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

Can not die the same turn as winning in the derth arena

git-svn-id: http://svn.net-core.org/repos/t-engine4@6090 51575b47-30f0-44d4-a5cc-537603b46e54
parent 5d126e48
No related branches found
No related tags found
No related merge requests found
......@@ -136,6 +136,12 @@ function _M:call(str, ...)
self.changed = true
end
--- Gets the last log line
function _M:getNewestLine()
if self.log[1] then return self.log[1].str end
return nil
end
--- Clear the log
function _M:empty()
self.cache = {}
......
......@@ -43,9 +43,6 @@ function _M:init(chat, id)
self:generateList()
self.c_desc = Textzone.new{width=self.iw - 10 - xoff, height=1, auto_height=true, text=self.text.."\n"}
self:generateList()
self.c_list = VariableList.new{width=self.iw - 10 - xoff, list=self.list, fct=function(item) self:use(item) end, select=function(item) self:select(item) end}
local uis = {
......@@ -145,5 +142,9 @@ function _M:generateList()
self.text = self.chat:replace(self.chat:get(self.cur_id).text)
if self.chat:get(self.cur_id).action then
self.chat:get(self.cur_id).action(self.npc, self.player)
end
return true
end
......@@ -297,7 +297,7 @@ function _M:act()
-- Resting ? Running ? Otherwise pause
if not self:restStep() and not self:runStep() and self.player and self:enoughEnergy() then
game.paused = true
game.log("")
if game.uiset.logdisplay:getNewestLine() ~= "" then game.log("") end
elseif not self.player then
self:useEnergy()
end
......
......@@ -110,6 +110,7 @@ newChat{ id="go",
newChat{ id="win",
action = function(npc, player) player:attr("invulnerable", 1) end,
text = [[#LIGHT_GREEN#*The Cornac rogue comes back from the shadows*#WHITE#
Well done, @playerdescriptor.race@! I knew you had potential.
#LIGHT_GREEN#*The rogue takes out his hood, showing a fairly young, but unmistakingly
......@@ -126,6 +127,8 @@ Good luck in your adventures, and come visit us when you are done!
]],
answers = {
{ "I will. Farewell for now.", action = function (self, player)
player:attr("invulnerable", -1)
local g = game.zone:makeEntityByName(game.level, "terrain", "SAND_UP_WILDERNESS")
g.change_level = 1
g.change_zone = "town-derth"
......
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