From 20775d04836573704217ff460acb41f7c46f4f1f Mon Sep 17 00:00:00 2001 From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54> Date: Tue, 27 Apr 2010 00:13:31 +0000 Subject: [PATCH] map can define obscure and shown color tint Ringil can throw a burst of ice Amulet of the fish (water braething) flooded cave is underwater git-svn-id: http://svn.net-core.org/repos/t-engine4@564 51575b47-30f0-44d4-a5cc-537603b46e54 --- game/engine/Map.lua | 18 +++++++++++++---- game/engine/Zone.lua | 4 ++++ game/engine/interface/ObjectActivable.lua | 8 ++++++-- game/modules/tome/class/Actor.lua | 10 ++++++--- .../data/general/objects/egos/amulets.lua | 9 +++++++++ .../zones/ancient-elven-ruins/objects.lua | 10 +++++++++ .../tome/data/zones/flooded-cave/grids.lua | 2 ++ .../tome/data/zones/flooded-cave/zone.lua | 9 ++++++--- ideas/zones.ods | Bin 11197 -> 11229 bytes src/map.c | 19 +++++++++++++++++- src/map.h | 1 + 11 files changed, 77 insertions(+), 13 deletions(-) diff --git a/game/engine/Map.lua b/game/engine/Map.lua index e053b019d2..1a1974731e 100644 --- a/game/engine/Map.lua +++ b/game/engine/Map.lua @@ -38,7 +38,8 @@ OBJECT = 1000 --- The order of display for grid seen searchOrder = { TERRAIN, TRAP, OBJECT, ACTOR } -obscure = { 0.6, 0.6, 0.6, 1 } +color_shown = { 1, 1, 1, 1 } +color_obscure = { 0.6, 0.6, 0.6, 1 } --- Sets the viewport size -- Static @@ -62,9 +63,17 @@ end --- Defines the "obscure" factor of unseen map -- By default it is 0.6, 0.6, 0.6, 1 function _M:setObscure(r, g, b, a) - self.obscure = {r, g, b, a} + self.color_obscure = {r, g, b, a} -- If we are used on a real map, set it localy - if self._map then self._map:setObscure(unpack(self.obscure)) end + if self._map then self._map:setObscure(unpack(self.color_obscure)) end +end + +--- Defines the "shown" factor of seen map +-- By default it is 1, 1, 1, 1 +function _M:setShown(r, g, b, a) + self.color_shown= {r, g, b, a} + -- If we are used on a real map, set it localy + if self._map then self._map:setShown(unpack(self.color_shown)) end end --- Create the tile repositories @@ -120,7 +129,8 @@ function _M:loaded() self.particle = core.display.loadImage("/data/gfx/particle.png"):glTexture() self._map = core.map.newMap(self.w, self.h, self.mx, self.my, self.viewport.mwidth, self.viewport.mheight, self.tile_w, self.tile_h, self.multidisplay) - self._map:setObscure(unpack(self.obscure)) + self._map:setObscure(unpack(self.color_obscure)) + self._map:setShown(unpack(self.color_shown)) self._fovcache = { block_sight = core.fov.newCache(self.w, self.h), diff --git a/game/engine/Zone.lua b/game/engine/Zone.lua index d9ae2b06a4..dba422a40a 100644 --- a/game/engine/Zone.lua +++ b/game/engine/Zone.lua @@ -447,6 +447,10 @@ function _M:newLevel(level_data, lev, old_lev, game) generator:generate() end + -- Adjust shown & obscure colors + if level_data.color_shown then map:setShown(unpack(level_data.color_shown)) end + if level_data.color_obscure then map:setObscure(unpack(level_data.color_obscure)) end + -- Delete the room_map, now useless map.room_map = nil diff --git a/game/engine/interface/ObjectActivable.lua b/game/engine/interface/ObjectActivable.lua index 356337ea0e..7b3daca5f5 100644 --- a/game/engine/interface/ObjectActivable.lua +++ b/game/engine/interface/ObjectActivable.lua @@ -52,7 +52,9 @@ end function _M:useObject(who) if self.use_power then if self.power >= self.use_power.power then - local ret, no_power = self.use_power.use(self, who) + local co = coroutine.create(function() return self.use_power.use(self, who) end) + local ok, ret, no_power = coroutine.resume(co) + if not ok and ret then error(ret) end if not no_power then self.power = self.power - self.use_power.power end return ret else @@ -63,7 +65,9 @@ function _M:useObject(who) end end elseif self.use_simple then - local ret = self.use_simple.use(self, who) + local co = coroutine.create(function() return self.use_simple.use(self, who) end) + local ok, ret = coroutine.resume(co) + if not ok and ret then error(ret) end return ret end end diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua index c047f2c698..5e8f28d59d 100644 --- a/game/modules/tome/class/Actor.lua +++ b/game/modules/tome/class/Actor.lua @@ -89,6 +89,7 @@ function _M:init(t, no_default) t.melee_project = t.melee_project or {} t.can_pass = t.can_pass or {} t.move_project = t.move_project or {} + t.can_breath = t.can_breath or {} -- Resistances t.resists = t.resists or {} @@ -144,8 +145,10 @@ function _M:act() if self:attr("stunned") then self.energy.value = 0 end -- Suffocate ? - local air_level = game.level.map:checkEntity(self.x, self.y, Map.TERRAIN, "air_level") - if air_level then self:suffocate(-air_level, self) end + 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 + end -- Regain natural balance? local equilibrium_level = game.level.map:checkEntity(self.x, self.y, Map.TERRAIN, "equilibrium_level") @@ -781,8 +784,9 @@ end --- Suffocate a bit, lose air function _M:suffocate(value, src) + if self:attr("no_breath") then return end self.air = self.air - value - if self.air <= 0 and not self:attr("no_breath") then + if self.air <= 0 then game.logSeen(self, "%s suffocates to death!", self.name:capitalize()) return self:die(src) end diff --git a/game/modules/tome/data/general/objects/egos/amulets.lua b/game/modules/tome/data/general/objects/egos/amulets.lua index ba83ee5b3b..f8890eac8f 100644 --- a/game/modules/tome/data/general/objects/egos/amulets.lua +++ b/game/modules/tome/data/general/objects/egos/amulets.lua @@ -108,3 +108,12 @@ newEntity{ esp = {range=10}, }, } +newEntity{ + name = " of the fish", + level_range = {25, 50}, + rarity = 10, + cost = 10, + wielder = { + can_breath = {water=1}, + }, +} diff --git a/game/modules/tome/data/zones/ancient-elven-ruins/objects.lua b/game/modules/tome/data/zones/ancient-elven-ruins/objects.lua index 4238d1e3f6..9923e5a4d6 100644 --- a/game/modules/tome/data/zones/ancient-elven-ruins/objects.lua +++ b/game/modules/tome/data/zones/ancient-elven-ruins/objects.lua @@ -41,4 +41,14 @@ newEntity{ base = "BASE_LONGSWORD", inc_damage = { [DamageType.COLD] = 20 }, melee_project={[DamageType.ICE] = 15}, }, + max_power = 18, power_regen = 1, + use_power = { name = "generate a burst of ice", power = 8, + use = function(self, who) + local tg = {type="ball", range=0, radius=4, friendlyfire=false} + who:project(tg, who.x, who.y, engine.DamageType.ICE, {dur=2, dam=10 + (who:getMag() + who:getWil()) / 2}, {type="freeze"}) + game:playSoundNear(who, "talents/ice") + game.logSeen(who, "%s invokes the power of his icy sword!", who.name:capitalize()) + return true + end + }, } diff --git a/game/modules/tome/data/zones/flooded-cave/grids.lua b/game/modules/tome/data/zones/flooded-cave/grids.lua index 3f6d2f1160..c8149dab46 100644 --- a/game/modules/tome/data/zones/flooded-cave/grids.lua +++ b/game/modules/tome/data/zones/flooded-cave/grids.lua @@ -23,6 +23,7 @@ newEntity{ define_as = "WATER_FLOOR", name = "underwater", image = "terrain/water_floor.png", display = '.', color=colors.LIGHT_BLUE, + air_level = -5, air_condition="water", } newEntity{ @@ -33,4 +34,5 @@ newEntity{ can_pass = {pass_wall=1}, does_block_move = true, block_sight = true, + air_level = -20, } diff --git a/game/modules/tome/data/zones/flooded-cave/zone.lua b/game/modules/tome/data/zones/flooded-cave/zone.lua index c8937f395a..d95fcad97f 100644 --- a/game/modules/tome/data/zones/flooded-cave/zone.lua +++ b/game/modules/tome/data/zones/flooded-cave/zone.lua @@ -25,10 +25,13 @@ return { decay = {300, 800}, actor_adjust_level = function(zone, level, e) return zone.base_level + e:getRankLevelAdjust() + level.level-1 + rng.range(-1,2) end, width = 50, height = 50, --- all_remembered = true, + all_remembered = true, all_lited = true, - persistant = "zone", +-- persistant = "zone", ambiant_music = "elven_town.ogg", + -- Apply a bluish tint to all the map + color_shown = {0.5, 1, 0.8, 1}, + color_obscure = {0.5*0.6, 1*0.6, 0.8*0.6, 1}, generator = { map = { class = "engine.generator.map.Roomer", @@ -55,7 +58,7 @@ return { trap = { class = "engine.generator.trap.Random", -- nb_object = {6, 9}, - nb_object = {0, 0}, + nb_trap = {0, 0}, }, }, levels = diff --git a/ideas/zones.ods b/ideas/zones.ods index 7a1621bee947dd738f13cbf5af09be49acc350c7..22ea54e169b0da1988511a631224d490182f3e11 100644 GIT binary pat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Q#7A^+PLQ;4^bL;`H!a=MBk7i)^*s*x2~_o5dywc zTbidD*~{-d%Qu07=1t0ka|OoOvHXn_^<_V^{XxFrqImw}IZ@}vuX-G(oucT~16V1t z;oZG!k-f5{_zan&i;z22gzrUBGE+_0&T)LKr=NG`l#QPHBMzpYyxQ^Ap`+myWL&@> zVKNN7%FeXMw!R_91!mt8w=<Rtz08t31>nTj>1161Bc$W0nsZ)wpXu~P_1tEjPZVdx zeMoBWC1DFN5Z6T3Ge*V3WtG3Fsi#uqhcI1q1XXVWpd^n>pLORgqh}>mnMu1;U|leG zEmID?@O70m#Yn3PBoD8%{S56lhUg&+m4k%20ozF#<g(bWSY&xTZC-#201z_%7mNS? z!fMSpV}QTgA{$)4`zjb9oDL%a<NmEV!1RCPJDB2c1j3bmqZ(Z0U!4w935WeJ|M4$p z;#Md9J7%T-@AHT8<G#!EOZqb_5CQ%)1g3+V_Q5ZoU-_XI2LSjr{_X_*VP;SOz|G#< zhR@&4RaXNDq5x0;{ymAby$e2|^Y108Apii)A9DZz6)H>^)g6rbU5M$g<^Q~lzkUBO u9Tot<%ii1D8R_Wt|7{^}_)}302mm<Y0|1nN%mV;;F;#bA;AXC0;{O0?+^=~6 diff --git a/src/map.c b/src/map.c index 618e698a5f..b651063795 100644 --- a/src/map.c +++ b/src/map.c @@ -45,6 +45,8 @@ static int map_new(lua_State *L) map->obscure_r = map->obscure_g = map->obscure_b = 0.6f; map->obscure_a = 1; + map->shown_r = map->shown_g = map->shown_b = 1; + map->shown_a = 1; map->multidisplay = multidisplay; map->w = w; @@ -134,6 +136,20 @@ static int map_set_obscure(lua_State *L) return 0; } +static int map_set_shown(lua_State *L) +{ + map_type *map = (map_type*)auxiliar_checkclass(L, "core{map}", 1); + float r = luaL_checknumber(L, 2); + float g = luaL_checknumber(L, 3); + float b = luaL_checknumber(L, 4); + float a = luaL_checknumber(L, 5); + map->shown_r = r; + map->shown_g = g; + map->shown_b = b; + map->shown_a = a; + return 0; +} + static int map_set_grid(lua_State *L) { map_type *map = (map_type*)auxiliar_checkclass(L, "core{map}", 1); @@ -252,7 +268,7 @@ static int map_to_screen(lua_State *L) { if (map->grids_seens[i][j]) { - glColor4f(1, 1, 1, 1); + glColor4f(map->shown_r, map->shown_g, map->shown_b, map->shown_a); if (map->multidisplay) { @@ -374,6 +390,7 @@ static const struct luaL_reg map_reg[] = { {"__gc", map_free}, {"close", map_free}, + {"setShown", map_set_shown}, {"setObscure", map_set_obscure}, {"setGrid", map_set_grid}, {"cleanSeen", map_clean_seen}, diff --git a/src/map.h b/src/map.h index de31577772..f1ecd97804 100644 --- a/src/map.h +++ b/src/map.h @@ -36,6 +36,7 @@ typedef struct { // Map parameters float obscure_r, obscure_g, obscure_b, obscure_a; + float shown_r, shown_g, shown_b, shown_a; // Map size int w; -- GitLab