Skip to content
Snippets Groups Projects
Commit 695b4da5 authored by DarkGod's avatar DarkGod
Browse files

wings wings wings !

parent 05ab6181
No related branches found
No related tags found
No related merge requests found
Showing
with 97 additions and 32 deletions
......@@ -329,9 +329,17 @@ function _M:makeMapObject(tiles, idx)
if shad.shad then self._mo:shader(shad.shad) end
end
self._mo, self.z, last_mo = self:alterMakeMapObject(tiles, self._mo, self.z, last_mo)
return self._mo, self.z, last_mo
end
--- Allows to alter the generated map objects
-- Does nothing by default
function _M:alterMakeMapObject(tiles, mo, z, last_mo)
return mo, z, last_mo
end
--- Get all "map objects" representing this entity
-- Do not touch unless you *KNOW* what you are doing.<br/>
-- You do *NOT* need this, this is used by the engine.Map class automatically.<br/>
......
......@@ -836,19 +836,14 @@ function _M:setupMinimapInfo(mo, map)
end
end
function _M:makeMapObject(tiles, idx)
local mo, z, lastmo = Actor.makeMapObject(self, tiles, idx)
if mo and mo:isValid() then return mo, z, lasmo end
if idx == 1 and mo then
local submo = core.map.newObject(self.uid, 1, self:check("display_on_seen"), self:check("display_on_remember"), self:check("display_on_unknown"), self:check("display_x") or 0, self:check("display_y") or 0, self:check("display_w") or 1, self:check("display_h") or 1, self:check("display_scale") or 1)
local tex, texx, texy, pos_x, pos_y = tiles:get("", 0, 0, 0, 0, 0, 0, "invis.png", false, false, true)
submo:texture(0, tex, false, texx, texy, pos_x, pos_y)
submo:chain(mo)
if lastmo == mo then lastmo = submo end
mo = submo
self._mo = mo
end
function _M:alterMakeMapObject(tiles, mo, z, lastmo)
local submo = core.map.newObject(self.uid, 1, self:check("display_on_seen"), self:check("display_on_remember"), self:check("display_on_unknown"), self:check("display_x") or 0, self:check("display_y") or 0, self:check("display_w") or 1, self:check("display_h") or 1, self:check("display_scale") or 1)
local tex, texx, texy, pos_x, pos_y = tiles:get("", 0, 0, 0, 0, 0, 0, "invis.png", false, false, true)
submo:texture(0, tex, false, texx, texy, pos_x, pos_y)
submo:chain(mo)
if lastmo == mo then lastmo = submo end
mo = submo
self._mo = mo
return mo, z, lastmo
end
......
......@@ -17,33 +17,38 @@
-- Nicolas Casalini "DarkGod"
-- darkgod@te4.org
use_shader = {type="flamewings"}
use_shader = {type="flamewings", deploy_factor=deploy_speed, flap=flap}
base_size = 32
local r = 1
local g = 1
local b = 1
local a = 1
local a = a or 1
local infinite = infinite
local nb = 0
return { generator = function()
return {
trail = 0,
life = 10,
life = life or 10,
size = 64 * (size_factor or 1), sizev = 0, sizea = 0,
x = 0, xv = 0, xa = 0,
y = -20, yv = 0, ya = 0,
y = -25, yv = 0, ya = 0,
dir = 0, dirv = dirv, dira = 0,
vel = 0, velv = 0, vela = 0,
r = r, rv = 0, ra = 0,
g = g, gv = 0, ga = 0,
b = b, bv = 0, ba = 0,
a = a, av = -0.02, aa = 0.005,
a = a, av = 0, aa = fade or 0,
}
end, },
function(self)
self.ps:emit(1)
if nb == 0 or infinite then
self.ps:emit(1)
nb = 1
end
end,
1,
"particles_images/"..(img or "wings")
game/modules/tome/data/gfx/particles_images/bloodwings.png

14 KiB

game/modules/tome/data/gfx/particles_images/darkwings.png

8.96 KiB

game/modules/tome/data/gfx/particles_images/sickwings.png

9.21 KiB

......@@ -4,6 +4,8 @@ uniform float aadjust;
uniform vec3 color;
uniform float time_factor;
uniform float tick_start;
uniform float deploy_factor;
uniform float flap;
uniform float ellipsoidalFactor = 1.7; //1 is perfect circle, >1 is ellipsoidal
uniform float oscillationSpeed = 0.0; //oscillation between ellipsoidal and spherical form
......@@ -148,8 +150,8 @@ void main(void)
pos.x = 0.5 + (pos.x - 0.5) * ellipsoidalFactor;
pos = vec2(0.5, 0.5) + (pos - vec2(0.5, 0.5)) * 1.1;
float foldRatio = max(0.0, min(1.0, (tick - tick_start) / time_factor * 5.0));
//foldRatio = (1.0 + sin(tick / time_factor * 20.0)) * 0.5;
float foldRatio = max(0.0, min(1.0, (tick - tick_start) / time_factor * deploy_factor));
if (flap > 0.0) foldRatio = (1.0 + sin(tick / time_factor * flap)) * 0.5;
foldRatio *= 0.95 + 0.05 * sin(tick / time_factor * 15.0);
float radius = 0.25 * (foldRatio * 0.5 + 0.5);
......@@ -199,5 +201,5 @@ void main(void)
gl_FragColor.a *= min(1.0, max(0.0, (1.0 - planarPoint.x) * antialiasingCoef));
//gl_FragColor.a *= min(1.0, max(0.0, (1.0 - planarPoint.y) * antialiasingCoef));
}
gl_FragColor.a *= 1.0 - pow(1.0 - foldRatio, 3.0);
gl_FragColor.a *= (1.0 - pow(1.0 - foldRatio, 3.0)) * gl_Color.a;
}
......@@ -22,10 +22,11 @@ return {
vert = nil,
args = {
tex = { texture = 0 },
time_factor = 6000,
ellipsoidalFactor = 1.7, --1 is perfect circle, >1 is ellipsoidal
oscillationSpeed = 0.0, --oscillation between ellipsoidal and spherical form
growRatio = 1.0,
time_factor = time_factor or 6000,
deploy_factor = deploy_factor or 5,
ellipsoidalFactor = ellipsoidalFactor or 1.7, --1 is perfect circle, >1 is ellipsoidal
oscillationSpeed = oscillationSpeed or 0.0, --oscillation between ellipsoidal and spherical form
flap = flap or 0.0,
},
resetargs = {
tick_start = function() return core.game.getTime() end,
......
......@@ -25,7 +25,7 @@ return {
mainfbo = { texture = 1 },
color = color or {0.4, 0.7, 1.0},
time_factor = time_factor or 25000,
aadjust = aadjust or 10,
aadjust = aadjust or 5,
ellipsoidalFactor = 1.5,
oscillationSpeed = 20.0,
antialiasingRadius = 0.6,
......
......@@ -223,10 +223,17 @@ newTalent{
level.allow_demon_plane_damage = true
end)
local particle
if core.shader.active(4) then
local p = Particles.new("shader_wings", 1, {infinite=1, img="bloodwings", flap=28, a=0.6})
p.toback = true
particle = self:addParticles(p)
end
local ret = {
vim = self:addTemporaryValue("vim_regen", -5),
target = target,
x = self.x, y = self.y,
particle = particle,
}
return ret
end,
......@@ -234,6 +241,7 @@ newTalent{
-- If we're a clone of the original fearscapper, just deactivate
if not self.on_die then return true end
if p.particle then self:removeParticles(p.particle) end
self:removeTemporaryValue("vim_regen", p.vim)
game:onTickEnd(function()
......
......@@ -172,6 +172,12 @@ newTalent{
self:project(tg, x, y, DamageType.ICE, self:mindCrit(self:combatTalentStatDamage(t, "str", 30, 430)))
game.level.map:particleEmitter(self.x, self.y, tg.radius, "breath_cold", {radius=tg.radius, tx=x-self.x, ty=y-self.y})
game:playSoundNear(self, "talents/breath")
if core.shader.active(4) then
local p = Particles.new("shader_wings", 1, {life=18, fade=-0.003, deploy_speed=14})
p.toback = true
self:addParticles(p)
end
return true
end,
info = function(self, t)
......
......@@ -79,6 +79,12 @@ newTalent{
if not x or not y then return nil end
self:project(tg, x, y, DamageType.PHYSKNOCKBACK, {dam=self:mindCrit(self:combatTalentStatDamage(t, "str", 15, 90)), dist=4})
game:playSoundNear(self, "talents/breath")
if core.shader.active(4) then
local p = Particles.new("shader_wings", 1, {life=18, fade=-0.003, deploy_speed=14})
p.toback = true
self:addParticles(p)
end
return true
end,
info = function(self, t)
......@@ -165,6 +171,12 @@ newTalent{
if not x or not y then return nil end
self:project(tg, x, y, DamageType.FIREBURN, {dam=self:mindCrit(self:combatTalentStatDamage(t, "str", 30, 550)), dur=3, initial=70})
game.level.map:particleEmitter(self.x, self.y, tg.radius, "breath_fire", {radius=tg.radius, tx=x-self.x, ty=y-self.y})
if core.shader.active(4) then
local p = Particles.new("shader_wings", 1, {life=18, fade=-0.003, deploy_speed=14})
p.toback = true
self:addParticles(p)
end
game:playSoundNear(self, "talents/breath")
return true
end,
......
......@@ -121,6 +121,12 @@ newTalent{
self:project(tg, x, y, DamageType.INSIDIOUS_POISON, {dam=self:mindCrit(t.getDamage(self,t)), dur=6, heal_factor=t.getEffect(self,t)})
game.level.map:particleEmitter(self.x, self.y, tg.radius, "breath_slime", {radius=tg.radius, tx=x-self.x, ty=y-self.y})
game:playSoundNear(self, "talents/breath")
if core.shader.active(4) then
local p = Particles.new("shader_wings", 1, {life=18, fade=-0.003, deploy_speed=14})
p.toback = true
self:addParticles(p)
end
return true
end,
info = function(self, t)
......
......@@ -157,6 +157,12 @@ newTalent{
self:project(tg, x, y, DamageType.SAND, {dur=t.getDuration(self, t), dam=self:mindCrit(t.getDamage(self, t))})
game.level.map:particleEmitter(self.x, self.y, tg.radius, "breath_earth", {radius=tg.radius, tx=x-self.x, ty=y-self.y})
game:playSoundNear(self, "talents/breath")
if core.shader.active(4) then
local p = Particles.new("shader_wings", 1, {life=18, fade=-0.003, deploy_speed=14})
p.toback = true
self:addParticles(p)
end
return true
end,
info = function(self, t)
......
......@@ -210,6 +210,12 @@ newTalent{
else game.level.map:particleEmitter(self.x, self.y, tg.radius, "breath_lightning", {radius=tg.radius, tx=x-self.x, ty=y-self.y})
end
if core.shader.active(4) then
local p = Particles.new("shader_wings", 1, {img="lightningwings",infinite=1, life=18, fade=0*-0.003, deploy_speed=14})
p.toback = true
self:addParticles(p)
end
game:playSoundNear(self, "talents/breath")
return true
end,
......
......@@ -182,6 +182,12 @@ newTalent{
self:project(tg, x, y, DamageType.ACID_DISARM, self:mindCrit(self:combatTalentStatDamage(t, "str", 30, 420)))
game.level.map:particleEmitter(self.x, self.y, tg.radius, "breath_acid", {radius=tg.radius, tx=x-self.x, ty=y-self.y})
game:playSoundNear(self, "talents/breath")
if core.shader.active(4) then
local p = Particles.new("shader_wings", 1, {life=18, fade=-0.003, deploy_speed=14})
p.toback = true
self:addParticles(p)
end
return true
end,
info = function(self, t)
......
......@@ -274,9 +274,7 @@ newTalent{
local tg = {type="ball", nolock=true, pass_terrain=false, nowarning=true, friendly_fire=true, default_target=self, range=range, radius=radius, talent=t}
local x, y = self:getTarget(tg)
print("====1")
if not x or not y then return nil end
print("====2")
local _ _, _, _, x, y = self:canProject(tg, x, y)
-- get locations in line of movement from center
......@@ -298,7 +296,6 @@ newTalent{
end end
darkCount = math.min(darkCount, #locations)
print("====3", darkCount)
if darkCount == 0 then return false end
for i = 1, darkCount do
......@@ -332,13 +329,21 @@ newTalent{
activate = function(self, t)
local chance, val = t.getParams(self, t)
game:playSoundNear(self, "talents/spell_generic2")
local particle
if core.shader.active(4) then
local p = Particles.new("shader_wings", 1, {infinite=1, img="darkwings"})
p.toback = true
particle = self:addParticles(p)
end
local ret = {
chance = self:addTemporaryValue("life_leech_chance", chance),
val = self:addTemporaryValue("life_leech_value", val),
particle = particle,
}
return ret
end,
deactivate = function(self, t, p)
if p.particle then self:removeParticles(p.particle) end
self:removeTemporaryValue("life_leech_chance", p.chance)
self:removeTemporaryValue("life_leech_value", p.val)
return true
......
......@@ -124,10 +124,9 @@ newTalent{
local particle
if core.shader.active(4) then
local p = Particles.new("shader_wings", 1)
local p = Particles.new("shader_wings", 1, {infinite=1})
p.toback = true
particle = self:addParticles(p)
-- particle = self:addParticles(Particles.new("shader_ring_rotating", 1, {radius=1.1}, {type="flames", hide_center=0, xy={self.x, self.y}}))
else
particle = self:addParticles(Particles.new("wildfire", 1))
end
......
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