Skip to content
Snippets Groups Projects
Commit b3ecc76e authored by dg's avatar dg
Browse files

anomalies

git-svn-id: http://svn.net-core.org/repos/t-engine4@2386 51575b47-30f0-44d4-a5cc-537603b46e54
parent 9cddd427
No related branches found
No related tags found
No related merge requests found
...@@ -1542,6 +1542,16 @@ function _M:preUseTalent(ab, silent, fake) ...@@ -1542,6 +1542,16 @@ function _M:preUseTalent(ab, silent, fake)
self:incParadox(pa / 2) self:incParadox(pa / 2)
self:useEnergy() self:useEnergy()
return false return false
elseif rng.percent(math.pow((self:getParadox()/400), 4)) then
-- Random anomaly
local ts = {}
for id, t in pairs(self.talents_def) do
if t.type[1] == "chronomancy/anomalies" then ts[#ts+1] = id end
end
if not silent then game.logPlayer(self, "You lose control and unleash an anomaly!") end
self:forceUseTalent(rng.table(ts), {ignore_energy=true})
self:useEnergy()
return false
end end
end end
......
...@@ -181,13 +181,13 @@ newTalent{ ...@@ -181,13 +181,13 @@ newTalent{
display = '&', color_r=255, color_g=255, color_b=255, back_color=colors.STEEL_BLUE, display = '&', color_r=255, color_g=255, color_b=255, back_color=colors.STEEL_BLUE,
message = "@Target@ moves through the wormhole.", message = "@Target@ moves through the wormhole.",
triggered = function(self, x, y, who) triggered = function(self, x, y, who)
local tx, ty = util.findFreeGrid(self.dest.x, self.dest.y, 5, true, {[engine.Map.ACTOR]=true}) local tx, ty = util.findFreeGrid(self.dest.x, self.dest.y, 5, true, {[engine.Map.ACTOR]=true})
if not tx or not who:canBe("teleport") or game.level.map.attrs(tx, ty, "no_teleport") then if not tx or not who:canBe("teleport") or game.level.map.attrs(tx, ty, "no_teleport") then
game.logPlayer(who, "You try to enter the wormhole but a violent force pushes you back.") game.logPlayer(who, "You try to enter the wormhole but a violent force pushes you back.")
return true return true
else else
who:move(tx, ty, true) who:move(tx, ty, true)
end end
return true return true
end, end,
disarm = function(self, x, y, who) return false end, disarm = function(self, x, y, who) return false end,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment