War Room fix

This commit is contained in:
tool4EvEr
2022-11-11 23:34:39 +01:00
parent 0b4f8e0854
commit 1ab6338c1d
3 changed files with 18 additions and 10 deletions

View File

@@ -20,6 +20,7 @@ package forge.game.spellability;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.google.common.base.Predicate;
import com.google.common.collect.Iterables; import com.google.common.collect.Iterables;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
@@ -544,6 +545,13 @@ public class SpellAbilityRestriction extends SpellAbilityVariables {
} }
} }
if (this.getGameTypes().size() > 0) {
Predicate<GameType> pgt = type -> game.getRules().hasAppliedVariant(type);
if (!Iterables.any(getGameTypes(), pgt)) {
return false;
}
}
return true; return true;
} }

View File

@@ -371,6 +371,15 @@ public class SpellAbilityVariables implements Cloneable {
this.phases.addAll(phases); this.phases.addAll(phases);
} }
/**
* Gets the game types.
*
* @return the game types
*/
public final Set<GameType> getGameTypes() {
return this.gameTypes;
}
/** /**
* <p> * <p>
* Setter for the field <code>gameTypes</code>. * Setter for the field <code>gameTypes</code>.
@@ -709,15 +718,6 @@ public class SpellAbilityVariables implements Cloneable {
return this.firstCombatOnly = first; return this.firstCombatOnly = first;
} }
/**
* Gets the game types.
*
* @return the game types
*/
public final Set<GameType> getGameTypes() {
return this.gameTypes;
}
/** /**
* Gets the present defined. * Gets the present defined.
* *

View File

@@ -2,7 +2,7 @@ Name:War Room
ManaCost:no cost ManaCost:no cost
Types:Land Types:Land
A:AB$ Mana | Cost$ T | Produced$ C | SpellDescription$ Add {C}. A:AB$ Mana | Cost$ T | Produced$ C | SpellDescription$ Add {C}.
A:AB$ Draw | Cost$ 3 T PayLife<X> | CostDesc$ {3}, {T}, Pay life equal to the number of colors in your commanders' color identity: | NumCards$ 1 | SpellDescription$ Draw a card. A:AB$ Draw | Cost$ 3 T PayLife<X> | ActivationGameTypes$ Commander,Brawl,TinyLeaders,Oathbreaker | CostDesc$ {3}, {T}, Pay life equal to the number of colors in your commanders' color identity: | NumCards$ 1 | SpellDescription$ Draw a card.
SVar:X:Count$ColorsColorIdentity SVar:X:Count$ColorsColorIdentity
AI:RemoveDeck:NonCommander AI:RemoveDeck:NonCommander
Oracle:{T}: Add {C}.\n{3}, {T}, Pay life equal to the number of colors in your commanders' color identity: Draw a card. Oracle:{T}: Add {C}.\n{3}, {T}, Pay life equal to the number of colors in your commanders' color identity: Draw a card.