v0.6.5: badge changes:

- removed rare monsters badges and unused tutorial badges
- added badges for 3 and 6 challenges
- adjusted 'death by glyph' badge
- fixed 'happy end' not showing in rankings
This commit is contained in:
Evan Debenham 2018-04-23 23:43:44 -04:00 committed by Evan Debenham
parent a5872b8771
commit bd43201e95
15 changed files with 77 additions and 145 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@ -21,12 +21,6 @@
package com.shatteredpixel.shatteredpixeldungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Acidic;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Albino;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Bandit;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Senior;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Shielded;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.Artifact;
import com.shatteredpixel.shatteredpixeldungeon.items.bags.MagicalHolster;
@ -43,6 +37,7 @@ import com.watabou.utils.FileUtils;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
@ -76,14 +71,14 @@ public class Badges {
BAG_BOUGHT_SCROLL_HOLDER,
BAG_BOUGHT_POTION_BANDOLIER,
BAG_BOUGHT_WAND_HOLSTER,
ALL_BAGS_BOUGHT( 58 ),
DEATH_FROM_FIRE( 24 ),
DEATH_FROM_POISON( 25 ),
DEATH_FROM_GAS( 26 ),
DEATH_FROM_HUNGER( 27 ),
DEATH_FROM_GLYPH( 57 ),
DEATH_FROM_FALLING( 59 ),
YASD( 34, true ),
ALL_BAGS_BOUGHT( 24 ),
DEATH_FROM_FIRE( 25 ),
DEATH_FROM_POISON( 26 ),
DEATH_FROM_GAS( 27 ),
DEATH_FROM_HUNGER( 28 ),
DEATH_FROM_GLYPH( 29 ),
DEATH_FROM_FALLING( 30 ),
YASD( 31, true ),
BOSS_SLAIN_1_WARRIOR,
BOSS_SLAIN_1_MAGE,
BOSS_SLAIN_1_ROGUE,
@ -102,6 +97,16 @@ public class Badges {
BOSS_SLAIN_3_SNIPER,
BOSS_SLAIN_3_WARDEN,
BOSS_SLAIN_3_ALL_SUBCLASSES( 33, true ),
VICTORY_WARRIOR,
VICTORY_MAGE,
VICTORY_ROGUE,
VICTORY_HUNTRESS,
VICTORY( 34 ),
VICTORY_ALL_CLASSES( 35, true ),
HAPPY_END( 36 ),
CHAMPION_1( 37, true ),
CHAMPION_2( 39, true ),
CHAMPION_3( 38, true ),
STRENGTH_ATTAINED_1( 40 ),
STRENGTH_ATTAINED_2( 41 ),
STRENGTH_ATTAINED_3( 42 ),
@ -118,34 +123,18 @@ public class Badges {
ITEM_LEVEL_2( 49 ),
ITEM_LEVEL_3( 50 ),
ITEM_LEVEL_4( 51 ),
RARE_ALBINO,
RARE_BANDIT,
RARE_SHIELDED,
RARE_SENIOR,
RARE_ACIDIC,
RARE( 37, true ),
TUTORIAL_WARRIOR,
TUTORIAL_MAGE,
VICTORY_WARRIOR,
VICTORY_MAGE,
VICTORY_ROGUE,
VICTORY_HUNTRESS,
VICTORY( 31 ),
VICTORY_ALL_CLASSES( 36, true ),
MASTERY_COMBO( 56 ),
POTIONS_COOKED_1( 52 ),
POTIONS_COOKED_2( 53 ),
POTIONS_COOKED_3( 54 ),
POTIONS_COOKED_4( 55 ),
NO_MONSTERS_SLAIN( 28 ),
GRIM_WEAPON( 29 ),
PIRANHAS( 30 ),
MASTERY_COMBO( 56 ),
NO_MONSTERS_SLAIN( 57 ),
GRIM_WEAPON( 58 ),
PIRANHAS( 59 ),
GAMES_PLAYED_1( 60, true ),
GAMES_PLAYED_2( 61, true ),
GAMES_PLAYED_3( 62, true ),
GAMES_PLAYED_4( 63, true ),
HAPPY_END( 38 ),
CHAMPION( 39, true );
GAMES_PLAYED_4( 63, true );
public boolean meta;
@ -184,6 +173,16 @@ public class Badges {
public static final String BADGES_FILE = "badges.dat";
private static final String BADGES = "badges";
private static final HashSet<String> removedBadges = new HashSet<>();
static{
//removed in 0.6.1
removedBadges.add("NIGHT_HUNTER");
//removed in 0.6.5
removedBadges.addAll(Arrays.asList("RARE_ALBINO", "RARE_BANDIT", "RARE_SHIELDED",
"RARE_SENIOR", "RARE_ACIDIC", "RARE", "TUTORIAL_WARRIOR", "TUTORIAL_MAGE"));
}
private static HashSet<Badge> restore( Bundle bundle ) {
HashSet<Badge> badges = new HashSet<Badge>();
if (bundle == null) return badges;
@ -191,7 +190,9 @@ public class Badges {
String[] names = bundle.getStringArray( BADGES );
for (int i=0; i < names.length; i++) {
try {
badges.add( Badge.valueOf( names[i] ) );
if (!removedBadges.contains(names[i])){
badges.add( Badge.valueOf( names[i] ) );
}
} catch (Exception e) {
ShatteredPixelDungeon.reportException(e);
}
@ -685,36 +686,6 @@ public class Badges {
}
}
public static void validateRare( Mob mob ) {
Badge badge = null;
if (mob instanceof Albino) {
badge = Badge.RARE_ALBINO;
} else if (mob instanceof Bandit) {
badge = Badge.RARE_BANDIT;
} else if (mob instanceof Shielded) {
badge = Badge.RARE_SHIELDED;
} else if (mob instanceof Senior) {
badge = Badge.RARE_SENIOR;
} else if (mob instanceof Acidic) {
badge = Badge.RARE_ACIDIC;
}
if (!global.contains( badge )) {
global.add( badge );
saveNeeded = true;
}
if (global.contains( Badge.RARE_ALBINO ) &&
global.contains( Badge.RARE_BANDIT ) &&
global.contains( Badge.RARE_SHIELDED ) &&
global.contains( Badge.RARE_SENIOR ) &&
global.contains( Badge.RARE_ACIDIC )) {
badge = Badge.RARE;
displayBadge( badge );
}
}
public static void validateVictory() {
Badge badge = Badge.VICTORY;
@ -750,28 +721,6 @@ public class Badges {
}
}
public static void validateTutorial(){
Badge badge = null;
switch (Dungeon.hero.heroClass){
case WARRIOR:
badge = Badge.TUTORIAL_WARRIOR;
break;
case MAGE:
badge = Badge.TUTORIAL_MAGE;
break;
default:
break;
}
if (badge != null) {
local.add(badge);
if (!global.contains(badge)) {
global.add(badge);
saveNeeded = true;
}
}
}
public static void validateNoKilling() {
if (!local.contains( Badge.NO_MONSTERS_SLAIN ) && Statistics.completedWithNoKilling) {
Badge badge = Badge.NO_MONSTERS_SLAIN;
@ -806,12 +755,29 @@ public class Badges {
displayBadge( badge );
}
//necessary in order to display the happy end badge in the surface scene
public static void silentValidateHappyEnd() {
if (!local.contains( Badge.HAPPY_END )){
local.add( Badge.HAPPY_END );
}
}
public static void validateHappyEnd() {
displayBadge( Badge.HAPPY_END );
}
public static void validateChampion() {
displayBadge(Badge.CHAMPION);
public static void validateChampion( int challenges ) {
Badge badge = null;
if (challenges >= 1) {
badge = Badge.CHAMPION_1;
}
if (challenges >= 3){
badge = Badge.CHAMPION_2;
}
if (challenges >= 6){
badge = Badge.CHAMPION_3;
}
displayBadge( badge );
}
private static void displayBadge( Badge badge ) {
@ -884,7 +850,8 @@ public class Badges {
leaveBest( filtered, Badge.ALL_POTIONS_IDENTIFIED, Badge.ALL_ITEMS_IDENTIFIED );
leaveBest( filtered, Badge.ALL_SCROLLS_IDENTIFIED, Badge.ALL_ITEMS_IDENTIFIED );
leaveBest( filtered, Badge.GAMES_PLAYED_1, Badge.GAMES_PLAYED_2, Badge.GAMES_PLAYED_3, Badge.GAMES_PLAYED_4 );
leaveBest( filtered, Badge.CHAMPION_1, Badge.CHAMPION_2, Badge.CHAMPION_3 );
ArrayList<Badge> list = new ArrayList<Badge>( filtered );
Collections.sort( list );

View File

@ -682,8 +682,13 @@ public class Dungeon {
hero.belongings.identify();
if (challenges != 0) {
Badges.validateChampion();
int chCount = 0;
for (int ch : Challenges.MASKS){
if ((challenges & ch) != 0) chCount++;
}
if (chCount != 0) {
Badges.validateChampion(chCount);
}
Rankings.INSTANCE.submit( true, cause );

View File

@ -839,6 +839,7 @@ public class Hero extends Char {
} else {
Dungeon.win( Amulet.class );
Dungeon.deleteGame( GamesInProgress.curSlot, true );
Badges.silentValidateHappyEnd();
Game.switchScene( SurfaceScene.class );
}

View File

@ -21,7 +21,6 @@
package com.shatteredpixel.shatteredpixeldungeon.actors.mobs;
import com.shatteredpixel.shatteredpixeldungeon.Badges;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
@ -52,9 +51,4 @@ public class Acidic extends Scorpio {
return super.defenseProc( enemy, damage );
}
@Override
public void die( Object cause ) {
super.die( cause );
Badges.validateRare( this );
}
}

View File

@ -21,7 +21,6 @@
package com.shatteredpixel.shatteredpixeldungeon.actors.mobs;
import com.shatteredpixel.shatteredpixeldungeon.Badges;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Bleeding;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
@ -36,12 +35,6 @@ public class Albino extends Rat {
HP = HT = 15;
}
@Override
public void die( Object cause ) {
super.die( cause );
Badges.validateRare( this );
}
@Override
public int attackProc( Char enemy, int damage ) {
damage = super.attackProc( enemy, damage );

View File

@ -21,7 +21,6 @@
package com.shatteredpixel.shatteredpixeldungeon.actors.mobs;
import com.shatteredpixel.shatteredpixeldungeon.Badges;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Blindness;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
@ -58,9 +57,4 @@ public class Bandit extends Thief {
}
}
@Override
public void die( Object cause ) {
super.die( cause );
Badges.validateRare( this );
}
}

View File

@ -21,7 +21,6 @@
package com.shatteredpixel.shatteredpixeldungeon.actors.mobs;
import com.shatteredpixel.shatteredpixeldungeon.Badges;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Paralysis;
@ -48,9 +47,4 @@ public class Senior extends Monk {
return super.attackProc( enemy, damage );
}
@Override
public void die( Object cause ) {
super.die( cause );
Badges.validateRare( this );
}
}

View File

@ -21,7 +21,6 @@
package com.shatteredpixel.shatteredpixeldungeon.actors.mobs;
import com.shatteredpixel.shatteredpixeldungeon.Badges;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ShieldedSprite;
import com.watabou.utils.Random;
@ -38,9 +37,4 @@ public class Shielded extends Brute {
return Random.NormalIntRange(0, 10);
}
@Override
public void die( Object cause ) {
super.die( cause );
Badges.validateRare( this );
}
}

View File

@ -22,7 +22,6 @@
package com.shatteredpixel.shatteredpixeldungeon.items;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Badges;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
@ -95,7 +94,6 @@ public class BrokenSeal extends Item {
Sample.INSTANCE.play(Assets.SND_UNLOCK);
armor.affixSeal((BrokenSeal)curItem);
curItem.detach(Dungeon.hero.belongings.backpack);
Badges.validateTutorial();
}
}
}

View File

@ -567,20 +567,6 @@ public class Armor extends EquipableItem {
public abstract ItemSprite.Glowing glowing();
public boolean checkOwner( Char owner ) {
if (!owner.isAlive() && owner instanceof Hero) {
Dungeon.fail( getClass() );
GLog.n( Messages.get(this, "killed", name()) );
Badges.validateDeathFromGlyph();
return true;
} else {
return false;
}
}
@SuppressWarnings("unchecked")
public static Glyph random() {
try {

View File

@ -353,7 +353,6 @@ public class MagesStaff extends MeleeWeapon {
Dungeon.quickslot.clearItem(wand);
wand.detach(curUser.belongings.backpack);
Badges.validateTutorial();
GLog.p( Messages.get(MagesStaff.class, "imbue", wand.name()));
imbueWand( wand, curUser );

View File

@ -102,7 +102,7 @@ public class Chasm {
//The lower the hero's HP, the more bleed and the less upfront damage.
//Hero has a 50% chance to bleed out at 66% HP, and begins to risk instant-death at 25%
Buff.affect( hero, Bleeding.class).set( Math.round(hero.HT / (6f + (6f*(hero.HP/(float)hero.HT)))));
Buff.affect( hero, FallBleed.class).set( Math.round(hero.HT / (6f + (6f*(hero.HP/(float)hero.HT)))));
hero.damage( Math.max( hero.HP / 2, Random.NormalIntRange( hero.HP / 2, hero.HT / 4 )), new Hero.Doom() {
@Override
public void onDeath() {
@ -133,4 +133,12 @@ public class Chasm {
return true;
}
}
public static class FallBleed extends Bleeding implements Hero.Doom{
@Override
public void onDeath() {
Badges.validateDeathFromFalling();
}
}
}

View File

@ -75,7 +75,7 @@ public class BadgesScene extends PixelScene {
List<Badges.Badge> badges = Badges.filtered( true );
int blankBadges = 34;
int blankBadges = 33;
blankBadges -= badges.size();
if (badges.contains(Badges.Badge.ALL_ITEMS_IDENTIFIED)) blankBadges -= 6;
if (badges.contains(Badges.Badge.YASD)) blankBadges -= 5;

View File

@ -26,7 +26,7 @@ badges$badge.death_from_fire=Death from fire
badges$badge.death_from_poison=Death from poison
badges$badge.death_from_gas=Death from toxic gas
badges$badge.death_from_hunger=Death from hunger
badges$badge.death_from_glyph=Death from a glyph
badges$badge.death_from_glyph=Death from deferred damage
badges$badge.death_from_falling=Death from falling down
badges$badge.yasd=Death from fire, poison, toxic gas, hunger, glyph, and falling
badges$badge.boss_slain_1=1st boss slain
@ -47,7 +47,6 @@ badges$badge.item_level_1=Item of level 3 acquired
badges$badge.item_level_2=Item of level 6 acquired
badges$badge.item_level_3=Item of level 9 acquired
badges$badge.item_level_4=Item of level 12 acquired
badges$badge.rare=All rare monsters slain
badges$badge.victory=Amulet of Yendor obtained
badges$badge.victory_all_classes=Amulet of Yendor obtained by Warrior, Mage, Rogue & Huntress
badges$badge.mastery_combo=10-hit combo