v2.2.0: converted inventory spells to use new consumption system

This commit is contained in:
Evan Debenham
2023-09-12 12:22:20 -04:00
parent 295ac57f86
commit 2b927b1f74

View File

@@ -35,7 +35,6 @@ public abstract class InventorySpell extends Spell {
@Override
protected void onCast(Hero hero) {
curItem = detach( hero.belongings.backpack );
GameScene.selectItem( itemSelector );
}
@@ -78,6 +77,8 @@ public abstract class InventorySpell extends Spell {
}
if (item != null) {
curItem = detach(curUser.belongings.backpack);
((InventorySpell)curItem).onItemSelected( item );
curUser.spend( 1f );
@@ -87,8 +88,6 @@ public abstract class InventorySpell extends Spell {
Sample.INSTANCE.play( Assets.Sounds.READ );
Invisibility.dispel();
} else {
curItem.collect( curUser.belongings.backpack );
}
}
};