diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua index f287c39ac3efb24ed29a6faf552e9c26c4bd20aa..da24c665038d91d9b2608f2a107600cebf3cebab 100644 --- a/game/modules/tome/class/Actor.lua +++ b/game/modules/tome/class/Actor.lua @@ -5344,8 +5344,9 @@ function _M:paradoxDoAnomaly(chance, paradox, def) game.bignews:saySimple(180, "#STEEL_BLUE#Targeting %s", anom.name) end - -- targeted talents don't work well with no_energy, so we call the action directly - anom.action(self, anom) + -- Targeted talents don't work well with no_energy, so we call the action directly. + -- In addition, prevent targeting from being cancelled by the player. + anom.doAction(self, anom, false) elseif def.ignore_energy then self:forceUseTalent(anom, {force_target=def.target or self, ignore_energy=true}) elseif self:knowTalent(self.T_TWIST_FATE) and not self:isTalentCoolingDown(self.T_TWIST_FATE) then diff --git a/game/modules/tome/data/talents/chronomancy/anomalies.lua b/game/modules/tome/data/talents/chronomancy/anomalies.lua index 1d7365383b61cc42e80a1b2516222042e41342da..82fbe92754919f55892256f8f2dc866195f87d86 100644 --- a/game/modules/tome/data/talents/chronomancy/anomalies.lua +++ b/game/modules/tome/data/talents/chronomancy/anomalies.lua @@ -122,11 +122,13 @@ newTalent{ return {type="ball", range=self:getTalentRange(t), radius=self:getTalentRadius(t)} end, message = "@Source@ causes a spacetime hiccup.", - action = function(self, t) + doAction = function(self, t, cancellable) local tg = self:getTalentTarget(t) local x, y = self:getTarget(tg) local _ _, _, _, x, y = self:canProject(tg, x, y) - if not x or not y then x, y = self.x, self.y end + if not x or not y then + if cancellable then return nil else x, y = self.x, self.y end + end local tgts = getAnomalyTargets(self, t, x, y, "ACTOR", self:getTalentRadius(t)) @@ -136,7 +138,7 @@ newTalent{ local a, id = rng.table(tgts) table.remove(tgts, id) checkAnomalyTriggers(self, a) - + if a:canBe("teleport") and a:canBe("anomaly") then game.level.map:particleEmitter(a.x, a.y, 1, "temporal_teleport") a:teleportRandom(a.x, a.y, 10, 1) @@ -145,6 +147,9 @@ newTalent{ end return true end, + action = function(self, t, cancellable) + t.doAction(self, t, true) + end, info = function(self, t) local radius = self:getTalentRadius(t) return ([[Teleports up to five targets in a radius of %d up to ten tiles away.]]):format(radius) @@ -168,11 +173,13 @@ newTalent{ return {type="ball", range=10, radius=self:getTalentRadius(t)} end, message = "@Source@ shifts reality.", - action = function(self, t) + doAction = function(self, t, cancellable) local tg = self:getTalentTarget(t) local x, y = self:getTarget(tg) local _ _, _, _, x, y = self:canProject(tg, x, y) - if not x or not y then x, y = self.x, self.y end + if not x or not y then + if cancellable then return nil else x, y = self.x, self.y end + end local tgts = getAnomalyTargets(self, t, x, y, "ACTOR", self:getTalentRadius(t)) -- Randomly take targets @@ -190,6 +197,9 @@ newTalent{ end return true end, + action = function(self, t, cancellable) + t.doAction(self, t, true) + end, info = function(self, t) local range = self:getTalentRange(t) local radius = self:getTalentRadius(t) @@ -214,11 +224,13 @@ newTalent{ return {type="ball", range=self:getTalentRange(t), radius=self:getTalentRadius(t)} end, message = "@Source@ swaps places with a nearby target.", - action = function(self, t) + doAction = function(self, t, cancellable) local tg = self:getTalentTarget(t) local x, y = self:getTarget(tg) local _ _, _, _, x, y = self:canProject(tg, x, y) - if not x or not y then x, y = self.x, self.y end + if not x or not y then + if cancellable then return nil else x, y = self.x, self.y end + end local tgts = getAnomalyTargets(self, t, x, y, "ACTOR", self:getTalentRange(t), true) -- Randomly take targets @@ -248,6 +260,9 @@ newTalent{ return true end, + action = function(self, t, cancellable) + t.doAction(self, t, true) + end, info = function(self, t) return ([[You swap locations with a random target.]]):format() end, @@ -270,11 +285,13 @@ newTalent{ return {type="hit", range=self:getTalentRange(t), nowarning=true} end, message = "@Source@ transfers damage to a nearby target.", - action = function(self, t) + doAction = function(self, t, cancellable) local tg = self:getTalentTarget(t) local x, y = self:getTarget(tg) local _ _, _, _, x, y = self:canProject(tg, x, y) - if not x or not y then x, y = self.x, self.y end + if not x or not y then + if cancellable then return nil else x, y = self.x, self.y end + end local tgts = getAnomalyTargets(self, t, x, y, "ACTOR", self:getTalentRadius(t), true) -- Randomly take targets @@ -293,6 +310,9 @@ newTalent{ return true end, + action = function(self, t, cancellable) + t.doAction(self, t, true) + end, info = function(self, t) return ([[50%% chance that damage the caster takes will be warped to a set target. Once the maximum damage (%d) is absorbed, the time runs out, or the target dies, the shield will crumble.]]):format(getAnomalyDamage(self, t)*2) @@ -315,11 +335,13 @@ newTalent{ return {type="bolt", nowarning=true, range=10, nolock=true, simple_dir_request=true, talent=t} end, message = "@Source@ folds the space between two points.", - action = function(self, t) + doAction = function(self, t, cancellable) local tg = self:getTalentTarget(t) local x, y = self:getTarget(tg) local _ _, _, _, x, y = self:canProject(tg, x, y) - if not x or not y then x, y = self.x, self.y end + if not x or not y then + if cancellable then return nil else x, y = self.x, self.y end + end if (x == self.x and y == self.y) or game.level.map:checkEntity(x, y, Map.TERRAIN, "block_move")then x, y = getAnomalyPosition(self, self:getTalentRange(t)) end @@ -387,6 +409,9 @@ newTalent{ return true end, + action = function(self, t, cancellable) + t.doAction(self, t, true) + end, info = function(self, t) return ([[Creates a wormhole nearby and a second wormhole up to ten tiles away.]]):format() end, @@ -409,11 +434,13 @@ newTalent{ return {type="ball", range=self:getTalentRange(t), radius=self:getTalentRadius(t), nowarning=true} end, message = "@Source@ places several targets out of phase.", - action = function(self, t) + doAction = function(self, t, cancellable) local tg = self:getTalentTarget(t) local x, y = self:getTarget(tg) local _ _, _, _, x, y = self:canProject(tg, x, y) - if not x or not y then x, y = self.x, self.y end + if not x or not y then + if cancellable then return nil else x, y = self.x, self.y end + end local tgts = getAnomalyTargets(self, t, x, y, "ACTOR", self:getTalentRadius(t)) for i = 1, rng.avg(1, 5, 3) do @@ -430,6 +457,9 @@ newTalent{ return true end, + action = function(self, t, cancellable) + t.doAction(self, t, true) + end, info = function(self, t) return ([[Allows up to five targets in a radius of %d to travel up to %d tiles through walls.]]): format(getAnomalyDuration(self, t)*2, getAnomalyDuration(self, t)) @@ -453,11 +483,13 @@ newTalent{ return {type="ball", range=self:getTalentRange(t), radius=self:getTalentRadius(t)} end, message = "@Source@ makes several targets blink uncontrollably.", - action = function(self, t) + doAction = function(self, t, cancellable) local tg = self:getTalentTarget(t) local x, y = self:getTarget(tg) local _ _, _, _, x, y = self:canProject(tg, x, y) - if not x or not y then x, y = self.x, self.y end + if not x or not y then + if cancellable then return nil else x, y = self.x, self.y end + end local tgts = getAnomalyTargets(self, t, x, y, "ACTOR", self:getTalentRadius(t)) for i = 1, rng.avg(1, 5, 3) do @@ -474,6 +506,9 @@ newTalent{ return true end, + action = function(self, t, cancellable) + t.doAction(self, t, true) + end, info = function(self, t) return ([[Up to five targets in a radius of %d are teleporting %d tiles every turn.]]): format(self:getTalentRadius(t), getAnomalyDuration(self, t)) @@ -498,11 +533,13 @@ newTalent{ end, getSummonTime = function(self, t) return math.ceil(getAnomalyDuration(self, t)*2) end, message = "Some innocent bystanders have been teleported into the fight.", - action = function(self, t) + doAction = function(self, t, cancellable) local tg = self:getTalentTarget(t) local x, y = self:getTarget(tg) local _ _, _, _, x, y = self:canProject(tg, x, y) - if not x or not y then x, y = self.x, self.y end + if not x or not y then + if cancellable then return nil else x, y = self.x, self.y end + end -- Randomly pick a race local race = rng.range(1, 4) @@ -584,6 +621,9 @@ newTalent{ game:playSoundNear(self, "talents/spell_generic") return true end, + action = function(self, t, cancellable) + t.doAction(self, t, true) + end, info = function(self, t) return ([[Pulls innocent people into the fight.]]) end, @@ -608,11 +648,13 @@ newTalent{ end, getSlow = function(self, t) return 1 - 1 / (1 + (getAnomalyEffectPower(self, t)) / 100) end, message = "@Source@ creates a bubble of slow time.", - action = function(self, t) + doAction = function(self, t, cancellable) local tg = self:getTalentTarget(t) local x, y = self:getTarget(tg) local _ _, _, _, x, y = self:canProject(tg, x, y) - if not x or not y then x, y = self.x, self.y end + if not x or not y then + if cancellable then return nil else x, y = self.x, self.y end + end local tgts = getAnomalyTargets(self, t, x, y, "ACTOR", self:getTalentRadius(t)) for i = 1, rng.avg(1, 5, 3) do @@ -629,6 +671,9 @@ newTalent{ end return true end, + action = function(self, t, cancellable) + t.doAction(self, t, true) + end, info = function(self, t) return ([[Slows up to five targets in a radius %d ball by %d%%.]]): format(self:getTalentRadius(t), t.getSlow(self, t)*100) @@ -653,11 +698,13 @@ newTalent{ end, getHaste = function(self, t) return 1 - 1 / (1 + (getAnomalyEffectPower(self, t)) / 100) end, message = "@Source@ creates a bubble of fast time.", - action = function(self, t) + doAction = function(self, t, cancellable) local tg = self:getTalentTarget(t) local x, y = self:getTarget(tg) local _ _, _, _, x, y = self:canProject(tg, x, y) - if not x or not y then x, y = self.x, self.y end + if not x or not y then + if cancellable then return nil else x, y = self.x, self.y end + end local tgts = getAnomalyTargets(self, t, x, y, "ACTOR", self:getTalentRadius(t)) for i = 1, rng.avg(1, 5, 3) do @@ -673,6 +720,9 @@ newTalent{ return true end, + action = function(self, t, cancellable) + t.doAction(self, t, true) + end, info = function(self, t) return ([[Increases global speed of up to five targets in a radius %d ball by %d%%.]]): format(self:getTalentRadius(t), t.getHaste(self, t)*100) @@ -696,11 +746,13 @@ newTalent{ return {type="ball", range=self:getTalentRange(t), radius=self:getTalentRadius(t)} end, message = "@Source@ creates a bubble of nul time.", - action = function(self, t) + doAction = function(self, t, cancellable) local tg = self:getTalentTarget(t) local x, y = self:getTarget(tg) local _ _, _, _, x, y = self:canProject(tg, x, y) - if not x or not y then x, y = self.x, self.y end + if not x or not y then + if cancellable then return nil else x, y = self.x, self.y end + end local tgts = getAnomalyTargets(self, t, x, y, "ACTOR", self:getTalentRadius(t)) for i = 1, rng.avg(1, 5, 3) do @@ -718,6 +770,9 @@ newTalent{ return true end, + action = function(self, t, cancellable) + t.doAction(self, t, true) + end, info = function(self, t) return ([[Stuns up to five targets in a radius %d ball.]]): format(self:getTalentRadius(t)) @@ -741,11 +796,13 @@ newTalent{ return {type="ball", range=self:getTalentRange(t), radius=self:getTalentRadius(t)} end, message = "@Source@ removes several targets from time.", - action = function(self, t) + doAction = function(self, t, cancellable) local tg = self:getTalentTarget(t) local x, y = self:getTarget(tg) local _ _, _, _, x, y = self:canProject(tg, x, y) - if not x or not y then x, y = self.x, self.y end + if not x or not y then + if cancellable then return nil else x, y = self.x, self.y end + end local tgts = getAnomalyTargets(self, t, x, y, "ACTOR", self:getTalentRadius(t)) for i = 1, rng.avg(1, 5, 3) do @@ -763,6 +820,9 @@ newTalent{ return true end, + action = function(self, t, cancellable) + t.doAction(self, t, true) + end, info = function(self, t) return ([[Time Prisons up to five targets in a radius %d ball.]]): format(self:getTalentRadius(t)) @@ -786,11 +846,13 @@ newTalent{ return {type="ball", range=self:getTalentRange(t), radius=self:getTalentRadius(t), nowarning=true} end, message = "@Source@ creates a temporal shield around several targets.", - action = function(self, t) + doAction = function(self, t, cancellable) local tg = self:getTalentTarget(t) local x, y = self:getTarget(tg) local _ _, _, _, x, y = self:canProject(tg, x, y) - if not x or not y then x, y = self.x, self.y end + if not x or not y then + if cancellable then return nil else x, y = self.x, self.y end + end local tgts = getAnomalyTargets(self, t, x, y, "ACTOR", self:getTalentRadius(t)) for i = 1, rng.avg(1, 5, 3) do @@ -806,6 +868,9 @@ newTalent{ return true end, + action = function(self, t, cancellable) + t.doAction(self, t, true) + end, info = function(self, t) return ([[Time Shields up to five targets in a radius of %d.]]): format(self:getTalentRadius(t)) @@ -829,11 +894,13 @@ newTalent{ return {type="ball", range=self:getTalentRange(t), radius=self:getTalentRadius(t), nowarning=true} end, message = "@Source@ energizes several targets.", - action = function(self, t) + doAction = function(self, t, cancellable) local tg = self:getTalentTarget(t) local x, y = self:getTarget(tg) local _ _, _, _, x, y = self:canProject(tg, x, y) - if not x or not y then x, y = self.x, self.y end + if not x or not y then + if cancellable then return nil else x, y = self.x, self.y end + end local tgts = getAnomalyTargets(self, t, x, y, "ACTOR", self:getTalentRadius(t)) for i = 1, rng.avg(1, 5, 3) do @@ -849,6 +916,9 @@ newTalent{ return true end, + action = function(self, t, cancellable) + t.doAction(self, t, true) + end, info = function(self, t) return ([[Invigorates up to five targets in a radius of %d.]]): format(self:getTalentRadius(t)) @@ -872,11 +942,13 @@ newTalent{ return {type="ball", range=self:getTalentRange(t), radius=self:getTalentRadius(t), nowarning=true} end, message = "@Source@ clones a nearby creature.", - action = function(self, t) + doAction = function(self, t, cancellable) local tg = self:getTalentTarget(t) local x, y = self:getTarget(tg) local _ _, _, _, x, y = self:canProject(tg, x, y) - if not x or not y then x, y = self.x, self.y end + if not x or not y then + if cancellable then return nil else x, y = self.x, self.y end + end local tgts = getAnomalyTargets(self, t, x, y, "ACTOR", self:getTalentRadius(t)) -- Randomly take targets @@ -897,6 +969,9 @@ newTalent{ return true end, + action = function(self, t, cancellable) + t.doAction(self, t, true) + end, info = function(self, t) return ([[Clones a random creature within range.]]):format() end, @@ -919,11 +994,13 @@ newTalent{ return {type="ball", range=self:getTalentRange(t), radius=self:getTalentRadius(t)} end, message = "@Source@ creates a temporal storm.", - action = function(self, t) + doAction = function(self, t, cancellable) local tg = self:getTalentTarget(t) local x, y = self:getTarget(tg) local _ _, _, _, x, y = self:canProject(tg, x, y) - if not x or not y then x, y = self.x, self.y end + if not x or not y then + if cancellable then return nil else x, y = self.x, self.y end + end -- Add a lasting map effect game.level.map:addEffect(self, @@ -936,6 +1013,9 @@ newTalent{ ) return true end, + action = function(self, t, cancellable) + t.doAction(self, t, true) + end, info = function(self, t) local duration = self:combatScale(getParadoxSpellpower(self, t), 4, 10, 12, 100, 0.75)/2 local damage = self:combatScale(getParadoxSpellpower(self, t), 10, 10, 50, 100, 0.75) @@ -962,11 +1042,13 @@ newTalent{ return {type="ball", range=self:getTalentRange(t), radius=self:getTalentRadius(t)} end, message = "@Source@ increases local gravity.", - action = function(self, t) + doAction = function(self, t, cancellable) local tg = self:getTalentTarget(t) local x, y = self:getTarget(tg) local _ _, _, _, x, y = self:canProject(tg, x, y) - if not x or not y then x, y = self.x, self.y end + if not x or not y then + if cancellable then return nil else x, y = self.x, self.y end + end self:project(tg, x, y, function(px, py) local target = game.level.map(px, py, Map.ACTOR) @@ -985,6 +1067,9 @@ newTalent{ return true end, + action = function(self, t, cancellable) + t.doAction(self, t, true) + end, info = function(self, t) return ([[Increases localized gravity, pulling in targets in a radius of %d.]]):format(self:getTalentRadius(t)) end, @@ -1007,17 +1092,22 @@ newTalent{ return {type="ball", range=self:getTalentRange(t), radius=self:getTalentRadius(t)} end, message = "@Source@ turns matter to dust.", - action = function(self, t) + doAction = function(self, t, cancellable) local tg = self:getTalentTarget(t) local x, y = self:getTarget(tg) local _ _, _, _, x, y = self:canProject(tg, x, y) - if not x or not y then x, y = self.x, self.y end + if not x or not y then + if cancellable then return nil else x, y = self.x, self.y end + end self:project(tg, x, y, DamageType.DIG, 1) game.level.map:particleEmitter(x, y, tg.radius, "ball_earth", {radius=tg.radius}) game:playSoundNear(self, "talents/breath") return true end, + action = function(self, t, cancellable) + t.doAction(self, t, true) + end, info = function(self, t) return ([[Digs out all terrain in a radius %d ball.]]):format(self:getTalentRadius(t)) end, @@ -1040,11 +1130,13 @@ newTalent{ return {type="ball", range=self:getTalentRange(t), radius=self:getTalentRadius(t), nowarning=true} end, message = "@Source@ creates a stone wall.", - action = function(self, t) + doAction = function(self, t, cancellable) local tg = self:getTalentTarget(t) local x, y = self:getTarget(tg) local _ _, _, _, x, y = self:canProject(tg, x, y) - if not x or not y then x, y = self.x, self.y end + if not x or not y then + if cancellable then return nil else x, y = self.x, self.y end + end for i = -1, 1 do for j = -1, 1 do if game.level.map:isBound(x + i, y + j) then local oe = game.level.map(x + i, y + j, Map.TERRAIN) @@ -1095,6 +1187,9 @@ newTalent{ game:playSoundNear(self, "talents/earth") return true end, + action = function(self, t, cancellable) + t.doAction(self, t, true) + end, info = function(self, t) return ([[Entombs a single target in a wall of stone.]]):format() end, @@ -1117,11 +1212,13 @@ newTalent{ return {type="ball", range=self:getTalentRange(t), radius=self:getTalentRadius(t)} end, message = "@Source@ increases local entropy.", - action = function(self, t) + doAction = function(self, t, cancellable) local tg = self:getTalentTarget(t) local x, y = self:getTarget(tg) local _ _, _, _, x, y = self:canProject(tg, x, y) - if not x or not y then x, y = self.x, self.y end + if not x or not y then + if cancellable then return nil else x, y = self.x, self.y end + end local tgts = getAnomalyTargets(self, t, x, y, "ACTOR", self:getTalentRadius(t)) -- Randomly take targets @@ -1154,6 +1251,9 @@ newTalent{ end return true end, + action = function(self, t, cancellable) + t.doAction(self, t, true) + end, info = function(self, t) return ([[Places between three and six talents of up to 5 targets in a radius %d ball on cooldown for up to %d turns.]]): format(getAnomalyRadius(self, t), getAnomalyDuration(self, t)) @@ -1172,17 +1272,18 @@ newTalent{ range = 10, radius = function(self, t) return getAnomalyRadius(self, t) end, direct_hit = true, - -requires_target = true, + requires_target = true, target = function(self, t) return {type="ball", range=self:getTalentRange(t), radius=self:getTalentRadius(t)} end, message = "@Source@ increases local gravity.", - action = function(self, t) + doAction = function(self, t, cancellable) local tg = self:getTalentTarget(t) local x, y = self:getTarget(tg) local _ _, _, _, x, y = self:canProject(tg, x, y) - if not x or not y then x, y = self.x, self.y end + if not x or not y then + if cancellable then return nil else x, y = self.x, self.y end + end local tgts = getAnomalyTargets(self, t, x, y, "ACTOR", self:getTalentRadius(t)) -- Randomly take targets @@ -1201,6 +1302,9 @@ requires_target = true, game:playSoundNear(self, "talents/earth") return true end, + action = function(self, t, cancellable) + t.doAction(self, t, true) + end, info = function(self, t) return ([[Creates a gravity well in a radius %d ball, pinning up to five targets.]]):format(self:getTalentRadius(t)) end, @@ -1223,11 +1327,13 @@ newTalent{ return {type="ball", range=self:getTalentRange(t), radius=self:getTalentRadius(t)} end, message = "@Source@ causes an earthquake.", - action = function(self, t) + doAction = function(self, t, cancellable) local tg = self:getTalentTarget(t) local x, y = self:getTarget(tg) local _ _, _, _, x, y = self:canProject(tg, x, y) - if not x or not y then x, y = self.x, self.y end + if not x or not y then + if cancellable then return nil else x, y = self.x, self.y end + end -- Don't bury the player if not game.player:knowTalent(game.player.T_DIG_OBJECT) then @@ -1237,6 +1343,9 @@ newTalent{ self:doQuake(tg, x, y) return true end, + action = function(self, t, cancellable) + t.doAction(self, t, true) + end, info = function(self, t) return ([[Causes an earthquake in a radius of %d.]]): format(getAnomalyRadius(self, t)) @@ -1260,11 +1369,13 @@ newTalent{ return {type="ball", range=self:getTalentRange(t), radius=self:getTalentRadius(t)} end, message = "@Source@ crumbles the resistances of several targets.", - action = function(self, t) + doAction = function(self, t, cancellable) local tg = self:getTalentTarget(t) local x, y = self:getTarget(tg) local _ _, _, _, x, y = self:canProject(tg, x, y) - if not x or not y then x, y = self.x, self.y end + if not x or not y then + if cancellable then return nil else x, y = self.x, self.y end + end local tgts = getAnomalyTargets(self, t, x, y, "ACTOR", self:getTalentRadius(t)) -- Randomly take targets @@ -1280,6 +1391,9 @@ newTalent{ end return true end, + action = function(self, t, cancellable) + t.doAction(self, t, true) + end, info = function(self, t) return ([[Reduces the resistances of up to five targets in a ball of radius %d by %d%%.]]):format(self:getTalentRadius(t), getAnomalyEffectPower(self, t)) end, @@ -1302,11 +1416,13 @@ newTalent{ return {type="ball", range=self:getTalentRange(t), radius=self:getTalentRadius(t)} end, message = "@Source@ causes a dust storm.", - action = function(self, t) + doAction = function(self, t, cancellable) local tg = self:getTalentTarget(t) local x, y = self:getTarget(tg) local _ _, _, _, x, y = self:canProject(tg, x, y) - if not x or not y then x, y = self.x, self.y end + if not x or not y then + if cancellable then return nil else x, y = self.x, self.y end + end local tgts = getAnomalyTargets(self, t, x, y, "ACTOR", self:getTalentRange(t)) local dam = getAnomalyRadius(self, t) -- not a typo, very low damage since this isn't a major anomaly @@ -1342,6 +1458,9 @@ newTalent{ end return true end, + action = function(self, t, cancellable) + t.doAction(self, t, true) + end, info = function(self, t) return ([[Summons three to six dust storms.]]):format() end, @@ -1366,7 +1485,7 @@ newTalent{ return {type="ball", range=self:getTalentRange(t), radius=self:getTalentRadius(t)} end, message = "@Source@ causes a fire.", - action = function(self, t) + doAction = function(self, t, cancellable) local tg = self:getTalentTarget(t) local tgts = getAnomalyTargets(self, t, self.x, self.y, "ACTOR", self:getTalentRange(t)) @@ -1401,6 +1520,9 @@ newTalent{ end return true end, + action = function(self, t, cancellable) + t.doAction(self, t, true) + end, info = function(self, t) return ([[Summons three to six blazing fires.]]):format() end, @@ -1423,7 +1545,7 @@ newTalent{ return {type="ball", range=self:getTalentRange(t), radius=self:getTalentRadius(t)} end, message = "@Source@ calcifies several targets.", - action = function(self, t) + doAction = function(self, t, cancellable) local tg = self:getTalentTarget(t) local x, y = self:getTarget(tg) local tgts = getAnomalyTargets(self, t, x, y, "ACTOR", self:getTalentRadius(t)) @@ -1442,6 +1564,9 @@ newTalent{ end return true end, + action = function(self, t, cancellable) + t.doAction(self, t, true) + end, info = function(self, t) return ([[Turns up to 5 targets in a radius %d ball to stone for %d turns.]]): format(getAnomalyRadius(self, t), getAnomalyDuration(self, t)) @@ -1465,7 +1590,7 @@ newTalent{ return {type="hit", range=self:getTalentRange(t), talent=t} end, message = "@Source@ teleports several targets to @Source@'s location.", - action = function(self, t) + doAction = function(self, t, cancellable) local tg = self:getTalentTarget(t) local tgts = getAnomalyTargets(self, t, self.x, self.y, "ACTOR", self:getTalentRange(t), true) @@ -1484,6 +1609,9 @@ newTalent{ end return true end, + action = function(self, t, cancellable) + t.doAction(self, t, true) + end, info = function(self, t) return ([[Teleports between 3 and 6 targets to the caster.]]): format() @@ -1508,7 +1636,7 @@ newTalent{ end, getHaste = function(self, t) return 1 - 1 / (1 + (getAnomalyEffectPower(self, t)) / 100) end, message = "The odds have tilted.", - action = function(self, t) + doAction = function(self, t, cancellable) local tg = self:getTalentTarget(t) local tgts = getAnomalyTargets(self, t, self.x, self.y, "ACTOR", self:getTalentRange(t)) @@ -1525,6 +1653,9 @@ newTalent{ game:playSoundNear(self, "talents/spell_generic") return true end, + action = function(self, t, cancellable) + t.doAction(self, t, true) + end, info = function(self, t) return ([[Substantially toughens and hastes one target for %d turns.]]):format(getAnomalyDuration(self, t)) end, @@ -1547,7 +1678,7 @@ newTalent{ return {type="hit", range=self:getTalentRange(t), talent=t} end, message = "@Source@'s evil twin has come from another timeline.", - action = function(self, t) + doAction = function(self, t, cancellable) local tg = self:getTalentTarget(t) local x, y = util.findFreeGrid(self.x, self.y, 3, true, {[Map.ACTOR]=true}) @@ -1565,6 +1696,9 @@ newTalent{ return true end, + action = function(self, t, cancellable) + t.doAction(self, t, true) + end, info = function(self, t) return ([[Clones the caster.]]):format(getAnomalyDuration(self, t)) end, @@ -1587,7 +1721,7 @@ newTalent{ return {type="hit", range=self:getTalentRange(t), talent=t} end, message = "@Source@ has caused two threads to merge.", - action = function(self, t) + doAction = function(self, t, cancellable) local tg = self:getTalentTarget(t) local tgts = getAnomalyTargets(self, t, self.x, self.y, "ACTOR", self:getTalentRange(t)) @@ -1611,6 +1745,9 @@ newTalent{ return true end, + action = function(self, t, cancellable) + t.doAction(self, t, true) + end, info = function(self, t) return ([[Clones all creatures in a radius of 10.]]):format(getAnomalyDuration(self, t)) end, @@ -1628,13 +1765,12 @@ newTalent{ range = 10, radius = function(self, t) return getAnomalyRadius(self, t) end, direct_hit = true, - -requires_target = true, + requires_target = true, target = function(self, t) return {type="ball", range=self:getTalentRange(t), radius=self:getTalentRadius(t)} end, message = "@Source@ digs out a huge area.", - action = function(self, t) + doAction = function(self, t, cancellable) local tg = self:getTalentTarget(t) for i = 1, rng.avg(3, 6, 3) do local orig_x, orig_y = getAnomalyPosition(self, self:getTalentRange(t)) @@ -1645,6 +1781,9 @@ requires_target = true, game:playSoundNear(self, "talents/breath") return true end, + action = function(self, t, cancellable) + t.doAction(self, t, true) + end, info = function(self, t) return ([[Digs out all terrain in between three and six radius %d balls.]]):format(self:getTalentRadius(t)) end, @@ -1667,7 +1806,7 @@ newTalent{ return {type="ball", range=self:getTalentRange(t), radius=self:getTalentRadius(t)} end, message = "@Source@ creates a sphere of destruction.", - action = function(self, t) + doAction = function(self, t, cancellable) local tg = self:getTalentTarget(t) local tgts = getAnomalyTargets(self, t, self.x, self.y, "ACTOR", self:getTalentRange(t)) @@ -1702,6 +1841,9 @@ newTalent{ game:playSoundNear(self, "talents/distortion") return true end, + action = function(self, t, cancellable) + t.doAction(self, t, true) + end, info = function(self, t) return ([[Summons a sphere of destruction.]]):format() end, @@ -1724,7 +1866,7 @@ newTalent{ return {type="ball", range=self:getTalentRange(t), radius=self:getTalentRadius(t)} end, message = "@Source@ causes a tornado storm.", - action = function(self, t) + doAction = function(self, t, cancellable) local tg = self:getTalentTarget(t) local tgts = getAnomalyTargets(self, t, self.x, self.y, "ACTOR", self:getTalentRange(t)) @@ -1778,6 +1920,9 @@ newTalent{ end return true end, + action = function(self, t, cancellable) + t.doAction(self, t, true) + end, info = function(self, t) return ([[Summons three to six tornados.]]):format() end, @@ -1800,7 +1945,7 @@ newTalent{ return {type="ball", range=self:getTalentRange(t), radius=self:getTalentRadius(t)} end, message = "@Source@ causes a meteor to fall from the sky.", - action = function(self, t) + doAction = function(self, t, cancellable) local tg = self:getTalentTarget(t) local x, y = getAnomalyPosition(self, self:getTalentRange(t)) @@ -1871,6 +2016,9 @@ newTalent{ return true end, + action = function(self, t, cancellable) + t.doAction(self, t, true) + end, info = function(self, t) return ([[Causes a meteor to fall from the sky.]]): format() @@ -1894,7 +2042,7 @@ newTalent{ return {type="ball", range=self:getTalentRange(t), radius=self:getTalentRadius(t)} end, message = "@Source@ tears a hole in the fabric of spacetime.", - action = function(self, t) + doAction = function(self, t, cancellable) local tg = self:getTalentTarget(t) local tx, ty = getAnomalyPosition(self, self:getTalentRange(t)) @@ -1952,6 +2100,9 @@ newTalent{ return true end, + action = function(self, t, cancellable) + t.doAction(self, t, true) + end, info = function(self, t) return ([[Tears a hole in the fabric of spacetime.]]): format() @@ -1975,7 +2126,7 @@ newTalent{ return {type="ball", range=self:getTalentRange(t), radius=self:getTalentRadius(t)} end, message = "Some Time Elementals have been attracted by @Source@'s meddling.", - action = function(self, t) + doAction = function(self, t, cancellable) local tg = self:getTalentTarget(t) local tgts = getAnomalyTargets(self, t, self.x, self.y, "ACTOR", self:getTalentRadius(t)) @@ -2001,6 +2152,9 @@ newTalent{ return true end, + action = function(self, t, cancellable) + t.doAction(self, t, true) + end, info = function(self, t) return ([[Time elementals have been attracted to the timeline.]]): format() diff --git a/game/modules/tome/data/talents/chronomancy/flux.lua b/game/modules/tome/data/talents/chronomancy/flux.lua index abe0ee504e9efd89ab577c3ca006f60698ce036d..af5941f60d4a72b6bbe3469c65eebb9abd8d721a 100644 --- a/game/modules/tome/data/talents/chronomancy/flux.lua +++ b/game/modules/tome/data/talents/chronomancy/flux.lua @@ -168,8 +168,9 @@ newTalent{ game.bignews:saySimple(180, "#STEEL_BLUE#Targeting %s", anom.name) end - -- Call the anomoly action function directly - anom.action(self, anom) + -- Call the anomaly action function directly, while disabling the + -- ability to cancel targeting + anom.doAction(self, anom, false) self:incParadox(-eff.paradox) end