Skip to content
Snippets Groups Projects
Commit 3be69150 authored by dg's avatar dg
Browse files

Added new world artifacts

git-svn-id: http://svn.net-core.org/repos/t-engine4@1184 51575b47-30f0-44d4-a5cc-537603b46e54
parent fed12b6d
No related branches found
No related tags found
No related merge requests found
......@@ -59,7 +59,7 @@ end
function _M:initBody()
if self.body then
for inven, max in pairs(self.body) do
self.inven[self["INVEN_"..inven]] = {max=max, worn=self.inven_def[self["INVEN_"..inven]].is_worn}
self.inven[self["INVEN_"..inven]] = {max=max, worn=self.inven_def[self["INVEN_"..inven]].is_worn, id=self["INVEN_"..inven]}
end
self.body = nil
end
......@@ -426,3 +426,21 @@ function _M:findInAllInventories(name, getname)
if o and item then return o, item, inven_id end
end
end
--- Applies fct over all items
-- @param inven the inventory to look into
-- @param fct the function to be called. It will receive three parameters: inven, item, object
function _M:inventoryApply(inven, fct)
for item, o in ipairs(inven) do
fct(inven, item, o)
end
end
--- Applies fct over all items in all inventories
-- @param inven the inventory to look into
-- @param fct the function to be called. It will receive three parameters: inven, item, object
function _M:inventoryApplyAll(fct)
for inven_id, inven in pairs(self.inven) do
self:inventoryApply(inven, fct)
end
end
......@@ -90,6 +90,22 @@ newEntity{ base = "BASE_RING",
},
}
newEntity{ base = "BASE_RING",
unique = true,
name = "Ring of Mandos", color = colors.DARK_GREY,
unided_name = "dull black ring",
desc = [[This dull black ring is completely featureless.]],
level_range = {35, 42},
rarity = 250,
cost = 500,
material_level = 4,
wielder = {
inc_stats = { [Stats.STAT_LCK] = 10, },
},
one_shot_life_saving = true,
}
newEntity{ base = "BASE_RING",
unique = true,
name = "Elemental Fury", color = colors.PURPLE,
......
......@@ -138,6 +138,14 @@ function _M:use()
self.actor:attr("re-assembled", 1)
game.logPlayer(self.actor, "#YELLOW#Your bones magically come back together. You are once more able to dish out pain to your foes!")
self:cleanActor()
self:restoreRessources()
self:resurrectBasic()
elseif act:find("^consume") then
local inven, item, o = self.list[self.sel].inven, self.list[self.sel].item, self.list[self.sel].object
self.actor:removeObject(inven, item)
game.logPlayer(self.actor, "#YELLOW#Your %s consumes and disappears! You come back to life!", o:getName{do_colour=true})
self:cleanActor()
self:restoreRessources()
self:resurrectBasic()
......@@ -151,6 +159,14 @@ function _M:generateList()
if self.actor:attr("blood_life") and not self.actor:attr("undead") then list[#list+1] = {name="Resurrect with the Blood of Life", action="blood_life"} end
if self.actor:getTalentLevelRaw(self.actor.T_SKELETON_REASSEMBLE) >= 5 and not self.actor:attr("re-assembled") then list[#list+1] = {name="Re-assemble your bones and resurrect (Skeleton ability)", action="skeleton"} end
local consumenb = 1
self.actor:inventoryApplyAll(function(inven, item, o)
if o.one_shot_life_saving and (not o.slot or inven.worn) then
list[#list+1] = {name="Resurrect by consuming "..o:getName{do_colour=true}, action="consume"..consumenb, inven=inven, item=item, object=o}
consumenb = consumenb + 1
end
end)
list[#list+1] = {name="Character dump", action="dump"}
list[#list+1] = {name="Exit to main menu", action="exit"}
......
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