From 1bbeb0adf0e50db2a12794bd6ae3f5d563d06a5e Mon Sep 17 00:00:00 2001 From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54> Date: Wed, 26 Dec 2012 10:01:02 +0000 Subject: [PATCH] Casting Cease to Exist on oneself is a bad idea git-svn-id: http://svn.net-core.org/repos/t-engine4@6234 51575b47-30f0-44d4-a5cc-537603b46e54 --- game/engines/default/engine/utils.lua | 6 ++++++ game/modules/tome/class/GameState.lua | 19 ++++++++++++++----- .../tome/data/talents/chronomancy/paradox.lua | 7 +++++++ 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/game/engines/default/engine/utils.lua b/game/engines/default/engine/utils.lua index 1192586349..b3ac8c7f6e 100644 --- a/game/engines/default/engine/utils.lua +++ b/game/engines/default/engine/utils.lua @@ -363,6 +363,12 @@ function string.a_an(str) else return "a "..str end end +function string.his_her(actor) + if actor.female then return "her" + else return "his" + end +end + function string.capitalize(str) if #str > 1 then return string.upper(str:sub(1, 1))..str:sub(2) diff --git a/game/modules/tome/class/GameState.lua b/game/modules/tome/class/GameState.lua index 5475c40865..88e3c40704 100644 --- a/game/modules/tome/class/GameState.lua +++ b/game/modules/tome/class/GameState.lua @@ -734,11 +734,20 @@ function _M:checkDonation(back_insert) end -- Dont ask often - local last = profile.mod.donations and profile.mod.donations.last_ask or 0 - local min_interval = 15 * 24 * 60 * 60 -- 1 month - if os.time() < last + min_interval then - print("Donation check: too soon") - return + if profile.auth and tonumber(profile.auth.donated) then + local last = profile.mod.donations and profile.mod.donations.last_ask or 0 + local min_interval = 30 * 24 * 60 * 60 -- 1 month + if os.time() < last + min_interval then + print("Donation check: too soon (donator)") + return + end + else + local last = profile.mod.donations and profile.mod.donations.last_ask or 0 + local min_interval = 7 * 24 * 60 * 60 -- 1 week + if os.time() < last + min_interval then + print("Donation check: too soon (player)") + return + end end -- Not as soon as they start playing, wait 15 minutes diff --git a/game/modules/tome/data/talents/chronomancy/paradox.lua b/game/modules/tome/data/talents/chronomancy/paradox.lua index 7dbc07cf6b..12272cafe1 100644 --- a/game/modules/tome/data/talents/chronomancy/paradox.lua +++ b/game/modules/tome/data/talents/chronomancy/paradox.lua @@ -84,6 +84,13 @@ newTalent{ local target = game.level.map(tx, ty, Map.ACTOR) if not target then return end + + if target == self then + game.logSeen(self, "#LIGHT_STEEL_BLUE#%s tries to remove %sself from existance!", self.name, string.his_her(self)) + self:incParadox(400) + game.level.map:particleEmitter(self.x, self.y, 1, "ball_temporal", {radius=1, tx=self.x, ty=self.y}) + return true + end -- does the spell hit? if not nothing happens if not self:checkHit(self:combatSpellpower(), target:combatSpellResist()) then -- GitLab