class CounterDispellSkillLogic extends ProtectSkillLogic { condFunc = ( x ) => x > 0 ; willBeExecuted ( data ) { let range = RangeFactory . getRange ( data . skill . skillFuncArg3 ) ; let hasValidtarget = range . hasValidTarget ( data . executor , this . getCondFunc ( ) ) ; return super . willBeExecuted ( data ) && hasValidtarget ; } private getCondFunc ( ) { return ( card ) : boolean => card . hasStatus ( this . condFunc ) ; } execute ( data ) { let toReturn = this . executeProtectPhase ( data , true ) ; if ( data . executor . isDead || ! data . executor . canUseSkill ( ) ) { return toReturn ; } this . logger . addMinorEvent ( { executorId : data . executor . id , type : ENUM . MinorEventType . DESCRIPTION , description : data . executor . name + " procs " + data . skill . name , skillId : data . skill . id } ) ; let range = RangeFactory . getRange ( data . skill . skillFuncArg3 ) ; range . getReady ( data . executor , this . getCondFunc ( ) ) ; let target ; while ( target = range . getTarget ( data . executor ) ) { target . clearAllStatus ( this . condFunc ) ; this . logger . addMinorEvent ( { executorId : data . executor . id , targetId : target . id , type : ENUM . MinorEventType . STATUS , status : { type : 0 , isDispelled : true , } , description : target . name + " is dispelled." , skillId : data . skill . id } ) ; } return toReturn ; } }