Resistance Discounting

Fix a variable name, and added a continue statement for efficiency
This commit is contained in:
Vincentyification 2014-01-02 13:35:47 +08:00
parent d6b3010b53
commit 5fbb7e7d4e

View File

@ -151,17 +151,17 @@ public class AcrobaticsManager extends SkillManager {
} }
private boolean isFatal(double damage) { private boolean isFatal(double damage) {
Player player = getPlayer();
int discount=1; int discount=1;
// If the player has resistance active, carry resistance checking // If the player has resistance active, carry resistance checking
if(player.hasPotionEffect(PotionEffectType.DAMAGE_RESISTANCE)){ if(getPlayer().hasPotionEffect(PotionEffectType.DAMAGE_RESISTANCE)){
Iterator potions=t.getActivePotionEffects().iterator(); Iterator potions=getPlayer().getActivePotionEffects().iterator();
while(potions.hasNext()){ while(potions.hasNext()){
PotionEffect potion=(PotionEffect)potions.next(); PotionEffect potion=(PotionEffect)potions.next();
if(potion.getType()==PotionEffectType.DAMAGE_RESISANCE) if(potion.getType()==PotionEffectType.DAMAGE_RESISANCE)
{//Having resistance allows you to recieve less damage {//Having resistance allows you to recieve less damage
int coupon=potion.getAmplifier(); int coupon=potion.getAmplifier();
discount=Math.min(0,1-(coupon*0.2)); discount=Math.min(0,1-(coupon*0.2));
continue;
} }
} }
}//...Which is accounted here }//...Which is accounted here