Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- straight from iron will talent, i just added the confusion code to match the stun code:
- passives = function(self, t, p)
- self:talentTemporaryValue(p, "confusion_immune", t.confusionImmune(self, t))
- self:talentTemporaryValue(p, "stun_immune", t.stunImmune(self, t))
- end,
- info = function(self, t)
- return ([[Dual-self mental sturdiness improves Mental Saves by %d, and confusion and stun immunity by %d%%.]]):
- format(self:getTalentLevelRaw(t)*6, t.confusionImmune(self, t)*100, t.stunImmune(self, t)*100)
- end,
- Result = nil value error:
- Lua Error: /data-Chrono_Xorn/talents/Chrono_Xorn.lua:533: attempt to call field 'confusionImmune' (a nil value)
- At [C]:-1 confusionImmune
- At /data-Chrono_Xorn/talents/Chrono_Xorn.lua:533 passives
- At /engine/interface/ActorTalents.lua:435 learnTalent
- At /mod/class/Actor.lua:4065 learnTalent
- At /engine/Birther.lua:369 apply
- At /mod/dialogs/Birther.lua:292 fct
- At /mod/dialogs/Birther.lua:191 checkNew
- At /mod/dialogs/Birther.lua:241 atEnd
- At /mod/dialogs/Birther.lua:63 fct
- At /engine/ui/Button.lua:62 fct
- At /engine/Mouse.lua:56 receiveMouse
- At /engine/Mouse.lua:94 delegate
- At /engine/ui/Dialog.lua:602 mouseEvent
- At /engine/ui/Dialog.lua:343 fct
- At /engine/Mouse.lua:56
- and this is the mental timed effects confusion code in the game:
- newEffect{
- name = "CONFUSED", image = "effects/confused.png",
- desc = "Confused",
- long_desc = function(self, eff) return ("The target is confused, acting randomly (chance %d%%) and unable to perform complex actions."):format(eff.power) end,
- type = "mental",
- subtype = { confusion=true },
- status = "detrimental",
- parameters = { power=50 },
- on_gain = function(self, err) return "#Target# wanders around!.", "+Confused" end,
- on_lose = function(self, err) return "#Target# seems more focused.", "-Confused" end,
- activate = function(self, eff)
- eff.power = math.floor(math.max(eff.power - (self:attr("confusion_immune") or 0) * 100, 10))
- eff.power = util.bound(eff.power, 0, 50)
- eff.tmpid = self:addTemporaryValue("confused", eff.power)
- if eff.power <= 0 then eff.dur = 0 end
- end,
- deactivate = function(self, eff)
- self:removeTemporaryValue("confused", eff.tmpid)
- if self == game.player and self.updateMainShader then self:updateMainShader() end
- end,
- }
- and my talent which is needed because having a zillion bloated horrors dropping confusion on me all at once became just bad:
- newTalent{
- short_name = "2_MIND",
- name = "2 Mountains Mind",
- --code adapted from iron will
- type = {"race/Chrono_Xorn", 1},
- image = "talents/overseer_of_nations.png",
- require = psi_wil_req3,
- points = 5,
- no_npc_use = true,
- no_unlearn_last = true,
- mode = "passive",
- stunImmune = function(self, t) return self:combatTalentLimit(t, 1, 0.17, 0.50) end,
- on_learn = function(self, t)
- self.combat_mentalresist = self.combat_mentalresist + 6
- end,
- on_unlearn = function(self, t)
- self.combat_mentalresist = self.combat_mentalresist - 6
- end,
- passives = function(self, t, p)
- self:talentTemporaryValue(p, "confusion_immune", t.confusionImmune(self, t))
- self:talentTemporaryValue(p, "stun_immune", t.stunImmune(self, t))
- end,
- info = function(self, t)
- return ([[Dual-self mental sturdiness improves Mental Saves by %d, and confusion and stun immunity by %d%%.]]):
- format(self:getTalentLevelRaw(t)*6, t.confusionImmune(self, t)*100, t.stunImmune(self, t)*100)
- end,
- }
- what is confusing it?
Advertisement
Add Comment
Please, Sign In to add comment