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

Random bosses can now use the unlockable trees (poisons, wildfire, ...)

git-svn-id: http://svn.net-core.org/repos/t-engine4@4142 51575b47-30f0-44d4-a5cc-537603b46e54
parent 9fa6129a
No related branches found
No related tags found
No related merge requests found
......@@ -363,6 +363,7 @@ function _M:apply()
self.actor.body = d.body
self.actor:initBody()
end
if self.applyingDescriptor then self:applyingDescriptor(i, d) end
end
-- Apply stats now to not be overridden by other things
......
......@@ -1376,6 +1376,7 @@ function _M:createRandomBoss(base, data)
-- Add talent categories
for tt, d in pairs(class.talents_types or {}) do b:learnTalentType(tt, true) b:setTalentTypeMastery(tt, (b:getTalentTypeMastery(tt) or 1) + d[2]) end
for tt, d in pairs(class.unlockable_talents_types or {}) do b:learnTalentType(tt, true) b:setTalentTypeMastery(tt, (b:getTalentTypeMastery(tt) or 1) + d[2]) end
-- Add starting equipment
for k, resolver in pairs(class.copy or {}) do
......
......@@ -70,6 +70,12 @@ newBirthDescriptor{
["spell/aegis"]={true, 0.3},
["cunning/survival"]={false, -0.1},
},
unlockable_talents_types = {
["spell/wildfire"]={false, 0.3, "mage_pyromancer"},
["spell/ice"]={false, 0.3, "mage_cryomancer"},
["spell/stone"]={false, 0.3, "mage_geomancer"},
["spell/storm"]={false, 0.3, "mage_tempest"},
},
birth_example_particles = "arcane_power",
talents = {
[ActorTalents.T_ARCANE_POWER] = 1,
......@@ -97,12 +103,6 @@ newBirthDescriptor{
{type="weapon", subtype="staff", name="elm staff", autoreq=true, ego_chance=-1000},
{type="armor", subtype="cloth", name="linen robe", autoreq=true, ego_chance=-1000},
},
resolvers.generic(function(self)
if profile.mod.allow_build.mage_pyromancer then self:learnTalentType("spell/wildfire", false) self:setTalentTypeMastery("spell/wildfire", 1.3) end
if profile.mod.allow_build.mage_cryomancer then self:learnTalentType("spell/ice", false) self:setTalentTypeMastery("spell/ice", 1.3) end
if profile.mod.allow_build.mage_geomancer then self:learnTalentType("spell/stone", false) self:setTalentTypeMastery("spell/stone", 1.3) end
if profile.mod.allow_build.mage_tempest then self:learnTalentType("spell/storm", false) self:setTalentTypeMastery("spell/storm", 1.3) end
end),
},
copy_add = {
life_rating = -4,
......
......@@ -67,17 +67,15 @@ newBirthDescriptor{
["cunning/lethality"]={true, 0.3},
["cunning/survival"]={true, 0.3},
},
unlockable_talents_types = {
["cunning/poisons"]={false, 0.3, "rogue_poisons"},
},
talents = {
[ActorTalents.T_STEALTH] = 1,
[ActorTalents.T_TRAP_MASTERY] = 1,
[ActorTalents.T_LETHALITY] = 1,
[ActorTalents.T_DUAL_STRIKE] = 1,
},
copy = {
resolvers.generic(function(self)
if profile.mod.allow_build.rogue_poisons then self:learnTalentType("cunning/poisons", false) self:setTalentTypeMastery("cunning/poisons", 1.3) end
end),
},
}
newBirthDescriptor{
......
......@@ -174,6 +174,23 @@ function _M:checkNew(fct)
end
end
function _M:applyingDescriptor(i, d)
if d.unlockable_talents_types then
for t, v in pairs(d.unlockable_talents_types) do
if profile.mod.allow_build[v[3]] then
local mastery
if type(v) == "table" then
v, mastery = v[1], v[2]
else
v, mastery = v, 0
end
self.actor:learnTalentType(t, v)
self.actor.talents_types_mastery[t] = (self.actor.talents_types_mastery[t] or 1) + mastery
end
end
end
end
function _M:atEnd(v)
if v == "created" and not self.ui_by_ui[self.c_ok].hidden then
self:checkNew(function()
......
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