v0.7.0: Blandfruit now always uses potion effects, leaves behind chunks.

This commit is contained in:
Evan Debenham 2018-05-30 18:19:28 -04:00
parent 0cccd06d44
commit 876c1844c6
4 changed files with 43 additions and 30 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -24,11 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.food;
import com.shatteredpixel.shatteredpixeldungeon.Challenges;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.EarthImbue;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FireImbue;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Hunger;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ToxicImbue;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.Recipe;
@ -98,29 +94,27 @@ public class Blandfruit extends Food {
if (action.equals( AC_EAT ) && potionAttrib != null){
if (potionAttrib instanceof PotionOfFrost) {
GLog.i(Messages.get(this, "ice_msg"));
FrozenCarpaccio.effect(hero);
} else if (potionAttrib instanceof PotionOfLiquidFlame){
GLog.i(Messages.get(this, "fire_msg"));
Buff.affect(hero, FireImbue.class).set(FireImbue.DURATION);
} else if (potionAttrib instanceof PotionOfToxicGas) {
GLog.i(Messages.get(this, "toxic_msg"));
Buff.affect(hero, ToxicImbue.class).set(ToxicImbue.DURATION);
} else if (potionAttrib instanceof PotionOfParalyticGas) {
GLog.i(Messages.get(this, "para_msg"));
Buff.affect(hero, EarthImbue.class, EarthImbue.DURATION);
} else {
potionAttrib.apply(hero);
}
potionAttrib.apply(hero);
}
}
@Override
public String desc() {
if (potionAttrib== null) return super.desc();
else return Messages.get(this, "desc_cooked");
if (potionAttrib== null) {
return super.desc();
} else {
String desc = Messages.get(this, "desc_cooked") + "\n\n";
if (potionAttrib instanceof PotionOfFrost
|| potionAttrib instanceof PotionOfLiquidFlame
|| potionAttrib instanceof PotionOfToxicGas
|| potionAttrib instanceof PotionOfParalyticGas) {
desc += Messages.get(this, "desc_throw");
} else {
desc += Messages.get(this, "desc_eat");
}
return desc;
}
}
@Override
@ -197,9 +191,9 @@ public class Blandfruit extends Food {
potionAttrib instanceof PotionOfFrost ||
potionAttrib instanceof PotionOfLevitation ||
potionAttrib instanceof PotionOfPurity) {
Dungeon.level.press( cell, null, true );
potionAttrib.shatter( cell );
Dungeon.level.drop(new Chunks(), cell).sprite.drop();
} else {
super.onThrow( cell );
@ -297,4 +291,17 @@ public class Blandfruit extends Food {
}
}
public static class Chunks extends Food {
{
stackable = true;
image = ItemSpriteSheet.BLAND_CHUNKS;
energy = Hunger.STARVING;
bones = true;
}
}
}

View File

@ -458,21 +458,23 @@ public class ItemSpriteSheet {
public static final int STEAK = FOOD+1;
public static final int OVERPRICED = FOOD+2;
public static final int CARPACCIO = FOOD+3;
public static final int BLANDFRUIT = FOOD+4;
public static final int RATION = FOOD+5;
public static final int PASTY = FOOD+6;
public static final int PUMPKIN_PIE = FOOD+7;
public static final int CANDY_CANE = FOOD+8;
public static final int RATION = FOOD+4;
public static final int PASTY = FOOD+5;
public static final int PUMPKIN_PIE = FOOD+6;
public static final int CANDY_CANE = FOOD+7;
public static final int BLANDFRUIT = FOOD+8;
public static final int BLAND_CHUNKS= FOOD+9;
static{
assignItemRect(MEAT, 15, 11);
assignItemRect(STEAK, 15, 11);
assignItemRect(OVERPRICED, 14, 11);
assignItemRect(CARPACCIO, 15, 11);
assignItemRect(BLANDFRUIT, 9, 12);
assignItemRect(RATION, 16, 12);
assignItemRect(PASTY, 16, 11);
assignItemRect(PUMPKIN_PIE, 16, 12);
assignItemRect(CANDY_CANE, 13, 16);
assignItemRect(BLANDFRUIT, 9, 12);
assignItemRect(BLAND_CHUNKS,14, 6);
}
private static final int QUEST = xy(1, 26); //32 slots

View File

@ -360,7 +360,11 @@ items.food.blandfruit.fire_msg=You feel a great fire burning within you!
items.food.blandfruit.toxic_msg=You are imbued with vile toxic power!
items.food.blandfruit.para_msg=You feel the power of the earth coursing through you!
items.food.blandfruit.desc=So dry and insubstantial, perhaps stewing it with another ingredient would improve it.
items.food.blandfruit.desc_cooked=The fruit has plumped up from its time soaking in the pot and has even absorbed the properties of the seed it was cooked with.\n\nIt looks ready to be eaten!
items.food.blandfruit.desc_cooked=The fruit has plumped up from its time soaking in the pot and has even absorbed the properties of the seed it was cooked with.
items.food.blandfruit.desc_eat=It looks ready to be eaten!
items.food.blandfruit.desc_throw=It seems pretty volatile, it might be best to throw it.
items.food.blandfruit$chunks.name=blandfruit chunks
items.food.blandfruit$chunks.desc=The blandfruit has exploded on impact, leaving inert chunks behind.\n\nDespite a bit of dirt, these large chunks of cooked blandfruit seem perfectly edible.
items.food.chargrilledmeat.name=chargrilled meat
items.food.chargrilledmeat.desc=It looks like a decent steak.