v0.4.0: updated logic for curse wand effect, same as cursing traps

This commit is contained in:
Evan Debenham 2016-06-11 14:25:35 -04:00 committed by Evan Debenham
parent 6b700a96eb
commit 4972092366
2 changed files with 57 additions and 63 deletions

View File

@ -58,6 +58,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportat
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.MissileWeapon;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.CursingTrap;
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.LightningTrap;
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.SummoningTrap;
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
@ -315,16 +316,7 @@ public class CursedWand {
//curses!
case 1:
KindOfWeapon weapon = user.belongings.weapon;
Armor armor = user.belongings.armor;
KindofMisc misc1 = user.belongings.misc1;
KindofMisc misc2 = user.belongings.misc2;
if (weapon != null) weapon.cursed = weapon.cursedKnown = true;
if (armor != null) armor.cursed = armor.cursedKnown = true;
if (misc1 != null) misc1.cursed = misc1.cursedKnown = true;
if (misc2 != null) misc2.cursed = misc2.cursedKnown = true;
EquipableItem.equipCursed(user);
GLog.n( Messages.get(CursedWand.class, "cursed") );
CursingTrap.curse(user);
wand.wandUsed();
break;

View File

@ -66,8 +66,11 @@ public class CursingTrap extends Trap {
}
if (Dungeon.hero.pos == pos){
Hero hero = Dungeon.hero;
curse(Dungeon.hero);
}
}
public static void curse(Hero hero){
//items the trap wants to curse because it will create a more negative effect
ArrayList<Item> priorityCurse = new ArrayList<>();
//items the trap can curse if nothing else is available.
@ -117,11 +120,10 @@ public class CursingTrap extends Trap {
}
EquipableItem.equipCursed(hero);
GLog.n( Messages.get(this, "curse") );
}
GLog.n( Messages.get(CursingTrap.class, "curse") );
}
private void curse(Item item){
private static void curse(Item item){
item.cursed = item.cursedKnown = true;
if (item instanceof Weapon){