Commit 76b58d42728c31d90b73070d8fb5fc3582d5c016

Authored by Lisa Greene
1 parent 08f9c26c

Check for conflicts between power source and categories for mastery boosting

... ... @@ -100,12 +100,16 @@ newEntity{
100 100 rarity = 6,
101 101 cost = 2,
102 102 wielder = {},
103   - resolvers.generic(function(e)
  103 + resolvers.genericlast(function(e)
104 104 local tts = {}
105 105 local p = game:getPlayer(true)
106 106 for i, def in ipairs(engine.interface.ActorTalents.talents_types_def) do
107   - if p and def.allow_random and p:knowTalentType(def.type) or p:knowTalentType(def.type) == false then tts[#tts+1] = def.type end
108   - end
  107 + if p and def.allow_random and p:knowTalentType(def.type) or p:knowTalentType(def.type) == false then
  108 + if not (e.power_source.antimagic and def.is_spell) or (e.power_source.arcane and def.is_antimagic) then
  109 + tts[#tts+1] = def.type
  110 + end
  111 + end
  112 + end
109 113 local tt = tts[rng.range(1, #tts)]
110 114
111 115 e.wielder.talents_types_mastery = {}
... ... @@ -533,12 +537,16 @@ newEntity{
533 537 greater_ego = 1,
534 538 cost = 2,
535 539 wielder = {},
536   - resolvers.generic(function(e)
  540 + resolvers.genericlast(function(e)
537 541 local tts = {}
538 542 local p = game:getPlayer(true)
539 543 for i, def in ipairs(engine.interface.ActorTalents.talents_types_def) do
540   - if p and def.allow_random and p:knowTalentType(def.type) or p:knowTalentType(def.type) == false then tts[#tts+1] = def.type end
541   - end
  544 + if p and def.allow_random and p:knowTalentType(def.type) or p:knowTalentType(def.type) == false then
  545 + if not (e.power_source.antimagic and def.is_spell) or (e.power_source.arcane and def.is_antimagic) then
  546 + tts[#tts+1] = def.type
  547 + end
  548 + end
  549 + end
542 550 --local tt = tts[rng.range(1, #tts)]
543 551 local tt = rng.tableRemove(tts)
544 552 local tt2 = rng.tableRemove(tts)
... ...