Flashback + keyword (Deep Analysis)
With the new 08-28 version I noticed that the spell Deep Analysis is still hard coded. I thought that I would try to remove some of the code and turn it into a keyword + code type of card.
Deep Analysis looked like this in cards.txt:
Deep Analysis
3 U
Sorcery
no text
and the CardFactory.java code looked like this:
Deep Analysis
3 U
Sorcery
Target player draws two cards.
spDrawCardsTgt:2
and I changed the CardFactory.java code to look like this:
Granted, the code is now just a shell for the flashback code. There is no serialVersionUID but I am not sure if one is required.
I noticed that when the flashback is executed, I am not asked to pick a target player. Just an observation.
Does anything need to be added to the limited code above? Or is this OK?
Deep Analysis looked like this in cards.txt:
Deep Analysis
3 U
Sorcery
no text
and the CardFactory.java code looked like this:
- Code: Select all
//*************** START *********** START **************************
if(cardName.equals("Deep Analysis"))
{
SpellAbility spell = new Spell(card)
{
private static final long serialVersionUID = 6317660847906461825L;
public void resolve()
{
AllZone.GameAction.drawCard(card.getController());
AllZone.GameAction.drawCard(card.getController());
}
public boolean canPlayAI()
{
return AllZone.Computer_Hand.getCards().length <= 6;
}
};
spell.setDescription("Target player draws two cards.");
spell.setStackDescription(card.getName() + " - " + card.getController() + " draws two cards.");
card.clearSpellAbility();
card.addSpellAbility(spell);
card.addSpellAbility(CardFactoryUtil.ability_Flashback(card, "1 U", "3"));
card.setFlashback(true);
}//*************** END ************ END **************************
Deep Analysis
3 U
Sorcery
Target player draws two cards.
spDrawCardsTgt:2
and I changed the CardFactory.java code to look like this:
- Code: Select all
//*************** START *********** START **************************
if(cardName.equals("Deep Analysis"))
{
card.addSpellAbility(CardFactoryUtil.ability_Flashback(card, "1 U", "3"));
card.setFlashback(true);
}//*************** END ************ END **************************
Granted, the code is now just a shell for the flashback code. There is no serialVersionUID but I am not sure if one is required.
I noticed that when the flashback is executed, I am not asked to pick a target player. Just an observation.
Does anything need to be added to the limited code above? Or is this OK?