mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
added support for mana adding counter magic protection
This commit is contained in:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -1354,6 +1354,7 @@ res/cardsfolder/c/cave_sense.txt svneol=native#text/plain
|
||||
res/cardsfolder/c/cave_tiger.txt svneol=native#text/plain
|
||||
res/cardsfolder/c/cavern_crawler.txt svneol=native#text/plain
|
||||
res/cardsfolder/c/cavern_harpy.txt svneol=native#text/plain
|
||||
res/cardsfolder/c/cavern_of_souls.txt -text
|
||||
res/cardsfolder/c/cavern_thoctar.txt svneol=native#text/plain
|
||||
res/cardsfolder/c/caverns_of_despair.txt svneol=native#text/plain
|
||||
res/cardsfolder/c/caves_of_koilos.txt svneol=native#text/plain
|
||||
|
||||
@@ -5,4 +5,6 @@ Text:no text
|
||||
A:AB$ Mana | Cost$ T | Produced$ Any | RestrictValid$ Creature | SpellDescription$ Add one mana of any color to your mana pool. Spend this mana only to cast a creature spell.
|
||||
SVar:Rarity:Uncommon
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/ancient_ziggurat.jpg
|
||||
SetInfo:CFX|Uncommon|http://magiccards.info/scans/en/cfx/141.jpg
|
||||
Oracle:{T}: Add one mana of any color to your mana pool. Spend this mana only to cast a creature spell.
|
||||
End
|
||||
13
res/cardsfolder/c/cavern_of_souls.txt
Normal file
13
res/cardsfolder/c/cavern_of_souls.txt
Normal file
@@ -0,0 +1,13 @@
|
||||
Name:Cavern of Souls
|
||||
ManaCost:no cost
|
||||
Types:Land
|
||||
Text:no text
|
||||
T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ ChooseCT | Static$ True | TriggerDescription$ As CARDNAME enters the battlefield, choose a creature type.
|
||||
SVar:ChooseCT:AB$ ChooseType | Cost$ 0 | Defined$ You | Type$ Creature | AILogic$ MostProminentInComputerDeck
|
||||
A:AB$ Mana | Cost$ T | Produced$ 1 | SpellDescription$ Add 1 to your mana pool.
|
||||
A:AB$ Mana | Cost$ T | Produced$ Any | RestrictValid$ Creature.ChosenType | AddsNoCounter$ True | SpellDescription$ Add one mana of any color to your mana pool. Spend this mana only to cast a creature spell of the chosen type, and that spell can't be countered.
|
||||
SVar:Rarity:Rare
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/cavern_of_souls.jpg
|
||||
SetInfo:AVR|Rare|http://magiccards.info/scans/en/avr/226.jpg
|
||||
Oracle:As Cavern of Souls enters the battlefield, choose a creature type.\n{T}: Add {1} to your mana pool.\n{T}: Add one mana of any color to your mana pool. Spend this mana only to cast a creature spell of the chosen type, and that spell can't be countered.
|
||||
End
|
||||
@@ -6,4 +6,6 @@ A:AB$ Mana | Cost$ T | Produced$ 1 | Amount$ 2 | RestrictValid$ Creature.Myr,Act
|
||||
A:AB$ ChangeZone | Cost$ 3 T | TgtPrompt$ Choose target Myr card in your graveyard | ValidTgts$ Card.Myr+YouCtrl | Origin$ Graveyard | Destination$ Hand | SpellDescription$ Return target Myr card from your graveyard to your hand.
|
||||
SVar:Rarity:Rare
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/myr_reservoir.jpg
|
||||
SetInfo:SOM|Rare|http://magiccards.info/scans/en/som/183.jpg
|
||||
Oracle:{T}: Add {2} to your mana pool. Spend this mana only to cast Myr spells or activate abilities of Myr.\n{3}, {T}: Return target Myr card from your graveyard to your hand.
|
||||
End
|
||||
@@ -133,6 +133,7 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
private final ArrayList<Card> mustBlockCards = new ArrayList<Card>();
|
||||
|
||||
private boolean canMorph = false;
|
||||
private boolean canCounter = true;
|
||||
private boolean kicked = false;
|
||||
private boolean evoked = false;
|
||||
|
||||
@@ -3203,6 +3204,29 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
return this.curCharacteristics == CardCharactersticName.FaceDown;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* setCanCounter.
|
||||
* </p>
|
||||
*
|
||||
* @param b
|
||||
* a boolean.
|
||||
*/
|
||||
public final void setCanCounter(final boolean b) {
|
||||
this.canCounter = b;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* getCanCounter.
|
||||
* </p>
|
||||
*
|
||||
* @return a boolean.
|
||||
*/
|
||||
public final boolean getCanCounter() {
|
||||
return this.canCounter;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* setCanMorph.
|
||||
|
||||
@@ -2029,7 +2029,7 @@ public class CardFactoryUtil {
|
||||
* @return a boolean.
|
||||
*/
|
||||
public static boolean isCounterable(final Card c) {
|
||||
if (c.hasKeyword("CARDNAME can't be countered.")) {
|
||||
if (c.hasKeyword("CARDNAME can't be countered.") || !c.getCanCounter()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,8 +34,8 @@ public class Mana {
|
||||
private String color;
|
||||
private Card sourceCard = null;
|
||||
private AbilityMana sourceAbility = null;
|
||||
boolean hasRestrictions = false;
|
||||
boolean paidWithCounterable = true;
|
||||
private boolean hasRestrictions = false;
|
||||
private boolean pumpCounterMagic = false;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -57,7 +57,7 @@ public class Mana {
|
||||
this.hasRestrictions = true;
|
||||
}
|
||||
if (manaAbility.cannotCounterPaidWith()) {
|
||||
this.paidWithCounterable = false;
|
||||
this.pumpCounterMagic = true;
|
||||
}
|
||||
}
|
||||
if (source == null) {
|
||||
@@ -116,8 +116,8 @@ public class Mana {
|
||||
*
|
||||
* @return a boolean.
|
||||
*/
|
||||
public final boolean isPaidWithCounterable() {
|
||||
return this.paidWithCounterable;
|
||||
public final boolean addsNoCounterMagic() {
|
||||
return this.pumpCounterMagic;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -417,6 +417,9 @@ public class ManaPool {
|
||||
manaCost.payMana(mana);
|
||||
manaPaid.add(mana);
|
||||
this.removeManaFrom(this.floatingMana, mana);
|
||||
if (mana.addsNoCounterMagic() && sa.getSourceCard() != null) {
|
||||
sa.getSourceCard().setCanCounter(false);
|
||||
}
|
||||
if (manaCost.isPaid()) {
|
||||
keepPayingFromPool = false;
|
||||
}
|
||||
@@ -455,6 +458,9 @@ public class ManaPool {
|
||||
manaCost.payMana(mana);
|
||||
manaPaid.add(mana);
|
||||
this.removeManaFrom(this.floatingMana, mana);
|
||||
if (mana.addsNoCounterMagic() && sa.getSourceCard() != null) {
|
||||
sa.getSourceCard().setCanCounter(false);
|
||||
}
|
||||
}
|
||||
return manaCost;
|
||||
}
|
||||
@@ -488,6 +494,9 @@ public class ManaPool {
|
||||
manaCost.payMana(mana);
|
||||
manaPaid.add(mana);
|
||||
this.removeManaFrom(this.floatingMana, mana);
|
||||
if (mana.addsNoCounterMagic() && sa.getSourceCard() != null) {
|
||||
sa.getSourceCard().setCanCounter(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
return manaCost;
|
||||
@@ -521,6 +530,9 @@ public class ManaPool {
|
||||
abilitiesUsedToPay.clear();
|
||||
// move non-undoable paying mana back to floating
|
||||
if (refund) {
|
||||
if (ability.getSourceCard() != null) {
|
||||
ability.getSourceCard().setCanCounter(true);
|
||||
}
|
||||
for (final Mana m : manaPaid) {
|
||||
this.addManaToPool(this.floatingMana, m);
|
||||
}
|
||||
|
||||
@@ -1142,6 +1142,7 @@ public class MagicStack extends MyObservable {
|
||||
// hostCard in AF is not the same object that's on the battlefield
|
||||
// verified by System.identityHashCode(card);
|
||||
final Card tmp = sa.getSourceCard();
|
||||
tmp.setCanCounter(true); // reset mana pumped counter magic flag
|
||||
if (tmp.getClones().size() > 0) {
|
||||
for (final Card c : AllZoneUtil.getCardsIn(ZoneType.Battlefield)) {
|
||||
if (c.equals(tmp)) {
|
||||
|
||||
Reference in New Issue
Block a user