From afe89a10561b51fd0eddd5cdbd0ed09c5edc8a61 Mon Sep 17 00:00:00 2001 From: Oleg Agafonov Date: Sat, 17 Jun 2023 08:19:22 +0400 Subject: [PATCH] momir game: fixed game error on start, added momir emblem image --- .../plugins/card/dl/sources/ScryfallImageSupportTokens.java | 4 ++++ .../Mage.Game.MomirGame/src/mage/game/MomirGame.java | 6 +++++- .../main/java/mage/game/command/emblems/MomirEmblem.java | 2 +- Mage/src/main/resources/tokens-database.txt | 1 + 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/ScryfallImageSupportTokens.java b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/ScryfallImageSupportTokens.java index 280e8b8f58..9f644bf99b 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/ScryfallImageSupportTokens.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/ScryfallImageSupportTokens.java @@ -2006,6 +2006,10 @@ public class ScryfallImageSupportTokens { put("ODY/Wurm", "https://api.scryfall.com/cards/pr2/6/en?format=image"); put("ODY/Zombie", "https://api.scryfall.com/cards/pr2/4/en?format=image"); + // DIS + put("DIS/Emblem Momir", "https://api.scryfall.com/cards/pmoa/61/en?format=image"); + + // generate supported sets supportedSets.clear(); for (String cardName : this.keySet()) { diff --git a/Mage.Server.Plugins/Mage.Game.MomirGame/src/mage/game/MomirGame.java b/Mage.Server.Plugins/Mage.Game.MomirGame/src/mage/game/MomirGame.java index efa5ee8b89..0c9e3464c6 100644 --- a/Mage.Server.Plugins/Mage.Game.MomirGame/src/mage/game/MomirGame.java +++ b/Mage.Server.Plugins/Mage.Game.MomirGame/src/mage/game/MomirGame.java @@ -49,7 +49,11 @@ public class MomirGame extends GameImpl { for (UUID playerId : state.getPlayerList(startingPlayerId)) { Player player = getPlayer(playerId); if (player != null) { - CardInfo cardInfo = CardRepository.instance.findCard("Momir Vig, Simic Visionary"); + CardInfo cardInfo = CardRepository.instance.findCardWithPreferredSetAndNumber("Momir Vig, Simic Visionary", "DIS", "118"); + if (cardInfo == null) { + // how-to fix: make sure that a Momir Emblem and a source card uses same set (DIS - Dissension) + throw new IllegalStateException("Wrong code usage: momir card and emblem must exists in the same set (DIS)"); + } addEmblem(new MomirEmblem(), cardInfo.getCard(), playerId); } } diff --git a/Mage/src/main/java/mage/game/command/emblems/MomirEmblem.java b/Mage/src/main/java/mage/game/command/emblems/MomirEmblem.java index 9ed4c3295f..2c0ba23ba7 100644 --- a/Mage/src/main/java/mage/game/command/emblems/MomirEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/MomirEmblem.java @@ -32,7 +32,7 @@ public final class MomirEmblem extends Emblem { // Faking Vanguard as an Emblem; need to come back to this and add a new type of CommandObject public MomirEmblem() { - super("Emblem Momir Vig, Simic Visionary"); + super("Emblem Momir"); // {X}, Discard a card: Create a token that's a copy of a creature card with converted mana cost X chosen at random. // Activate this ability only any time you could cast a sorcery and only once each turn. diff --git a/Mage/src/main/resources/tokens-database.txt b/Mage/src/main/resources/tokens-database.txt index ab0466710b..2aef302e89 100644 --- a/Mage/src/main/resources/tokens-database.txt +++ b/Mage/src/main/resources/tokens-database.txt @@ -114,6 +114,7 @@ |Generate|EMBLEM:MOM|Emblem Wrenn|||WrennAndRealmbreakerEmblem| |Generate|EMBLEM:MOC|Emblem Elspeth|||ElspethSunsChampionEmblem| |Generate|EMBLEM:MOC|Emblem Teferi|||TeferisTalentEmblem| +|Generate|EMBLEM:DIS|Emblem Momir|||MomirEmblem| # ALL PLANES # Usage hints: