Skip to content
Snippets Groups Projects
Commit 70f0e850 authored by dg's avatar dg
Browse files

more particle shields

git-svn-id: http://svn.net-core.org/repos/t-engine4@690 51575b47-30f0-44d4-a5cc-537603b46e54
parent 2f3fdd03
No related branches found
No related tags found
No related merge requests found
Showing
with 113 additions and 12 deletions
......@@ -52,7 +52,7 @@ function _M:loaded()
local odef = self.def
print("[PARTICLE] Loading from /data/gfx/particles/"..self.def..".lua")
local f = loadfile("/data/gfx/particles/"..self.def..".lua")
setfenv(f, setmetatable(args or {}, {__index=_G}))
setfenv(f, setmetatable(self.args or {}, {__index=_G}))
def, fct, max = f()
max = max or 1000
_M.particles_def[odef] = f
......
......@@ -22,6 +22,7 @@ return { generator = function()
local a = math.rad(ad)
local dir = math.rad(ad + 90)
local r = rng.range(14, 18)
local dirv = math.rad(2)
return {
trail = 1,
......@@ -30,7 +31,7 @@ return { generator = function()
x = r * math.cos(a), xv = -0.1, xa = 0,
y = r * math.sin(a), yv = -0.1, ya = 0,
dir = dir, dirv = 1, dira = 0,
dir = dir, dirv = dirv, dira = 0,
vel = 1, velv = 0, vela = 0,
r = rng.range(100, 220)/255, rv = rng.range(0, 10), ra = 0,
......
......@@ -22,6 +22,7 @@ return { generator = function()
local a = math.rad(ad)
local dir = math.rad(ad + 90)
local r = rng.range(12, 20)
local dirv = math.rad(0.4)
return {
trail = 1,
......@@ -30,7 +31,7 @@ return { generator = function()
x = r * math.cos(a), xv = -0.1, xa = 0,
y = r * math.sin(a), yv = -0.1, ya = 0,
dir = dir, dirv = 1, dira = 0,
dir = dir, dirv = dirv, dira = 0,
vel = 1, velv = 0, vela = 0,
r = rng.range(10, 220)/255, rv = rng.range(0, 10), ra = 0,
......
......@@ -36,7 +36,7 @@ return { generator = function()
r = rng.range(130, 220)/255, rv = rng.range(0, 10), ra = 0,
g = 0, gv = 0, ga = 0,
b = rng.range(170, 255)/255, bv = rng.range(0, 10), ba = 0,
a = 1, av = 0, aa = 0,
a = rng.range(70, 255)/255, av = 0, aa = 0,
}
end, },
function(self)
......
-- ToME - Tales of Middle-Earth
-- Copyright (C) 2009, 2010 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
return { generator = function()
local ad = rng.range(0, 360)
local a = math.rad(ad)
local dir = math.rad(ad + 90)
local r = rng.range(11, 14)
return {
trail = 1,
life = 5,
size = 4, sizev = 0, sizea = 0,
x = r * math.cos(a), xv = 0, xa = 0,
y = r * math.sin(a), yv = 0, ya = 0,
dir = dir, dirv = math.rad(0.7), dira = 0,
vel = 0.5, velv = 0, vela = 0,
r = 127/255, rv = 0, ra = 0,
g = 255/255, gv = 0, ga = 0,
b = 212/255, bv = 0, ba = 0,
a = rng.range(100, 220)/255, av = 0.05, aa = 0,
}
end, },
function(self)
self.ps:emit(1)
end,
15
-- ToME - Tales of Middle-Earth
-- Copyright (C) 2009, 2010 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
density = density or 1
return { generator = function()
local ad = rng.range(0, 360)
local a = math.rad(ad)
local dir = math.rad(ad + 90)
local r = rng.range(11, 14)
return {
trail = 1,
life = 5,
size = 4, sizev = 0, sizea = 0,
x = r * math.cos(a), xv = 0, xa = 0,
y = r * math.sin(a), yv = 0, ya = 0,
dir = dir, dirv = math.rad(6), dira = 0,
vel = 2, velv = 0, vela = 0,
r = 0xD7/255, rv = 0, ra = 0,
g = 0x8E/255, gv = 0, ga = 0,
b = 0x45/255, bv = 0, ba = 0,
a = rng.range(100, 220)/255, av = 0.05, aa = 0,
}
end, },
function(self)
self.ps:emit(1 * density)
end,
15 * density
......@@ -25,12 +25,12 @@ return { generator = function()
return {
trail = 1,
life = 20,
size = 2, sizev = 0.2, sizea = 0,
life = 30,
size = 2, sizev = 0.08, sizea = 0,
x = r * math.cos(a), xv = 0, xa = 0,
y = r * math.sin(a), yv = 0, ya = 0,
dir = dir, dirv = 0, dira = 0,
dir = dir, dirv = math.rad(3), dira = math.rad(3) / 3,
vel = 1, velv = 0, vela = 0,
r = rng.range(10, 220)/255, rv = rng.range(0, 10), ra = 0,
......@@ -40,6 +40,6 @@ return { generator = function()
}
end, },
function(self)
self.ps:emit(10)
self.ps:emit(5)
end,
100
150
......@@ -22,6 +22,7 @@ return { generator = function()
local a = math.rad(ad)
local dir = math.rad(ad + 90)
local r = rng.range(12, 20)
local dirv = math.rad(1)
return {
trail = 1,
......@@ -30,7 +31,7 @@ return { generator = function()
x = r * math.cos(a), xv = -0.1, xa = 0,
y = r * math.sin(a), yv = -0.1, ya = 0,
dir = dir, dirv = 1, dira = 0,
dir = dir, dirv = dirv, dira = 0,
vel = 1, velv = 0, vela = 0,
r = rng.range(10, 220)/255, rv = rng.range(0, 10), ra = 0,
......
......@@ -99,10 +99,9 @@ newTalent{
local power = math.max(0.8, 3 - (self:combatSpellpower(1) * self:getTalentLevel(t)) / 280)
self.disruption_shield_absorb = 0
game:playSoundNear(self, "talents/arcane")
local ps = self:addParticles(Particles.new("disruption_shield", 1))
return {
shield = self:addTemporaryValue("disruption_shield", power),
particle = ps,
particle = self:addParticles(Particles.new("disruption_shield", 1)),
}
end,
deactivate = function(self, t, p)
......
......@@ -35,9 +35,11 @@ newTalent{
local power = 4 + self:combatSpellpower(0.03) * self:getTalentLevel(t)
return {
armor = self:addTemporaryValue("combat_armor", power),
particle = self:addParticles(Particles.new("stone_skin", 1)),
}
end,
deactivate = function(self, t, p)
self:removeParticles(p.particle)
self:removeTemporaryValue("combat_armor", p.armor)
return true
end,
......
......@@ -56,10 +56,12 @@ newTalent{
local power = 4 + self:combatSpellpower(0.04) * self:getTalentLevel(t)
game:playSoundNear(self, "talents/heal")
return {
particle = self:addParticles(Particles.new("phantasm_shield", 1)),
def = self:addTemporaryValue("combat_def", power),
}
end,
deactivate = function(self, t, p)
self:removeParticles(p.particle)
self:removeTemporaryValue("combat_def", p.def)
return true
end,
......@@ -84,10 +86,12 @@ newTalent{
local power = 10 + self:combatSpellpower(0.06) * self:getTalentLevel(t)
game:playSoundNear(self, "talents/heal")
return {
particle = self:addParticles(Particles.new("phantasm_shield", 1)),
onhit = self:addTemporaryValue("on_melee_hit", {[DamageType.ARCANE]=power}),
}
end,
deactivate = function(self, t, p)
self:removeParticles(p.particle)
self:removeTemporaryValue("on_melee_hit", p.onhit)
return true
end,
......
......@@ -195,9 +195,11 @@ newEffect{
on_gain = function(self, err) return "#Target# hardens its skin.", "+Earthen barrier" end,
on_lose = function(self, err) return "#Target# skin returns to normal.", "-Earthen barrier" end,
activate = function(self, eff)
eff.particle = self:addParticles(Particles.new("stone_skin", 1, {density=4}))
eff.tmpid = self:addTemporaryValue("resists", {[DamageType.PHYSICAL]=eff.power})
end,
deactivate = function(self, eff)
self:removeParticles(eff.particle)
self:removeTemporaryValue("resists", eff.tmpid)
end,
}
......
No preview for this file type
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