From 6fbe3205359daabee2a6c8d8af4c02f2a47186d1 Mon Sep 17 00:00:00 2001 From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54> Date: Wed, 15 Aug 2012 23:26:24 +0000 Subject: [PATCH] tmp git-svn-id: http://svn.net-core.org/repos/t-engine4@5479 51575b47-30f0-44d4-a5cc-537603b46e54 --- game/modules/tome/class/Game.lua | 2 +- .../tome/data/general/events/slimey-pool.lua | 41 +++++++++++++++++++ .../modules/tome/data/timed_effects/floor.lua | 9 ++++ 3 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 game/modules/tome/data/general/events/slimey-pool.lua diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua index 32fd2346d1..6990f34d1f 100644 --- a/game/modules/tome/class/Game.lua +++ b/game/modules/tome/class/Game.lua @@ -1219,7 +1219,7 @@ function _M:setupCommands() end end end end, [{"_g","ctrl"}] = function() if config.settings.cheat then - local f, err = loadfile("/data/general/events/fell-aura.lua") + local f, err = loadfile("/data/general/events/slimey-pool.lua") print(f, err) setfenv(f, setmetatable({level=self.level, zone=self.zone}, {__index=_G})) print(pcall(f)) diff --git a/game/modules/tome/data/general/events/slimey-pool.lua b/game/modules/tome/data/general/events/slimey-pool.lua new file mode 100644 index 0000000000..9986a34b22 --- /dev/null +++ b/game/modules/tome/data/general/events/slimey-pool.lua @@ -0,0 +1,41 @@ +-- ToME - Tales of Maj'Eyal +-- Copyright (C) 2009, 2010, 2011, 2012 Nicolas Casalini +-- +-- This program is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see <http://www.gnu.org/licenses/>. +-- +-- Nicolas Casalini "DarkGod" +-- darkgod@te4.org + +-- Find a random spot +local x, y = game.state:findEventGrid(level) +if not x then return false end + +local list = mod.class.Grid:loadList("/data/general/grids/slime.lua") + +local g = list.SLIME_FLOOR:clone() +g.name = "slimey pool" +g.on_stand = nil +level.map(x, y, engine.Map.TERRAIN, g) +game.nicer_tiles:updateAround(level, x, y) + +local on_stand = function(self, x, y, who) who:setEffect(who.EFF_SLIMEY_POOL, 1, {}) end + +local grids = core.fov.circle_grids(x, y, 1, "do not block") +for x, yy in pairs(grids) do for y, _ in pairs(yy) do + local g = game.level.map(x, y, engine.Map.TERRAIN):cloneFull() + g.on_stand = g.on_stand or on_stand + game.zone:addEntity(game.level, g, "terrain", x, y) +end end + +return true diff --git a/game/modules/tome/data/timed_effects/floor.lua b/game/modules/tome/data/timed_effects/floor.lua index 08facbb0f7..929fec6fb5 100644 --- a/game/modules/tome/data/timed_effects/floor.lua +++ b/game/modules/tome/data/timed_effects/floor.lua @@ -142,3 +142,12 @@ floorEffect{ self:effectTemporaryValue(eff, "resists", {all=-20}) end, } + +floorEffect{ + desc = "Slimey Pool", image = "talents/acidic_skin.png", + long_desc = "The target is walking on slime. Decreasing movement speed by 20% and dealing 20 slime damage to any creatures attacking it.", + activate = function(self, eff) + self:effectTemporaryValue(eff, "on_melee_hit", {[DamageType.SLIME] = 20}) + self:effectTemporaryValue(eff, "movement_speed", -0.2) + end, +} -- GitLab