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
@@ -39,38 +39,38 @@ public class Ring extends KindofMisc {
private static final float TIME_TO_EQUIP = 1f;
private static final String TXT_IDENTIFY =
private static final String TXT_IDENTIFY =
"you are now familiar enough with your %s to identify it. It is %s.";
protected Buff buff;
private static final Class<?>[] rings = {
RingOfAccuracy.class,
RingOfEvasion.class,
RingOfElements.class,
RingOfForce.class,
RingOfFuror.class,
RingOfHaste.class,
RingOfAccuracy.class,
RingOfEvasion.class,
RingOfElements.class,
RingOfForce.class,
RingOfFuror.class,
RingOfHaste.class,
RingOfMagic.class,
RingOfMight.class,
RingOfSharpshooting.class,
RingOfTenacity.class,
RingOfWealth.class,
RingOfSharpshooting.class,
RingOfTenacity.class,
RingOfWealth.class,
};
private static final String[] gems =
private static final String[] gems =
{"diamond", "opal", "garnet", "ruby", "amethyst", "topaz", "onyx", "tourmaline", "emerald", "sapphire", "quartz", "agate"};
private static final Integer[] images = {
ItemSpriteSheet.RING_DIAMOND,
ItemSpriteSheet.RING_OPAL,
ItemSpriteSheet.RING_GARNET,
ItemSpriteSheet.RING_RUBY,
ItemSpriteSheet.RING_AMETHYST,
ItemSpriteSheet.RING_TOPAZ,
ItemSpriteSheet.RING_ONYX,
ItemSpriteSheet.RING_TOURMALINE,
ItemSpriteSheet.RING_EMERALD,
ItemSpriteSheet.RING_SAPPHIRE,
ItemSpriteSheet.RING_QUARTZ,
ItemSpriteSheet.RING_DIAMOND,
ItemSpriteSheet.RING_OPAL,
ItemSpriteSheet.RING_GARNET,
ItemSpriteSheet.RING_RUBY,
ItemSpriteSheet.RING_AMETHYST,
ItemSpriteSheet.RING_TOPAZ,
ItemSpriteSheet.RING_ONYX,
ItemSpriteSheet.RING_TOURMALINE,
ItemSpriteSheet.RING_EMERALD,
ItemSpriteSheet.RING_SAPPHIRE,
ItemSpriteSheet.RING_QUARTZ,
ItemSpriteSheet.RING_AGATE};
private static ItemStatusHandler<Ring> handler;
@@ -95,7 +95,7 @@ public class Ring extends KindofMisc {
public Ring() {
super();
syncVisuals();
syncVisuals();
}
public void syncVisuals() {
@@ -148,27 +148,27 @@ public class Ring extends KindofMisc {
buff.attachTo( ch );
}
@Override
public boolean doUnequip( Hero hero, boolean collect, boolean single ) {
if (super.doUnequip( hero, collect, single )) {
@Override
public boolean doUnequip( Hero hero, boolean collect, boolean single ) {
if (super.doUnequip( hero, collect, single )) {
if (hero.belongings.misc1 == this) {
hero.belongings.misc1 = null;
} else {
hero.belongings.misc2 = null;
}
if (hero.belongings.misc1 == this) {
hero.belongings.misc1 = null;
} else {
hero.belongings.misc2 = null;
}
hero.remove( buff );
buff = null;
hero.remove( buff );
buff = null;
return true;
return true;
} else {
} else {
return false;
return false;
}
}
}
}
@Override
public boolean isEquipped( Hero hero ) {
@@ -211,7 +211,7 @@ public class Ring extends KindofMisc {
@Override
public String desc() {
return
return
"This metal band is adorned with a large " + gem + " gem " +
"that glitters in the darkness. Who knows what effect it has when worn?";
}
@@ -220,7 +220,7 @@ public class Ring extends KindofMisc {
public String info() {
if (isEquipped( Dungeon.hero )) {
return desc() + "\n\n" + "The " + name() + " is on your finger" +
return desc() + "\n\n" + "The " + name() + " is on your finger" +
(cursed ? ", and because it is cursed, you are powerless to remove it." : "." );
} else if (cursed && cursedKnown) {
@@ -259,7 +259,7 @@ public class Ring extends KindofMisc {
level = -n;
cursed = true;
} else
level = n;
level = n;
return this;
}
@@ -309,7 +309,7 @@ public class Ring extends KindofMisc {
public class RingBuff extends Buff {
private static final String TXT_KNOWN = "This is a %s";
private static final String TXT_KNOWN = "This is a %s";
public int level;
public RingBuff() {
@@ -32,7 +32,7 @@ public class RingOfAccuracy extends Ring {
public String desc() {
return isKnown() ?
"This ring increases your focus, reducing your enemy's ability to dodge your attacks. "+
"A degraded ring will instead make you easier to evade.":
"A degraded ring will instead make you easier to evade.":
super.desc();
}
@@ -36,46 +36,46 @@ public class RingOfEvasion extends Ring {
public String desc() {
return isKnown() ?
"This ring obfuscates the true position of the wearer, making them harder to detect and attack. " +
"This ring is much stronger while the user remains undetected, and if the user is targeted the power of " +
"evasion will slowly fade away, remaining undetected will restore the ring's effectiveness. " +
"A degraded ring will instead make the user easier to detect and strike.":
"This ring is much stronger while the user remains undetected, and if the user is targeted the power of " +
"evasion will slowly fade away, remaining undetected will restore the ring's effectiveness. " +
"A degraded ring will instead make the user easier to detect and strike.":
super.desc();
}
//yup, the only ring in the game with logic inside of its class
//yup, the only ring in the game with logic inside of its class
public class Evasion extends RingBuff {
public int effectiveLevel;
private int pos;
public int effectiveLevel;
private int pos;
@Override
public boolean attachTo( Char target ) {
@Override
public boolean attachTo( Char target ) {
pos = target.pos;
effectiveLevel = Math.min(0, level);
return super.attachTo(target);
}
pos = target.pos;
effectiveLevel = Math.min(0, level);
return super.attachTo(target);
}
@Override
public boolean act() {
@Override
public boolean act() {
boolean seen = false;
boolean seen = false;
for (Mob enemy : Dungeon.level.mobs.toArray(new Mob[0])){
if (enemy.focusingHero()) {
seen = true;
break;
}
}
for (Mob enemy : Dungeon.level.mobs.toArray(new Mob[0])){
if (enemy.focusingHero()) {
seen = true;
break;
}
}
if (level < 1){
effectiveLevel = level;
} else if (seen) {
effectiveLevel = Math.max(effectiveLevel - 1, 0);
} else {
effectiveLevel = Math.min(effectiveLevel + 1, level);
}
if (level < 1){
effectiveLevel = level;
} else if (seen) {
effectiveLevel = Math.max(effectiveLevel - 1, 0);
} else {
effectiveLevel = Math.min(effectiveLevel + 1, level);
}
return super.act();
}
return super.act();
}
}
}
@@ -2,39 +2,36 @@ package com.shatteredpixel.shatteredpixeldungeon.items.rings;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
/**
* Created by debenhame on 10/09/2014.
*/
public class RingOfForce extends Ring {
{
name = "Ring of Force";
}
{
name = "Ring of Force";
}
@Override
protected RingBuff buff( ) {
return new Force();
}
@Override
protected RingBuff buff( ) {
return new Force();
}
@Override
public String desc() {
if (isKnown()){
String desc = "This ring enhances the force of the wearer's blows. " +
"This extra power is largely wasted when wielding weapons, " +
"but an unarmed attack will be made much stronger. " +
"A degraded ring will instead weaken the wearer's blows.\n\n" +
"When unarmed, at your current strength, ";
int str = Dungeon.hero.STR() - 8;
desc += levelKnown ?
"average damage with this ring is " + (str/2+level + (int)(str*0.5f*level) + str*2)/2 + " points per hit.":
"typical average damage with this ring is" + (str/2+1 + (int)(str*0.5f) + str*2)/2 + " points per hit.";
desc += " Wearing a second ring of force would enhance this.";
return desc;
} else
return super.desc();
}
@Override
public String desc() {
if (isKnown()){
String desc = "This ring enhances the force of the wearer's blows. " +
"This extra power is largely wasted when wielding weapons, " +
"but an unarmed attack will be made much stronger. " +
"A degraded ring will instead weaken the wearer's blows.\n\n" +
"When unarmed, at your current strength, ";
int str = Dungeon.hero.STR() - 8;
desc += levelKnown ?
"average damage with this ring is " + (str/2+level + (int)(str*0.5f*level) + str*2)/2 + " points per hit.":
"typical average damage with this ring is" + (str/2+1 + (int)(str*0.5f) + str*2)/2 + " points per hit.";
desc += " Wearing a second ring of force would enhance this.";
return desc;
} else
return super.desc();
}
public class Force extends RingBuff {
}
public class Force extends RingBuff {
}
}
@@ -1,28 +1,25 @@
package com.shatteredpixel.shatteredpixeldungeon.items.rings;
/**
* Created by debenhame on 10/09/2014.
*/
public class RingOfFuror extends Ring {
{
name = "Ring of Furor";
}
{
name = "Ring of Furor";
}
@Override
protected RingBuff buff( ) {
return new Furor();
}
@Override
protected RingBuff buff( ) {
return new Furor();
}
@Override
public String desc() {
return isKnown() ?
"This ring grants the wearer an inner fury, allowing them to attack more rapidly. " +
"This fury works best in large bursts, so slow weapons benefit far more than fast ones. " +
"A degraded ring will instead slow the wearer's speed of attack." :
super.desc();
}
@Override
public String desc() {
return isKnown() ?
"This ring grants the wearer an inner fury, allowing them to attack more rapidly. " +
"This fury works best in large bursts, so slow weapons benefit far more than fast ones. " +
"A degraded ring will instead slow the wearer's speed of attack." :
super.desc();
}
public class Furor extends RingBuff {
}
public class Furor extends RingBuff {
}
}
@@ -32,7 +32,7 @@ public class RingOfHaste extends Ring {
public String desc() {
return isKnown() ?
"This ring reduces the stress of movement on the wearer, allowing them to run " +
"at superhuman speeds. A degraded ring will instead weigh the wearer down.":
"at superhuman speeds. A degraded ring will instead weigh the wearer down.":
super.desc();
}
@@ -1,30 +1,27 @@
package com.shatteredpixel.shatteredpixeldungeon.items.rings;
/**
* Created by debenhame on 10/09/2014.
*/
public class RingOfMight extends Ring {
{
name = "Ring of Might";
}
{
name = "Ring of Might";
}
@Override
protected RingBuff buff( ) {
return new Might();
}
@Override
protected RingBuff buff( ) {
return new Might();
}
@Override
public String desc() {
return isKnown() ?
"This ring enhances the physical traits of the wearer, " +
"granting them greater physical strength and constitution. " +
"A degraded ring will weaken the wearer." :
super.desc();
}
@Override
public String desc() {
return isKnown() ?
"This ring enhances the physical traits of the wearer, " +
"granting them greater physical strength and constitution. " +
"A degraded ring will weaken the wearer." :
super.desc();
}
public class Might extends RingBuff {
}
public class Might extends RingBuff {
}
}
@@ -1,28 +1,25 @@
package com.shatteredpixel.shatteredpixeldungeon.items.rings;
/**
* Created by debenhame on 10/09/2014.
*/
public class RingOfSharpshooting extends Ring {
{
name = "Ring of Sharpshooting";
}
{
name = "Ring of Sharpshooting";
}
@Override
protected RingBuff buff( ) {
return new Aim();
}
@Override
protected RingBuff buff( ) {
return new Aim();
}
@Override
public String desc() {
return isKnown() ?
"This ring enhances the wearer's precision and aim, which will " +
"make all projectile weapons more accurate and durable. " +
"A degraded ring will have the opposite effect.":
super.desc();
}
@Override
public String desc() {
return isKnown() ?
"This ring enhances the wearer's precision and aim, which will " +
"make all projectile weapons more accurate and durable. " +
"A degraded ring will have the opposite effect.":
super.desc();
}
public class Aim extends RingBuff {
}
public class Aim extends RingBuff {
}
}
@@ -1,29 +1,26 @@
package com.shatteredpixel.shatteredpixeldungeon.items.rings;
/**
* Created by debenhame on 10/09/2014.
*/
public class RingOfTenacity extends Ring {
{
name = "Ring of Tenacity";
}
{
name = "Ring of Tenacity";
}
@Override
protected RingBuff buff( ) {
return new Tenacity();
}
@Override
protected RingBuff buff( ) {
return new Tenacity();
}
@Override
public String desc() {
return isKnown() ?
"When worn, this ring will allow the wearer to resist normally mortal strikes. " +
"The more injured the user is, the more resistant they will be to damage. " +
"A degraded ring will instead make it easier for enemies to execute the wearer." :
super.desc();
}
@Override
public String desc() {
return isKnown() ?
"When worn, this ring will allow the wearer to resist normally mortal strikes. " +
"The more injured the user is, the more resistant they will be to damage. " +
"A degraded ring will instead make it easier for enemies to execute the wearer." :
super.desc();
}
public class Tenacity extends RingBuff {
}
public class Tenacity extends RingBuff {
}
}
@@ -1,28 +1,25 @@
package com.shatteredpixel.shatteredpixeldungeon.items.rings;
/**
* Created by debenhame on 10/09/2014.
*/
public class RingOfWealth extends Ring {
{
name = "Ring of Wealth";
}
{
name = "Ring of Wealth";
}
@Override
protected RingBuff buff( ) {
return new Wealth();
}
@Override
protected RingBuff buff( ) {
return new Wealth();
}
@Override
public String desc() {
return isKnown() ?
"It's not clear what this ring does exactly, good luck may influence " +
"the life an an adventurer in many subtle ways. " +
"Naturally a degraded ring would give bad luck." :
super.desc();
}
@Override
public String desc() {
return isKnown() ?
"It's not clear what this ring does exactly, good luck may influence " +
"the life an an adventurer in many subtle ways. " +
"Naturally a degraded ring would give bad luck." :
super.desc();
}
public class Wealth extends RingBuff {
}
public class Wealth extends RingBuff {
}
}