116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
|
sorcery.vfx.imbue = function(color, target, strength, height)
local tpos if target.get_pos then
tpos = target:get_pos()
if target.get_properties then
height = height or ((target:get_properties().eye_height or 1)*1.3)
end
else
tpos = target
end
height = height or 1
local scenter = vector.add(tpos, {x=0,y=height/2,z=0})
for i=1,math.random(64*(strength or 1),128*(strength or 1)) do
local high = (height+0.8)*math.random() - 0.8
local far = (high >= -0.5 and high <= height) and
(math.random() * 0.3 + 0.4) or
(math.random() * 0.5)
local yaw = {x=0, y = math.random()*(2*math.pi), z=0}
local po = vector.rotate({x=far,y=high,z=0}, yaw)
local ppos = vector.add(po,tpos)
|
|
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
|
sorcery.vfx.imbue = function(color, target, strength, height)
local tpos if target.get_pos then
tpos = target:get_pos()
if target.get_properties then
height = height or ((target:get_properties().eye_height or 1)*1.3)
end
else
tpos = vector.offset(target, 0,0.5,0)
end
height = height or 1
local scenter = vector.add(tpos, {x=0,y=height/2,z=0})
for i=1,math.random(24*(strength or 1),32*(strength or 1)) do
local high = (height+0.8)*math.random() - 0.8
local far = (high >= -0.5 and high <= height) and
(math.random() * 0.3 + 0.4) or
(math.random() * 0.5)
local yaw = {x=0, y = math.random()*(2*math.pi), z=0}
local po = vector.rotate({x=far,y=high,z=0}, yaw)
local ppos = vector.add(po,tpos)
|