Fixed spDamgTgt to consider wither. TODO: Stuffy doll(which is supposed to selfdestruct when given wither).

This commit is contained in:
jendave
2011-08-06 02:46:23 +00:00
parent 2114d9eaed
commit fc45d9b745
3 changed files with 20 additions and 8 deletions

View File

@@ -1,6 +1,6 @@
program/mail=mtgrares@yahoo.com program/mail=mtgrares@yahoo.com
program/forum=http://www.slightlymagic.net/forum/viewforum.php?f=26 program/forum=http://www.slightlymagic.net/forum/viewforum.php?f=26
program/version=MTG Forge -- official beta: 09/11/02, SVN revision: 62 program/version=MTG Forge -- official beta: 09/11/02, SVN revision: 63
tokens--file=AllTokens.txt tokens--file=AllTokens.txt

View File

@@ -1421,7 +1421,10 @@ public class CardFactory implements NewConstants {
if(getTargetCard() != null) if(getTargetCard() != null)
{ {
if(AllZone.GameAction.isCardInPlay(getTargetCard()) && CardFactoryUtil.canTarget(card, getTargetCard()) ) { if(AllZone.GameAction.isCardInPlay(getTargetCard()) && CardFactoryUtil.canTarget(card, getTargetCard()) ) {
getTargetCard().addDamage(dmg[0]); if (card.getKeyword().contains("Wither"))
getTargetCard().addCounter(Counters.M1M1, dmg[0]);
else
getTargetCard().addDamage(dmg[0]);
if (card.getKeyword().contains("Lifelink")) if (card.getKeyword().contains("Lifelink"))
GameActionUtil.executeLifeLinkEffects(card, dmg[0]); GameActionUtil.executeLifeLinkEffects(card, dmg[0]);
for(int i=0; i < CardFactoryUtil.hasNumberEnchantments(card, "Guilty Conscience"); i++) for(int i=0; i < CardFactoryUtil.hasNumberEnchantments(card, "Guilty Conscience"); i++)
@@ -1466,7 +1469,10 @@ public class CardFactory implements NewConstants {
{ {
if(AllZone.GameAction.isCardInPlay(getTargetCard()) && CardFactoryUtil.canTarget(card, getTargetCard()) ) if(AllZone.GameAction.isCardInPlay(getTargetCard()) && CardFactoryUtil.canTarget(card, getTargetCard()) )
{ {
getTargetCard().addDamage(dmg[0]); if (card.getKeyword().contains("Wither"))
getTargetCard().addCounter(Counters.M1M1, dmg[0]);
else
getTargetCard().addDamage(dmg[0]);
if (card.getKeyword().contains("Lifelink")) if (card.getKeyword().contains("Lifelink"))
GameActionUtil.executeLifeLinkEffects(card, dmg[0]); GameActionUtil.executeLifeLinkEffects(card, dmg[0]);
for(int i=0; i < CardFactoryUtil.hasNumberEnchantments(card, "Guilty Conscience"); i++) for(int i=0; i < CardFactoryUtil.hasNumberEnchantments(card, "Guilty Conscience"); i++)
@@ -1513,7 +1519,10 @@ public class CardFactory implements NewConstants {
if(getTargetCard() != null) if(getTargetCard() != null)
{ {
if(AllZone.GameAction.isCardInPlay(getTargetCard()) && CardFactoryUtil.canTarget(card, getTargetCard()) ) { if(AllZone.GameAction.isCardInPlay(getTargetCard()) && CardFactoryUtil.canTarget(card, getTargetCard()) ) {
getTargetCard().addDamage(dmg[0]); if (card.getKeyword().contains("Wither"))
getTargetCard().addCounter(Counters.M1M1, dmg[0]);
else
getTargetCard().addDamage(dmg[0]);
if (card.getKeyword().contains("Lifelink")) if (card.getKeyword().contains("Lifelink"))
GameActionUtil.executeLifeLinkEffects(card, dmg[0]); GameActionUtil.executeLifeLinkEffects(card, dmg[0]);
for(int i=0; i < CardFactoryUtil.hasNumberEnchantments(card, "Guilty Conscience"); i++) for(int i=0; i < CardFactoryUtil.hasNumberEnchantments(card, "Guilty Conscience"); i++)
@@ -16166,7 +16175,12 @@ return land.size() > 1 && CardFactoryUtil.AI_isMainPhase();
boolean undoable = true; boolean undoable = true;
public void undo() {card.addCounter(Counters.CHARGE, 1);} public void undo() {card.addCounter(Counters.CHARGE, 1);}
public String Mana() {return this.choices_made[0].toString();} public String Mana() {return this.choices_made[0].toString();}
public boolean canPlay() {return super.canPlay() && card.getCounters(Counters.CHARGE) > 0;} public boolean canPlay()
{
if(choices_made[0] == null)
choices_made[0] = "1";
return super.canPlay() && card.getCounters(Counters.CHARGE) > 0;
}
public void resolve(){card.subtractCounter(Counters.CHARGE, 1); super.resolve();} public void resolve(){card.subtractCounter(Counters.CHARGE, 1); super.resolve();}
}; };
retrieve.choices_made = new String[1]; retrieve.choices_made = new String[1];
@@ -16177,8 +16191,6 @@ return land.size() > 1 && CardFactoryUtil.AI_isMainPhase();
public void showMessage() public void showMessage()
{ {
retrieve.choices_made[0] = Input_PayManaCostUtil.getColor2((String)AllZone.Display.getChoiceOptional("Select a Color", Constant.Color.onlyColors)); retrieve.choices_made[0] = Input_PayManaCostUtil.getColor2((String)AllZone.Display.getChoiceOptional("Select a Color", Constant.Color.onlyColors));
if(retrieve.choices_made[0] == null)
retrieve.choices_made[0] = "1";
AllZone.Stack.add(retrieve); AllZone.Stack.add(retrieve);
stop(); stop();
} }

View File

@@ -352,7 +352,7 @@ public class ManaPool extends Card
if(choices.size() == 0) return manaCost; if(choices.size() == 0) return manaCost;
chosen = choices.get(0); chosen = choices.get(0);
if (choices.size()> 1) if (choices.size()> 1)
chosen = (String)AllZone.Display.getChoiceOptional("Choose "+ (isSnow()? "snow " : "")+"mana to pay" + Mana, choices.toArray()); chosen = (String)AllZone.Display.getChoiceOptional("Choose "+ (isSnow()? "snow " : "")+"mana to pay " + Mana, choices.toArray());
if (chosen == null) {spendAll = false; return manaCost;} if (chosen == null) {spendAll = false; return manaCost;}
if(chosen.equals(Constant.Color.Snow)) if(chosen.equals(Constant.Color.Snow))
manaCost.subtractMana(chosen); manaCost.subtractMana(chosen);