class CounterDrainSkillLogic extends CounterSkillLogic { execute ( data ) { let skill = data . skill ; let target ; super . execute ( data ) ; let range = RangeFactory . getRange ( skill . skillFuncArg4 ) ; range . getReady ( data . executor ) ; assert ( ! ( range instanceof RandomRange ) , "can't do this with random ranges!" ) ; let totalHealAmount = data . executor . lastBattleDamageDealt * skill . skillFuncArg2 ; let eachTargetHealAmount = Math . floor ( totalHealAmount / range . targets . length ) ; while ( target = range . getTarget ( data . executor ) ) { this . battleModel . damageToTargetDirectly ( target , - 1 * eachTargetHealAmount , " healing" ) ; } } }