Computer tapping lands for mana
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
3 posts
• Page 1 of 1
Computer tapping lands for mana
by slapshot5 » 24 Oct 2010, 03:16
I am trying to add Manabarbs, which deals damage when a player taps a land for mana.
I have some code in Ability_Mana.resolve:
Is there a different place where the Compy taps lands for mana?
-slapshot5
I have some code in Ability_Mana.resolve:
- Code: Select all
//Manabarbs code
if(sourceCard.isLand() && this.isTapAbility()) {
CardList barbs = AllZoneUtil.getCardsInPlay("Manabarbs");
for(Card barb:barbs) {
final Card manabarb = barb;
SpellAbility ability = new Ability(manabarb, "") {
@Override
public void resolve() {
sourceCard.getController().addDamage(1, manabarb);
}
};
ability.setStackDescription(manabarb.getName()+" - deal 1 damage to "+sourceCard.getController());
AllZone.Stack.add(ability);
}
}
Is there a different place where the Compy taps lands for mana?
-slapshot5
- slapshot5
- Programmer
- Posts: 1391
- Joined: 03 Jan 2010, 17:47
- Location: Mac OS X
- Has thanked: 25 times
- Been thanked: 68 times
Re: Computer tapping lands for mana
by Chris H. » 24 Oct 2010, 10:29
Try ComputerUtil.payManaCost().
-
Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Re: Computer tapping lands for mana
by slapshot5 » 24 Oct 2010, 12:45
That did the trick. Thanks Chris!Chris H. wrote:Try ComputerUtil.payManaCost().
-slapshot5
- slapshot5
- Programmer
- Posts: 1391
- Joined: 03 Jan 2010, 17:47
- Location: Mac OS X
- Has thanked: 25 times
- Been thanked: 68 times
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 28 guests