v2.5.0: cleaning tipped darts now doesn't show 'clean all' if there is 1
This commit is contained in:
+16
-4
@@ -78,12 +78,24 @@ public abstract class TippedDart extends Dart {
|
|||||||
super.execute(hero, action);
|
super.execute(hero, action);
|
||||||
if (action.equals( AC_CLEAN )){
|
if (action.equals( AC_CLEAN )){
|
||||||
|
|
||||||
|
String[] options;
|
||||||
|
if (quantity() > 1){
|
||||||
|
options = new String[]{
|
||||||
|
Messages.get(this, "clean_all"),
|
||||||
|
Messages.get(this, "clean_one"),
|
||||||
|
Messages.get(this, "cancel")
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
options = new String[]{
|
||||||
|
Messages.get(this, "clean_one"),
|
||||||
|
Messages.get(this, "cancel")
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
GameScene.show(new WndOptions(new ItemSprite(this),
|
GameScene.show(new WndOptions(new ItemSprite(this),
|
||||||
Messages.titleCase(name()),
|
Messages.titleCase(name()),
|
||||||
Messages.get(this, "clean_desc"),
|
Messages.get(this, "clean_desc"),
|
||||||
Messages.get(this, "clean_all"),
|
options){
|
||||||
Messages.get(this, "clean_one"),
|
|
||||||
Messages.get(this, "cancel")){
|
|
||||||
@Override
|
@Override
|
||||||
protected void onSelect(int index) {
|
protected void onSelect(int index) {
|
||||||
if (index == 0){
|
if (index == 0){
|
||||||
@@ -93,7 +105,7 @@ public abstract class TippedDart extends Dart {
|
|||||||
hero.spend( 1f );
|
hero.spend( 1f );
|
||||||
hero.busy();
|
hero.busy();
|
||||||
hero.sprite.operate(hero.pos);
|
hero.sprite.operate(hero.pos);
|
||||||
} else if (index == 1){
|
} else if (index == 1 && quantity() > 1){
|
||||||
detach(hero.belongings.backpack);
|
detach(hero.belongings.backpack);
|
||||||
if (!new Dart().collect()) Dungeon.level.drop(new Dart(), hero.pos).sprite.drop();
|
if (!new Dart().collect()) Dungeon.level.drop(new Dart(), hero.pos).sprite.drop();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user