mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
Merge branch 'descriptions' into 'master'
Fix alternate state descriptions when viewed from original See merge request core-developers/forge!4277
This commit is contained in:
@@ -216,7 +216,13 @@ public abstract class ReplacementEffect extends TriggerReplacementBase {
|
||||
public String getDescription() {
|
||||
if (hasParam("Description") && !this.isSuppressed()) {
|
||||
String desc = AbilityUtils.applyDescriptionTextChangeEffects(getParam("Description"), this);
|
||||
String currentName = getHostCard().getName();
|
||||
String currentName;
|
||||
if (this.isIntrinsic() && !this.getHostCard().isMutated() && cardState != null) {
|
||||
currentName = cardState.getName();
|
||||
}
|
||||
else {
|
||||
currentName = getHostCard().getName();
|
||||
}
|
||||
desc = CardTranslation.translateSingleDescriptionText(desc, currentName);
|
||||
desc = TextUtil.fastReplace(desc, "CARDNAME", CardTranslation.getTranslatedName(currentName));
|
||||
desc = TextUtil.fastReplace(desc, "NICKNAME", Lang.getInstance().getNickName(CardTranslation.getTranslatedName(currentName)));
|
||||
|
||||
@@ -842,7 +842,14 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit
|
||||
}
|
||||
String desc = node.getDescription();
|
||||
if (node.getHostCard() != null) {
|
||||
String currentName = node.getHostCard().getName();
|
||||
String currentName;
|
||||
// if alternate state is viewed while card uses original
|
||||
if (node.isIntrinsic() && !node.getHostCard().isMutated() && node.cardState != null) {
|
||||
currentName = node.cardState.getName();
|
||||
}
|
||||
else {
|
||||
currentName = node.getHostCard().getName();
|
||||
}
|
||||
desc = CardTranslation.translateMultipleDescriptionText(desc, currentName);
|
||||
desc = TextUtil.fastReplace(desc, "CARDNAME", CardTranslation.getTranslatedName(currentName));
|
||||
desc = TextUtil.fastReplace(desc, "NICKNAME", Lang.getInstance().getNickName(CardTranslation.getTranslatedName(currentName)));
|
||||
|
||||
@@ -208,7 +208,13 @@ public class StaticAbility extends CardTraitBase implements IIdentifiable, Clone
|
||||
@Override
|
||||
public final String toString() {
|
||||
if (hasParam("Description") && !this.isSuppressed()) {
|
||||
String currentName = this.hostCard.getName();
|
||||
String currentName;
|
||||
if (this.isIntrinsic() && !this.getHostCard().isMutated() && cardState != null) {
|
||||
currentName = cardState.getName();
|
||||
}
|
||||
else {
|
||||
currentName = getHostCard().getName();
|
||||
}
|
||||
String desc = CardTranslation.translateSingleDescriptionText(getParam("Description"), currentName);
|
||||
desc = TextUtil.fastReplace(desc, "CARDNAME", CardTranslation.getTranslatedName(currentName));
|
||||
desc = TextUtil.fastReplace(desc, "NICKNAME", Lang.getInstance().getNickName(CardTranslation.getTranslatedName(currentName)));
|
||||
|
||||
@@ -131,7 +131,13 @@ public abstract class Trigger extends TriggerReplacementBase {
|
||||
if (hasParam("TriggerDescription") && !this.isSuppressed()) {
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String currentName = getHostCard().getName();
|
||||
String currentName;
|
||||
if (this.isIntrinsic() && !this.getHostCard().isMutated() && cardState != null) {
|
||||
currentName = cardState.getName();
|
||||
}
|
||||
else {
|
||||
currentName = getHostCard().getName();
|
||||
}
|
||||
String desc = getParam("TriggerDescription");
|
||||
if (!desc.contains("ABILITY")) {
|
||||
desc = CardTranslation.translateSingleDescriptionText(getParam("TriggerDescription"), currentName);
|
||||
|
||||
Reference in New Issue
Block a user