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

finish west portal

git-svn-id: http://svn.net-core.org/repos/t-engine4@1281 51575b47-30f0-44d4-a5cc-537603b46e54
parent 26e7be6e
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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!"},
}
......
-- 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
......@@ -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)
......
......@@ -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")
......
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