v0.4.1: fixed some items being burned/frozen when held by thieves

This commit is contained in:
Evan Debenham 2016-07-20 18:38:32 -04:00 committed by Evan Debenham
parent 3de8225f9b
commit 43f3582e1e
3 changed files with 23 additions and 9 deletions

View File

@ -125,9 +125,16 @@ public class Burning extends Buff implements Hero.Doom {
target.damage( damage, this ); target.damage( damage, this );
} }
if (target instanceof Thief && ((Thief)target).item instanceof Scroll) { if (target instanceof Thief) {
((Thief)target).item = null;
Item item = ((Thief) target).item;
if (item instanceof Scroll &&
!(item instanceof ScrollOfUpgrade || item instanceof ScrollOfMagicalInfusion)) {
target.sprite.emitter().burst( ElmoParticle.FACTORY, 6 ); target.sprite.emitter().burst( ElmoParticle.FACTORY, 6 );
((Thief)target).item = null;
}
} }
} else { } else {

View File

@ -74,10 +74,14 @@ public class Chill extends FlavourBuff {
GLog.w( Messages.get(this, "freezes", item.toString()) ); GLog.w( Messages.get(this, "freezes", item.toString()) );
} }
} else if (target instanceof Thief && ((Thief)target).item instanceof Potion) { } else if (target instanceof Thief) {
Item item = ((Thief) target).item;
if (item instanceof Potion && !(item instanceof PotionOfStrength || item instanceof PotionOfMight)) {
((Potion) ((Thief) target).item).shatter(target.pos); ((Potion) ((Thief) target).item).shatter(target.pos);
((Thief) target).item = null; ((Thief) target).item = null;
}
} }
return true; return true;

View File

@ -74,13 +74,16 @@ public class Frost extends FlavourBuff {
GLog.w( Messages.get(this, "freezes", item.toString()) ); GLog.w( Messages.get(this, "freezes", item.toString()) );
} }
} else if (target instanceof Thief && ((Thief)target).item instanceof Potion) { } else if (target instanceof Thief) {
Item item = ((Thief) target).item;
if (item instanceof Potion && !(item instanceof PotionOfStrength || item instanceof PotionOfMight)) {
((Potion) ((Thief) target).item).shatter(target.pos); ((Potion) ((Thief) target).item).shatter(target.pos);
((Thief) target).item = null; ((Thief) target).item = null;
} }
}
return true; return true;
} else { } else {