Skip to content

Commit d8a48f5

Browse files
committed
try to fix spell calc hardcode
1 parent 78fd438 commit d8a48f5

File tree

6 files changed

+19
-9
lines changed

6 files changed

+19
-9
lines changed

src/main/java/com/robertx22/age_of_exile/capability/player/data/DeathFavorData.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ public List<Component> getTooltip() {
6565

6666
GearRarity rar = getRarity();
6767

68-
tooltip.add(rar.locName().append(" Favor").withStyle(rar.textFormatting()));
68+
tooltip.add(rar.locName().append(Words.Favor_In_GUI.locName()).withStyle(rar.textFormatting()));
6969

7070
tooltip.add(Component.empty());
7171

72-
tooltip.add(Component.literal("Current: " + (int) favor).withStyle(ChatFormatting.YELLOW));
72+
tooltip.add(Words.Current_Favor.locName((int) favor).withStyle(ChatFormatting.YELLOW));
7373

7474
tooltip.add(Component.empty());
7575

76-
tooltip.add(Component.literal("Loot/Exp Multiplier: " + getLootExpMulti() + "x").withStyle(rar.textFormatting()));
76+
tooltip.add(Words.Loot_Exp_Multiplier.locName(getLootExpMulti()).withStyle(rar.textFormatting()));
7777

7878
tooltip.add(Component.empty());
7979

src/main/java/com/robertx22/age_of_exile/database/data/stats/Stat.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,12 @@ public String getIconNameFormat(String str) {
128128
return this.getFormat() + this.icon + " " + str + ChatFormatting.GRAY;
129129
}
130130

131+
public MutableComponent getMutableIconNameFormat() {
132+
return ExileText.ofTranslate(SlashRef.MODID + ".spell.conbine_icon_and_damage", this.getFormat() + this.icon, this.locName)
133+
.append("").format(ChatFormatting.GRAY)
134+
.get();
135+
}
136+
131137
@Override
132138
public boolean isFromDatapack() {
133139
return false;

src/main/java/com/robertx22/age_of_exile/database/data/value_calc/ScalingCalc.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public int getMultiAsPercent(LivingEntity en, MaxLevelProvider provider) {
4343
}
4444

4545
public Component GetTooltipString(LivingEntity en, MaxLevelProvider provider) {
46-
return Component.literal("(" + getMultiAsPercent(en, provider) + "% of " + getStat().getIconNameFormat() + ")");
46+
return Component.translatable(SlashRef.MODID + ".spell.spell_damage_proportion", getMultiAsPercent(en, provider), getStat().getMutableIconNameFormat());
4747
}
4848

4949
public List<Component> getTooltipFor(float multi, float value, MutableComponent statname, Elements el) {

src/main/java/com/robertx22/age_of_exile/uncommon/localization/Words.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,10 @@ public enum Words implements IAutoLocName {
221221
Energy_Cost_Per_Mob("Energy Cost: %1$s + %2$s Per mob, x %3$s Dmg"),
222222
Durability("Durability: "),
223223
Unbreakable("Unbreakable"),
224-
Restores("Restores: %1$s%%");
224+
Restores("Restores: %1$s%%"),
225+
Favor_In_GUI(" Favor"),
226+
Current_Favor("Current: %1$s"),
227+
Loot_Exp_Multiplier("Loot/Exp Multiplier: %1$sx");
225228

226229

227230
private String localization = "";

src/main/java/com/robertx22/age_of_exile/uncommon/utilityclasses/TooltipUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ public static MutableComponent tier(int tier) {
209209
}
210210

211211
public static MutableComponent gearSlot(GearSlot slot) {
212-
return Words.Tooltips_Item_Type.locName().withStyle(ChatFormatting.WHITE)
212+
return Words.ITEM_TYPE.locName().withStyle(ChatFormatting.WHITE)
213213
.append(slot.locName()
214214
.withStyle(ChatFormatting.AQUA));
215215
}

src/main/resources/assets/mmorpg/lang/en_us.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@
745745
"mmorpg.word.clicktoopen": "Click to Open",
746746
"mmorpg.word.cloak": "Cloak",
747747
"mmorpg.word.coat": "Coat",
748-
"mmorpg.word.cooldown": "Cooldown: %1$s",
748+
"mmorpg.word.cooldown": "Cooldown: %1$ss",
749749
"mmorpg.word.corrupted": "Corrupted",
750750
"mmorpg.word.crate": "Crate",
751751
"mmorpg.word.creation": "Creation",
@@ -862,7 +862,6 @@
862862
"mmorpg.word.tm_prefix_space": " ",
863863
"mmorpg.word.tm_suffix_space": " ",
864864
"mmorpg.word.tooltips_rarity": "Rarity: ",
865-
"mmorpg.word.tooltips_item_type": "Item Type: ",
866865
"mmorpg.word.tooltips_tier": "Tier: ",
867866
"mmorpg.word.tooltips_item_tier": "Item Tier: ",
868867
"mmorpg.word.tooltips_level": "Level: ",
@@ -873,6 +872,7 @@
873872
"mmorpg.word.energy_cost_per_mob": "Energy Cost: %1$s + %2$s Per mob, x %3$s Dmg",
874873
"mmorpg.word.durability": "Durability: ",
875874
"mmorpg.word.unbreakable": "Unbreakable",
875+
"mmorpg.word.restores": "Restores: %1$s%%",
876876

877877

878878
"_comment": " [CATEGORY]: WORDS - NAMES",
@@ -1814,7 +1814,8 @@
18141814

18151815

18161816
"_comment": " [CATEGORY]: SPELLS - DESCRIPTIONS",
1817-
1817+
"mmorpg.spell.conbine_icon_and_damage": "%1$s %2$s",
1818+
"mmorpg.spell.spell_damage_proportion": "(%1$s%% of %2$s)",
18181819
"spell.desc.arrow_barrage": "Shoot out arrows in rapid succession, dealing [calc:arrow_storm] §6☀ Physical§7 Damage",
18191820
"spell.desc.arrow_storm": "Shoot out arrows in an arc, dealing [calc:arrow_storm] §6☀ Physical§7 Damage",
18201821
"spell.desc.arrow_totem": "Summons a totem that rapidly shoots arrows, dealing [calc:arrow_totem] §6☀ Physical§7 Damage",

0 commit comments

Comments
 (0)