mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
- Converted all cards with stPreventDamage keyword to the PreventDamage static ability.
- Removed the code of the stPreventDamage keyword.
This commit is contained in:
@@ -4,7 +4,7 @@ Types:Creature Angel
|
||||
Text:no text
|
||||
PT:3/4
|
||||
K:Flying
|
||||
K:stPreventDamage:You:Card.YouDontCtrl:1:If a source an opponent controls would deal damage to you, prevent 1 of that damage.
|
||||
S:Mode$ PreventDamage | Target$ You | Source$ Card.YouDontCtrl | Amount$ 1 | Description$ If a source an opponent controls would deal damage to you, prevent 1 of that damage.
|
||||
SVar:Rarity:Rare
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/guardian_seraph.jpg
|
||||
SetInfo:M10|Rare|http://magiccards.info/scans/en/m10/13.jpg
|
||||
|
||||
@@ -2,7 +2,7 @@ Name:Light of Sanction
|
||||
ManaCost:1 W W
|
||||
Types:Enchantment
|
||||
Text:no text
|
||||
K:stPreventDamage:Creature.YouCtrl:Card.YouCtrl:All:Prevent all damage that would be dealt to creatures you control by sources you control.
|
||||
S:Mode$ PreventDamage | Target$ Creature.YouCtrl | Source$ Card.YouCtrl | Amount$ All | Description$ Prevent all damage that would be dealt to creatures you control by sources you control.
|
||||
SVar:RemRandomDeck:True
|
||||
SVar:Rarity:Rare
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/light_of_sanction.jpg
|
||||
|
||||
@@ -5,8 +5,7 @@ Text:no text
|
||||
PT:1/2
|
||||
K:Flash
|
||||
K:Flying
|
||||
K:stPreventDamage:Player:Spell:1:If a spell would deal damage to a creature or player, prevent 1 damage that spell would deal to that creature or player.
|
||||
K:stPreventDamage:Creature:Spell:1:no text
|
||||
S:Mode$ PreventDamage | Target$ Creature,Player | Source$ Spell | Amount$ 1 | Description$ If a spell would deal damage to a creature or player, prevent 1 damage that spell would deal to that creature or player.
|
||||
SVar:Rarity:Uncommon
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/plated_pegasus.jpg
|
||||
SetInfo:TSP|Uncommon|http://magiccards.info/scans/en/ts/34.jpg
|
||||
|
||||
@@ -2,7 +2,7 @@ Name:Sphere of Duty
|
||||
ManaCost:3 W
|
||||
Types:Enchantment
|
||||
Text:no text
|
||||
K:stPreventDamage:You:Card.Green:2:If a green source would deal damage to you, prevent 2 of that damage.
|
||||
S:Mode$ PreventDamage | Target$ You | Source$ Card.Green | Amount$ 2 | Description$ If a green source would deal damage to you, prevent 2 of that damage.
|
||||
SVar:RemRandomDeck:True
|
||||
SVar:Rarity:Uncommon
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/sphere_of_duty.jpg
|
||||
|
||||
@@ -2,7 +2,7 @@ Name:Sphere of Grace
|
||||
ManaCost:3 W
|
||||
Types:Enchantment
|
||||
Text:no text
|
||||
K:stPreventDamage:You:Card.Black:2:If a black source would deal damage to you, prevent 2 of that damage.
|
||||
S:Mode$ PreventDamage | Target$ You | Source$ Card.Black | Amount$ 2 | Description$ If a black source would deal damage to you, prevent 2 of that damage.
|
||||
SVar:RemRandomDeck:True
|
||||
SVar:Rarity:Uncommon
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/sphere_of_grace.jpg
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
Name:Sphere of Law
|
||||
ManaCost:3 W
|
||||
Types:Enchantment
|
||||
Text:
|
||||
K:stPreventDamage:You:Card.Red:2:If a red source would deal damage to you, prevent 2 of that damage.
|
||||
Text:no text
|
||||
S:Mode$ PreventDamage | Target$ You | Source$ Card.Red | Amount$ 2 | Description$ If a red source would deal damage to you, prevent 2 of that damage.
|
||||
SVar:RemRandomDeck:True
|
||||
SVar:Rarity:Uncommon
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/sphere_of_law.jpg
|
||||
|
||||
@@ -2,7 +2,7 @@ Name:Sphere of Purity
|
||||
ManaCost:3 W
|
||||
Types:Enchantment
|
||||
Text:no text
|
||||
K:stPreventDamage:You:Artifact:1:If an artifact source would deal damage to you, prevent 1 of that damage.
|
||||
S:Mode$ PreventDamage | Target$ You | Source$ Artifact | Amount$ 1 | Description$ If an artifact source would deal damage to you, prevent 1 of that damage.
|
||||
SVar:RemRandomDeck:True
|
||||
SVar:Rarity:Uncommon
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/sphere_of_purity.jpg
|
||||
|
||||
@@ -2,7 +2,7 @@ Name:Sphere of Reason
|
||||
ManaCost:3 W
|
||||
Types:Enchantment
|
||||
Text:no text
|
||||
K:stPreventDamage:You:Card.Blue:2:If a blue source would deal damage to you, prevent 2 of that damage.
|
||||
S:Mode$ PreventDamage | Target$ You | Source$ Card.Blue | Amount$ 2 | Description$ If a blue source would deal damage to you, prevent 2 of that damage.
|
||||
SVar:RemRandomDeck:True
|
||||
SVar:Rarity:Uncommon
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/sphere_of_reason.jpg
|
||||
|
||||
@@ -2,7 +2,7 @@ Name:Sphere of Truth
|
||||
ManaCost:3 W
|
||||
Types:Enchantment
|
||||
Text:no text
|
||||
K:stPreventDamage:You:Card.White:2:If a white source would deal damage to you, prevent 2 of that damage.
|
||||
S:Mode$ PreventDamage | Target$ You | Source$ Card.White | Amount$ 2 | Description$ If a white source would deal damage to you, prevent 2 of that damage.
|
||||
SVar:RemRandomDeck:True
|
||||
SVar:Rarity:Uncommon
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/sphere_of_truth.jpg
|
||||
|
||||
@@ -2,9 +2,10 @@ Name:Urza's Armor
|
||||
ManaCost:6
|
||||
Types:Artifact
|
||||
Text:no text
|
||||
K:stPreventDamage:You:Card:1:If a source would deal damage to you, prevent 1 of that damage.
|
||||
S:Mode$ PreventDamage | Target$ You | Source$ Card | Amount$ 1 | Description$ If a source would deal damage to you, prevent 1 of that damage.
|
||||
SVar:Rarity:Uncommon
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/urzas_armor.jpg
|
||||
SetInfo:8ED|Rare|http://magiccards.info/scans/en/8e/318.jpg
|
||||
SetInfo:USG|Uncommon|http://magiccards.info/scans/en/us/313.jpg
|
||||
Oracle:If a source would deal damage to you, prevent 1 of that damage.
|
||||
End
|
||||
@@ -1569,11 +1569,6 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
} else if (keyword.get(i).toString().contains("Protection:")) {
|
||||
String[] k = keyword.get(i).split(":");
|
||||
sbLong.append(k[2]).append("\r\n");
|
||||
} else if (keyword.get(i).toString().contains("stPreventDamage:")) {
|
||||
String[] k = keyword.get(i).split(":");
|
||||
if (!k[4].equals("no text")) {
|
||||
sbLong.append(k[4]).append("\r\n");
|
||||
}
|
||||
} else if (keyword.get(i).toString().contains("Creatures can't attack unless their controller pays")) {
|
||||
String[] k = keyword.get(i).split(":");
|
||||
if (!k[3].equals("no text")) {
|
||||
@@ -5701,33 +5696,14 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
|
||||
|
||||
|
||||
//stPreventDamage
|
||||
//Prevent Damage static abilities
|
||||
CardList allp = AllZoneUtil.getCardsIn(Zone.Battlefield);
|
||||
for (Card ca : allp) {
|
||||
ArrayList<StaticAbility> staticAbilities = ca.getStaticAbilities();
|
||||
for (StaticAbility stAb : staticAbilities) {
|
||||
restDamage = stAb.applyAbility("PreventDamage", source, this, restDamage);
|
||||
}
|
||||
|
||||
if (ca.hasStartOfKeyword("stPreventDamage")) {
|
||||
//syntax stPreventDamage:[Who is protected(You/Player/ValidCards)]:[ValidSource]:[Amount/All]
|
||||
int keywordPosition = ca.getKeywordPosition("stPreventDamage");
|
||||
String parse = ca.getKeyword().get(keywordPosition).toString();
|
||||
String[] k = parse.split(":");
|
||||
|
||||
final String[] restrictions1 = k[1].split(",");
|
||||
final String[] restrictions2 = k[2].split(",");
|
||||
final Card card = ca;
|
||||
if (this.isValidCard(restrictions1, card.getController(), card)
|
||||
&& source.isValidCard(restrictions2, card.getController(), card))
|
||||
{
|
||||
if (k[3].equals("All")) {
|
||||
return 0;
|
||||
}
|
||||
restDamage = restDamage - Integer.valueOf(k[3]);
|
||||
}
|
||||
}
|
||||
} //stPreventDamage
|
||||
|
||||
// specific Cards
|
||||
if (isCreature()) { //and not a planeswalker
|
||||
|
||||
@@ -409,29 +409,14 @@ public abstract class Player extends GameEntity {
|
||||
return 0;
|
||||
}
|
||||
|
||||
//stPreventDamage
|
||||
//Prevent Damage static abilities
|
||||
CardList allp = AllZoneUtil.getCardsIn(Zone.Battlefield);
|
||||
for (Card ca : allp) {
|
||||
ArrayList<StaticAbility> staticAbilities = ca.getStaticAbilities();
|
||||
for (StaticAbility stAb : staticAbilities) {
|
||||
restDamage = stAb.applyAbility("PreventDamage", source, this, restDamage);
|
||||
}
|
||||
if (ca.hasStartOfKeyword("stPreventDamage")) {
|
||||
//syntax stPreventDamage:[Who is protected(You/Player/ValidCards)]:[ValidSource]:[Amount/All]
|
||||
int KeywordPosition = ca.getKeywordPosition("stPreventDamage");
|
||||
String parse = ca.getKeyword().get(KeywordPosition).toString();
|
||||
String k[] = parse.split(":");
|
||||
|
||||
final Card card = ca;
|
||||
if (k[1].equals("Player") || (k[1].equals("You") && card.getController().isPlayer(this))) {
|
||||
final String restrictions[] = k[2].split(",");
|
||||
if (source.isValidCard(restrictions, card.getController(), card)) {
|
||||
if (k[3].equals("All")) return 0;
|
||||
restDamage = restDamage - Integer.valueOf(k[3]);
|
||||
}
|
||||
}
|
||||
}
|
||||
} //stPreventDamage
|
||||
|
||||
//specific cards
|
||||
if (AllZoneUtil.isCardInPlay("Spirit of Resistance", this)) {
|
||||
|
||||
Reference in New Issue
Block a user