From 872199b43ef5a5020dfe596002aee1ba21c5d6a6 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sat, 3 Jan 2015 21:55:40 -0500 Subject: [PATCH] v0.2.3: improvements to the rankings page --- assets/icons.png | Bin 3731 -> 3997 bytes .../shatteredpixeldungeon/Rankings.java | 31 ++++++++++- .../ResultDescriptions.java | 26 +++++----- .../shatteredpixeldungeon/actors/Char.java | 7 ++- .../actors/blobs/ToxicGas.java | 2 +- .../actors/buffs/Bleeding.java | 2 +- .../actors/buffs/Burning.java | 2 +- .../actors/buffs/Hunger.java | 2 +- .../actors/buffs/Ooze.java | 2 +- .../actors/buffs/Poison.java | 2 +- .../actors/mobs/Eye.java | 2 +- .../actors/mobs/Shaman.java | 3 +- .../actors/mobs/Skeleton.java | 2 +- .../actors/mobs/Warlock.java | 3 +- .../actors/mobs/Yog.java | 2 +- .../items/armor/glyphs/Viscosity.java | 2 +- .../items/artifacts/ChaliceOfBlood.java | 2 +- .../items/scrolls/ScrollOfPsionicBlast.java | 2 +- .../items/wands/WandOfAvalanche.java | 2 +- .../items/wands/WandOfFirebolt.java | 2 +- .../items/wands/WandOfLightning.java | 2 +- .../items/wands/WandOfMagicMissile.java | 2 +- .../levels/features/Chasm.java | 2 +- .../levels/traps/LightningTrap.java | 2 +- .../scenes/RankingsScene.java | 49 ++++++++++++++++-- .../shatteredpixeldungeon/ui/Icons.java | 4 ++ 26 files changed, 115 insertions(+), 44 deletions(-) diff --git a/assets/icons.png b/assets/icons.png index d6391c12287bf37956f913820716d7f06affb539..7865e0d716a072071957cd0368cdfe6ec671d01d 100644 GIT binary patch delta 3993 zcmV;K4`%R_9i1PLDu4d~{{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G` z2j2k%0W$~ob08T201qljL_t(|+U;C@a1`Yoe%^3Off8teBpe`9m_&hEDv3@(A|H-A z#hhO=Er^GW67F>32pajQM1cZMV~qkO%AHW6oPpR{K9Ugx34eqjP`tz%$p?3nXhbf_ z5fn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Y7LN>_*+>5;A6)cJxMj}ruHMACuJwxm&l!KI#K}uqCJ5ATJ1}b z&&QnmX5iS76Mjh&CI8?b1RYH=oX9zY8EeM*wXcx~?Q*{iLgCr7W25y;n#*LS0I{VY zw{v*lw0}{3k^c{?4Nn;jlGm0WJBiyS>m(zAFY;$E_y}bOr0;F^ixaT*360-Kpz&Vv zNfm$IUj}u<1wgA-e}5p8&(FzHB5*nyL<_f>bEd=TXv8w3fwFC1_B|qaK-B&!+cm%T zcUnD?8m{mk`gT0e^nSPM0uIAOyLXz2GC1{jCYJU!34M zaHo+=1N>gcYX*%#2vVznpCb5?Ea0b}mKhC{RoRxj0)dw@5jcHOKSJpwQc5k=Ri9V_As{6w*}`5o+T|&w7WU$iA2fDa zZNx)vBTVV3=<4di_3K@JuaiU0jj$h~l>C}6k0AG@or)(aB`Mi*pDw)T_Z~N9qE$@Q6L;5SG6MzgVKA;PXR%pA?~Dg&TmN$nPurgg^|SJQq3e{u@7x01I(yo^6o7H*Lw|pwg*$U;;m%wtV-0RhNlK=7{%SHE3=LJGd1LhPl6CF= zck}7~ck|V_kB|pf1lCnIptYr)E0_xRzHb6x>3;VMHNw7{%d@cO2ap29`T&8fy>IfQ z8~e$9gb~KTi2#a0DHVN!maz668)xtR&zdA@U_Xbjs04J69-;I50DngpPQM0VkiWr> z#)~jjRS`yhOH1$n<#V}QRIAkzj{HO~sZr1I{w9KjZ$s82;X@;VJ$l$eMFgw}9OP)c z=y!0-<)J;>EiKSyHuVsnJ%QV{+wC+dDXI75WcBaK`0;{uvzKO-LKY5H903{CInw`jru3K{Xt>sdV@hJBBP=Ps1O rJ`K-87-57FMi^m)5k?q48T=pVMLd>t3>3=%0000 records; public int lastRecord; public int totalNumber; + + private boolean saveNeeded = false; public void submit( boolean win ) { @@ -54,6 +56,8 @@ public enum Rankings { rec.win = win; rec.heroClass = Dungeon.hero.heroClass; rec.armorTier = Dungeon.hero.tier(); + rec.herolevel = Dungeon.hero.lvl; + rec.depth = Dungeon.depth; rec.score = score( win ); String gameFile = Utils.format( DETAILS_FILE, SystemTime.now ); @@ -138,7 +142,7 @@ public enum Rankings { if (totalNumber == 0) { totalNumber = records.size(); } - + } catch (IOException e) { } } @@ -149,6 +153,8 @@ public enum Rankings { private static final String WIN = "win"; private static final String SCORE = "score"; private static final String TIER = "tier"; + private static final String LEVEL = "level"; + private static final String DEPTH = "depth"; private static final String GAME = "gameFile"; public String info; @@ -156,6 +162,8 @@ public enum Rankings { public HeroClass heroClass; public int armorTier; + public int herolevel; //not currently used, but I may want this here in the future. + public int depth; public int score; @@ -172,6 +180,25 @@ public enum Rankings { armorTier = bundle.getInt( TIER ); gameFile = bundle.getString( GAME ); + + //for pre 0.2.3 saves + if (!bundle.contains(LEVEL)){ + try { + depth = Integer.parseInt(info.replaceAll("[\\D]", "")); + } catch (Exception e) { + depth = 0; + } + info = info.split("on level")[0].trim(); + try { + Dungeon.loadGame(gameFile); + herolevel = Dungeon.hero.lvl; + } catch (Exception e){ + herolevel = 0; + } + } else { + depth = bundle.getInt( DEPTH ); + herolevel = bundle.getInt( LEVEL ); + } } @Override @@ -183,6 +210,8 @@ public enum Rankings { heroClass.storeInBundle( bundle ); bundle.put( TIER, armorTier ); + bundle.put( LEVEL, herolevel ); + bundle.put( DEPTH, depth ); bundle.put( GAME, gameFile ); } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/ResultDescriptions.java b/src/com/shatteredpixel/shatteredpixeldungeon/ResultDescriptions.java index 4fa23b4af..4e7a129a6 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/ResultDescriptions.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/ResultDescriptions.java @@ -20,25 +20,25 @@ package com.shatteredpixel.shatteredpixeldungeon; public class ResultDescriptions { // Mobs - public static final String MOB = "Killed by %s on level %d"; - public static final String UNIQUE = "Killed by the %s on level %d"; - public static final String NAMED = "Killed by %s on level %d"; + public static final String MOB = "Killed by %s"; + public static final String UNIQUE = "Killed by the %s"; + public static final String NAMED = "Killed by %s"; // Items - public static final String ITEM = "Killed by your own %s on level %d"; - public static final String GLYPH = "Killed by the %s on level %d"; + public static final String ITEM = "Killed by your own %s"; + public static final String GLYPH = "Killed by the %s"; // Dungeon features - public static final String TRAP = "Killed by a %s on level %d"; + public static final String TRAP = "Killed by a %s"; // Debuffs & blobs - public static final String BURNING = "Burned to death on level %d"; - public static final String HUNGER = "Starved to death on level %d"; - public static final String POISON = "Died from poison on level %d"; - public static final String GAS = "Died from toxic gas on level %d"; - public static final String BLEEDING = "Bled to death on level %d"; - public static final String OOZE = "Corroded to death on level %d"; - public static final String FALL = "Fell to death on level %d"; + public static final String BURNING = "Burned to Ash"; + public static final String HUNGER = "Starved to Death"; + public static final String POISON = "Succumbed to Poison"; + public static final String GAS = "Asphyxiated"; + public static final String BLEEDING = "Bled to Death"; + public static final String OOZE = "Melted Away"; + public static final String FALL = "Died on Impact"; public static final String WIN = "Obtained the Amulet of Yendor"; } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java index 97846e22f..ed8cb0d79 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java @@ -159,12 +159,11 @@ public abstract class Char extends Actor { } else { if ( this instanceof Yog ) { - Dungeon.fail( Utils.format( ResultDescriptions.NAMED, name, Dungeon.depth ) ); + Dungeon.fail( Utils.format( ResultDescriptions.NAMED, name) ); } if (Bestiary.isUnique( this )) { - Dungeon.fail( Utils.format( ResultDescriptions.UNIQUE, name, Dungeon.depth ) ); + Dungeon.fail( Utils.format( ResultDescriptions.UNIQUE, name) ); } else { - Dungeon.fail( Utils.format( ResultDescriptions.MOB, - Utils.indefinite( name ), Dungeon.depth ) ); + Dungeon.fail( Utils.format( ResultDescriptions.MOB, Utils.indefinite( name )) ); } GLog.n( TXT_KILL, name ); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/ToxicGas.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/ToxicGas.java index 49e868d04..ccf8fdabe 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/ToxicGas.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/ToxicGas.java @@ -68,7 +68,7 @@ public class ToxicGas extends Blob implements Hero.Doom { Badges.validateDeathFromGas(); - Dungeon.fail( Utils.format( ResultDescriptions.GAS, Dungeon.depth ) ); + Dungeon.fail( ResultDescriptions.GAS ); GLog.n( "You died from a toxic gas.." ); } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Bleeding.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Bleeding.java index 4148b89f5..39a28fa33 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Bleeding.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Bleeding.java @@ -73,7 +73,7 @@ public class Bleeding extends Buff { } if (target == Dungeon.hero && !target.isAlive()) { - Dungeon.fail( Utils.format( ResultDescriptions.BLEEDING, Dungeon.depth ) ); + Dungeon.fail( ResultDescriptions.BLEEDING ); GLog.n( "You bled to death..." ); } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Burning.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Burning.java index 9c37e2543..fc58f33be 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Burning.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Burning.java @@ -148,7 +148,7 @@ public class Burning extends Buff implements Hero.Doom { Badges.validateDeathFromFire(); - Dungeon.fail( Utils.format( ResultDescriptions.BURNING, Dungeon.depth ) ); + Dungeon.fail( ResultDescriptions.BURNING ); GLog.n( TXT_BURNED_TO_DEATH ); } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Hunger.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Hunger.java index 64695eb05..3355ac010 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Hunger.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Hunger.java @@ -153,7 +153,7 @@ public class Hunger extends Buff implements Hero.Doom { Badges.validateDeathFromHunger(); - Dungeon.fail( Utils.format( ResultDescriptions.HUNGER, Dungeon.depth ) ); + Dungeon.fail( ResultDescriptions.HUNGER ); GLog.n( TXT_DEATH ); } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Ooze.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Ooze.java index 517ed3c59..b8811f885 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Ooze.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Ooze.java @@ -47,7 +47,7 @@ public class Ooze extends Buff { else if (Random.Int(2) == 0) target.damage( 1, this ); if (!target.isAlive() && target == Dungeon.hero) { - Dungeon.fail( Utils.format( ResultDescriptions.OOZE, Dungeon.depth ) ); + Dungeon.fail( ResultDescriptions.OOZE ); GLog.n( TXT_HERO_KILLED, toString() ); } spend( TICK ); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Poison.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Poison.java index 125002e1c..dbc9caaee 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Poison.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Poison.java @@ -90,7 +90,7 @@ public class Poison extends Buff implements Hero.Doom { public void onDeath() { Badges.validateDeathFromPoison(); - Dungeon.fail( Utils.format( ResultDescriptions.POISON, Dungeon.depth ) ); + Dungeon.fail( ResultDescriptions.POISON ); GLog.n( "You died from poison..." ); } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Eye.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Eye.java index d9a942ccb..9b7e3b248 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Eye.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Eye.java @@ -132,7 +132,7 @@ public class Eye extends Mob { } if (!ch.isAlive() && ch == Dungeon.hero) { - Dungeon.fail( Utils.format( ResultDescriptions.MOB, Utils.indefinite( name ), Dungeon.depth ) ); + Dungeon.fail( Utils.format( ResultDescriptions.MOB, Utils.indefinite( name ) ) ); GLog.n( TXT_DEATHGAZE_KILLED, name ); } } else { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Shaman.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Shaman.java index 278d91195..eb86f1577 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Shaman.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Shaman.java @@ -106,8 +106,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.depth ) ); + Dungeon.fail( Utils.format( ResultDescriptions.MOB, Utils.indefinite( name ) ) ); GLog.n( TXT_LIGHTNING_KILLED, name ); } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Skeleton.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Skeleton.java index eb860f236..c4c669531 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Skeleton.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Skeleton.java @@ -78,7 +78,7 @@ public class Skeleton extends Mob { } if (heroKilled) { - Dungeon.fail( Utils.format( ResultDescriptions.MOB, Utils.indefinite( name ), Dungeon.depth ) ); + Dungeon.fail( Utils.format( ResultDescriptions.MOB, Utils.indefinite( name ) ) ); GLog.n( TXT_HERO_KILLED ); } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Warlock.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Warlock.java index cba7a45f5..b3056eadb 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Warlock.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Warlock.java @@ -108,8 +108,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.depth ) ); + Dungeon.fail( Utils.format( ResultDescriptions.MOB, Utils.indefinite( name ) ) ); GLog.n( TXT_SHADOWBOLT_KILLED, name ); } } else { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Yog.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Yog.java index 8e2961858..8992a01b5 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Yog.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Yog.java @@ -335,7 +335,7 @@ public class Yog extends Mob { enemy.sprite.flash(); if (!enemy.isAlive() && enemy == Dungeon.hero) { - Dungeon.fail( Utils.format( ResultDescriptions.UNIQUE, name, Dungeon.depth ) ); + Dungeon.fail( Utils.format( ResultDescriptions.UNIQUE, name ) ); GLog.n( TXT_KILL, name ); } return true; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Viscosity.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Viscosity.java index 514b4af8d..379da5d0d 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Viscosity.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Viscosity.java @@ -127,7 +127,7 @@ public class Viscosity extends Glyph { if (target == Dungeon.hero && !target.isAlive()) { // FIXME Glyph glyph = new Viscosity(); - Dungeon.fail( Utils.format( ResultDescriptions.GLYPH, glyph.name(), Dungeon.depth ) ); + Dungeon.fail( Utils.format( ResultDescriptions.GLYPH, glyph.name() ) ); GLog.n( "%s killed you...", glyph.name() ); Badges.validateDeathFromGlyph(); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/ChaliceOfBlood.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/ChaliceOfBlood.java index 74b597599..3825ce1b0 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/ChaliceOfBlood.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/ChaliceOfBlood.java @@ -107,7 +107,7 @@ public class ChaliceOfBlood extends Artifact { hero.damage(damage, this); if (!hero.isAlive()) { - Dungeon.fail(Utils.format(ResultDescriptions.ITEM, name, Dungeon.depth)); + Dungeon.fail(Utils.format( ResultDescriptions.ITEM, name )); GLog.n("The Chalice sucks your life essence dry..."); } else { upgrade(); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfPsionicBlast.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfPsionicBlast.java index 8ce33fd6e..053adf712 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfPsionicBlast.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfPsionicBlast.java @@ -64,7 +64,7 @@ public class ScrollOfPsionicBlast extends Scroll { curUser.spendAndNext( TIME_TO_READ ); if (!curUser.isAlive()) { - Dungeon.fail(Utils.format(ResultDescriptions.ITEM, name, Dungeon.depth)); + Dungeon.fail( Utils.format(ResultDescriptions.ITEM, name )); GLog.n("The Psionic Blast tears your mind apart..."); } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfAvalanche.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfAvalanche.java index 95dce7648..e413641c4 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfAvalanche.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfAvalanche.java @@ -81,7 +81,7 @@ public class WandOfAvalanche extends Wand { } if (!curUser.isAlive()) { - Dungeon.fail( Utils.format( ResultDescriptions.ITEM, name, Dungeon.depth ) ); + Dungeon.fail( Utils.format( ResultDescriptions.ITEM, name ) ); GLog.n( "You killed yourself with your own Wand of Avalanche..." ); } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFirebolt.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFirebolt.java index 80d5fcd96..e4fa2c054 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFirebolt.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFirebolt.java @@ -66,7 +66,7 @@ public class WandOfFirebolt extends Wand { ch.sprite.emitter().burst( FlameParticle.FACTORY, 5 ); if (ch == curUser && !ch.isAlive()) { - Dungeon.fail( Utils.format( ResultDescriptions.ITEM, name, Dungeon.depth ) ); + Dungeon.fail( Utils.format( ResultDescriptions.ITEM, name ) ); GLog.n( "You killed yourself with your own Wand of Firebolt..." ); } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfLightning.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfLightning.java index 8e9edbc6a..1f34e151f 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfLightning.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfLightning.java @@ -50,7 +50,7 @@ public class WandOfLightning extends Wand { protected void onZap( int cell ) { if (!curUser.isAlive()) { - Dungeon.fail( Utils.format( ResultDescriptions.ITEM, name, Dungeon.depth ) ); + Dungeon.fail( Utils.format( ResultDescriptions.ITEM, name ) ); GLog.n( "You killed yourself with your own Wand of Lightning..." ); } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfMagicMissile.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfMagicMissile.java index 5c5211fbe..4f0278226 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfMagicMissile.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfMagicMissile.java @@ -78,7 +78,7 @@ public class WandOfMagicMissile extends Wand { ch.sprite.burst( 0xFF99CCFF, level / 2 + 2 ); if (ch == curUser && !ch.isAlive()) { - Dungeon.fail( Utils.format( ResultDescriptions.ITEM, name, Dungeon.depth ) ); + Dungeon.fail( Utils.format( ResultDescriptions.ITEM, name ) ); GLog.n( "You killed yourself with your own Wand of Magic Missile..." ); } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/levels/features/Chasm.java b/src/com/shatteredpixel/shatteredpixeldungeon/levels/features/Chasm.java index 47d1b27bd..b44ee1468 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/levels/features/Chasm.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/levels/features/Chasm.java @@ -104,7 +104,7 @@ public class Chasm { public void onDeath() { Badges.validateDeathFromFalling(); - Dungeon.fail( Utils.format( ResultDescriptions.FALL, Dungeon.depth ) ); + Dungeon.fail( ResultDescriptions.FALL ); GLog.n( "You fell to death..." ); } } ); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/levels/traps/LightningTrap.java b/src/com/shatteredpixel/shatteredpixeldungeon/levels/traps/LightningTrap.java index 61091b1b7..9d5c20d14 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/levels/traps/LightningTrap.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/levels/traps/LightningTrap.java @@ -45,7 +45,7 @@ public class LightningTrap { Camera.main.shake( 2, 0.3f ); if (!ch.isAlive()) { - Dungeon.fail( Utils.format( ResultDescriptions.TRAP, name, Dungeon.depth ) ); + Dungeon.fail( Utils.format( ResultDescriptions.TRAP, name ) ); GLog.n( "You were killed by a discharge of a lightning trap..." ); } else { ((Hero)ch).belongings.charge( false ); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/scenes/RankingsScene.java b/src/com/shatteredpixel/shatteredpixeldungeon/scenes/RankingsScene.java index 4042f4b9d..821baca2c 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/scenes/RankingsScene.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/scenes/RankingsScene.java @@ -138,7 +138,10 @@ public class RankingsScene extends PixelScene { private Flare flare; private BitmapText position; private BitmapTextMultiline desc; + private Image steps; + private BitmapText depth; private Image classIcon; + private BitmapText level; public Record( int pos, boolean latest, Rankings.Record rec ) { super(); @@ -168,9 +171,29 @@ public class RankingsScene extends PixelScene { shield.view( ItemSpriteSheet.AMULET, null ); position.hardlight( TEXT_WIN[odd] ); desc.hardlight( TEXT_WIN[odd] ); + depth.hardlight( TEXT_WIN[odd] ); + level.hardlight( TEXT_WIN[odd] ); } else { position.hardlight( TEXT_LOSE[odd] ); desc.hardlight( TEXT_LOSE[odd] ); + depth.hardlight( TEXT_LOSE[odd] ); + level.hardlight( TEXT_LOSE[odd] ); + + if (rec.depth != 0){ + depth.text( Integer.toString(rec.depth) ); + depth.measure(); + steps.copy(Icons.DEPTH_LG.get()); + + add(steps); + add(depth); + } + + } + + if (rec.herolevel != 0){ + level.text( Integer.toString(rec.herolevel) ); + level.measure(); + add(level); } classIcon.copy( Icons.get( rec.heroClass ) ); @@ -185,13 +208,22 @@ public class RankingsScene extends PixelScene { add( shield ); position = new BitmapText( PixelScene.font1x ); + position.alpha(0.8f); add( position ); desc = createMultiline( 9 ); add( desc ); + + depth = new BitmapText( PixelScene.font1x ); + depth.alpha(0.8f); + + steps = new Image(); classIcon = new Image(); add( classIcon ); + + level = new BitmapText( PixelScene.font1x ); + level.alpha(0.8f); } @Override @@ -208,12 +240,21 @@ public class RankingsScene extends PixelScene { if (flare != null) { flare.point( shield.center() ); } - - classIcon.x = align( x + width - classIcon.width ); + + classIcon.x = align(x + width - classIcon.width); classIcon.y = shield.y; - + + level.x = align( classIcon.x + (classIcon.width - level.width()) / 2 ); + level.y = align( classIcon.y + (classIcon.height - level.height()) / 2 + 1 ); + + steps.x = align(x + width - steps.width - classIcon.width); + steps.y = shield.y; + + depth.x = align( steps.x + (steps.width - depth.width()) / 2 ); + depth.y = align( steps.y + (steps.height - depth.height()) / 2 + 1 ); + desc.x = shield.x + shield.width + GAP; - desc.maxWidth = (int)(classIcon.x - desc.x); + desc.maxWidth = (int)(steps.x - desc.x); desc.measure(); desc.y = align( shield.y + (shield.height - desc.height()) / 2 + 1 ); } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/ui/Icons.java b/src/com/shatteredpixel/shatteredpixeldungeon/ui/Icons.java index a3bddeb35..7620e8ccf 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/ui/Icons.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/ui/Icons.java @@ -39,6 +39,7 @@ public enum Icons { HUNTRESS, CLOSE, DEPTH, + DEPTH_LG, SLEEP, ALERT, BACKPACK, @@ -106,6 +107,9 @@ public enum Icons { case DEPTH: icon.frame( icon.texture.uvRect( 45, 12, 54, 20 ) ); break; + case DEPTH_LG: + icon.frame( icon.texture.uvRect( 34, 46, 50, 62 ) ); + break; case SLEEP: icon.frame( icon.texture.uvRect( 13, 45, 22, 53 ) ); break;