Skip to content
Snippets Groups Projects
Commit 559b4388 authored by Eric Wykoff's avatar Eric Wykoff
Browse files

better

parent 2d7dab74
No related branches found
No related tags found
No related merge requests found
......@@ -246,119 +246,60 @@ newTalent{
}
newTalent{
name = "Wormhole",
name = "Banish",
type = {"chronomancy/spacetime-folding", 2},
require = chrono_req2,
points = 5,
paradox = function (self, t) return getParadoxCost(self, t, 10) end,
cooldown = 10,
tactical = { ESCAPE = 2 },
range = function(self, t) return math.floor(self:combatTalentScale(t, 5, 9, 0.5, 0, 1)) end,
radius = function(self, t) return math.floor(self:combatTalentLimit(t, 1, 7, 3)) end, -- Limit to radius 1
range = 0,
radius = function(self, t) return math.floor(self:combatTalentScale(t, 2.5, 5.5)) end,
getTeleport = function(self, t) return math.floor(self:combatTalentScale(self:getTalentLevel(t), 8, 16)) end,
target = function(self, t)
return {type="ball", range=0, radius=self:getTalentRadius(t), selffire=false, talent=t}
end,
requires_target = true,
getDuration = function (self, t) return getExtensionModifier(self, t, math.floor(self:combatTalentScale(self:getTalentLevel(t), 6, 10))) end,
no_npc_use = true,
direct_hit = true,
action = function(self, t)
-- Target the entrance location
local tg = {type="bolt", nowarning=true, range=1, nolock=true, simple_dir_request=true, talent=t}
local entrance_x, entrance_y = self:getTarget(tg)
if not entrance_x or not entrance_y then return nil end
local _ _, entrance_x, entrance_y = self:canProject(tg, entrance_x, entrance_y)
local trap = game.level.map(entrance_x, entrance_y, engine.Map.TRAP)
if trap or game.level.map:checkEntity(entrance_x, entrance_y, Map.TERRAIN, "block_move") then game.logPlayer(self, "You can't place a wormhole entrance here.") return end
-- Target the exit location
local tg = {type="hit", nolock=true, pass_terrain=true, nowarning=true, range=self:getTalentRange(t)}
local exit_x, exit_y = self:getTarget(tg)
if not exit_x or not exit_y then return nil end
local _ _, exit_x, exit_y = self:canProject(tg, exit_x, exit_y)
local trap = game.level.map(exit_x, exit_y, engine.Map.TRAP)
if trap or game.level.map:checkEntity(exit_x, exit_y, Map.TERRAIN, "block_move") or core.fov.distance(entrance_x, entrance_y, exit_x, exit_y) < 2 then game.logPlayer(self, "You can't place a wormhole exit here.") return end
local tg = self:getTalentTarget(t)
local hit = false
-- Wormhole values
local power = getParadoxSpellpower(self, t)
local dest_power = getParadoxSpellpower(self, t, 0.3)
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
game.level.map:particleEmitter(target.x, target.y, 1, "temporal_teleport")
if self:checkHit(getParadoxSpellpower(self, t), target:combatSpellResist() + (target:attr("continuum_destabilization") or 0)) and target:canBe("teleport") then
if not target:teleportRandom(target.x, target.y, self:getTalentRadius(t) * 4, self:getTalentRadius(t) * 2) then
game.logSeen(target, "The spell fizzles on %s!", target.name:capitalize())
else
target:setEffect(target.EFF_CONTINUUM_DESTABILIZATION, 100, {power=getParadoxSpellpower(self, t, 0.3)})
game.level.map:particleEmitter(target.x, target.y, 1, "temporal_teleport")
hit = true
end
else
game.logSeen(target, "%s resists the banishment!", target.name:capitalize())
end
end)
-- Our base wormhole
local function makeWormhole(x, y, dest_x, dest_y)
local wormhole = mod.class.Trap.new{
name = "wormhole",
type = "annoy", subtype="teleport", id_by_type=true, unided_name = "trap",
image = "terrain/wormhole.png",
display = '&', color_r=255, color_g=255, color_b=255, back_color=colors.STEEL_BLUE,
message = "@Target@ moves onto the wormhole.",
temporary = t.getDuration(self, t),
x = x, y = y, dest_x = dest_x, dest_y = dest_y,
radius = self:getTalentRadius(t),
canAct = false,
energy = {value=0},
disarm = function(self, x, y, who) return false end,
power = power, dest_power = dest_power,
summoned_by = self, -- "summoner" is immune to it's own traps
triggered = function(self, x, y, who)
local hit = who == self.summoned_by or who:checkHit(self.power, who:combatSpellResist()+(who:attr("continuum_destabilization") or 0), 0, 95) and who:canBe("teleport") -- Bug fix, Deprecrated checkhit call
if hit then
game.level.map:particleEmitter(who.x, who.y, 1, "temporal_teleport")
if not who:teleportRandom(self.dest_x, self.dest_y, self.radius, 1) then
game.logSeen(who, "%s tries to enter the wormhole but a violent force pushes it back.", who.name:capitalize())
else
if who ~= self.summoned_by then who:setEffect(who.EFF_CONTINUUM_DESTABILIZATION, 100, {power=self.dest_power}) end
game.level.map:particleEmitter(who.x, who.y, 1, "temporal_teleport")
game:playSoundNear(self, "talents/teleport")
end
else
game.logSeen(who, "%s ignores the wormhole.", who.name:capitalize())
end
return true
end,
act = function(self)
self:useEnergy()
self.temporary = self.temporary - 1
if self.temporary <= 0 then
game.logSeen(self, "Reality asserts itself and forces the wormhole shut.")
if game.level.map(self.x, self.y, engine.Map.TRAP) == self then game.level.map:remove(self.x, self.y, engine.Map.TRAP) end
game.level:removeEntity(self)
end
end,
}
return wormhole
if not hit then
game:onTickEnd(function()
if not self:attr("no_talents_cooldown") then
self.talents_cd[self.T_BANISH] = self.talents_cd[self.T_BANISH] /2
end
end)
end
-- Adding the entrance wormhole
local entrance = makeWormhole(entrance_x, entrance_y, exit_x, exit_y)
game.level:addEntity(entrance)
entrance:identify(true)
entrance:setKnown(self, true)
game.zone:addEntity(game.level, entrance, "trap", entrance_x, entrance_y)
entrance.faction = nil
game:playSoundNear(self, "talents/heal")
-- Adding the exit wormhole
local exit = makeWormhole(exit_x, exit_y, entrance_x, entrance_y)
exit.x = exit_x
exit.y = exit_y
game.level:addEntity(exit)
exit:identify(true)
exit:setKnown(self, true)
game.zone:addEntity(game.level, exit, "trap", exit_x, exit_y)
exit.faction = nil
-- Linking the wormholes
entrance.dest = exit
exit.dest = entrance
game:playSoundNear(self, "talents/teleport")
game.logSeen(self, "%s folds the space between two points.", self.name)
return true
end,
info = function(self, t)
local duration = t.getDuration(self, t)
local radius = self:getTalentRadius(t)
local range = self:getTalentRange(t)
return ([[You fold the space between yourself and a second point within a range of %d, creating a pair of wormholes. Any creature stepping on either wormhole will be teleported near the other (radius %d accuracy).
The wormholes will last %d turns and must be placed at least two tiles apart.
The chance of teleporting enemies will scale with your Spellpower.]])
:format(range, radius, duration)
local range = t.getTeleport(self, t)
return ([[Randomly teleports all targets within a radius of %d around you. Targets will be teleported between %d and %d tiles from their current location.
If no targets are teleported the cooldown will be halved.
The chance of teleportion will scale with your Spellpower.]]):format(radius, range / 2, range)
end,
}
......
......@@ -153,59 +153,118 @@ newTalent{
}
newTalent{
name = "Banish",
name = "Wormhole",
type = {"chronomancy/spacetime-weaving", 4},
require = chrono_req4,
points = 5,
paradox = function (self, t) return getParadoxCost(self, t, 10) end,
cooldown = 10,
tactical = { ESCAPE = 2 },
range = 0,
radius = function(self, t) return math.floor(self:combatTalentScale(t, 2.5, 5.5)) end,
getTeleport = function(self, t) return math.floor(self:combatTalentScale(self:getTalentLevel(t), 8, 16)) end,
target = function(self, t)
return {type="ball", range=0, radius=self:getTalentRadius(t), selffire=false, talent=t}
end,
range = function(self, t) return math.floor(self:combatTalentScale(t, 5, 9, 0.5, 0, 1)) end,
radius = function(self, t) return math.floor(self:combatTalentLimit(t, 1, 5, 2)) end, -- Limit to radius 1
requires_target = true,
direct_hit = true,
getDuration = function (self, t) return getExtensionModifier(self, t, math.floor(self:combatTalentScale(self:getTalentLevel(t), 6, 10))) end,
no_npc_use = true,
action = function(self, t)
local tg = self:getTalentTarget(t)
local hit = false
-- Target the entrance location
local tg = {type="bolt", nowarning=true, range=1, nolock=true, simple_dir_request=true, talent=t}
local entrance_x, entrance_y = self:getTarget(tg)
if not entrance_x or not entrance_y then return nil end
local _ _, entrance_x, entrance_y = self:canProject(tg, entrance_x, entrance_y)
local trap = game.level.map(entrance_x, entrance_y, engine.Map.TRAP)
if trap or game.level.map:checkEntity(entrance_x, entrance_y, Map.TERRAIN, "block_move") then game.logPlayer(self, "You can't place a wormhole entrance here.") return 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
game.level.map:particleEmitter(target.x, target.y, 1, "temporal_teleport")
if self:checkHit(getParadoxSpellpower(self, t), target:combatSpellResist() + (target:attr("continuum_destabilization") or 0)) and target:canBe("teleport") then
if not target:teleportRandom(target.x, target.y, self:getTalentRadius(t) * 4, self:getTalentRadius(t) * 2) then
game.logSeen(target, "The spell fizzles on %s!", target.name:capitalize())
else
target:setEffect(target.EFF_CONTINUUM_DESTABILIZATION, 100, {power=getParadoxSpellpower(self, t, 0.3)})
game.level.map:particleEmitter(target.x, target.y, 1, "temporal_teleport")
hit = true
end
else
game.logSeen(target, "%s resists the banishment!", target.name:capitalize())
end
end)
-- Target the exit location
local tg = {type="hit", nolock=true, pass_terrain=true, nowarning=true, range=self:getTalentRange(t)}
local exit_x, exit_y = self:getTarget(tg)
if not exit_x or not exit_y then return nil end
local _ _, exit_x, exit_y = self:canProject(tg, exit_x, exit_y)
local trap = game.level.map(exit_x, exit_y, engine.Map.TRAP)
if trap or game.level.map:checkEntity(exit_x, exit_y, Map.TERRAIN, "block_move") or core.fov.distance(entrance_x, entrance_y, exit_x, exit_y) < 2 then game.logPlayer(self, "You can't place a wormhole exit here.") return end
-- Wormhole values
local power = getParadoxSpellpower(self, t)
local dest_power = getParadoxSpellpower(self, t, 0.3)
if not hit then
game:onTickEnd(function()
if not self:attr("no_talents_cooldown") then
self.talents_cd[self.T_BANISH] = self.talents_cd[self.T_BANISH] /2
end
end)
-- Our base wormhole
local function makeWormhole(x, y, dest_x, dest_y)
local wormhole = mod.class.Trap.new{
name = "wormhole",
type = "annoy", subtype="teleport", id_by_type=true, unided_name = "trap",
image = "terrain/wormhole.png",
display = '&', color_r=255, color_g=255, color_b=255, back_color=colors.STEEL_BLUE,
message = "@Target@ moves onto the wormhole.",
temporary = t.getDuration(self, t),
x = x, y = y, dest_x = dest_x, dest_y = dest_y,
radius = self:getTalentRadius(t),
canAct = false,
energy = {value=0},
disarm = function(self, x, y, who) return false end,
power = power, dest_power = dest_power,
summoned_by = self, -- "summoner" is immune to it's own traps
triggered = function(self, x, y, who)
local hit = who == self.summoned_by or who:checkHit(self.power, who:combatSpellResist()+(who:attr("continuum_destabilization") or 0), 0, 95) and who:canBe("teleport") -- Bug fix, Deprecrated checkhit call
if hit then
game.level.map:particleEmitter(who.x, who.y, 1, "temporal_teleport")
if not who:teleportRandom(self.dest_x, self.dest_y, self.radius, 1) then
game.logSeen(who, "%s tries to enter the wormhole but a violent force pushes it back.", who.name:capitalize())
else
if who ~= self.summoned_by then who:setEffect(who.EFF_CONTINUUM_DESTABILIZATION, 100, {power=self.dest_power}) end
game.level.map:particleEmitter(who.x, who.y, 1, "temporal_teleport")
game:playSoundNear(self, "talents/teleport")
end
else
game.logSeen(who, "%s ignores the wormhole.", who.name:capitalize())
end
return true
end,
act = function(self)
self:useEnergy()
self.temporary = self.temporary - 1
if self.temporary <= 0 then
game.logSeen(self, "Reality asserts itself and forces the wormhole shut.")
if game.level.map(self.x, self.y, engine.Map.TRAP) == self then game.level.map:remove(self.x, self.y, engine.Map.TRAP) end
game.level:removeEntity(self)
end
end,
}
return wormhole
end
-- Adding the entrance wormhole
local entrance = makeWormhole(entrance_x, entrance_y, exit_x, exit_y)
game.level:addEntity(entrance)
entrance:identify(true)
entrance:setKnown(self, true)
game.zone:addEntity(game.level, entrance, "trap", entrance_x, entrance_y)
entrance.faction = nil
game:playSoundNear(self, "talents/heal")
game:playSoundNear(self, "talents/teleport")
-- Adding the exit wormhole
local exit = makeWormhole(exit_x, exit_y, entrance_x, entrance_y)
exit.x = exit_x
exit.y = exit_y
game.level:addEntity(exit)
exit:identify(true)
exit:setKnown(self, true)
game.zone:addEntity(game.level, exit, "trap", exit_x, exit_y)
exit.faction = nil
-- Linking the wormholes
entrance.dest = exit
exit.dest = entrance
game.logSeen(self, "%s folds the space between two points.", self.name)
return true
end,
info = function(self, t)
local duration = t.getDuration(self, t)
local radius = self:getTalentRadius(t)
local range = t.getTeleport(self, t)
return ([[Randomly teleports all targets within a radius of %d around you. Targets will be teleported between %d and %d tiles from their current location.
If no targets are teleported the cooldown will be halved.
The chance of teleportion will scale with your Spellpower.]]):format(radius, range / 2, range)
local range = self:getTalentRange(t)
return ([[You fold the space between yourself and a second point within a range of %d, creating a pair of wormholes. Any creature stepping on either wormhole will be teleported near the other (radius %d accuracy).
The wormholes will last %d turns and must be placed at least two tiles apart.
The chance of teleporting enemies will scale with your Spellpower.]])
:format(range, radius, duration)
end,
}
\ No newline at end of file
......@@ -35,7 +35,7 @@ newTalent{
return {type="bolt", range=self:getTalentRange(t), talent=t}
end,
getDamage = function(self, t) return self:combatTalentSpellDamage(t, 20, 230, getParadoxSpellpower(self, t)) end,
getTargetCount = function(self, t) return math.floor(self:combatTalentScale(t, 2, 6, "log")) end,
getTargetCount = function(self, t) return 3 end,
action = function(self, t)
local tg = self:getTalentTarget(t)
local fx, fy = self:getTarget(tg)
......@@ -79,7 +79,6 @@ newTalent{
local tgr = {type="beam", range=self:getTalentRange(t), selffire=false, talent=t, x=sx, y=sy}
self:project(tgr, actor.x, actor.y, function(px, py)
DamageType:get(DamageType.TEMPORAL).projector(self, px, py, DamageType.TEMPORAL, damage)
damage = damage * 0.67
-- Get our braid targets
local target = game.level.map(px, py, Map.ACTOR)
......@@ -109,7 +108,6 @@ newTalent{
local targets = t.getTargetCount(self, t)
return ([[Rethread the timeline, dealing %0.2f temporal damage to the target before moving on to a second target.
Rethread can hit up to %d targets up to 10 grids apart, and will never hit the same one twice; nor will it hit the caster.
Each time it jumps target the damage is reduced by 33%%.
The damage will increase with your Spellpower.]]):
format(damDesc(self, DamageType.TEMPORAL, damage), targets)
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