class BlindAffliction extends Affliction { missProb : number ; validTurnNum : number ; constructor ( ) { super ( ENUM . AfflictionType . BLIND ) ; this . missProb = 0 ; this . finished = false ; this . validTurnNum = 0 ; } canAttack ( ) { return true ; } canMiss ( ) { return Math . random ( ) <= this . missProb ; } update ( ) { if ( -- this . validTurnNum <= 0 ) { this . clear ( ) ; } } add ( option ) { this . validTurnNum = option . turnNum ; this . missProb = option . missProb ; } }