Merge pull request #2916 from Northmoc/battle2

MOM: more Battle-related CardProperty fun!
This commit is contained in:
Anthony Calosa
2023-04-14 03:35:18 +08:00
committed by GitHub
18 changed files with 119 additions and 6 deletions

View File

@@ -23,6 +23,8 @@ public class ImmediateTriggerEffect extends SpellAbilityEffect {
protected String getStackDescription(SpellAbility sa) {
if (sa.hasParam("TriggerDescription")) {
return sa.getParam("TriggerDescription");
} else if (sa.hasParam("SpellDescription")) {
return sa.getParam("SpellDescription");
}
return "";

View File

@@ -256,9 +256,10 @@ public class PlayEffect extends SpellAbilityEffect {
if (sa.hasParam("ShowCardToActivator")) {
game.getAction().revealTo(tgtCard, controller);
}
String prompt = sa.hasParam("CastTransformed") ? "lblDoYouWantPlayCardTransformed" : "lblDoYouWantPlayCard";
if (singleOption && sa.getTargetCard() == null)
sa.setPlayEffectCard(tgtCard);// show card to play rather than showing the source card
if (singleOption && !controller.getController().confirmAction(sa, null, Localizer.getInstance().getMessage("lblDoYouWantPlayCard", CardTranslation.getTranslatedName(tgtCard.getName())), null)) {
if (singleOption && !controller.getController().confirmAction(sa, null, Localizer.getInstance().getMessage(prompt, CardTranslation.getTranslatedName(tgtCard.getName())), null)) {
if (wasFaceDown) {
tgtCard.turnFaceDownNoUpdate();
tgtCard.updateStateForView();

View File

@@ -26,6 +26,7 @@ public class CardDamageHistory {
private boolean creatureGotBlockedThisCombat = false;
private List<GameEntity> attackedThisTurn = Lists.newArrayList();
private boolean attackedBattleThisTurn = false;
private final List<Player> creatureAttackedLastTurnOf = Lists.newArrayList();
private final List<Player> NotAttackedSinceLastUpkeepOf = Lists.newArrayList();
@@ -59,6 +60,12 @@ public class CardDamageHistory {
if (defender != null) {
attackedThisTurn.add(defender);
if (defender instanceof Card) {
final Card def = (Card) defender;
if (def.isBattle()) {
attackedBattleThisTurn = true;
}
}
}
}
/**
@@ -84,6 +91,9 @@ public class CardDamageHistory {
public final boolean hasAttackedThisTurn(GameEntity e) {
return this.attackedThisTurn.contains(e);
}
public final boolean hasAttackedBattleThisTurn() {
return this.attackedBattleThisTurn;
}
/**
* <p>
* Setter for the field <code>creatureAttackedLastTurn</code>.
@@ -272,6 +282,7 @@ public class CardDamageHistory {
public void newTurn() {
attackedThisTurn.clear();
attackedBattleThisTurn = false;
damagedThisCombat.clear();
damageDoneThisTurn.clear();

View File

@@ -218,6 +218,14 @@ public class CardProperty {
|| !sourceController.getOpponents().contains(card.getProtectingPlayer())) {
return false;
}
} else if (property.startsWith("ProtectedBy")) {
if (card.getProtectingPlayer() == null) {
return false;
}
final List<Player> lp = AbilityUtils.getDefinedPlayers(source, property.substring(12), spellAbility);
if (!lp.contains(card.getProtectingPlayer())) {
return false;
}
} else if (property.startsWith("DefendingPlayer")) {
Player p = property.endsWith("Ctrl") ? controller : card.getOwner();
if (!game.getPhaseHandler().inCombat()) {
@@ -1242,6 +1250,10 @@ public class CardProperty {
if (card.getDamageHistory().getCreatureAttacksThisTurn() == 0) {
return false;
}
} else if (property.startsWith("attackedBattleThisTurn")) {
if (!card.getDamageHistory().hasAttackedBattleThisTurn()) {
return false;
}
} else if (property.startsWith("attackedYouThisTurn")) {
if (!card.getDamageHistory().hasAttackedThisTurn(sourceController)) {
return false;

View File

@@ -3,12 +3,12 @@ ManaCost:3 B
Types:Legendary Creature Ogre Demon
PT:4/4
A:AB$ Scry | Cost$ B Sac<1/Creature> | ScryNum$ 2 | SpellDescription$ Scry 2.
A:AB$ Dig | Cost$ 2 R T | Defined$ You | DigNum$ 1 | ChangeNum$ All | DestinationZone$ Exile | RememberChanged$ True | SubAbility$ DBEffect | AILogic$ ExileAndPlayUntilEOT | StackDescription$ SpellDescription | SpellDescription$ Exile the top card of your library. You may play that card this turn. When you exile a nonland card this way, CARDNAME deals damage equal to the exiled card's mana value to any target.
SVar:DBEffect:DB$ Effect | RememberObjects$ RememberedCard | StaticAbilities$ Play | SubAbility$ DBImmediateTrigger | ExileOnMoved$ Exile
SVar:Play:Mode$ Continuous | MayPlay$ True | EffectZone$ Command | Affected$ Card.IsRemembered | AffectedZone$ Exile | Description$ You may play this card this turn.
SVar:DBImmediateTrigger:DB$ ImmediateTrigger | ConditionDefined$ Remembered | ConditionPresent$ Card.nonLand | Execute$ TrigDealDamage | RememberObjects$ RememberedCard | SubAbility$ DBCleanup | StackDescription$ None | TriggerDescription$ When you exile a nonland card this way, CARDNAME deals damage equal to the exiled card's mana value to any target.
A:AB$ Dig | Cost$ 2 R T | Defined$ You | DigNum$ 1 | ChangeNum$ All | DestinationZone$ Exile | RememberChanged$ True | SubAbility$ DBEffect | AILogic$ ExileAndPlayUntilEOT | StackDescription$ SpellDescription | SpellDescription$ Exile the top card of your library.
SVar:DBEffect:DB$ Effect | RememberObjects$ RememberedCard | StaticAbilities$ Play | SubAbility$ DBImmediateTrigger | ExileOnMoved$ Exile | SpellDescription$ You may play that card this turn.
SVar:Play:Mode$ Continuous | MayPlay$ True | EffectZone$ Command | Affected$ Card.IsRemembered | AffectedZone$ Exile | Description$ You may play that card this turn.
SVar:DBImmediateTrigger:DB$ ImmediateTrigger | ConditionDefined$ Remembered | ConditionPresent$ Card.nonLand | Execute$ TrigDealDamage | RememberObjects$ RememberedCard | SubAbility$ DBCleanup | SpellDescription$ When you exile a nonland card this way, CARDNAME deals damage equal to the exiled card's mana value to any target.
SVar:TrigDealDamage:DB$ DealDamage | ValidTgts$ Creature,Player,Planeswalker | TgtPrompt$ Select any target | NumDmg$ X
SVar:X:TriggerRemembered$CardManaCost
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
Deckhas:Ability$Sacrifice
Oracle:{B}, Sacrifice a creature: Scry 2.\n{2}{R}, {T}, Exile the top card of your library. You may play that card this turn. When you exile a nonland card this way, Hidetsugu, Devouring Chaos deals damage equal to the exiled card's mana value to any target.
Oracle:{B}, Sacrifice a creature: Scry 2.\n{2}{R}, {T}: Exile the top card of your library. You may play that card this turn. When you exile a nonland card this way, Hidetsugu, Devouring Chaos deals damage equal to the exiled card's mana value to any target.

View File

@@ -0,0 +1,20 @@
Name:Invasion of Ixalan
ManaCost:1 G
Types:Battle Siege
Defense:4
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigDig | TriggerDescription$ When CARDNAME enters the battlefield, look at the top five cards of your library. You may reveal a permanent card from among them and put it into your hand. Put the rest on the bottom of your library in a random order.
SVar:TrigDig:DB$ Dig | DigNum$ 5 | ChangeNum$ 1 | Optional$ True | ChangeValid$ Permanent | ForceRevealToController$ True | RestRandomOrder$ True
AlternateMode:DoubleFaced
Oracle:(As a Siege enters, choose an opponent to protect it. You and others can attack it. When it's defeated, exile it, then cast it transformed.)\nWhen Invasion of Ixalan enters the battlefield, look at the top five cards of your library. You may reveal a permanent card from among them and put it into your hand. Put the rest on the bottom of your library in a random order.
ALTERNATE
Name:Belligerent Regisaur
ManaCost:no cost
Colors:green
Types:Creature Dinosaur
PT:4/3
K:Trample
T:Mode$ SpellCast | ValidCard$ Card | ValidActivatingPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigPump | TriggerDescription$ Whenever you cast a spell, CARDNAME gains indestructible until end of turn.
SVar:TrigPump:DB$ Pump | KW$ Indestructible
Oracle:Trample\nWhenever you cast a spell, Belligerent Regisaur gains indestructible until end of turn.

View File

@@ -0,0 +1,29 @@
Name:Invasion of Kaldheim
ManaCost:3 R
Types:Battle Siege
Defense:4
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigExileHand | TriggerDescription$ When CARDNAME enters the battlefield, exile all cards from your hand, then draw that many cards. Until the end of your next turn, you may play cards exiled this way.
SVar:TrigExileHand:DB$ ChangeZoneAll | ChangeType$ Card.YouOwn | Origin$ Hand | Destination$ Exile | RememberChanged$ True | SubAbility$ DBDraw
SVar:DBDraw:DB$ Draw | Defined$ You | NumCards$ Y | SubAbility$ DBEffect
SVar:DBEffect:DB$ Effect | RememberObjects$ RememberedCard | StaticAbilities$ Play | Duration$ UntilTheEndOfYourNextTurn | ForgetOnMoved$ Exile | SubAbility$ DBCleanup
SVar:Play:Mode$ Continuous | MayPlay$ True | EffectZone$ Command | Affected$ Card.IsRemembered | AffectedZone$ Exile | Description$ Until the end of your next turn, you may play cards exiled this way.
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:Y:Count$RememberedSize
AlternateMode:DoubleFaced
Oracle:(As a Siege enters, choose an opponent to protect it. You and others can attack it. When it's defeated, exile it, then cast it transformed.)\nWhen Invasion of Kaldheim enters the battlefield, exile all cards from your hand, then draw that many cards. Until the end of your next turn, you may play cards exiled this way.
ALTERNATE
Name:Pyre of the World Tree
ManaCost:no cost
Colors:red
Types:Enchantment
A:AB$ DealDamage | Cost$ Discard<1/Land> | ValidTgts$ Creature,Player,Planeswalker | TgtPrompt$ Select any target | NumDmg$ 2 | SpellDescription$ CARDNAME deals 2 damage to any target.
T:Mode$ Discarded | ValidCard$ Land.YouOwn | TriggerZones$ Battlefield | Execute$ TrigExile | TriggerDescription$ Whenever you discard a land card, exile the top card of your library. You may play that card this turn.
SVar:TrigExile:DB$ Dig | DigNum$ 1 | ChangeNum$ All | DestinationZone$ Exile | RememberChanged$ True | SubAbility$ DBEffect | AILogic$ ExileAndPlayUntilEOT
SVar:DBEffect:DB$ Effect | RememberObjects$ RememberedCard | StaticAbilities$ Play | ExileOnMoved$ Exile | SubAbility$ DBCleanup
SVar:Play:Mode$ Continuous | MayPlay$ True | EffectZone$ Command | Affected$ Card.IsRemembered | AffectedZone$ Exile | Description$ You may play that card this turn.
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
DeckHas:Ability$Discard
DeckHints:Ability$Discard
Oracle:Discard a land card: Pyre of the World Tree deals 2 damage to any target.\nWhenever you discard a land card, exile the top card of your library. You may play that card this turn.

View File

@@ -0,0 +1,11 @@
Name:Rampaging Raptor
ManaCost:2 R R
Types:Creature Dinosaur
PT:4/4
K:Trample
K:Haste
A:AB$ Pump | Cost$ 2 R | NumAtt$ 2 | SpellDescription$ CARDNAME gets +2/+0 until end of turn.
T:Mode$ DamageDone | ValidSource$ Card.Self | ValidTarget$ Opponent | CombatDamage$ True | TriggerZones$ Battlefield | Execute$ TrigDamage | TriggerDescription$ Whenever CARDNAME deals combat damage to an opponent, it deals that much damage to target planeswalker that player controls or battle that player protects.
SVar:TrigDamage:DB$ DealDamage | ValidTgts$ Planeswalker.ControlledBy TriggeredTarget,Battle.ProtectedBy TriggeredTarget | TgtPrompt$ Select target planeswalker that player controls or battle that player protects | NumDmg$ X
SVar:X:TriggerCount$DamageAmount
Oracle:Trample, haste\n{2}{R}: Rampaging Raptor gets +2/+0 until end of turn.\nWhenever Rampaging Raptor deals combat damage to an opponent, it deals that much damage to target planeswalker that player controls or battle that player protects.

View File

@@ -0,0 +1,8 @@
Name:War Historian
ManaCost:2 G
Types:Creature Human Monk
PT:3/3
K:Reach
S:Mode$ Continuous | Affected$ Card.Self+attackedBattleThisTurn | AddKeyword$ Indestructible | Description$ CARDNAME has indestructible as long as it attacked a battle this turn.
AI:RemoveDeck:Random
Oracle:Reach\nWar Historian has indestructible as long as it attacked a battle this turn.

View File

@@ -0,0 +1,11 @@
Name:Wildwood Escort
ManaCost:4 G
Types:Creature Elf Warrior
PT:3/3
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigReturn | TriggerDescription$ When CARDNAME enters the battlefield, return target creature or battle card from your graveyard to your hand.
SVar:TrigReturn:DB$ ChangeZone | Origin$ Graveyard | Destination$ Hand | TgtPrompt$ Select target creature or battle card in your graveyard | ValidTgts$ Creature.YouOwn,Battle.YouOwn
R:Event$ Moved | ActiveZones$ Battlefield | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Card.Self | ReplaceWith$ Exile | Description$ If CARDNAME would die, exile it instead.
SVar:Exile:DB$ ChangeZone | Origin$ Battlefield | Destination$ Exile | Defined$ ReplacedCard
DeckHints:Type$Battle
DeckHas:Ability$Graveyard
Oracle:When Wildwood Escort enters the battlefield, return target creature or battle card from your graveyard to your hand.\nIf Wildwood Escort would die, exile it instead.

View File

@@ -1858,6 +1858,7 @@ lblSearchPlayerZoneConfirm=Durchsuche {0} {1}?
lblCardMatchSearchingTypeInAlternateZones=Karten entsprechen deiner Suche in alternativen Zonen
lblLookingCardIn=Schaue nach Karten in
lblDoYouWantPlayCard=Möchtest du {0} spielen?
lblDoYouWantPlayCardTransformed=Möchtest du {0} verwandelt spielen?
lblSelectCardFromPlayerZone=Wähle Karte von {0} {1}
lblSelectUpToNumCardFromPlayerZone=Wähle bis zu {0} Karte(n) von {1} {2}
lblSelectCardsFromPlayerZone=Wähle Karten {0} {1}

View File

@@ -1863,6 +1863,7 @@ lblSearchPlayerZoneConfirm=Search {0} {1}?
lblCardMatchSearchingTypeInAlternateZones=cards match your searching type in Alternate Zones.
lblLookingCardIn=Looking at cards in
lblDoYouWantPlayCard=Do you want to play {0}?
lblDoYouWantPlayCardTransformed=Do you want to play {0} transformed?
lblSelectCardFromPlayerZone=Select a card from {0} {1}
lblSelectUpToNumCardFromPlayerZone=Select up to {0} cards from {1} {2}
lblSelectCardsFromPlayerZone=Select cards from {0} {1}

View File

@@ -1859,6 +1859,7 @@ lblSearchPlayerZoneConfirm=¿Buscar {0} {1}?
lblCardMatchSearchingTypeInAlternateZones=las cartas coinciden con tu tipo de búsqueda en las zonas alternativas.
lblLookingCardIn=Mirando las cartas en
lblDoYouWantPlayCard=¿Quieres jugar {0}?
lblDoYouWantPlayCardTransformed=¿Quieres jugar {0} transformada?
lblSelectCardFromPlayerZone=Selecciona una carta de {0} {1}
lblSelectUpToNumCardFromPlayerZone=Selecciona hasta {0} cartas de {1} {2}
lblSelectCardsFromPlayerZone=Selecciona cartas de {0} {1}

View File

@@ -1860,6 +1860,7 @@ lblSearchPlayerZoneConfirm=Rechercher {0} {1} ?
lblCardMatchSearchingTypeInAlternateZones=les cartes correspondent à votre type de recherche dans les zones alternatives.
lblLookingCardIn=Regarder les cartes dans
lblDoYouWantPlayCard=Voulez-vous jouer à {0} ?
lblDoYouWantPlayCardTransformed=Voulez-vous jouer à {0} transformée?
lblSelectCardFromPlayerZone=Sélectionnez une carte de {0} {1}
lblSelectUpToNumCardFromPlayerZone=S\u00e9lectionnez jusqu''\u00e0 {0} cartes de {1} {2}
lblSelectCardsFromPlayerZone=Sélectionner les cartes de {0} {1}

View File

@@ -1858,6 +1858,7 @@ lblSearchPlayerZoneConfirm=Cerchi {1} di {0}?
lblCardMatchSearchingTypeInAlternateZones=carte corrispondono alla tua ricerca in zone diverse..
lblLookingCardIn=Stai guardando le carte in
lblDoYouWantPlayCard=Vuoi giocare {0}?
lblDoYouWantPlayCardTransformed=Vuoi giocare {0} transformata?
lblSelectCardFromPlayerZone=Scegl;i una carta da {1} di {0}
lblSelectUpToNumCardFromPlayerZone=Scegli fino a {0} carte da {2} di {1}
lblSelectCardsFromPlayerZone=Scegli carte a {1} di {0}

View File

@@ -1858,6 +1858,7 @@ lblSearchPlayerZoneConfirm={0} {1}を探しますか?
lblCardMatchSearchingTypeInAlternateZones=枚もう一つの領域のカードが探すタイプと一致します。
lblLookingCardIn=カードを見る
lblDoYouWantPlayCard={0}をプレイしますか?
lblDoYouWantPlayCardTransformed={0}をプレイしますか変換?
lblSelectCardFromPlayerZone={0} {1}から 1枚のカードを選ぶ
lblSelectUpToNumCardFromPlayerZone={1} {2}から最大 {0}枚のカードを選ぶ
lblSelectCardsFromPlayerZone={0} {1}からカードを選ぶ

View File

@@ -1920,6 +1920,7 @@ lblSearchPlayerZoneConfirm=Procurar {0} {1}?
lblCardMatchSearchingTypeInAlternateZones=cartas que correspondem à busca de tipo em Zonas Alternativas.
lblLookingCardIn=Olhando as cartas em
lblDoYouWantPlayCard=Quer jogar {0}?
lblDoYouWantPlayCardTransformed=Você quer jogar {0} transformada?
lblSelectCardFromPlayerZone=Escolha a carta de {0} {1}
lblSelectUpToNumCardFromPlayerZone=Escolha até {0} cartas de {1} {2}
lblSelectCardsFromPlayerZone=Escolha cartas de {0} {1}

View File

@@ -1862,6 +1862,7 @@ lblSearchPlayerZoneConfirm=搜索{0}的{1}?
lblCardMatchSearchingTypeInAlternateZones=在你的备用区域搜索匹配类型的卡牌。
lblLookingCardIn=看牌自
lblDoYouWantPlayCard=你想要使用{0}?
lblDoYouWantPlayCardTransformed=你想要使用转化{0}?
lblSelectCardFromPlayerZone=选择一张牌从{0}的{1}
lblSelectUpToNumCardFromPlayerZone=最多选择{0}张牌来自{1}的{2}
lblSelectCardsFromPlayerZone=选择卡牌来自{0}的{1}