diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua index bc388b2ff5889c40c644e61358bd42cb484f51b5..e296f67974a87131c01c9dbfc4965232ed283132 100644 --- a/game/modules/tome/class/Game.lua +++ b/game/modules/tome/class/Game.lua @@ -550,6 +550,7 @@ function _M:setupCommands() end, [{"_g","ctrl"}] = function() if config.settings.tome.cheat then +-- self.level.map:particleEmitter(self.player.x, self.player.y, 3, "farportal_lightning") self:changeLevel(1, "grushnak-pride") -- self.player:grantQuest("master-jeweler") end diff --git a/game/modules/tome/data/chats/zemekkys.lua b/game/modules/tome/data/chats/zemekkys.lua index a27b9fe5f3dbb66d7d82e1aac06d444daad4bf2c..88b0f0eef77fa0c770a769268a64d2c1cb5f715d 100644 --- a/game/modules/tome/data/chats/zemekkys.lua +++ b/game/modules/tome/data/chats/zemekkys.lua @@ -42,7 +42,7 @@ newChat{ id="welcome", What do you want, @playerdescriptor.race@?]], answers = { {"Paladin Aeryn told me that you could help me. I need to get to Middle Earth.", jump="help", cond=function(npc, player) return not player:hasQuest("west-portal") end}, - {"I found the Blood-Runed Athame, but there was no Resonating Diamond.", jump="athame", cond=function(npc, player) return player:hasQuest("west-portal") and player:hasQuest("west-portal"):isCompleted("athame") end}, + {"I found the Blood-Runed Athame, but there was no Resonating Diamond.", jump="athame", cond=function(npc, player) return player:hasQuest("west-portal") and player:hasQuest("west-portal"):isCompleted("athame") and not player:hasQuest("west-portal"):isCompleted("gem") end}, {"I have a Resonating Diamond.", jump="complete", cond=function(npc, player) return player:hasQuest("west-portal") and player:hasQuest("west-portal"):isCompleted("gem") end}, {"Sorry, I have to go!"}, } diff --git a/game/modules/tome/data/gfx/particles/farportal_lightning.lua b/game/modules/tome/data/gfx/particles/farportal_lightning.lua new file mode 100644 index 0000000000000000000000000000000000000000..14aeff5a93720cdba6b724218cf27e5961f81ba9 --- /dev/null +++ b/game/modules/tome/data/gfx/particles/farportal_lightning.lua @@ -0,0 +1,119 @@ +-- ToME - Tales of Middle-Earth +-- Copyright (C) 2009, 2010 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 + +-- Make the 2 main forks +local forks +local m1 +local m2 +local tiles +local tx +local ty +local breakdir +local pause = false + +local function make_forks(tx, ty) + forks = {{}, {}} + m1 = forks[1] + m2 = forks[2] + tiles = math.ceil(math.sqrt(tx*tx+ty*ty)) + tx = tx * engine.Map.tile_w + ty = ty * engine.Map.tile_h + breakdir = math.rad(rng.range(-8, 8)) + m1.bx = 0 + m1.by = 0 + m1.thick = 5 + m1.dir = math.atan2(ty, tx) + breakdir + m1.size = math.sqrt(tx*tx+ty*ty) / 2 + + m2.bx = m1.size * math.cos(m1.dir) + m2.by = m1.size * math.sin(m1.dir) + m2.thick = 5 + m2.dir = math.atan2(ty, tx) - breakdir + m2.size = math.sqrt(tx*tx+ty*ty) / 2 + + -- Add more forks + for i = 1, math.min(math.max(3, m1.size / 5), 20) do + local m = rng.percent(50) and forks[1] or forks[2] + if rng.percent(60) then m = rng.table(forks) end + local f = {} + f.thick = 2 + f.dir = m.dir + math.rad(rng.range(-30,30)) + f.size = rng.range(6, 25) + local br = rng.range(1, m.size) + f.bx = br * math.cos(m.dir) + m.bx + f.by = br * math.sin(m.dir) + m.by + forks[#forks+1] = f + end +end + +make_forks(1,1) + +-- Populate the lightning based on the forks +return { generator = function() + if pause then + return { + life = 35, + size = 0, sizev = 0, sizea = 0, + + x = 0, xv = 0, xa = 0, + y = 0, yv = 0, ya = 0, + dir = 0, dirv = 0, dira = 0, + vel = 0, velv = 0, vela = 0, + + r = 0, rv = 0, ra = 0, + g = 0, gv = 0, ga = 0, + b = 0, bv = 0, ba = 0, + a = 0, av = 0, aa = 0, + } + else + local f = rng.table(forks) + local a = f.dir + local rad = rng.range(-3,3) + local ra = math.rad(rad) + local r = rng.range(1, f.size) + + return { + life = 4, + size = f.thick, sizev = 0, sizea = 0, + + x = r * math.cos(a) + 3 * math.cos(ra) + f.bx, xv = 0, xa = 0, + y = r * math.sin(a) + 3 * math.sin(ra) + f.by, yv = 0, ya = 0, + dir = 0, dirv = 0, dira = 0, + vel = 0, velv = 0, vela = 0, + + r = rng.range(140, 200)/255, rv = 0, ra = 0, + g = rng.range(180, 220)/255, gv = 0, ga = 0, + b = rng.range(220, 240)/255, bv = 0, ba = 0, + a = rng.range(230, 255)/255, av = 0, aa = 0, + } + end +end, }, +function(self) + self.nb = (self.nb or 0) + 1 + + -- Create a lightning + if self.nb == 1 then pause = false make_forks(rng.range(-2,2), rng.range(-2,2)) end + + if self.nb < 4 then + self.ps:emit(200*tiles) + elseif self.nb == 6 then pause = true self.ps:emit(1) + elseif self.nb == 32 then pause = false self.nb = 0 + end +end, +4*(230)*tiles diff --git a/game/modules/tome/data/quests/west-portal.lua b/game/modules/tome/data/quests/west-portal.lua index afa7ac94e1d6bfe8c103d271954f77a40b3b3a7e..1c1f1d536bd452027527eb9270b4a0eb1d367016 100644 --- a/game/modules/tome/data/quests/west-portal.lua +++ b/game/modules/tome/data/quests/west-portal.lua @@ -71,7 +71,7 @@ wyrm_lair = function(self, who) game.logPlayer(game.player, "Zemekkys points the location of Briagh lair on your map.") end -create_portal = function (npc, player) +create_portal = function(self, npc, player) -- Farportal local g = mod.class.Grid.new{ name = "Farportal: Minas Tirith", @@ -116,6 +116,9 @@ This one seems to go near the town of Minas Tirith in the West.]], game.zone:addEntity(game.level, zemekkys, "actor", 41, 17) game.zone:addEntity(game.level, g, "terrain", 41, 16) + game.level.map:particleEmitter(41, 16, 3, "farportal_lightning") + game.level.map:particleEmitter(41, 16, 3, "farportal_lightning") + game.level.map:particleEmitter(41, 16, 3, "farportal_lightning") player:move(40, 16, true) player:setQuestStatus(self.id, engine.Quest.DONE) diff --git a/game/modules/tome/data/zones/briagh-lair/npcs.lua b/game/modules/tome/data/zones/briagh-lair/npcs.lua index 249e21e9b8bad412b0a34c324e37c0f0882372cd..df0402c5ecd2de26736b4693ae896b56519b6732 100644 --- a/game/modules/tome/data/zones/briagh-lair/npcs.lua +++ b/game/modules/tome/data/zones/briagh-lair/npcs.lua @@ -17,9 +17,7 @@ -- Nicolas Casalini "DarkGod" -- darkgod@te4.org -load("/data/general/npcs/spider.lua", rarity(0)) - -load("/data/general/npcs/all.lua", rarity(4, 35)) +load("/data/general/npcs/sandworm.lua", rarity(0)) local Talents = require("engine.interface.ActorTalents")