Commit c13b3b03587fbcc8f8e1076639ca5bfa058c8df4

Authored by DarkGod
2 parents c5e611a5 c9e3e302

Merge branch 'fallen-bugfix' into 'master'

Fallen bugfix

Dirges update mastery correctly.
Prevent player from infinitely stacking Pestilence shield with enough action speed.
Prevent exploit where you could increase and decrease talent mastery at the same time you learned Fallen prodigy.

See merge request !721
... ... @@ -43,7 +43,8 @@ newTalentType{ no_silence=true, is_spell=true, type="celestial/other", name = _t
43 43 newTalentType{ allow_random=false, no_silence=true, is_spell=true, type="celestial/dirges", name = _t("Dirges", "talent type"), description = _t"The songs the Fallen sing." }
44 44 newTalentType{ allow_random=false, no_silence=true, is_spell=true, type="celestial/darkside", name = _t("Darkside", "talent type"), description = _t"Signature magics of the Fallen. The sun shines for the guilty and the innocent alike." }
45 45 newTalentType{ allow_random=false, no_silence=true, is_spell=true, type="celestial/dark-sun", name = _t("Dark Sun", "talent type"), description = _t"Celestial combat techniques inspired by the dark places that are not empty." }
46   -newTalentType{ allow_random=false, no_silence=true, is_spell=true, generic=true, type="celestial/dirge", name = _t("Dirges", "talent type"), description = _t"Sing of death and damnation." }
  46 +
  47 +newTalentType{ allow_random=false, no_silence=true, is_spell=true, generic=true, type="celestial/dirge", name = _t("Dirges", "talent type"), description = _t"Sing of death and damnation.", on_mastery_change = function(self, m, tt) self.talents_types_mastery["celestial/dirges"] = self.talents_types_mastery[tt] end }
47 48
48 49 -- Generic requires for celestial spells based on talent level
49 50 divi_req1 = {
... ...
... ... @@ -162,9 +162,9 @@ newTalent{
162 162 getShield = function(self, t) return self:combatTalentScale(t, 50, 200, 0.75) end,
163 163 getShieldCD = function(self, t) return 5 end,
164 164 callbackOnTemporaryEffectAdd = function(self, t, eff_id, e_def, eff)
165   - if not self:hasProc("dirge_shield") then
  165 + if not self:hasEffect(self.EFF_NO_PESTILENCE) then
166 166 if e_def.status == "detrimental" and e_def.type ~= "other" and eff.src ~= self then
167   - self:setProc("dirge_shield", true, t.getShieldCD(self, t))
  167 + self:setEffect(self.EFF_NO_PESTILENCE, t.getShieldCD(self, t), {src=self})
168 168 if self:hasEffect(self.EFF_DAMAGE_SHIELD) then
169 169 local shield = self:hasEffect(self.EFF_DAMAGE_SHIELD)
170 170 local shield_power = self:spellCrit(t.getShield(self, t))
... ... @@ -289,7 +289,7 @@ newTalent{
289 289 require = divi_req3,
290 290 points = 5,
291 291 mode = "passive",
292   - getDuration = function(self, t) return self:getTalentLevel(t) end,
  292 + getDuration = function(self, t) return math.floor(self:getTalentLevel(t)) end,
293 293 getImmune = function(self, t) return self:combatTalentLimit(t, 1, 0.15, 0.50) end,
294 294 info = function(self, t)
295 295 return ([[Your dirges echo mournfully through the air. When you end a dirge, you continue to gain its acolyte-level effects for %d turns. You can only benefit from one such lingering dirge at a time.
... ...
... ... @@ -158,7 +158,7 @@ newTalent{
158 158 require = cursed_wil_req4,
159 159 points = 5,
160 160 mode = "passive",
161   - getTime = function(self, t) return self:combatTalentScale(t, 3, 5) end,
  161 + getTime = function(self, t) return math.ceil(self:combatTalentScale(t, 3, 5)) end,
162 162 getThreshold = function(self, t) return self:combatTalentLimit(t, 10, 30, 15) end,
163 163 getSpillThreshold = function(self, t) return 40 end,
164 164 callbackOnTakeDamage = function(self, t, src, x, y, type, dam, state)
... ...
... ... @@ -348,10 +348,10 @@ uberTalent{
348 348 ["technique/2hweapon-assault"] = true,
349 349 ["technique/shield-offense"] = true,
350 350 }
351   - if self.__increased_talent_types["technique/2hweapon-assault"] then
  351 + if self.__increased_talent_types["technique/2hweapon-assault"] and self.__increased_talent_types["technique/2hweapon-assault"] > 0 then
352 352 self.unused_talents_types = self.unused_talents_types + 1
353 353 end
354   - if self.__increased_talent_types["technique/shield-offense"] then
  354 + if self.__increased_talent_types["technique/shield-offense"] and self.__increased_talent_types["technique/shield-offense"] > 0 then
355 355 self.unused_talents_types = self.unused_talents_types + 1
356 356 end
357 357 t.unlearnTalents(self, t, removes)
... ...
... ... @@ -5509,9 +5509,9 @@ newEffect{
5509 5509 status = "beneficial",
5510 5510 parameters = { shield=50, cd=5 },
5511 5511 callbackOnTemporaryEffectAdd = function(self, eff, eff_id, e_def, eff_incoming)
5512   - if not self:hasProc("dirge_shield") then
  5512 + if not self:hasEffect(self.EFF_NO_PESTILENCE) then
5513 5513 if e_def.status == "detrimental" and e_def.type ~= "other" and eff_incoming.src ~= self then
5514   - self:setProc("dirge_shield", true, eff.cd)
  5514 + self:setEffect(self.EFF_NO_PESTILENCE, eff.cd, {src=self})
5515 5515 if self:hasEffect(self.EFF_DAMAGE_SHIELD) then
5516 5516 local shield = self:hasEffect(self.EFF_DAMAGE_SHIELD)
5517 5517 local shield_power = self:spellCrit(eff.shield)
... ...
... ... @@ -4147,6 +4147,15 @@ newEffect{
4147 4147 deactivate = function(self, eff) end,
4148 4148 }
4149 4149
  4150 +newEffect{
  4151 + name = "NO_PESTILENCE", image = "talents/dirge_of_pestilence.png",
  4152 + desc = _t"Pestilence Saturation",
  4153 + long_desc = function(self, eff) return _t"The target recently benefited from Dirge of Pestilence" end,
  4154 + type = "other",
  4155 + subtype = { dirge=true },
  4156 + status = "neutral",
  4157 + parameters = { },
  4158 +}
4150 4159
4151 4160 newEffect{
4152 4161 name = "SELF_JUDGEMENT", image = "talents/self_judgement.png",
... ...