v0.4.0: updated wand curse logic

This commit is contained in:
Evan Debenham 2016-06-11 14:21:42 -04:00 committed by Evan Debenham
parent 3f9c7cf6f8
commit 6b700a96eb
2 changed files with 9 additions and 5 deletions
src/com/shatteredpixel/shatteredpixeldungeon/items
wands
weapon/melee

View File

@ -186,12 +186,16 @@ public abstract class Wand extends Item {
@Override
public Item upgrade() {
if (cursed && cursedKnown) {
GLog.p( Messages.get(Item.class, "remove_curse") );
Dungeon.hero.sprite.emitter().start( ShadowParticle.UP, 0.05f, 10 );
}
boolean cursedPreUpgrade = cursed;
super.upgrade();
if (cursedPreUpgrade && Random.Float() > Math.pow(0.9, level())){
GLog.p( Messages.get(Item.class, "remove_curse") );
Dungeon.hero.sprite.emitter().start( ShadowParticle.UP, 0.05f, 10 );
} else {
cursed = cursedPreUpgrade;
}
updateLevel();
curCharges = Math.min( curCharges + 1, maxCharges );

View File

@ -155,6 +155,7 @@ public class MagesStaff extends MeleeWeapon {
public Item imbueWand(Wand wand, Char owner){
wand.cursed = false;
this.wand = null;
//syncs the level of the two items.
@ -176,7 +177,6 @@ public class MagesStaff extends MeleeWeapon {
wand.maxCharges = Math.min(wand.maxCharges + 1, 10);
wand.curCharges = wand.maxCharges;
wand.identify();
wand.cursed = false;
if (owner != null) wand.charge(owner);
name = Messages.get(wand, "staff_name");