- Added the keyword "Whenever CARDNAME deals damage, you gain that much life.".

- Converted some of the lifelink abilities to it.
- Added Noble Purpose.
This commit is contained in:
jendave
2011-08-06 12:49:50 +00:00
parent 8910f6d59f
commit be9a82aeee
10 changed files with 57 additions and 19 deletions

1
.gitattributes vendored
View File

@@ -3229,6 +3229,7 @@ res/cardsfolder/no_mercy.txt -text svneol=native#text/plain
res/cardsfolder/nobilis_of_war.txt -text svneol=native#text/plain res/cardsfolder/nobilis_of_war.txt -text svneol=native#text/plain
res/cardsfolder/noble_hierarch.txt -text svneol=native#text/plain res/cardsfolder/noble_hierarch.txt -text svneol=native#text/plain
res/cardsfolder/noble_panther.txt -text svneol=native#text/plain res/cardsfolder/noble_panther.txt -text svneol=native#text/plain
res/cardsfolder/noble_purpose.txt -text svneol=native#text/plain
res/cardsfolder/noble_steeds.txt -text svneol=native#text/plain res/cardsfolder/noble_steeds.txt -text svneol=native#text/plain
res/cardsfolder/noble_templar.txt -text svneol=native#text/plain res/cardsfolder/noble_templar.txt -text svneol=native#text/plain
res/cardsfolder/nocturnal_raid.txt -text svneol=native#text/plain res/cardsfolder/nocturnal_raid.txt -text svneol=native#text/plain

View File

@@ -3,7 +3,7 @@ ManaCost:1 B B
Types:Creature Human Wizard Types:Creature Human Wizard
Text:no text Text:no text
PT:1/1 PT:1/1
K:Lifelink K:Whenever CARDNAME deals damage, you gain that much life.
SVar:Rarity:Rare SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/el_hajjaj.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/el_hajjaj.jpg
SetInfo:3ED|Rare|http://magiccards.info/scans/en/rv/16.jpg SetInfo:3ED|Rare|http://magiccards.info/scans/en/rv/16.jpg

View File

@@ -4,7 +4,7 @@ Types:Creature Angel
Text:no text Text:no text
PT:4/5 PT:4/5
K:Flying K:Flying
K:Lifelink K:Whenever Exalted Angel deals damage, you gain that much life.
K:Morph:2 W W K:Morph:2 W W
SVar:Rarity:Rare SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/exalted_angel.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/exalted_angel.jpg

View File

@@ -3,7 +3,7 @@ ManaCost:2 G W
Types:Creature Cat Types:Creature Cat
Text:no text Text:no text
PT:2/2 PT:2/2
K:Lifelink K:Whenever CARDNAME deals damage, you gain that much life.
SVar:Rarity:Uncommon SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/horned_cheetah.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/horned_cheetah.jpg
SetInfo:INV|Uncommon|http://magiccards.info/scans/en/in/251.jpg SetInfo:INV|Uncommon|http://magiccards.info/scans/en/in/251.jpg

View File

@@ -5,7 +5,7 @@ Text:no text
PT:3/3 PT:3/3
K:Flying K:Flying
K:First Strike K:First Strike
K:Lifelink K:Whenever CARDNAME deals damage, you gain that much life.
SVar:Rarity:Uncommon SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/kjeldoran_gargoyle.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/kjeldoran_gargoyle.jpg
SetInfo:CSP|Uncommon|http://magiccards.info/scans/en/cs/10.jpg SetInfo:CSP|Uncommon|http://magiccards.info/scans/en/cs/10.jpg

View File

@@ -4,7 +4,7 @@ Types:Creature Thrull
Text:no text Text:no text
PT:1/1 PT:1/1
K:Flying K:Flying
K:Lifelink K:Whenever CARDNAME deals damage, you gain that much life.
SVar:Rarity:Common SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/mourning_thrull.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/mourning_thrull.jpg
SetInfo:GPT|Common|http://magiccards.info/scans/en/gp/146.jpg SetInfo:GPT|Common|http://magiccards.info/scans/en/gp/146.jpg

View File

@@ -0,0 +1,8 @@
Name:Noble Purpose
ManaCost:3 W W
Types:Enchantment
Text:no text
K:stPumpAll:Creature.YouCtrl:0/0/HIDDEN Whenever CARDNAME deals damage, you gain that much life.:No Condition:Whenever a creature you control deals combat damage, you gain that much life.
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/noble_purpose.jpg
End

View File

@@ -1,8 +1,8 @@
Name:Rite of Passage Name:Noble Purpose
ManaCost:2 G ManaCost:3 W W
Types:Enchantment Types:Enchantment
Text:no text Text:no text
K:stPumpAll:Creature.YouCtrl:0/0/HIDDEN Whenever CARDNAME is dealt damage, put a +1/+1 counter on it.:No Condition:Whenever a creature you control is dealt damage, put a +1/+1 counter on it. (The damage is dealt before the counter is put on.) K:stPumpAll:Creature.YouCtrl:0/0/HIDDEN Whenever CARDNAME deals damage, you gain that much life.:No Condition:Whenever a creature you control is dealt damage, put a +1/+1 counter on it. (The damage is dealt before the counter is put on.)
SVar:Rarity:Rare SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/rite_of_passage.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/rite_of_passage.jpg
End End

View File

@@ -2853,24 +2853,22 @@ public class Card extends MyObservable {
System.out.println("Adding " + damageToAdd + " damage to " + getName()); System.out.println("Adding " + damageToAdd + " damage to " + getName());
Log.debug("Adding " + damageToAdd + " damage to " + getName()); Log.debug("Adding " + damageToAdd + " damage to " + getName());
if(source.getKeyword().contains("Lifelink")) GameActionUtil.executeLifeLinkEffects(source, damageToAdd); GameActionUtil.executeDamageDealingEffects(source, this, damageToAdd);
CardList cl = CardFactoryUtil.getAurasEnchanting(source, "Guilty Conscience"); if(this.isPlaneswalker()) {
for(Card c:cl) { this.subtractCounter(Counters.LOYALTY, damageToAdd);
GameActionUtil.executeGuiltyConscienceEffects(source, c, damageToAdd); return;
} }
GameActionUtil.executeDamageToCreatureEffects(source, this, damageToAdd);
if((source.getKeyword().contains("Wither") || source.getKeyword().contains("Infect")) && this.isCreature()) { if((source.getKeyword().contains("Wither") || source.getKeyword().contains("Infect")) && this.isCreature()) {
this.addCounterFromNonEffect(Counters.M1M1, damageToAdd); this.addCounterFromNonEffect(Counters.M1M1, damageToAdd);
damageToAdd = 0; damageToAdd = 0;
} }
if(this.isPlaneswalker()) {
this.subtractCounter(Counters.LOYALTY, damageToAdd);
} else
if(AllZoneUtil.isCardInPlay(this)) damage += damageToAdd; if(AllZoneUtil.isCardInPlay(this)) damage += damageToAdd;
GameActionUtil.executeCreatureDamageEffects(source, this, damageToAdd);
} }
private ArrayList<SetInfo> Sets = new ArrayList<SetInfo>(); private ArrayList<SetInfo> Sets = new ArrayList<SetInfo>();
private String curSetCode = ""; private String curSetCode = "";

View File

@@ -5333,8 +5333,39 @@ public class GameActionUtil {
AllZone.Stack.add(ability2); AllZone.Stack.add(ability2);
} }
//not restricted to combat damage //not restricted to combat damage, not restricted to dealing damage to creatures
public static void executeCreatureDamageEffects(final Card source, final Card affected, int damage) { public static void executeDamageDealingEffects(final Card source, final Card affected, int damage) {
final Player player = affected.getController();
if(source.getKeyword().contains("Lifelink")) GameActionUtil.executeLifeLinkEffects(source, damage);
if(source.getKeyword().contains("Whenever CARDNAME deals damage, you gain that much life.")) {
final int life = damage;
Ability ability = new Ability(source, "0") {
@Override
public void resolve() {
player.gainLife(life, affected);
}
};
StringBuilder sb = new StringBuilder();
sb.append(source.getName()+" - ").append(player).append(" gains ").append(life).append(" life");
ability.setStackDescription(sb.toString());
int amount = affected.getAmountOfKeyword("Whenever CARDNAME deals damage, you gain that much life.");
for(int i=0 ; i < amount ; i++)
AllZone.Stack.add(ability);
}
CardList cl = CardFactoryUtil.getAurasEnchanting(source, "Guilty Conscience");
for(Card c:cl) {
GameActionUtil.executeGuiltyConscienceEffects(source, c, damage);
}
}
//not restricted to combat damage, restricted to dealing damage to creatures
public static void executeDamageToCreatureEffects(final Card source, final Card affected, int damage) {
final Player player = affected.getController(); final Player player = affected.getController();