v0.3.4: externalized item actions
This commit is contained in:
committed by
Evan Debenham
parent
7757b47573
commit
13b9d2f801
@@ -28,6 +28,8 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShadowParticle;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public abstract class EquipableItem extends Item {
|
||||
|
||||
public static final String AC_EQUIP = "EQUIP";
|
||||
@@ -37,6 +39,13 @@ public abstract class EquipableItem extends Item {
|
||||
bones = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<String> actions(Hero hero ) {
|
||||
ArrayList<String> actions = super.actions( hero );
|
||||
actions.add( isEquipped( hero ) ? AC_UNEQUIP : AC_EQUIP );
|
||||
return actions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute( Hero hero, String action ) {
|
||||
if (action.equals( AC_EQUIP )) {
|
||||
|
||||
Reference in New Issue
Block a user