Skip to content
Snippets Groups Projects
Commit 5fb83387 authored by dg's avatar dg
Browse files

tset

git-svn-id: http://svn.net-core.org/repos/t-engine4@6034 51575b47-30f0-44d4-a5cc-537603b46e54
parent cee2b77b
No related branches found
No related tags found
No related merge requests found
...@@ -31,6 +31,7 @@ function _M:init(t, no_default) ...@@ -31,6 +31,7 @@ function _M:init(t, no_default)
self.name = "Yiilkgur, the Sher'Tul Fortress" self.name = "Yiilkgur, the Sher'Tul Fortress"
self.is_fortress = true self.is_fortress = true
self.no_worldmap_encounter = true
self.allow_talents_worldmap = true self.allow_talents_worldmap = true
self.faction = game:getPlayer(true).faction self.faction = game:getPlayer(true).faction
self.no_inventory_access = true self.no_inventory_access = true
...@@ -226,15 +227,23 @@ function _M:moveEngineMove(x, y, force) ...@@ -226,15 +227,23 @@ function _M:moveEngineMove(x, y, force)
return true return true
end end
function _M:takeControl(from)
game.party:addMember(self, {temporary_level=1, control="full"})
game.party:setPlayer(self, true)
game.level.map:remove(from.x, from.y, engine.Map.ACTOR)
end
--- Checks if something bumps in us --- Checks if something bumps in us
-- If it happens the method attack is called on the target with the attacker as parameter. -- If it happens the method attack is called on the target with the attacker as parameter.
-- Do not touch! -- Do not touch!
function _M:block_move(x, y, e, act) function _M:block_move(x, y, e, act)
if act and e == game.player then if act and e == game.player then
Dialog:yesnoPopup(self.name, "Do you wish to teleport to the fortress?", function(ret) if ret then Dialog:yesnoPopup(self.name, "Do you wish to teleport to the fortress?", function(ret) if ret then
game.party:addMember(self, {temporary_level=1, control="full"}) if not game.zone.wilderness then
game.party:setPlayer(self, true) Dialog:simplePopup(self.name, "The teleport fizzles!")
game.level.map:remove(e.x, e.y, engine.Map.ACTOR) return
end
self:takeControl(e)
end end) end end)
end end
return false return false
......
...@@ -28,7 +28,7 @@ newChat{ id="welcome", ...@@ -28,7 +28,7 @@ newChat{ id="welcome",
#{italic}#"Rokzan krilt copru."#{normal}#]] or [[#WHITE#*#{italic}#"Insert control rod."#{normal}#]]), #{italic}#"Rokzan krilt copru."#{normal}#]] or [[#WHITE#*#{italic}#"Insert control rod."#{normal}#]]),
answers = { answers = {
{"[Examine the orb]", jump="examine", cond=has_rod}, {"[Examine the orb]", jump="examine", cond=has_rod},
-- {"[Fly the fortress]", action=function(npc, player) player:hasQuest("shertul-fortress"):fly() end}, {"[Fly the fortress -- #LIGHT_RED#FOR TESTING ONLY#LAST#]", action=function(npc, player) player:hasQuest("shertul-fortress"):fly() end, cond=function() return config.settings.cheat end},
{"[Begin the Lichform ceremory]", cond=function(npc, player) local q = player:hasQuest("lichform") return q and q:check_lichform(player) end, action=function(npc, player) player:setQuestStatus("lichform", engine.Quest.COMPLETED) end}, {"[Begin the Lichform ceremory]", cond=function(npc, player) local q = player:hasQuest("lichform") return q and q:check_lichform(player) end, action=function(npc, player) player:setQuestStatus("lichform", engine.Quest.COMPLETED) end},
{"[Leave the orb alone]"}, {"[Leave the orb alone]"},
} }
......
...@@ -177,15 +177,33 @@ upgrade_transmo_gems = function(self) ...@@ -177,15 +177,33 @@ upgrade_transmo_gems = function(self)
end end
fly = function(self) fly = function(self)
game.player:learnLore("shertul-fortress-takeoff") if self:isStatus(self.COMPLETED, "flying") then
game:changeLevel(1, "wilderness", {direct_switch=true})
local f = require("mod.class.FortressPC").new{}
game:changeLevel(1, "wilderness", {direct_switch=true}) local f = nil
game.party:addMember(f, {temporary_level=1, control="full"}) for uid, e in pairs(game.level.entities) do
f.x = game.player.x if e.is_fortress then f = e break end
f.y = game.player.y end
game.party:setPlayer(f, true)
game.level:addEntity(f) if not f then
game.level.map:remove(f.x, f.y, engine.Map.ACTOR) game.log("The fortress is not found!")
f:move(f.x, f.y, true) return
end
f:takeControl(game.player)
else
game.player:learnLore("shertul-fortress-takeoff")
local f = require("mod.class.FortressPC").new{}
game:changeLevel(1, "wilderness", {direct_switch=true})
game.party:addMember(f, {temporary_level=1, control="full"})
f.x = game.player.x
f.y = game.player.y
game.party:setPlayer(f, true)
game.level:addEntity(f)
game.level.map:remove(f.x, f.y, engine.Map.ACTOR)
f:move(f.x, f.y, true)
game.player:setQuestStatus("shertul-fortress", self.COMPLETED, "flying")
end
end end
...@@ -314,6 +314,7 @@ newTalent{ ...@@ -314,6 +314,7 @@ newTalent{
no_npc_use = true, no_npc_use = true,
no_unlearn_last = true, no_unlearn_last = true,
action = function(self, t) action = function(self, t)
if game.level.map:checkAllEntities(self.x, self.y, "block_move") then game.log("You can not teleport there.") return true end
game.party:removeMember(self, true) game.party:removeMember(self, true)
game.party:findSuitablePlayer() game.party:findSuitablePlayer()
game.player:move(self.x, self.y, true) game.player:move(self.x, self.y, true)
......
...@@ -97,7 +97,7 @@ elseif zone == "Far East" then ...@@ -97,7 +97,7 @@ elseif zone == "Far East" then
-- Spawn random encounters -- Spawn random encounters
local g = game.level.map(game.player.x, game.player.y, Map.TERRAIN) local g = game.level.map(game.player.x, game.player.y, Map.TERRAIN)
if g and g.can_encounter then if g and g.can_encounter and not game.player.no_worldmap_encounter then
local type = encounter_chance(game.player) local type = encounter_chance(game.player)
if type then if type then
game.level:setEntitiesList("fareast_encounters_rng", game.zone:computeRarities("fareast_encounters_rng", game.level:getEntitiesList("fareast_encounters"), game.level, nil)) game.level:setEntitiesList("fareast_encounters_rng", game.zone:computeRarities("fareast_encounters_rng", game.level:getEntitiesList("fareast_encounters"), game.level, nil))
......
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