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

Fix Demon Plane when used with escorts on the level

git-svn-id: http://svn.net-core.org/repos/t-engine4@3154 51575b47-30f0-44d4-a5cc-537603b46e54
parent 2edb20fd
No related branches found
No related tags found
No related merge requests found
......@@ -142,11 +142,13 @@ newTalent{
local tg = {type="hit", range=self:getTalentRange(t), talent=t}
local tx, ty, target = self:getTarget(tg)
if not tx or not ty or not target then return nil end
local _ _, tx, ty = self:canProject(tg, tx, ty)
if not tx or not ty or not target then return nil end
target = game.level.map(tx, ty, Map.ACTOR)
if not tx or not ty or not target then return nil end
if not (target.player and target.game_ender) and not (self.player and self.game_ender) then return nil end
if target == self then return end
game:playSoundNear(self, "talents/flame")
local dam = self:combatTalentSpellDamage(t, 12, 140)
......@@ -154,14 +156,17 @@ newTalent{
game:onTickEnd(function()
local oldzone = game.zone
local oldlevel = game.level
-- Remove them before making the new elvel, this way party memebrs are not removed from the old
if oldlevel:hasEntity(self) then oldlevel:removeEntity(self) end
if oldlevel:hasEntity(target) then oldlevel:removeEntity(target) end
local zone = engine.Zone.new("demon-plane-spell")
local level = zone:getLevel(game, 1, 0)
level.demonfire_dam = dam
level.plane_owner = self
if oldlevel:hasEntity(self) then oldlevel:removeEntity(self) end
level:addEntity(self)
if oldlevel:hasEntity(target) then oldlevel:removeEntity(target) end
level:addEntity(target)
level.source_zone = oldzone
......
......@@ -24,7 +24,7 @@ newEntity{
name = "lava floor", image = "terrain/lava_floor.png",
display = '.', color=colors.RED, back_color=colors.DARK_GREY,
shader = "lava",
on_move = function(self, x, y, who)
on_stand = function(self, x, y, who)
if not game.level.allow_demon_plane_damage then return end
local DT = engine.DamageType
local dam = DT:get(DT.DEMONFIRE).projector(game.level.plane_owner, x, y, DT.DEMONFIRE, game.level.demonfire_dam or 1)
......
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