From f7bd4ab3f02014290dd24ea45a6b624daac7368c Mon Sep 17 00:00:00 2001 From: otowakotori <806682153@qq.com> Date: Sat, 21 Mar 2020 10:14:17 +0800 Subject: [PATCH 01/20] Fix skip learning a trap break player.restCheck mentioned in http://forums.te4.org/viewtopic.php?f=42&t=50732 --- game/modules/tome/class/Trap.lua | 45 ++++++++++++++++---------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/game/modules/tome/class/Trap.lua b/game/modules/tome/class/Trap.lua index cca858f3f7..739b1d5769 100644 --- a/game/modules/tome/class/Trap.lua +++ b/game/modules/tome/class/Trap.lua @@ -197,29 +197,6 @@ function _M:onDisarm(x, y, who) local diff_level = (t.trap_mastery_level or 5) local success, consec, msg = false, 0 local oldrestCheck = rawget(who, "restCheck") -- hack restCheck to perform action each turn - who.restCheck = function(player) - if not player.resting then player.restCheck = oldrestCheck return false, _t"not resting" end - if player.resting.cnt >= diff_level then -- start making checks at diff_level turns - if rng.percent(chance) then - consec = consec + 1 - else -- reset success count - consec = 0 - if rng.percent(10) then -- oops! 10% chance to set it off - game:onTickEnd(function() self:triggered(player.x, player.y, player) end) - msg = _t"You set off the trap!" - return false, msg - end - end - end - if consec >= diff_level then -- success after diff_level consecutive checks - msg = _t"You successfully dismantled the trap." - success = true return false, msg - end - local continue, reason = mod.class.Player.restCheck(player) - if not continue then msg = _t"You were interrupted." end - return continue, reason - end - local turns = math.ceil(diff_level*(1 + rng.float(1, 6*(1-chance/200)))) -- random turns to dismantle local dismantle = coroutine.create(function(self, who) local wait = function() @@ -255,6 +232,28 @@ function _M:onDisarm(x, y, who) ]]):tformat(turns, desc), math.min(800, game.w*.75), function(quit) if quit == true then + who.restCheck = function(player) + if not player.resting then player.restCheck = oldrestCheck return false, _t"not resting" end + if player.resting.cnt >= diff_level then -- start making checks at diff_level turns + if rng.percent(chance) then + consec = consec + 1 + else -- reset success count + consec = 0 + if rng.percent(10) then -- oops! 10% chance to set it off + game:onTickEnd(function() self:triggered(player.x, player.y, player) end) + msg = _t"You set off the trap!" + return false, msg + end + end + end + if consec >= diff_level then -- success after diff_level consecutive checks + msg = _t"You successfully dismantled the trap." + success = true return false, msg + end + local continue, reason = mod.class.Player.restCheck(player) + if not continue then msg = _t"You were interrupted." end + return continue, reason + end game:playSoundNear(who, "ambient/town/town_large2") coroutine.resume(dismantle, self, who) end -- GitLab From 5a9e685acf70ab4efb0512f40055fd1609fb0dc8 Mon Sep 17 00:00:00 2001 From: otowakotori <806682153@qq.com> Date: Sat, 21 Mar 2020 10:31:40 +0800 Subject: [PATCH 02/20] Shield wand and Healing totem now ignore_nullify_all_friendlyfire http://forums.te4.org/viewtopic.php?f=42&t=50783 This will make them work with Through The Crowd on --- game/modules/tome/data/general/objects/egos/totems-powers.lua | 2 +- game/modules/tome/data/general/objects/egos/wands-powers.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/game/modules/tome/data/general/objects/egos/totems-powers.lua b/game/modules/tome/data/general/objects/egos/totems-powers.lua index 9bf2be90ca..8183660dd9 100644 --- a/game/modules/tome/data/general/objects/egos/totems-powers.lua +++ b/game/modules/tome/data/general/objects/egos/totems-powers.lua @@ -50,7 +50,7 @@ newEntity{ { radius = function(self, who) return 10 end, heal = function(self, who) return self:getCharmPower(who) end, - target = function(self, who) return {type="ball", nowarning=true, radius=self.use_power.radius(self, who)} end, + target = function(self, who) return {type="ball", nowarning=true, radius=self.use_power.radius(self, who), ignore_nullify_all_friendlyfire=true} end, tactical = {HEAL = 1}, }) } diff --git a/game/modules/tome/data/general/objects/egos/wands-powers.lua b/game/modules/tome/data/general/objects/egos/wands-powers.lua index 3ef3679d6f..cc0431ac18 100644 --- a/game/modules/tome/data/general/objects/egos/wands-powers.lua +++ b/game/modules/tome/data/general/objects/egos/wands-powers.lua @@ -161,7 +161,7 @@ newEntity{ { radius = function(self, who) return 10 end, shield = function(self, who) return self:getCharmPower(who) end, - target = function(self, who) return {type="ball", nowarning=true, radius=self.use_power.radius(self, who)} end, + target = function(self, who) return {type="ball", nowarning=true, radius=self.use_power.radius(self, who), ignore_nullify_all_friendlyfire=true} end, tactical = {HEAL = 1}, }) } \ No newline at end of file -- GitLab From 659f7c644ba01b1cbed33fe72f237d11adbdd130 Mon Sep 17 00:00:00 2001 From: otowakotori <806682153@qq.com> Date: Sat, 21 Mar 2020 11:03:38 +0800 Subject: [PATCH 03/20] Fix Disruption Shield bug http://forums.te4.org/viewtopic.php?f=42&t=50707 --- .../tome/data/talents/spells/arcane.lua | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/game/modules/tome/data/talents/spells/arcane.lua b/game/modules/tome/data/talents/spells/arcane.lua index 1b9622f9de..ea7ff8d798 100644 --- a/game/modules/tome/data/talents/spells/arcane.lua +++ b/game/modules/tome/data/talents/spells/arcane.lua @@ -215,16 +215,18 @@ newTalent{ -- if self:reactionToward(src) > 0 then return end self.disruption_shield_power = self.disruption_shield_power or 0 self.disruption_shield_storage = self.disruption_shield_storage or 0 + local absorbed = 0 if cb.value <= self.disruption_shield_power then - game:delayedLogDamage(src, self, 0, ("#SLATE#(%d absorbed)#LAST#"):tformat(cb.value), false) self.disruption_shield_power = self.disruption_shield_power - cb.value + absorbed = cb.value cb.value = 0 + game:delayedLogDamage(src, self, 0, ("#SLATE#(%d absorbed)#LAST#"):tformat(absorbed), false) return true else - game:delayedLogDamage(src, self, 0, ("#SLATE#(%d absorbed)#LAST#"):tformat(cb.value), false) - self.disruption_shield_power = 0 cb.value = cb.value - self.disruption_shield_power + absorbed = self.disruption_shield_power + self.disruption_shield_power = 0 end local do_explode = false @@ -232,18 +234,23 @@ newTalent{ local mana_usage = cb.value * ratio local store = cb.value + if self.disruption_shield_storage + store >= t.getMaxDamage(self, t) then + do_explode = true + store = t.getMaxDamage(self, t) - self.disruption_shield_storage + mana_usage = store * ratio + end if (self:getMana() - mana_usage) / self:getMaxMana() < 0.5 then do_explode = true local mana_limit = self:getMaxMana() * 0.3 mana_usage = self:getMana() - mana_limit - cb.value = cb.value - mana_usage / ratio store = mana_usage / ratio - else - cb.value = 0 end + cb.value = cb.value - store + absorbed = absorbed + store self:incMana(-mana_usage) self.disruption_shield_storage = math.min(self.disruption_shield_storage + store, t.getMaxDamage(self, t)) + game:delayedLogDamage(src, self, 0, ("#SLATE#(%d absorbed)#LAST#"):tformat(absorbed), false) game:delayedLogDamage(src, self, 0, ("#PURPLE#(%d mana)#LAST#"):tformat(store), false) if do_explode then -- GitLab From d074f9688aa799244708ca7d3c5f373f79d4989b Mon Sep 17 00:00:00 2001 From: otowakotori <806682153@qq.com> Date: Sat, 21 Mar 2020 11:04:52 +0800 Subject: [PATCH 04/20] Avoid Over Mind+Projection abuse http://forums.te4.org/viewtopic.php?f=42&t=50688 --- game/modules/tome/data/talents/psionic/thought-forms.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/game/modules/tome/data/talents/psionic/thought-forms.lua b/game/modules/tome/data/talents/psionic/thought-forms.lua index 827a9a97f7..c02ccca935 100644 --- a/game/modules/tome/data/talents/psionic/thought-forms.lua +++ b/game/modules/tome/data/talents/psionic/thought-forms.lua @@ -533,6 +533,7 @@ newTalent{ no_sustain_autoreset = true, cooldown = 24, no_npc_use = true, + unlearn_on_clone = true, getControlBonus = function(self, t) return self:combatTalentMindDamage(t, 5, 50) end, -- getRangeBonus = function(self, t) return math.floor(self:combatTalentScale(t, 1, 5)) end, on_pre_use = function(self, t, silent) if not game.party:findMember{type="thought-form"} then if not silent then game.logPlayer(self, "You must have an active Thought-Form to use this talent!") end return false end return true end, -- GitLab From 485ebc962520affe91293cb97eaaced8101016e3 Mon Sep 17 00:00:00 2001 From: otowakotori <806682153@qq.com> Date: Sat, 21 Mar 2020 11:18:52 +0800 Subject: [PATCH 05/20] Solipsism threshold fixes http://forums.te4.org/viewtopic.php?f=42&t=50288 --- game/modules/tome/data/talents/psionic/solipsism.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/game/modules/tome/data/talents/psionic/solipsism.lua b/game/modules/tome/data/talents/psionic/solipsism.lua index 8d06fb78ca..e70c48bae4 100644 --- a/game/modules/tome/data/talents/psionic/solipsism.lua +++ b/game/modules/tome/data/talents/psionic/solipsism.lua @@ -35,8 +35,8 @@ newTalent{ return 100 - (100 - talentmod)/lifemod, 1-1/lifemod, talentmod end, - on_levelup_close = function(self, t) - if self:getTalentLevelRaw(t) == 1 then + on_levelup_close = function(self, t, lvl, old_lvl, lvl_raw, old_lvl_raw) + if old_lvl_raw == 0 and lvl_raw >= 1 then self.inc_resource_multi.psi = (self.inc_resource_multi.psi or 0) + 0.5 self.inc_resource_multi.life = (self.inc_resource_multi.life or 0) - 0.25 self.life_rating = math.ceil(self.life_rating/2) -- GitLab From d2b8a47915f80074a8997ef834be638162490b40 Mon Sep 17 00:00:00 2001 From: otowakotori <806682153@qq.com> Date: Sat, 21 Mar 2020 12:30:33 +0800 Subject: [PATCH 06/20] fix ai bug if you don't have preferred_paradox http://forums.te4.org/viewtopic.php?f=42&t=50678 --- game/modules/tome/data/resources.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game/modules/tome/data/resources.lua b/game/modules/tome/data/resources.lua index db12e2586f..e43ff7a3d6 100644 --- a/game/modules/tome/data/resources.lua +++ b/game/modules/tome/data/resources.lua @@ -176,7 +176,7 @@ ActorResource:defineResource(_t"Paradox", "paradox", ActorTalents.T_PARADOX_POOL ai = { -- special ai functions and data tactical = { default_pool_size = 100, -- assumed pool size to account for gains/losses/regeneration want_level = function(act, aitarget) - local value = util.bound(5*(act:getParadox()-act.preferred_paradox)*act.global_speed/300, -10, 5) -- excess paradox + local value = util.bound(5*(act:getParadox()-(act.preferred_paradox or 300))*act.global_speed/300, -10, 5) -- excess paradox value = value + math.min(value, 5*(act:paradoxFailChance()/100)^.5) -- preferred paradox overrides failure chance return value end -- GitLab From 2f2de462d3e2f1f009f7bd22cbdde2cf2ab96b11 Mon Sep 17 00:00:00 2001 From: otowakotori <806682153@qq.com> Date: Sat, 21 Mar 2020 12:32:10 +0800 Subject: [PATCH 07/20] Stoning posion fits better in cunning/poisons-effects --- game/modules/tome/data/talents/cunning/poisons.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game/modules/tome/data/talents/cunning/poisons.lua b/game/modules/tome/data/talents/cunning/poisons.lua index 9e0029427f..1fd0c15c91 100644 --- a/game/modules/tome/data/talents/cunning/poisons.lua +++ b/game/modules/tome/data/talents/cunning/poisons.lua @@ -576,7 +576,7 @@ newTalent{ -- learned from the lost merchant newTalent{ name = "Stoning Poison", - type = {"cunning/poisons", 4}, + type = {"cunning/poisons-effects", 1}, require = {stat = {cun=40}, level=25}, hide = true, points = 1, -- GitLab From bb1383459b1372b9587dd2d062fd7e6c0eadd635 Mon Sep 17 00:00:00 2001 From: otowakotori <806682153@qq.com> Date: Sat, 21 Mar 2020 12:40:51 +0800 Subject: [PATCH 08/20] Rune: Blink los and description bug http://forums.te4.org/viewtopic.php?f=42&t=50677 --- game/modules/tome/data/talents/misc/inscriptions.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/game/modules/tome/data/talents/misc/inscriptions.lua b/game/modules/tome/data/talents/misc/inscriptions.lua index e98665b060..f1b4074e61 100644 --- a/game/modules/tome/data/talents/misc/inscriptions.lua +++ b/game/modules/tome/data/talents/misc/inscriptions.lua @@ -653,7 +653,7 @@ newInscription{ local tg = self:getTalentTarget(t) local x, y = self:getTarget(tg) if not x then return end - if not self:hasLOS(x, y) then return end + if not self:hasLOS(x, y) or game.level.map:checkEntity(x, y, Map.TERRAIN, "block_move") then return end local _ _, x, y = self:canProject(tg, x, y) local rad = 0 @@ -673,7 +673,7 @@ newInscription{ local data = self:getInscriptionData(t.short_name) local power = data.power + data.inc_stat * 3 return ([[Activate the rune to teleport up to %d spaces within line of sight. Afterwards you stay out of phase for %d turns. In this state all new negative status effects duration is reduced by %d%%, your defense is increased by %d and all your resistances by %d%%.]]): - tformat(data.range + data.inc_stat, t.getDur(self, t), power, power, power) + tformat(t.range(self, t), t.getDur(self, t), power, power, power) end, short_info = function(self, t) local data = self:getInscriptionData(t.short_name) -- GitLab From 210867c9d6dd34b0db01c6f72944401d5c6bd868 Mon Sep 17 00:00:00 2001 From: otowakotori <806682153@qq.com> Date: Sat, 21 Mar 2020 17:47:26 +0800 Subject: [PATCH 09/20] No more negative fortress energy http://forums.te4.org/viewtopic.php?f=42&t=50618 --- game/modules/tome/data/chats/shertul-fortress-butler.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game/modules/tome/data/chats/shertul-fortress-butler.lua b/game/modules/tome/data/chats/shertul-fortress-butler.lua index 3ded528458..a1cb195941 100644 --- a/game/modules/tome/data/chats/shertul-fortress-butler.lua +++ b/game/modules/tome/data/chats/shertul-fortress-butler.lua @@ -211,7 +211,7 @@ newChat{ id="permanent-cloak", However, I suggest you still carry it with you in case something manages to remove it from you.]], answers = { {_t"Not now."}, - {_t"That could be quite useful. Yes, please do it.", action=function(npc, player) + {_t"That could be quite useful. Yes, please do it.", cond=function() return q.shertul_energy >= 10 end,action=function(npc, player) local cloak = player:findInAllInventoriesBy("define_as", "CLOAK_DECEPTION") cloak.upgraded_cloak = true player.permanent_undead_cloak = true -- Prevents the effect being removed from moving the flags -- GitLab From a91077c085f4aab03d07f48754df56342e627600 Mon Sep 17 00:00:00 2001 From: otowakotori <806682153@qq.com> Date: Sun, 22 Mar 2020 10:55:48 +0800 Subject: [PATCH 10/20] Eyal's Wrath have correct duration http://forums.te4.org/viewtopic.php?f=42&t=50656 --- game/modules/tome/data/talents/gifts/eyals-fury.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game/modules/tome/data/talents/gifts/eyals-fury.lua b/game/modules/tome/data/talents/gifts/eyals-fury.lua index b550e86ba0..9f8433b6f9 100644 --- a/game/modules/tome/data/talents/gifts/eyals-fury.lua +++ b/game/modules/tome/data/talents/gifts/eyals-fury.lua @@ -195,7 +195,7 @@ newTalent{ action = function(self, t) -- Add a lasting map effect local eff = game.level.map:addEffect(self, - self.x, self.y, 7, + self.x, self.y, t.getDuration(self, t), DamageType.NATURE, self:mindCrit(t.getDamage(self, t)), t.radius(self, t), 5, nil, -- GitLab From c0621729e9354f21e55f54f61fb557f7efe7e00f Mon Sep 17 00:00:00 2001 From: otowakotori <806682153@qq.com> Date: Sun, 22 Mar 2020 12:10:29 +0800 Subject: [PATCH 11/20] Stalked will not stop enter worldmap --- game/modules/tome/data/timed_effects/mental.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/game/modules/tome/data/timed_effects/mental.lua b/game/modules/tome/data/timed_effects/mental.lua index d5833c7729..74bcf3b4f2 100644 --- a/game/modules/tome/data/timed_effects/mental.lua +++ b/game/modules/tome/data/timed_effects/mental.lua @@ -468,6 +468,7 @@ newEffect{ type = "mental", subtype = { veil=true }, status = "detrimental", + no_stop_enter_worlmap = true, cancel_on_level_change = true, parameters = {}, activate = function(self, eff) local effStalker = eff.src:hasEffect(eff.src.EFF_STALKER) -- GitLab From e6e79a5e8b412b85977bdcb374ed2033f827c5bd Mon Sep 17 00:00:00 2001 From: otowakotori <806682153@qq.com> Date: Sun, 22 Mar 2020 16:21:20 +0800 Subject: [PATCH 12/20] grapple will check if target can be silence/slowed --- game/modules/tome/class/interface/Combat.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/game/modules/tome/class/interface/Combat.lua b/game/modules/tome/class/interface/Combat.lua index ea5236bac9..90c02548ca 100644 --- a/game/modules/tome/class/interface/Combat.lua +++ b/game/modules/tome/class/interface/Combat.lua @@ -2746,6 +2746,13 @@ function _M:startGrapple(target) grappleParam["sharePct"] = t.getSharePct(self, t) -- damage shared with grappled set by Clinch end + + if grappledParam.silence == 1 and not target:canBe("silence") then + grappledParam.silence = 0 + end + if grappledParam.slow == 1 and not target:canBe("slow") then + grappledParam.slow = 0 + end -- oh for the love of god why didn't I rewrite this entire structure grappledParam["src"] = self grappledParam["apply_power"] = self:combatPhysicalpower() -- GitLab From 1d31c4f23802431ffefa84a77cf64d68adc48262 Mon Sep 17 00:00:00 2001 From: otowakotori <806682153@qq.com> Date: Sun, 22 Mar 2020 23:32:42 +0800 Subject: [PATCH 13/20] fix EFF_DWARVEN_RESILIENCE bug Also, we should not have two EFF_DWARVEN_RESILIENCE --- .../tome/data/timed_effects/physical.lua | 28 ++----------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/game/modules/tome/data/timed_effects/physical.lua b/game/modules/tome/data/timed_effects/physical.lua index f3c7bc8bfa..88a38c4d87 100644 --- a/game/modules/tome/data/timed_effects/physical.lua +++ b/game/modules/tome/data/timed_effects/physical.lua @@ -672,28 +672,6 @@ newEffect{ end, } -newEffect{ - name = "DWARVEN_RESILIENCE", image = "talents/dwarf_resilience.png", - desc = _t"Dwarven Resilience", - long_desc = function(self, eff) return ("The target's skin turns to stone, granting %d armour, %d physical save and %d spell save."):tformat(eff.armor, eff.physical, eff.spell) end, - type = "physical", - subtype = { earth=true }, - status = "beneficial", - parameters = { armor=10, spell=10, physical=10 }, - on_gain = function(self, err) return _t"#Target#'s skin turns to stone." end, - on_lose = function(self, err) return _t"#Target#'s skin returns to normal." end, - activate = function(self, eff) - eff.aid = self:addTemporaryValue("combat_armor", eff.armor) - eff.pid = self:addTemporaryValue("combat_physresist", eff.physical) - eff.sid = self:addTemporaryValue("combat_spellresist", eff.spell) - end, - deactivate = function(self, eff) - self:removeTemporaryValue("combat_armor", eff.aid) - self:removeTemporaryValue("combat_physresist", eff.pid) - self:removeTemporaryValue("combat_spellresist", eff.sid) - end, -} - newEffect{ name = "STONE_SKIN", image = "talents/stoneskin.png", desc = _t"Stoneskin", @@ -3635,15 +3613,15 @@ newEffect{ desc = _t"Dwarven Resilience", long_desc = function(self, eff) if eff.mid_ac then - return ("The target's skin turns to stone, granting %d armour, %d physical save and %d spell save. Also applies %d armour to all non-physical damage."):tformat(eff.armor, eff.physical, eff.spell, eff.mid_ac) + return ("The target's skin turns to stone, granting %d armour, %d%% armour hardiness, %d physical save and %d spell save. Also applies %d armour to all non-physical damage."):tformat(eff.armor, eff.armor_hardiness, eff.physical, eff.spell, eff.mid_ac) else - return ("The target's skin turns to stone, granting %d armour, %d physical save and %d spell save."):tformat(eff.armor, eff.physical, eff.spell) + return ("The target's skin turns to stone, granting %d armour, %d%% armour hardiness, %d physical save and %d spell save."):tformat(eff.armor, eff.armor_hardiness, eff.physical, eff.spell) end end, type = "physical", subtype = { earth=true }, status = "beneficial", - parameters = { armor=10, spell=10, physical=10 }, + parameters = { armor=10, armor_hardiness=20, spell=10, physical=10 }, on_gain = function(self, err) return _t"#Target#'s skin turns to stone." end, on_lose = function(self, err) return _t"#Target#'s skin returns to normal." end, activate = function(self, eff) -- GitLab From 55b79f0c942744fa5b27ae6f91070032cb9c5726 Mon Sep 17 00:00:00 2001 From: otowakotori <806682153@qq.com> Date: Mon, 23 Mar 2020 08:37:48 +0800 Subject: [PATCH 14/20] !." typos --- game/modules/tome/class/GameState.lua | 2 +- game/modules/tome/data/timed_effects/magical.lua | 4 ++-- game/modules/tome/data/timed_effects/mental.lua | 2 +- game/modules/tome/data/timed_effects/other.lua | 6 +++--- game/modules/tome/data/timed_effects/physical.lua | 6 +++--- game/modules/tome/data/zones/mark-spellblaze/objects.lua | 2 +- game/modules/tome/data/zones/sandworm-lair/objects.lua | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/game/modules/tome/class/GameState.lua b/game/modules/tome/class/GameState.lua index ca08d3532c..4225011767 100644 --- a/game/modules/tome/class/GameState.lua +++ b/game/modules/tome/class/GameState.lua @@ -3557,7 +3557,7 @@ function _M:infiniteDungeonChallengeFinish(zone, level) end) level.turn_counter = turns * 10 level.max_turn_counter = turns * 10 - level.turn_counter_desc = _t"Survive the multiplicative madness!." + level.turn_counter_desc = _t"Survive the multiplicative madness!" end end, _t"Refuse", _t"Accept", true) elseif id_challenge == "headhunter" then local mlist = {} -- add random elite "spawns of Urh'Rok" diff --git a/game/modules/tome/data/timed_effects/magical.lua b/game/modules/tome/data/timed_effects/magical.lua index df9a8322b3..c2fdbc7459 100644 --- a/game/modules/tome/data/timed_effects/magical.lua +++ b/game/modules/tome/data/timed_effects/magical.lua @@ -509,7 +509,7 @@ newEffect{ subtype = { bane=true, confusion=true }, status = "detrimental", parameters = { power=50, dam=10 }, - on_gain = function(self, err) return _t"#Target# wanders around!.", _t"+Confused" end, + on_gain = function(self, err) return _t"#Target# wanders around!", _t"+Confused" end, on_lose = function(self, err) return _t"#Target# seems more focused.", _t"-Confused" end, on_timeout = function(self, eff) DamageType:get(DamageType.DARKNESS).projector(eff.src, self.x, self.y, DamageType.DARKNESS, eff.dam) @@ -2600,7 +2600,7 @@ newEffect{ subtype = { arcane=true }, status = "detrimental", parameters = { dam=10 }, - on_gain = function(self, err) return _t"#Target# is focused by an arcane vortex!.", _t"+Arcane Vortex" end, + on_gain = function(self, err) return _t"#Target# is focused by an arcane vortex!", _t"+Arcane Vortex" end, on_lose = function(self, err) return _t"#Target# is free from the arcane vortex.", _t"-Arcane Vortex" end, on_timeout = function(self, eff) if not self.x then return end diff --git a/game/modules/tome/data/timed_effects/mental.lua b/game/modules/tome/data/timed_effects/mental.lua index 74bcf3b4f2..c3ea36f233 100644 --- a/game/modules/tome/data/timed_effects/mental.lua +++ b/game/modules/tome/data/timed_effects/mental.lua @@ -131,7 +131,7 @@ newEffect{ subtype = { confusion=true }, status = "detrimental", parameters = { power=30 }, - on_gain = function(self, err) return _t"#Target# wanders around!.", _t"+Confused" end, + on_gain = function(self, err) return _t"#Target# wanders around!", _t"+Confused" end, on_lose = function(self, err) return _t"#Target# seems more focused.", _t"-Confused" end, activate = function(self, eff) eff.power = math.floor(util.bound(eff.power, 0, 50)) diff --git a/game/modules/tome/data/timed_effects/other.lua b/game/modules/tome/data/timed_effects/other.lua index 48df28488c..1702240ae7 100644 --- a/game/modules/tome/data/timed_effects/other.lua +++ b/game/modules/tome/data/timed_effects/other.lua @@ -495,7 +495,7 @@ newEffect{ subtype = { miscellaneous=true }, status = "detrimental", parameters = { }, - on_gain = function(self, err) return _t"#LIGHT_RED##Target# is out of sight of its master; direct control will break!.", _t"+Out of sight" end, + on_gain = function(self, err) return _t"#LIGHT_RED##Target# is out of sight of its master; direct control will break!", _t"+Out of sight" end, activate = function(self, eff) end, deactivate = function(self, eff) @@ -522,7 +522,7 @@ newEffect{ subtype = { miscellaneous=true }, status = "detrimental", parameters = { }, - on_gain = function(self, err) return _t"#LIGHT_RED##Target# is out of sight of its master; direct control will break!.", _t"+Out of sight" end, + on_gain = function(self, err) return _t"#LIGHT_RED##Target# is out of sight of its master; direct control will break!", _t"+Out of sight" end, activate = function(self, eff) end, deactivate = function(self, eff) @@ -549,7 +549,7 @@ newEffect{ subtype = { miscellaneous=true }, status = "detrimental", parameters = { }, - on_gain = function(self, err) return _t"#LIGHT_RED##Target# is out of sight of its master; direct control will break!.", _t"+Out of sight" end, + on_gain = function(self, err) return _t"#LIGHT_RED##Target# is out of sight of its master; direct control will break!", _t"+Out of sight" end, activate = function(self, eff) end, deactivate = function(self, eff) diff --git a/game/modules/tome/data/timed_effects/physical.lua b/game/modules/tome/data/timed_effects/physical.lua index 88a38c4d87..bf23d3ddba 100644 --- a/game/modules/tome/data/timed_effects/physical.lua +++ b/game/modules/tome/data/timed_effects/physical.lua @@ -1265,7 +1265,7 @@ newEffect{ subtype = { speed=true, tactic=true }, status = "beneficial", parameters = {power=1000}, - on_gain = function(self, err) return _t"#Target# prepares for the next kill!.", _t"+Step Up" end, + on_gain = function(self, err) return _t"#Target# prepares for the next kill!", _t"+Step Up" end, on_lose = function(self, err) return _t"#Target# slows down.", _t"-Step Up" end, get_fractional_percent = function(self, eff) local d = game.turn - eff.start_turn @@ -1295,7 +1295,7 @@ newEffect{ subtype = { lightning=true, speed=true }, status = "beneficial", parameters = {}, - on_gain = function(self, err) return _t"#Target# turns into pure lightning!.", _t"+Lightning Speed" end, + on_gain = function(self, err) return _t"#Target# turns into pure lightning!", _t"+Lightning Speed" end, on_lose = function(self, err) return _t"#Target# is back to normal.", _t"-Lightning Speed" end, get_fractional_percent = function(self, eff) local d = game.turn - eff.start_turn @@ -3819,7 +3819,7 @@ newEffect{ subtype = { tactic=true, speed=true }, status = "beneficial", parameters = {power=1000}, - on_gain = function(self, err) return _t"#Target# enters an evasive stance!.", _t"+Escape!" end, + on_gain = function(self, err) return _t"#Target# enters an evasive stance!", _t"+Escape!" end, on_lose = function(self, err) return _t"#Target# slows down.", _t"-Escape" end, get_fractional_percent = function(self, eff) local d = game.turn - eff.start_turn diff --git a/game/modules/tome/data/zones/mark-spellblaze/objects.lua b/game/modules/tome/data/zones/mark-spellblaze/objects.lua index bb2fcc3eec..8902b513e3 100644 --- a/game/modules/tome/data/zones/mark-spellblaze/objects.lua +++ b/game/modules/tome/data/zones/mark-spellblaze/objects.lua @@ -56,7 +56,7 @@ newEntity{ end -- Make sure a previous amulet didnt bug it out if who:getTalentTypeMastery("corruption/vile-life") == 0 then who:setTalentTypeMastery("corruption/vile-life", 1) end - game.logPlayer(who, "You are transformed by the corrupted heart of the Queen!.") + game.logPlayer(who, "You are transformed by the corrupted heart of the Queen!") game.logPlayer(who, "#00FF00#You gain an affinity for blight. You can now learn new Vile Life talents (press p).") who:attr("drake_touched", 1) diff --git a/game/modules/tome/data/zones/sandworm-lair/objects.lua b/game/modules/tome/data/zones/sandworm-lair/objects.lua index d6a42d05ba..5bd15e95af 100644 --- a/game/modules/tome/data/zones/sandworm-lair/objects.lua +++ b/game/modules/tome/data/zones/sandworm-lair/objects.lua @@ -59,7 +59,7 @@ You could ... consume it, should you feel mad enough or you could try to corrupt end -- Make sure a previous amulet didnt bug it out if who:getTalentTypeMastery("wild-gift/harmony") == 0 then who:setTalentTypeMastery("wild-gift/harmony", 1) end - game.logPlayer(who, "You are transformed by the heart of the Queen!.") + game.logPlayer(who, "You are transformed by the heart of the Queen!") game.logPlayer(who, "#00FF00#You gain an affinity for nature. You can now learn new Harmony talents (press p).") who:attr("drake_touched", 1) -- GitLab From a3cd40d89f9c3dcb50fb0e910720f83e2e435b30 Mon Sep 17 00:00:00 2001 From: otowakotori <806682153@qq.com> Date: Wed, 25 Mar 2020 12:23:23 +0800 Subject: [PATCH 15/20] Fix Poltergeist duplicate uniques (my fault!) --- .../tome/data/maps/vaults/auto/greater/living-weapons.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/game/modules/tome/data/maps/vaults/auto/greater/living-weapons.lua b/game/modules/tome/data/maps/vaults/auto/greater/living-weapons.lua index 3aa0e2da0b..ea59ab3754 100644 --- a/game/modules/tome/data/maps/vaults/auto/greater/living-weapons.lua +++ b/game/modules/tome/data/maps/vaults/auto/greater/living-weapons.lua @@ -236,6 +236,7 @@ local make_poltergeist = function(type) --if class == e:resolve() e:resolve(nil, true) + game.zone:addEntity(game.level, o, "object") e:wearObject(o, true, false, "MAINHAND") for _, v in ipairs(el) do e:wearObject(v[1], true, false, v[2]) -- GitLab From 077ef00b4ebb5ca76bbe2b42c3020355b9c3423b Mon Sep 17 00:00:00 2001 From: otowakotori <806682153@qq.com> Date: Thu, 26 Mar 2020 22:49:37 +0800 Subject: [PATCH 16/20] Fix Sentinel not putting initial talent on cd. http://forums.te4.org/viewtopic.php?f=42&t=50812 --- game/modules/tome/class/Actor.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua index ae0b786e57..d711dbd532 100644 --- a/game/modules/tome/class/Actor.lua +++ b/game/modules/tome/class/Actor.lua @@ -5856,6 +5856,8 @@ function _M:preUseTalent(ab, silent, fake) if self:hasEffect(self.EFF_SENTINEL) and (ab.mode ~= "sustained" or not self:isTalentActive(ab.id)) and util.getval(ab.no_energy, self, ab) ~= true and not fake and not self:attr("force_talent_ignore_ressources") then if not silent then game.logSeen(self, "%s's %s is interrupted by the shot!", self:getName():capitalize(), ab.name) end + local cdr = self:getTalentCooldown(ab) + self.talents_cd[ab.id] = cdr self.tempeffect_def[self.EFF_SENTINEL].do_proc(self, self:hasEffect(self.EFF_SENTINEL)) self:useEnergy() self:fireTalentCheck("callbackOnTalentDisturbed", t) -- GitLab From e094271ea0b29ae08af9a8436b9faf933b3f3db7 Mon Sep 17 00:00:00 2001 From: otowakotori <806682153@qq.com> Date: Thu, 26 Mar 2020 23:07:24 +0800 Subject: [PATCH 17/20] fix Shattering Shout bug --- game/modules/tome/data/talents/techniques/warcries.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game/modules/tome/data/talents/techniques/warcries.lua b/game/modules/tome/data/talents/techniques/warcries.lua index 0296a9f48f..848ec200bc 100644 --- a/game/modules/tome/data/talents/techniques/warcries.lua +++ b/game/modules/tome/data/talents/techniques/warcries.lua @@ -55,7 +55,7 @@ newTalent{ return ([[Release a powerful shout, doing %0.2f physical damage in a radius %d cone in front of you. At level 5 the shout is so strong it shatters all incomming projectiles caught inside. The damage increases with your Strength.]]) - :tformat(damDesc(self, DamageType.PHYSICAL, t.getdamage(self,t)), t.radius(self,t)) + :tformat(damDesc(self, DamageType.PHYSICAL, t.getDamage(self,t)), t.radius(self,t)) end, } -- GitLab From 96455acb28a06fd44aab4eeab30be0997c163de4 Mon Sep 17 00:00:00 2001 From: otowakotori <806682153@qq.com> Date: Fri, 27 Mar 2020 10:06:12 +0800 Subject: [PATCH 18/20] add on_pre_use for corruption/scourge talents --- .../tome/data/talents/corruptions/scourge.lua | 36 ++++++++++++------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/game/modules/tome/data/talents/corruptions/scourge.lua b/game/modules/tome/data/talents/corruptions/scourge.lua index 2a1bda52a3..6289b1552a 100644 --- a/game/modules/tome/data/talents/corruptions/scourge.lua +++ b/game/modules/tome/data/talents/corruptions/scourge.lua @@ -36,12 +36,16 @@ newTalent{ requires_target = true, getIncrease = function(self, t) return math.floor(self:combatTalentLimit(t, 4, 1, 3.5)) end, getDamage = function(self, t) return self:combatTalentWeaponDamage(t, 0.8, 1.6) end, + on_pre_use = function(self, t, silent) + if not self:hasDualWeapon() then + if not silent then game.logPlayer(self, "You cannot use Virulent Strike without two weapons!") end + return false + end + return true + end, action = function(self, t) local weapon, offweapon = self:hasDualWeapon() - if not weapon then - game.logPlayer(self, "You cannot use Virulent Strike without two weapons!") - return nil - end + if not weapon then return nil end local tg = self:getTalentTarget(t) local x, y, target = self:getTarget(tg) @@ -132,12 +136,16 @@ newTalent{ end, getSplash = function(self, t) return self:combatTalentSpellDamage(t, 10, 200) end, getDamage = function(self, t) return self:combatTalentWeaponDamage(t, 0.8, 1.6) end, + on_pre_use = function(self, t, silent) + if not self:hasDualWeapon() then + if not silent then game.logPlayer(self, "You cannot use Acid Strike without two weapons!") end + return false + end + return true + end, action = function(self, t) local weapon, offweapon = self:hasDualWeapon() - if not weapon then - game.logPlayer(self, "You cannot use Acid Strike without two weapons!") - return nil - end + if not weapon then return nil end local tg = {type="hit", range=self:getTalentRange(t)} local x, y, target = self:getTarget(tg) @@ -182,12 +190,16 @@ newTalent{ tactical = { ATTACK = {BLIGHT = 1},}, target = function(self, t) return {type="hit", range=self:getTalentRange(t)} end, getDamage = function(self, t) return self:combatTalentWeaponDamage(t, 1, 2) end, + on_pre_use = function(self, t, silent) + if not self:hasDualWeapon() then + if not silent then game.logPlayer(self, "You cannot use Corrupting Strike without two weapons!") end + return false + end + return true + end, action = function(self, t) local weapon, offweapon = self:hasDualWeapon() - if not weapon then - game.logPlayer(self, "You cannot use Corrupting Strike without two weapons!") - return nil - end + if not weapon then return nil end local tg = self:getTalentTarget(t) local x, y, target = self:getTarget(tg) -- GitLab From fd3b48340ec06f701b471a52388572d19295fc9d Mon Sep 17 00:00:00 2001 From: otowakotori <806682153@qq.com> Date: Fri, 27 Mar 2020 10:21:06 +0800 Subject: [PATCH 19/20] Bone grab will correctly fail if not hitting target. --- .../tome/data/talents/corruptions/bone.lua | 89 +++++++++---------- 1 file changed, 42 insertions(+), 47 deletions(-) diff --git a/game/modules/tome/data/talents/corruptions/bone.lua b/game/modules/tome/data/talents/corruptions/bone.lua index 47587bb02b..f7cc85d21e 100644 --- a/game/modules/tome/data/talents/corruptions/bone.lua +++ b/game/modules/tome/data/talents/corruptions/bone.lua @@ -73,60 +73,55 @@ newTalent{ getDamage = function(self, t) return self:combatTalentSpellDamage(t, 5, 140) end, action = function(self, t) local tg = {type="bolt", range=self:getTalentRange(t), friendlyblock=false, talent=t} - local x, y = self:getTarget(tg) - if not x or not y then return nil end - + local x, y, target = self:getTargetLimited(tg) + if not target then return nil end + local dam = self:spellCrit(t.getDamage(self, t)) - self:project(tg, x, y, function(px, py) - local target = game.level.map(px, py, engine.Map.ACTOR) - if not target then return end + if core.fov.distance(self.x, self.y, target.x, target.y) > 1 then + DamageType:get(DamageType.PHYSICAL).projector(self, target.x, target.y, DamageType.PHYSICAL, dam) + if target:canBe("pin") then + target:setEffect(target.EFF_BONE_GRAB, t.getDuration(self, t), {apply_power=self:combatSpellpower()}) + else + game.logSeen(target, "%s resists the pin!", target:getName():capitalize()) + end - if core.fov.distance(self.x, self.y, target.x, target.y) > 1 then - DamageType:get(DamageType.PHYSICAL).projector(self, target.x, target.y, DamageType.PHYSICAL, dam) - if target:canBe("pin") then - target:setEffect(target.EFF_BONE_GRAB, t.getDuration(self, t), {apply_power=self:combatSpellpower()}) - else - game.logSeen(target, "%s resists the pin!", target:getName():capitalize()) - end + local hit = self:checkHit(self:combatSpellpower(), target:combatSpellResist() + (target:attr("continuum_destabilization") or 0)) + if not target:canBe("teleport") or not hit then + game.logSeen(target, "%s resists being teleported by Bone Grab!", target:getName():capitalize()) + return true + end - local hit = self:checkHit(self:combatSpellpower(), target:combatSpellResist() + (target:attr("continuum_destabilization") or 0)) - if not target:canBe("teleport") or not hit then - game.logSeen(target, "%s resists being teleported by Bone Grab!", target:getName():capitalize()) - return true - end + -- Grab the closest adjacent grid that doesn't have block_move or no_teleport + local grid = util.closestAdjacentCoord(self.x, self.y, target.x, target.y, true, function(x, y) return game.level.map.attrs(x, y, "no_teleport") end) + if not grid then return true end + target:teleportRandom(grid[1], grid[2], 0) + else + local tg = {type="cone", cone_angle=90, range=0, radius=6, friendlyfire=false} + + local grids = {} + self:project(tg, x, y, function(px, py) + if game.level.map(tx, ty, engine.Map.ACTOR) then return end + grids[#grids+1] = {px, py, core.fov.distance(self.x, self.y, px, py)} + end) + table.sort(grids, function(a, b) return a[3] > b[3] end ) - -- Grab the closest adjacent grid that doesn't have block_move or no_teleport - local grid = util.closestAdjacentCoord(self.x, self.y, target.x, target.y, true, function(x, y) return game.level.map.attrs(x, y, "no_teleport") end) - if not grid then return true end - target:teleportRandom(grid[1], grid[2], 0) + DamageType:get(DamageType.PHYSICAL).projector(self, target.x, target.y, DamageType.PHYSICAL, dam) + if target:canBe("pin") then + target:setEffect(target.EFF_BONE_GRAB, t.getDuration(self, t), {apply_power=self:combatSpellpower()}) else - local tg = {type="cone", cone_angle=90, range=0, radius=6, friendlyfire=false} - - local grids = {} - self:project(tg, x, y, function(px, py) - if game.level.map(tx, ty, engine.Map.ACTOR) then return end - grids[#grids+1] = {px, py, core.fov.distance(self.x, self.y, px, py)} - end) - table.sort(grids, function(a, b) return a[3] > b[3] end ) - - DamageType:get(DamageType.PHYSICAL).projector(self, target.x, target.y, DamageType.PHYSICAL, dam) - if target:canBe("pin") then - target:setEffect(target.EFF_BONE_GRAB, t.getDuration(self, t), {apply_power=self:combatSpellpower()}) - else - game.logSeen(target, "%s resists the pin!", target:getName():capitalize()) - end + game.logSeen(target, "%s resists the pin!", target:getName():capitalize()) + end - local hit = self:checkHit(self:combatSpellpower(), target:combatSpellResist() + (target:attr("continuum_destabilization") or 0)) - if not target:canBe("teleport") or not hit then - game.logSeen(target, "%s resists being teleported by Bone Grab!", target:getName():capitalize()) - return true - end - - if #grids <= 0 then return end - target:teleportRandom(grids[1][1], grids[1][2], 0) + local hit = self:checkHit(self:combatSpellpower(), target:combatSpellResist() + (target:attr("continuum_destabilization") or 0)) + if not target:canBe("teleport") or not hit then + game.logSeen(target, "%s resists being teleported by Bone Grab!", target:getName():capitalize()) + return true end - end) - game:playSoundNear(self, "talents/arcane") + + if #grids <= 0 then return end + target:teleportRandom(grids[1][1], grids[1][2], 0) + end + game:playSoundNear(self, "talents/arcane") return true end, info = function(self, t) -- GitLab From 1d105aba8ebb5094f1783b1c38b193fe7594a70c Mon Sep 17 00:00:00 2001 From: otowakotori <806682153@qq.com> Date: Sun, 19 Apr 2020 12:30:00 +0800 Subject: [PATCH 20/20] Fix DAMAGE_SHIELD, my fault sorry! --- game/modules/tome/data/timed_effects/magical.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game/modules/tome/data/timed_effects/magical.lua b/game/modules/tome/data/timed_effects/magical.lua index ad1ffe1f02..1259ac967e 100644 --- a/game/modules/tome/data/timed_effects/magical.lua +++ b/game/modules/tome/data/timed_effects/magical.lua @@ -772,7 +772,7 @@ newEffect{ on_merge = function(self, old_eff, new_eff) local new_eff_adj = {} -- Adjust for shield modifiers new_eff_adj.power = self:getShieldAmount(new_eff.power) - new_eff_adj.dur = self:getShieldDuration(new_eff_adj.dur) + new_eff_adj.dur = self:getShieldDuration(new_eff.dur) -- If the new shield would be stronger than the existing one, just replace it if old_eff.dur > new_eff_adj.dur then return old_eff end if math.max(self.damage_shield_absorb, self.damage_shield_absorb_max) <= new_eff_adj.power then -- GitLab