mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
- Added stPreventDamage keyword for creature protection.
- Converted some cards.
This commit is contained in:
2
.gitattributes
vendored
2
.gitattributes
vendored
@@ -1621,7 +1621,7 @@ res/cardsfolder/daru_lancer.txt -text svneol=native#text/plain
|
|||||||
res/cardsfolder/daru_mender.txt svneol=native#text/plain
|
res/cardsfolder/daru_mender.txt svneol=native#text/plain
|
||||||
res/cardsfolder/daru_sanctifier.txt svneol=native#text/plain
|
res/cardsfolder/daru_sanctifier.txt svneol=native#text/plain
|
||||||
res/cardsfolder/daru_warchief.txt -text svneol=native#text/plain
|
res/cardsfolder/daru_warchief.txt -text svneol=native#text/plain
|
||||||
res/cardsfolder/daunting_defender.txt svneol=native#text/plain
|
res/cardsfolder/daunting_defender.txt -text svneol=native#text/plain
|
||||||
res/cardsfolder/dauntless_dourbark.txt -text svneol=native#text/plain
|
res/cardsfolder/dauntless_dourbark.txt -text svneol=native#text/plain
|
||||||
res/cardsfolder/dauntless_escort.txt -text svneol=native#text/plain
|
res/cardsfolder/dauntless_escort.txt -text svneol=native#text/plain
|
||||||
res/cardsfolder/dauthi_cutthroat.txt -text svneol=native#text/plain
|
res/cardsfolder/dauthi_cutthroat.txt -text svneol=native#text/plain
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
Name:Daunting Defender
|
Name:Daunting Defender
|
||||||
ManaCost:4 W
|
ManaCost:4 W
|
||||||
Types:Creature Human Cleric
|
Types:Creature Human Cleric
|
||||||
Text:If a source would deal damage to a Cleric creature you control, prevent 1 of that damage.
|
Text:no text
|
||||||
|
K:stPreventDamage:Creature.Cleric+YouCtrl:Card:1:If a source would deal damage to a Cleric creature you control, prevent 1 of that damage.
|
||||||
PT:3/3
|
PT:3/3
|
||||||
SVar:Rarity:Common
|
SVar:Rarity:Common
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/daunting_defender.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/daunting_defender.jpg
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
Name:Light of Sanction
|
Name:Light of Sanction
|
||||||
ManaCost:1 W W
|
ManaCost:1 W W
|
||||||
Types:Enchantment
|
Types:Enchantment
|
||||||
Text:Prevent all damage that would be dealt to creatures you control by sources you control.
|
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.
|
||||||
SVar:RemRandomDeck:True
|
SVar:RemRandomDeck:True
|
||||||
SVar:Rarity:Rare
|
SVar:Rarity:Rare
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/light_of_sanction.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/light_of_sanction.jpg
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ PT:1/2
|
|||||||
K:Flash
|
K:Flash
|
||||||
K:Flying
|
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: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
|
||||||
SVar:Rarity:Uncommon
|
SVar:Rarity:Uncommon
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/plated_pegasus.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/plated_pegasus.jpg
|
||||||
SetInfo:TSP|Uncommon|http://magiccards.info/scans/en/ts/34.jpg
|
SetInfo:TSP|Uncommon|http://magiccards.info/scans/en/ts/34.jpg
|
||||||
|
|||||||
@@ -986,7 +986,8 @@ public class Card extends MyObservable {
|
|||||||
sbLong.append(k[2]).append("\r\n");
|
sbLong.append(k[2]).append("\r\n");
|
||||||
}else if (keyword.get(i).toString().contains("stPreventDamage:")) {
|
}else if (keyword.get(i).toString().contains("stPreventDamage:")) {
|
||||||
String k[] = keyword.get(i).split(":");
|
String k[] = keyword.get(i).split(":");
|
||||||
sbLong.append(k[4]).append("\r\n");
|
if(!k[4].equals("no text"))
|
||||||
|
sbLong.append(k[4]).append("\r\n");
|
||||||
} else if (keyword.get(i).startsWith("Enchant")) {
|
} else if (keyword.get(i).startsWith("Enchant")) {
|
||||||
String k = keyword.get(i);
|
String k = keyword.get(i);
|
||||||
k = k.replace("Curse", "");
|
k = k.replace("Curse", "");
|
||||||
@@ -3213,24 +3214,47 @@ public class Card extends MyObservable {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//stPreventDamage
|
||||||
|
CardList allp = AllZoneUtil.getCardsInPlay();
|
||||||
|
for(Card ca : allp) {
|
||||||
|
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)) {
|
||||||
|
if(source.isValidCard(restrictions2,card.getController(),card)) {
|
||||||
|
if (k[3].equals("All")) return 0;
|
||||||
|
restDamage = restDamage - Integer.valueOf(k[3]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} //stPreventDamage
|
||||||
|
|
||||||
// specific Cards
|
// specific Cards
|
||||||
if(isCreature()) { //and not a planeswalker
|
if(isCreature()) { //and not a planeswalker
|
||||||
if((source.isCreature() && AllZoneUtil.isCardInPlay("Well-Laid Plans") && source.sharesColorWith(this)))return 0;
|
if((source.isCreature() && AllZoneUtil.isCardInPlay("Well-Laid Plans") && source.sharesColorWith(this)))return 0;
|
||||||
|
|
||||||
if((!isCombat && AllZoneUtil.isCardInPlay("Mark of Asylum", player)))return 0;
|
if((!isCombat && AllZoneUtil.isCardInPlay("Mark of Asylum", player)))return 0;
|
||||||
|
|
||||||
|
/*
|
||||||
if((AllZoneUtil.isCardInPlay("Light of Sanction", player) && source.getController().isPlayer(player)))
|
if((AllZoneUtil.isCardInPlay("Light of Sanction", player) && source.getController().isPlayer(player)))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (AllZoneUtil.isCardInPlay("Plated Pegasus") && source.isSpell()&& restDamage > 0) {
|
if (AllZoneUtil.isCardInPlay("Plated Pegasus") && source.isSpell()&& restDamage > 0) {
|
||||||
int amount = AllZoneUtil.getCardsInPlay("Plated Pegasus").size();
|
int amount = AllZoneUtil.getCardsInPlay("Plated Pegasus").size();
|
||||||
for (int i = 0; i < amount;i++)
|
for (int i = 0; i < amount;i++)
|
||||||
if ( restDamage > 0 )
|
if ( restDamage > 0 ) %
|
||||||
restDamage -= 1;
|
restDamage -= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isType("Cleric") && AllZoneUtil.isCardInPlay("Daunting Defender", player))
|
if (isType("Cleric") && AllZoneUtil.isCardInPlay("Daunting Defender", player))
|
||||||
restDamage = restDamage - AllZoneUtil.getPlayerCardsInPlay(player, "Daunting Defender").size();
|
restDamage = restDamage - AllZoneUtil.getPlayerCardsInPlay(player, "Daunting Defender").size();
|
||||||
|
*/
|
||||||
|
|
||||||
if(getName().equals("Callous Giant") && restDamage <= 3) return 0;
|
if(getName().equals("Callous Giant") && restDamage <= 3) return 0;
|
||||||
} //Creature end
|
} //Creature end
|
||||||
|
|||||||
@@ -300,12 +300,11 @@ public abstract class Player extends MyObservable{
|
|||||||
|
|
||||||
final Card card = ca;
|
final Card card = ca;
|
||||||
if(k[1].equals("Player") || (k[1].equals("You") && card.getController().isPlayer(this))) {
|
if(k[1].equals("Player") || (k[1].equals("You") && card.getController().isPlayer(this))) {
|
||||||
final String restrictions[] = k[2].split(",");
|
final String restrictions[] = k[2].split(",");
|
||||||
|
if(source.isValidCard(restrictions,card.getController(),card)) {
|
||||||
if(source.isValidCard(restrictions,card.getController(),card)) {
|
if (k[3].equals("All")) return 0;
|
||||||
if (k[3].equals("All")) return 0;
|
restDamage = restDamage - Integer.valueOf(k[3]);
|
||||||
restDamage = restDamage - Integer.valueOf(k[3]);
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} //stPreventDamage
|
} //stPreventDamage
|
||||||
|
|||||||
Reference in New Issue
Block a user