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

Added pockets of air bubbles on the flooded level of the lake of Nur. Beware,...

Added pockets of air bubbles on the flooded level of the lake of Nur. Beware, they will not last forever


git-svn-id: http://svn.net-core.org/repos/t-engine4@2239 51575b47-30f0-44d4-a5cc-537603b46e54
parent 92e9f41c
No related branches found
No related tags found
No related merge requests found
......@@ -314,7 +314,9 @@ function _M:act()
-- Suffocate ?
local air_level, air_condition = game.level.map:checkEntity(self.x, self.y, Map.TERRAIN, "air_level"), game.level.map:checkEntity(self.x, self.y, Map.TERRAIN, "air_condition")
if air_level then
if not air_condition or not self.can_breath[air_condition] then self:suffocate(-air_level, self) end
if not air_condition or not self.can_breath[air_condition] then
self:suffocate(-air_level, self)
end
end
-- Regain natural balance?
......
......@@ -421,7 +421,7 @@ end
--- Suffocate a bit, lose air
function _M:suffocate(value, src)
local dead, affected = mod.class.Actor.suffocate(self, value, src)
if affected then
if affected and value < 0 then
self:runStop("suffocating")
self:restStop("suffocating")
end
......
......@@ -48,3 +48,22 @@ newEntity{
end
end,
}
newEntity{
define_as = "WATER_FLOOR_BUBBLE",
name = "underwater air bubble", image = "terrain/water_floor_bubbles.png",
display = '.', color=colors.LIGHT_BLUE, back_color=colors.DARK_BLUE,
add_displays = class:makeWater(true),
air_level = 15, nb_charges = resolvers.rngrange(4, 7),
force_clone = true,
on_stand = function(self, x, y, who)
if ((who.can_breath.water and who.can_breath.water <= 0) or not who.can_breath.water) and not who:attr("no_breath") then
self.nb_charges = self.nb_charges - 1
if self.nb_charges <= 0 then
game.logSeen(who, "#AQUAMARINE#The air bubbles are depleted!")
local g = game.zone:makeEntityByName(game.level, "terrain", "WATER_FLOOR")
game.zone:addEntity(game.level, g, "terrain", x, y)
end
end
end,
}
......@@ -37,7 +37,7 @@ return {
nb_rooms = 10,
rooms = {"random_room"},
lite_room_chance = 0,
['.'] = "WATER_FLOOR",
['.'] = {"WATER_FLOOR","WATER_FLOOR","WATER_FLOOR","WATER_FLOOR","WATER_FLOOR","WATER_FLOOR","WATER_FLOOR","WATER_FLOOR","WATER_FLOOR","WATER_FLOOR","WATER_FLOOR_BUBBLE"},
['#'] = "WATER_WALL",
up = "WATER_UP",
down = "WATER_DOWN",
......
......@@ -54,7 +54,6 @@ function _M:use(item)
local stop = false
if act == "godmode" then
game.player:forceLevelup(50)
game.player.no_breath = 1
game.player.invulnerable = 1
game.player.esp.all = 1
game.player.esp.range = 50
......
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