Commit 2b637ad1981d6ebe35d4fcd7f63ceec1c121f59c

Authored by Chris Davidson
1 parent 1c0f05a5

Change Virulent Strike to prioritize the lowest duration diseases

... ... @@ -52,15 +52,24 @@ newTalent{
52 52 local speed2, hit2 = self:attackTargetWith(target, offweapon.combat, nil, self:getOffHandMult(offweapon.combat, t.getDamage(self, t)))
53 53 DamageType:projectingFor(self, nil)
54 54
  55 + local effs = target:effectsFilter(function(e) return e.subtype.disease end, 9999)
55 56 if hit1 then
56   - local effs = target:effectsFilter(function(e) return e.subtype.disease end, 1)
  57 + if #effs > 0 then table.sort(effs, function(a, b)
  58 + local eff = target:hasEffect(a)
  59 + local eff2 = target:hasEffect(b)
  60 + return eff.dur < eff2.dur end)
  61 + end
57 62 local eff2 = target:hasEffect(effs[1])
58 63 if eff2 then
59 64 eff2.dur = eff2.dur + t.getIncrease(self, t)
60 65 end
61 66 end
62 67 if hit2 then
63   - local effs = target:effectsFilter(function(e) return e.subtype.disease end, 1)
  68 + if #effs > 0 then table.sort(effs, function(a, b)
  69 + local eff = target:hasEffect(a)
  70 + local eff2 = target:hasEffect(b)
  71 + return eff.dur < eff2.dur end)
  72 + end
64 73 local eff2 = target:hasEffect(effs[1])
65 74 if eff2 then
66 75 eff2.dur = eff2.dur + t.getIncrease(self, t)
... ... @@ -70,7 +79,7 @@ newTalent{
70 79 return true
71 80 end,
72 81 info = function(self, t)
73   - return ([[Strike the target with both weapons dealing %d%% damage with each hit. Each strike that hits will increase the duration of a random disease effect by %d.]]):
  82 + return ([[Strike the target with both weapons dealing %d%% damage with each hit. Each strike that hits will increase the duration of the lowest duration disease effect by %d.]]):
74 83 format(100 * t.getDamage(self, t), t.getIncrease(self, t))
75 84 end,
76 85 }
... ...