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
@@ -50,9 +50,9 @@ public class Potion extends Item {
private static final String TXT_BENEFICIAL = "Beneficial potion";
private static final String TXT_YES = "Yes, I know what I'm doing";
private static final String TXT_NO = "No, I changed my mind";
private static final String TXT_R_U_SURE_DRINK =
private static final String TXT_R_U_SURE_DRINK =
"Are you sure you want to drink it? In most cases you should throw such potions at your enemies.";
private static final String TXT_R_U_SURE_THROW =
private static final String TXT_R_U_SURE_THROW =
"Are you sure you want to throw it? In most cases it makes sense to drink it.";
private static final float TIME_TO_DRINK = 1f;
@@ -60,44 +60,44 @@ public class Potion extends Item {
protected String initials;
private static final Class<?>[] potions = {
PotionOfHealing.class,
PotionOfExperience.class,
PotionOfToxicGas.class,
PotionOfHealing.class,
PotionOfExperience.class,
PotionOfToxicGas.class,
PotionOfLiquidFlame.class,
PotionOfStrength.class,
PotionOfParalyticGas.class,
PotionOfLevitation.class,
PotionOfMindVision.class,
PotionOfMindVision.class,
PotionOfPurity.class,
PotionOfInvisibility.class,
PotionOfMight.class,
PotionOfFrost.class
};
private static final String[] colors = {
"turquoise", "crimson", "azure", "jade", "golden", "magenta",
"turquoise", "crimson", "azure", "jade", "golden", "magenta",
"charcoal", "ivory", "amber", "bistre", "indigo", "silver"};
private static final Integer[] images = {
ItemSpriteSheet.POTION_TURQUOISE,
ItemSpriteSheet.POTION_CRIMSON,
ItemSpriteSheet.POTION_AZURE,
ItemSpriteSheet.POTION_JADE,
ItemSpriteSheet.POTION_GOLDEN,
ItemSpriteSheet.POTION_MAGENTA,
ItemSpriteSheet.POTION_CHARCOAL,
ItemSpriteSheet.POTION_IVORY,
ItemSpriteSheet.POTION_AMBER,
ItemSpriteSheet.POTION_BISTRE,
ItemSpriteSheet.POTION_INDIGO,
ItemSpriteSheet.POTION_TURQUOISE,
ItemSpriteSheet.POTION_CRIMSON,
ItemSpriteSheet.POTION_AZURE,
ItemSpriteSheet.POTION_JADE,
ItemSpriteSheet.POTION_GOLDEN,
ItemSpriteSheet.POTION_MAGENTA,
ItemSpriteSheet.POTION_CHARCOAL,
ItemSpriteSheet.POTION_IVORY,
ItemSpriteSheet.POTION_AMBER,
ItemSpriteSheet.POTION_BISTRE,
ItemSpriteSheet.POTION_INDIGO,
ItemSpriteSheet.POTION_SILVER};
private static ItemStatusHandler<Potion> handler;
private String color;
public boolean ownedByFruit = false;
public boolean ownedByFruit = false;
{
stackable = true;
{
stackable = true;
defaultAction = AC_DRINK;
}
@@ -120,11 +120,11 @@ public class Potion extends Item {
syncVisuals();
}
@Override
public void syncVisuals(){
image = handler.image( this );
color = handler.label( this );
};
@Override
public void syncVisuals(){
image = handler.image( this );
color = handler.label( this );
};
@Override
public ArrayList<String> actions( Hero hero ) {
@@ -138,11 +138,11 @@ public class Potion extends Item {
if (action.equals( AC_DRINK )) {
if (isKnown() && (
this instanceof PotionOfLiquidFlame ||
this instanceof PotionOfToxicGas ||
this instanceof PotionOfLiquidFlame ||
this instanceof PotionOfToxicGas ||
this instanceof PotionOfParalyticGas)) {
GameScene.show(
GameScene.show(
new WndOptions( TXT_HARMFUL, TXT_R_U_SURE_DRINK, TXT_YES, TXT_NO ) {
@Override
protected void onSelect(int index) {
@@ -168,14 +168,14 @@ public class Potion extends Item {
public void doThrow( final Hero hero ) {
if (isKnown() && (
this instanceof PotionOfExperience ||
this instanceof PotionOfExperience ||
this instanceof PotionOfHealing ||
this instanceof PotionOfMindVision ||
this instanceof PotionOfStrength ||
this instanceof PotionOfInvisibility ||
this instanceof PotionOfInvisibility ||
this instanceof PotionOfMight)) {
GameScene.show(
GameScene.show(
new WndOptions( TXT_BENEFICIAL, TXT_R_U_SURE_THROW, TXT_YES, TXT_NO ) {
@Override
protected void onSelect(int index) {
@@ -229,23 +229,23 @@ public class Potion extends Item {
}
}
@Override
public void cast( final Hero user, int dst ) {
super.cast(user, dst);
}
@Override
public void cast( final Hero user, int dst ) {
super.cast(user, dst);
}
public boolean isKnown() {
return handler.isKnown( this );
}
public void setKnown() {
if (!ownedByFruit) {
if (!isKnown()) {
handler.know(this);
}
if (!ownedByFruit) {
if (!isKnown()) {
handler.know(this);
}
Badges.validateAllPotionsIdentified();
}
Badges.validateAllPotionsIdentified();
}
}
@Override
@@ -302,14 +302,14 @@ public class Potion extends Item {
final int color = ItemSprite.pick( image, 8, 10 );
Splash.at( cell, color, 5 );
Fire fire = (Fire)Dungeon.level.blobs.get( Fire.class );
if (fire != null)
fire.clear( cell );
Fire fire = (Fire)Dungeon.level.blobs.get( Fire.class );
if (fire != null)
fire.clear( cell );
Char ch = Actor.findChar(cell);
if (ch != null)
Buff.detach( ch, Burning.class );
}
Char ch = Actor.findChar(cell);
if (ch != null)
Buff.detach( ch, Burning.class );
}
@Override
public int price() {
@@ -25,7 +25,7 @@ public class PotionOfExperience extends Potion {
name = "Potion of Experience";
initials = "Ex";
bones = true;
bones = true;
}
@Override
@@ -59,10 +59,10 @@ public class PotionOfFrost extends Potion {
@Override
public String desc() {
return
return
"Upon exposure to open air this chemical will evaporate into a freezing cloud, causing " +
"any creature that contacts it to be frozen in place unable to act and move. " +
"The freezing effect is much stronger if the environment is wet.";
"The freezing effect is much stronger if the environment is wet.";
}
@Override
@@ -33,7 +33,7 @@ public class PotionOfHealing extends Potion {
name = "Potion of Healing";
initials = "He";
bones = true;
bones = true;
}
@Override
@@ -35,18 +35,18 @@ public class PotionOfLevitation extends Potion {
initials = "Le";
}
@Override
public void shatter( int cell ) {
@Override
public void shatter( int cell ) {
if (Dungeon.visible[cell]) {
setKnown();
if (Dungeon.visible[cell]) {
setKnown();
splash( cell );
Sample.INSTANCE.play( Assets.SND_SHATTER );
}
splash( cell );
Sample.INSTANCE.play( Assets.SND_SHATTER );
}
GameScene.add( Blob.seed( cell, 1000, ConfusionGas.class ) );
}
GameScene.add( Blob.seed( cell, 1000, ConfusionGas.class ) );
}
@Override
public void apply( Hero hero ) {
@@ -60,7 +60,7 @@ public class PotionOfLevitation extends Potion {
return
"Drinking this curious liquid will cause you to hover in the air, " +
"able to drift effortlessly over traps and pits. Throwing this potion " +
"will create a cloud of unrefined gas, disorienting anything caught in it.";
"will create a cloud of unrefined gas, disorienting anything caught in it.";
}
@Override
@@ -45,19 +45,19 @@ public class PotionOfLiquidFlame extends Potion {
Sample.INSTANCE.play( Assets.SND_SHATTER );
}
for (int offset : Level.NEIGHBOURS9){
if (Level.flamable[cell+offset]
|| Actor.findChar(cell+offset) != null
|| Dungeon.level.heaps.get(cell+offset) != null) {
for (int offset : Level.NEIGHBOURS9){
if (Level.flamable[cell+offset]
|| Actor.findChar(cell+offset) != null
|| Dungeon.level.heaps.get(cell+offset) != null) {
GameScene.add(Blob.seed(cell + offset, 2, Fire.class));
GameScene.add(Blob.seed(cell + offset, 2, Fire.class));
} else {
} else {
CellEmitter.get(cell+offset).burst(FlameParticle.FACTORY, 2);
CellEmitter.get(cell+offset).burst(FlameParticle.FACTORY, 2);
}
}
}
}
}
@Override
@@ -28,7 +28,7 @@ public class PotionOfMight extends PotionOfStrength {
name = "Potion of Might";
initials = "Mi";
bones = true;
bones = true;
}
@Override
@@ -41,7 +41,7 @@ public class PotionOfMight extends PotionOfStrength {
hero.sprite.showStatus( CharSprite.POSITIVE, "+1 str, +5 ht" );
GLog.p( "Newfound strength surges through your body." );
Badges.validateStrengthAttained();
Badges.validateStrengthAttained();
}
@Override
@@ -56,10 +56,10 @@ public class PotionOfPurity extends Potion {
boolean procd = false;
Blob[] blobs = {
Dungeon.level.blobs.get( ToxicGas.class ),
Dungeon.level.blobs.get( ToxicGas.class ),
Dungeon.level.blobs.get( ParalyticGas.class ),
Dungeon.level.blobs.get( ConfusionGas.class ),
Dungeon.level.blobs.get( StenchGas.class ),
Dungeon.level.blobs.get( ConfusionGas.class ),
Dungeon.level.blobs.get( StenchGas.class ),
Dungeon.level.blobs.get( VenomGas.class )
};
@@ -73,7 +73,7 @@ public class PotionOfPurity extends Potion {
for (int i=0; i < Level.LENGTH; i++) {
if (PathFinder.distance[i] < Integer.MAX_VALUE) {
int value = blob.cur[i];
int value = blob.cur[i];
if (value > 0) {
blob.cur[i] = 0;
@@ -125,7 +125,7 @@ public class PotionOfPurity extends Potion {
@Override
public String desc() {
return
return
"This reagent will quickly neutralize all harmful gases in the area of effect. " +
"Drinking it will give you a temporary immunity to such gases.";
}
@@ -28,7 +28,7 @@ public class PotionOfStrength extends Potion {
name = "Potion of Strength";
initials = "St";
bones = true;
bones = true;
}
@Override