v0.3.0: removed the ability to disenchant the wand of magic missile, removed wands as weapons, added save transfer logic for pre-0.3.0

This commit is contained in:
Evan Debenham
2015-05-12 22:15:31 -04:00
parent 0a78b2dc28
commit 00dc49c021
5 changed files with 33 additions and 120 deletions
@@ -75,10 +75,20 @@ public class Belongings implements Iterable<Item> {
backpack.clear();
backpack.restoreFromBundle( bundle );
weapon = (KindOfWeapon)bundle.get( WEAPON );
if (weapon != null) {
weapon.activate( owner );
if (bundle.get( WEAPON ) instanceof Wand){
//handles the case of an equipped wand from pre-0.3.0
Wand item = (Wand) bundle.get(WEAPON);
//try to add the wand to inventory
if (!item.collect(backpack)){
//if it's too full, shove it in anyway
backpack.items.add(item);
}
} else {
weapon = (KindOfWeapon) bundle.get(WEAPON);
if (weapon != null) {
weapon.activate(owner);
}
}
armor = (Armor)bundle.get( ARMOR );