Hi all,
finally got to start programming cards after wasting infinite time on installation and setup issues. Much thanks to Dennis, sillyfreak, and Chris for their help.
so how bout that masticore...
cards.txt is pretty strait forward thanks to the implementation of the card interpreter the team has build, with regeneration, and creature_a to creature_b direct damage built in.
Masticore4
Artifact Creature
Choose and discard a card during your upkeep, or sacrifice
Masticore.
4/4
RegenerateMe:2
abDamageTgtC2:1
so the upkeep code is a little tricky, and needs one last hack i'd say before it works properly.
GameActionUtil.java
- Code: Select all
private static void upkeep_Masticore()
{
final String player = AllZone.Phase.getActivePlayer();
PlayerZone playZone = AllZone.getZone(Constant.Zone.Play, player);
CardList list = new CardList(playZone.getCards());
list = list.getName("Masticore");
Ability ability;
for (int i = 0; i < list.size(); i++)
{
final Card m = list.get(0);
ability = new Ability(list.get(i), "0")
{
public void resolve()
{ !!!need hack here!!!
AllZone.GameAction.discard(getTargetCard());
}
};// Ability
Input runtime = new Input()
{
private static final long serialVersionUID = -4302110760957471033L;
public void showMessage()
{
stopSetNext(CardFactoryUtil.input_discard());
}
};
ability.setStackDescription(player + "discards a card");
AllZone.Stack.add(ability);
}// for
}//upkeep_Masticore
basically my question is: how do i retrieve the card that was set in the Input method later in the resolve method when it's time to get that card discarded, and also check if it's null in which case masticore needs to die?