@@ -730,7 +730,7 @@ module.exports = { | |||||
return; | return; | ||||
this.getHp({ | this.getHp({ | ||||
event: { amount: lifeOnHit }, | |||||
heal: { amount: lifeOnHit }, | |||||
source: obj, | source: obj, | ||||
target: obj | target: obj | ||||
}); | }); | ||||
@@ -7,7 +7,7 @@ module.exports = { | |||||
afterDealDamage: function ({ damage, target }) { | afterDealDamage: function ({ damage, target }) { | ||||
damage.dealt *= 0.5; | damage.dealt *= 0.5; | ||||
this.obj.stats.getHp({ | this.obj.stats.getHp({ | ||||
event: damage, | |||||
heal: damage, | |||||
source: this.obj, | source: this.obj, | ||||
target: this.obj | target: this.obj | ||||
}); | }); | ||||
@@ -10,7 +10,7 @@ const doesEventMatch = (firedEvent, eventCondition) => { | |||||
if ( | if ( | ||||
!firedEvent || | !firedEvent || | ||||
( | ( | ||||
!eventCondition.targetNotSelf && | |||||
eventCondition.targetNotSelf === false && | |||||
firedEvent.target === firedEvent.source | firedEvent.target === firedEvent.source | ||||
) | ) | ||||
) | ) | ||||
@@ -90,6 +90,10 @@ module.exports = { | |||||
afterDealDamage: function (item, event) { | afterDealDamage: function (item, event) { | ||||
handler(this, item, event, 'afterDealDamage'); | handler(this, item, event, 'afterDealDamage'); | ||||
}, | |||||
afterPositionChange: function (item, event) { | |||||
handler(this, item, event, 'afterPositionChange'); | |||||
} | } | ||||
} | } | ||||
}; | }; |
@@ -18,8 +18,8 @@ module.exports = { | |||||
amount = (cpnStats.values.hpMax / 100) * ~~amount.replace('%', ''); | amount = (cpnStats.values.hpMax / 100) * ~~amount.replace('%', ''); | ||||
cpnStats.getHp({ | cpnStats.getHp({ | ||||
event: { | |||||
amount: amount, | |||||
heal: { | |||||
amount, | |||||
threatMult: 0 | threatMult: 0 | ||||
}, | }, | ||||
source: cpnStats.obj, | source: cpnStats.obj, | ||||
@@ -34,8 +34,8 @@ module.exports = { | |||||
let amount = rolls.amount || ((damage.dealt / 100) * rolls.percentage); | let amount = rolls.amount || ((damage.dealt / 100) * rolls.percentage); | ||||
this.stats.getHp({ | this.stats.getHp({ | ||||
event: { | |||||
amount: amount | |||||
heal: { | |||||
amount | |||||
}, | }, | ||||
source: this, | source: this, | ||||
target: this | target: this | ||||
@@ -38,9 +38,9 @@ let cpnArcanePatch = { | |||||
for (let i = 0; i < cLen; i++) { | for (let i = 0; i < cLen; i++) { | ||||
let c = contents[i]; | let c = contents[i]; | ||||
let amount = this.spell.getDamage(c, true); | |||||
let heal = this.spell.getDamage(c, true); | |||||
c.stats.getHp({ | c.stats.getHp({ | ||||
event: amount, | |||||
heal, | |||||
source: this.caster, | source: this.caster, | ||||
target: c | target: c | ||||
}); | }); | ||||
@@ -124,7 +124,10 @@ module.exports = { | |||||
const moveEvent = { | const moveEvent = { | ||||
newPos: targetPos, | newPos: targetPos, | ||||
source: this | |||||
source: this, | |||||
target: this, | |||||
spellName: 'charge', | |||||
spell: this | |||||
}; | }; | ||||
this.obj.fireEvent('afterPositionChange', moveEvent); | this.obj.fireEvent('afterPositionChange', moveEvent); | ||||
@@ -183,7 +183,10 @@ module.exports = { | |||||
x: xFinal, | x: xFinal, | ||||
y: yFinal | y: yFinal | ||||
}, | }, | ||||
source: this | |||||
source: this.obj, | |||||
target, | |||||
spellName: 'fireblast', | |||||
spell: this | |||||
}; | }; | ||||
target.fireEvent('afterPositionChange', moveEvent); | target.fireEvent('afterPositionChange', moveEvent); | ||||
} | } | ||||
@@ -8,11 +8,11 @@ let cpnHealPatch = { | |||||
this[p] = blueprint[p]; | this[p] = blueprint[p]; | ||||
}, | }, | ||||
applyHeal: function (o, amount) { | |||||
o.stats.getHp({ | |||||
event: amount, | |||||
applyHeal: function (target, heal) { | |||||
target.stats.getHp({ | |||||
heal, | |||||
source: this.caster, | source: this.caster, | ||||
target: o | |||||
target | |||||
}); | }); | ||||
}, | }, | ||||
@@ -97,7 +97,7 @@ module.exports = { | |||||
} else if ((Math.abs(x - m.x) <= 1) && (Math.abs(y - m.y) <= 1)) { | } else if ((Math.abs(x - m.x) <= 1) && (Math.abs(y - m.y) <= 1)) { | ||||
m.destroyed = true; | m.destroyed = true; | ||||
obj.stats.getHp({ | obj.stats.getHp({ | ||||
event: { | |||||
heal: { | |||||
amount: obj.stats.values.hpMax / 10 | amount: obj.stats.values.hpMax / 10 | ||||
}, | }, | ||||
source: obj, | source: obj, | ||||
@@ -46,7 +46,7 @@ module.exports = { | |||||
amount = amount * this.shieldMultiplier; | amount = amount * this.shieldMultiplier; | ||||
const heal = { amount }; | const heal = { amount }; | ||||
target.stats.getHp({ | target.stats.getHp({ | ||||
event: heal, | |||||
heal, | |||||
source: obj, | source: obj, | ||||
target | target | ||||
}); | }); | ||||
@@ -54,7 +54,7 @@ module.exports = { | |||||
let healAmount = damage.amount * (this.healPercent / 100); | let healAmount = damage.amount * (this.healPercent / 100); | ||||
obj.stats.getHp({ | obj.stats.getHp({ | ||||
event: { | |||||
heal: { | |||||
amount: healAmount | amount: healAmount | ||||
}, | }, | ||||
source: obj, | source: obj, | ||||