Skip to content
Snippets Groups Projects
Commit 6cc72ed2 authored by DarkGod's avatar DarkGod
Browse files

Merge branch 'BrawlerFix' into 'master'

Brawler equipment fix

Currently applyRandomClass only copies specific things from the copy descriptor table in its apply_resolvers functions, making it impossible to set misc flags there.  Misc properties put there are copied to player characters and such so I'm assuming this is an oversight and made it copy the entire table.

Brawler NPCs like to equip weapons in their inventory since their hands are empty in onAddedToLevel, so this uses the above to add a no_npc_weapon_equip flag to the Brawler descriptors.

See merge request !440
parents 9ddf66d0 56da1b7a
No related branches found
No related tags found
1 merge request!440Brawler equipment fix
Pipeline #
......@@ -2000,6 +2000,8 @@ print(" power types: not_power_source =", table.concat(table.keys(b.not_power_
if instant then b:check("birth_create_alchemist_golem") end
elseif k == "soul" then
b.soul = util.bound(1 + math.ceil(data.level / 10), 1, 10) -- Does this need to scale?
else
b[k] = resolver -- Copy any misc attributes that we don't need to play with
end
end
for k, resolver in pairs(mclass.copy or {}) do apply_resolvers(k, resolver) end
......
......@@ -528,7 +528,9 @@ function _M:addedToLevel(level, x, y)
for i = #MainInven, 1, -1 do
o = MainInven[i]
local inven, worn = self:getInven(o:wornInven())
if inven and game.state:checkPowers(self, o, nil, "antimagic_only") then -- check antimagic restrictions
--print("[NPC:addedToLevel]", self.name, self.uid, "checking", o.name, "type", o.type)
if inven and game.state:checkPowers(self, o, nil, "antimagic_only") and not (o.type and o.type == "weapon" and self.no_npc_weapon_equip) then -- check restrictions
--print("[NPC:addedToLevel]", self.name, self.uid, "passed restriction check", o.name)
local ro, replace = inven and inven[1], false
o = self:removeObject(self.INVEN_INVEN, i)
if o then
......
......@@ -317,6 +317,7 @@ newBirthDescriptor{
[ActorTalents.T_UNARMED_MASTERY] = 1, -- early game is absolutely stupid without this
},
copy = {
no_npc_weapon_equip = true, -- avoids randbosses equipping weapons from their inventory
resolvers.equipbirth{ id=true,
{type="armor", subtype="hands", name="iron gauntlets", autoreq=true, ego_chance=-1000, ego_chance=-1000},
{type="armor", subtype="light", name="rough leather armour", autoreq=true, ego_chance=-1000, ego_chance=-1000},
......
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