v2.5.0: big expansion and some code improvements to catalogs

This commit is contained in:
Evan Debenham
2024-06-10 16:25:07 -04:00
parent 39209884f3
commit 6a313b1355
7 changed files with 309 additions and 130 deletions
@@ -1,10 +1,27 @@
journal.catalog.weapons.title=weapons
journal.catalog.melee_weapons.title=melee weapons
journal.catalog.armor.title=armor
journal.catalog.enchantments.title=enchantments and curses
journal.catalog.glyphs.title=glyphs and curses
journal.catalog.thrown_weapons.title=thrown weapons
journal.catalog.wands.title=wands
journal.catalog.rings.title=rings
journal.catalog.artifacts.title=artifacts
journal.catalog.trinkets.title=trinkets
journal.catalog.misc_equipment.title=misc. equipment
journal.catalog.potions.title=potions
journal.catalog.scrolls.title=scrolls
journal.catalog.seeds.title=seeds
journal.catalog.stones.title=runestones
journal.catalog.food.title=food
journal.catalog.exotic_potions.title=exotic potions
journal.catalog.exotic_scrolls.title=exotic scrolls
journal.catalog.bombs.title=bombs
journal.catalog.tipped_darts.title=tipped darts
journal.catalog.brews_elixirs.title=brews and elixirs
journal.catalog.spells.title=spells
journal.catalog.misc_consumables.title=misc. consumables
journal.document.adventurers_guide.title=Tome of Dungeon Mastery
journal.document.adventurers_guide.intro.title=Introduction
@@ -65,6 +65,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfToxicGas;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.brews.Brew;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.elixirs.Elixir;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.exotic.ExoticPotion;
import com.shatteredpixel.shatteredpixeldungeon.items.quest.Pickaxe;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.Ring;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfAccuracy;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfArcana;
@@ -181,6 +182,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.ThrowingSp
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.ThrowingStone;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.Tomahawk;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.Trident;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.darts.Dart;
import com.shatteredpixel.shatteredpixeldungeon.plants.Blindweed;
import com.shatteredpixel.shatteredpixeldungeon.plants.Earthroot;
import com.shatteredpixel.shatteredpixeldungeon.plants.Fadeleaf;
@@ -419,9 +421,10 @@ public class Generator {
Spear.class,
Quarterstaff.class,
Dirk.class,
Sickle.class
Sickle.class,
Pickaxe.class
};
WEP_T2.defaultProbs = new float[]{ 2, 2, 2, 2, 2, 2 };
WEP_T2.defaultProbs = new float[]{ 2, 2, 2, 2, 2, 2, 0 };
WEP_T2.probs = WEP_T2.defaultProbs.clone();
WEP_T3.classes = new Class<?>[]{
@@ -481,9 +484,10 @@ public class Generator {
MIS_T1.classes = new Class<?>[]{
ThrowingStone.class,
ThrowingKnife.class,
ThrowingSpike.class
ThrowingSpike.class,
Dart.class
};
MIS_T1.defaultProbs = new float[]{ 3, 3, 3 };
MIS_T1.defaultProbs = new float[]{ 3, 3, 3, 0 };
MIS_T1.probs = MIS_T1.defaultProbs.clone();
MIS_T2.classes = new Class<?>[]{
@@ -39,7 +39,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfToxicGas;
import com.watabou.utils.Reflection;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
public class ExoticPotion extends Potion {
@@ -47,44 +47,45 @@ public class ExoticPotion extends Potion {
//sprite = equivalent potion sprite but one row down
}
public static final HashMap<Class<?extends Potion>, Class<?extends ExoticPotion>> regToExo = new HashMap<>();
public static final HashMap<Class<?extends ExoticPotion>, Class<?extends Potion>> exoToReg = new HashMap<>();
public static final LinkedHashMap<Class<?extends Potion>, Class<?extends ExoticPotion>> regToExo = new LinkedHashMap<>();
public static final LinkedHashMap<Class<?extends ExoticPotion>, Class<?extends Potion>> exoToReg = new LinkedHashMap<>();
static{
regToExo.put(PotionOfHealing.class, PotionOfShielding.class);
exoToReg.put(PotionOfShielding.class, PotionOfHealing.class);
regToExo.put(PotionOfToxicGas.class, PotionOfCorrosiveGas.class);
exoToReg.put(PotionOfCorrosiveGas.class, PotionOfToxicGas.class);
regToExo.put(PotionOfStrength.class, PotionOfMastery.class);
exoToReg.put(PotionOfMastery.class, PotionOfStrength.class);
regToExo.put(PotionOfHealing.class, PotionOfShielding.class);
exoToReg.put(PotionOfShielding.class, PotionOfHealing.class);
regToExo.put(PotionOfMindVision.class, PotionOfMagicalSight.class);
exoToReg.put(PotionOfMagicalSight.class, PotionOfMindVision.class);
regToExo.put(PotionOfFrost.class, PotionOfSnapFreeze.class);
exoToReg.put(PotionOfSnapFreeze.class, PotionOfFrost.class);
regToExo.put(PotionOfHaste.class, PotionOfStamina.class);
exoToReg.put(PotionOfStamina.class, PotionOfHaste.class);
regToExo.put(PotionOfLiquidFlame.class, PotionOfDragonsBreath.class);
exoToReg.put(PotionOfDragonsBreath.class, PotionOfLiquidFlame.class);
regToExo.put(PotionOfToxicGas.class, PotionOfCorrosiveGas.class);
exoToReg.put(PotionOfCorrosiveGas.class, PotionOfToxicGas.class);
regToExo.put(PotionOfHaste.class, PotionOfStamina.class);
exoToReg.put(PotionOfStamina.class, PotionOfHaste.class);
regToExo.put(PotionOfInvisibility.class, PotionOfShroudingFog.class);
exoToReg.put(PotionOfShroudingFog.class, PotionOfInvisibility.class);
regToExo.put(PotionOfMindVision.class, PotionOfMagicalSight.class);
exoToReg.put(PotionOfMagicalSight.class, PotionOfMindVision.class);
regToExo.put(PotionOfLevitation.class, PotionOfStormClouds.class);
exoToReg.put(PotionOfStormClouds.class, PotionOfLevitation.class);
regToExo.put(PotionOfExperience.class, PotionOfDivineInspiration.class);
exoToReg.put(PotionOfDivineInspiration.class, PotionOfExperience.class);
regToExo.put(PotionOfPurity.class, PotionOfCleansing.class);
exoToReg.put(PotionOfCleansing.class, PotionOfPurity.class);
regToExo.put(PotionOfParalyticGas.class, PotionOfEarthenArmor.class);
exoToReg.put(PotionOfEarthenArmor.class, PotionOfParalyticGas.class);
regToExo.put(PotionOfPurity.class, PotionOfCleansing.class);
exoToReg.put(PotionOfCleansing.class, PotionOfPurity.class);
regToExo.put(PotionOfExperience.class, PotionOfDivineInspiration.class);
exoToReg.put(PotionOfDivineInspiration.class, PotionOfExperience.class);
}
@Override
@@ -39,46 +39,46 @@ import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade;
import com.watabou.utils.Reflection;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
public abstract class ExoticScroll extends Scroll {
public static final HashMap<Class<?extends Scroll>, Class<?extends ExoticScroll>> regToExo = new HashMap<>();
public static final HashMap<Class<?extends ExoticScroll>, Class<?extends Scroll>> exoToReg = new HashMap<>();
public static final LinkedHashMap<Class<?extends Scroll>, Class<?extends ExoticScroll>> regToExo = new LinkedHashMap<>();
public static final LinkedHashMap<Class<?extends ExoticScroll>, Class<?extends Scroll>> exoToReg = new LinkedHashMap<>();
static{
regToExo.put(ScrollOfUpgrade.class, ScrollOfEnchantment.class);
exoToReg.put(ScrollOfEnchantment.class, ScrollOfUpgrade.class);
regToExo.put(ScrollOfIdentify.class, ScrollOfDivination.class);
exoToReg.put(ScrollOfDivination.class, ScrollOfIdentify.class);
regToExo.put(ScrollOfUpgrade.class, ScrollOfEnchantment.class);
exoToReg.put(ScrollOfEnchantment.class, ScrollOfUpgrade.class);
regToExo.put(ScrollOfRemoveCurse.class, ScrollOfAntiMagic.class);
exoToReg.put(ScrollOfAntiMagic.class, ScrollOfRemoveCurse.class);
regToExo.put(ScrollOfLullaby.class, ScrollOfSirensSong.class);
exoToReg.put(ScrollOfSirensSong.class, ScrollOfLullaby.class);
regToExo.put(ScrollOfRage.class, ScrollOfChallenge.class);
exoToReg.put(ScrollOfChallenge.class, ScrollOfRage.class);
regToExo.put(ScrollOfTerror.class, ScrollOfDread.class);
exoToReg.put(ScrollOfDread.class, ScrollOfTerror.class);
regToExo.put(ScrollOfMirrorImage.class, ScrollOfPrismaticImage.class);
exoToReg.put(ScrollOfPrismaticImage.class, ScrollOfMirrorImage.class);
regToExo.put(ScrollOfRecharging.class, ScrollOfMysticalEnergy.class);
exoToReg.put(ScrollOfMysticalEnergy.class, ScrollOfRecharging.class);
regToExo.put(ScrollOfMagicMapping.class, ScrollOfForesight.class);
exoToReg.put(ScrollOfForesight.class, ScrollOfMagicMapping.class);
regToExo.put(ScrollOfTeleportation.class, ScrollOfPassage.class);
exoToReg.put(ScrollOfPassage.class, ScrollOfTeleportation.class);
regToExo.put(ScrollOfLullaby.class, ScrollOfSirensSong.class);
exoToReg.put(ScrollOfSirensSong.class, ScrollOfLullaby.class);
regToExo.put(ScrollOfMagicMapping.class, ScrollOfForesight.class);
exoToReg.put(ScrollOfForesight.class, ScrollOfMagicMapping.class);
regToExo.put(ScrollOfRage.class, ScrollOfChallenge.class);
exoToReg.put(ScrollOfChallenge.class, ScrollOfRage.class);
regToExo.put(ScrollOfRetribution.class, ScrollOfPsionicBlast.class);
exoToReg.put(ScrollOfPsionicBlast.class, ScrollOfRetribution.class);
regToExo.put(ScrollOfMirrorImage.class, ScrollOfPrismaticImage.class);
exoToReg.put(ScrollOfPrismaticImage.class, ScrollOfMirrorImage.class);
regToExo.put(ScrollOfTerror.class, ScrollOfDread.class);
exoToReg.put(ScrollOfDread.class, ScrollOfTerror.class);
regToExo.put(ScrollOfTransmutation.class, ScrollOfMetamorphosis.class);
exoToReg.put(ScrollOfMetamorphosis.class, ScrollOfTransmutation.class);
@@ -52,7 +52,7 @@ import com.shatteredpixel.shatteredpixeldungeon.windows.WndOptions;
import com.watabou.utils.Reflection;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
public abstract class TippedDart extends Dart {
@@ -199,20 +199,20 @@ public abstract class TippedDart extends Dart {
return 8 * quantity;
}
private static HashMap<Class<?extends Plant.Seed>, Class<?extends TippedDart>> types = new HashMap<>();
public static final LinkedHashMap<Class<?extends Plant.Seed>, Class<?extends TippedDart>> types = new LinkedHashMap<>();
static {
types.put(Blindweed.Seed.class, BlindingDart.class);
types.put(Mageroyal.Seed.class, CleansingDart.class);
types.put(Earthroot.Seed.class, ParalyticDart.class);
types.put(Fadeleaf.Seed.class, DisplacingDart.class);
types.put(Firebloom.Seed.class, IncendiaryDart.class);
types.put(Icecap.Seed.class, ChillingDart.class);
types.put(Rotberry.Seed.class, RotDart.class);
types.put(Sorrowmoss.Seed.class, PoisonDart.class);
types.put(Starflower.Seed.class, HolyDart.class);
types.put(Stormvine.Seed.class, ShockingDart.class);
types.put(Sungrass.Seed.class, HealingDart.class);
types.put(Fadeleaf.Seed.class, DisplacingDart.class);
types.put(Icecap.Seed.class, ChillingDart.class);
types.put(Firebloom.Seed.class, IncendiaryDart.class);
types.put(Sorrowmoss.Seed.class, PoisonDart.class);
types.put(Swiftthistle.Seed.class, AdrenalineDart.class);
types.put(Blindweed.Seed.class, BlindingDart.class);
types.put(Stormvine.Seed.class, ShockingDart.class);
types.put(Earthroot.Seed.class, ParalyticDart.class);
types.put(Mageroyal.Seed.class, CleansingDart.class);
types.put(Starflower.Seed.class, HolyDart.class);
}
public static TippedDart getTipped( Plant.Seed s, int quantity ){
@@ -22,8 +22,89 @@
package com.shatteredpixel.shatteredpixeldungeon.journal;
import com.shatteredpixel.shatteredpixeldungeon.Badges;
import com.shatteredpixel.shatteredpixeldungeon.items.Amulet;
import com.shatteredpixel.shatteredpixeldungeon.items.Ankh;
import com.shatteredpixel.shatteredpixeldungeon.items.ArcaneResin;
import com.shatteredpixel.shatteredpixeldungeon.items.Dewdrop;
import com.shatteredpixel.shatteredpixeldungeon.items.EnergyCrystal;
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
import com.shatteredpixel.shatteredpixeldungeon.items.Gold;
import com.shatteredpixel.shatteredpixeldungeon.items.Honeypot;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.KingsCrown;
import com.shatteredpixel.shatteredpixeldungeon.items.LiquidMetal;
import com.shatteredpixel.shatteredpixeldungeon.items.Stylus;
import com.shatteredpixel.shatteredpixeldungeon.items.TengusMask;
import com.shatteredpixel.shatteredpixeldungeon.items.Torch;
import com.shatteredpixel.shatteredpixeldungeon.items.Waterskin;
import com.shatteredpixel.shatteredpixeldungeon.items.bags.MagicalHolster;
import com.shatteredpixel.shatteredpixeldungeon.items.bags.PotionBandolier;
import com.shatteredpixel.shatteredpixeldungeon.items.bags.ScrollHolder;
import com.shatteredpixel.shatteredpixeldungeon.items.bags.VelvetPouch;
import com.shatteredpixel.shatteredpixeldungeon.items.bombs.ArcaneBomb;
import com.shatteredpixel.shatteredpixeldungeon.items.bombs.Bomb;
import com.shatteredpixel.shatteredpixeldungeon.items.bombs.Firebomb;
import com.shatteredpixel.shatteredpixeldungeon.items.bombs.Flashbang;
import com.shatteredpixel.shatteredpixeldungeon.items.bombs.FrostBomb;
import com.shatteredpixel.shatteredpixeldungeon.items.bombs.HolyBomb;
import com.shatteredpixel.shatteredpixeldungeon.items.bombs.Noisemaker;
import com.shatteredpixel.shatteredpixeldungeon.items.bombs.RegrowthBomb;
import com.shatteredpixel.shatteredpixeldungeon.items.bombs.ShockBomb;
import com.shatteredpixel.shatteredpixeldungeon.items.bombs.ShrapnelBomb;
import com.shatteredpixel.shatteredpixeldungeon.items.bombs.WoollyBomb;
import com.shatteredpixel.shatteredpixeldungeon.items.food.Berry;
import com.shatteredpixel.shatteredpixeldungeon.items.food.Blandfruit;
import com.shatteredpixel.shatteredpixeldungeon.items.food.ChargrilledMeat;
import com.shatteredpixel.shatteredpixeldungeon.items.food.Food;
import com.shatteredpixel.shatteredpixeldungeon.items.food.FrozenCarpaccio;
import com.shatteredpixel.shatteredpixeldungeon.items.food.MeatPie;
import com.shatteredpixel.shatteredpixeldungeon.items.food.MysteryMeat;
import com.shatteredpixel.shatteredpixeldungeon.items.food.Pasty;
import com.shatteredpixel.shatteredpixeldungeon.items.food.PhantomMeat;
import com.shatteredpixel.shatteredpixeldungeon.items.food.SmallRation;
import com.shatteredpixel.shatteredpixeldungeon.items.food.StewedMeat;
import com.shatteredpixel.shatteredpixeldungeon.items.food.SupplyRation;
import com.shatteredpixel.shatteredpixeldungeon.items.keys.CrystalKey;
import com.shatteredpixel.shatteredpixeldungeon.items.keys.GoldenKey;
import com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey;
import com.shatteredpixel.shatteredpixeldungeon.items.keys.SkeletonKey;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.brews.AquaBrew;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.brews.BlizzardBrew;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.brews.CausticBrew;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.brews.InfernalBrew;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.brews.ShockingBrew;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.brews.UnstableBrew;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.elixirs.ElixirOfAquaticRejuvenation;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.elixirs.ElixirOfArcaneArmor;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.elixirs.ElixirOfDragonsBlood;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.elixirs.ElixirOfFeatherFall;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.elixirs.ElixirOfHoneyedHealing;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.elixirs.ElixirOfIcyTouch;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.elixirs.ElixirOfMight;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.elixirs.ElixirOfToxicEssence;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.exotic.ExoticPotion;
import com.shatteredpixel.shatteredpixeldungeon.items.quest.GooBlob;
import com.shatteredpixel.shatteredpixeldungeon.items.quest.MetalShard;
import com.shatteredpixel.shatteredpixeldungeon.items.remains.BowFragment;
import com.shatteredpixel.shatteredpixeldungeon.items.remains.BrokenHilt;
import com.shatteredpixel.shatteredpixeldungeon.items.remains.BrokenStaff;
import com.shatteredpixel.shatteredpixeldungeon.items.remains.CloakScrap;
import com.shatteredpixel.shatteredpixeldungeon.items.remains.SealShard;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic.ExoticScroll;
import com.shatteredpixel.shatteredpixeldungeon.items.spells.Alchemize;
import com.shatteredpixel.shatteredpixeldungeon.items.spells.BeaconOfReturning;
import com.shatteredpixel.shatteredpixeldungeon.items.spells.CurseInfusion;
import com.shatteredpixel.shatteredpixeldungeon.items.spells.MagicalInfusion;
import com.shatteredpixel.shatteredpixeldungeon.items.spells.PhaseShift;
import com.shatteredpixel.shatteredpixeldungeon.items.spells.ReclaimTrap;
import com.shatteredpixel.shatteredpixeldungeon.items.spells.Recycle;
import com.shatteredpixel.shatteredpixeldungeon.items.spells.SummonElemental;
import com.shatteredpixel.shatteredpixeldungeon.items.spells.TelekineticGrab;
import com.shatteredpixel.shatteredpixeldungeon.items.spells.UnstableSpell;
import com.shatteredpixel.shatteredpixeldungeon.items.spells.WildEnergy;
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.TrinketCatalyst;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.SpiritBow;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.darts.TippedDart;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.watabou.utils.Bundle;
@@ -36,15 +117,28 @@ import java.util.List;
public enum Catalog {
//EQUIPMENT
WEAPONS,
MELEE_WEAPONS,
ARMOR,
THROWN_WEAPONS,
WANDS,
RINGS,
ARTIFACTS,
TRINKETS,
MISC_EQUIPMENT,
//CONSUMABLES
POTIONS,
SCROLLS;
SEEDS,
SCROLLS,
STONES,
FOOD,
EXOTIC_POTIONS,
EXOTIC_SCROLLS,
BOMBS,
TIPPED_DARTS,
BREWS_ELIXIRS,
SPELLS,
MISC_CONSUMABLES;
private LinkedHashMap<Class<? extends Item>, Boolean> seen = new LinkedHashMap<>();
@@ -52,6 +146,13 @@ public enum Catalog {
return seen.keySet();
}
//should only be used when initializing
private void addItems( Class<?>... items){
for (Class<?> item : items){
seen.put((Class<? extends Item>) item, false);
}
}
public String title(){
return Messages.get(this, name() + ".title");
}
@@ -67,53 +168,79 @@ public enum Catalog {
}
return seenTotal;
}
//TODO ordering of some items, and see if there may be better places to centralize some of these lists
static {
for (Class weapon : Generator.Category.WEP_T1.classes){
WEAPONS.seen.put( weapon, false);
}
for (Class weapon : Generator.Category.WEP_T2.classes){
WEAPONS.seen.put( weapon, false);
}
for (Class weapon : Generator.Category.WEP_T3.classes){
WEAPONS.seen.put( weapon, false);
}
for (Class weapon : Generator.Category.WEP_T4.classes){
WEAPONS.seen.put( weapon, false);
}
for (Class weapon : Generator.Category.WEP_T5.classes){
WEAPONS.seen.put( weapon, false);
}
for (Class armor : Generator.Category.ARMOR.classes){
ARMOR.seen.put( armor, false);
}
MELEE_WEAPONS.addItems(Generator.Category.WEP_T1.classes);
MELEE_WEAPONS.addItems(Generator.Category.WEP_T2.classes);
MELEE_WEAPONS.addItems(Generator.Category.WEP_T3.classes);
MELEE_WEAPONS.addItems(Generator.Category.WEP_T4.classes);
MELEE_WEAPONS.addItems(Generator.Category.WEP_T5.classes);
for (Class wand : Generator.Category.WAND.classes){
WANDS.seen.put( wand, false);
}
ARMOR.addItems(Generator.Category.ARMOR.classes);
for (Class ring : Generator.Category.RING.classes){
RINGS.seen.put( ring, false);
}
THROWN_WEAPONS.addItems(Generator.Category.MIS_T1.classes);
THROWN_WEAPONS.addItems(Generator.Category.MIS_T2.classes);
THROWN_WEAPONS.addItems(Generator.Category.MIS_T3.classes);
THROWN_WEAPONS.addItems(Generator.Category.MIS_T4.classes);
THROWN_WEAPONS.addItems(Generator.Category.MIS_T5.classes);
for (Class artifact : Generator.Category.ARTIFACT.classes){
ARTIFACTS.seen.put( artifact, false);
}
WANDS.addItems(Generator.Category.WAND.classes);
for (Class potion : Generator.Category.POTION.classes){
POTIONS.seen.put( potion, false);
}
RINGS.addItems(Generator.Category.RING.classes);
for (Class scroll : Generator.Category.SCROLL.classes){
SCROLLS.seen.put( scroll, false);
}
ARTIFACTS.addItems(Generator.Category.ARTIFACT.classes);
TRINKETS.addItems(Generator.Category.TRINKET.classes);
MISC_EQUIPMENT.addItems( SpiritBow.class, Waterskin.class, VelvetPouch.class,
PotionBandolier.class, ScrollHolder.class, MagicalHolster.class, Amulet.class);
POTIONS.addItems(Generator.Category.POTION.classes);
SCROLLS.addItems(Generator.Category.SCROLL.classes);
SEEDS.addItems(Generator.Category.SEED.classes);
STONES.addItems(Generator.Category.STONE.classes);
FOOD.addItems( Food.class, Pasty.class, MysteryMeat.class, ChargrilledMeat.class,
StewedMeat.class, FrozenCarpaccio.class, SmallRation.class, Berry.class,
SupplyRation.class, Blandfruit.class, PhantomMeat.class, MeatPie.class );
EXOTIC_POTIONS.addItems(ExoticPotion.exoToReg.keySet().toArray(new Class[0]));
EXOTIC_SCROLLS.addItems(ExoticScroll.exoToReg.keySet().toArray(new Class[0]));
BOMBS.addItems( Bomb.class, FrostBomb.class, Firebomb.class, Flashbang.class, RegrowthBomb.class,
WoollyBomb.class, Noisemaker.class, ShockBomb.class, HolyBomb.class, ArcaneBomb.class, ShrapnelBomb.class);
TIPPED_DARTS.addItems(TippedDart.types.values().toArray(new Class[0]));
BREWS_ELIXIRS.addItems( UnstableBrew.class, InfernalBrew.class, BlizzardBrew.class,
ShockingBrew.class, CausticBrew.class, AquaBrew.class, ElixirOfHoneyedHealing.class,
ElixirOfAquaticRejuvenation.class, ElixirOfArcaneArmor.class, ElixirOfDragonsBlood.class,
ElixirOfIcyTouch.class, ElixirOfToxicEssence.class, ElixirOfMight.class, ElixirOfFeatherFall.class);
SPELLS.addItems( UnstableSpell.class, WildEnergy.class, TelekineticGrab.class, PhaseShift.class,
Alchemize.class, CurseInfusion.class, MagicalInfusion.class, Recycle.class,
ReclaimTrap.class, SummonElemental.class, BeaconOfReturning.class);
MISC_CONSUMABLES.addItems( Gold.class, EnergyCrystal.class, Dewdrop.class,
IronKey.class, GoldenKey.class, CrystalKey.class, SkeletonKey.class,
TrinketCatalyst.class, Stylus.class, Torch.class, Honeypot.class, Ankh.class,
GooBlob.class, TengusMask.class, MetalShard.class, KingsCrown.class,
LiquidMetal.class, ArcaneResin.class,
SealShard.class, BrokenStaff.class, CloakScrap.class, BowFragment.class, BrokenHilt.class);
}
public static LinkedHashMap<Catalog, Badges.Badge> catalogBadges = new LinkedHashMap<>();
static {
catalogBadges.put(WEAPONS, Badges.Badge.ALL_WEAPONS_IDENTIFIED);
catalogBadges.put(MELEE_WEAPONS, Badges.Badge.ALL_WEAPONS_IDENTIFIED);
catalogBadges.put(ARMOR, Badges.Badge.ALL_ARMOR_IDENTIFIED);
catalogBadges.put(WANDS, Badges.Badge.ALL_WANDS_IDENTIFIED);
catalogBadges.put(RINGS, Badges.Badge.ALL_RINGS_IDENTIFIED);
@@ -121,6 +248,34 @@ public enum Catalog {
catalogBadges.put(POTIONS, Badges.Badge.ALL_POTIONS_IDENTIFIED);
catalogBadges.put(SCROLLS, Badges.Badge.ALL_SCROLLS_IDENTIFIED);
}
public static ArrayList<Catalog> equipmentCatalogs = new ArrayList<>();
static {
equipmentCatalogs.add(MELEE_WEAPONS);
equipmentCatalogs.add(ARMOR);
equipmentCatalogs.add(THROWN_WEAPONS);
equipmentCatalogs.add(WANDS);
equipmentCatalogs.add(RINGS);
equipmentCatalogs.add(ARTIFACTS);
equipmentCatalogs.add(TRINKETS);
equipmentCatalogs.add(MISC_EQUIPMENT);
}
public static ArrayList<Catalog> consumableCatalogs = new ArrayList<>();
static {
consumableCatalogs.add(POTIONS);
consumableCatalogs.add(SCROLLS);
consumableCatalogs.add(SEEDS);
consumableCatalogs.add(STONES);
consumableCatalogs.add(FOOD);
consumableCatalogs.add(EXOTIC_POTIONS);
consumableCatalogs.add(EXOTIC_SCROLLS);
consumableCatalogs.add(BOMBS);
consumableCatalogs.add(TIPPED_DARTS);
consumableCatalogs.add(BREWS_ELIXIRS);
consumableCatalogs.add(SPELLS);
consumableCatalogs.add(MISC_CONSUMABLES);
}
public static boolean isSeen(Class<? extends Item> itemClass){
for (Catalog cat : values()) {
@@ -169,23 +324,24 @@ public enum Catalog {
Badges.loadGlobal();
//logic for if we have all badges
if (Badges.isUnlocked(Badges.Badge.ALL_ITEMS_IDENTIFIED)){
//FIXME skip this for now as it's outdated
/*if (Badges.isUnlocked(Badges.Badge.ALL_ITEMS_IDENTIFIED)){
for ( Catalog cat : values()){
for (Class<? extends Item> item : cat.items()){
cat.seen.put(item, true);
}
}
return;
}
}*/
//catalog-specific badge logic
for (Catalog cat : values()){
/*for (Catalog cat : values()){
if (Badges.isUnlocked(catalogBadges.get(cat))){
for (Class<? extends Item> item : cat.items()){
cat.seen.put(item, true);
}
}
}
}*/
//general save/load
if (bundle.contains(CATALOG_ITEMS)) {
@@ -517,35 +517,36 @@ public class WndJournal extends WndTabbed {
grid.scrollTo( 0, 0 );
if (currentItemIdx == EQUIP_IDX) {
int totalItems = Catalog.WEAPONS.totalItems() + Catalog.ARMOR.totalItems() + Catalog.WANDS.totalItems() + Catalog.RINGS.totalItems() + Catalog.ARTIFACTS.totalItems();
int totalSeen = Catalog.WEAPONS.totalSeen() + Catalog.ARMOR.totalSeen() + Catalog.WANDS.totalSeen() + Catalog.RINGS.totalSeen() + Catalog.ARTIFACTS.totalSeen();
int totalItems = 0;
int totalSeen = 0;
for (Catalog catalog : Catalog.equipmentCatalogs){
totalItems += catalog.totalItems();
totalSeen += catalog.totalSeen();
}
grid.addHeader("_" + Messages.get(this, "title_equipment") + "_ (" + totalSeen + "/" + totalItems + ")", 9, true);
grid.addHeader("_" + Messages.capitalize(Catalog.WEAPONS.title()) + "_ (" + Catalog.WEAPONS.totalSeen() + "/" + Catalog.WEAPONS.totalItems() + "):");
addGridItems(grid, Catalog.WEAPONS.items());
grid.addHeader("_" + Messages.capitalize(Catalog.ARMOR.title()) + "_ (" + Catalog.ARMOR.totalSeen() + "/" + Catalog.ARMOR.totalItems() + "):");
addGridItems(grid, Catalog.ARMOR.items());
grid.addHeader("_" + Messages.capitalize(Catalog.WANDS.title()) + "_ (" + Catalog.WANDS.totalSeen() + "/" + Catalog.WANDS.totalItems() + "):");
addGridItems(grid, Catalog.WANDS.items());
grid.addHeader("_" + Messages.capitalize(Catalog.RINGS.title()) + "_ (" + Catalog.RINGS.totalSeen() + "/" + Catalog.RINGS.totalItems() + "):");
addGridItems(grid, Catalog.RINGS.items());
grid.addHeader("_" + Messages.capitalize(Catalog.ARTIFACTS.title()) + "_ (" + Catalog.ARTIFACTS.totalSeen() + "/" + Catalog.ARTIFACTS.totalItems() + "):");
addGridItems(grid, Catalog.ARTIFACTS.items());
for (Catalog catalog : Catalog.equipmentCatalogs){
totalItems += catalog.totalItems();
totalSeen += catalog.totalSeen();
grid.addHeader("_" + Messages.titleCase(catalog.title()) + "_ (" + catalog.totalSeen() + "/" + catalog.totalItems() + "):");
addGridItems(grid, catalog.items());
}
} else if (currentItemIdx == CONSUM_IDX){
int totalItems = Catalog.POTIONS.totalItems() + Catalog.SCROLLS.totalItems();
int totalSeen = Catalog.POTIONS.totalSeen() + Catalog.SCROLLS.totalSeen();
int totalItems = 0;
int totalSeen = 0;
for (Catalog catalog : Catalog.consumableCatalogs){
totalItems += catalog.totalItems();
totalSeen += catalog.totalSeen();
}
grid.addHeader("_" + Messages.get(this, "title_consumables") + "_ (" + totalSeen + "/" + totalItems + ")", 9, true);
grid.addHeader("_" + Messages.capitalize(Catalog.POTIONS.title()) + "_ (" + Catalog.POTIONS.totalSeen() + "/" + Catalog.POTIONS.totalItems() + "):");
addGridItems(grid, Catalog.POTIONS.items());
grid.addHeader("_" + Messages.capitalize(Catalog.SCROLLS.title()) + "_ (" + Catalog.SCROLLS.totalSeen() + "/" + Catalog.SCROLLS.totalItems() + "):");
addGridItems(grid, Catalog.SCROLLS.items());
for (Catalog catalog : Catalog.consumableCatalogs){
totalItems += catalog.totalItems();
totalSeen += catalog.totalSeen();
grid.addHeader("_" + Messages.titleCase(catalog.title()) + "_ (" + catalog.totalSeen() + "/" + catalog.totalItems() + "):");
addGridItems(grid, catalog.items());
}
}
@@ -595,7 +596,7 @@ public class WndJournal extends WndTabbed {
}
};
if (itemSeen) {
if (item instanceof Potion || item instanceof Scroll || item instanceof Ring) {
if (item.icon != -1) {
Image icon = new Image(Assets.Sprites.ITEM_ICONS);
icon.frame(ItemSpriteSheet.Icons.film.get(item.icon));
gridItem.addSecondIcon(icon);