add Phyrexian Processor (from Urza's Saga)

This commit is contained in:
jendave
2011-08-06 12:35:39 +00:00
parent 0c9c4bd42a
commit 65fecebb3a
5 changed files with 76 additions and 0 deletions

1
.gitattributes vendored
View File

@@ -3408,6 +3408,7 @@ res/cardsfolder/phyrexian_hulk.txt -text svneol=native#text/plain
res/cardsfolder/phyrexian_ironfoot.txt -text svneol=native#text/plain
res/cardsfolder/phyrexian_monitor.txt -text svneol=native#text/plain
res/cardsfolder/phyrexian_plaguelord.txt -text svneol=native#text/plain
res/cardsfolder/phyrexian_processor.txt -text svneol=native#text/plain
res/cardsfolder/phyrexian_prowler.txt -text svneol=native#text/plain
res/cardsfolder/phyrexian_rager.txt -text svneol=native#text/plain
res/cardsfolder/phyrexian_snowcrusher.txt -text svneol=native#text/plain

View File

@@ -0,0 +1,10 @@
Name:Phyrexian Processor
ManaCost:4
Types:Artifact
Text:As Phyrexian Processor enters the battlefield, pay any amount of life.
A:AB$Token | Cost$ 4 T | TokenAmount$ 1 | TokenName$ Minion | TokenTypes$ Creature,Minion | TokenOwner$ Controller | TokenColors$ Black | TokenPower$ X | TokenToughness$ X |SpellDescription$Put an X/X black Minion creature token onto the battlefield, where X is the life paid as Phyrexian Processor entered the battlefield.
SVar:X:Count$xLifePaid
SVar:RemAIDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/phyrexian_processor.jpg
End

View File

@@ -112,6 +112,8 @@ public class Card extends MyObservable {
private int xManaCostPaid = 0;
private int xLifePaid = 0;
private int multiKickerMagnitude = 0;
private Player owner = null;
@@ -205,6 +207,16 @@ public class Card extends MyObservable {
return xManaCostPaid;
}
public void setXLifePaid(int n)
{
xLifePaid = n;
}
public int getXLifePaid()
{
return xLifePaid;
}
//used to see if an attacking creature with a triggering attack ability triggered this phase:
public void setCreatureAttackedThisCombat(boolean b) {
creatureAttackedThisCombat = b;

View File

@@ -11369,6 +11369,45 @@ public class CardFactory implements NewConstants {
card.addComesIntoPlayCommand(intoPlay);
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Phyrexian Processor")) {
final SpellAbility ability = new Ability_Static(card, "0") {
@Override
public void resolve() {
Player player = card.getController();
int lifeToPay = 0;
if(player.isHuman()) {
int num = card.getController().getLife();
String[] choices = new String[num+1];
for(int j = 0; j <= num; j++) {
choices[j] = ""+j;
}
String answer = (String)(AllZone.Display.getChoiceOptional(
"Life to pay:", choices));
lifeToPay = Integer.parseInt(answer);
} else {
//not implemented for Compy
}
if(player.payLife(lifeToPay, card)) card.setXLifePaid(lifeToPay);
}
};//ability
Command intoPlay = new Command() {
private static final long serialVersionUID = 5634360316643996274L;
public void execute() {
StringBuilder sb = new StringBuilder();
sb.append("When ").append(card.getName()).append(" comes into play, pay any amount of life.");
ability.setStackDescription(sb.toString());
AllZone.Stack.add(ability);
}
};
card.addComesIntoPlayCommand(intoPlay);
}//*************** END ************ END **************************
return postFactoryKeywords(card);
}//getCard2

View File

@@ -3732,6 +3732,20 @@ public class CardFactoryUtil {
}
}
if(sq[0].contains("xLifePaid")) {
if (c.getController().isHuman()) {
return c.getXLifePaid();
}
else {
//copied for xPaid
//not implemented for Compy
//int dam = ComputerUtil.getAvailableMana().size()- CardUtil.getConvertedManaCost(c);
//if (dam < 0) dam = 0;
//return dam;
return 0;
}
}
CardList someCards = new CardList();
//Complex counting methods