mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
- Added the option "RemoveAllAbilities" to continuous static abilities which will remove triggers and activated abilities (keywords and static abilities coming soon).
- Fixed Pithing Needle affecting mana abilities.
This commit is contained in:
@@ -139,6 +139,14 @@ public class StaticEffects {
|
||||
}
|
||||
}
|
||||
|
||||
//remove abilities
|
||||
if (params.containsKey("RemoveAllAbilities")) {
|
||||
SpellAbility[] spellAbility = affectedCard.getSpellAbility();
|
||||
for (SpellAbility s : spellAbility) {
|
||||
s.setTemporarilySuppressed(false);
|
||||
}
|
||||
}
|
||||
|
||||
//remove Types
|
||||
if (params.containsKey("AddType") || params.containsKey("RemoveType")) {
|
||||
affectedCard.removeChangedCardTypes(se.getTimestamp());
|
||||
|
||||
@@ -46,9 +46,13 @@ abstract public class Ability_Activated extends SpellAbility implements java.io.
|
||||
if (AllZone.getStack().isSplitSecondOnStack()) return false;
|
||||
|
||||
final Card c = getSourceCard();
|
||||
if (c.isFaceDown() && isIntrinsic()) // Intrinsic abilities can't be activated by face down cards
|
||||
if (c.isFaceDown() && isIntrinsic()) { // Intrinsic abilities can't be activated by face down cards
|
||||
return false;
|
||||
if (c.hasKeyword("CARDNAME's activated abilities can't be activated.")) return false;
|
||||
}
|
||||
|
||||
if (c.hasKeyword("CARDNAME's activated abilities can't be activated.") || isSuppressed()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
CardList pithing = AllZoneUtil.getPlayerCardsInPlay(AllZone.getHumanPlayer());
|
||||
pithing.addAll(AllZoneUtil.getPlayerCardsInPlay(AllZone.getComputerPlayer()));
|
||||
@@ -59,7 +63,7 @@ abstract public class Ability_Activated extends SpellAbility implements java.io.
|
||||
}
|
||||
});
|
||||
|
||||
if (pithing.size() != 0) return false;
|
||||
if (pithing.size() != 0 && !(this instanceof Ability_Mana)) return false;
|
||||
|
||||
if (!(getRestrictions().canPlay(c, this)))
|
||||
return false;
|
||||
|
||||
@@ -48,6 +48,7 @@ public abstract class SpellAbility {
|
||||
private boolean trigger = false;
|
||||
private int sourceTrigger = -1;
|
||||
private boolean mandatory = false;
|
||||
private boolean temporarilySuppressed = false;
|
||||
|
||||
private boolean tapAbility;
|
||||
private boolean untapAbility;
|
||||
@@ -865,6 +866,11 @@ public abstract class SpellAbility {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
if(isSuppressed()) {
|
||||
return "";
|
||||
}
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
SpellAbility node = this;
|
||||
|
||||
@@ -1216,4 +1222,12 @@ public abstract class SpellAbility {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setTemporarilySuppressed(boolean supp) {
|
||||
temporarilySuppressed = supp;
|
||||
}
|
||||
|
||||
public boolean isSuppressed() {
|
||||
return (temporarilySuppressed);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -82,7 +82,8 @@ public class StaticAbility {
|
||||
return 5;
|
||||
|
||||
if(mapParams.containsKey("AddKeyword") || mapParams.containsKey("AddAbility")
|
||||
|| mapParams.containsKey("AddTrigger") || mapParams.containsKey("RemoveTriggers"))
|
||||
|| mapParams.containsKey("AddTrigger") || mapParams.containsKey("RemoveTriggers")
|
||||
|| mapParams.containsKey("RemoveAllAbilities"))
|
||||
return 6;
|
||||
|
||||
if(mapParams.containsKey("CharacteristicDefining"))
|
||||
|
||||
@@ -249,6 +249,14 @@ public class StaticAbility_Continuous {
|
||||
trigger.setTemporarilySuppressed(true);
|
||||
}
|
||||
}
|
||||
|
||||
// remove activated abilities
|
||||
if (params.containsKey("RemoveAllAbilities")) {
|
||||
ArrayList<SpellAbility> abilities = affectedCard.getSpellAbilities();
|
||||
for (SpellAbility ab : abilities) {
|
||||
ab.setTemporarilySuppressed(true);
|
||||
}
|
||||
}
|
||||
//affectedCard.updateObservers();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user