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

elemental harmony


git-svn-id: http://svn.net-core.org/repos/t-engine4@3377 51575b47-30f0-44d4-a5cc-537603b46e54
parent f0948cde
No related branches found
No related tags found
No related merge requests found
......@@ -52,6 +52,7 @@ newBirthDescriptor{
stats = { wil=5, cun=3, dex=1, },
talents_types = {
["wild-gift/call"]={true, 0.2},
["wild-gift/harmony"]={true, 0.1},
["wild-gift/summon-melee"]={true, 0.3},
["wild-gift/summon-distance"]={true, 0.3},
["wild-gift/summon-utility"]={true, 0.3},
......
......@@ -156,6 +156,12 @@ setDefaultProjector(function(src, x, y, type, dam, tmp, no_martyr)
t.doMadness(target, t, src)
end
if not target.dead and dam > 0 and target:attr("elemental_harmony") and not target:hasEffect(target.EFF_ELEMENTAL_HARMONY) then
if type == DamageType.FIRE or type == DamageType.COLD or type == DamageType.LIGHTNING or type == DamageType.ACID or type == DamageType.NATURE then
target:setEffect(target.EFF_ELEMENTAL_HARMONY, 5 + math.ceil(target:attr("elemental_harmony")), {power=target:attr("elemental_harmony"), type=type})
end
end
return dam
end
return 0
......
......@@ -62,28 +62,34 @@ newTalent{
name = "Elemental Harmony",
type = {"wild-gift/harmony", 2},
require = gifts_req2,
random_ego = "defensive",
points = 5,
equilibrium = 10,
cooldown = 20,
range = 1,
requires_target = true,
no_npc_use = true,
action = function(self, t)
local tg = {default_target=self, type="hit", nowarning=true, range=self:getTalentRange(t), first_target="friend"}
local x, y, target = self:getTarget(tg)
if not x or not y or not target then return nil end
if math.floor(core.fov.distance(self.x, self.y, x, y)) > 1 then return nil end
if not target.undead then
target:heal(20 + self:getWil(50) * self:getTalentLevel(t))
end
game:playSoundNear(self, "talents/heal")
mode = "sustained",
equilibrium = 20,
cooldown = 30,
activate = function(self, t)
return {
tmpid = self:addTemporaryValue("elemental_harmony", self:getTalentLevel(t)),
}
end,
deactivate = function(self, t, p)
self:removeTemporaryValue("elemental_harmony", p.tmpid)
return true
end,
info = function(self, t)
return ([[Touch a target (or yourself) to infuse it with Nature, healing it for %d(heal does not work on undead).
Heal will increase with your Willpower stat.]]):
format(20 + self:getWil(50) * self:getTalentLevel(t))
local power = self:getTalentLevel(t)
local turns = 5 + math.ceil(power)
local fire = 100 * (0.1 + power / 11)
local cold = 3 + power * 2
local lightning = math.floor(power)
local acid = 5 + power * 2
local nature = 5 + power * 1.4
return ([[Befriend the natural elements that constitute nature. Each time you are hit by one of the elements you gain a special effect for %d turns. This can only happen every %d turns.
Fire: +%d%% global speed
Cold: +%d armour
Lightning: +%d to all stats
Acid: +%0.2f life regen
Nature: +%d%% to all resists]]):
format(turns, turns, fire, cold, lightning, acid, nature)
end,
}
......
......@@ -3948,3 +3948,53 @@ newEffect{
self:removeTemporaryValue("purify_disease", eff.diseid)
end,
}
newEffect{
name = "ELEMENTAL_HARMONY",
desc = "Elemental Harmony",
long_desc = function(self, eff)
if eff.type == DamageType.FIRE then return ("Increases global speed by %d%%."):format(100 * (0.1 + eff.power / 11))
elseif eff.type == DamageType.COLD then return ("Increases armour by %d."):format(3 + eff.power *2)
elseif eff.type == DamageType.LIGHTNING then return ("Increases all stats by %d."):format(math.floor(eff.power))
elseif eff.type == DamageType.ACID then return ("Increases life regen by %0.2f%%."):format(5 + eff.power * 2)
elseif eff.type == DamageType.NATURE then return ("Increases all resists by %d%%."):format(5 + eff.power * 1.4)
end
end,
type = "physical",
status = "beneficial",
parameters = { },
activate = function(self, eff)
if eff.type == DamageType.FIRE then
eff.tmpid = self:addTemporaryValue("global_speed", 0.1 + eff.power / 11)
elseif eff.type == DamageType.COLD then
eff.tmpid = self:addTemporaryValue("combat_armor", 3 + eff.power * 2)
elseif eff.type == DamageType.LIGHTNING then
eff.tmpid = self:addTemporaryValue("inc_stats",
{
[Stats.STAT_STR] = math.floor(eff.power),
[Stats.STAT_DEX] = math.floor(eff.power),
[Stats.STAT_MAG] = math.floor(eff.power),
[Stats.STAT_WIL] = math.floor(eff.power),
[Stats.STAT_CUN] = math.floor(eff.power),
[Stats.STAT_CON] = math.floor(eff.power),
})
elseif eff.type == DamageType.ACID then
eff.tmpid = self:addTemporaryValue("life_regen", 5 + eff.power * 2)
elseif eff.type == DamageType.NATURE then
eff.tmpid = self:addTemporaryValue("resists", {all=5 + eff.power * 1.4})
end
end,
deactivate = function(self, eff)
if eff.type == DamageType.FIRE then
self:removeTemporaryValue("global_speed", eff.tmpid)
elseif eff.type == DamageType.COLD then
self:removeTemporaryValue("combat_armor", eff.tmpid)
elseif eff.type == DamageType.LIGHTNING then
self:removeTemporaryValue("inc_stats", eff.tmpid)
elseif eff.type == DamageType.ACID then
self:removeTemporaryValue("life_regen", eff.tmpid)
elseif eff.type == DamageType.NATURE then
self:removeTemporaryValue("resists", eff.tmpid)
end
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