class BurnAffliction extends Affliction { private static STACK_NUM = 3 ; damage = 0 ; values : number [ ] = [ ] ; constructor ( ) { super ( ENUM . AfflictionType . BURN ) ; } canAttack ( ) { return true ; } update ( card ) { BattleModel . getInstance ( ) . damageToTargetDirectly ( card , this . damage , "burn" ) ; } add ( option ) { let arr = this . values ; arr . push ( option . damage ) ; arr . sort ( ( a , b ) => b - a ) ; this . damage = 0 ; for ( let i = 0 ; i < BurnAffliction . STACK_NUM ; i ++ ) { if ( arr [ i ] ) { this . damage += arr [ i ] ; } } } }