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

plop

git-svn-id: http://svn.net-core.org/repos/t-engine4@5345 51575b47-30f0-44d4-a5cc-537603b46e54
parent 75f07611
No related branches found
No related tags found
No related merge requests found
......@@ -1210,7 +1210,7 @@ function _M:setupCommands()
end end,
[{"_g","ctrl"}] = function() if config.settings.cheat then
-- self:registerDialog(require("mod.dialogs.DownloadCharball").new())
local f, err = loadfile("/data/general/events/fearscape-portal.lua")
local f, err = loadfile("/data/general/events/snowstorm.lua")
print(f, err)
setfenv(f, setmetatable({level=self.level, zone=self.zone}, {__index=_G}))
print(pcall(f))
......
-- 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
-- Darken
game.level.map:setShown(0.6, 0.6, 0.6, 1)
game.level.map:setObscure(0.6*0.6, 0.6*0.6, 0.6*0.6, 0.6)
game.level.map:liteAll(0, 0, game.level.map.w, game.level.map.h, false)
-- Add snowing
local Map = require "engine.Map"
level.foreground_particle = require("engine.Particles").new("snowing", 1, {factor=10, width=Map.viewport.width, height=Map.viewport.height})
game.level.data.snowstorm_event_foreground = game.level.data.foreground
game.level.data.foreground = function(level, x, y, nb_keyframes)
if level.data.snowstorm_event_foreground then level.data.snowstorm_event_foreground(level, x, y, nb_keyframes) end
if not config.settings.tome.weather_effects or not level.foreground_particle then return end
level.foreground_particle.ps:toScreen(x, y, true, 1)
end
game.zone.snowstorm_event_levels = game.zone.snowstorm_event_levels or {}
game.zone.snowstorm_event_levels[level.level] = true
if not game.zone.snowstorm_event_on_turn then game.zone.snowstorm_event_on_turn = game.zone.on_turn or function() end end
game.zone.on_turn = function()
if game.zone.snowstorm_event_on_turn then game.zone.snowstorm_event_on_turn() end
if game.turn % 10 ~= 0 or not game.zone.snowstorm_event_levels[game.level.level] then return end
end
require("engine.ui.Dialog"):simplePopup("Snowstorm", "As you walk into the area you notice a huge snowstorm over your head, beware.")
return true
......@@ -18,6 +18,7 @@
-- darkgod@te4.org
dir = math.rad(110)
factor = factor or 1
return { generator = function()
local x, y = rng.range(-width/2, width), rng.range(-height/2, height)
......@@ -42,11 +43,11 @@ return { generator = function()
end, },
function(self)
if first then
self.ps:emit(2100)
self.ps:emit(700 * factor)
else
self.ps:emit(6)
self.ps:emit(2 * factor)
end
first = false
end,
3000,
1000 * factor,
"weather/snowflake"
......@@ -22,4 +22,5 @@ return { one_per_level=true,
{group="outdoor-majeyal-generic"},
{group="majeyal-generic"},
{name="cultists", percent=10},
-- {name="snowstorm", percent=10},
}
......@@ -99,15 +99,5 @@ return {
end
game.state:makeWeather(level, 6, {max_nb=7, chance=1, dir=120, speed={0.1, 0.9}, alpha={0.2, 0.4}, particle_name="weather/grey_cloud_%02d"})
if not config.settings.tome.weather_effects then return end
local Map = require "engine.Map"
level.foreground_particle = require("engine.Particles").new("snowing", 1, {width=Map.viewport.width, height=Map.viewport.height})
end,
foreground = function(level, x, y, nb_keyframes)
if not config.settings.tome.weather_effects or not level.foreground_particle then return end
level.foreground_particle.ps:toScreen(x, y, true, 1)
end,
}
......@@ -74,5 +74,13 @@ return {
post_process = function(level)
if not config.settings.tome.weather_effects then return end
local Map = require "engine.Map"
level.foreground_particle = require("engine.Particles").new("snowing", 1, {width=Map.viewport.width, height=Map.viewport.height})
end,
foreground = function(level, x, y, nb_keyframes)
if not config.settings.tome.weather_effects or not level.foreground_particle then return end
level.foreground_particle.ps:toScreen(x, y, true, 1)
end,
}
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