mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- Added the static ability "CantBeActivated".
- Converted Grand Abolisher.
This commit is contained in:
@@ -4,7 +4,7 @@ Types:Creature Human Cleric
|
|||||||
Text:no text
|
Text:no text
|
||||||
PT:2/2
|
PT:2/2
|
||||||
S:Mode$ CantBeCast | ValidCard$ Card | PlayerTurn$ True | Caster$ Opponent | Description$ During your turn, your opponents can't cast spells or activate abilities of artifacts, creatures, or enchantments.
|
S:Mode$ CantBeCast | ValidCard$ Card | PlayerTurn$ True | Caster$ Opponent | Description$ During your turn, your opponents can't cast spells or activate abilities of artifacts, creatures, or enchantments.
|
||||||
S:Mode$ Continuous | Affected$ Artifact.YouDontCtrl,Creature.YouDontCtrl,Enchantment.YouDontCtrl | AddHiddenKeyword$ HIDDEN CARDNAME's activated abilities can't be activated. | PlayerTurn$ True
|
S:Mode$ CantBeActivated | ValidCard$ Artifact,Creature,Enchantment | PlayerTurn$ True | Activator$ Opponent
|
||||||
SVar:Rarity:Rare
|
SVar:Rarity:Rare
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/grand_abolisher.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/grand_abolisher.jpg
|
||||||
SetInfo:M12|Rare|http://magiccards.info/scans/en/m12/19.jpg
|
SetInfo:M12|Rare|http://magiccards.info/scans/en/m12/19.jpg
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
package forge.card.spellability;
|
package forge.card.spellability;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import forge.*;
|
import forge.*;
|
||||||
import forge.Constant.Zone;
|
import forge.Constant.Zone;
|
||||||
import forge.card.cost.Cost;
|
import forge.card.cost.Cost;
|
||||||
import forge.card.cost.Cost_Payment;
|
import forge.card.cost.Cost_Payment;
|
||||||
|
import forge.card.staticAbility.StaticAbility;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -51,6 +54,19 @@ abstract public class Ability_Activated extends SpellAbility implements java.io.
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Player activator = getActivatingPlayer();
|
||||||
|
|
||||||
|
//CantBeActivated static abilities
|
||||||
|
CardList allp = AllZoneUtil.getCardsIn(Zone.Battlefield);
|
||||||
|
for (Card ca : allp) {
|
||||||
|
ArrayList<StaticAbility> staticAbilities = ca.getStaticAbilities();
|
||||||
|
for (StaticAbility stAb : staticAbilities) {
|
||||||
|
if(stAb.applyAbility("CantBeActivated", c, activator)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (c.hasKeyword("CARDNAME's activated abilities can't be activated.") || isSuppressed()) {
|
if (c.hasKeyword("CARDNAME's activated abilities can't be activated.") || isSuppressed()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ abstract public class Spell extends SpellAbility implements java.io.Serializable
|
|||||||
|
|
||||||
Player activator = getActivatingPlayer();
|
Player activator = getActivatingPlayer();
|
||||||
|
|
||||||
//Prevent Damage static abilities
|
//CantBeCast static abilities
|
||||||
CardList allp = AllZoneUtil.getCardsIn(Zone.Battlefield);
|
CardList allp = AllZoneUtil.getCardsIn(Zone.Battlefield);
|
||||||
for (Card ca : allp) {
|
for (Card ca : allp) {
|
||||||
ArrayList<StaticAbility> staticAbilities = ca.getStaticAbilities();
|
ArrayList<StaticAbility> staticAbilities = ca.getStaticAbilities();
|
||||||
|
|||||||
@@ -181,6 +181,9 @@ public class StaticAbility {
|
|||||||
if (mode.equals("CantBeCast"))
|
if (mode.equals("CantBeCast"))
|
||||||
return StaticAbility_CantBeCast.applyCantBeCastAbility(this, card, activator);
|
return StaticAbility_CantBeCast.applyCantBeCastAbility(this, card, activator);
|
||||||
|
|
||||||
|
if (mode.equals("CantBeActivated"))
|
||||||
|
return StaticAbility_CantBeCast.applyCantBeActivatedAbility(this, card, activator);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,29 @@ public class StaticAbility_CantBeCast {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(params.containsKey("Caster") && !activator.isValid(params.get("Caster"), hostCard.getController(), hostCard)) {
|
if(params.containsKey("Caster") && activator != null &&
|
||||||
|
!activator.isValid(params.get("Caster"), hostCard.getController(), hostCard)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* TODO Write javadoc for this method.
|
||||||
|
* @param stAb a StaticAbility
|
||||||
|
*/
|
||||||
|
public static boolean applyCantBeActivatedAbility(final StaticAbility stAb, Card card, Player activator) {
|
||||||
|
HashMap<String, String> params = stAb.getMapParams();
|
||||||
|
Card hostCard = stAb.getHostCard();
|
||||||
|
|
||||||
|
if(params.containsKey("ValidCard") && !card.isValid(params.get("ValidCard").split(","), hostCard.getController(), hostCard)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(params.containsKey("Activator") && activator != null &&
|
||||||
|
!activator.isValid(params.get("Activator"), hostCard.getController(), hostCard)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user