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

wings of wind

thunderstorm !


git-svn-id: http://svn.net-core.org/repos/t-engine4@265 51575b47-30f0-44d4-a5cc-537603b46e54
parent 2ddad424
No related branches found
No related tags found
No related merge requests found
......@@ -297,3 +297,8 @@ function rng.mbonus(max, level, max_level)
return val
end
function rng.table(t)
local id = rng.range(1, #t)
return t[id], id
end
......@@ -86,6 +86,12 @@ function _M:act()
-- Compute timed effects
self:timedEffects()
-- Handle thunderstorm, even if the actor is stunned or incampacited it still works
if self:isTalentActive(self.T_THUNDERSTORM) then
local t = self:getTalentFromId(self.T_THUNDERSTORM)
t.do_storm(self, t)
end
-- Still enough energy to act ?
if self.energy.value < game.energy_to_act then return false end
......
......@@ -56,3 +56,79 @@ newTalent{
The damage and duration will increase with the Magic stat]]):format(4 + self:combatSpellpower(0.11) * self:getTalentLevel(t), self:getTalentLevel(t))
end,
}
newTalent{
name = "Wings of Wind",
type = {"spell/air",3},
require = spells_req3,
points = 5,
mode = "sustained",
sustain_mana = 100,
tactical = {
MOVEMENT = 10,
},
activate = function(self, t)
return {
fly = self:addTemporaryValue("fly", math.floor(self:getTalentLevel(t))),
}
end,
deactivate = function(self, t, p)
self:removeTemporaryValue("fly", p.fly)
return true
end,
info = function(self, t)
return ([[Grants the caster a pair of wings made of pure wind, allowing her to fly up to %d height.]]):
format(math.floor(self:getTalentLevel(t)))
end,
}
newTalent{
name = "Thunderstorm",
type = {"spell/air", 4},
require = spells_req4,
points = 5,
mode = "sustained",
sustain_mana = 250,
cooldown = 15,
tactical = {
ATTACKAREA = 10,
},
range = 5,
do_storm = function(self, t)
local tgts = {}
local grids = core.fov.circle_grids(self.x, self.y, 5, true)
for x, yy in pairs(grids) do for y, _ in pairs(grids[x]) do
local a = game.level.map(x, y, Map.ACTOR)
if a and self:reactionToward(a) < 0 then
tgts[#tgts+1] = a
end
end end
-- Randomly take targets
local tg = {type="hit", range=self:getTalentRange(t)}
for i = 1, math.floor(self:getTalentLevel(t)) do
if #tgts <= 0 then break end
local a, id = rng.table(tgts)
table.remove(tgts, id)
self:project(tg, a.x, a.y, DamageType.LIGHTNING, rng.avg(1, self:spellCrit(20 + self:combatSpellpower(0.8) * self:getTalentLevel(t)), 3), {type="lightning"})
end
end,
activate = function(self, t)
game.logSeen(self, "#0080FF#A furious lightning storm forms around %s!", self.name)
return {
drain = self:addTemporaryValue("mana_regen", -2),
}
end,
deactivate = function(self, t, p)
game.logSeen(self, "#0080FF#A furious lightning storm forms around %s!", self.name)
self:removeTemporaryValue("mana_regen", p.drain)
return true
end,
info = function(self, t)
return ([[Conjures a furious raging lightning storm with a radius of 5 that follows you as long as this spell is active.
Each turn a random lightning bolt will hit up to %d of your foes for 1 to %0.2f damage.
This powerfull spell will continuously drain mana while active.
The damage will increase with the Magic stat]]):format(self:getTalentLevel(t), 20 + self:combatSpellpower(0.8) * self:getTalentLevel(t))
end,
}
......@@ -63,7 +63,7 @@ newTalent{
local power = 4 + self:combatSpellpower(0.1) * self:getTalentLevel(t)
return {
invisible = self:addTemporaryValue("invisible", power),
drain = self:addTemporaryValue("mana_regen", 5),
drain = self:addTemporaryValue("mana_regen", -5),
}
end,
deactivate = function(self, t, p)
......
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