Skip to content
Snippets Groups Projects
Commit 13a7b145 authored by dg's avatar dg
Browse files

When inside an exploratory farportal zone you can use the rod of recall to...

When inside an exploratory farportal zone you can use the rod of recall to force an emergency recall, doing so however has very high change of permanently breaking the exploratory farportal


git-svn-id: http://svn.net-core.org/repos/t-engine4@3859 51575b47-30f0-44d4-a5cc-537603b46e54
parent 2d1f5ff5
No related branches found
No related tags found
No related merge requests found
......@@ -104,8 +104,9 @@ There are however unwanted byproducts to this operation, the generation of a met
}
newChat{ id="farportal",
text = [[Long ago the Sher'tuls used farportals not only for transportation to know locations but also to explore new parts of the new world, or even other worlds.
text = [[Long ago the Sher'tuls used farportals not only for transportation to know locations but also to explore new parts of the world, or even other worlds.
This Fortress is equiped with an exploratory farportal, and now has enough energy to allow one teleportation. Each teleportation will take you to a random part of the universe and use 30 energy.
Beware that the return portal may not be nearby your arrival point, you will need to find it. You can use the rod of recall to try and force an emergency recall, but it has high chances of breaking the exploratory farportal forever.
You maye use the farportal, however beware I sense a strange presence in the farportal room.]],
answers = {
{"I will check it out, thanks.", action=function() q:spawn_farportal_guardian() end},
......
......@@ -314,12 +314,24 @@ You have heard of such items before. They are very useful to adventurers, allowi
max_power = 400, power_regen = 1,
use_power = { name = "recall the user to the worldmap", power = 400,
use = function(self, who)
if who:canBe("worldport") and not self:attr("never_move") then
who:setEffect(who.EFF_RECALL, 40, { where = self.shertul_fortress and "shertul-fortress" or nil })
game.logPlayer(who, "Space around you starts to dissolve...")
else
game.logPlayer(who, "The rod emits a strange noise, glows briefly and returns to normal.")
if not self:attr("never_move") then
if who:canBe("worldport") then
who:setEffect(who.EFF_RECALL, 40, { where = self.shertul_fortress and "shertul-fortress" or nil })
game.logPlayer(who, "Space around you starts to dissolve...")
return true
elseif game.zone.force_farportal_recall then
require("engine.ui.Dialog"):yesnoLongPopup("Force a recall", "The Fortress Shadow warned you that trying to force a recall without finding the portal back could break the exploratory farportal forever.", 500, function(ret)
if not ret then
who:setEffect(who.EFF_RECALL, 40, { where = self.shertul_fortress and "shertul-fortress" or nil, allow_override=true })
game.logPlayer(who, "Space around you starts to dissolve...")
if rng.percent(90) and who:hasQuest("shertul-fortress") then
who:hasQuest("shertul-fortress"):break_farportal()
end
end
end, "Cancel", "Recall")
end
end
game.logPlayer(who, "The rod emits a strange noise, glows briefly and returns to normal.")
return true
end
},
......
......@@ -39,7 +39,9 @@ desc = function(self, who)
end
end
if self:isCompleted("farportal") then
if self:isCompleted("farportal-done") then
if self:isCompleted("farportal-broken") then
desc[#desc+1] = "You have forced a recall while into an exploratory farportal zone, the farportal was rendered unusable in the process."
elseif self:isCompleted("farportal-done") then
desc[#desc+1] = "You have entered the exploratory farportal room and defeated the horror lurking there, you can now use the farportal."
else
desc[#desc+1] = "The fortress shadow has asked that you come back as soon as possible."
......@@ -63,6 +65,10 @@ on_grant = function(self, who)
self.explored = 0
end
break_farportal = function(self)
game.player:setQuestStatus(self.id, self.COMPLETED, "farportal-broken")
end
spawn_butler = function(self)
local spot = game.level:pickSpot{type="spawn", subtype="butler"}
local butler = game.zone:makeEntityByName(game.level, "actor", "BUTLER")
......
......@@ -2299,7 +2299,7 @@ newEffect{
activate = function(self, eff)
end,
deactivate = function(self, eff)
if self:canBe("worldport") and not self:attr("never_move") then
if eff.allow_override or (self:canBe("worldport") and not self:attr("never_move")) then
game:onTickEnd(function()
game.logPlayer(self, "You are yanked out of this place!")
game:changeLevel(1, eff.where or game.player.last_wilderness)
......@@ -2663,7 +2663,7 @@ newEffect{
parameters = { },
activate = function(self, eff)
eff.src = self
-- hate
if eff.hateGain and eff.hateGain > 0 then
eff.hateGainId = self:addTemporaryValue("hate_regen", eff.hateGain)
......@@ -2706,7 +2706,7 @@ newEffect{
eff.resistGainId = self:addTemporaryValue("resists", gainList)
eff.resistLossId = eff.target:addTemporaryValue("resists", lossList)
end
eff.target:setEffect(eff.target.EFF_FED_UPON, eff.dur, { src = eff.src, target = eff.target })
end,
deactivate = function(self, eff)
......@@ -2738,7 +2738,7 @@ newEffect{
updateFeed = function(self, eff)
local source = eff.src
local target = eff.target
if source.dead or target.dead or not game.level:hasEntity(source) or not game.level:hasEntity(target) or not source:hasLOS(target.x, target.y) then
source:removeEffect(source.EFF_FEED)
if eff.particles then
......@@ -2747,7 +2747,7 @@ newEffect{
end
return
end
-- update particles position
if not eff.particles or eff.particles.x ~= source.x or eff.particles.y ~= source.y or eff.particles.tx ~= target.x or eff.particles.ty ~= target.y then
if eff.particles then
......
......@@ -69,10 +69,12 @@ It should automatically create a portal back, but it might not be near your arri
local q = who:hasQuest("shertul-fortress")
if not q then Dialog:simplePopup("Exploratory Farportal", "The farportal seems to be inactive") return end
if not q:exploratory_energy(true) then Dialog:simplePopup("Exploratory Farportal", "The fortress does not have enough energy to power a trip through the portal.") return end
if q:isCompleted("farportal-broken") then Dialog:simplePopup("Exploratory Farportal", "The farportal is broken and will not be usable anymore.") return end
Dialog:yesnoPopup("Exploratory Farportal", "Do you want to travel in the farportal? You can not know where you will end up.", function(ret) if ret then
local zone, boss = game.state:createRandomZone()
zone.no_worldport = true
zone.force_farportal_recall = true
zone.generator.actor.abord_no_guardian = true
zone.make_back_portal = function(self)
local p = game:getPlayer(true)
......
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