v1.2.2: fixed cases where heroic energy was being incorrectly renamed

This commit is contained in:
Evan Debenham
2022-04-04 17:47:32 -04:00
parent d51fed0f4d
commit 05c3621615
4 changed files with 11 additions and 4 deletions
@@ -195,7 +195,7 @@ public enum Talent {
public int icon(){ public int icon(){
if (this == HEROIC_ENERGY){ if (this == HEROIC_ENERGY){
if (Dungeon.hero != null && Dungeon.hero.armorAbility instanceof Ratmogrify){ if (Ratmogrify.useRatroicEnergy){
return 127; return 127;
} }
HeroClass cls = Dungeon.hero != null ? Dungeon.hero.heroClass : GamesInProgress.selectedClass; HeroClass cls = Dungeon.hero != null ? Dungeon.hero.heroClass : GamesInProgress.selectedClass;
@@ -219,9 +219,7 @@ public enum Talent {
} }
public String title(){ public String title(){
if (this == HEROIC_ENERGY if (Ratmogrify.useRatroicEnergy){
&& Dungeon.hero != null
&& Dungeon.hero.armorAbility instanceof Ratmogrify){
return Messages.get(this, name() + ".rat_title"); return Messages.get(this, name() + ".rat_title");
} }
return Messages.get(this, name() + ".title"); return Messages.get(this, name() + ".title");
@@ -57,6 +57,9 @@ public class Ratmogrify extends ArmorAbility {
baseChargeUse = 50f; baseChargeUse = 50f;
} }
//this is sort of hacky, but we need it to know when to use alternate name/icon for heroic energy
public static boolean useRatroicEnergy = false;
@Override @Override
public String targetingPrompt() { public String targetingPrompt() {
return Messages.get(this, "prompt"); return Messages.get(this, "prompt");
@@ -25,6 +25,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Badges;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.Ratmogrify;
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene; import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
@@ -52,6 +53,8 @@ public class TalentsPane extends ScrollPane {
public TalentsPane( TalentButton.Mode mode, ArrayList<LinkedHashMap<Talent, Integer>> talents ) { public TalentsPane( TalentButton.Mode mode, ArrayList<LinkedHashMap<Talent, Integer>> talents ) {
super(new Component()); super(new Component());
Ratmogrify.useRatroicEnergy = Dungeon.hero != null && Dungeon.hero.armorAbility instanceof Ratmogrify;
int tiersAvailable = 1; int tiersAvailable = 1;
if (mode == TalentButton.Mode.INFO){ if (mode == TalentButton.Mode.INFO){
@@ -24,6 +24,8 @@ package com.shatteredpixel.shatteredpixeldungeon.windows;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.ArmorAbility; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.ArmorAbility;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.Ratmogrify;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Rat;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
@@ -43,6 +45,7 @@ public class WndInfoArmorAbility extends WndTitledMessage {
ArrayList<LinkedHashMap<Talent, Integer>> talentList = new ArrayList<>(); ArrayList<LinkedHashMap<Talent, Integer>> talentList = new ArrayList<>();
Talent.initArmorTalents(ability, talentList); Talent.initArmorTalents(ability, talentList);
Ratmogrify.useRatroicEnergy = ability instanceof Ratmogrify;
TalentsPane.TalentTierPane talentPane = new TalentsPane.TalentTierPane(talentList.get(3), 4, TalentButton.Mode.INFO); TalentsPane.TalentTierPane talentPane = new TalentsPane.TalentTierPane(talentList.get(3), 4, TalentButton.Mode.INFO);
talentPane.title.text( Messages.titleCase(Messages.get(WndHeroInfo.class, "talents"))); talentPane.title.text( Messages.titleCase(Messages.get(WndHeroInfo.class, "talents")));
talentPane.setRect(0, height + 5, width, talentPane.height()); talentPane.setRect(0, height + 5, width, talentPane.height());