help with Phyrexian War Beast

Hi all,
I'm currently working on Phyrexian War Beast (among other things...)
Two parts here - when Phyrexian War Beast leaves play
1) It does one damage to controller
2) controller must sacrifice a land
First pass code implements the one damage:
CardFactory_Creatures.java:
CardFactory_Creatures.java:
Probably:
1) Immediately put both things on the stack
2) have the one damage resolve
3) ask for input for a land to sacrifice
4) have that resolve
Thoughts? Tweaks?
Thanks,
slapshot5
I'm currently working on Phyrexian War Beast (among other things...)
Two parts here - when Phyrexian War Beast leaves play
1) It does one damage to controller
2) controller must sacrifice a land
First pass code implements the one damage:
CardFactory_Creatures.java:
- Code: Select all
//*************** START *********** START **************************
else if(cardName.equals("Phyrexian War Beast")) {
/* When Phyrexian War Beast leaves the battlefield, sacrifice a land
* and Phyrexian War Beast deals 1 damage to you.
*/
final SpellAbility ability = new Spell(card) {
private static final long serialVersionUID = -3829801813561677938L;
public void resolve() {
AllZone.GameAction.addDamage(card.getController(), 1, card);
}
};
final Command oneDamage = new Command() {
private static final long serialVersionUID = -8829001394137848084L;
public void execute() {
String player = card.getController();
ability.setStackDescription(card.getName() + " - does 1 damage to "+player +"and sacrifice one land.");
AllZone.Stack.add(ability);
}//execute
};
card.addLeavesPlayCommand(oneDamage);
}//*************** END ************ END **************************
CardFactory_Creatures.java:
- Code: Select all
//*************** START *********** START **************************
else if(cardName.equals("Phyrexian War Beast")) {
/* When Phyrexian War Beast leaves the battlefield, sacrifice a land
* and Phyrexian War Beast deals 1 damage to you.
*/
final SpellAbility ability = new Spell(card) {
private static final long serialVersionUID = -3829801813561677938L;
public void resolve() {
AllZone.GameAction.addDamage(card.getController(), 1, card);
}
};
final Ability ability2 = new Ability(card, "0") {
public void resolve() {
Card c = getTargetCard();
AllZone.GameAction.sacrifice(c);
}
};
final Command sacrificeLand = new Command() {
private static final long serialVersionUID = -1793348608291550952L;
public void execute() {
AllZone.InputControl.setInput(CardFactoryUtil.input_targetType(ability2, "Land"));
ButtonUtil.disableAll();
ability.setStackDescription(card.getName() + " - sacrifice a land");
//AllZone.Stack.add(ability2);
}
};
final Command oneDamage = new Command() {
private static final long serialVersionUID = -8829001394137848084L;
public void execute() {
String player = card.getController();
ability.setStackDescription(card.getName() + " - does 1 damage to "+player +"and sacrifice one land.");
AllZone.Stack.add(ability);
}//execute
};
card.addLeavesPlayCommand(oneDamage);
card.addLeavesPlayCommand(sacrificeLand);
}//*************** END ************ END **************************
Probably:
1) Immediately put both things on the stack
2) have the one damage resolve
3) ask for input for a land to sacrifice
4) have that resolve
Thoughts? Tweaks?
Thanks,
slapshot5