mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
make Worms of the Earth into a GlobalRuleChange
This commit is contained in:
@@ -258,6 +258,36 @@ public class GameAction {
|
||||
}
|
||||
}
|
||||
|
||||
// special rule for Worms of the Earth
|
||||
if (toBattlefield && game.getStaticEffects().getGlobalRuleChange(GlobalRuleChange.noLandBattlefield)) {
|
||||
// something that is already a Land cant enter the battlefield
|
||||
if (c.isLand()) {
|
||||
return c;
|
||||
}
|
||||
// check if something would be a land
|
||||
Card noLandLKI = CardUtil.getLKICopy(c);
|
||||
|
||||
//setZone is not enough
|
||||
//noLandLKI.setZone(zoneTo);
|
||||
noLandLKI.setImmutable(true); // immu doesn't trigger Zone
|
||||
zoneTo.add(noLandLKI);
|
||||
|
||||
noLandLKI.setImmutable(false); // but need to remove that or Static doesn't find it
|
||||
checkStaticAbilities(false, Sets.newHashSet(noLandLKI));
|
||||
|
||||
boolean noLand = noLandLKI.isLand();
|
||||
zoneTo.remove(noLandLKI);
|
||||
|
||||
// reset static
|
||||
checkStaticAbilities(false, Sets.newHashSet(noLandLKI));
|
||||
|
||||
if(noLand) {
|
||||
// if something would only be a land when entering the battlefield and not before
|
||||
// put it into the graveyard instead
|
||||
zoneTo = c.getOwner().getZone(ZoneType.Graveyard);
|
||||
}
|
||||
}
|
||||
|
||||
if (!suppress) {
|
||||
if (zoneFrom == null) {
|
||||
copied.getOwner().addInboundToken(copied);
|
||||
|
||||
@@ -34,7 +34,8 @@ public enum GlobalRuleChange {
|
||||
onlyOneBlocker ("No more than one creature can block each combat."),
|
||||
onlyTwoBlockers ("No more than two creatures can block each combat."),
|
||||
toughnessAssignsDamage ("Each creature assigns combat damage equal to its toughness rather than its power."),
|
||||
blankIsChaos("Each blank roll of the planar dice is a {CHAOS} roll.");
|
||||
blankIsChaos("Each blank roll of the planar dice is a {CHAOS} roll."),
|
||||
noLandBattlefield("Lands can't enter the battlefield.");
|
||||
|
||||
private final String ruleText;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user