v0.4.2: fixed some bugs involving cursed boomerangs

This commit is contained in:
Evan Debenham 2016-09-03 17:54:22 -04:00
parent df5f9dc1d5
commit 616348a0e5
2 changed files with 3 additions and 2 deletions

View File

@ -125,7 +125,7 @@ public class Boomerang extends MissileWeapon {
@Override @Override
public void cast( Hero user, int dst ) { public void cast( Hero user, int dst ) {
throwEquiped = isEquipped( user ); throwEquiped = isEquipped( user ) && !cursed;
if (throwEquiped) Dungeon.quickslot.convertToPlaceholder(this); if (throwEquiped) Dungeon.quickslot.convertToPlaceholder(this);
super.cast( user, dst ); super.cast( user, dst );
} }

View File

@ -34,6 +34,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.Artifact; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.Artifact;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.Ring; import com.shatteredpixel.shatteredpixeldungeon.items.rings.Ring;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.Boomerang;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.TrapSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.TrapSprite;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
@ -77,7 +78,7 @@ public class CursingTrap extends Trap {
ArrayList<Item> canCurse = new ArrayList<>(); ArrayList<Item> canCurse = new ArrayList<>();
KindOfWeapon weapon = hero.belongings.weapon; KindOfWeapon weapon = hero.belongings.weapon;
if (weapon instanceof Weapon && !weapon.cursed){ if (weapon instanceof Weapon && !weapon.cursed && !(weapon instanceof Boomerang)){
if (((Weapon) weapon).enchantment == null) if (((Weapon) weapon).enchantment == null)
priorityCurse.add(weapon); priorityCurse.add(weapon);
else else