- Added stPreventDamage keyword for creature protection.

- Converted some cards.
This commit is contained in:
jendave
2011-08-07 00:06:24 +00:00
parent 169e8fb73e
commit 38b18c6418
6 changed files with 45 additions and 19 deletions

2
.gitattributes vendored
View File

@@ -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_sanctifier.txt 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_escort.txt -text svneol=native#text/plain
res/cardsfolder/dauthi_cutthroat.txt -text svneol=native#text/plain

View File

@@ -1,7 +1,8 @@
Name:Daunting Defender
ManaCost:4 W
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
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/daunting_defender.jpg

View File

@@ -1,7 +1,8 @@
Name:Light of Sanction
ManaCost:1 W W
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:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/light_of_sanction.jpg

View File

@@ -6,6 +6,7 @@ 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
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

View File

@@ -986,7 +986,8 @@ public class Card extends MyObservable {
sbLong.append(k[2]).append("\r\n");
}else if (keyword.get(i).toString().contains("stPreventDamage:")) {
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")) {
String k = keyword.get(i);
k = k.replace("Curse", "");
@@ -3213,24 +3214,47 @@ public class Card extends MyObservable {
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
if(isCreature()) { //and not a planeswalker
if((source.isCreature() && AllZoneUtil.isCardInPlay("Well-Laid Plans") && source.sharesColorWith(this)))return 0;
if((!isCombat && AllZoneUtil.isCardInPlay("Mark of Asylum", player)))return 0;
/*
if((AllZoneUtil.isCardInPlay("Light of Sanction", player) && source.getController().isPlayer(player)))
return 0;
if (AllZoneUtil.isCardInPlay("Plated Pegasus") && source.isSpell()&& restDamage > 0) {
int amount = AllZoneUtil.getCardsInPlay("Plated Pegasus").size();
for (int i = 0; i < amount;i++)
if ( restDamage > 0 )
if ( restDamage > 0 ) %
restDamage -= 1;
}
if (isType("Cleric") && AllZoneUtil.isCardInPlay("Daunting Defender", player))
restDamage = restDamage - AllZoneUtil.getPlayerCardsInPlay(player, "Daunting Defender").size();
*/
if(getName().equals("Callous Giant") && restDamage <= 3) return 0;
} //Creature end

View File

@@ -300,12 +300,11 @@ public abstract class Player extends MyObservable{
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]);
}
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