Commit 4c7ab713b3eae674b61b8e815c0176b3b73fa811

Authored by Chris Davidson
1 parent 01df68a6

Redesign Bloodlust

The old version was messy and had a lot of little numbers for no real reason.  This one is cleaner and reinforces Reaver as a melee class.

- Stacks up to 10 times

- Now only stacks on melee attacks with no turn limit.  So Bone Grab+2 melee spells fully stacks it.

- No longer decays slowly

- Duration set to 3
... ... @@ -2614,11 +2614,6 @@ function _M:onTakeHit(value, src, death_note)
2614 2614 end
2615 2615 end
2616 2616
2617   - -- Bloodlust!
2618   - if value > 0 and src and not (src == self) and src.knowTalent and src:knowTalent(src.T_BLOODLUST) then
2619   - src:setEffect(src.EFF_BLOODLUST, 1, {})
2620   - end
2621   -
2622 2617 if value > 0 and self:knowTalent(self.T_RAMPAGE) then
2623 2618 local t = self:getTalentFromId(self.T_RAMPAGE)
2624 2619 t:onTakeHit(self, value / self.max_life)
... ...
... ... @@ -1764,7 +1764,7 @@ function _M:combatSpellpower(mod, add)
1764 1764 add = add + self:callTalent(self.T_SHADOW_CUNNING,"getSpellpower") * self:getCun() / 100
1765 1765 end
1766 1766 if self:hasEffect(self.EFF_BLOODLUST) then
1767   - add = add + self:hasEffect(self.EFF_BLOODLUST).power
  1767 + add = add + self:hasEffect(self.EFF_BLOODLUST).spellpower * self:hasEffect(self.EFF_BLOODLUST).stacks
1768 1768 end
1769 1769
1770 1770 local am = 1
... ...
... ... @@ -42,24 +42,24 @@ newTalent{
42 42 end,
43 43 }
44 44
45   --- Fix display
46 45 newTalent{
47 46 name = "Bloodlust",
48 47 type = {"corruption/reaving-combat", 2},
49 48 mode = "passive",
50 49 require = str_corrs_req2,
51 50 points = 5,
52   - -- _M:combatSpellpower references effect in mod\class\interface\Combat.lua
53   - -- Effect is refreshed in function _M:onTakeHit(value, src) in mod\class\Actor.lua
54   - -- getParams called in definition of EFF_BLOODLUST in data\timed_effects\magical.lua
55   - getParams = function(self, t) -- returns maxSP per turn, max duration
56   - return self:combatTalentScale(t, 1, 8, 0.75), math.floor(self:combatTalentScale(t, 2, 6))
  51 + getSpellpower = function(self, t) return self:combatTalentScale(t, 1, 5.5) end, -- 66 at TL5 total
  52 + callbackOnMeleeAttack = function(self, t, target, hitted)
  53 + if not hitted or not (self:reactionToward(target) < 0) then return end
  54 + self:setEffect(self.EFF_BLOODLUST, 3, {spellpower = t.getSpellpower(self, t), max_stacks = 10})
  55 + return true
57 56 end,
58 57 info = function(self, t)
59   - local SPbonus, maxDur = t.getParams(self, t)
60   - return ([[Each time you deal damage to one of your foes, you enter a bloodlust-infused frenzy, increasing your Spellpower by 1 (maximum %d Spellpower per turn, %d Spellpower overall), and extending any current frenzy for an additional turn.
61   - The frenzy lasts up to %d turns, and the bonus decreases by %0.1f%% of its current value each turn you don't deal damage.]]):
62   - format(SPbonus / 5, SPbonus*8, maxDur, 100/maxDur)
  58 + local SPbonus = t.getSpellpower(self, t)
  59 + return ([[Each time you hit an enemy with a melee weapon you enter a bloodlust-infused frenzy, increasing your Spellpower by %0.1f.
  60 + This effect stacks up to 10 times for a total Spellpower gain of %d.
  61 + The frenzy lasts 3 turns.]]):
  62 + format(SPbonus, SPbonus*10)
63 63 end,
64 64 }
65 65
... ...
... ... @@ -1003,47 +1003,21 @@ newEffect{
1003 1003 newEffect{
1004 1004 name = "BLOODLUST", image = "talents/bloodlust.png",
1005 1005 desc = "Bloodlust",
1006   - long_desc = function(self, eff) return ("The target is in a magical frenzy, improving spellpower by %d."):format(eff.power) end,
  1006 + long_desc = function(self, eff) return ("The target is in a magical frenzy, improving spellpower by %d."):format(eff.spellpower * eff.stacks) end,
1007 1007 type = "magical",
1008 1008 subtype = { frenzy=true },
1009 1009 status = "beneficial",
1010   - charges = function(self, eff) return math.floor(eff.power) end,
1011   - parameters = { power=1 },
1012   - on_timeout = function(self, eff)
1013   - if eff.refresh_turn + 10 < game.turn then -- Decay only if it's not refreshed
1014   - eff.power = math.max(0, eff.power*(100-eff.decay)/100)
1015   - end
1016   - end,
  1010 + charges = function(self, eff) return math.floor(eff.spellpower * eff.stacks) end,
  1011 + parameters = { spellpower=1, stacks=1, max_stacks=1 },
1017 1012 on_merge = function(self, old_eff, new_eff)
1018   - local dur = new_eff.dur
1019   - local max_turn, maxDur = self:callTalent(self.T_BLOODLUST, "getParams")
1020   - local maxSP = max_turn * 6 -- max total sp
1021   - local power = new_eff.power
1022   -
1023   - if old_eff.last_turn + 10 <= game.turn then -- clear limits every game turn (10 ticks)
1024   - old_eff.used_this_turn = 0
1025   - old_eff.last_turn = game.turn
1026   - end
1027   - if old_eff.used_this_turn >= max_turn then
1028   - dur = 0
1029   - power = 0
1030   - else
1031   - power = math.min(max_turn-old_eff.used_this_turn, power)
1032   - old_eff.power = math.min(old_eff.power + power, maxSP)
1033   - old_eff.used_this_turn = old_eff.used_this_turn + power
1034   - end
1035   -
1036   - old_eff.decay = 100/maxDur
1037   - old_eff.dur = math.min(old_eff.dur + dur, maxDur)
1038   - old_eff.refresh_turn = game.turn
  1013 + old_eff.dur = new_eff.dur
  1014 + old_eff.stacks = old_eff.stacks + 1
  1015 + old_eff.max_stacks = new_eff.max_stacks
  1016 + old_eff.stacks = math.min(old_eff.max_stacks, old_eff.stacks)
1039 1017 return old_eff
1040 1018 end,
1041 1019 activate = function(self, eff)
1042   - eff.last_turn = game.turn
1043   - local SPbonus, maxDur = self:callTalent(self.T_BLOODLUST, "getParams")
1044   - eff.used_this_turn = eff.power
1045   - eff.decay = 100/maxDur
1046   - eff.refresh_turn = game.turn
  1020 + eff.stacks = 1
1047 1021 end,
1048 1022 deactivate = function(self, eff)
1049 1023 end,
... ...