forked from public/foundryvtt-wh4-lang-fr-fr
Add all systems effects scripts + translations
This commit is contained in:
14
reference_scripts/V1D2Uo3WDKYQePU3.js
Normal file
14
reference_scripts/V1D2Uo3WDKYQePU3.js
Normal file
@ -0,0 +1,14 @@
|
||||
let damage = this.effect.sourceTest.result.damage;
|
||||
|
||||
let loc = "head"
|
||||
let APatLoc = this.actor.system.status.armour[loc];
|
||||
|
||||
let metalAP = APatLoc.layers.reduce((metal, layer) => metal += (layer.metal ? layer.value : 0), 0)
|
||||
|
||||
let APused = Math.max(0, APatLoc.value - metalAP); // remove metal AP at location;
|
||||
|
||||
damage -= (APused + this.actor.system.characteristics.t.bonus)
|
||||
|
||||
let msg = await this.actor.applyBasicDamage(damage, {suppressMsg : true, damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL});
|
||||
msg += ` (ignored ${metalAP} metal AP on ${game.wfrp4e.config.locations[loc]})`
|
||||
this.script.scriptMessage(msg)
|
Reference in New Issue
Block a user