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

fixes

quests can be completed by pets killing bosses


git-svn-id: http://svn.net-core.org/repos/t-engine4@458 51575b47-30f0-44d4-a5cc-537603b46e54
parent aa75e861
No related branches found
No related tags found
No related merge requests found
......@@ -75,6 +75,7 @@ function _M:runStep()
return false
else
self:moveDir(self.running.dir)
if not self.running then return false end
self.running.cnt = self.running.cnt + 1
if self.running.newdir then
self.running.dir = self.running.newdir
......
......@@ -183,7 +183,8 @@ function _M:probabilityTravel(x, y, dist)
return true
end
--- Reveals location surrounding the actor
--- Quake a zone
-- Moves randomly each grid to an other grid
function _M:doQuake(tg, x, y)
local locs = {}
local ms = {}
......@@ -288,16 +289,20 @@ function _M:onTakeHit(value, src)
return value
end
function _M:resolveSource()
if self.summoner_gain_exp and self.summoner then
return self.summoner:resolveSource()
else
return self
end
end
function _M:die(src)
engine.interface.ActorLife.die(self, src)
-- Gives the killer some exp for the kill
if src then
if src.summoner_gain_exp and src.summoner then
src.summoner:gainExp(self:worthExp(src.summoner))
else
src:gainExp(self:worthExp(src))
end
src:resolveSource():gainExp(self:worthExp(src:resolveSource()))
end
-- Do we get a blooooooody death ?
if rng.percent(33) then self:bloodyDeath() end
......
......@@ -35,6 +35,8 @@ newEntity{
end
end
}
sand.summoner_gain_exp = true
sand.summoner = src
sand.old_feat = old
sand.temporary = 20
sand.x = x
......
......@@ -85,7 +85,9 @@ newTalent{
game.level:removeEntity(self)
game.level.map:redisplay()
end
end
end,
summoner_gain_exp = true,
summoner = self,
}
game.level:addEntity(e)
game.level.map(x, y, Map.TERRAIN, e)
......
......@@ -115,7 +115,9 @@ newTalent{
game.level:removeEntity(self)
game.level.map:redisplay()
end
end
end,
summoner_gain_exp = true,
summoner = self,
}
game.level:addEntity(e)
game.level.map(x + i, y + j, Map.TERRAIN, e)
......
......@@ -42,6 +42,6 @@ newEntity{ define_as = "MINOTAUR_MAZE",
ai = "dumb_talented_simple", ai_state = { talent_in=1, },
on_die = function(self, who)
who:setQuestStatus("starter-zones", engine.Quest.COMPLETED, "maze")
who:resolveSource():setQuestStatus("starter-zones", engine.Quest.COMPLETED, "maze")
end,
}
......@@ -43,6 +43,6 @@ newEntity{ define_as = "OLD_MAN_WILLOW",
ai = "dumb_talented_simple", ai_state = { talent_in=3, },
on_die = function(self, who)
who:setQuestStatus("starter-zones", engine.Quest.COMPLETED, "old-forest")
who:resolveSource():setQuestStatus("starter-zones", engine.Quest.COMPLETED, "old-forest")
end,
}
......@@ -63,6 +63,6 @@ newEntity{ define_as = "SANDWORM_QUEEN",
ai = "dumb_talented_simple", ai_state = { talent_in=2, },
on_die = function(self, who)
who:setQuestStatus("starter-zones", engine.Quest.COMPLETED, "sandworm-lair")
who:resolveSource():setQuestStatus("starter-zones", engine.Quest.COMPLETED, "sandworm-lair")
end,
}
......@@ -55,6 +55,6 @@ newEntity{ define_as = "THE_MASTER",
ai = "dumb_talented_simple", ai_state = { talent_in=1, },
on_die = function(self, who)
who:setQuestStatus("tol-falas", engine.Quest.DONE)
who:resolveSource():setQuestStatus("tol-falas", engine.Quest.DONE)
end,
}
......@@ -31,6 +31,6 @@ newEntity{ define_as = "SHADE_OF_ANGMAR",
ai = "dumb_talented_simple", ai_state = { talent_in=4, },
on_die = function(self, who)
who:setQuestStatus("start-dunadan", engine.Quest.COMPLETED, "amon-sul")
who:resolveSource():setQuestStatus("start-dunadan", engine.Quest.COMPLETED, "amon-sul")
end,
}
......@@ -34,6 +34,6 @@ newEntity{ define_as = "TROLL_BILL",
ai = "dumb_talented_simple", ai_state = { talent_in=4, },
on_die = function(self, who)
who:setQuestStatus("start-dunadan", engine.Quest.COMPLETED, "trollshaws")
who:resolveSource():setQuestStatus("start-dunadan", engine.Quest.COMPLETED, "trollshaws")
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