Cantrip keyword and milling
First post in the new forum!
I thought I had once posted some code that might allow cantrips to be handled as a keyword. (Cantrips are spells or permanents, which also draw a card on resolution, such as Accelrate or Carven Caryatid)
I figured out where in the code any given SpellAbility's Resolve method is called.
I thought I had once posted some code that might allow cantrips to be handled as a keyword. (Cantrips are spells or permanents, which also draw a card on resolution, such as Accelrate or Carven Caryatid)
I figured out where in the code any given SpellAbility's Resolve method is called.
- Code: Select all
C:\MTGForge0517\source\ComputerUtil.java (1 hits)
Line 61: sa.resolve();
C:\MTGForge0517\source\Input_StackNotEmpty.java (1 hits)
Line 31: sa.resolve();
- Code: Select all
If (sa.getSourceCard().getKeywords().Contains("Cantrip"))
GameAction.drawCard(sa.getSourceCard().getController());
- Code: Select all
if(card.getKeyword().contains("When this card comes into play, draw a card."))
{
card.setComesIntoPlay(new Command()
{
private static final long serialVersionUID = 203335252453049234L;
public void execute()
{
GameAction.drawCard(card.getController());
}
});
}//if "Comes into play tapped."
- Code: Select all
if(library.size() != 0)
{
Card c = library.get(0);
library.remove(0);
hand.add(c);
GameActionUtil.executeDrawCardTriggeredEffects(player);
}
else
{
PlayerLife life = AllZone.GameAction.getPlayerLife(player);
life.setLife(0);
}