Commit 5edd9e27f4edb4fd8e68c21211dbccbcc79cfc87
1 parent
42f1dff9
Fixed endgame dialog running multiple times in some cases
Fixed "player under ther stairs" bug git-svn-id: http://svn.net-core.org/repos/t-engine4@1501 51575b47-30f0-44d4-a5cc-537603b46e54
Showing
7 changed files
with
25 additions
and
11 deletions
... | ... | @@ -202,7 +202,7 @@ function _M:unregisterDialog(d) |
202 | 202 | self.dialogs[d] = nil |
203 | 203 | d:unload() |
204 | 204 | -- Update positions |
205 | - for i, id in ipairs(self.dialogs) do self.dialogs[id] = i end | |
205 | + for i, id in ipairs(self.dialogs) do id.__stack_id = i self.dialogs[id] = i end | |
206 | 206 | |
207 | 207 | local last = self.dialogs[#self.dialogs] or self |
208 | 208 | if last.key then last.key:setCurrent() end | ... | ... |
... | ... | @@ -93,8 +93,8 @@ function _M:regen() |
93 | 93 | d.__showup = false |
94 | 94 | game:replaceDialog(self, d) |
95 | 95 | end |
96 | - | |
97 | 96 | function _M:resolveAuto() |
97 | +--[[ | |
98 | 98 | if not self.chat:get(self.cur_id).auto then return end |
99 | 99 | for i, a in ipairs(self.chat:get(self.cur_id).answers) do |
100 | 100 | if not a.cond or a.cond(self.npc, self.player) then |
... | ... | @@ -103,6 +103,7 @@ function _M:resolveAuto() |
103 | 103 | end |
104 | 104 | end |
105 | 105 | end |
106 | +]] | |
106 | 107 | end |
107 | 108 | |
108 | 109 | function _M:generateList() | ... | ... |
... | ... | @@ -376,11 +376,20 @@ function _M:changeLevel(lev, zone, keep_old_lev, force_down) |
376 | 376 | self.player:move(self.player.wild_x, self.player.wild_y, true) |
377 | 377 | self.player.last_wilderness = self.zone.short_name |
378 | 378 | else |
379 | + local x, y | |
379 | 380 | if lev > old_lev and not force_down then |
380 | - self.player:move(self.level.default_up.x, self.level.default_up.y, true) | |
381 | + x, y = self.level.default_up.x, self.level.default_up.y | |
381 | 382 | else |
382 | - self.player:move(self.level.default_down.x, self.level.default_down.y, true) | |
383 | + x, y = self.level.default_down.x, self.level.default_down.y | |
383 | 384 | end |
385 | + -- Check if there is already an actor at that location, if so move it | |
386 | + local blocking_actor = self.level.map(x, y, engine.Map.ACTOR) | |
387 | + if blocking_actor then | |
388 | + local newx, newy = util.findFreeGrid(x, y, 20, true, {[Map.ACTOR]=true}) | |
389 | + if newx and newy then blocking_actor:move(newx, newy, true) | |
390 | + else blocking_actor:teleportRandom(x, y, 200) end | |
391 | + end | |
392 | + self.player:move(x, y, true) | |
384 | 393 | end |
385 | 394 | self.player.changed = true |
386 | 395 | if self.to_re_add_actors then for act, _ in pairs(self.to_re_add_actors) do | ... | ... |
... | ... | @@ -115,6 +115,8 @@ function failed_mount_doom(self, level) |
115 | 115 | end |
116 | 116 | |
117 | 117 | function win(self, how) |
118 | + game:playMusic("Lords of the Sky.ogg") | |
119 | + | |
118 | 120 | if how == "full" then world:gainAchievement("WIN_FULL", game.player) |
119 | 121 | elseif how == "aeryn-sacrifice" then world:gainAchievement("WIN_AERYN", game.player) |
120 | 122 | elseif how == "self-sacrifice" then world:gainAchievement("WIN_SACRIFICE", game.player) |
... | ... | @@ -123,3 +125,4 @@ function win(self, how) |
123 | 125 | game.player.winner = how |
124 | 126 | game:registerDialog(require("engine.dialogs.ShowText").new("Winner", "win", {playername=game.player.name, how=how}, game.w * 0.6)) |
125 | 127 | end |
128 | + | ... | ... |
... | ... | @@ -42,7 +42,7 @@ newTalent{ |
42 | 42 | elseif lev == 4 then |
43 | 43 | self:learnTalent(self.T_DISARMING_TRAP, true) |
44 | 44 | elseif lev == 5 then |
45 | - self:learnTalent(self.T_FREEZING_TRAP, true) | |
45 | + self:learnTalent(self.T_NIGHTSHADE_TRAP, true) | |
46 | 46 | end |
47 | 47 | end, |
48 | 48 | on_unlearn = function(self, t) |
... | ... | @@ -56,7 +56,7 @@ newTalent{ |
56 | 56 | elseif lev == 3 then |
57 | 57 | self:unlearnTalent(self.T_DISARMING_TRAP) |
58 | 58 | elseif lev == 4 then |
59 | - self:unlearnTalent(self.T_FREEZING_TRAP) | |
59 | + self:unlearnTalent(self.T_NIGHTSHADE_TRAP) | |
60 | 60 | end |
61 | 61 | end, |
62 | 62 | info = function(self, t) |
... | ... | @@ -426,7 +426,7 @@ newTalent{ |
426 | 426 | } |
427 | 427 | |
428 | 428 | newTalent{ |
429 | - name = "Freezing Trap", | |
429 | + name = "Nightshade Trap", | |
430 | 430 | type = {"cunning/traps", 1}, |
431 | 431 | points = 1, |
432 | 432 | cooldown = 8, |
... | ... | @@ -444,15 +444,15 @@ newTalent{ |
444 | 444 | local Trap = require "mod.class.Trap" |
445 | 445 | local t = Trap.new{ |
446 | 446 | type = "elemental", id_by_type=true, unided_name = "trap", |
447 | - name = "freeze trap", color=colors.LIGHT_BLUE, | |
447 | + name = "nightshade trap", color=colors.LIGHT_BLUE, | |
448 | 448 | display = '^', |
449 | 449 | dam = dam, |
450 | 450 | faction = self.faction, |
451 | 451 | check_hit = self:combatAttackDex(), |
452 | 452 | triggered = function(self, x, y, who) |
453 | - self:project({type="hit", x=x,y=y}, x, y, engine.DamageType.COLD, self.dam, {type="freeze"}) | |
453 | + self:project({type="hit", x=x,y=y}, x, y, engine.DamageType.NATURE, self.dam, {type="slime"}) | |
454 | 454 | if who:checkHit(self.check_hit, who:combatSpellResist(), 0, 95, 15) and who:canBe("stun") then |
455 | - who:setEffect(who.EFF_FROZEN, 4, {src=self.summoner}) | |
455 | + who:setEffect(who.EFF_STUNNED, 4, {src=self.summoner}) | |
456 | 456 | end |
457 | 457 | return true, true |
458 | 458 | end, |
... | ... | @@ -480,7 +480,7 @@ newTalent{ |
480 | 480 | return true |
481 | 481 | end, |
482 | 482 | info = function(self, t) |
483 | - return ([[Lay a freezing trap, doing %0.2f cold damage to a creature and freezing it for 4 turns.]]): | |
483 | + return ([[Lay a trap cotted with a potent venom, doing %0.2f nature damage to a creature and stunning it for 4 turns.]]): | |
484 | 484 | format(damDesc(self, DamageType.COLD, 20 + self:getCun() * 0.7 * self:getTalentLevel(self.T_TRAP_MASTERY))) |
485 | 485 | end, |
486 | 486 | } | ... | ... |
No preview for this file type
-
Please register or login to post a comment