v0.3.4: reworked rankings to store their cause instead of a result string

This commit is contained in:
Evan Debenham
2016-01-23 02:12:18 -05:00
committed by Evan Debenham
parent 0e2fbc05fb
commit ac967fad27
36 changed files with 79 additions and 65 deletions
@@ -153,15 +153,8 @@ public abstract class Char extends Actor {
if (!enemy.isAlive() && visibleFight) {
if (enemy == Dungeon.hero) {
if ( this instanceof Yog ) {
Dungeon.fail( Utils.format( ResultDescriptions.NAMED, name) );
} else if (properties().contains(Property.MINIBOSS) || properties().contains(Property.BOSS)) {
Dungeon.fail( Utils.format( ResultDescriptions.UNIQUE, name) );
} else {
Dungeon.fail( Utils.format( ResultDescriptions.MOB, Utils.indefinite( name )) );
}
GLog.n( Messages.get(Char.class, "kill", name) );
Dungeon.fail( getClass() );
GLog.n( Messages.get(Char.class, "kill", name) );
} else if (this == Dungeon.hero) {
GLog.i( Messages.get(Char.class, "defeat", enemy.name) );
@@ -72,7 +72,7 @@ public class ToxicGas extends Blob implements Hero.Doom {
Badges.validateDeathFromGas();
Dungeon.fail( ResultDescriptions.GAS );
Dungeon.fail( getClass() );
GLog.n( Messages.get(this, "ondeath") );
}
}
@@ -55,7 +55,7 @@ public class Bleeding extends Buff {
public void set( int level ) {
this.level = level;
};
}
@Override
public int icon() {
@@ -80,7 +80,7 @@ public class Bleeding extends Buff {
}
if (target == Dungeon.hero && !target.isAlive()) {
Dungeon.fail( ResultDescriptions.BLEEDING );
Dungeon.fail( getClass() );
GLog.n( Messages.get(this, "ondeath") );
}
@@ -170,7 +170,7 @@ public class Burning extends Buff implements Hero.Doom {
Badges.validateDeathFromFire();
Dungeon.fail( ResultDescriptions.BURNING );
Dungeon.fail( getClass() );
GLog.n( Messages.get(this, "ondeath") );
}
}
@@ -188,7 +188,7 @@ public class Hunger extends Buff implements Hero.Doom {
Badges.validateDeathFromHunger();
Dungeon.fail( ResultDescriptions.HUNGER );
Dungeon.fail( getClass() );
GLog.n( Messages.get(this, "ondeath") );
}
}
@@ -62,7 +62,7 @@ public class Ooze extends Buff {
else if (Random.Int(2) == 0)
target.damage( 1, this );
if (!target.isAlive() && target == Dungeon.hero) {
Dungeon.fail( ResultDescriptions.OOZE );
Dungeon.fail( getClass() );
GLog.n( Messages.get(this, "ondeath") );
}
spend( TICK );
@@ -58,7 +58,7 @@ public class Poison extends Buff implements Hero.Doom {
public void set( float duration ) {
this.left = duration;
};
}
@Override
public int icon() {
@@ -118,7 +118,7 @@ public class Poison extends Buff implements Hero.Doom {
public void onDeath() {
Badges.validateDeathFromPoison();
Dungeon.fail( ResultDescriptions.POISON );
Dungeon.fail( getClass() );
GLog.n( "You died from poison..." );
}
}
@@ -770,7 +770,7 @@ public class Hero extends Char {
GameScene.show( new WndMessage( Messages.get(this, "leave") ) );
ready();
} else {
Dungeon.win( ResultDescriptions.WIN );
Dungeon.win( Amulet.class );
Dungeon.deleteGame( Dungeon.hero.heroClass, true );
Game.switchScene( SurfaceScene.class );
}
@@ -128,7 +128,7 @@ public class Eye extends Mob {
}
if (!ch.isAlive() && ch == Dungeon.hero) {
Dungeon.fail( Utils.format( ResultDescriptions.MOB, Utils.indefinite( name ) ) );
Dungeon.fail( getClass() );
GLog.n( Messages.get(this, "deathgaze_kill") );
}
} else {
@@ -107,7 +107,7 @@ public class Shaman extends Mob implements Callback {
Camera.main.shake( 2, 0.3f );
if (!enemy.isAlive()) {
Dungeon.fail( Utils.format( ResultDescriptions.MOB, Utils.indefinite( name ) ) );
Dungeon.fail( getClass() );
GLog.n( Messages.get(this, "zap_kill") );
}
}
@@ -83,7 +83,7 @@ public class Skeleton extends Mob {
}
if (heroKilled) {
Dungeon.fail( Utils.format( ResultDescriptions.MOB, Utils.indefinite( name ) ) );
Dungeon.fail( getClass() );
GLog.n( Messages.get(this, "explo_kill") );
}
}
@@ -111,7 +111,7 @@ public class Warlock extends Mob implements Callback {
enemy.damage( dmg, this );
if (!enemy.isAlive() && enemy == Dungeon.hero) {
Dungeon.fail( Utils.format( ResultDescriptions.MOB, Utils.indefinite( name ) ) );
Dungeon.fail( getClass() );
GLog.n( Messages.get(this, "bolt_kill") );
}
} else {
@@ -346,7 +346,7 @@ public class Yog extends Mob {
enemy.sprite.flash();
if (!enemy.isAlive() && enemy == Dungeon.hero) {
Dungeon.fail( Utils.format( ResultDescriptions.UNIQUE, name ) );
Dungeon.fail( getClass() );
GLog.n( Messages.get(Char.class, "kill", name) );
}
return true;