cleaned up formatting:

- removed trailing whitespace
- changed all leading whitespace to tabs
- removed IDE created author comments
This commit is contained in:
Evan Debenham
2015-06-12 16:22:26 -04:00
parent baa83b7e43
commit cebdff0221
335 changed files with 8555 additions and 8714 deletions
@@ -6,46 +6,43 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.items.food.Blandfruit;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
/**
* 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 caked dust. " +
"The fruit is gross and unsubstantial but isn't poisonous. perhaps it could be cooked.";
private static final String TXT_DESC =
"Distant cousin of the Rotberry, the pear-shaped produce of the Blandfruit bush tastes like caked dust. " +
"The fruit is gross and unsubstantial but isn't poisonous. perhaps it could be cooked.";
{
image = 8;
plantName = "Blandfruit";
}
{
image = 8;
plantName = "Blandfruit";
}
@Override
public void activate() {
Char ch = Actor.findChar(pos);
@Override
public void activate() {
Char ch = Actor.findChar(pos);
Dungeon.level.drop( new Blandfruit(), pos ).sprite.drop();
}
Dungeon.level.drop( new Blandfruit(), pos ).sprite.drop();
}
@Override
public String desc() {
return TXT_DESC;
}
@Override
public String desc() {
return TXT_DESC;
}
public static class Seed extends Plant.Seed {
{
plantName = "Blandfruit";
public static class Seed extends Plant.Seed {
{
plantName = "Blandfruit";
name = "seed of " + plantName;
image = ItemSpriteSheet.SEED_BLANDFRUIT;
name = "seed of " + plantName;
image = ItemSpriteSheet.SEED_BLANDFRUIT;
plantClass = BlandfruitBush.class;
alchemyClass = null;
}
plantClass = BlandfruitBush.class;
alchemyClass = null;
}
@Override
public String desc() {
return TXT_DESC;
}
}
@Override
public String desc() {
return TXT_DESC;
}
}
}
@@ -32,9 +32,9 @@ import com.watabou.utils.Random;
public class Blindweed extends Plant {
private static final String TXT_DESC =
private static final String TXT_DESC =
"Upon being touched a Blindweed perishes in a bright flash of light. " +
"The flash is strong enough to disorient for several seconds.";
"The flash is strong enough to disorient for several seconds.";
{
image = 3;
@@ -46,9 +46,9 @@ public class Blindweed extends Plant {
Char ch = Actor.findChar(pos);
if (ch != null) {
int len = Random.Int( 5, 10 );
int len = Random.Int( 5, 10 );
Buff.prolong( ch, Blindness.class, len );
Buff.prolong( ch, Cripple.class, len );
Buff.prolong( ch, Cripple.class, len );
if (ch instanceof Mob) {
if (((Mob)ch).state == ((Mob)ch).HUNTING) ((Mob)ch).state = ((Mob)ch).WANDERING;
((Mob)ch).beckon( Dungeon.level.randomDestination() );
@@ -36,55 +36,55 @@ import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
public class Dreamfoil extends Plant {
private static final String TXT_DESC =
"The Dreamfoil's prickly flowers contain a chemical which is known for its " +
"properties as a strong neutralizing agent. Most weaker creatures are overwhelmed " +
"and knocked unconscious, which gives the plant its namesake.";
private static final String TXT_DESC =
"The Dreamfoil's prickly flowers contain a chemical which is known for its " +
"properties as a strong neutralizing agent. Most weaker creatures are overwhelmed " +
"and knocked unconscious, which gives the plant its namesake.";
{
image = 10;
plantName = "Dreamfoil";
}
{
image = 10;
plantName = "Dreamfoil";
}
@Override
public void activate() {
Char ch = Actor.findChar(pos);
@Override
public void activate() {
Char ch = Actor.findChar(pos);
if (ch != null) {
if (ch instanceof Mob)
Buff.affect(ch, MagicalSleep.class);
else if (ch instanceof Hero){
GLog.i( "You feel refreshed." );
Buff.detach( ch, Poison.class );
Buff.detach( ch, Cripple.class );
Buff.detach( ch, Weakness.class );
Buff.detach( ch, Bleeding.class );
Buff.detach( ch, Drowsy.class );
Buff.detach( ch, Slow.class );
Buff.detach( ch, Vertigo.class);
}
}
}
if (ch != null) {
if (ch instanceof Mob)
Buff.affect(ch, MagicalSleep.class);
else if (ch instanceof Hero){
GLog.i( "You feel refreshed." );
Buff.detach( ch, Poison.class );
Buff.detach( ch, Cripple.class );
Buff.detach( ch, Weakness.class );
Buff.detach( ch, Bleeding.class );
Buff.detach( ch, Drowsy.class );
Buff.detach( ch, Slow.class );
Buff.detach( ch, Vertigo.class);
}
}
}
@Override
public String desc() {
return TXT_DESC;
}
@Override
public String desc() {
return TXT_DESC;
}
public static class Seed extends Plant.Seed {
{
plantName = "Dreamfoil";
public static class Seed extends Plant.Seed {
{
plantName = "Dreamfoil";
name = "seed of " + plantName;
image = ItemSpriteSheet.SEED_DREAMFOIL;
name = "seed of " + plantName;
image = ItemSpriteSheet.SEED_DREAMFOIL;
plantClass = Dreamfoil.class;
alchemyClass = PotionOfPurity.class;
}
plantClass = Dreamfoil.class;
alchemyClass = PotionOfPurity.class;
}
@Override
public String desc() {
return TXT_DESC;
}
}
@Override
public String desc() {
return TXT_DESC;
}
}
}
@@ -32,7 +32,7 @@ import com.watabou.utils.Bundle;
public class Earthroot extends Plant {
private static final String TXT_DESC =
private static final String TXT_DESC =
"When a creature touches an Earthroot, its roots " +
"create a kind of immobile natural armor around it.";
@@ -51,7 +51,7 @@ public class Earthroot extends Plant {
if (Dungeon.visible[pos]) {
CellEmitter.bottom( pos ).start( EarthParticle.FACTORY, 0.05f, 8 );
Camera.main.shake( 1, 0.4f );
Camera.main.shake( 1, 0.4f );
}
}
@@ -70,7 +70,7 @@ public class Earthroot extends Plant {
plantClass = Earthroot.class;
alchemyClass = PotionOfParalyticGas.class;
bones = true;
bones = true;
}
@Override
@@ -128,7 +128,7 @@ public class Earthroot extends Plant {
@Override
public String toString() {
return Utils.format("Herbal armor", level);
return Utils.format("Herbal armor", level);
}
@Override
@@ -30,7 +30,7 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
public class Fadeleaf extends Plant {
private static final String TXT_DESC =
private static final String TXT_DESC =
"Touching a Fadeleaf will teleport any creature " +
"to a random place on the current level.";
@@ -28,9 +28,9 @@ import com.watabou.utils.PathFinder;
public class Icecap extends Plant {
private static final String TXT_DESC =
private static final String TXT_DESC =
"Upon being touched, an Icecap lets out a puff of freezing pollen. " +
"The freezing effect is much stronger if the environment is wet.";
"The freezing effect is much stronger if the environment is wet.";
{
image = 1;
@@ -75,22 +75,22 @@ public abstract class Plant implements Bundlable {
if (Dungeon.hero.subClass == HeroSubClass.WARDEN) {
int naturalismLevel = 0;
SandalsOfNature.Naturalism naturalism = Dungeon.hero.buff( SandalsOfNature.Naturalism.class );
if (naturalism != null) {
naturalismLevel = naturalism.level()+1;
}
int naturalismLevel = 0;
SandalsOfNature.Naturalism naturalism = Dungeon.hero.buff( SandalsOfNature.Naturalism.class );
if (naturalism != null) {
naturalismLevel = naturalism.level()+1;
}
if (Random.Int( 5 - (naturalismLevel/2) ) == 0) {
Item seed = Generator.random(Generator.Category.SEED);
Item seed = Generator.random(Generator.Category.SEED);
if (seed instanceof BlandfruitBush.Seed) {
if (Random.Int(15) - Dungeon.limitedDrops.blandfruitSeed.count >= 0) {
Dungeon.level.drop(seed, pos).sprite.drop();
Dungeon.limitedDrops.blandfruitSeed.count++;
}
} else
Dungeon.level.drop(seed, pos).sprite.drop();
if (seed instanceof BlandfruitBush.Seed) {
if (Random.Int(15) - Dungeon.limitedDrops.blandfruitSeed.count >= 0) {
Dungeon.level.drop(seed, pos).sprite.drop();
Dungeon.limitedDrops.blandfruitSeed.count++;
}
} else
Dungeon.level.drop(seed, pos).sprite.drop();
}
if (Random.Int( 5 - naturalismLevel ) == 0) {
Dungeon.level.drop( new Dewdrop(), pos ).sprite.drop();
@@ -123,7 +123,7 @@ public abstract class Plant implements Bundlable {
private static final float TIME_TO_PLANT = 1f;
{
stackable = true;
stackable = true;
defaultAction = AC_THROW;
}
@@ -29,7 +29,7 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
public class Sorrowmoss extends Plant {
private static final String TXT_DESC =
private static final String TXT_DESC =
"A Sorrowmoss is a flower (not a moss) with razor-sharp petals, coated with a deadly venom.";
{
@@ -42,7 +42,7 @@ public class Sorrowmoss extends Plant {
Char ch = Actor.findChar(pos);
if (ch != null) {
Buff.affect( ch, Poison.class ).set( Poison.durationFactor( ch ) * (4 + Dungeon.depth / 2) );
Buff.affect( ch, Poison.class ).set( Poison.durationFactor( ch ) * (4 + Dungeon.depth / 2) );
}
if (Dungeon.visible[pos]) {
@@ -7,48 +7,45 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Vertigo;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfLevitation;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
/**
* Created by Evan on 23/10/2014.
*/
public class Stormvine extends Plant {
private static final String TXT_DESC =
"Gravity affects the Stormvine plant strangely, allowing its whispy blue tendrils " +
"to 'hang' on the air. Anything caught in the vine is affected by this, and becomes disoriented.";
private static final String TXT_DESC =
"Gravity affects the Stormvine plant strangely, allowing its whispy blue tendrils " +
"to 'hang' on the air. Anything caught in the vine is affected by this, and becomes disoriented.";
{
image = 9;
plantName = "Stormvine";
}
{
image = 9;
plantName = "Stormvine";
}
@Override
public void activate() {
Char ch = Actor.findChar(pos);
@Override
public void activate() {
Char ch = Actor.findChar(pos);
if (ch != null) {
Buff.affect(ch, Vertigo.class, Vertigo.duration( ch ) );
}
}
if (ch != null) {
Buff.affect(ch, Vertigo.class, Vertigo.duration( ch ) );
}
}
@Override
public String desc() {
return TXT_DESC;
}
@Override
public String desc() {
return TXT_DESC;
}
public static class Seed extends Plant.Seed {
{
plantName = "Stormvine";
public static class Seed extends Plant.Seed {
{
plantName = "Stormvine";
name = "seed of " + plantName;
image = ItemSpriteSheet.SEED_STORMVINE;
name = "seed of " + plantName;
image = ItemSpriteSheet.SEED_STORMVINE;
plantClass = Stormvine.class;
alchemyClass = PotionOfLevitation.class;
}
plantClass = Stormvine.class;
alchemyClass = PotionOfLevitation.class;
}
@Override
public String desc() {
return TXT_DESC;
}
}
@Override
public String desc() {
return TXT_DESC;
}
}
}
@@ -67,7 +67,7 @@ public class Sungrass extends Plant {
plantClass = Sungrass.class;
alchemyClass = PotionOfHealing.class;
bones = true;
bones = true;
}
@Override
@@ -81,9 +81,9 @@ public class Sungrass extends Plant {
private static final float STEP = 1f;
private int pos;
private int healCurr = 1;
private int count = 0;
private int level;
private int healCurr = 1;
private int count = 0;
private int level;
{
type = buffType.POSITIVE;
@@ -96,38 +96,38 @@ public class Sungrass extends Plant {
}
@Override
public boolean act() {
if (target.pos != pos) {
detach();
}
if (count == 5) {
if (level <= healCurr*.025*target.HT) {
target.HP = Math.min(target.HT, target.HP + level);
target.sprite.emitter().burst(Speck.factory(Speck.HEALING), 1);
detach();
} else {
target.HP = Math.min(target.HT, target.HP+(int)(healCurr*.025*target.HT));
level -= (healCurr*.025*target.HT);
if (healCurr < 6)
healCurr ++;
target.sprite.emitter().burst(Speck.factory(Speck.HEALING), 1);
}
count = 1;
} else {
count++;
}
if (level <= 0)
detach();
spend( STEP );
return true;
}
public boolean act() {
if (target.pos != pos) {
detach();
}
if (count == 5) {
if (level <= healCurr*.025*target.HT) {
target.HP = Math.min(target.HT, target.HP + level);
target.sprite.emitter().burst(Speck.factory(Speck.HEALING), 1);
detach();
} else {
target.HP = Math.min(target.HT, target.HP+(int)(healCurr*.025*target.HT));
level -= (healCurr*.025*target.HT);
if (healCurr < 6)
healCurr ++;
target.sprite.emitter().burst(Speck.factory(Speck.HEALING), 1);
}
count = 1;
} else {
count++;
}
if (level <= 0)
detach();
spend( STEP );
return true;
}
public int absorb( int damage ) {
level -= damage;
if (level <= 0)
detach();
return damage;
}
public int absorb( int damage ) {
level -= damage;
if (level <= 0)
detach();
return damage;
}
public void boost( int amount ){
level += amount;
@@ -140,7 +140,7 @@ public class Sungrass extends Plant {
@Override
public String toString() {
return "Herbal Healing";
return "Herbal Healing";
}
@Override
@@ -154,26 +154,26 @@ public class Sungrass extends Plant {
}
private static final String POS = "pos";
private static final String HEALCURR = "healCurr";
private static final String COUNT = "count";
private static final String LEVEL = "level";
private static final String HEALCURR = "healCurr";
private static final String COUNT = "count";
private static final String LEVEL = "level";
@Override
@Override
public void storeInBundle( Bundle bundle ) {
super.storeInBundle( bundle );
bundle.put( POS, pos );
bundle.put( HEALCURR, healCurr);
bundle.put( COUNT, count);
bundle.put( LEVEL, level);
bundle.put( HEALCURR, healCurr);
bundle.put( COUNT, count);
bundle.put( LEVEL, level);
}
@Override
public void restoreFromBundle( Bundle bundle ) {
super.restoreFromBundle( bundle );
pos = bundle.getInt( POS );
healCurr = bundle.getInt( HEALCURR );
count = bundle.getInt( COUNT );
level = bundle.getInt( LEVEL );
healCurr = bundle.getInt( HEALCURR );
count = bundle.getInt( COUNT );
level = bundle.getInt( LEVEL );
}
}