Skip to content
Snippets Groups Projects
Commit 4bd8223e authored by dg's avatar dg
Browse files

Once the transmogrification chest has been found once, all new characters will...

Once the transmogrification chest has been found once, all new characters will start with it from birth


git-svn-id: http://svn.net-core.org/repos/t-engine4@4686 51575b47-30f0-44d4-a5cc-537603b46e54
parent 3e4b38b0
No related branches found
No related tags found
No related merge requests found
......@@ -250,6 +250,14 @@ function _M:newGame()
self.state = GameState.new{}
local birth_done = function()
if self.player.__allow_rod_recall then game.state:allowRodRecall(true) self.player.__allow_rod_recall = nil end
if self.player.__allow_transmo_chest and profile.mod.allow_build.transmo_chest then
self.player.__allow_transmo_chest = nil
local chest = game.zone:makeEntityByName(game.level, "object", "TRANSMO_CHEST")
if chest then
game.zone:addEntity(game.level, chest, "object")
self.player:addObject(self.player:getInven("INVEN"), chest)
end
end
for i = 1, 50 do
local o = self.state:generateRandart(true)
......
......@@ -130,6 +130,7 @@ newBirthDescriptor{
easy_mode_lifes = 99999,
__game_difficulty = 1,
__allow_rod_recall = false,
__allow_transmo_chest = false,
},
}
newBirthDescriptor{
......
......@@ -75,6 +75,7 @@ newBirthDescriptor{
descriptor_choices = default_eyal_descriptors{},
copy = {
__allow_rod_recall = true,
__allow_transmo_chest = true,
}
}
......@@ -94,6 +95,8 @@ newBirthDescriptor{
},
descriptor_choices = default_eyal_descriptors{ difficulty = { Tutorial = "never"} },
copy = {
__allow_transmo_chest = true,
-- Can levelup forever
resolvers.generic(function(e) e.max_level = nil end),
no_points_on_levelup = function(self)
......
......@@ -99,7 +99,16 @@ However, the Fortess is badly damaged and has lain dormant for too long. Its ene
Take this Transmogrification Chest. It is linked by a permanent farportal to the Fortress. Any item you put inside will be sent to the power core and dismantled for energy.
There are, however, unwanted byproducts to this operation: the generation of a metal known as gold. It is of no use to the Fortress and thus will be sent back to you.]],
answers = {
{"I will, thanks.", jump="welcome", action=function() q:spawn_transmo_chest() end},
{"I will, thanks.", jump="welcome", action=function() q:spawn_transmo_chest() end, cond=function(npc, player) return not player:attr("has_transmo") end},
{"I have already found such a chest in my travel, will it work?", jump="alreadychest", cond=function(npc, player) return player:attr("has_transmo") end},
}
}
newChat{ id="alreadychest",
text = [[Yes it will, I will attune it to this fortress.
Done.]],
answers = {
{"Thanks.", jump="welcome"},
}
}
......
......@@ -348,3 +348,62 @@ You have heard of such items before. They are very useful to adventurers, allowi
end
end,
}
newEntity{ base = "BASE_WAND",
power_source = {unknown=true, arcane=false},
type = "chest", subtype = "sher'tul",
define_as = "TRANSMO_CHEST",
add_name = false,
identified=true, force_lore_artifact=true,
name = "Transmogrification Chest", display = '~', color=colors.GOLD, unique=true, image = "object/chest4.png",
desc = [[This chest is an extension of Yiilkgur, any items dropped inside is transported to the Fortress, processed by the core and destroyed to extract energy.
The byproduct of this effect is the creation of gold, which is useless to the Fortress, so it is sent back to you.
When you possess the chest all items you walk upon will automatically be put inside and transmogrified when you leave the level.
Simply go to your inventory to move them out of the chest if you wish to keep them.
Items in the chest will not encumber you.]],
cost = 0, quest=true,
carrier = {
has_transmo = 1,
},
max_power = 1000, power_regen = 1,
use_power = { name = "transmogrify all the items in your chest at once(also done automatically when you change level)", power = 0,
use = function(self, who)
local inven = who:getInven("INVEN")
local nb = 0
for i = #inven, 1, -1 do
local o = inven[i]
if o.__transmo then nb = nb + 1 end
end
if nb <= 0 then require("engine.ui.Dialog"):simplePopup("Transmogrification Chest", "You do not have any items to transmogrify in your chest.") return {id=true, used=true} end
require("engine.ui.Dialog"):yesnoPopup("Transmogrification Chest", "Transmogrify all "..nb.." item(s) in your chest?", function(ret)
if not ret then return end
for i = #inven, 1, -1 do
local o = inven[i]
if o.__transmo then
who:transmoInven(inven, i, o)
end
end
end)
return {id=true, used=true}
end
},
on_pickup = function(self, who)
require("engine.ui.Dialog"):simpleLongPopup("Transmogrification Chest", [[This chest is an extension of Yiilkgur, any items dropped inside is transported to the Fortress, processed by the core and destroyed to extract energy.
The byproduct of this effect is the creation of gold, which is useless to the Fortress, so it is sent back to you.
When you possess the chest all items you walk upon will automatically be put inside and transmogrified when you leave the level.
To take an item out, simply go to your inventory to move them out of the chest.
Items in the chest will not encumber you.]], 500)
end,
on_drop = function(self, who)
if who == game.player then
game.logPlayer(who, "You cannot bring yourself to drop the %s", self:getName())
return true
end
end,
}
......@@ -86,6 +86,8 @@ spawn_transmo_chest = function(self, energy)
game.zone:addEntity(game.level, chest, "object", spot.x + 1, spot.y)
game.level.map:particleEmitter(spot.x, spot.y, 1, "demon_teleport")
game.player:setQuestStatus(self.id, self.COMPLETED, "transmo-chest")
game:setAllowedBuild("transmo_chest", true)
end
gain_energy = function(self, energy)
......
-- ToME - Tales of Maj'Eyal
-- Copyright (C) 2009, 2010, 2011 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
return "New birth equipment: #LIGHT_GREEN#Transmogrification Chest",
[[You have discovered an old Fortress belonging to the mysterious Sher'tul race.
The fortress shadow gave you a transmogrification chest which shall make your dealing with storage and gold much easier.
All your new characters will now start with a transmogrification chest at birth. All items transmogrified before you find the Fortress with them will only yield gold.
]]
......@@ -19,65 +19,6 @@
load("/data/general/objects/objects-maj-eyal.lua")
newEntity{ base = "BASE_WAND",
power_source = {unknown=true, arcane=false},
type = "chest", subtype = "sher'tul",
define_as = "TRANSMO_CHEST",
add_name = false,
identified=true, force_lore_artifact=true,
name = "Transmogrification Chest", display = '~', color=colors.GOLD, unique=true, image = "object/chest4.png",
desc = [[This chest is an extension of Yiilkgur, any items dropped inside is transported to the Fortress, processed by the core and destroyed to extract energy.
The byproduct of this effect is the creation of gold, which is useless to the Fortress, so it is sent back to you.
When you possess the chest all items you walk upon will automatically be put inside and transmogrified when you leave the level.
Simply go to your inventory to move them out of the chest if you wish to keep them.
Items in the chest will not encumber you.]],
cost = 0, quest=true,
carrier = {
has_transmo = 1,
},
max_power = 1000, power_regen = 1,
use_power = { name = "transmogrify all the items in your chest at once(also done automatically when you change level)", power = 0,
use = function(self, who)
local inven = who:getInven("INVEN")
local nb = 0
for i = #inven, 1, -1 do
local o = inven[i]
if o.__transmo then nb = nb + 1 end
end
if nb <= 0 then require("engine.ui.Dialog"):simplePopup("Transmogrification Chest", "You do not have any items to transmogrify in your chest.") return {id=true, used=true} end
require("engine.ui.Dialog"):yesnoPopup("Transmogrification Chest", "Transmogrify all "..nb.." item(s) in your chest?", function(ret)
if not ret then return end
for i = #inven, 1, -1 do
local o = inven[i]
if o.__transmo then
who:transmoInven(inven, i, o)
end
end
end)
return {id=true, used=true}
end
},
on_pickup = function(self, who)
require("engine.ui.Dialog"):simpleLongPopup("Transmogrification Chest", [[This chest is an extension of Yiilkgur, any items dropped inside is transported to the Fortress, processed by the core and destroyed to extract energy.
The byproduct of this effect is the creation of gold, which is useless to the Fortress, so it is sent back to you.
When you possess the chest all items you walk upon will automatically be put inside and transmogrified when you leave the level.
To take an item out, simply go to your inventory to move them out of the chest.
Items in the chest will not encumber you.]], 500)
end,
on_drop = function(self, who)
if who == game.player then
game.logPlayer(who, "You cannot bring yourself to drop the %s", self:getName())
return true
end
end,
}
newEntity{ base = "BASE_CLOTH_ARMOR",
define_as = "SIMPLE_GOWN",
name = "simple gown",
......
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