class AfflictionSkillLogic extends SkillLogic { execute ( data ) { data . skill . getReady ( data . executor ) ; let target ; while ( target = data . skill . getTarget ( data . executor ) ) { AfflictionSkillLogic . processAffliction ( data . executor , target , data . skill ) ; } } param executor param target param skill param fixedProb returns { } static processAffliction ( executor , target , skill , fixedProb ? ) { let type = skill . skillFuncArg2 ; let prob = fixedProb ? fixedProb : skill . skillFuncArg3 ; prob *= executor . getPassiveAfflictionProbabilityBuffEffect ( target ) ; if ( Math . random ( ) > prob || ! type ) { return ; } let option = { } ; if ( skill . skillFuncArg4 ) { if ( type === ENUM . AfflictionType . POISON ) { option . percent = skill . skillFuncArg4 ; } else if ( type === ENUM . AfflictionType . SILENT || type === ENUM . AfflictionType . BLIND || type === ENUM . AfflictionType . CONFUSE ) { option . turnNum = skill . skillFuncArg4 ; } else if ( type === ENUM . AfflictionType . BURN ) { option . damage = skill . skillFuncArg4 ; } } if ( skill . skillFuncArg5 ) { if ( type === ENUM . AfflictionType . BLIND ) { option . missProb = skill . skillFuncArg5 ; } else if ( type === ENUM . AfflictionType . CONFUSE ) { option . confuseProb = skill . skillFuncArg5 ; } } target . setAffliction ( type , option ) ; if ( type === ENUM . AfflictionType . POISON ) { var percent = target . getPoisonPercent ( ) ; } let logger = BattleLogger . getInstance ( ) ; logger . addMinorEvent ( { executorId : executor . id , targetId : target . id , type : ENUM . MinorEventType . AFFLICTION , affliction : { type : type , duration : option . turnNum , percent : percent , missProb : option . missProb } , description : target . name + " is now " + ENUM . AfflictionType [ type ] , } ) ; } }