mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
- Fixed several flaws in stAnimate. Now Blood Moon and friends will only change subtypes and leave land creatures their type and power/toughness.
This commit is contained in:
@@ -2,7 +2,7 @@ Name:Blood Moon
|
|||||||
ManaCost:2 R
|
ManaCost:2 R
|
||||||
Types:Enchantment
|
Types:Enchantment
|
||||||
Text:no text
|
Text:no text
|
||||||
K:stAnimateAll:Land.nonBasic:0/0:Land,Mountain,Overwrite,KeepSupertype:no colors:Overwrite:No Condition:Nonbasic lands are Mountains.
|
K:stAnimateAll:Land.nonBasic:no changes:Land,Mountain,RemoveSubTypes:no colors:Overwrite:No Condition:Nonbasic lands are Mountains.
|
||||||
SVar:RemRandomDeck:True
|
SVar:RemRandomDeck:True
|
||||||
SVar:Rarity:Rare
|
SVar:Rarity:Rare
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/blood_moon.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/blood_moon.jpg
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ ManaCost:1 B
|
|||||||
Types:Enchantment Aura
|
Types:Enchantment Aura
|
||||||
Text:no text
|
Text:no text
|
||||||
K:Enchant Land Curse
|
K:Enchant Land Curse
|
||||||
K:stAnimateEnchanted:Land:0/0:Land,Swamp,Overwrite,KeepSupertype:no colors:Overwrite:No Condition:Enchanted land is a Swamp.
|
K:stAnimateEnchanted:Land:no changes:Land,Swamp,RemoveSubTypes:no colors:Overwrite:No Condition:Enchanted land is a Swamp.
|
||||||
T:Mode$ Taps | ValidCard$ Card.AttachedBy | TriggerZones$ Battlefield | Execute$ TrigLose | TriggerDescription$ Whenever enchanted land becomes tapped, its controller loses 2 life.
|
T:Mode$ Taps | ValidCard$ Card.AttachedBy | TriggerZones$ Battlefield | Execute$ TrigLose | TriggerDescription$ Whenever enchanted land becomes tapped, its controller loses 2 life.
|
||||||
SVar:TrigLose:AB$LoseLife | Cost$ 0 | Defined$ EnchantedController | LifeAmount$ 2
|
SVar:TrigLose:AB$LoseLife | Cost$ 0 | Defined$ EnchantedController | LifeAmount$ 2
|
||||||
SVar:Rarity:Common
|
SVar:Rarity:Common
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ ManaCost:G
|
|||||||
Types:Enchantment Aura
|
Types:Enchantment Aura
|
||||||
Text:no text
|
Text:no text
|
||||||
K:Enchant Land
|
K:Enchant Land
|
||||||
K:stAnimateEnchanted:Land:0/0:Land,Mountain,Forest,Plains,Overwrite,KeepSupertype:no colors:Overwrite:No Condition:Enchanted land is a Mountain, Forest, and Plains.
|
K:stAnimateEnchanted:Land:no changes:Land,Mountain,Forest,Plains,RemoveSubTypes:no colors:Overwrite:No Condition:Enchanted land is a Mountain, Forest, and Plains.
|
||||||
SVar:RemRandomDeck:True
|
SVar:RemRandomDeck:True
|
||||||
SVar:Rarity:Common
|
SVar:Rarity:Common
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/lush_growth.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/lush_growth.jpg
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ ManaCost:2 R
|
|||||||
Types:Creature Human Wizard
|
Types:Creature Human Wizard
|
||||||
Text:no text
|
Text:no text
|
||||||
PT:2/2
|
PT:2/2
|
||||||
K:stAnimateAll:Land.nonBasic:0/0:Land,Mountain,Overwrite,KeepSupertype:no colors:Overwrite:No Condition:Nonbasic lands are Mountains.
|
K:stAnimateAll:Land.nonBasic:no changes:Land,Mountain,RemoveSubTypes:no colors:Overwrite:No Condition:Nonbasic lands are Mountains.
|
||||||
SVar:RemRandomDeck:True
|
SVar:RemRandomDeck:True
|
||||||
SVar:Rarity:Rare
|
SVar:Rarity:Rare
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/magus_of_the_moon.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/magus_of_the_moon.jpg
|
||||||
|
|||||||
@@ -243,6 +243,10 @@ public class CardUtil {
|
|||||||
|| cardType.equals("Snow") || cardType.equals("World"));
|
|| cardType.equals("Snow") || cardType.equals("World"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isASubType(String cardType) {
|
||||||
|
return (!isASuperType(cardType) && !isACardType(cardType));
|
||||||
|
}
|
||||||
|
|
||||||
// Check if a Type is a Creature Type (by excluding all other types)
|
// Check if a Type is a Creature Type (by excluding all other types)
|
||||||
public static boolean isACreatureType(String cardType) {
|
public static boolean isACreatureType(String cardType) {
|
||||||
return (!isACardType(cardType) && !isASuperType(cardType) && !isALandType(cardType)
|
return (!isACardType(cardType) && !isASuperType(cardType) && !isALandType(cardType)
|
||||||
|
|||||||
@@ -7343,17 +7343,19 @@ public class GameActionUtil {
|
|||||||
CardList affectedCards = getAffectedCards(cardWithKeyword, k, specific); // options are All, Self, Enchanted etc.
|
CardList affectedCards = getAffectedCards(cardWithKeyword, k, specific); // options are All, Self, Enchanted etc.
|
||||||
se.setAffectedCards(affectedCards);
|
se.setAffectedCards(affectedCards);
|
||||||
|
|
||||||
String[] pt = k[2].split("/");
|
if(!k[2].equals("no changes")) {
|
||||||
|
String[] pt = k[2].split("/");
|
||||||
int x = 0;
|
|
||||||
if (pt[0].contains("X") || pt[1].contains("X"))
|
int x = 0;
|
||||||
x = CardFactoryUtil.xCount(cardWithKeyword, cardWithKeyword.getSVar("X").split("\\$")[1]);
|
if (pt[0].contains("X") || pt[1].contains("X"))
|
||||||
se.setXValue(x);
|
x = CardFactoryUtil.xCount(cardWithKeyword, cardWithKeyword.getSVar("X").split("\\$")[1]);
|
||||||
|
se.setXValue(x);
|
||||||
int y = 0;
|
|
||||||
if (pt[1].contains("Y"))
|
int y = 0;
|
||||||
y = CardFactoryUtil.xCount(cardWithKeyword, cardWithKeyword.getSVar("Y").split("\\$")[1]);
|
if (pt[1].contains("Y"))
|
||||||
se.setYValue(y);
|
y = CardFactoryUtil.xCount(cardWithKeyword, cardWithKeyword.getSVar("Y").split("\\$")[1]);
|
||||||
|
se.setYValue(y);
|
||||||
|
}
|
||||||
|
|
||||||
ArrayList<String> types = new ArrayList<String>();
|
ArrayList<String> types = new ArrayList<String>();
|
||||||
if(!k[3].equalsIgnoreCase("no types")) {
|
if(!k[3].equalsIgnoreCase("no types")) {
|
||||||
@@ -7366,6 +7368,10 @@ public class GameActionUtil {
|
|||||||
types.remove("KeepSupertype");
|
types.remove("KeepSupertype");
|
||||||
se.setKeepSupertype(true);
|
se.setKeepSupertype(true);
|
||||||
}
|
}
|
||||||
|
if(types.contains("RemoveSubTypes")) {
|
||||||
|
types.remove("RemoveSubTypes");
|
||||||
|
se.setRemoveSubTypes(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String colors = "";
|
String colors = "";
|
||||||
@@ -7392,18 +7398,33 @@ public class GameActionUtil {
|
|||||||
|
|
||||||
private void addStaticEffects(StaticEffect se, Card source, CardList affectedCards, String details, ArrayList<String> types, String colors) {
|
private void addStaticEffects(StaticEffect se, Card source, CardList affectedCards, String details, ArrayList<String> types, String colors) {
|
||||||
|
|
||||||
String[] keyword = details.split("/", 3);
|
|
||||||
String powerStr = keyword[0];
|
|
||||||
String toughStr = keyword[1];
|
|
||||||
|
|
||||||
for(int i = 0; i < affectedCards.size(); i++) {
|
for(int i = 0; i < affectedCards.size(); i++) {
|
||||||
Card affectedCard = affectedCards.get(i);
|
Card affectedCard = affectedCards.get(i);
|
||||||
//copied from stSetPT power/toughness
|
|
||||||
int power = powerStr.matches("[0-9][0-9]?") ? Integer.parseInt(powerStr) : CardFactoryUtil.xCount(affectedCard, powerStr);
|
if(!details.equals("no changes")) {
|
||||||
int toughness = toughStr.matches("[0-9][0-9]?") ? Integer.parseInt(toughStr) : CardFactoryUtil.xCount(affectedCard, toughStr);
|
String[] keyword = details.split("/", 3);
|
||||||
se.addOriginalPT(affectedCard, affectedCard.getBaseAttack(), affectedCard.getBaseDefense());
|
String powerStr = keyword[0];
|
||||||
affectedCard.setBaseAttack(power);
|
String toughStr = keyword[1];
|
||||||
affectedCard.setBaseDefense(toughness);
|
//copied from stSetPT power/toughness
|
||||||
|
int power = powerStr.matches("[0-9][0-9]?") ? Integer.parseInt(powerStr) : CardFactoryUtil.xCount(affectedCard, powerStr);
|
||||||
|
int toughness = toughStr.matches("[0-9][0-9]?") ? Integer.parseInt(toughStr) : CardFactoryUtil.xCount(affectedCard, toughStr);
|
||||||
|
se.addOriginalPT(affectedCard, affectedCard.getBaseAttack(), affectedCard.getBaseDefense());
|
||||||
|
affectedCard.setBaseAttack(power);
|
||||||
|
affectedCard.setBaseDefense(toughness);
|
||||||
|
if(se.isOverwriteKeywords()) {
|
||||||
|
se.addOriginalKeywords(affectedCard, affectedCard.getIntrinsicKeyword());
|
||||||
|
affectedCard.clearAllKeywords();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if(keyword.length > 2) {
|
||||||
|
String keywords[] = keyword[2].split(" & ");
|
||||||
|
for(int j = 0; j < keywords.length; j++) {
|
||||||
|
String kw = keywords[j];
|
||||||
|
affectedCard.addExtrinsicKeyword(kw);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(se.isOverwriteTypes()) {
|
if(se.isOverwriteTypes()) {
|
||||||
se.addOriginalTypes(affectedCard, affectedCard.getType());
|
se.addOriginalTypes(affectedCard, affectedCard.getType());
|
||||||
@@ -7417,6 +7438,13 @@ public class GameActionUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(se.isRemoveSubTypes()) {
|
||||||
|
se.addOriginalTypes(affectedCard, affectedCard.getType());
|
||||||
|
ArrayList<String> acTypes = affectedCard.getType();
|
||||||
|
for(String t : acTypes) {
|
||||||
|
if(CardUtil.isASubType(t)) affectedCard.removeType(t);
|
||||||
|
}
|
||||||
|
}
|
||||||
for(String type : types) {
|
for(String type : types) {
|
||||||
if(!affectedCard.isType(type)) {
|
if(!affectedCard.isType(type)) {
|
||||||
affectedCard.addType(type);
|
affectedCard.addType(type);
|
||||||
@@ -7426,19 +7454,6 @@ public class GameActionUtil {
|
|||||||
se.removeType(affectedCard, type);
|
se.removeType(affectedCard, type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(se.isOverwriteKeywords()) {
|
|
||||||
se.addOriginalKeywords(affectedCard, affectedCard.getIntrinsicKeyword());
|
|
||||||
affectedCard.clearAllKeywords();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if(keyword.length > 2) {
|
|
||||||
String keywords[] = keyword[2].split(" & ");
|
|
||||||
for(int j = 0; j < keywords.length; j++) {
|
|
||||||
String kw = keywords[j];
|
|
||||||
affectedCard.addExtrinsicKeyword(kw);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//Abilities
|
//Abilities
|
||||||
if(se.isOverwriteAbilities()) {
|
if(se.isOverwriteAbilities()) {
|
||||||
se.addOriginalAbilities(affectedCard, affectedCard.getAllButFirstSpellAbility());
|
se.addOriginalAbilities(affectedCard, affectedCard.getAllButFirstSpellAbility());
|
||||||
@@ -7469,8 +7484,10 @@ public class GameActionUtil {
|
|||||||
|
|
||||||
private void removeStaticEffect(StaticEffect se, Card source, Card affectedCard, String[] details) {
|
private void removeStaticEffect(StaticEffect se, Card source, Card affectedCard, String[] details) {
|
||||||
|
|
||||||
affectedCard.setBaseAttack(se.getOriginalPower(affectedCard));
|
if(!details[2].equals("no changes")) {
|
||||||
affectedCard.setBaseDefense(se.getOriginalToughness(affectedCard));
|
affectedCard.setBaseAttack(se.getOriginalPower(affectedCard));
|
||||||
|
affectedCard.setBaseDefense(se.getOriginalToughness(affectedCard));
|
||||||
|
}
|
||||||
|
|
||||||
for(String type : se.getTypes(affectedCard)) {
|
for(String type : se.getTypes(affectedCard)) {
|
||||||
affectedCard.removeType(type);
|
affectedCard.removeType(type);
|
||||||
@@ -7482,6 +7499,11 @@ public class GameActionUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(se.isRemoveSubTypes()) {
|
||||||
|
for(String type : se.getOriginalTypes(affectedCard)) {
|
||||||
|
if(CardUtil.isASubType(type)) affectedCard.addType(type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(se.isOverwriteKeywords()) {
|
if(se.isOverwriteKeywords()) {
|
||||||
for(String kw : se.getOriginalKeywords(affectedCard)) affectedCard.addIntrinsicKeyword(kw);
|
for(String kw : se.getOriginalKeywords(affectedCard)) affectedCard.addIntrinsicKeyword(kw);
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ public class StaticEffect {
|
|||||||
//for types
|
//for types
|
||||||
private boolean overwriteTypes = false;
|
private boolean overwriteTypes = false;
|
||||||
private boolean keepSupertype = false;
|
private boolean keepSupertype = false;
|
||||||
|
private boolean removeSubTypes = false;
|
||||||
private HashMap<Card, ArrayList<String>> types = new HashMap<Card, ArrayList<String>>();
|
private HashMap<Card, ArrayList<String>> types = new HashMap<Card, ArrayList<String>>();
|
||||||
private HashMap<Card, ArrayList<String>> originalTypes = new HashMap<Card, ArrayList<String>>();
|
private HashMap<Card, ArrayList<String>> originalTypes = new HashMap<Card, ArrayList<String>>();
|
||||||
|
|
||||||
@@ -175,6 +176,15 @@ public class StaticEffect {
|
|||||||
public void setKeepSupertype(boolean keepSupertype) {
|
public void setKeepSupertype(boolean keepSupertype) {
|
||||||
this.keepSupertype = keepSupertype;
|
this.keepSupertype = keepSupertype;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//should we overwrite land types?
|
||||||
|
public boolean isRemoveSubTypes() {
|
||||||
|
return removeSubTypes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRemoveSubTypes(boolean removeSubTypes) {
|
||||||
|
this.removeSubTypes = removeSubTypes;
|
||||||
|
}
|
||||||
|
|
||||||
//original types
|
//original types
|
||||||
public void addOriginalType(Card c, String s) {
|
public void addOriginalType(Card c, String s) {
|
||||||
|
|||||||
Reference in New Issue
Block a user