diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua index 7e1c3df52908ca227441af79dabc05746cb6e6fb..360e6782180f21d1166a44b509973c3dcfc7b701 100644 --- a/game/modules/tome/class/Actor.lua +++ b/game/modules/tome/class/Actor.lua @@ -3211,6 +3211,8 @@ function _M:die(src, death_note) if game.level and game.level.data.record_player_kills then game.level.data.record_player_kills = game.level.data.record_player_kills + 1 end + + p.last_kill_turn = game.turn end -- Ingredients diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua index a171c71e4a8bee785a4aff5ca7a310cfb73b195d..af807d3c8522b571a2db30c0bb40c3eb1e607cd6 100644 --- a/game/modules/tome/class/Game.lua +++ b/game/modules/tome/class/Game.lua @@ -773,8 +773,23 @@ function _M:onLevelLoadRun() self.on_level_load_fcts[self.zone.short_name.."-"..self.level.level] = nil end +function _M:noStairsTime() + local nb = 3 + if game.difficulty == game.DIFFICULTY_EASY then nb = 0 + elseif game.difficulty == game.DIFFICULTY_NIGHTMARE then nb = 5 + elseif game.difficulty == game.DIFFICULTY_INSANE then nb = 7 + elseif game.difficulty == game.DIFFICULTY_MADNESS then nb = 10 + end + return nb * 10 +end + function _M:changeLevel(lev, zone, params) params = params or {} + if self:getPlayer(true).last_kill_turn and self:getPlayer(true).last_kill_turn >= self.turn - self:noStairsTime() then + local left = math.ceil((10 + self:getPlayer(true).last_kill_turn - self.turn + self:noStairsTime()) / 10) + self.logPlayer(self.player, "#LIGHT_RED#You may not change level so soon after a kill (%d game turns left to wait)!", left) + return + end if not self.player.can_change_level then self.logPlayer(self.player, "#LIGHT_RED#You may not change level without your own body!") return diff --git a/game/modules/tome/data/birth/descriptors.lua b/game/modules/tome/data/birth/descriptors.lua index ef503723a1d8b949ab5c2f9a27d0c105e4734b07..7e0457cba513b25d52b2dcd1e5ba8be2b439d685 100644 --- a/game/modules/tome/data/birth/descriptors.lua +++ b/game/modules/tome/data/birth/descriptors.lua @@ -169,6 +169,7 @@ newBirthDescriptor{ { "#GOLD##{bold}#Normal mode#WHITE##{normal}#", "Provides the normal level of challenges.", + "Stairs can not be used for 3 turns after a kill.", }, descriptor_choices = { @@ -190,6 +191,7 @@ newBirthDescriptor{ "Unfair game setting", "All zone levels increased by 50%", "All creature talent levels increased by 30%", + "Stairs can not be used for 5 turns after a kill.", "Player can earn Nightmare version of achievements if also playing in Roguelike or Adventure permadeath mode.", }, descriptor_choices = @@ -218,6 +220,7 @@ newBirthDescriptor{ "Rare creatures are far more frequent and random bosses start to appear", "Nonrandom bosses will have randomly selected talents", "All enemies have 20% more life", + "Stairs can not be used for 7 turns after a kill.", "Player can earn Insane version of achievements if also playing in Roguelike or Adventure permadeath mode.", }, descriptor_choices = @@ -250,6 +253,7 @@ newBirthDescriptor{ "All creature talent levels increased by 170%", "Rare creatures are far more frequent and random bosses start to appear", "Bosses will have randomly selected talents", + "Stairs can not be used for 10 turns after a kill.", "Player is being hunted! Randomly all foes in a radius will get a feeling of where she/he is", "Player can earn Madness version of achievements if also playing in Roguelike or Adventure permadeath mode.", },