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

New tree: Cunning / Poisons

Rogues might want to try siding with the assassin lord


git-svn-id: http://svn.net-core.org/repos/t-engine4@3387 51575b47-30f0-44d4-a5cc-537603b46e54
parent 8f75361d
No related branches found
No related tags found
No related merge requests found
Showing with 532 additions and 10 deletions
......@@ -1376,6 +1376,11 @@ function _M:die(src)
t.on_kill(src, t, self)
end
if src and src.knowTalent and src:knowTalent(src.T_TOXIC_DEATH) then
local t = src:getTalentFromId(src.T_TOXIC_DEATH)
t.on_kill(src, t, self)
end
if src and src.hasEffect and src:hasEffect(self.EFF_UNSTOPPABLE) then
local p = src:hasEffect(self.EFF_UNSTOPPABLE)
p.kills = p.kills + 1
......@@ -1966,6 +1971,15 @@ function _M:preUseTalent(ab, silent, fake)
end
end
-- Failure chance?
if self:attr("talent_fail_chance") and ab.no_energy ~= true and not fake and not self:attr("force_talent_ignore_ressources") then
if rng.percent(self:attr("talent_fail_chance")) then
if not silent then game.logSeen(self, "%s fails to use %s.", self.name:capitalize(), ab.name) end
self:useEnergy()
return false
end
end
-- Special checks
if ab.on_pre_use and not ab.on_pre_use(self, ab, silent, fake) then return false end
......
......@@ -1423,6 +1423,8 @@ function _M:countBirthUnlocks()
mage_pyromancer = true,
mage_cryomancer = true,
rogue_poisons = true,
divine_anorithil = true,
divine_sun_paladin = true,
......
......@@ -397,6 +397,15 @@ function _M:attackTargetWith(target, weapon, damtype, mult)
weapon.special_on_hit.fct(weapon, self, target)
end
-- Poison coating
if hitted and not target.dead and self.vile_poisons and next(self.vile_poisons) and rng.percent(20 + self:getTalentLevel(self.T_VILE_POISONS) * 5) and target:canBe("poison") then
local tid = rng.table(table.keys(self.vile_poisons))
if tid then
local t = self:getTalentFromId(tid)
t.proc(self, t, target, weapon)
end
end
-- Regen on being hit
if hitted and not target.dead and target:attr("stamina_regen_on_hit") then target:incStamina(target.stamina_regen_on_hit) end
if hitted and not target.dead and target:attr("mana_regen_on_hit") then target:incMana(target.mana_regen_on_hit) end
......
......@@ -135,6 +135,11 @@ newAchievement{
show = "name",
desc = [[Rescued the merchant from the assassin lord.]],
}
newAchievement{
name = "Poisonous", id = "LOST_MERCHANT_EVIL",
show = "name",
desc = [[Sided with the assassin lord.]],
}
newAchievement{
name = "Destroyer of the creation", id = "SLASUL_DEAD",
show = "name",
......
......@@ -73,6 +73,11 @@ newBirthDescriptor{
[ActorTalents.T_LETHALITY] = 1,
[ActorTalents.T_DUAL_STRIKE] = 1,
},
copy = {
resolvers.generic(function(self)
if profile.mod.allow_build.rogue_poisons then self:learnTalentType("cunning/poisons", false) self:setTalentTypeMastery("cunning/poisons", 1.3) end
end),
},
}
newBirthDescriptor{
......
......@@ -17,6 +17,21 @@
-- Nicolas Casalini "DarkGod"
-- darkgod@te4.org
local function evil(npc, player)
engine.Faction:setFactionReaction(player.faction, npc.faction, 100, true)
player:setQuestStatus("lost-merchant", engine.Quest.COMPLETED, "evil")
player:setQuestStatus("lost-merchant", engine.Quest.COMPLETED)
world:gainAchievement("LOST_MERCHANT_EVIL", player)
game:setAllowedBuild("rogue_poisons", true)
local p = game.party:findMember{main=true}
if p.descriptor.subclass == "Rogue" then
if p:knowTalentType("cunning/poisons") == nil then
p:learnTalentType("cunning/poisons", false)
p:setTalentTypeMastery("cunning/poisons", 1.3)
end
end
end
newChat{ id="welcome",
text = [[#LIGHT_GREEN#*Before you stands a menacing man clothed in black.*#WHITE#
Ahh, the intruder at last... And what shall we do with you? Why did you kill my men?]],
......@@ -55,16 +70,8 @@ newChat{ id="offer",
You will have to do some dirty work for me, though, and you will be bound to me. Nevertheless, you may make quite a profit from this venture, if you are as good as you seem to be.
And do not think of crossing me. That would be... unwise.]],
answers = {
{"Well, I suppose it is better than dying.", action=function(npc, player)
engine.Faction:setFactionReaction(player.faction, npc.faction, 100, true)
player:setQuestStatus("lost-merchant", engine.Quest.COMPLETED, "evil")
player:setQuestStatus("lost-merchant", engine.Quest.COMPLETED)
end},
{"Money? I'm in!", action=function(npc, player)
engine.Faction:setFactionReaction(player.faction, npc.faction, 100, true)
player:setQuestStatus("lost-merchant", engine.Quest.COMPLETED, "evil")
player:setQuestStatus("lost-merchant", engine.Quest.COMPLETED)
end},
{"Well, I suppose it is better than dying.", action=evil},
{"Money? I'm in!", action=evil},
{"Just let me and the merchant get out of here and you may live!", action=function(npc, player) engine.Faction:setFactionReaction(player.faction, npc.faction, -100, true) end},
}
}
......
......@@ -130,6 +130,10 @@ setDefaultProjector(function(src, x, y, type, dam, tmp, no_martyr)
dam = dam * 0.3
print("[PROJECTOR] stunned dam", dam)
end
if src:attr("numbed") then
dam = dam - dam * src:attr("numbed") / 100
print("[PROJECTOR] numbed dam", dam)
end
print("[PROJECTOR] final dam", dam)
......
......@@ -22,6 +22,8 @@ newTalentType{ allow_random=true, type="cunning/stealth-base", name = "stealth",
newTalentType{ allow_random=true, type="cunning/stealth", name = "stealth", description = "Allows the user to enter stealth." }
newTalentType{ allow_random=true, type="cunning/trapping", name = "trapping", description = "The knowledge of trap laying and assorted trickeries." }
newTalentType{ allow_random=true, type="cunning/traps", name = "traps", description = "Collection of known traps." }
newTalentType{ allow_random=true, type="cunning/poisons", name = "poisons", description = "The knowledge of poisons and how to apply them to 'good' effects." }
newTalentType{ allow_random=true, type="cunning/poisons-effects", name = "poisons", description = "Collection of known poisons." }
newTalentType{ allow_random=true, type="cunning/dirty", name = "dirty fighting", description = "Teaches various talents to cripple your foes." }
newTalentType{ allow_random=true, type="cunning/lethality", name = "lethality", description = "How to make your foes feel the pain." }
newTalentType{ allow_random=true, type="cunning/shadow-magic", name = "shadow magic", description = "Blending magic and shadows." }
......@@ -49,9 +51,30 @@ cuns_req5 = {
stat = { cun=function(level) return 44 + (level-1) * 2 end },
level = function(level) return 16 + (level-1) end,
}
cuns_req_high1 = {
stat = { cun=function(level) return 22 + (level-1) * 2 end },
level = function(level) return 10 + (level-1) end,
}
cuns_req_high2 = {
stat = { cun=function(level) return 30 + (level-1) * 2 end },
level = function(level) return 14 + (level-1) end,
}
cuns_req_high3 = {
stat = { cun=function(level) return 38 + (level-1) * 2 end },
level = function(level) return 18 + (level-1) end,
}
cuns_req_high4 = {
stat = { cun=function(level) return 46 + (level-1) * 2 end },
level = function(level) return 22 + (level-1) end,
}
cuns_req_high5 = {
stat = { cun=function(level) return 54 + (level-1) * 2 end },
level = function(level) return 26 + (level-1) end,
}
load("/data/talents/cunning/stealth.lua")
load("/data/talents/cunning/traps.lua")
load("/data/talents/cunning/poisons.lua")
load("/data/talents/cunning/dirty.lua")
load("/data/talents/cunning/lethality.lua")
load("/data/talents/cunning/tactical.lua")
......
-- ToME - Tales of Maj'Eyal
-- Copyright (C) 2009, 2010, 2011 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
local Map = require "engine.Map"
----------------------------------------------------------------
-- Poisons
----------------------------------------------------------------
newTalent{
name = "Vile Poisons",
type = {"cunning/poisons", 1},
points = 5,
mode = "passive",
require = cuns_req_high1,
on_learn = function(self, t)
local lev = self:getTalentLevelRaw(t)
if lev == 1 then
self.vile_poisons = {}
self:learnTalent(self.T_DEADLY_POISON, true)
elseif lev == 2 then
self:learnTalent(self.T_NUMBING_POISON, true)
elseif lev == 3 then
self:learnTalent(self.T_INSIDIOUS_POISON, true)
elseif lev == 4 then
self:learnTalent(self.T_CRIPPLING_POISON, true)
elseif lev == 5 then
self:learnTalent(self.T_STONING_POISON, true)
end
end,
on_unlearn = function(self, t)
local lev = self:getTalentLevelRaw(t)
if lev == 0 then
self.vile_poisons = nil
self:unlearnTalent(self.T_DEADLY_POISON)
elseif lev == 1 then
self:unlearnTalent(self.T_NUMBING_POISON)
elseif lev == 2 then
self:unlearnTalent(self.T_INSIDIOUS_POISON)
elseif lev == 3 then
self:unlearnTalent(self.T_CRIPPLING_POISON)
elseif lev == 4 then
self:unlearnTalent(self.T_STONING_POISON)
end
end,
info = function(self, t)
return ([[Learn how to coat your weapons with poison. Each level you will learn a new kind of poison:
Level 1: Deadly Poison
Level 2: Numbing Poison
Level 3: Insidious Poison
Level 4: Crippling Poison
Level 5: Stoning Poison
New poisons can also be learned from special teachers in the world.
Also increases the effectiveness of your poisons by %d%%. (The effect varies for each poison).
Coating your weapons in poisons does not break stealth.
You may only have two poisons active at once.
Every time your hit a creature with your weapons you have %d%% chance to randomly apply one of your active poisons.]]):
format(self:getTalentLevel(t) * 20, 20 + self:getTalentLevel(t) * 5)
end,
}
newTalent{
name = "Venomous Strike",
type = {"cunning/poisons", 2},
points = 5,
cooldown = 5,
stamina = 7,
require = cuns_req_high2,
requires_target = true,
tactical = { ATTACK = 2 },
action = function(self, t)
local tg = {type="hit", range=self:getTalentRange(t)}
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
local nb = 0
for eff_id, p in pairs(target.tmp) do
local e = target.tempeffect_def[eff_id]
if e.type == "poison" then nb = nb + 1 end
end
local dam = self:combatTalentWeaponDamage(t, 0.5 + nb * 0.6, 0.9 + nb * 1)
self:attackTarget(target, DamageType.NATURE, dam, true)
return true
end,
info = function(self, t)
local dam0 = 100 * self:combatTalentWeaponDamage(t, 0.5, 0.9)
local dam1 = 100 * self:combatTalentWeaponDamage(t, 0.5 + 0.6, 0.9 + 1)
local dam2 = 100 * self:combatTalentWeaponDamage(t, 0.5 + 0.6*2, 0.9 + 1*2)
local dam3 = 100 * self:combatTalentWeaponDamage(t, 0.5 + 0.6*3, 0.9 + 1*3)
return ([[You hit your target doing nature damage depending on the number of poisons on the target:
- 0 poisons: %d%%
- 1 poisons: %d%%
- 2 poisons: %d%%
- 3 poisons: %d%%
]]):
format(dam0, dam1, dam2, dam3)
end,
}
newTalent{
name = "Empower Poisons",
type = {"cunning/poisons", 3},
points = 5,
cooldown = 24,
stamina = 15,
require = cuns_req_high3,
requires_target = true,
no_energy = true,
tactical = { ATTACK = 1 },
action = function(self, t)
local tg = {type="hit", range=self:getTalentRange(t)}
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
local mod = (100 + self:combatTalentStatDamage(t, "cun", 40, 250)) / 100
for eff_id, p in pairs(target.tmp) do
local e = target.tempeffect_def[eff_id]
if e.type == "poison" then
p.dur = math.ceil(p.dur / 2)
p.power = (p.power or 0) * mod
end
end
game.level.map:particleEmitter(target.x, target.y, 1, "slime")
game:playSoundNear(self, "talents/slime")
return true
end,
info = function(self, t)
return ([[Reduce the duration of all poisons on the target by 50%% but increases their damage by %d%%.
Effect increases with your Cunning.]]):
format(100 + self:combatTalentStatDamage(t, "cun", 40, 250))
end,
}
newTalent{
name = "Toxic Death",
type = {"cunning/poisons", 4},
points = 5,
mode = "passive",
require = cuns_req_high4,
on_kill = function(self, t, target)
local possible = {}
for i = -1, 1 do for j = -1, 1 do if game.level.map:isBound(target.x + i, target.y + j) then if i ~= 0 or j ~= 0 then
local tgt = game.level.map(target.x + i, target.y + j, Map.ACTOR)
if tgt and not tgt.dead then possible[tgt] = true end
end end end end
possible[self] = nil
possible[target] = nil
possible = table.keys(possible)
for eff_id, p in pairs(target.tmp) do
local e = target.tempeffect_def[eff_id]
if e.type == "poison" and p.src == self then
for i, tgt in ipairs(possible) do if rng.percent(20 + self:getTalentLevelRaw(t) * 8) and not tgt:hasEffect(eff_id) then
p.src = nil
local pp = table.clone(p)
pp.src = self
p.src = self
tgt:setEffect(eff_id, pp.dur, pp)
end end
end
end
end,
info = function(self, t)
return ([[When you kill a creature all the poisons affecting it will have %d%% chances to spread to each adjacent foes.]]):format(20 + self:getTalentLevelRaw(t) * 8)
end,
}
----------------------------------------------------------------
-- Poisons effects
----------------------------------------------------------------
local function cancelPoisons(self)
local todel = {}
for tid, p in pairs(self.sustain_talents) do
local t = self:getTalentFromId(tid)
if t.type[1] == "cunning/poisons-effects" then
todel[#todel+1] = tid
end
end
while #todel > 1 do self:forceUseTalent(rng.tableRemove(todel), {ignore_energy=true}) end
end
newTalent{
name = "Deadly Poison",
type = {"cunning/poisons-effects", 1},
points = 1,
mode = "sustained",
cooldown = 10,
no_break_stealth = true,
no_energy = true,
tactical = { BUFF = 2 },
getDuration = function(self, t) return 5 + self:getTalentLevel(self.T_VILE_POISONS) end,
getDOT = function(self, t) return 8 + self:combatTalentStatDamage(self.T_VILE_POISONS, "cun", 10, 60) * 0.6 end,
proc = function(self, t, target) target:setEffect(target.EFF_POISONED, t.getDuration(self, t), {src=self, power=t.getDOT(self, t), max_power=t.getDOT(self, t) * 4}) end,
activate = function(self, t)
cancelPoisons(self)
self.vile_poisons[t.id] = true
return {}
end,
deactivate = function(self, t, p)
self.vile_poisons[t.id] = nil
return true
end,
info = function(self, t)
return ([[Coat your weapons with a deadly poison, inflicting %d nature damage per turn for %d turns.
The damage scales with your Cunning.
Every application of the poison stacks.]]):
format(damDesc(self, DamageType.NATURE, t.getDOT(self, t)), t.getDuration(self, t))
end,
}
newTalent{
name = "Numbing Poison",
type = {"cunning/poisons-effects", 1},
points = 1,
mode = "sustained",
cooldown = 10,
no_break_stealth = true,
no_energy = true,
tactical = { BUFF = 2 },
getDuration = function(self, t) return 5 + self:getTalentLevel(self.T_VILE_POISONS) end,
getDOT = function(self, t) return 8 + self:combatTalentStatDamage(self.T_VILE_POISONS, "cun", 10, 50) * 0.6 end,
getEffect = function(self, t) return 10 + self:getTalentLevel(self.T_VILE_POISONS) * 3 end,
proc = function(self, t, target) target:setEffect(target.EFF_NUMBING_POISON, t.getDuration(self, t), {src=self, power=t.getDOT(self, t), reduce=t.getEffect(self, t)}) end,
activate = function(self, t)
cancelPoisons(self)
self.vile_poisons[t.id] = true
return {}
end,
deactivate = function(self, t, p)
self.vile_poisons[t.id] = nil
return true
end,
info = function(self, t)
return ([[Coat your weapons with a numbing poison, inflicting %d nature damage per turn for %d turns.
Poisoned creatures will deal %d%% less damage.
The effects scales with your Cunning.]]):
format(damDesc(self, DamageType.NATURE, t.getDOT(self, t)), t.getDuration(self, t), t.getEffect(self, t))
end,
}
newTalent{
name = "Insidious Poison",
type = {"cunning/poisons-effects", 1},
points = 1,
mode = "sustained",
cooldown = 10,
no_break_stealth = true,
no_energy = true,
tactical = { BUFF = 2 },
getDuration = function(self, t) return 5 + self:getTalentLevel(self.T_VILE_POISONS) end,
getDOT = function(self, t) return 8 + self:combatTalentStatDamage(self.T_VILE_POISONS, "cun", 10, 50) * 0.6 end,
getEffect = function(self, t) return 30 + self:getTalentLevel(self.T_VILE_POISONS) * 5.5 end,
proc = function(self, t, target) target:setEffect(target.EFF_INSIDIOUS_POISON, t.getDuration(self, t), {src=self, power=t.getDOT(self, t), heal_factor=t.getEffect(self, t)}) end,
activate = function(self, t)
cancelPoisons(self)
self.vile_poisons[t.id] = true
return {}
end,
deactivate = function(self, t, p)
self.vile_poisons[t.id] = nil
return true
end,
info = function(self, t)
return ([[Coat your weapons with an insidious poison, inflicting %d nature damage per turn for %d turns.
Poisoned creatures heals are reduced by %d%%.
The effects scales with your Cunning.]]):
format(damDesc(self, DamageType.NATURE, t.getDOT(self, t)), t.getDuration(self, t), t.getEffect(self, t))
end,
}
newTalent{
name = "Crippling Poison",
type = {"cunning/poisons-effects", 1},
points = 1,
mode = "sustained",
cooldown = 10,
no_break_stealth = true,
no_energy = true,
tactical = { BUFF = 2 },
getDuration = function(self, t) return 3 + self:getTalentLevel(self.T_VILE_POISONS) end,
getDOT = function(self, t) return 8 + self:combatTalentStatDamage(self.T_VILE_POISONS, "cun", 10, 50) * 0.6 end,
getEffect = function(self, t) return 10 + self:getTalentLevel(self.T_VILE_POISONS) * 3 end,
proc = function(self, t, target) target:setEffect(target.EFF_CRIPPLING_POISON, t.getDuration(self, t), {src=self, power=t.getDOT(self, t), fail=t.getEffect(self, t)}) end,
activate = function(self, t)
cancelPoisons(self)
self.vile_poisons[t.id] = true
return {}
end,
deactivate = function(self, t, p)
self.vile_poisons[t.id] = nil
return true
end,
info = function(self, t)
return ([[Coat your weapons with a crippling poison, inflicting %d nature damage per turn for %d turns.
Every time a poisoned creature tries to use a talent it will have %d%% chances to fail and lose a turn.
The damage scales with your Cunning.]]):
format(damDesc(self, DamageType.NATURE, t.getDOT(self, t)), t.getDuration(self, t), t.getEffect(self, t))
end,
}
newTalent{
name = "Stoning Poison",
type = {"cunning/poisons-effects", 1},
points = 1,
mode = "sustained",
cooldown = 10,
no_break_stealth = true,
no_energy = true,
tactical = { BUFF = 2 },
getDuration = function(self, t) return 12 - self:getTalentLevel(self.T_VILE_POISONS) end,
getDOT = function(self, t) return 8 + self:combatTalentStatDamage(self.T_VILE_POISONS, "cun", 10, 30) * 0.6 end,
getEffect = function(self, t) return math.ceil(2 + self:getTalentLevel(t) / 2) end,
proc = function(self, t, target)
if target:hasEffect(target.EFF_STONED) or target:hasEffect(target.EFF_STONE_POISON) then return end
target:setEffect(target.EFF_STONE_POISON, t.getDuration(self, t), {src=self, power=t.getDOT(self, t), stone=t.getEffect(self, t)})
end,
activate = function(self, t)
cancelPoisons(self)
self.vile_poisons[t.id] = true
return {}
end,
deactivate = function(self, t, p)
self.vile_poisons[t.id] = nil
return true
end,
info = function(self, t)
return ([[Coat your weapons with a stoning poison, inflicting %d nature damage per turn for %d turns.
When the poison ends the victim turns into stone for %d turns.
The damage scales with your Cunning.]]):
format(damDesc(self, DamageType.NATURE, t.getDOT(self, t)), t.getDuration(self, t), t.getEffect(self, t))
end,
}
-- ToME - Tales of Maj'Eyal
-- Copyright (C) 2009, 2010, 2011 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 "New Talent Category: #LIGHT_GREEN#Poisons",
[[Extracted from plants, wildlife or more exotic locations, poisons have always existed.
Many creatures use them, along with some shady people.
You have made a deal with such a person and can now create new Rogue characters that can learn the #LIGHT_GREEN#Poisons talents#WHITE#.
Talents:
- #YELLOW#Vile Poisons: #WHITE#Learn new dangerous and terrible poisons to coat your weapons with, infecting your foes
- #YELLOW#Venomous Blow: #WHITE#A terrible strike that deals increased nature damage based on the number of poison effects
- #YELLOW#Empower Poisons: #WHITE#Lean to make your poisons even more lethal and fast
- #YELLOW#Toxic Death: #WHITE#Spread the toxic joy to your foe's friends!
]]
......@@ -223,6 +223,7 @@ newEffect{
local dur = math.ceil((old_eff.dur + new_eff.dur) / 2)
old_eff.dur = dur
old_eff.power = (olddam + newdam) / dur
if new_eff.max_power then old_eff.power = math.min(old_eff.power, new_eff.max_power) end
return old_eff
end,
on_timeout = function(self, eff)
......@@ -277,6 +278,74 @@ newEffect{
end,
}
newEffect{
name = "CRIPPLING_POISON",
desc = "Crippling Poison",
long_desc = function(self, eff) return ("The target is poisoned and sick, doing %0.2f nature damage per turn. Each time it tries to use a talent there is %d%% chance of failure."):format(eff.power, eff.fail) end,
type = "poison",
status = "detrimental",
parameters = {power=10, fail=5},
on_gain = function(self, err) return "#Target# is poisoned!", "+Crippling Poison" end,
on_lose = function(self, err) return "#Target# is no longer poisoned.", "-Crippling Poison" end,
-- Damage each turn
on_timeout = function(self, eff)
if self:attr("purify_poison") then self:heal(eff.power)
else DamageType:get(DamageType.NATURE).projector(eff.src, self.x, self.y, DamageType.NATURE, eff.power)
end
end,
activate = function(self, eff)
eff.tmpid = self:addTemporaryValue("talent_fail_chance", eff.fail)
end,
deactivate = function(self, eff)
self:removeTemporaryValue("talent_fail_chance", eff.tmpid)
end,
}
newEffect{
name = "NUMBING_POISON",
desc = "Numbing Poison",
long_desc = function(self, eff) return ("The target is poisoned and sick, doing %0.2f nature damage per turn. All damage it does is reduced by %d%%."):format(eff.power, eff.reduce) end,
type = "poison",
status = "detrimental",
parameters = {power=10, reduce=5},
on_gain = function(self, err) return "#Target# is poisoned!", "+Numbing Poison" end,
on_lose = function(self, err) return "#Target# is no longer poisoned.", "-Numbing Poison" end,
-- Damage each turn
on_timeout = function(self, eff)
if self:attr("purify_poison") then self:heal(eff.power)
else DamageType:get(DamageType.NATURE).projector(eff.src, self.x, self.y, DamageType.NATURE, eff.power)
end
end,
activate = function(self, eff)
eff.tmpid = self:addTemporaryValue("numbed", eff.reduce)
end,
deactivate = function(self, eff)
self:removeTemporaryValue("numbed", eff.tmpid)
end,
}
newEffect{
name = "STONE_POISON",
desc = "Stoning Poison",
long_desc = function(self, eff) return ("The target is poisoned and sick, doing %0.2f nature damage per turn. When the effect ends the target will turn to stone for %d turns."):format(eff.power, eff.stone) end,
type = "poison",
status = "detrimental",
parameters = {power=10, reduce=5},
on_gain = function(self, err) return "#Target# is poisoned!", "+Stoning Poison" end,
on_lose = function(self, err) return "#Target# is no longer poisoned.", "-Stoning Poison" end,
-- Damage each turn
on_timeout = function(self, eff)
if self:attr("purify_poison") then self:heal(eff.power)
else DamageType:get(DamageType.NATURE).projector(eff.src, self.x, self.y, DamageType.NATURE, eff.power)
end
end,
activate = function(self, eff)
end,
deactivate = function(self, eff)
self:setEffect(self.EFF_STONED, eff.stone, {})
end,
}
newEffect{
name = "FROZEN",
desc = "Frozen",
......
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