From 3abc8dfccd76f44b29eedf472c080e03ee6f7095 Mon Sep 17 00:00:00 2001 From: DarkGod <darkgod@net-core.org> Date: Tue, 21 Jul 2020 18:50:56 +0200 Subject: [PATCH] Hiemal Shield only affects 66.6% of the incomming damage when above 1 life, 100% when under --- game/modules/tome/class/Game.lua | 1 + .../tome/data/talents/spells/glacial-waste.lua | 16 +++++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua index 4e478c170c..b7582fd2fc 100644 --- a/game/modules/tome/class/Game.lua +++ b/game/modules/tome/class/Game.lua @@ -2032,6 +2032,7 @@ function _M:setupCommands() end end, [{"_g","ctrl"}] = function() if config.settings.cheat then game.player:takeHit(100, game.player) + -- DamageType:get(DamageType.ACID).projector(game.player, game.player.x, game.player.y, DamageType.ACID, 100) do return end game.player:setEffect("EFF_STUNNED", 1, {apply_power=200}) do return end diff --git a/game/modules/tome/data/talents/spells/glacial-waste.lua b/game/modules/tome/data/talents/spells/glacial-waste.lua index 9b16c7e1be..aabe3ccc54 100644 --- a/game/modules/tome/data/talents/spells/glacial-waste.lua +++ b/game/modules/tome/data/talents/spells/glacial-waste.lua @@ -97,18 +97,20 @@ newTalent{ local p = self:isTalentActive(t.id) if not p then return end if cb.value <= 0 then return end + local cbvalue = cb.value + if self.life >= 1 then cbvalue = cb.value * 0.666 end local reduce = 0 if self:knowTalent(self.T_BLEAK_GUARD) then reduce = self:callTalent(self.T_BLEAK_GUARD, "getReduce") end reduce = (100 - reduce) / 100 - local rvalue = cb.value * reduce + local rvalue = cbvalue * reduce if rvalue <= p.shield then - game:delayedLogDamage(src, self, 0, ("#SLATE#(%d absorbed)#LAST#"):tformat(cb.value), false) + game:delayedLogDamage(src, self, 0, ("#SLATE#(%d absorbed)#LAST#"):tformat(cbvalue), false) p.shield = p.shield - rvalue - cb.value = 0 + cbvalue = 0 if p.waste_counter then p.waste_counter = p.waste_counter + rvalue / p.original_shield @@ -120,7 +122,7 @@ newTalent{ end else game:delayedLogDamage(src, self, 0, ("#SLATE#(%d absorbed)#LAST#"):tformat(p.shield), false) - cb.value = (rvalue - p.shield) / reduce + cbvalue = (rvalue - p.shield) / reduce p.shield = 0 end p.been_used = true @@ -135,6 +137,9 @@ newTalent{ -- Deactivate without losing energy self:forceUseTalent(t.id, {ignore_energy=true}) end + + if self.life >= 1 then cb.value = cb.value * (1-0.666) + cbvalue + else cb.value = cbvalue end return true end, activate = function(self, t) @@ -158,7 +163,8 @@ newTalent{ info = function(self, t) return ([[Conjure a shield of ice around you that can absorbs a total of %d damage. Anytime it does it retaliates by sending a bolt of ice at the attacker, dealing %0.2f cold damage (this can only happen once per turn per creature). - When you are under 1 life it also reduces the damage of critical hits by %d%%. + When you are above 1 life it only affects 66.6%% of the damage, letting through the rest. + When you are under 1 life it affects 100%% of the damage and also reduces the damage of critical hits by %d%%. 10 turns after leaving combat the shield will consume its mana and soul cost again to fully regenerate if needed. if that cost can not be matched, it unsustains. The shield strength will increase with your Spellpower.]]): tformat(t:_getMaxAbsorb(self), damDesc(self, DamageType.COLD, t:_getDamage(self)), t:_getCritResist(self)) -- GitLab