Commit 4ca7001f87b9c221bdce3f93cd0e31591438603c
1 parent
e109d771
Added "callbackOnDealDamage" trigger
Showing
3 changed files
with
8 additions
and
2 deletions
... | ... | @@ -2249,7 +2249,7 @@ function _M:onTakeHit(value, src, death_note) |
2249 | 2249 | if self:fireTalentCheck("callbackOnHit", cb, src, death_note) then |
2250 | 2250 | value = cb.value |
2251 | 2251 | end |
2252 | - | |
2252 | + | |
2253 | 2253 | local hd = {"Actor:takeHit", value=value, src=src, death_note=death_note} |
2254 | 2254 | if self:triggerHook(hd) then value = hd.value end |
2255 | 2255 | |
... | ... | @@ -2289,8 +2289,11 @@ function _M:takeHit(value, src, death_note) |
2289 | 2289 | end |
2290 | 2290 | end |
2291 | 2291 | |
2292 | + | |
2292 | 2293 | local dead, val = mod.class.interface.ActorLife.takeHit(self, value, src, death_note) |
2293 | 2294 | |
2295 | + if src.fireTalentCheck then src:fireTalentCheck("callbackOnDealDamage", val, self, dead, death_note) end | |
2296 | + | |
2294 | 2297 | if dead and src and src.attr and src:attr("overkill") and src.project and not src.turn_procs.overkill then |
2295 | 2298 | src.turn_procs.overkill = true |
2296 | 2299 | local dam = (self.die_at - self.life) * src:attr("overkill") / 100 |
... | ... | @@ -4072,6 +4075,7 @@ function _M:preUseTalent(ab, silent, fake) |
4072 | 4075 | end |
4073 | 4076 | |
4074 | 4077 | local sustainCallbackCheck = { |
4078 | + callbackOnDealDamage = "talents_on_deal_damage", | |
4075 | 4079 | callbackOnHit = "talents_on_hit", |
4076 | 4080 | callbackOnAct = "talents_on_act", |
4077 | 4081 | callbackOnActBase = "talents_on_act_base", | ... | ... |
... | ... | @@ -235,6 +235,7 @@ end |
235 | 235 | --- Determines the combat field to use for this item |
236 | 236 | function _M:getObjectCombat(o, kind) |
237 | 237 | if kind == "barehand" then return self.combat end |
238 | + if not o then return nil end | |
238 | 239 | if kind == "mainhand" then return o.combat end |
239 | 240 | if kind == "offhand" then return o.combat end |
240 | 241 | return nil | ... | ... |
... | ... | @@ -658,12 +658,13 @@ local racials = { |
658 | 658 | T_RETCH = {last=30, base=0, every=4, max=5}, |
659 | 659 | }, |
660 | 660 | } |
661 | +resolvers.racials_defs = racials | |
661 | 662 | |
662 | 663 | function resolvers.racial(race) |
663 | 664 | return {__resolver="racial", race} |
664 | 665 | end |
665 | 666 | function resolvers.calc.racial(t, e) |
666 | - if e.type ~= "humanoid" and e.type ~= "undead" then return end | |
667 | + if e.type ~= "humanoid" and e.type ~= "giant" and e.type ~= "undead" then return end | |
667 | 668 | local race = t[1] or e.subtype |
668 | 669 | if not racials[race] then return end |
669 | 670 | ... | ... |
-
Please register or login to post a comment