question: protected boolean doDamage ( final RPEntity entity ) { float attack ; float defense ; if ( entity . getHP ( ) == 0 ) { return false ; } if ( entity . isGhost ( ) ) { return true ; } attack = damage ; defense = calculateDefense ( entity ) ; int actualDamage = Math . round ( Math . max ( 1 , attack - defense ) ) ; actualDamage = Math . min ( actualDamage , entity . getHP ( ) ) ; if ( actualDamage != 0 ) { entity . onDamaged ( this , actualDamage ) ; } return true ; }
target:  Inflict damage on an entity.