Skip to content

Commit

Permalink
Ignore Ankama {~ps}{~zs} reliquat on effects to fix emoji stats on it…
Browse files Browse the repository at this point in the history
…em command
  • Loading branch information
Kaysoro committed Mar 21, 2024
1 parent e7dba0f commit 042946b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 10 additions & 6 deletions src/main/java/data/Item.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@
import util.Translator;
import util.URLManager;

import java.awt.*;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;

/**
* Created by steve on 14/07/2016.
Expand Down Expand Up @@ -180,17 +178,23 @@ private static String extractEvolutionEffectsFromTitle(Language lg, String url)
Document doc = JSoupManager.postDocument(url, header, data);
Elements lines = doc.getElementsByClass("ak-list-element");
StringBuilder tmp = new StringBuilder();
for (Element line : lines)
tmp.append(EmojiManager.getEmojiForStat(lg, line.text())).append(line.text()).append("\n");
for (Element line : lines) {
String effect = line.text().replaceAll("\\{~p}\\{~z}", "")
.replaceAll("\\{~ps}\\{~zs}", "s");
tmp.append(EmojiManager.getEmojiForStat(lg, effect)).append(effect).append("\n");
}
return tmp.toString();
}

private static String extractStatsFromTitle(Language lg, Element title)
{
Elements lines = title.parent().getElementsByClass("ak-title");
StringBuilder tmp = new StringBuilder();
for (Element line : lines)
tmp.append(EmojiManager.getEmojiForStat(lg, line.text())).append(line.text()).append("\n");
for (Element line : lines) {
String effect = line.text().replaceAll("\\{~p}\\{~z}", "")
.replaceAll("\\{~ps}\\{~zs}", "s");
tmp.append(EmojiManager.getEmojiForStat(lg, effect)).append(effect).append("\n");
}
return tmp.toString();
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/label_FR
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ stat.resistance_fixe_feu=Résistance Feu;Feu (fixe)
stat.resistance_fixe_eau=Résistance Eau;Eau (fixe)
stat.resistance_fixe_air=Résistance Air;Air (fixe)
stat.resistance_fixe_poussee=Résistance Poussée;Poussée (fixe)
stat.resistance_fixe_cc=Résistance Critiques;Coups critiques (fixe)
stat.resistance_fixe_cc=Résistance Critiques;Résistances Critiques;Coups critiques (fixe)
stat.resistance_percent_neutre=Neutre %;% Résistance Neutre;Neutre (%)
stat.resistance_percent_terre=Terre %;% Résistance Terre;Terre (%)
stat.resistance_percent_feu=Feu %;% Résistance Feu;Feu (%)
Expand Down

0 comments on commit 042946b

Please sign in to comment.