add Reckless Abandon (from Urza's Destiny) and fix Goblin Grenade to addDamage instead of subtractLife.

This commit is contained in:
jendave
2011-08-06 08:59:24 +00:00
parent bf66a421c2
commit d348629d27
4 changed files with 25 additions and 15 deletions

1
.gitattributes vendored
View File

@@ -3142,6 +3142,7 @@ res/cardsfolder/reborn_hope.txt -text svneol=native#text/plain
res/cardsfolder/rebuff_the_wicked.txt -text svneol=native#text/plain res/cardsfolder/rebuff_the_wicked.txt -text svneol=native#text/plain
res/cardsfolder/rebuild.txt -text svneol=native#text/plain res/cardsfolder/rebuild.txt -text svneol=native#text/plain
res/cardsfolder/recall.txt -text svneol=native#text/plain res/cardsfolder/recall.txt -text svneol=native#text/plain
res/cardsfolder/reckless_abandon.txt -text svneol=native#text/plain
res/cardsfolder/reckless_assault.txt -text svneol=native#text/plain res/cardsfolder/reckless_assault.txt -text svneol=native#text/plain
res/cardsfolder/reckless_embermage.txt -text svneol=native#text/plain res/cardsfolder/reckless_embermage.txt -text svneol=native#text/plain
res/cardsfolder/reckless_ogre.txt -text svneol=native#text/plain res/cardsfolder/reckless_ogre.txt -text svneol=native#text/plain

View File

@@ -1,7 +1,7 @@
Name:Goblin Grenade Name:Goblin Grenade
ManaCost:R ManaCost:R
Types:Sorcery Types:Sorcery
Text:As an additional cost to cast Goblin Grenade, sacrifice a Goblin. Text:As an additional cost to cast Goblin Grenade, sacrifice a Goblin.
SVar:Rarity:Common SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/goblin_grenade.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/goblin_grenade.jpg
End End

View File

@@ -0,0 +1,7 @@
Name:Reckless Abandon
ManaCost:R
Types:Sorcery
Text:As an additional cost to cast Reckless Abandon, sacrifice a creature.
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/reckless_abandon.jpg
End

View File

@@ -4121,7 +4121,9 @@ public class CardFactory_Sorceries {
//*************** START ************ START ************************** //*************** START ************ START **************************
else if(cardName.equals("Goblin Grenade")) { else if(cardName.equals("Goblin Grenade") || cardName.equals("Reckless Abandon")) {
final int damage = cardName.equals("Reckless Abandon") ? 4 : 5;
final String type = cardName.equals("Reckless Abandon") ? "Creature" : "Goblin";
final SpellAbility DamageCP = new Spell(card) { final SpellAbility DamageCP = new Spell(card) {
private static final long serialVersionUID = -4289150611689144985L; private static final long serialVersionUID = -4289150611689144985L;
Card check; Card check;
@@ -4129,14 +4131,14 @@ public class CardFactory_Sorceries {
@Override @Override
public boolean canPlay() { public boolean canPlay() {
CardList gobs = new CardList(AllZone.getZone(Constant.Zone.Play, card.getController()).getCards()); CardList gobs = new CardList(AllZone.getZone(Constant.Zone.Play, card.getController()).getCards());
gobs = gobs.getType("Goblin"); gobs = gobs.getType(type);
return super.canPlay() && gobs.size() > 0; return super.canPlay() && gobs.size() > 0;
} }
@Override @Override
public boolean canPlayAI() { public boolean canPlayAI() {
if(AllZone.Human_Life.getLife() <= 5) return true; if(AllZone.Human_Life.getLife() <= damage) return true;
PlayerZone compHand = AllZone.getZone(Constant.Zone.Hand, Constant.Player.Computer); PlayerZone compHand = AllZone.getZone(Constant.Zone.Hand, Constant.Player.Computer);
CardList hand = new CardList(compHand.getCards()); CardList hand = new CardList(compHand.getCards());
@@ -4149,7 +4151,7 @@ public class CardFactory_Sorceries {
@Override @Override
public void chooseTargetAI() { public void chooseTargetAI() {
if(AllZone.Human_Life.getLife() <= 5) { if(AllZone.Human_Life.getLife() <= damage) {
setTargetPlayer(Constant.Player.Human); setTargetPlayer(Constant.Player.Human);
return; return;
} }
@@ -4165,7 +4167,7 @@ public class CardFactory_Sorceries {
Card c = getFlying(); Card c = getFlying();
if(check == null && c != null) Log.debug("Goblin Grenade", "Check equals null"); if(check == null && c != null) Log.debug(card.getName(), "Check equals null");
else if((c == null) || (!check.equals(c))) throw new RuntimeException(card else if((c == null) || (!check.equals(c))) throw new RuntimeException(card
+ " error in chooseTargetAI() - Card c is " + c + ", Card check is " + check); + " error in chooseTargetAI() - Card c is " + c + ", Card check is " + check);
@@ -4176,12 +4178,12 @@ public class CardFactory_Sorceries {
Card getFlying() { Card getFlying() {
CardList flying = CardFactoryUtil.AI_getHumanCreature("Flying", card, true); CardList flying = CardFactoryUtil.AI_getHumanCreature("Flying", card, true);
for(int i = 0; i < flying.size(); i++) for(int i = 0; i < flying.size(); i++)
if(flying.get(i).getNetDefense() <= 5) { if(flying.get(i).getNetDefense() <= damage) {
Log.debug("Goblin Grenade", "getFlying() returns " + flying.get(i).getName()); Log.debug(card.getName(), "getFlying() returns " + flying.get(i).getName());
return flying.get(i); return flying.get(i);
} }
Log.debug("Goblin Grenade", "getFlying() returned null"); Log.debug(card.getName(), "getFlying() returned null");
return null; return null;
} }
@@ -4189,7 +4191,7 @@ public class CardFactory_Sorceries {
public void resolve() { public void resolve() {
if(card.getController().equals(Constant.Player.Computer)) { if(card.getController().equals(Constant.Player.Computer)) {
CardList gobs = new CardList(AllZone.getZone(Constant.Zone.Play, card.getController()).getCards()); CardList gobs = new CardList(AllZone.getZone(Constant.Zone.Play, card.getController()).getCards());
gobs = gobs.getType("Goblin"); gobs = gobs.getType(type);
if(gobs.size() > 0) { if(gobs.size() > 0) {
CardListUtil.sortAttackLowFirst(gobs); CardListUtil.sortAttackLowFirst(gobs);
@@ -4203,13 +4205,13 @@ public class CardFactory_Sorceries {
&& CardFactoryUtil.canTarget(card, getTargetCard())) { && CardFactoryUtil.canTarget(card, getTargetCard())) {
Card c = getTargetCard(); Card c = getTargetCard();
//c.addDamage(damage); //c.addDamage(damage);
AllZone.GameAction.addDamage(c, card, 5); AllZone.GameAction.addDamage(c, card, damage);
} }
} else AllZone.GameAction.getPlayerLife(getTargetPlayer()).subtractLife(5,card); } else AllZone.GameAction.addDamage(getTargetPlayer(), card, damage);
//resolve() //resolve()
} }
}; //spellAbility }; //spellAbility
DamageCP.setDescription(card.getName() + " deals 5 damage to target creature or player."); DamageCP.setDescription(card.getName() + " deals "+damage+" damage to target creature or player.");
//DamageCP.setStackDescription(card.getName() +" deals 5 damage."); //DamageCP.setStackDescription(card.getName() +" deals 5 damage.");
Input target = new Input() { Input target = new Input() {
@@ -4253,7 +4255,7 @@ public class CardFactory_Sorceries {
@Override @Override
public void showMessage() { public void showMessage() {
AllZone.Display.showMessage("Select a Goblin to sacrifice."); AllZone.Display.showMessage("Select a "+type+" to sacrifice.");
ButtonUtil.enableOnlyCancel(); ButtonUtil.enableOnlyCancel();
} }
@@ -4266,7 +4268,7 @@ public class CardFactory_Sorceries {
public void selectCard(Card crd, PlayerZone zone) { public void selectCard(Card crd, PlayerZone zone) {
CardList choices = new CardList( CardList choices = new CardList(
AllZone.getZone(Constant.Zone.Play, card.getController()).getCards()); AllZone.getZone(Constant.Zone.Play, card.getController()).getCards());
choices = choices.getType("Goblin"); choices = choices.getType(type);
if(choices.contains(crd)) { if(choices.contains(crd)) {
AllZone.GameAction.sacrifice(crd); AllZone.GameAction.sacrifice(crd);