mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
*Added ManaSpent & ManaNotSpent restrictions to Triggers. Triggers with ManaSpent$ Green for instance will only go off if Green mana was spent to cast the host card.
*New AI SVar; "ManaNeededToAvoidNegativeEffect". This is a comma-separated list of colors the AI will try to use to pay for the cost, but only if it actually has a source for that color mana. *Added Plaxmanta.
This commit is contained in:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -5678,6 +5678,7 @@ res/cardsfolder/p/plated_wurm.txt svneol=native#text/plain
|
||||
res/cardsfolder/p/platinum_angel.txt svneol=native#text/plain
|
||||
res/cardsfolder/p/platinum_emperion.txt svneol=native#text/plain
|
||||
res/cardsfolder/p/plaxcaster_frogling.txt -text
|
||||
res/cardsfolder/p/plaxmanta.txt -text
|
||||
res/cardsfolder/p/plover_knights.txt svneol=native#text/plain
|
||||
res/cardsfolder/p/plow_under.txt svneol=native#text/plain
|
||||
res/cardsfolder/p/plumes_of_peace.txt svneol=native#text/plain
|
||||
|
||||
15
res/cardsfolder/p/plaxmanta.txt
Normal file
15
res/cardsfolder/p/plaxmanta.txt
Normal file
@@ -0,0 +1,15 @@
|
||||
Name:Plaxmanta
|
||||
ManaCost:1 U
|
||||
Types:Creature Beast
|
||||
Text:no text
|
||||
PT:2/2
|
||||
K:Flash
|
||||
T:Mode$ ChangesZone | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigPumpAll | TriggerDescription$ When CARDNAME enters the battlefield, creatures you control gain shroud until end of turn. (They can't be the targets of spells or abilities.)
|
||||
T:Mode$ ChangesZone | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigSac | ManaNotSpent$ G | TriggerDescription$ When CARDNAME enters the battlefield, sacrifice it unless G was spent to cast it.
|
||||
SVar:TrigPumpAll:AB$PumpAll | Cost$ 0 | ValidCards$ Creature.YouCtrl | KW$ Shroud
|
||||
SVar:TrigSac:AB$Sacrifice | Cost$ 0 | Defined$ Self
|
||||
SVar:ManaNeededToAvoidNegativeEffect:Green
|
||||
SVar:RemRandomDeck:True
|
||||
Oracle:Flash\nWhen Plaxmanta enters the battlefield, creatures you control gain shroud until end of turn. (They can't be the targets of spells or abilities.)\nWhen Plaxmanta enters the battlefield, sacrifice it unless {G} was spent to cast it.
|
||||
SetInfo:DIS|Uncommon|http://magiccards.info/scans/en/di/29.jpg
|
||||
End
|
||||
@@ -488,6 +488,9 @@ public class ComputerUtil {
|
||||
ArrayList<String> colors;
|
||||
|
||||
cost = ((ManaPool) manapool).subtractMana(sa, cost);
|
||||
if(card.getSVar("ManaNeededToAvoidNegativeEffect") != "") {
|
||||
cost.setManaNeededToAvoidNegativeEffect(card.getSVar("ManaNeededToAvoidNegativeEffect").split(","));
|
||||
}
|
||||
|
||||
CardList manaSources = getAvailableMana();
|
||||
|
||||
@@ -733,6 +736,8 @@ public class ComputerUtil {
|
||||
|
||||
ArrayList<String> colors;
|
||||
|
||||
ArrayList<String> colorsNeededToAvoidNegativeEffect = cost.getManaNeededToAvoidNegativeEffect();
|
||||
|
||||
ArrayList<Ability_Mana> res = new ArrayList<Ability_Mana>();
|
||||
|
||||
ManaCost onlyColored = new ManaCost(cost.toString());
|
||||
@@ -746,6 +751,12 @@ public class ComputerUtil {
|
||||
res.add(am);
|
||||
break;
|
||||
}
|
||||
for(String col : colorsNeededToAvoidNegativeEffect) {
|
||||
if(col.equalsIgnoreCase(colors.get(j))
|
||||
|| col.substring(0,1).equalsIgnoreCase(colors.get(j))) {
|
||||
res.add(am);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -759,6 +770,12 @@ public class ComputerUtil {
|
||||
res.add(am);
|
||||
break;
|
||||
}
|
||||
for(String col : colorsNeededToAvoidNegativeEffect) {
|
||||
if(col.equalsIgnoreCase(colors.get(j))
|
||||
|| col.substring(0,1).equalsIgnoreCase(colors.get(j))) {
|
||||
res.add(am);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,8 @@ public class ManaCost {
|
||||
private ArrayList<Object> manaPart;
|
||||
private HashMap<String, Integer> sunburstMap = new HashMap<String, Integer>();
|
||||
private int xcounter = 0;
|
||||
private ArrayList<String> manaNeededToAvoidNegativeEffect = new ArrayList<String>();
|
||||
private ArrayList<String> manaPaidToAvoidNegativeEffect = new ArrayList<String>();
|
||||
|
||||
//manaCost can be like "0", "3", "G", "GW", "10", "3 GW", "10 GW"
|
||||
//or "split hybrid mana" like "2/G 2/G", "2/B 2/B 2/B"
|
||||
@@ -63,11 +65,11 @@ public class ManaCost {
|
||||
public String getColorsPaid() {
|
||||
String s = "";
|
||||
for (String key: sunburstMap.keySet()) {
|
||||
if(key.equals("black")) s+= "B";
|
||||
if(key.equals("blue")) s+= "U";
|
||||
if(key.equals("green")) s+= "G";
|
||||
if(key.equals("red")) s+= "R";
|
||||
if(key.equals("white")) s+= "W";
|
||||
if(key.equalsIgnoreCase("black") || key.equalsIgnoreCase("B")) s+= "B";
|
||||
if(key.equalsIgnoreCase("blue") || key.equalsIgnoreCase("U")) s+= "U";
|
||||
if(key.equalsIgnoreCase("green") || key.equalsIgnoreCase("G")) s+= "G";
|
||||
if(key.equalsIgnoreCase("red") || key.equalsIgnoreCase("R")) s+= "R";
|
||||
if(key.equalsIgnoreCase("white") || key.equalsIgnoreCase("W")) s+= "W";
|
||||
}
|
||||
return s;
|
||||
}
|
||||
@@ -146,6 +148,14 @@ public class ManaCost {
|
||||
* @return a boolean.
|
||||
*/
|
||||
public boolean isNeeded(String mana) {
|
||||
if(manaNeededToAvoidNegativeEffect.size() != 0) {
|
||||
for(String s : manaNeededToAvoidNegativeEffect) {
|
||||
if ((s.equalsIgnoreCase(mana) || s.substring(0,1).equalsIgnoreCase(mana))
|
||||
&& !manaPaidToAvoidNegativeEffect.contains(mana)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (mana.length() > 1)
|
||||
mana = Input_PayManaCostUtil.getShortColorString(mana);
|
||||
Mana_Part m;
|
||||
@@ -203,6 +213,9 @@ public class ManaCost {
|
||||
* @return a boolean.
|
||||
*/
|
||||
public boolean payMana(String color) {
|
||||
if(manaNeededToAvoidNegativeEffect.contains(color) && !manaPaidToAvoidNegativeEffect.contains(color)) {
|
||||
manaPaidToAvoidNegativeEffect.add(color);
|
||||
}
|
||||
color = Input_PayManaCostUtil.getShortColorString(color);
|
||||
return addMana(color);
|
||||
}
|
||||
@@ -488,4 +501,14 @@ public class ManaCost {
|
||||
manaPart.remove(manaPart.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
public void setManaNeededToAvoidNegativeEffect(String[] manaCol) {
|
||||
for(String s : manaCol) {
|
||||
manaNeededToAvoidNegativeEffect.add(s);
|
||||
}
|
||||
}
|
||||
|
||||
public ArrayList<String> getManaNeededToAvoidNegativeEffect() {
|
||||
return manaNeededToAvoidNegativeEffect;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -431,6 +431,17 @@ public abstract class Trigger {
|
||||
}
|
||||
}
|
||||
|
||||
if(mapParams.containsKey("ManaSpent")) {
|
||||
if(!hostCard.getColorsPaid().contains(mapParams.get("ManaSpent"))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if(mapParams.containsKey("ManaNotSpent")) {
|
||||
if(hostCard.getColorsPaid().contains(mapParams.get("ManaNotSpent"))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user