diff --git a/game/engines/default/engine/interface/ActorTalents.lua b/game/engines/default/engine/interface/ActorTalents.lua index a38a0773cc42339dcacaf41a249cd59fc649f970..fa690e86c6062db3ae114c311b3d52eed5880f64 100644 --- a/game/engines/default/engine/interface/ActorTalents.lua +++ b/game/engines/default/engine/interface/ActorTalents.lua @@ -997,12 +997,13 @@ function _M:getTalentDisplayName(t) return t.display_name end ---- Cooldown all talents by one +--- Cooldown all talents -- This should be called in your actors "act()" method -function _M:cooldownTalents() +-- @param turns the number of turns to cooldown the talents +function _M:cooldownTalents(turns) for tid, c in pairs(self.talents_cd) do self.changed = true - self.talents_cd[tid] = self.talents_cd[tid] - 1 + self.talents_cd[tid] = self.talents_cd[tid] - (turns or 1) if self.talents_cd[tid] <= 0 then self.talents_cd[tid] = nil if self.onTalentCooledDown then self:onTalentCooledDown(tid) end diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua index 759d56b4a94955cc1721b8c9e45250ebe219b9c0..267f99fead623af9d87ad935d982700e5bce6cb7 100644 --- a/game/modules/tome/class/Actor.lua +++ b/game/modules/tome/class/Actor.lua @@ -603,7 +603,10 @@ function _M:actBase() end -- Cooldown talents after effects, because some of them involve breaking sustains. - if not self:attr("no_talents_cooldown") then self:cooldownTalents() end + + if not self:attr("no_talents_cooldown") then + if self:attr("half_talents_cooldown") then self:cooldownTalents(0.5) else self:cooldownTalents(1) end + end self:checkStillInCombat() end @@ -1409,7 +1412,7 @@ function _M:move(x, y, force) end -- Break channels - if moved then + if not force and moved and ox and oy and (ox ~= self.x or oy ~= self.y) then self:breakPsionicChannel() self:breakSpacetimeTuning() end diff --git a/game/modules/tome/data/damage_types.lua b/game/modules/tome/data/damage_types.lua index 333d06415e1831c7f07d51f0723638e3c5821e98..98f7186e0dd2c34153f95356dbadfe1cc62559fc 100644 --- a/game/modules/tome/data/damage_types.lua +++ b/game/modules/tome/data/damage_types.lua @@ -148,7 +148,7 @@ setDefaultProjector(function(src, x, y, type, dam, state) end if src:attr("stunned") then - dam = dam * 0.4 + dam = dam * 0.5 print("[PROJECTOR] stunned dam", dam) end if src:attr("invisible_damage_penalty") then @@ -1739,7 +1739,7 @@ newDamageType{ local realdam = DamageType:get(DamageType.NATURE).projector(src, x, y, DamageType.NATURE, dam / 6, state) local target = game.level.map(x, y, Map.ACTOR) if target and target:canBe("poison") then - target:setEffect(target.EFF_POISONED, 5, {src=src, power=dam / 6, apply_power=power or (src.combatAttack and src:combatAttack()) or 0}) + target:setEffect(target.EFF_POISONED, 5, {src=src, power=dam / 6}) end return realdam end, @@ -1772,7 +1772,6 @@ newDamageType{ } -- Spydric poison: prevents movement --- Very special, does not have a power check newDamageType{ name = "spydric poison", type = "SPYDRIC_POISON", projector = function(src, x, y, type, dam, state) @@ -1945,7 +1944,7 @@ newDamageType{ local target = game.level.map(x, y, Map.ACTOR) if target then if target:canBe("confusion") then - target:setEffect(target.EFF_CONFUSED, dam.dur, {power=dam.dam, apply_power=(dam.power_check or src.combatSpellpower)(src)}) + target:setEffect(target.EFF_CONFUSED, dam.dur, {power=dam.dam or 30, apply_power=(dam.power_check or src.combatSpellpower)(src)}) else game.logSeen(target, "%s resists!", target.name:capitalize()) end @@ -1963,7 +1962,7 @@ newDamageType{ local target = game.level.map(x, y, Map.ACTOR) if target and rng.percent(dam.dam) then if target:canBe("confusion") then - target:setEffect(target.EFF_CONFUSED, 4, {power=75, apply_power=(dam.power_check or src.combatSpellpower)(src), no_ct_effect=true}) + target:setEffect(target.EFF_CONFUSED, 4, {power=dam.power or 30, apply_power=(dam.power_check or src.combatSpellpower)(src), no_ct_effect=true}) else game.logSeen(target, "%s resists!", target.name:capitalize()) end @@ -1981,7 +1980,7 @@ newDamageType{ local target = game.level.map(x, y, Map.ACTOR) if target and rng.percent(dam.dam) then if target:canBe("confusion") then - target:setEffect(target.EFF_CONFUSED, 4, {power=75, apply_power=src:combatPhysicalpower(), no_ct_effect=true}) + target:setEffect(target.EFF_CONFUSED, 4, {power=dam.power or 30, apply_power=src:combatPhysicalpower(), no_ct_effect=true}) else game.logSeen(target, "%s resists!", target.name:capitalize()) end @@ -2890,7 +2889,7 @@ newDamageType{ if target and src:reactionToward(target) < 0 then DamageType:get(DamageType.NATURE).projector(src, x, y, DamageType.NATURE, dam.dam, state) if target:canBe("confusion") and rng.percent(dam.chance) then - target:setEffect(target.EFF_CONFUSED, 2, {apply_power=src:combatMindpower(), power=dam.power}, true) + target:setEffect(target.EFF_CONFUSED, 2, {apply_power=src:combatMindpower(), power=dam.power or 30}, true) else game.logSeen(target, "%s resists the confusion!", target.name:capitalize()) end @@ -3104,7 +3103,7 @@ newDamageType{ end elseif chance == 4 then if target:canBe("confusion") then - target:setEffect(target.EFF_CONFUSED, 3, {power=50, apply_power=src:combatSpellpower()}) + target:setEffect(target.EFF_CONFUSED, 3, {power=dam.power or 30, apply_power=src:combatSpellpower()}) else game.logSeen(target, "%s resists the confusion!", target.name:capitalize()) end @@ -3747,7 +3746,7 @@ newDamageType{ end elseif eff == 4 then if target:canBe("confusion") then - target:setEffect(target.EFF_CONFUSED, dur, {power=50, apply_power=power}) + target:setEffect(target.EFF_CONFUSED, dur, {power=dam.power or 30, apply_power=power}) else game.logSeen(target, "%s resists the confusion!", target.name:capitalize()) end @@ -3904,7 +3903,7 @@ newDamageType{ if effect == 1 then -- confusion if target:canBe("confusion") and not target:hasEffect(target.EFF_CONFUSED) then - target:setEffect(target.EFF_CONFUSED, dam.dur, {power=50}) + target:setEffect(target.EFF_CONFUSED, dam.dur, {power=dam.power or 30}) game.level.map:particleEmitter(target.x, target.y, 1, "circle", {base_rot=0, oversize=0.7, a=130, limit_life=8, appear=8, speed=0, img="curse_gfx_04", radius=0}) end elseif effect == 2 then diff --git a/game/modules/tome/data/general/objects/egos/ammo.lua b/game/modules/tome/data/general/objects/egos/ammo.lua index 3fdfddb094d890a632961dd1149617d268f97b6c..8ec7e8989c225b968b2ff362623dabbaf594abe7 100644 --- a/game/modules/tome/data/general/objects/egos/ammo.lua +++ b/game/modules/tome/data/general/objects/egos/ammo.lua @@ -393,7 +393,7 @@ newEntity{ if eff == "stun" then target:setEffect(target.EFF_STUNNED, 4, {}) elseif eff == "blind" then target:setEffect(target.EFF_BLINDED, 4, {}) elseif eff == "pin" then target:setEffect(target.EFF_PINNED, 4, {}) - elseif eff == "confusion" then target:setEffect(target.EFF_CONFUSED, 4, {power=50}) + elseif eff == "confusion" then target:setEffect(target.EFF_CONFUSED, 4, {power=30}) end end}, }, @@ -799,7 +799,7 @@ newEntity{ if eff == "stun" then target:setEffect(target.EFF_STUNNED, 3, {}) elseif eff == "blind" then target:setEffect(target.EFF_BLINDED, 3, {}) elseif eff == "pin" then target:setEffect(target.EFF_PINNED, 3, {}) - elseif eff == "confusion" then target:setEffect(target.EFF_CONFUSED, 3, {power=60}) + elseif eff == "confusion" then target:setEffect(target.EFF_CONFUSED, 3, {power=30}) elseif eff == "silence" then target:setEffect(target.EFF_SILENCED, 3, {}) end end}, diff --git a/game/modules/tome/data/general/objects/egos/weapon.lua b/game/modules/tome/data/general/objects/egos/weapon.lua index 0f2fd539fe14cf89241381f2d0c68c7785471465..f512f41c3b6d00d8d1dccaa0e13628fabb1e1981 100644 --- a/game/modules/tome/data/general/objects/egos/weapon.lua +++ b/game/modules/tome/data/general/objects/egos/weapon.lua @@ -931,7 +931,7 @@ newEntity{ }, }, combat = { - special_on_hit = {desc="20% chance to torment the target", fct=function(combat, who, target) + special_on_hit = {desc="20% chance to stun, blind, pin, confuse, or silence the target", fct=function(combat, who, target) if not rng.percent(20) then return end local eff = rng.table{"stun", "blind", "pin", "confusion", "silence",} if not target:canBe(eff) then return end @@ -940,7 +940,7 @@ newEntity{ if eff == "stun" then target:setEffect(target.EFF_STUNNED, 3, {}) elseif eff == "blind" then target:setEffect(target.EFF_BLINDED, 3, {}) elseif eff == "pin" then target:setEffect(target.EFF_PINNED, 3, {}) - elseif eff == "confusion" then target:setEffect(target.EFF_CONFUSED, 3, {power=60}) + elseif eff == "confusion" then target:setEffect(target.EFF_CONFUSED, 3, {power=30}) elseif eff == "silence" then target:setEffect(target.EFF_SILENCED, 3, {}) end end}, diff --git a/game/modules/tome/data/general/objects/world-artifacts.lua b/game/modules/tome/data/general/objects/world-artifacts.lua index c4c92133b0f10311108deaeda0926b8a7cde148f..495878a0855f62ed045e609ddebea6b8cfa7e1c3 100644 --- a/game/modules/tome/data/general/objects/world-artifacts.lua +++ b/game/modules/tome/data/general/objects/world-artifacts.lua @@ -1742,7 +1742,7 @@ newEntity{ base = "BASE_GREATSWORD", if not target:canBe(eff) then return end if not target:checkHit(who:combatAttack(combat), target:combatPhysicalResist(), 15) then return end if eff == "stun" then target:setEffect(target.EFF_STUNNED, 3, {}) - elseif eff == "confusion" then target:setEffect(target.EFF_CONFUSED, 3, {power=75}) + elseif eff == "confusion" then target:setEffect(target.EFF_CONFUSED, 3, {power=50}) end end}, melee_project={[DamageType.LIGHT] = 49, [DamageType.DARKNESS] = 49}, @@ -3389,7 +3389,7 @@ newEntity{ base = "BASE_LONGSWORD", if eff == "stun" then target:setEffect(target.EFF_MADNESS_STUNNED, 3, {mindResistChange=-25}) elseif eff == "malign" then target:setEffect(target.EFF_MALIGNED, 3, {resistAllChange=10}) elseif eff == "agony" then target:setEffect(target.EFF_AGONY, 5, { src=who, damage=40, mindpower=40, range=10, minPercent=10, duration=5}) - elseif eff == "confusion" then target:setEffect(target.EFF_CONFUSED, 3, {power=60}) + elseif eff == "confusion" then target:setEffect(target.EFF_CONFUSED, 3, {power=50}) elseif eff == "silence" then target:setEffect(target.EFF_SILENCED, 3, {}) end end}, diff --git a/game/modules/tome/data/talents/cunning/poisons.lua b/game/modules/tome/data/talents/cunning/poisons.lua index 7e7233ae52b502d676c4d4390747b48d5c08065f..1fd9d9fc2a41dcfc96e748ccf9837e764598753a 100644 --- a/game/modules/tome/data/talents/cunning/poisons.lua +++ b/game/modules/tome/data/talents/cunning/poisons.lua @@ -136,7 +136,7 @@ newTalent{ getDamage = function(self, t) return 8 + self:combatTalentStatDamage(t, "cun", 10, 60) * 0.6 end, ApplyPoisons = function(self, t, target, weapon) -- apply poison(s) to a target if self:knowTalent(self.T_VULNERABILITY_POISON) then -- apply vulnerability first - target:setEffect(target.EFF_VULNERABILITY_POISON, t.getDuration(self, t), {src=self, power=self:callTalent(self.T_VULNERABILITY_POISON, "getDamage") , apply_power=self:combatAttack(), no_ct_effect=true}) + target:setEffect(target.EFF_VULNERABILITY_POISON, t.getDuration(self, t), {src=self, power=self:callTalent(self.T_VULNERABILITY_POISON, "getDamage") , no_ct_effect=true}) end if target:canBe("poison") then local insidious = 0 @@ -150,7 +150,7 @@ newTalent{ local volatile = 0 if self:isTalentActive(self.T_VOLATILE_POISON) then volatile = self:callTalent(self.T_VOLATILE_POISON, "getEffect")/100 end local dam = t.getDamage(self,t) * (1 + volatile) - target:setEffect(target.EFF_DEADLY_POISON, t.getDuration(self, t), {src=self, power=dam, max_power=dam*4, insidious=insidious, crippling=crippling, numbing=numbing, leeching=leeching, volatile=volatile, apply_power=self:combatAttack(), no_ct_effect=true}) + target:setEffect(target.EFF_DEADLY_POISON, t.getDuration(self, t), {src=self, power=dam, max_power=dam*4, insidious=insidious, crippling=crippling, numbing=numbing, leeching=leeching, volatile=volatile, no_ct_effect=true}) if self.vile_poisons then for tid, val in pairs(self.vile_poisons) do -- apply any special procs local tal = self:getTalentFromId(tid) @@ -159,6 +159,8 @@ newTalent{ end end end + else + game.logSeen(target, "%s resists the vile poison!", target.name:capitalize()) end end, callbackOnMeleeAttack = function(self, t, target, hitted, crit, weapon, damtype, mult, dam) @@ -552,7 +554,7 @@ newTalent{ return true end, info = function(self, t) - return ([[Enhances your Deadly Poison with a volatile agent, causing the poison to deal %d%% increased damage to the victim and damage all of your enemies adjacent to it.]]): + return ([[Enhances your Deadly Poison with a volatile agent, causing the poison to deal %d%% increased damage to the victim and damage all of your enemies adjacent to it for 50%%.]]): format(t.getEffect(self, t)) end, } diff --git a/game/modules/tome/data/talents/misc/npcs.lua b/game/modules/tome/data/talents/misc/npcs.lua index 7084db2715ceac41fc403ee8920825810d898c2b..9d2eb18b8a71553cfd6823670a1c9dd00b3475e3 100644 --- a/game/modules/tome/data/talents/misc/npcs.lua +++ b/game/modules/tome/data/talents/misc/npcs.lua @@ -541,15 +541,16 @@ newTalent{ tactical = { DISABLE = { confusion = 3 } }, target = function(self, t) return {type="hit", range=self:getTalentRange(t), talent=t} end, getDuration = function(self, t) return math.floor(self:combatTalentScale(t, 3, 7)) end, + getConfusion = function(self, t) return self:combatTalentLimit(t, 50, 15, 45) end, -- Confusion hard cap is 50% action = function(self, t) local tg = self:getTalentTarget(t) local x, y = self:getTarget(tg) if not x or not y then return nil end - self:project(tg, x, y, DamageType.CONFUSION, {dur=t.getDuration(self, t), dam=50+self:getTalentLevelRaw(t)*10}, {type="manathrust"}) + self:project(tg, x, y, DamageType.CONFUSION, {dur=t.getDuration(self, t), dam=t.getConfusion(self,t)}, {type="manathrust"}) return true end, info = function(self, t) - return ([[Try to confuse the target's mind for %d turns.]]):format(t.getDuration(self, t)) + return ([[Try to confuse the target's mind for %d (power %d%%) turns.]]):format(t.getDuration(self, t), t.getConfusion(self, t)) end, } diff --git a/game/modules/tome/data/talents/techniques/2hweapon.lua b/game/modules/tome/data/talents/techniques/2hweapon.lua index b3404cf62b848da3bb992c01c4aeeb6eec92d2cd..155181ca24813059088793d7effeabfb0f1ea5eb 100644 --- a/game/modules/tome/data/talents/techniques/2hweapon.lua +++ b/game/modules/tome/data/talents/techniques/2hweapon.lua @@ -119,6 +119,7 @@ newTalent{ range = 0, radius = function(self, t) return math.floor(self:combatTalentScale(t, 4, 8)) end, getDuration = function(self, t) return math.floor(self:combatTalentScale(t, 4, 8)) end, + getConfusion = function(self, t) return self:combatTalentLimit(t, 50, 15, 45) end, requires_target = true, target = function(self, t) return {type="cone", range=self:getTalentRange(t), radius=self:getTalentRadius(t), selffire=false} @@ -136,7 +137,7 @@ newTalent{ if not x or not y then return nil end self:project(tg, x, y, DamageType.CONFUSION, { dur=t.getDuration(self, t), - dam=50+self:getTalentLevelRaw(t)*10, + dam=t.getConfusion(self, t), power_check=function() return self:combatPhysicalpower() end, resist_check=self.combatPhysicalResist, }) @@ -144,8 +145,8 @@ newTalent{ return true end, info = function(self, t) - return ([[Shout your warcry in a frontal cone of radius %d. Any targets caught inside will be confused for %d turns.]]): - format(self:getTalentRadius(t), t.getDuration(self, t)) + return ([[Shout your warcry in a frontal cone of radius %d. Any targets caught inside will be confused (power %d%%) for %d turns.]]): + format(self:getTalentRadius(t),t.getConfusion(self, t), t.getDuration(self, t)) end, } diff --git a/game/modules/tome/data/talents/techniques/conditioning.lua b/game/modules/tome/data/talents/techniques/conditioning.lua index e65cb382b51f050a3de87e7a772d5ca398d67c6a..6d07ec565a9d520270726b87d3f997d6cfa6cd06 100644 --- a/game/modules/tome/data/talents/techniques/conditioning.lua +++ b/game/modules/tome/data/talents/techniques/conditioning.lua @@ -24,26 +24,26 @@ newTalent{ mode = "passive", points = 5, cooldown = 15, - getHealValues = function(self, t) --base, fraction of max life - return (self.life_rating or 10) + self:combatTalentStatDamage(t, "con", 2, 20), self:combatTalentLimit(t, 0.3, 0.07, 0.16) + getHealValues = function(self, t) + return 5+self:combatTalentStatDamage(t, "con", 1, 200) end, - getWoundReduction = function(self, t) return self:combatTalentLimit(t, 1, 0.17, 0.5) end, -- Limit <100% + getWoundReduction = function(self, t) return self:combatTalentLimit(t, 0.6, 0.17, 0.5) end, -- Limit <60%% getDuration = function(self, t) return 8 end, do_vitality_recovery = function(self, t) if self:isTalentCoolingDown(t) then return end - local baseheal, percent = t.getHealValues(self, t) - self:setEffect(self.EFF_RECOVERY, t.getDuration(self, t), {power = baseheal, pct = percent / t.getDuration(self, t)}) + local baseheal = t.getHealValues(self, t) + self:setEffect(self.EFF_RECOVERY, t.getDuration(self, t), {regen = baseheal}) self:startTalentCooldown(t) end, info = function(self, t) local wounds = t.getWoundReduction(self, t) * 100 - local baseheal, healpct = t.getHealValues(self, t) + local baseheal = t.getHealValues(self, t) local duration = t.getDuration(self, t) - local totalheal = baseheal + self.max_life*healpct/duration + local totalheal = baseheal return ([[You recover faster from poisons, diseases and wounds, reducing the duration of all such effects by %d%%. - Additionally, when your life falls below 50%%, you heal for a base %0.1f health plus %0.1f%% of your maximum life (currently %0.1f total) each turn for %d turns. This effect can only happen once every %d turns. - The base healing scales with your Constitution.]]): - format(wounds, baseheal, healpct/duration*100, totalheal, duration, self:getTalentCooldown(t)) + Whenever your life falls below 50%%, your life regeneration increases by %0.1f for %d turns (%d total). This effect can only happen once every %d turns. + The regeneration scales with your Constitution.]]): + format(wounds, baseheal, duration, baseheal*duration, self:getTalentCooldown(t)) end, } diff --git a/game/modules/tome/data/timed_effects/magical.lua b/game/modules/tome/data/timed_effects/magical.lua index 87b4f9d2e1618c89ab6dd453382bce990411aab0..ff075238d0a5876e39078e751e52c08244face97 100644 --- a/game/modules/tome/data/timed_effects/magical.lua +++ b/game/modules/tome/data/timed_effects/magical.lua @@ -524,7 +524,6 @@ newEffect{ DamageType:get(DamageType.DARKNESS).projector(eff.src, self.x, self.y, DamageType.DARKNESS, eff.dam) end, activate = function(self, eff) - eff.power = math.floor(math.max(eff.power - (self:attr("confusion_immune") or 0) * 100, 10)) eff.power = util.bound(eff.power, 0, 50) eff.tmpid = self:addTemporaryValue("confused", eff.power) if eff.power <= 0 then eff.dur = 0 end @@ -2956,19 +2955,6 @@ newEffect{ end } -newEffect{ - name = "PATH_OF_THE_SUN", image = "talents/path_of_the_sun.png", - desc = "Path of the Sun", - long_desc = function(self, eff) return ("The target is able to instantly travel alongside Sun Paths."):format() end, - type = "magical", - subtype = { sun=true, }, - status = "beneficial", - parameters = {}, - activate = function(self, eff) - self:effectTemporaryValue(eff, "walk_sun_path", 1) - end -} - newEffect{ name = "SUNCLOAK", image = "talents/suncloak.png", desc = "Suncloak", diff --git a/game/modules/tome/data/timed_effects/mental.lua b/game/modules/tome/data/timed_effects/mental.lua index c0816f978654ec965e927170673c53d8816544eb..2a321c7f96a81a1f1e3f1aae66ad1fc26e123252 100644 --- a/game/modules/tome/data/timed_effects/mental.lua +++ b/game/modules/tome/data/timed_effects/mental.lua @@ -68,14 +68,14 @@ newEffect{ name = "CONFUSED", image = "effects/confused.png", desc = "Confused", long_desc = function(self, eff) return ("The target is confused, acting randomly (chance %d%%) and unable to perform complex actions."):format(eff.power) end, + charges = function(self, eff) return (tostring(eff.power).."%") end, type = "mental", subtype = { confusion=true }, status = "detrimental", - parameters = { power=50 }, + parameters = { power=30 }, on_gain = function(self, err) return "#Target# wanders around!.", "+Confused" end, on_lose = function(self, err) return "#Target# seems more focused.", "-Confused" end, activate = function(self, eff) - eff.power = math.floor(math.max(eff.power - (self:attr("confusion_immune") or 0) * 100, 10)) eff.power = util.bound(eff.power, 0, 50) eff.tmpid = self:addTemporaryValue("confused", eff.power) if eff.power <= 0 then eff.dur = 0 end @@ -261,7 +261,7 @@ newEffect{ newEffect{ name = "GLOOM_STUNNED", image = "effects/gloom_stunned.png", desc = "Stunned by the gloom", - long_desc = function(self, eff) return ("The gloom has stunned the target, reducing damage by 70%%, putting random talents on cooldown and reducing movement speed by 50%%. While stunned talents do not cooldown."):format() end, + long_desc = function(self, eff) return ("The gloom has stunned the target, reducing damage by 50%%, putting 4 random talents on cooldown and reducing movement speed by 50%%. While stunned talents cooldown twice as slow."):format() end, type = "mental", subtype = { gloom=true, stun=true }, status = "detrimental", @@ -270,11 +270,9 @@ newEffect{ on_lose = function(self, err) return "#Target# overcomes the gloom", "-Stunned" end, activate = function(self, eff) eff.particle = self:addParticles(Particles.new("gloom_stunned", 1)) - eff.tmpid = self:addTemporaryValue("stunned", 1) - eff.tcdid = self:addTemporaryValue("no_talents_cooldown", 1) eff.speedid = self:addTemporaryValue("movement_speed", -0.5) - + eff.lockid = self:addTemporaryValue("half_talents_cooldown", 1) local tids = {} for tid, lev in pairs(self.talents) do local t = self:getTalentFromId(tid) @@ -283,15 +281,14 @@ newEffect{ for i = 1, 4 do local t = rng.tableRemove(tids) if not t then break end - self.talents_cd[t.id] = 1 -- Just set cooldown to 1 since cooldown does not decrease while stunned + self.talents_cd[t.id] = 1 end end, deactivate = function(self, eff) self:removeParticles(eff.particle) - self:removeTemporaryValue("stunned", eff.tmpid) - self:removeTemporaryValue("no_talents_cooldown", eff.tcdid) self:removeTemporaryValue("movement_speed", eff.speedid) + self:removeTemporaryValue("half_talents_cooldown", eff.lockid) end, } @@ -300,6 +297,7 @@ newEffect{ desc = "Confused by the gloom", long_desc = function(self, eff) return ("The gloom has confused the target, making it act randomly (%d%% chance) and unable to perform complex actions."):format(eff.power) end, type = "mental", + charges = function(self, eff) return (tostring(eff.power).."%") end, subtype = { gloom=true, confusion=true }, status = "detrimental", parameters = { power = 10 }, @@ -307,7 +305,6 @@ newEffect{ on_lose = function(self, err) return "#Target# overcomes the gloom", "-Confused" end, activate = function(self, eff) eff.particle = self:addParticles(Particles.new("gloom_confused", 1)) - eff.power = math.floor(math.max(eff.power - (self:attr("confusion_immune") or 0) * 100, 10)) eff.power = util.bound(eff.power, 0, 50) eff.tmpid = self:addTemporaryValue("confused", eff.power) if eff.power <= 0 then eff.dur = 0 end @@ -905,7 +902,7 @@ newEffect{ newEffect{ name = "MADNESS_STUNNED", image = "effects/madness_stunned.png", desc = "Stunned by madness", - long_desc = function(self, eff) return ("Madness has stunned the target, reducing damage by 70%%, lowering mind resistance by %d%%, putting random talents on cooldown and reducing movement speed by 50%%. While stunned talents do not cooldown."):format(eff.mindResistChange) end, + long_desc = function(self, eff) return ("Madness has stunned the target, reducing damage by 50%%, lowering mind resistance by %d%%, putting 4 random talents on cooldown and reducing movement speed by 50%%. While stunned talents cooldown twice as slow."):format(eff.mindResistChange) end, type = "mental", subtype = { madness=true, stun=true }, status = "detrimental", @@ -917,8 +914,8 @@ newEffect{ eff.mindResistChangeId = self:addTemporaryValue("resists", { [DamageType.MIND]=eff.mindResistChange }) eff.tmpid = self:addTemporaryValue("stunned", 1) - eff.tcdid = self:addTemporaryValue("no_talents_cooldown", 1) eff.speedid = self:addTemporaryValue("movement_speed", -0.5) + eff.lockid = self:addTemporaryValue("half_talents_cooldown", 1) local tids = {} for tid, lev in pairs(self.talents) do @@ -928,7 +925,7 @@ newEffect{ for i = 1, 4 do local t = rng.tableRemove(tids) if not t then break end - self.talents_cd[t.id] = 1 -- Just set cooldown to 1 since cooldown does not decrease while stunned + self.talents_cd[t.id] = 1 end end, deactivate = function(self, eff) @@ -936,25 +933,25 @@ newEffect{ self:removeTemporaryValue("resists", eff.mindResistChangeId) self:removeTemporaryValue("stunned", eff.tmpid) - self:removeTemporaryValue("no_talents_cooldown", eff.tcdid) self:removeTemporaryValue("movement_speed", eff.speedid) + self:removeTemporaryValue("half_talents_cooldown", eff.lockid) end, } newEffect{ name = "MADNESS_CONFUSED", image = "effects/madness_confused.png", desc = "Confused by madness", - long_desc = function(self, eff) return ("Madness has confused the target, lowering mind resistance by %d%% and making it act randomly (%d%% chance) and unable to perform complex actions."):format(eff.mindResistChange, eff.power) end, + long_desc = function(self, eff) return ("Madness has confused the target, lowering mind resistance by %d%% and making it act randomly (%d%% chance)"):format(eff.mindResistChange, eff.power) end, type = "mental", - subtype = { madness=true, confusion=true }, + subtype = { madness=true, confusion=true, power=50 }, status = "detrimental", + charges = function(self, eff) return (tostring(eff.power).."%") end, parameters = { power=10 }, on_gain = function(self, err) return "#F53CBE##Target# is lost in madness!", "+Confused" end, on_lose = function(self, err) return "#Target# overcomes the madness", "-Confused" end, activate = function(self, eff) eff.particle = self:addParticles(Particles.new("gloom_confused", 1)) eff.mindResistChangeId = self:addTemporaryValue("resists", { [DamageType.MIND]=eff.mindResistChange }) - eff.power = math.floor(math.max(eff.power - (self:attr("confusion_immune") or 0) * 100, 10)) eff.power = util.bound(eff.power, 0, 50) eff.tmpid = self:addTemporaryValue("confused", eff.power) end, @@ -1574,7 +1571,7 @@ newEffect{ end elseif chance == 3 then if self:canBe("confusion") then - self:setEffect(self.EFF_CONFUSED, 3, {power=50}) + self:setEffect(self.EFF_CONFUSED, 3, {power=30}) end end game.logSeen(self, "#F53CBE#%s succumbs to the nightmare!", self.name:capitalize()) @@ -2235,7 +2232,7 @@ newEffect{ newEffect{ name = "BRAINLOCKED", desc = "Brainlocked", - long_desc = function(self, eff) return ("Renders a random talent unavailable. No talents will cool down until the effect has worn off."):format() end, + long_desc = function(self, eff) return ("Renders a random talent unavailable. Talent cooldown is halved until the effect has worn off."):format() end, type = "mental", subtype = { ["cross tier"]=true }, status = "detrimental", @@ -2243,11 +2240,11 @@ newEffect{ on_gain = function(self, err) return nil, "+Brainlocked" end, on_lose = function(self, err) return nil, "-Brainlocked" end, activate = function(self, eff) - eff.tcdid = self:addTemporaryValue("no_talents_cooldown", 1) + eff.tcdid = self:addTemporaryValue("half_talents_cooldown", 1) local tids = {} for tid, lev in pairs(self.talents) do local t = self:getTalentFromId(tid) - if t and not self.talents_cd[tid] and t.mode == "activated" and not t.innate then tids[#tids+1] = t end + if t and not self.talents_cd[tid] and t.mode == "activated" and not t.innate and not t.no_energy then tids[#tids+1] = t end end for i = 1, 1 do local t = rng.tableRemove(tids) @@ -2256,7 +2253,7 @@ newEffect{ end end, deactivate = function(self, eff) - self:removeTemporaryValue("no_talents_cooldown", eff.tcdid) + self:removeTemporaryValue("half_talents_cooldown", eff.tcdid) end, } @@ -2323,12 +2320,12 @@ newEffect{ type = "mental", subtype = { confusion=true }, status = "detrimental", + charges = function(self, eff) return (tostring(eff.confuse).."%") end, on_gain = function(self, err) return "#Target# higher mental functions have been imparied.", "+Lobotomized" end, on_lose = function(self, err) return "#Target#'s regains its senses.", "-Lobotomized" end, parameters = { power=1, confuse=10, dam=1 }, activate = function(self, eff) DamageType:get(DamageType.MIND).projector(eff.src or self, self.x, self.y, DamageType.MIND, {dam=eff.dam, alwaysHit=true}) - eff.confuse = math.floor(math.max(eff.confuse - (self:attr("confusion_immune") or 0) * 100, 10)) eff.confuse = util.bound(eff.confuse, 0, 50) -- Confusion cap of 50% eff.tmpid = self:addTemporaryValue("confused", eff.confuse) eff.cid = self:addTemporaryValue("inc_stats", {[Stats.STAT_CUN]=-eff.power/2}) diff --git a/game/modules/tome/data/timed_effects/other.lua b/game/modules/tome/data/timed_effects/other.lua index 8b97c999e5b359e5cf1e4815e96339584dd9f60d..70dd78b302676ff04ee4dbda1896c399bb7eb8d1 100644 --- a/game/modules/tome/data/timed_effects/other.lua +++ b/game/modules/tome/data/timed_effects/other.lua @@ -98,6 +98,7 @@ newEffect{ name = "INFUSION_COOLDOWN", image = "effects/infusion_cooldown.png", desc = "Infusion Saturation", long_desc = function(self, eff) return ("The more you use infusions, the longer they will take to recharge (+%d cooldowns)."):format(eff.power) end, + charges = function(self, eff) return eff.power end, type = "other", subtype = { infusion=true }, status = "detrimental", @@ -114,6 +115,7 @@ newEffect{ name = "RUNE_COOLDOWN", image = "effects/rune_cooldown.png", desc = "Runic Saturation", long_desc = function(self, eff) return ("The more you use runes, the longer they will take to recharge (+%d cooldowns)."):format(eff.power) end, + charges = function(self, eff) return eff.power end, type = "other", subtype = { rune=true }, status = "detrimental", @@ -142,6 +144,19 @@ newEffect{ end, } +newEffect{ + name = "PATH_OF_THE_SUN", image = "talents/path_of_the_sun.png", + desc = "Path of the Sun", + long_desc = function(self, eff) return ("The target is able to instantly travel alongside Sun Paths."):format() end, + type = "other", + subtype = { sun=true, }, + status = "beneficial", + parameters = {}, + activate = function(self, eff) + self:effectTemporaryValue(eff, "walk_sun_path", 1) + end +} + newEffect{ name = "TIME_PRISON", image = "talents/time_prison.png", desc = "Time Prison", diff --git a/game/modules/tome/data/timed_effects/physical.lua b/game/modules/tome/data/timed_effects/physical.lua index aa8f21589c3880dd133bf25b505d27a65add9cae..82c6c6dc86e6fb7f83b383bf5a478fb75ba38d82 100644 --- a/game/modules/tome/data/timed_effects/physical.lua +++ b/game/modules/tome/data/timed_effects/physical.lua @@ -124,6 +124,7 @@ newEffect{ name = "CUT", image = "effects/cut.png", desc = "Bleeding", long_desc = function(self, eff) return ("Huge cut that bleeds, doing %0.2f physical damage per turn."):format(eff.power) end, + charges = function(self, eff) return (math.floor(eff.power)) end, type = "physical", subtype = { wound=true, cut=true, bleed=true }, status = "detrimental", @@ -221,6 +222,7 @@ newEffect{ name = "POISONED", image = "effects/poisoned.png", desc = "Poison", long_desc = function(self, eff) return ("The target is poisoned, taking %0.2f nature damage per turn."):format(eff.power) end, + charges = function(self, eff) return (math.floor(eff.power)) end, type = "physical", subtype = { poison=true, nature=true }, no_ct_effect = true, status = "detrimental", @@ -421,6 +423,7 @@ newEffect{ name = "BURNING", image = "talents/flame.png", desc = "Burning", long_desc = function(self, eff) return ("The target is on fire, taking %0.2f fire damage per turn."):format(eff.power) end, + charges = function(self, eff) return (math.floor(eff.power)) end, type = "physical", subtype = { fire=true }, status = "detrimental", @@ -444,7 +447,8 @@ newEffect{ newEffect{ name = "BURNING_SHOCK", image = "talents/flameshock.png", desc = "Burning Shock", - long_desc = function(self, eff) return ("The target is on fire, taking %0.2f fire damage per turn, reducing damage by 70%%, putting random talents on cooldown and reducing movement speed by 50%%. While flameshocked talents do not cooldown."):format(eff.power) end, + long_desc = function(self, eff) return ("The target is on fire, taking %0.2f fire damage per turn, reducing damage by 70%%, putting 4 random talents on cooldown and reducing movement speed by 50%%. While flameshocked talents do not cooldown."):format(eff.power) end, + charges = function(self, eff) return (math.floor(eff.power)) end, type = "physical", subtype = { fire=true, stun=true }, status = "detrimental", @@ -453,8 +457,8 @@ newEffect{ on_lose = function(self, err) return "#Target# is not stunned anymore.", "-Burning Shock" end, activate = function(self, eff) eff.tmpid = self:addTemporaryValue("stunned", 1) - eff.tcdid = self:addTemporaryValue("no_talents_cooldown", 1) eff.speedid = self:addTemporaryValue("movement_speed", -0.5) + eff.lockid = self:addTemporaryValue("half_talents_cooldown", 1) local tids = {} for tid, lev in pairs(self.talents) do @@ -464,7 +468,7 @@ newEffect{ for i = 1, 4 do local t = rng.tableRemove(tids) if not t then break end - self:startTalentCooldown(t.id, 1) -- Just set cooldown to 1 since cooldown does not decrease while stunned + self:startTalentCooldown(t.id, 1) end end, on_timeout = function(self, eff) @@ -472,15 +476,15 @@ newEffect{ end, deactivate = function(self, eff) self:removeTemporaryValue("stunned", eff.tmpid) - self:removeTemporaryValue("no_talents_cooldown", eff.tcdid) self:removeTemporaryValue("movement_speed", eff.speedid) + self:removeTemporaryValue("half_talents_cooldown", eff.lockid) end, } newEffect{ name = "STUNNED", image = "effects/stunned.png", desc = "Stunned", - long_desc = function(self, eff) return ("The target is stunned, reducing damage by 60%%, putting 3 random talents on cooldown and reducing movement speed by 50%%. While stunned talents do not cooldown."):format() end, + long_desc = function(self, eff) return ("The target is stunned, reducing damage by 50%%, putting 3 random talents on cooldown and reducing movement speed by 50%%. While stunned talents cooldown twice as slow."):format() end, type = "physical", subtype = { stun=true }, status = "detrimental", @@ -489,9 +493,8 @@ newEffect{ on_lose = function(self, err) return "#Target# is not stunned anymore.", "-Stunned" end, activate = function(self, eff) eff.tmpid = self:addTemporaryValue("stunned", 1) - eff.tcdid = self:addTemporaryValue("no_talents_cooldown", 1) eff.speedid = self:addTemporaryValue("movement_speed", -0.5) - + eff.lockid = self:addTemporaryValue("half_talents_cooldown", 1) local tids = {} for tid, lev in pairs(self.talents) do local t = self:getTalentFromId(tid) @@ -505,8 +508,8 @@ newEffect{ end, deactivate = function(self, eff) self:removeTemporaryValue("stunned", eff.tmpid) - self:removeTemporaryValue("no_talents_cooldown", eff.tcdid) self:removeTemporaryValue("movement_speed", eff.speedid) + self:removeTemporaryValue("half_talents_cooldown", eff.lockid) end, } @@ -621,13 +624,21 @@ newEffect{ newEffect{ name = "SLOW", image = "talents/slow.png", desc = "Slow", - long_desc = function(self, eff) return ("Reduces global action speed by %d%%."):format(eff.power * 100) end, + long_desc = function(self, eff) return ("Reduces global action speed by %d%%."):format(math.floor(eff.power * 100)) end, + charges = function(self, eff) return (math.floor(eff.power * 100)) end, type = "physical", subtype = { slow=true }, status = "detrimental", parameters = { power=0.1 }, on_gain = function(self, err) return "#Target# slows down.", "+Slow" end, on_lose = function(self, err) return "#Target# speeds up.", "-Slow" end, + on_merge = function(self, old_eff, new_eff) + if new_eff.power > old_eff.power then + old_eff.power = new_eff.power + old_eff.dur = new_eff.dur + end + return old_eff + end, activate = function(self, eff) eff.tmpid = self:addTemporaryValue("global_speed_add", -eff.power) end, @@ -1558,30 +1569,24 @@ newEffect{ newEffect{ name = "Recovery", desc = "Recovery", - long_desc = function(self, eff) return ("The target is recovering %d life each turn."):format(eff.power + eff.pct * self.max_life) end, + long_desc = function(self, eff) return ("The target has %d increased life regeneration."):format(eff.regen) end, type = "physical", subtype = { heal=true }, status = "beneficial", - parameters = { power=10, pct = 0.01 }, + parameters = { regen=10 }, on_gain = function(self, err) return "#Target# is recovering from the damage!", "+Recovery" end, on_lose = function(self, err) return "#Target# has finished recovering.", "-Recovery" end, activate = function(self, eff) - --eff.regenid = self:addTemporaryValue("life_regen", eff.regen) - --eff.healid = self:addTemporaryValue("healing_factor", eff.heal_mod / 100) + eff.regenid = self:addTemporaryValue("life_regen", eff.regen) if core.shader.active(4) then eff.particle1 = self:addParticles(Particles.new("shader_shield", 1, {toback=true, size_factor=1.5, y=-0.3, img="healarcane"}, {type="healing", time_factor=4000, noup=2.0, beamColor1={0xff/255, 0x22/255, 0x22/255, 1}, beamColor2={0xff/255, 0x60/255, 0x60/255, 1}, circleColor={0,0,0,0}, beamsCount=8})) eff.particle2 = self:addParticles(Particles.new("shader_shield", 1, {toback=false, size_factor=1.5, y=-0.3, img="healarcane"}, {type="healing", time_factor=4000, noup=1.0, beamColor1={0xff/255, 0x22/255, 0x22/255, 1}, beamColor2={0xff/255, 0x60/255, 0x60/255, 1}, circleColor={0,0,0,0}, beamsCount=8})) end end, - on_timeout = function(self, eff) - local heal = (eff.power or 0) + self.max_life * eff.pct - self:heal(heal, src) - end, deactivate = function(self, eff) self:removeParticles(eff.particle1) self:removeParticles(eff.particle2) - --self:removeTemporaryValue("life_regen", eff.regenid) - --self:removeTemporaryValue("healing_factor", eff.healid) + self:removeTemporaryValue("life_regen", eff.regenid) end, } @@ -3211,10 +3216,11 @@ newEffect{ local insidious = eff.insidious > 0 and (" Healing received is reduced by %d%%."):format(eff.insidious) or "" local numbing = eff.numbing > 0 and (" Damage dealt is reduced by %d%%."):format(eff.numbing) or "" local crippling = eff.crippling > 0 and (" %d%% chance to fail talents."):format(eff.crippling) or "" - local volatile = eff.volatile > 0 and (" Poison damage also hits adjacent targets."):format() or "" + local volatile = eff.volatile > 0 and (" Poison damage also hits adjacent targets for 50%%."):format() or "" local leeching = eff.leeching > 0 and (" The source of this effect receives healing equal to %d%% of the damage it deals to the target."):format(eff.leeching) or "" return ("The target is poisoned, taking %0.2f nature damage per turn.%s%s%s%s%s"):format(eff.power, insidious, numbing, crippling, volatile, leeching) end, + charges = function(self, eff) return (math.floor(eff.power)) end, type = "physical", subtype = { poison=true, nature=true }, no_ct_effect = true, status = "detrimental", @@ -3229,7 +3235,7 @@ newEffect{ local dam = DamageType:get(DamageType.NATURE).projector(eff.src, self.x, self.y, DamageType.NATURE, eff.power) if eff.volatile > 0 then local tg = {type="ball", radius=1, friendlyfire=false, x=self.x, y=self.y, act_exclude={[self.uid]=true}} - eff.src:project(tg, self.x, self.y, DamageType.NATURE, eff.power) + eff.src:project(tg, self.x, self.y, DamageType.NATURE, eff.power / 2) end if dam > 0 and eff.leeching > 0 then local src = eff.src.resolveSource and eff.src:resolveSource() @@ -3966,7 +3972,7 @@ newEffect{ desc = "Shadow Smoke", long_desc = function(self, eff) return ("The target is wrapped in disorientating smoke, reducing vision range by %d."):format(eff.sight) end, type = "physical", - subtype = { sense=true }, + subtype = { blind=true }, status = "detrimental", parameters = { sight=5 }, on_gain = function(self, err) return "#Target# is surrounded by a thick smoke.", "+Shadow Smoke" end, @@ -3975,7 +3981,7 @@ newEffect{ activate = function(self, eff) if self:canBe("blind") then if self.sight - eff.sight < 1 then eff.sight = self.sight - 1 end - self:effectTemporaryValue(eff, "sight", -eff.sight) + eff.tmpid = self:addTemporaryValue("sight", -eff.sight) self:doFOV() end if core.shader.active() then @@ -3983,7 +3989,10 @@ newEffect{ end end, deactivate = function(self, eff) + if eff.tmpid then + self:removeTemporaryValue("sight", eff.tmpid) self:doFOV() + end end, }