V0.1.1: Blandfruit now half implemented, almost finished...
This commit is contained in:
parent
ffa746be18
commit
a7caea1598
|
@ -3,7 +3,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.food;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Hunger;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.*;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.SpellSprite;
|
||||
|
@ -16,6 +16,7 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
/**
|
||||
* Created by debenhame on 12/08/2014.
|
||||
|
@ -67,6 +68,34 @@ public class Blandfruit extends Food {
|
|||
|
||||
hero.spend( 1f );
|
||||
hero.busy();
|
||||
|
||||
if (potionAttrib instanceof PotionOfFrost){
|
||||
GLog.i( "the Frostfruit takes a bit like Frozen Carpaccio." );
|
||||
switch (Random.Int(5)) {
|
||||
case 0:
|
||||
GLog.i( "You see your hands turn invisible!" );
|
||||
Buff.affect(hero, Invisibility.class, Invisibility.DURATION);
|
||||
break;
|
||||
case 1:
|
||||
GLog.i( "You feel your skin hardens!" );
|
||||
Buff.affect( hero, Barkskin.class ).level( hero.HT / 4 );
|
||||
break;
|
||||
case 2:
|
||||
GLog.i( "Refreshing!" );
|
||||
Buff.detach( hero, Poison.class );
|
||||
Buff.detach( hero, Cripple.class );
|
||||
Buff.detach( hero, Weakness.class );
|
||||
Buff.detach( hero, Bleeding.class );
|
||||
break;
|
||||
case 3:
|
||||
GLog.i( "You feel better!" );
|
||||
if (hero.HP < hero.HT) {
|
||||
hero.HP = Math.min( hero.HP + hero.HT / 4, hero.HT );
|
||||
hero.sprite.emitter().burst( Speck.factory( Speck.HEALING ), 1 );
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else
|
||||
potionAttrib.apply(hero);
|
||||
|
||||
Sample.INSTANCE.play( Assets.SND_EAT );
|
||||
|
@ -93,7 +122,8 @@ public class Blandfruit extends Food {
|
|||
|
||||
if (potionAttrib instanceof PotionOfLiquidFlame ||
|
||||
potionAttrib instanceof PotionOfToxicGas ||
|
||||
potionAttrib instanceof PotionOfParalyticGas){
|
||||
potionAttrib instanceof PotionOfParalyticGas ||
|
||||
potionAttrib instanceof PotionOfFrost){
|
||||
potionAttrib.execute(hero, action);
|
||||
detach( hero.belongings.backpack );
|
||||
} else {
|
||||
|
@ -185,8 +215,6 @@ public class Blandfruit extends Food {
|
|||
info = "The fruit has plumped up from its time soaking in the pot and has even absorbed the properties "+
|
||||
"of the Sorrowmoss seed it was cooked with. It looks crisp and volatile, I shouldn't eat this.";
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
return this;
|
||||
|
|
|
@ -22,6 +22,7 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.levels.Room;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.plants.Sungrass;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.plants.BlandfruitBush;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
public class GardenPainter extends Painter {
|
||||
|
@ -34,9 +35,17 @@ public class GardenPainter extends Painter {
|
|||
|
||||
room.entrance().set( Room.Door.Type.REGULAR );
|
||||
|
||||
int bushes = Random.Int( 3 ) == 0 ? (Random.Int( 5 ) == 0 ? 2 : 1) : 0;
|
||||
for (int i=0; i < bushes; i++) {
|
||||
int bushes = Random.Int( 3 );
|
||||
if (bushes == 0) {
|
||||
level.plant(new Sungrass.Seed(), room.random());
|
||||
} else if (bushes == 1) {
|
||||
level.plant(new BlandfruitBush.Seed(), room.random() );
|
||||
} else {
|
||||
bushes = Random.Int( 5 );
|
||||
if (bushes == 0){
|
||||
level.plant(new Sungrass.Seed(), room.random());
|
||||
level.plant(new BlandfruitBush.Seed(), room.random() );
|
||||
}
|
||||
}
|
||||
|
||||
Foliage light = (Foliage)level.blobs.get( Foliage.class );
|
||||
|
|
|
@ -0,0 +1,59 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.plants;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Blindness;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Cripple;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfInvisibility;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
/**
|
||||
* Created by Evan on 13/08/2014.
|
||||
*/
|
||||
public class BlandfruitBush extends Plant {
|
||||
|
||||
private static final String TXT_DESC =
|
||||
"Distant cousin of the Rotberry, the pear-shaped produce of the Blandfruit bush tastes like mushy chalk. " +
|
||||
"The fruit is gross and unsubstantial but isn't poisonous. perhaps it could be cooked.";
|
||||
|
||||
{
|
||||
image = 8;
|
||||
plantName = "Blandfruit";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void activate( Char ch ) {
|
||||
super.activate( ch );
|
||||
|
||||
if (ch != null) {
|
||||
//need to implement this
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String desc() {
|
||||
return TXT_DESC;
|
||||
}
|
||||
|
||||
public static class Seed extends Plant.Seed {
|
||||
{
|
||||
plantName = "Blandfruit";
|
||||
|
||||
name = "seed of " + plantName;
|
||||
image = ItemSpriteSheet.SEED_BLINDWEED;
|
||||
|
||||
plantClass = BlandfruitBush.class;
|
||||
alchemyClass = PotionOfInvisibility.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String desc() {
|
||||
return TXT_DESC;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user