Merging Source v1.7.2: item changes

This commit is contained in:
Evan Debenham
2014-10-21 00:38:15 -04:00
parent 4a49763309
commit 13afc9df8d
32 changed files with 523 additions and 269 deletions
@@ -145,32 +145,28 @@ public class Ring extends KindofMisc {
buff = buff();
buff.attachTo( ch );
}
@Override
public boolean doUnequip( Hero hero, boolean collect ) {
if (cursed) {
GLog.w( "You can't remove cursed " + name() + "!" );
return false;
}
if (hero.belongings.misc1 == this) {
hero.belongings.misc1 = null;
} else {
hero.belongings.misc2 = null;
}
buff.detach();
buff = null;
hero.spendAndNext( TIME_TO_EQUIP );
if (collect && !collect( hero.belongings.backpack )) {
Dungeon.level.drop( this, hero.pos );
}
return true;
}
@Override
public boolean doUnequip( Hero hero, boolean collect, boolean single ) {
if (super.doUnequip( hero, collect, single )) {
if (hero.belongings.misc1 == this) {
hero.belongings.misc1 = null;
} else {
hero.belongings.misc2 = null;
}
hero.remove( buff );
buff = null;
return true;
} else {
return false;
}
}
@Override
public boolean isEquipped( Hero hero ) {