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

While frozen teleport spells are unusable (they were before but player could...

While frozen teleport spells are unusable (they were before but player could lose turn trying to use them)


git-svn-id: http://svn.net-core.org/repos/t-engine4@4710 51575b47-30f0-44d4-a5cc-537603b46e54
parent 61b7efe3
No related branches found
No related tags found
No related merge requests found
......@@ -2524,6 +2524,7 @@ function _M:preUseTalent(ab, silent, fake)
-- Cant heal
if ab.is_heal and self:attr("no_healing") then return false end
if ab.is_teleport and self:attr("encased_in_ice") then return false end
if not silent then
-- Allow for silent talents
......
......@@ -61,6 +61,7 @@ newTalent{
local eff = self.sustain_talents[self.T_JUMPGATE]
return eff and core.fov.distance(self.x, self.y, eff.jumpgate_x, eff.jumpgate_y) < t.getRange(self, t)
end,
is_teleport = true,
action = function(self, t)
local eff = self.sustain_talents[self.T_JUMPGATE]
if not eff then
......@@ -338,6 +339,7 @@ newTalent{
no_npc_use = true,
getRange = function(self, t) return math.floor(10 + 3 * self:getTalentLevel(t)) end,
-- Check distance in preUseTalent to grey out the talent
is_teleport = true,
on_pre_use = function(self, t)
local eff = self.sustain_talents[self.T_JUMPGATE_TWO]
return eff and core.fov.distance(self.x, self.y, eff.jumpgate2_x, eff.jumpgate2_y) < t.getRange(self, t)
......
......@@ -37,6 +37,7 @@ newTalent{
end
end,
direct_hit = true,
is_teleport = true,
action = function(self, t)
local tg = self:getTalentTarget(t)
local x, y = self:getTarget(tg)
......@@ -47,9 +48,9 @@ newTalent{
end
x, y = checkBackfire(self, x, y, t.paradox)
local __, x, y = self:canProject(tg, x, y)
game.level.map:particleEmitter(self.x, self.y, 1, "temporal_teleport")
-- since we're using a precise teleport we'll look for a free grid first
local tx, ty = util.findFreeGrid(x, y, 5, true, {[Map.ACTOR]=true})
if tx and ty then
......@@ -57,10 +58,10 @@ newTalent{
game.logSeen(self, "The spell fizzles!")
end
end
game.level.map:particleEmitter(self.x, self.y, 1, "temporal_teleport")
game:playSoundNear(self, "talents/teleport")
return true
end,
info = function(self, t)
......@@ -91,13 +92,13 @@ newTalent{
action = function(self, t)
local tg = self:getTalentTarget(t)
local actors = {}
--checks for spacetime mastery hit bonus
local power = self:combatSpellpower()
if self:knowTalent(self.T_SPACETIME_MASTERY) then
power = self:combatSpellpower() * (1 + self:getTalentLevel(self.T_SPACETIME_MASTERY)/10)
end
self:project(tg, self.x, self.y, function(px, py)
local target = game.level.map(px, py, Map.ACTOR)
if not target or target == self then return end
......@@ -117,14 +118,14 @@ newTalent{
a:setEffect(a.EFF_CONTINUUM_DESTABILIZATION, 100, {power=self:combatSpellpower(0.3)})
game.level.map:particleEmitter(a.x, a.y, 1, "teleport")
end
if do_fizzle == true then
game.logSeen(self, "The spell fizzles!")
end
game.level.map:particleEmitter(self.x, self.y, tg.radius, "ball_teleport", {radius=tg.radius})
game:playSoundNear(self, "talents/teleport")
return true
end,
info = function(self, t)
......@@ -197,13 +198,13 @@ newTalent{
exit_x, exit_y = pos[1], pos[2]
print("[[wormhole]] entrance ", entrance_x, " :: ", entrance_y)
print("[[wormhole]] exit ", exit_x, " :: ", exit_y)
--checks for spacetime mastery hit bonus
local power = self:combatSpellpower()
if self:knowTalent(self.T_SPACETIME_MASTERY) then
power = self:combatSpellpower() * (1 + self:getTalentLevel(self.T_SPACETIME_MASTERY)/10)
end
-- Adding the entrance wormhole
local entrance = mod.class.Trap.new{
name = "wormhole",
......@@ -251,7 +252,7 @@ newTalent{
game.zone:addEntity(game.level, entrance, "trap", entrance_x, entrance_y)
game.level.map:particleEmitter(entrance_x, entrance_y, 1, "teleport")
game:playSoundNear(self, "talents/heal")
-- Adding the exit wormhole
local exit = entrance:clone()
exit.x = exit_x
......@@ -261,11 +262,11 @@ newTalent{
exit:setKnown(self, true)
game.zone:addEntity(game.level, exit, "trap", exit_x, exit_y)
game.level.map:particleEmitter(exit_x, exit_y, 1, "teleport")
-- Linking the wormholes
entrance.dest = exit
exit.dest = entrance
game.logSeen(self, "%s folds the space between two points.", self.name)
return true
end,
......
......@@ -24,6 +24,7 @@ newTalent{
points = 5,
range = 10,
tactical = { ESCAPE = 2 },
is_teleport = true,
action = function(self, t)
local x, y, range
if self.ai_state.shadow_wall then
......
......@@ -93,6 +93,7 @@ newTalent{
getDuration = function(self, t)
return util.bound(7 - self:getTalentLevel(t) / 2, 2, 7)
end,
is_teleport = true,
action = function(self, t)
local range = self:getTalentRange(t)
local radius = self:getTalentRadius(t)
......
......@@ -117,6 +117,7 @@ newTalent{
getDuration = function(self, t)
return math.floor(util.bound(7 - self:getTalentLevel(t) / 2, 2, 7))
end,
is_teleport = true,
action = function(self, t)
local range = self:getTalentRange(t)
local radius = self:getTalentRadius(t)
......
......@@ -327,6 +327,7 @@ newInscription{
type = {"inscriptions/runes", 1},
points = 1,
is_spell = true,
is_teleport = true,
tactical = { ESCAPE = 2 },
action = function(self, t)
local data = self:getInscriptionData(t.short_name)
......@@ -350,6 +351,7 @@ newInscription{
type = {"inscriptions/runes", 1},
points = 1,
is_spell = true,
is_teleport = true,
tactical = { CLOSEIN = 2 },
action = function(self, t)
local data = self:getInscriptionData(t.short_name)
......@@ -388,6 +390,7 @@ newInscription{
type = {"inscriptions/runes", 1},
points = 1,
is_spell = true,
is_teleport = true,
tactical = { ESCAPE = 3 },
action = function(self, t)
local data = self:getInscriptionData(t.short_name)
......
......@@ -29,6 +29,7 @@ newTalent{
requires_target = function(self, t) return self:getTalentLevel(t) >= 4 end,
getRange = function(self, t) return 4 + self:combatTalentSpellDamage(t, 10, 15) end,
getRadius = function(self, t) return 7 - self:getTalentLevelRaw(t) end,
is_teleport = true,
action = function(self, t)
local target = self
if self:getTalentLevel(t) >= 4 then
......@@ -107,6 +108,7 @@ newTalent{
requires_target = function(self, t) return self:getTalentLevel(t) >= 4 end,
getRange = function(self, t) return 100 + self:combatSpellpower(1) end,
getRadius = function(self, t) return 20 - self:getTalentLevel(t) end,
is_teleport = true,
action = function(self, t)
local target = self
......
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