V0.1.1: fixed a bug involving throwing blandfruit (need to test)
This commit is contained in:
@@ -40,10 +40,10 @@ public class Blandfruit extends Food {
|
||||
|
||||
@Override
|
||||
public void execute( Hero hero, String action ) {
|
||||
if (potionAttrib == null){
|
||||
|
||||
if (action.equals( AC_EAT )){
|
||||
|
||||
if (potionAttrib == null) {
|
||||
|
||||
detach(hero.belongings.backpack);
|
||||
|
||||
((Hunger) hero.buff(Hunger.class)).satisfy(energy);
|
||||
@@ -58,12 +58,7 @@ public class Blandfruit extends Food {
|
||||
|
||||
Statistics.foodEaten++;
|
||||
Badges.validateFoodEaten();
|
||||
}
|
||||
|
||||
else super.execute(hero, action);
|
||||
|
||||
|
||||
} else if (action.equals( AC_EAT )){
|
||||
} else {
|
||||
|
||||
((Hunger) hero.buff(Hunger.class)).satisfy(Hunger.HUNGRY);
|
||||
|
||||
@@ -73,7 +68,7 @@ public class Blandfruit extends Food {
|
||||
hero.busy();
|
||||
|
||||
if (potionAttrib instanceof PotionOfFrost) {
|
||||
GLog.i( "the Frostfruit takes a bit like Frozen Carpaccio." );
|
||||
GLog.i("the Frostfruit tastes a bit like Frozen Carpaccio.");
|
||||
switch (Random.Int(5)) {
|
||||
case 0:
|
||||
GLog.i("You see your hands turn invisible!");
|
||||
@@ -120,19 +115,7 @@ public class Blandfruit extends Food {
|
||||
case HUNTRESS:
|
||||
break;
|
||||
}
|
||||
|
||||
} else if (action.equals( AC_THROW )){
|
||||
|
||||
if (potionAttrib instanceof PotionOfLiquidFlame ||
|
||||
potionAttrib instanceof PotionOfToxicGas ||
|
||||
potionAttrib instanceof PotionOfParalyticGas ||
|
||||
potionAttrib instanceof PotionOfFrost){
|
||||
potionAttrib.execute(hero, action);
|
||||
//detaches in Potion.cast, this is an awkward workaround due to throwing being on a different thread.
|
||||
} else {
|
||||
super.execute(hero, action);
|
||||
}
|
||||
|
||||
} else {
|
||||
super.execute(hero, action);
|
||||
}
|
||||
@@ -224,10 +207,24 @@ public class Blandfruit extends Food {
|
||||
|
||||
public static final String NAME = "name";
|
||||
|
||||
@Override
|
||||
public void cast( final Hero user, int dst ) {
|
||||
if (potionAttrib instanceof PotionOfLiquidFlame ||
|
||||
potionAttrib instanceof PotionOfToxicGas ||
|
||||
potionAttrib instanceof PotionOfParalyticGas ||
|
||||
potionAttrib instanceof PotionOfFrost) {
|
||||
potionAttrib.cast(user, dst);
|
||||
detach( user.belongings.backpack );
|
||||
} else {
|
||||
super.cast(user, dst);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void storeInBundle(Bundle bundle){
|
||||
super.storeInBundle(bundle);
|
||||
bundle.put(NAME name);
|
||||
bundle.put( NAME, name );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user