Merge remote-tracking branch 'core/master'

This commit is contained in:
Anthony Calosa
2021-03-29 18:30:55 +08:00
7 changed files with 40 additions and 15 deletions

View File

@@ -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)));

View File

@@ -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)));

View File

@@ -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)));

View File

@@ -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);

View File

@@ -2,8 +2,8 @@ Name:Inzerva, Master of Insights
ManaCost:1 2/U 2/R
Types:Legendary Planeswalker Inzerva
Loyalty:4
A:AB$ Draw | Cost$ AddCounter<2/LOYALTY> | Planeswalker$ True | NumCards$ 2 | ValidTgts$ Player | TgtPrompt$ Choose a player | SpellDescription$ Draw two cards, then discard a card. | SubAbility$ DBDiscard
SVar:DBDiscard:DB$ Discard | Defined$ Targeted | NumCards$ 1 | Mode$ TgtChoose
A:AB$ Draw | Cost$ AddCounter<2/LOYALTY> | Planeswalker$ True | NumCards$ 2 | SpellDescription$ Draw two cards, then discard a card. | SubAbility$ DBDiscard
SVar:DBDiscard:DB$ Discard | Defined$ You | NumCards$ 1 | Mode$ TgtChoose
A:AB$ RepeatEach | Cost$ SubCounter<2/LOYALTY> | RepeatPlayers$ Opponent | RepeatSubAbility$ DBDig | SubAbility$ DBScry | Planeswalker$ True | SpellDescription$ Look at the top two cards of each other player's library, then put any number of them on the bottom of that library and the rest on top in any order.
SVar:DBDig:DB$ Dig | Defined$ Remembered | DigNum$ 2 | AnyNumber$ True | DestinationZone$ Library | LibraryPosition2$ 0
SVar:DBScry:DB$ Scry | ScryNum$ 2

View File

@@ -1,6 +1,6 @@
Name:Adrix and Nev, Twincasters
ManaCost:2 G U
Types:Creature Merfolk Wizard
Types:Legendary Creature Merfolk Wizard
PT:2/2
K:Ward:2
R:Event$ CreateToken | ActiveZones$ Battlefield | ValidPlayer$ Player | ReplaceWith$ DoubleToken | Description$ If one or more tokens would be created, twice that many of those tokens are created instead.

View File

@@ -266,11 +266,11 @@ public class TargetSelection {
}
if (((CardView) chosen).getZone().equals(ZoneType.Stack)) {
for (final SpellAbilityStackInstance si : game.getStack()) {
// avoid peeking own SI so target is not changed
if (si.compareToSpellAbility(ability)) {
continue;
}
SpellAbility abilityOnStack = si.getSpellAbility(true);
if (si.compareToSpellAbility(ability)) {
// By peeking at stack item, target is set to its SI state. So set it back before adding targets
ability.resetTargets();
}
if (abilityOnStack.getHostCard().getView().equals(chosen)) {
ability.getTargets().add(abilityOnStack);
break;
@@ -293,11 +293,11 @@ public class TargetSelection {
final Game game = ability.getActivatingPlayer().getGame();
for (final SpellAbilityStackInstance si : game.getStack()) {
// avoid peeking own SI so target is not changed
if (si.compareToSpellAbility(ability)) {
continue;
}
SpellAbility abilityOnStack = si.getSpellAbility(true);
if (si.compareToSpellAbility(ability)) {
// By peeking at stack item, target is set to its SI state. So set it back before adding targets
ability.resetTargets();
}
if (ability.canTargetSpellAbility(abilityOnStack)) {
stackItemViewCache.put(si.getView(), si);
selectOptions.add(si.getView());