mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- Added the static effect "CantPlayLand".
- Added Solfatara and Turf Wound.
This commit is contained in:
@@ -1664,6 +1664,18 @@ public abstract class Player extends GameEntity {
|
||||
* @return a boolean.
|
||||
*/
|
||||
public final boolean canPlayLand() {
|
||||
|
||||
// CantBeCast static abilities
|
||||
final CardList allp = AllZoneUtil.getCardsIn(Zone.Battlefield);
|
||||
for (final Card ca : allp) {
|
||||
final ArrayList<StaticAbility> staticAbilities = ca.getStaticAbilities();
|
||||
for (final StaticAbility stAb : staticAbilities) {
|
||||
if (stAb.applyAbility("CantPlayLand", null, this)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return Phase.canCastSorcery(this)
|
||||
&& (numLandsPlayed < maxLandsToPlay || getCardsIn(Zone.Battlefield, "Fastbond").size() > 0);
|
||||
}
|
||||
|
||||
@@ -282,6 +282,10 @@ public class StaticAbility {
|
||||
if (mode.equals("CantBeCast")) {
|
||||
return StaticAbilityCantBeCast.applyCantBeCastAbility(this, card, activator);
|
||||
}
|
||||
|
||||
if (mode.equals("CantPlayLand")) {
|
||||
return StaticAbilityCantBeCast.applyCantPlayLandAbility(this, card, activator);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -77,5 +77,33 @@ public class StaticAbilityCantBeCast {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO Write javadoc for this method.
|
||||
*
|
||||
* @param stAb
|
||||
* a StaticAbility
|
||||
* @param card
|
||||
* the card
|
||||
* @param activator
|
||||
* the activator
|
||||
* @return true, if successful
|
||||
*/
|
||||
public static boolean applyCantPlayLandAbility(final StaticAbility stAb, final Card card, final Player player) {
|
||||
final HashMap<String, String> params = stAb.getMapParams();
|
||||
final Card hostCard = stAb.getHostCard();
|
||||
|
||||
if (params.containsKey("ValidCard") && card != null
|
||||
&& !card.isValid(params.get("ValidCard").split(","), hostCard.getController(), hostCard)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (params.containsKey("Player") && (player != null)
|
||||
&& !player.isValid(params.get("Player"), hostCard.getController(), hostCard)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user