MOM: Added card "Omnath, Locus of All" and its abilities and effects (#10029)

* MOM: Added card "Omnath, Locus of All" and its abilities and effects

* fixed rule text

* added art variant

* test

---------

Co-authored-by: Daniel Eberhard <daniel.h.e@gmx.de>
Co-authored-by: Evan Kranzler <theelk801@gmail.com>
This commit is contained in:
Merlingilb 2023-04-15 19:16:51 +02:00 committed by GitHub
parent 3b909d7b2a
commit 0623f52f68
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 161 additions and 4 deletions

View file

@ -38,6 +38,7 @@ public class ManaPool implements Serializable {
private final List<ManaPoolItem> poolBookmark = new ArrayList<>(); // mana pool bookmark for rollback purposes
private final Set<ManaType> doNotEmptyManaTypes = new HashSet<>();
private boolean manaBecomesBlack = false;
private boolean manaBecomesColorless = false;
private static final class ConditionalManaInfo {
@ -71,6 +72,7 @@ public class ManaPool implements Serializable {
poolBookmark.add(item.copy());
}
this.doNotEmptyManaTypes.addAll(pool.doNotEmptyManaTypes);
this.manaBecomesBlack = pool.manaBecomesBlack;
this.manaBecomesColorless = pool.manaBecomesColorless;
}
@ -225,6 +227,7 @@ public class ManaPool implements Serializable {
public void clearEmptyManaPoolRules() {
doNotEmptyManaTypes.clear();
this.manaBecomesBlack = false;
this.manaBecomesColorless = false;
}
@ -232,6 +235,14 @@ public class ManaPool implements Serializable {
doNotEmptyManaTypes.add(manaType);
}
public void setManaBecomesBlack(boolean manaBecomesBlack) {
this.manaBecomesBlack = manaBecomesBlack;
}
public boolean isManaBecomesBlack() {
return manaBecomesBlack;
}
public void setManaBecomesColorless(boolean manaBecomesColorless) {
this.manaBecomesColorless = manaBecomesColorless;
}
@ -274,15 +285,21 @@ public class ManaPool implements Serializable {
&& game.getTurnPhaseType() != TurnPhase.END) {
return 0;
}
if (!manaBecomesColorless) {
if (manaBecomesBlack) {
int amount = toEmpty.get(manaType);
toEmpty.clear(manaType);
return amount;
toEmpty.add(ManaType.BLACK, amount);
return 0;
}
if (manaBecomesColorless) {
int amount = toEmpty.get(manaType);
toEmpty.clear(manaType);
toEmpty.add(ManaType.COLORLESS, amount);
return 0;
}
int amount = toEmpty.get(manaType);
toEmpty.clear(manaType);
toEmpty.add(ManaType.COLORLESS, amount);
return 0;
return amount;
}
public Mana getMana() {