diff --git a/game/engines/default/engine/Entity.lua b/game/engines/default/engine/Entity.lua index 02ce3c5cdc1cf1d678c28fe1c3761acd9a08a0f3..d29573751b13fd0fe8a1eaef909b6d50b0731a54 100644 --- a/game/engines/default/engine/Entity.lua +++ b/game/engines/default/engine/Entity.lua @@ -690,6 +690,7 @@ end function _M:removeTemporaryValue(prop, id, noupdate) local oldval = self.compute_vals[id] print("removeTempVal", prop, oldval, " :=: ", id) + if not id then error("error removing prop "..tostring(prop).." with id nil") end self.compute_vals[id] = nil -- Find the base, one removed from the last prop diff --git a/game/engines/default/engine/Map.lua b/game/engines/default/engine/Map.lua index 83f6056f2db0662e3b4ff20d863a324e200efc28..58fbe794030150a5e3b0473d77a2241734fe3bcd 100644 --- a/game/engines/default/engine/Map.lua +++ b/game/engines/default/engine/Map.lua @@ -1144,7 +1144,7 @@ function _M:displayParticles(nb_keyframes) local dx, dy = self.display_x, self.display_y for i = #self.particles, 1, -1 do e = self.particles[i] - if e.ps then + if e and e.ps then adx, ady = 0, 0 if e.x and e.y then -- Make sure we display on the real screen coords: handle current move anim position diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua index 23cf102fdf6fbca90e339deec7324a2b0b8079c0..16976a39720e5253e95b2832faad37a13c83ca17 100644 --- a/game/modules/tome/class/Actor.lua +++ b/game/modules/tome/class/Actor.lua @@ -116,6 +116,8 @@ function _M:init(t, no_default) self.combat_spellresist = 0 self.combat_mentalresist = 0 + t.old_life = 0 + self.fatigue = 0 self.spell_cooldown_reduction = 0 @@ -635,6 +637,9 @@ function _M:act() -- Still not dead ? if self.dead then return false end + -- Register life for this turn + self.old_life = self.life + -- Ok reset the seen cache self:resetCanSeeCache() @@ -1834,6 +1839,14 @@ function _M:onTakeHit(value, src) end end + if self:hasEffect(self.EFF_CAUTERIZE) then + local eff = self:hasEffect(self.EFF_CAUTERIZE) + if eff.invulnerable then + eff.dam = eff.dam + value / 10 + return 0 + end + end + -- Reduce sleep durations if self:attr("sleep") then local effs = {} diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua index 4021052c70e8dc4688f0f09da9cb2a66c43eed56..684ec6c3a531f146a312782d0c9f3d3b7c830df5 100644 --- a/game/modules/tome/class/Game.lua +++ b/game/modules/tome/class/Game.lua @@ -1275,32 +1275,7 @@ function _M:setupCommands() print("===============") end end, [{"_g","ctrl"}] = function() if config.settings.cheat then - local elf = mod.class.NPC.new{ - name = "red helper elf", type="humanoid", subtype="elf", - image = "player/elf_female/base_shadow_01.png", display_w = 0.7, display_h = 0.7, display_x = 0.15, display_y = 0.15, - add_mos = { - {image="player/elf_female/cloak_behind_02.png", display_w = 0.7, display_h = 0.7, display_x = 0.15, display_y = 0.15}, - {image="player/elf_female/base_redhead_01.png", display_w = 0.7, display_h = 0.7, display_x = 0.15, display_y = 0.15}, - {image="player/elf_female/lower_body_06.png", display_w = 0.7, display_h = 0.7, display_x = 0.15, display_y = 0.15}, - {image="player/elf_female/upper_body_09.png", display_w = 0.7, display_h = 0.7, display_x = 0.15, display_y = 0.15}, - {image="player/elf_female/braid_redhead_02.png", display_w = 0.7, display_h = 0.7, display_x = 0.15, display_y = 0.15}, - }, - } - game.zone:addEntity(game.level, elf, "actor", game.player.x, game.player.y+1) - - local elf = mod.class.NPC.new{ - name = "green helper elf", type="humanoid", subtype="elf", - image = "player/elf_female/base_shadow_01.png", display_w = 0.7, display_h = 0.7, display_x = 0.15, display_y = 0.15, - add_mos = { - {image="player/elf_female/cloak_behind_06.png", display_w = 0.7, display_h = 0.7, display_x = 0.15, display_y = 0.15}, - {image="player/elf_female/base_thalore_01.png", display_w = 0.7, display_h = 0.7, display_x = 0.15, display_y = 0.15}, - {image="player/elf_female/lower_body_04.png", display_w = 0.7, display_h = 0.7, display_x = 0.15, display_y = 0.15}, - {image="player/elf_female/upper_body_06.png", display_w = 0.7, display_h = 0.7, display_x = 0.15, display_y = 0.15}, - {image="player/elf_female/braid_01.png", display_w = 0.7, display_h = 0.7, display_x = 0.15, display_y = 0.15}, - }, - } - game.zone:addEntity(game.level, elf, "actor", game.player.x+1, game.player.y+1) - + game.player:takeHit(1500, game.player) do return end self:registerDialog(require("mod.dialogs.DownloadCharball").new()) do return end diff --git a/game/modules/tome/class/Player.lua b/game/modules/tome/class/Player.lua index cfaaebac05cc8156266de76d10b79438acf8ef8b..3494cc6c372e5cd1feceb0d291f33ed2a02fd757 100644 --- a/game/modules/tome/class/Player.lua +++ b/game/modules/tome/class/Player.lua @@ -75,7 +75,6 @@ function _M:init(t, no_default) t.lite = t.lite or 0 t.rank = t.rank or 3 - t.old_life = 0 t.old_air = 0 t.old_psi = 0 @@ -90,6 +89,7 @@ function _M:init(t, no_default) self.puuid = self.puuid or util.uuid() self.damage_log = self.damage_log or {weapon={}} + self.damage_intake_log = self.damage_intake_log or {weapon={}} self.talent_kind_log = self.talent_kind_log or {} end @@ -296,7 +296,6 @@ function _M:act() -- Funky shader things ! self:updateMainShader() - self.old_life = self.life self.old_air = self.air self.old_psi = self.psi diff --git a/game/modules/tome/class/interface/ActorLife.lua b/game/modules/tome/class/interface/ActorLife.lua index c4caebb40fd4e6c4a9d9115ef74bfb2c1a7936fa..13690c4d1e898ec2388c203cce60284f7b4519f4 100644 --- a/game/modules/tome/class/interface/ActorLife.lua +++ b/game/modules/tome/class/interface/ActorLife.lua @@ -32,8 +32,12 @@ function _M:takeHit(value, src, death_note) self.life = self.life - value self.changed = true if self.life <= self.die_at then - if src.on_kill and src:on_kill(self) then return false, value end - return self:die(src, death_note), value + if self:knowTalent(self.T_CAUTERIZE) and self:triggerTalent(self.T_CAUTERIZE, nil, value) then + return false, 0 + else + if src.on_kill and src:on_kill(self) then return false, value end + return self:die(src, death_note), value + end end return false, value end \ No newline at end of file diff --git a/game/modules/tome/class/interface/Archery.lua b/game/modules/tome/class/interface/Archery.lua index 41e588d11f9ee6d713d150e3b441970b229a640f..3627599a6a43c58a814ccccdba627c747b07aa55 100644 --- a/game/modules/tome/class/interface/Archery.lua +++ b/game/modules/tome/class/interface/Archery.lua @@ -132,6 +132,8 @@ local function archery_projectile(tx, ty, tg, self, tmp) local damtype = tg.archery.damtype or ammo.damtype or DamageType.PHYSICAL local mult = tg.archery.mult or 1 + self.turn_procs.weapon_type = {kind=weapon and weapon.talented or "unknown", mode="archery"} + -- Does the blow connect? yes .. complex :/ if tg.archery.use_psi_archery then self.use_psi_combat = true end local atk, def = self:combatAttackRanged(weapon, ammo), target:combatDefenseRanged() @@ -404,6 +406,7 @@ local function archery_projectile(tx, ty, tg, self, tmp) target.turn_procs.roll_with_it = true end + self.turn_procs.weapon_type = nil self.use_psi_combat = false end diff --git a/game/modules/tome/class/interface/Combat.lua b/game/modules/tome/class/interface/Combat.lua index 39f7c33b81ae290057b76f6095091926485d4d4b..4db24aa03f3f1a4b5a9e063f2e3e9811bc4dad9b 100644 --- a/game/modules/tome/class/interface/Combat.lua +++ b/game/modules/tome/class/interface/Combat.lua @@ -908,6 +908,9 @@ function _M:combatDefenseBase(fake) local t = self:getTalentFromId(self.T_TACTICAL_EXPERT) add = add + t.do_tact_update(self, t) end + if self:knowTalent(self.T_CORRUPTED_SHELL) then + add = add + self:getCon() / 3 + end if self:knowTalent(self.T_STEADY_MIND) then local t = self:getTalentFromId(self.T_STEADY_MIND) add = add + t.getDefense(self, t) @@ -1112,6 +1115,10 @@ function _M:combatDamage(weapon) end end + if self:knowTalent(self.T_SUPERPOWER) then + totstat = totstat + self:getStat("wil") * 0.3 + end + if self:knowTalent(self.T_ARCANE_MIGHT) then totstat = totstat + self:getStat("mag") * 0.5 end @@ -1432,6 +1439,10 @@ function _M:combatMindpower(mod, add) mod = mod or 1 add = add or 0 + if self:knowTalent(self.T_SUPERPOWER) then + add = add + 25 * self:getStr() / 100 + end + if self:knowTalent(self.T_GESTURE_OF_POWER) then local t = self:getTalentFromId(self.T_GESTURE_OF_POWER) add = add + t.getMindpowerChange(self, t) @@ -1487,6 +1498,9 @@ function _M:combatPhysicalResist(fake) if not fake then add = add + (self:checkOnDefenseCall("physical") or 0) end + if self:knowTalent(self.T_CORRUPTED_SHELL) then + add = add + self:getCon() / 3 + end if self:knowTalent(self.T_POWER_IS_MONEY) then add = add + util.bound(self.money / (90 - self:getTalentLevelRaw(self.T_POWER_IS_MONEY) * 5), 0, self:getTalentLevelRaw(self.T_POWER_IS_MONEY) * 7) end @@ -1512,6 +1526,9 @@ function _M:combatSpellResist(fake) if not fake then add = add + (self:checkOnDefenseCall("spell") or 0) end + if self:knowTalent(self.T_CORRUPTED_SHELL) then + add = add + self:getCon() / 3 + end if self:knowTalent(self.T_POWER_IS_MONEY) then add = add + util.bound(self.money / (90 - self:getTalentLevelRaw(self.T_POWER_IS_MONEY) * 5), 0, self:getTalentLevelRaw(self.T_POWER_IS_MONEY) * 7) end @@ -1537,6 +1554,9 @@ function _M:combatMentalResist(fake) if not fake then add = add + (self:checkOnDefenseCall("mental") or 0) end + if self:knowTalent(self.T_CORRUPTED_SHELL) then + add = add + self:getCon() / 3 + end if self:knowTalent(self.T_STEADY_MIND) then local t = self:getTalentFromId(self.T_STEADY_MIND) add = add + t.getMental(self, t) diff --git a/game/modules/tome/data/damage_types.lua b/game/modules/tome/data/damage_types.lua index 404aec3f57d77c66dbd60245463e00ea4e1283f2..24090a856e9433f42b1a54561f383e28f1d436f0 100644 --- a/game/modules/tome/data/damage_types.lua +++ b/game/modules/tome/data/damage_types.lua @@ -293,7 +293,7 @@ setDefaultProjector(function(src, x, y, type, dam, tmp, no_martyr) print("[PROJECTOR] stunned dam", dam) end if src:attr("invisible_damage_penalty") then - dam = dam * util.bound(1 - src.invisible_damage_penalty, 0, 1) + dam = dam * util.bound(1 - (src.invisible_damage_penalty / (src.invisible_damage_penalty_divisor or 1)), 0, 1) print("[PROJECTOR] invisible dam", dam) end if src:attr("numbed") then @@ -400,6 +400,14 @@ setDefaultProjector(function(src, x, y, type, dam, tmp, no_martyr) end end + if dam > 0 and target.damage_intake_log and target.damage_intake_log.weapon then + target.damage_intake_log[type] = (target.damage_intake_log[type] or 0) + dam + if src.turn_procs and src.turn_procs.weapon_type then + target.damage_intake_log.weapon[src.turn_procs.weapon_type.kind] = (target.damage_intake_log.weapon[src.turn_procs.weapon_type.kind] or 0) + dam + target.damage_intake_log.weapon[src.turn_procs.weapon_type.mode] = (target.damage_intake_log.weapon[src.turn_procs.weapon_type.mode] or 0) + dam + end + end + if dam > 0 and source_talent then local t = source_talent diff --git a/game/modules/tome/data/gfx/talents/cauterize.png b/game/modules/tome/data/gfx/talents/cauterize.png new file mode 100644 index 0000000000000000000000000000000000000000..5507a0b0ea4fa6b4869338cd9542137d58ae8464 Binary files /dev/null and b/game/modules/tome/data/gfx/talents/cauterize.png differ diff --git a/game/modules/tome/data/gfx/talents/corrupted_shell.png b/game/modules/tome/data/gfx/talents/corrupted_shell.png new file mode 100644 index 0000000000000000000000000000000000000000..d3e07c59c229961af2183ae1e06dbfa69bb01f3c Binary files /dev/null and b/game/modules/tome/data/gfx/talents/corrupted_shell.png differ diff --git a/game/modules/tome/data/gfx/talents/mental_tyranny.png b/game/modules/tome/data/gfx/talents/mental_tyranny.png new file mode 100644 index 0000000000000000000000000000000000000000..a753d010e7c4527769dc680dc4363af7e007ed4e Binary files /dev/null and b/game/modules/tome/data/gfx/talents/mental_tyranny.png differ diff --git a/game/modules/tome/data/gfx/talents/superpower.png b/game/modules/tome/data/gfx/talents/superpower.png new file mode 100644 index 0000000000000000000000000000000000000000..dd0d82028de3a3f449f67a49daa4cff33a5f4a5e Binary files /dev/null and b/game/modules/tome/data/gfx/talents/superpower.png differ diff --git a/game/modules/tome/data/gfx/talents/tricks_of_the_trade.png b/game/modules/tome/data/gfx/talents/tricks_of_the_trade.png new file mode 100644 index 0000000000000000000000000000000000000000..3c0d7b6524a8137a79efbcc7bb37514e5b385ee5 Binary files /dev/null and b/game/modules/tome/data/gfx/talents/tricks_of_the_trade.png differ diff --git a/game/modules/tome/data/gfx/talents/vital_shot.png b/game/modules/tome/data/gfx/talents/vital_shot.png new file mode 100644 index 0000000000000000000000000000000000000000..db915e4554deff51b138ba00b65b1c81beb6746d Binary files /dev/null and b/game/modules/tome/data/gfx/talents/vital_shot.png differ diff --git a/game/modules/tome/data/talents/misc/npcs.lua b/game/modules/tome/data/talents/misc/npcs.lua index da44ef28a60c3fbcb85aa7af22969af8db20521f..28146f97fb0a3fb6fed784968911d6019e8e7f2e 100644 --- a/game/modules/tome/data/talents/misc/npcs.lua +++ b/game/modules/tome/data/talents/misc/npcs.lua @@ -1724,7 +1724,9 @@ newTalent{ local x, y = self:getTarget(tg) if not x or not y then return nil end - local terrains = mod.class.Grid:loadList("/data/general/grids/lava.lua") + local terrains = t.terrains or mod.class.Grid:loadList("/data/general/grids/lava.lua") + t.terrains = terrains -- cache + local meteor = function(src, x, y, dam) game.level.map:particleEmitter(x, y, 10, "meteor", {x=x, y=y}).on_remove = function(self) local x, y = self.args.x, self.args.y diff --git a/game/modules/tome/data/talents/uber/const.lua b/game/modules/tome/data/talents/uber/const.lua index f4afd1051cdc9703a4556d92f22f5245ac81b629..1b583795f31d3c277858a107d7652a48ff04eb03 100644 --- a/game/modules/tome/data/talents/uber/const.lua +++ b/game/modules/tome/data/talents/uber/const.lua @@ -152,3 +152,25 @@ uberTalent{ :format(self:getCon() * 1.5, self:getCon() * self.max_life / 100) end, } + +uberTalent{ + name = "Corrupted Shell", + mode = "passive", + require = { special={desc="Received at least 50000 blight damage and destroyed Zigur with the Grand Corruptor.", fct=function(self) return + (self.damage_intake_log and self.damage_intake_log[DamageType.BLIGHT] and self.damage_intake_log[DamageType.BLIGHT] >= 50000) and + (game.state.birth.ignore_prodigies_special_reqs or ( + self:hasQuest("anti-antimagic") and + self:hasQuest("anti-antimagic"):isStatus(engine.Quest.DONE) and + not self:hasQuest("anti-antimagic"):isStatus(engine.Quest.COMPLETED, "grand-corruptor-treason") + )) + end} }, + on_learn = function(self, t) + self.max_life = self.max_life + 150 + end, + info = function(self, t) + return ([[Thanks to your newfound knowledge of corruption, you've learned some tricks for toughening your body... but only if you are healthy enough to withstand the strain from the changes. + Improves your life by 150, your Defense by %d, and your saves by %d, as your natural toughness and reflexes are pushed beyond their normal limits. + Your saves and Defense will improve with your Constitution.]]) + :format(self:getCon() / 3, self:getCon() / 3) + end, +} diff --git a/game/modules/tome/data/talents/uber/cun.lua b/game/modules/tome/data/talents/uber/cun.lua index bfb768103c892782b8abbebcd7f79802b08e3931..1a2482d9d43273c3f58d7c8645563abf5ebb720d 100644 --- a/game/modules/tome/data/talents/uber/cun.lua +++ b/game/modules/tome/data/talents/uber/cun.lua @@ -271,3 +271,29 @@ uberTalent{ :format() end, } + +uberTalent{ + name = "Tricks of the Trade", + mode = "passive", + require = { special={desc="Sided with the Assassin Lord.", fct=function(self) return game.state.birth.ignore_prodigies_special_reqs or (self:isQuestStatus("lost-merchant", engine.Quest.COMPLETED, "evil")) end} }, + on_learn = function(self, t) + if self:knowTalentType("cunning/stealth") then + self:setTalentTypeMastery("cunning/stealth", self:getTalentTypeMastery("cunning/stealth") + 0.2) + elseif self:knowTalentType("cunning/stealth") == false then + self:learnTalentType("cunning/stealth", true) + end + if self:knowTalentType("cunning/scoundrel") then + self:setTalentTypeMastery("cunning/scoundrel", self:getTalentTypeMastery("cunning/scoundrel") + 0.1) + else + self:learnTalentType("cunning/scoundrel", true) + self:setTalentTypeMastery("cunning/scoundrel", 0.9) + end + self.invisible_damage_penalty_divisor = (self.invisible_damage_penalty_divisor or 0) + 2 + end, + info = function(self, t) + return ([[You have friends in low places, and have learned some underhanded tricks. + Gain 0.2 Category Mastery to the Cunning/Stealth Category (or unlock it, if locked), and either gain +0.1 to the Cunning/Scoundrel category or learn and unlock the category at 0.9, if you lack it. + Additionally, all of your damage penalties from invisibility are permanently halved.]]): + format() + end, +} diff --git a/game/modules/tome/data/talents/uber/dex.lua b/game/modules/tome/data/talents/uber/dex.lua index 34b2fe981a19fb8db64bf8d0b852952effacd145..8b6f1f9041853fe66023e0c7eed19068cf8edd16 100644 --- a/game/modules/tome/data/talents/uber/dex.lua +++ b/game/modules/tome/data/talents/uber/dex.lua @@ -195,3 +195,31 @@ uberTalent{ :format() end, } + +uberTalent{ + name = "Vital Shot", + no_energy = "fake", + cooldown = 20, + range = archery_range, + require = { special={desc="Dealt over 50000 damage with ranged weapons.", fct=function(self) return self.damage_log and self.damage_log.weapon.archery and self.damage_log.weapon.archery >= 50000 end} }, + tactical = { ATTACK = { weapon = 3 }, DISABLE = 3 }, + requires_target = true, + on_pre_use = function(self, t, silent) if not self:hasArcheryWeapon() then if not silent then game.logPlayer(self, "You require a bow or sling for this talent.") end return false end return true end, + archery_onhit = function(self, t, target, x, y) + if target:canBe("stun") then + target:setEffect(target.EFF_STUNNED, 5, {apply_power=self:combatAttack()}) + end + target:setEffect(target.EFF_CRIPPLE, 5, {speed=0.50, apply_power=self:combatAttack()}) + end, + action = function(self, t) + local targets = self:archeryAcquireTargets(nil, {one_shot=true}) + if not targets then return end + self:archeryShoot(targets, t, nil, {mult=4.5}) + return true + end, + info = function(self, t) + return ([[You fire a shot straight at your enemy's vital areas, wounding them terribly. + Enemies hit by this shot will take 450%% weapon damage, and will be stunned and crippled (Losing 50%% physical, magical and mental attack speeds) for five turns, due to the incredibly disabling impact of the shot. + The stun and cripple chances increase with your Accuracy.]]):format() + end, +} diff --git a/game/modules/tome/data/talents/uber/mag.lua b/game/modules/tome/data/talents/uber/mag.lua index 22f9aac9469055b8a0beddfc1aa4d294d4e7534f..1c73aa965e93a5302ab1b1d2842b80ba6c716cfa 100644 --- a/game/modules/tome/data/talents/uber/mag.lua +++ b/game/modules/tome/data/talents/uber/mag.lua @@ -157,7 +157,7 @@ uberTalent{ uberTalent{ name = "Revisionist History", - cooldown = 40, + cooldown = 30, no_energy = true, is_spell = true, no_npc_use = true, @@ -184,3 +184,24 @@ uberTalent{ :format() end, } + +uberTalent{ + name = "Cauterize", + mode = "passive", + cooldown = 12, + require = { special={desc="Received at least 50000 fire damage and have cast at least 1000 spells.", fct=function(self) return + self.talent_kind_log and self.talent_kind_log.spell and self.talent_kind_log.spell >= 1000 and self.damage_intake_log and self.damage_intake_log[DamageType.FIRE] and self.damage_intake_log[DamageType.FIRE] >= 50000 + end} }, + trigger = function(self, t, value) + self:startTalentCooldown(t) + + self:setEffect(self.EFF_CAUTERIZE, 8, {dam=value/10}) + return true + end, + info = function(self, t) + return ([[Your inner flame is strong, each time you receive a blow that would kill you your body is wreathed in flames. + The flames will cauterize the wound, fully absorbing all damage done this turn but they will continue to burn for 8 turns. + Each turn 10% of the damage absorbed will be dealt by the flames (this will bypass resistance and affinity). + Warning, this has a cooldown.]]) + end, +} diff --git a/game/modules/tome/data/talents/uber/str.lua b/game/modules/tome/data/talents/uber/str.lua index 31e981370c1889a4a76e56b47979d7413d4d324a..eb6c88620c5320bac5c597e6a6d291e8b93814f5 100644 --- a/game/modules/tome/data/talents/uber/str.lua +++ b/game/modules/tome/data/talents/uber/str.lua @@ -177,3 +177,14 @@ uberTalent{ :format() end, } + +uberTalent{ + name = "Superpower", + mode = "passive", + info = function(self, t) + return ([[A strong body is key to a strong mind. And a strong mind is powerful enough to make a strong body. + Grants a Mindpower bonus equal to 25%% of your Strength. + Additionally, you treat all weapons as having an additional 30%% Willpower modifier.]]) + :format() + end, +} diff --git a/game/modules/tome/data/talents/uber/wil.lua b/game/modules/tome/data/talents/uber/wil.lua index 6b569b70d1713ca7b789358cea310930805b93e6..b482c84ce5a183080f35e4fe10adb357ce3e45f6 100644 --- a/game/modules/tome/data/talents/uber/wil.lua +++ b/game/modules/tome/data/talents/uber/wil.lua @@ -214,3 +214,38 @@ uberTalent{ :format(damDesc(self, DamageType.MIND, 20 + self:getWil() * 2)) end, } + +uberTalent{ + name = "Mental Tyranny", + mode = "sustained", + require = { }, + cooldown = 20, + tactical = { BUFF = 2 }, + require = { special={desc="Dealt over 50000 mind damage", fct=function(self) return + self.damage_log and ( + (self.damage_log[DamageType.MIND] and self.damage_log[DamageType.MIND] >= 50000) + ) + end} }, + activate = function(self, t) + game:playSoundNear(self, "talents/distortion") + return { + converttype = self:addTemporaryValue("all_damage_convert", DamageType.MIND), + convertamount = self:addTemporaryValue("all_damage_convert_percent", 100), + dam = self:addTemporaryValue("inc_damage", {[DamageType.MIND] = 10}), + resist = self:addTemporaryValue("resists_pen", {[DamageType.MIND] = 30}), + } + end, + deactivate = function(self, t, p) + self:removeTemporaryValue("all_damage_convert", p.converttype) + self:removeTemporaryValue("all_damage_convert_percent", p.convertamount) + self:removeTemporaryValue("inc_damage", p.dam) + self:removeTemporaryValue("resists_pen", p.resist) + return true + end, + info = function(self, t) + return ([[Transcend the physical and rule over all with an iron will. + While this sustain is active, all of your damage is converted into mind damage. + Additionally, you gain +30%% mind resistance penetration, and +10%% mind damage.]]): + format() + end, +} diff --git a/game/modules/tome/data/timed_effects/other.lua b/game/modules/tome/data/timed_effects/other.lua index 70767a48bfc7d91daa7e8210aad074633e4d49da..792cd165a70b3a251982eef9727fd368f2978b0f 100644 --- a/game/modules/tome/data/timed_effects/other.lua +++ b/game/modules/tome/data/timed_effects/other.lua @@ -2120,3 +2120,39 @@ newEffect{ deactivate = function(self, eff) end, } + +newEffect{ + name = "CAUTERIZE", image = "talents/cauterize.png", + desc = "Cauterize", + long_desc = function(self, eff) return ("Your body is cauterizing, burns for %0.2f damage each turn."):format(eff.dam) end, + type = "other", + subtype = { fire=true }, + status = "detrimental", + parameters = { dam=10 }, + on_gain = function(self, err) return "#CRIMSON##Target# is wreathed in flames on the brink of death!", "+Cauterize" end, + on_lose = function(self, err) return "#CRIMSON#The flames around #target# vanishes.", "-Cauterize" end, + on_merge = function(self, old_eff, new_eff) + old_eff.dur = new_eff.dur + old_eff.dam = old_eff.dam + new_eff.dam + return old_eff + end, + activate = function(self, eff) + self.life = self.old_life or 10 + eff.invulnerable = true + eff.particle1 = self:addParticles(Particles.new("inferno", 1)) + eff.particle2 = self:addParticles(Particles.new("inferno", 1)) + end, + deactivate = function(self, eff) + self:removeParticles(eff.particle1) + self:removeParticles(eff.particle2) + end, + on_timeout = function(self, eff) + if eff.invulnerable then + eff.invulnerable = nil + end + local dead, val = self:takeHit(eff.dam, self, {special_death_msg="burnt to death by cauterize"}) + + local srcname = self.x and self.y and game.level.map.seens(self.x, self.y) and self.name:capitalize() or "Something" + game:delayedLogDamage(self, self, val, ("%s%d %s#LAST#"):format(DamageType:get(DamageType.FIRE).text_color or "#aaaaaa#", math.ceil(val), DamageType:get(DamageType.FIRE).name), false) + end, +}