import { Ability } from "../ability" ; import { Encounter } from "../combat" ; import { Entity } from "../entity" ; import { Text } from "../text" ; import { AbilityNode } from "./node" ; const AttackAb = new Ability ( "Attack" ) ; AttackAb . Short = ( ) => "Perform a physical attack." ; AttackAb . castTree . push ( AbilityNode . Template . Physical ( { onAbsorb : [ ( ability , encounter , caster , target , dmg ) => { const parse = AbilityNode . DefaultParser ( caster , target ) ; Text . Add ( "[Name] attack[notS] [tname], but [theshe] absorb[tnotS] the blow for " + Text . Heal ( dmg ) + " damage!" ) ; Text . NL ( ) ; } ] , onDamage : [ ( ability , encounter , caster , target , dmg ) => { const parse = AbilityNode . DefaultParser ( caster , target ) ; Text . Add ( "[Name] attack[notS] [tname] for " + Text . Damage ( - dmg ) + " damage! Waagh!" , parse ) ; Text . NL ( ) ; } ] , onMiss : [ ( ability , encounter , caster , target ) => { const parse = AbilityNode . DefaultParser ( caster , target ) ; Text . Add ( "[Name] attack[notS] [tname], but the blow misses!" , parse ) ; Text . NL ( ) ; } ] , } ) ) ; export { AttackAb } ;