v2.5.0: improved code (and some text) for trinket descriptions

This commit is contained in:
Evan Debenham
2024-06-19 14:57:24 -04:00
parent f6299e07c8
commit d69530831d
15 changed files with 133 additions and 45 deletions
@@ -1298,37 +1298,59 @@ items.stones.stoneofshock.desc=This runestone unleashes a blast of electrical en
###trinkets
items.trinkets.dimensionalsundial.name=dimensional sundial
items.trinkets.dimensionalsundial.warning=Your sundial isn't casting a shadow, you feel uneasy.
items.trinkets.dimensionalsundial.desc=This small handheld sundial is somehow able to cast a shadow in the depths of the dungeon, even if you aren't holding it upright. Even more strangely, the shadow's position seems to have no relation to the sun in this world. When no shadow is cast, the sundial seems to attract danger.\n\nAt its current level, this trinket will increase the spawning rate of enemies by _%d%%_ when it is nighttime in real life (9pm to 7am).\n\nThis trinket costs very little energy to upgrade.
items.trinkets.dimensionalsundial.desc=This small handheld sundial is somehow able to cast a shadow in the depths of the dungeon, even if you aren't holding it upright. Even more strangely, the shadow's position seems to have no relation to the sun in this world. When no shadow is cast, the sundial seems to attract danger.
items.trinkets.dimensionalsundial.typical_stats_desc=Typically this trinket will increase the spawning rate of enemies by _%d%%_ when it is nighttime in real life (9pm to 7am).\n\nThis trinket costs very little energy to upgrade.
items.trinkets.dimensionalsundial.stats_desc=At its current level, this trinket will increase the spawning rate of enemies by _%d%%_ when it is nighttime in real life (9pm to 7am).\n\nThis trinket costs very little energy to upgrade.
items.trinkets.exoticcrystals.name=exotic crystals
items.trinkets.exoticcrystals.desc=These small pink crystals have the same shape as crystals of alchemical energy. While they can't be used for energy directly, they seem to be somehow influencing the potions and scrolls you find.\n\nAt its current level this trinket will replace _%s%%_ of potion or scroll drops with their exotic equivalents. This does not affect potions of strength, scrolls of upgrade, or items that are generated to help solve hazard rooms.
items.trinkets.exoticcrystals.desc=These small pink crystals have the same shape as crystals of alchemical energy. While they can't be used for energy directly, they seem to be somehow influencing the potions and scrolls you find.
items.trinkets.exoticcrystals.typical_stats_desc=Typically this trinket will replace _%s%%_ of potion or scroll drops with their exotic equivalents. This does not affect potions of strength, scrolls of upgrade, or items that are generated to help solve hazard rooms.
items.trinkets.exoticcrystals.stats_desc=At its current level this trinket will replace _%s%%_ of potion or scroll drops with their exotic equivalents. This does not affect potions of strength, scrolls of upgrade, or items that are generated to help solve hazard rooms.
items.trinkets.eyeofnewt.name=eye of newt
items.trinkets.eyeofnewt.desc=This golden and black newt's eye is a common ingredient, now enhanced into a trinket. The eye seems to be reducing your vision in exchange for letting you see things in other ways.\n\nAt its current level this trinket will reduce your vision range by _%1$s%%_, but will also grant you mind vision on enemies within _%2$d_ tiles.
items.trinkets.eyeofnewt.desc=This golden and black newt's eye is a common ingredient, now enhanced into a trinket. The eye seems to be reducing your vision in exchange for letting you see things in other ways.
items.trinkets.eyeofnewt.typical_stats_desc=Typically this trinket will reduce your vision range by _%1$s%%_, but will also grant you mind vision on enemies within _%2$d_ tiles.
items.trinkets.eyeofnewt.stats_desc=At its current level this trinket will reduce your vision range by _%1$s%%_, but will also grant you mind vision on enemies within _%2$d_ tiles.
items.trinkets.mimictooth.name=mimic tooth
items.trinkets.mimictooth.desc=This large sharp tooth must have been pulled from a very unhappy mimic. It seems to be influencing the mimics of the dungeon, making them more frequent and dangerous.\n\nAt its current level this trinket will make all kinds of mimic _%1$sx_ more common, will make mimics much more difficult to detect, and will give each floor a _%2$s%%_ chance to contain an ebony mimic.
items.trinkets.mimictooth.desc=This large sharp tooth must have been pulled from a very unhappy mimic. It seems to be influencing the mimics of the dungeon, making them more frequent and dangerous.
items.trinkets.mimictooth.typical_stats_desc=Typically this trinket will make all kinds of mimic _%1$sx_ more common, will make mimics much more difficult to detect, and will give each floor a _%2$s%%_ chance to contain an ebony mimic.
items.trinkets.mimictooth.stats_desc=At its current level this trinket will make all kinds of mimic _%1$sx_ more common, will make mimics much more difficult to detect, and will give each floor a _%2$s%%_ chance to contain an ebony mimic.
items.trinkets.mossyclump.name=mossy clump
items.trinkets.mossyclump.desc=This clump of wet moss seems to hold onto its moisture no matter how hard you squeeze it. It seems to be magically tied to the dungeon itself, making grass and water more likely to appear.\n\nAt its current level this trinket will make _%d%%_ of regular floors become filled with either water or grass instead.\n\nThis trinket costs a very large amount of energy to upgrade.
items.trinkets.mossyclump.desc=This clump of wet moss seems to hold onto its moisture no matter how hard you squeeze it. It seems to be magically tied to the dungeon itself, making grass and water more likely to appear.
items.trinkets.mossyclump.typical_stats_desc=Typically this trinket will make _%d%%_ of regular floors become filled with either water or grass instead.\n\nThis trinket costs a very large amount of energy to upgrade.
items.trinkets.mossyclump.stats_desc=At its current level this trinket will make _%d%%_ of regular floors become filled with either water or grass instead.\n\nThis trinket costs a very large amount of energy to upgrade.
items.trinkets.parchmentscrap.name=parchment scrap
items.trinkets.parchmentscrap.desc=This little scrap of parchment looks like it came from a scroll. It has retained some of its magic, and it seems to be influencing weapons and armor found in the dungeon.\n\nAt its current level this trinket will make enchantments and glyphs _%dx_ as common, and curses on weapons and armor _%sx_ as common. Curses on wands, rings, or artifacts are not affected.\n\nThis trinket costs a moderately large amount of energy to upgrade.
items.trinkets.parchmentscrap.desc=This little scrap of parchment looks like it came from a scroll. It has retained some of its magic, and it seems to be influencing weapons and armor found in the dungeon.
items.trinkets.parchmentscrap.typical_stats_desc=Typically this trinket will make enchantments and glyphs _%dx_ as common, and curses on weapons and armor _%sx_ as common. Curses on wands, rings, or artifacts are not affected.\n\nThis trinket costs a moderately large amount of energy to upgrade.
items.trinkets.parchmentscrap.stats_desc=At its current level this trinket will make enchantments and glyphs _%dx_ as common, and curses on weapons and armor _%sx_ as common. Curses on wands, rings, or artifacts are not affected.\n\nThis trinket costs a moderately large amount of energy to upgrade.
items.trinkets.petrifiedseed.name=petrified seed
items.trinkets.petrifiedseed.desc=This seed has been fossilised, either by slow geological processes or by magic. The seed seems to be magically influencing the flora of the dungeon, occasionally replacing plant seeds with runestones.\n\nAt its current level this trinket will cause trampled grass to drop runestones instead of seeds _%1$d%%_ of the time, and will also cause high grass to drop items _%2$d%%_ more often.
items.trinkets.petrifiedseed.desc=This seed has been fossilised, either by slow geological processes or by magic. The seed seems to be magically influencing the flora of the dungeon, occasionally replacing plant seeds with runestones.
items.trinkets.petrifiedseed.typical_stats_desc=Typically this trinket will cause trampled grass to drop runestones instead of seeds _%1$s%%_ of the time, and will also cause high grass to drop items _%2$s%%_ more often.
items.trinkets.petrifiedseed.stats_desc=At its current level this trinket will cause trampled grass to drop runestones instead of seeds _%1$s%%_ of the time, and will also cause high grass to drop items _%2$s%%_ more often.
items.trinkets.ratskull.name=rat skull
items.trinkets.ratskull.desc=This macabre trinket isn't much larger than the skull of a normal rat, which is somehow a rarity down in this dungeon. The skull's magical influence seems to attract the more rare denizens of the dungeon, making them appear far more often.\n\nAt its current level this trinket will make rare exotic enemies _%dx_ as likely to appear. The skull is only half as effective at attracting crystal mimics and armored statues, however.
items.trinkets.ratskull.desc=This macabre trinket isn't much larger than the skull of a normal rat, which is somehow a rarity down in this dungeon. The skull's magical influence seems to attract the more rare denizens of the dungeon, making them appear far more often.
items.trinkets.ratskull.typical_stats_desc=Typically this trinket will make rare exotic enemies _%dx_ as likely to appear. The skull is only half as effective at attracting crystal mimics and armored statues, however.
items.trinkets.ratskull.stats_desc=At its current level this trinket will make rare exotic enemies _%dx_ as likely to appear. The skull is only half as effective at attracting crystal mimics and armored statues, however.
items.trinkets.thirteenleafclover.name=thirteen leaf clover
items.trinkets.thirteenleafclover.desc=Somehow stewing in the alchemy pot has caused this clover to grow a bunch of extra leaves! It's not really clear if this trinket is lucky or unlucky, perhaps this trinket will make your luck more chaotic?\n\nNormally when dealing or blocking damage, the game makes numbers closer to the average more common. At its current level this trinket has a _%d%%_ chance to invert this, making numbers closer to the maximum or minimum more likely to appear instead.\n\nThis trinket costs very little energy to upgrade.
items.trinkets.thirteenleafclover.desc=Somehow stewing in the alchemy pot has caused this clover to grow a bunch of extra leaves! It's not really clear if this trinket is lucky or unlucky, perhaps this trinket will make your luck more chaotic?
items.trinkets.thirteenleafclover.typical_stats_desc=Normally when dealing or blocking damage, the game makes numbers closer to the average more common. Typically this this trinket has a _%d%%_ chance to invert this, making numbers closer to the maximum or minimum more likely to appear instead.\n\nThis trinket costs very little energy to upgrade.
items.trinkets.thirteenleafclover.stats_desc=Normally when dealing or blocking damage, the game makes numbers closer to the average more common. At its current level this trinket has a _%d%%_ chance to invert this, making numbers closer to the maximum or minimum more likely to appear instead.\n\nThis trinket costs very little energy to upgrade.
items.trinkets.trapmechanism.name=trap mechanism
items.trinkets.trapmechanism.desc=The core mechanism of one of the dungeon's pitfall traps, carefully carved out of the floor so it can be carried. It seems to be magically tied to the dungeon itself, making terrain more hazardous for you and the dungeon's inhabitants.\n\nAt its current level this trinket will make _%d%%_ of regular floors become filled with either traps or chasms instead.\n\nThis trinket costs relatively little energy to upgrade.
items.trinkets.trapmechanism.desc=The core mechanism of one of the dungeon's pitfall traps, carefully carved out of the floor so it can be carried. It seems to be magically tied to the dungeon itself, making terrain more hazardous for you and the dungeon's inhabitants.
items.trinkets.trapmechanism.typical_stats_desc=Typically this trinket will make _%d%%_ of regular floors become filled with either traps or chasms instead.\n\nThis trinket costs relatively little energy to upgrade.
items.trinkets.trapmechanism.stats_desc=At its current level this trinket will make _%d%%_ of regular floors become filled with either traps or chasms instead.\n\nThis trinket costs relatively little energy to upgrade.
items.trinkets.wondrousresin.name=wondrous resin
items.trinkets.wondrousresin.desc=This shimmering blue resin appears to have the distilled essence of a cursed wand's magic. The magic from the alchemy pot has seemed to stabilize it somewhat, and it's now affecting your wands.\n\nAt its current level this trinket will force cursed wand effects to become neutral or positive _%1$s%%_ of the time, and will cause uncursed wands to fire an additional cursed zap _%2$s%%_ of the time.\n\nThis trinket costs a moderately large amount of energy to upgrade.
items.trinkets.wondrousresin.desc=This shimmering blue resin appears to have the distilled essence of a cursed wand's magic. The magic from the alchemy pot has seemed to stabilize it somewhat, and it's now affecting your wands.
items.trinkets.wondrousresin.typical_stats_desc=Typically this trinket will force cursed wand effects to become neutral or positive _%1$s%%_ of the time, and will cause uncursed wands to fire an additional cursed zap _%2$s%%_ of the time.\n\nThis trinket costs a moderately large amount of energy to upgrade.
items.trinkets.wondrousresin.stats_desc=At its current level this trinket will force cursed wand effects to become neutral or positive _%1$s%%_ of the time, and will cause uncursed wands to fire an additional cursed zap _%2$s%%_ of the time.\n\nThis trinket costs a moderately large amount of energy to upgrade.
items.trinkets.trinketcatalyst.name=magical catalyst
items.trinkets.trinketcatalyst.window_text=The water begins to glow as you add the catalyst. There are a few nearby items you could imbue with energy to turn into a magical trinket.
@@ -1361,6 +1383,7 @@ items.wands.wandofblastwave.name=wand of blast wave
items.wands.wandofblastwave.staff_name=staff of blast wave
items.wands.wandofblastwave.ondeath=You killed yourself with your own Wand of Blast Wave...
items.wands.wandofblastwave.desc=This wand is made of a sort of marbled stone, with gold trim and a round black gem at the tip. It feels very weighty in your hand.
items.wands.wandofblastwave.typical_stats_desc=This wand shoots a bolt which violently detonates at a target location. The force of this blast typically deals _%1$d-%2$d damage_ and is strong enough to send most enemies flying.
items.wands.wandofblastwave.stats_desc=This wand shoots a bolt which violently detonates at a target location. The force of this blast deals _%1$d-%2$d damage_ and is strong enough to send most enemies flying.
items.wands.wandofblastwave.bmage_desc=When _the Battlemage_ strikes an enemy with a staff of blast wave, the enemy has a chance to be knocked back, as if the staff had an elastic enchantment.
items.wands.wandofblastwave.eleblast_desc=An elemental blast with a staff of blast wave deals 67% damage and knocks all enemies outside of the blast area.
@@ -45,7 +45,7 @@ journal.document.adventurers_guide.identifying.body=You won't know all of the pr
journal.document.adventurers_guide.food.title=Dealing with Hunger
journal.document.adventurers_guide.food.body=Rationing food effectively is one of the best things you can do to improve your odds of survival. Try thinking of health and hunger as resources that need to be managed, not kept full at all times.\n\nWhen you aren't starving you will slowly regenerate health. So if you eat at full health, this regeneration will be wasted.\n\nIf you pace out when you eat based on how your health is doing, your food should last much longer.
journal.document.adventurers_guide.alchemy.title=Alchemy & Trinkets
journal.document.adventurers_guide.alchemy.body=If you don't find a certain consumable item useful, you can use it as an ingredient at an alchemy pot instead! Items can be used in specific recipes, or turned into all-purpose alchemical energy.\n\nTrinkets are the only piece of equipment that can be made using alchemy. They produce a variety of helpful effects and can be made with just a bit of alchemical energy and a magical catalyst.\n\n(You can find the first alchemy pot on the 3rd or 4th floor of the dungeon. You can find pages of an alchemy recipe book near these pots as well.)
journal.document.adventurers_guide.alchemy.body=If you don't find a certain consumable item useful, you can use it as an ingredient at an alchemy pot instead! Items can be used in specific recipes, or turned into all-purpose alchemical energy.\n\nTrinkets are the only piece of equipment that can be made using alchemy. They produce a variety of helpful effects and can be made with just a bit of alchemical energy and a magical catalyst. Trinkets can be upgraded with more energy to make their effect more powerful.\n\n(You can find the first alchemy pot on the 3rd or 4th floor of the dungeon. You can find pages of an alchemy recipe book near these pots as well.)
journal.document.adventurers_guide.dieing.title=Handling Defeat
journal.document.adventurers_guide.dieing.body=Unfortunately, dungeoneering is a very dangerous profession and most adventurers will eventually meet their demise.\n\nWhile luck can definitely play a role, the best adventurers are the ones who use every little trick to improve their odds of success.\n\n(Don't be dissuaded if you are dying a lot, this game is hard! Focus on learning the game and steadily improving, don't focus on winning right away.)
journal.document.adventurers_guide.searching.title=Searching
@@ -42,8 +42,12 @@ public class DimensionalSundial extends Trinket {
}
@Override
public String desc() {
return Messages.get(this, "desc", (int)(100*(enemySpawnMultiplier(buffedLvl())-1f)));
public String statsDesc() {
if (isIdentified()){
return Messages.get(this, "stats_desc", (int)(100*(enemySpawnMultiplier(buffedLvl())-1f)));
} else {
return Messages.get(this, "typical_stats_desc", (int)(100*(enemySpawnMultiplier(0)-1f)));
}
}
public static boolean sundialWarned = false;
@@ -37,8 +37,12 @@ public class ExoticCrystals extends Trinket {
}
@Override
public String desc() {
return Messages.get(this, "desc", (int)(100*consumableExoticChance(buffedLvl())));
public String statsDesc() {
if (isIdentified()){
return Messages.get(this, "stats_desc", Messages.decimalFormat("#.##", 100*consumableExoticChance(buffedLvl())));
} else {
return Messages.get(this, "typical_stats_desc", Messages.decimalFormat("#.##", 100*consumableExoticChance(0)));
}
}
public static float consumableExoticChance(){
@@ -37,10 +37,16 @@ public class EyeOfNewt extends Trinket {
}
@Override
public String desc() {
return Messages.get(this, "desc",
Messages.decimalFormat("#.##", 100*(1f-visionRangeMultiplier(buffedLvl()))),
mindVisionRange(buffedLvl()));
public String statsDesc() {
if (isIdentified()){
return Messages.get(this, "stats_desc",
Messages.decimalFormat("#.##", 100*(1f-visionRangeMultiplier(buffedLvl()))),
mindVisionRange(buffedLvl()));
} else {
return Messages.get(this, "typical_stats_desc",
Messages.decimalFormat("#.##", 100*(1f-visionRangeMultiplier(0))),
mindVisionRange(0));
}
}
public static float visionRangeMultiplier(){
@@ -37,10 +37,16 @@ public class MimicTooth extends Trinket {
}
@Override
public String desc() {
return Messages.get(this, "desc",
Messages.decimalFormat("#.##", mimicChanceMultiplier(buffedLvl())),
Messages.decimalFormat("#.##", 100*ebonyMimicChance(buffedLvl())));
public String statsDesc() {
if (isIdentified()){
return Messages.get(this, "stats_desc",
Messages.decimalFormat("#.##", mimicChanceMultiplier(buffedLvl())),
Messages.decimalFormat("#.##", 100*ebonyMimicChance(buffedLvl())));
} else {
return Messages.get(this, "typical_stats_desc",
Messages.decimalFormat("#.##", mimicChanceMultiplier(0)),
Messages.decimalFormat("#.##", 100*ebonyMimicChance(0)));
}
}
public static float mimicChanceMultiplier(){
@@ -43,8 +43,12 @@ public class MossyClump extends Trinket {
}
@Override
public String desc() {
return Messages.get(this, "desc", (int)(100*overrideNormalLevelChance(buffedLvl())));
public String statsDesc() {
if (isIdentified()){
return Messages.get(this, "stats_desc", (int)(100*overrideNormalLevelChance(buffedLvl())));
} else {
return Messages.get(this, "typical_stats_desc", (int)(100*overrideNormalLevelChance(0)));
}
}
public static float overrideNormalLevelChance(){
@@ -37,8 +37,12 @@ public class ParchmentScrap extends Trinket {
}
@Override
public String desc() {
return Messages.get(this, "desc", (int)enchantChanceMultiplier(buffedLvl()), Messages.decimalFormat("#.##", curseChanceMultiplier(buffedLvl())));
public String statsDesc() {
if (isIdentified()){
return Messages.get(this, "stats_desc", (int)enchantChanceMultiplier(buffedLvl()), Messages.decimalFormat("#.##", curseChanceMultiplier(buffedLvl())));
} else {
return Messages.get(this, "typical_stats_desc", (int)enchantChanceMultiplier(0), Messages.decimalFormat("#.##", curseChanceMultiplier(0)));
}
}
public static float enchantChanceMultiplier(){
@@ -37,8 +37,17 @@ public class PetrifiedSeed extends Trinket {
}
@Override
public String desc() {
return Messages.get(this, "desc", (int)(100*stoneInsteadOfSeedChance(buffedLvl())), (int)Math.round(100*(grassLootMultiplier(buffedLvl())-1f)));
public String statsDesc() {
if (isIdentified()){
return Messages.get(this, "stats_desc",
Messages.decimalFormat("#.##", 100*stoneInsteadOfSeedChance(buffedLvl())),
Messages.decimalFormat("#.##", 100*(grassLootMultiplier(buffedLvl())-1f)));
} else {
return Messages.get(this, "stats_desc",
Messages.decimalFormat("#.##", 100*stoneInsteadOfSeedChance(0)),
Messages.decimalFormat("#.##", 100*(grassLootMultiplier(0)-1f)));
}
}
public static float grassLootMultiplier(){
@@ -37,8 +37,12 @@ public class RatSkull extends Trinket {
}
@Override
public String desc() {
return Messages.get(this, "desc", (int)(exoticChanceMultiplier(buffedLvl())));
public String statsDesc() {
if (isIdentified()){
return Messages.get(this, "stats_desc", (int)(exoticChanceMultiplier(buffedLvl())));
} else {
return Messages.get(this, "typical_stats_desc", (int)(exoticChanceMultiplier(0)));
}
}
public static float exoticChanceMultiplier(){
@@ -38,8 +38,12 @@ public class ThirteenLeafClover extends Trinket {
}
@Override
public String desc() {
return Messages.get(this, "desc", (int)(100*combatDistributionInverseChance(buffedLvl())));
public String statsDesc() {
if (isIdentified()){
return Messages.get(this, "stats_desc", (int)(100*combatDistributionInverseChance(buffedLvl())));
} else {
return Messages.get(this, "typical_stats_desc", (int)(100*combatDistributionInverseChance(0)));
}
}
public static float combatDistributionInverseChance(){
@@ -43,8 +43,12 @@ public class TrapMechanism extends Trinket {
}
@Override
public String desc() {
return Messages.get(this, "desc", (int)(100*overrideNormalLevelChance(buffedLvl())));
public String statsDesc() {
if (isIdentified()){
return Messages.get(this, "stats_desc", (int)(100*overrideNormalLevelChance(buffedLvl())));
} else {
return Messages.get(this, "typical_stats_desc", (int)(100*overrideNormalLevelChance(0)));
}
}
public static float overrideNormalLevelChance(){
@@ -37,11 +37,6 @@ public abstract class Trinket extends Item {
unique = true;
}
@Override
public boolean isIdentified() {
return true;
}
@Override
public boolean isUpgradable() {
return false;
@@ -63,6 +58,15 @@ public abstract class Trinket extends Item {
}
}
@Override
public String info() {
String desc = desc();
desc += "\n\n" + statsDesc();
return desc;
}
public abstract String statsDesc();
public static class PlaceHolder extends Trinket {
{
@@ -84,6 +88,11 @@ public abstract class Trinket extends Item {
return "";
}
@Override
public String statsDesc() {
return "";
}
}
public static class UpgradeTrinket extends Recipe {
@@ -199,6 +199,7 @@ public class TrinketCatalyst extends Item {
if (cata != null) {
cata.detach(Dungeon.hero.belongings.backpack);
Catalog.countUse(cata.getClass());
item.identify();
((AlchemyScene)ShatteredPixelDungeon.scene()).craftItem(null, item);
}
}
@@ -37,10 +37,16 @@ public class WondrousResin extends Trinket {
}
@Override
public String desc() {
return Messages.get(this, "desc",
Messages.decimalFormat("#.##", 100*positiveCurseEffectChance(buffedLvl())),
Messages.decimalFormat("#.##", 100*extraCurseEffectChance(buffedLvl())));
public String statsDesc() {
if (isIdentified()){
return Messages.get(this, "stats_desc",
Messages.decimalFormat("#.##", 100*positiveCurseEffectChance(buffedLvl())),
Messages.decimalFormat("#.##", 100*extraCurseEffectChance(buffedLvl())));
} else {
return Messages.get(this, "typical_stats_desc",
Messages.decimalFormat("#.##", 100*positiveCurseEffectChance(0)),
Messages.decimalFormat("#.##", 100*extraCurseEffectChance(0)));
}
}
//TODO currently this trims most rare/v.rare wand effects entirely. Need to improve variety there