Skip to content
Snippets Groups Projects
Commit 261965c7 authored by Alex Ksandra's avatar Alex Ksandra
Browse files

Some small fixes.

parent 2483e1f0
No related branches found
No related tags found
No related merge requests found
......@@ -501,10 +501,10 @@ function _M:applyEgo(e, ego, type, no_name_change)
end
e.ego_list = e.ego_list or {}
e.ego_list[#e.ego_list + 1] = {orig_ego, type, no_name_change}
e:resolve()
end
local function reapplyEgos(e)
-- WARNING the thing may be in need of re-identifying after this
local function reapplyEgos(self, e)
if not e.__original then return e end
local brandNew = e.__original -- it will be cloned upon first ego application
if e.ego_list and #e.ego_list > 0 then
......@@ -512,7 +512,6 @@ local function reapplyEgos(e)
self:applyEgo(brandNew, unpack(ego_args))
end
end
brandNew:resolve(nil, true)
e:replaceWith(brandNew)
end
......@@ -526,7 +525,7 @@ function _M:removeEgo(e, ego)
end
if not idx then return end
table.remove(e.ego_list, idx)
reapplyEgos(e)
reapplyEgos(self, e)
return ego
end
......@@ -542,6 +541,12 @@ function _M:removeEgoByName(e, ego_name)
end
end
function _M:setEntityEgoList(e, list)
e.ego_list = table.clone(list)
reapplyEgos(self, e)
return e
end
--- Finishes generating an entity
function _M:finishEntity(level, type, e, ego_filter)
e = e:clone()
......
......@@ -597,7 +597,6 @@ function _M:generateRandart(data)
end
-- Re-resolve with the (possibly) new resolvers
o:resolve()
o:resolve(nil, true)
-----------------------------------------------------------
-- Imbue random powers into the randart according to themes
......@@ -674,7 +673,8 @@ function _M:generateRandart(data)
game.zone:applyEgo(o, ego, "object", true)
end
o:resolve() o:resolve(nil, true)
o:resolve()
o:resolve(nil, true)
-- Always assign at least one power source based on themes and restrictions
if not o.power_source then
......
......@@ -85,7 +85,6 @@ newTalent{
local def = self.tempeffect_def[curse]
local ego = Entity.new{
name = "curse",
special = true,
display_string = " ("..def.short_desc..")",
curse = curse,
fake_ego = true, unvault_ego = true,
......
......@@ -133,7 +133,7 @@ newTalent{
local new_ego = Entity.new{
name = "reshape weapon",
display_string = "reshaped("..tostring(atk_boost)..","..tostring(dam_boost)..") ", display_prefix = true,
special = true,
been_reshaped = true,
combat = {atk=atk_boost, dam=dam_boost},
old_atk = atk_boost, old_dam = dam_boost, orig_atk = o.combat.atk, orig_dam = o.combat.dam, -- Easier this way
fake_ego = true, unvault_ego = true,
......@@ -174,7 +174,6 @@ newTalent{
name = "reshape armour",
display_string = "reshaped["..tostring(armour)..","..tostring(real_fat).."%] ", display_prefix = true,
been_reshaped = true,
special = true,
wielder = {combat_armour=arm, fatigue=-real_fat},
fatigue_reduction = fat,
old_fat = fat, orig_fat = o.wielder.fatigue, orig_arm = o.wielder.armour, -- Easier this way
......
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