Skip to content
Snippets Groups Projects
Commit 9e106328 authored by Ryan Yappert's avatar Ryan Yappert
Browse files

MR for my TK Weapon Sprite addon. Adds a particle effect for TK wielded items...

MR for my TK Weapon Sprite addon. Adds a particle effect for TK wielded items that shows it floating behind the actor.
parent 0f35340e
No related branches found
No related tags found
No related merge requests found
......@@ -4260,6 +4260,28 @@ function _M:updateModdableTilePrepare()
end
return false
end
if self.tk_weapon_particle then
self:removeParticles(self.tk_weapon_particle)
self.tk_weapon_particle = nil
end
local i = self:getInven(self.INVEN_PSIONIC_FOCUS)
if i and i[1] and i[1].image then
local s = 17
if i[1].twohanded then
s = 21
if i[1].subtype == "staff" then
s = 24
end
elseif i[1].subtype == "dagger" then
s = 14
elseif i[1].type == "gem" or i[1].subtype == "mindstar" then
s = 11
end
self.tk_weapon_particle = self:addParticles(Particles.new("tk_rotating_weapon", 1, {img=i[1].image:sub(0,-5), toback=true, scale=s}))
end
self:removeAllMOs()
return true
end
......
-- ToME - Tales of Maj'Eyal
-- Copyright (C) 2009 - 2019 Nicolas Casalini
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- Nicolas Casalini "DarkGod"
-- darkgod@te4.org
base_size = 32
if core.shader.active(4) then
use_shader = {type="shadow_simulacrum", color = {0.8, 0.8, 0.8}, base = 0.8, time_factor = 4000 }
end
local ad = rng.range(0, 360)
local a = math.rad(ad)
local dir = math.rad(ad + 90)
local r = 14
local speed = 90
local dirv = math.pi * 2 / speed
local vel = math.pi * 2 * r / speed
local first = true
return {
system_rotation = base_rot or rng.range(0, 360), system_rotationv = -5*dirv,
generator = function()
local dr = rng.range(0, 2)
local da = math.rad(rng.range(0, 360))
return {
life = core.particles.ETERNAL,
size = scale, sizev = 0, sizea = 0,
x = r * math.cos(a) + dr * math.cos(da), xv = 0, xa = 0,
y = r * math.sin(a) + dr * math.cos(da), yv = 0, ya = 0,
dir = dir, dirv = dirv, dira = 0,
vel = vel, velv = 0, vela = 0,
r = rng.range(220, 255)/255, rv = 0, ra = 0,
g = rng.range(220, 255)/255, gv = 0, ga = 0,
b = rng.range(220, 255)/255, gv = 0, ga = 0,
a = rng.range(230, 225)/255, av = 0, aa = 0,
}
end, },
function(self)
if first then self.ps:emit(10) first = false end
end,
1, "shockbolt/"..img
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment