abstract class Affliction { type : ENUM . AfflictionType ; finished : boolean ; protected constructor ( type ) { this . type = type ; this . finished = false ; } static getAfflictionAdjective ( type ) { switch ( type ) { case ENUM . AfflictionType . BLIND : return "Blinded" ; case ENUM . AfflictionType . DISABLE : return "Disabled" ; case ENUM . AfflictionType . FROZEN : return "Frozen" ; case ENUM . AfflictionType . PARALYSIS : return "Paralyzed" ; case ENUM . AfflictionType . POISON : return "Poisoned" ; case ENUM . AfflictionType . SILENT : return "Silent" ; case ENUM . AfflictionType . CONFUSE : return "Confused" ; case ENUM . AfflictionType . BURN : return "Burned" ; default : throw new Error ( "Invalid affliction type!" ) ; } } /**
     * Can the familiar do anything (both auto attack and perform skills) with this affliction?
     */ canAttack ( ) { throw new Error ( "Implement this" ) ; } /**
     * Can the familiar use skills with this affliction?
     */ canUseSkill ( ) { return this . canAttack ( ) ; } /**
     * Can the familiar miss with this affliction?
     */ canMiss ( ) { return false ; } /**
     * Called when the affliction needs to be updated, like at the end of the fam's turn
     */ update ( card ) { throw new Error ( "Implement this" ) ; } /**
     * Called when the fam is affected with another affliction of the same type
     */ add ( option ) { } isFinished ( ) { return this . finished ; } clear ( ) { this . finished = true ; } getType ( ) { return this . type ; } static canConfuse ( skillType ) { return skillType === ENUM . SkillType . ACTIVE ; } } /**
 * A simple struct for affliction's optional parameters
 */ interface AfflictOptParam { turnNum ? : number ; missProb ? : number ; confuseProb ? : number ; percent ? : number ; damage ? : number ; }