class HealSkillLogic extends SkillLogic { willBeExecuted ( data ) { let hasValidTarget = data . skill . range . hasValidTarget ( data . executor , this . getCondFunc ( ) ) ; return super . willBeExecuted ( data ) && hasValidTarget ; } private getCondFunc ( ) { return ( card ) : boolean => ! card . isFullHealth ( ) ; } execute ( data ) { data . skill . range . getReady ( data . executor , this . getCondFunc ( ) ) ; let baseHealAmount = getHealAmount ( data . executor ) ; let multiplier = data . skill . skillFuncArg1 ; let healAmount = Math . floor ( multiplier * baseHealAmount ) ; let target ; while ( target = data . skill . getTarget ( data . executor ) ) { if ( data . skill . skillFuncArg2 === 1 ) { healAmount = multiplier * target . getOriginalHP ( ) ; } this . battleModel . damageToTargetDirectly ( target , - 1 * healAmount , " healing" ) ; } } }