Megrim
by mtgrares
Moderators: timmermac, friarsol, Blacksmith, KrazyTheFox, Agetian, CCGHQ Admins
Megrim
by jpb » 30 Sep 2008, 19:32
Here is Megrim. Replace the current discard method with this in GameAction.java
- Code: Select all
public void discard(Card c)
{
//check for megrim
discard_megrim(c);
moveToGraveyard(c);
}
public void discard_megrim(Card c)
{
//Whenever an opponent discards a card, Megrim deals 2 damage to that player.
//when a card is discarded, deal 2 damage to that player for each Megrim in play controlled by the opponent.
final String owner = c.getOwner();
final String opponent = AllZone.GameAction.getOpponent(owner);
PlayerZone opponentZone = AllZone.getZone(Constant.Zone.Play,opponent);
CardList opponentList = new CardList(opponentZone.getCards());
//remove 2 life for each Megrim the opponent controls.
for(int i=0;i<opponentList.size();i++){
Card tmpCard = opponentList.get(i);
if(tmpCard.getName().equals("Megrim")){
AllZone.GameAction.getPlayerLife(owner).subtractLife(2);
}
}
}
- Code: Select all
Megrim
2 B
Enchantment
Whenever an opponent discards a card, Megrim deals 2 damage to that player.
- jpb
- Posts: 132
- Joined: 05 Sep 2008, 13:12
- Has thanked: 0 time
- Been thanked: 0 time
Re: Megrim
by DennisBergkamp » 01 Oct 2008, 17:23
-
DennisBergkamp - AI Programmer
- Posts: 2602
- Joined: 09 Sep 2008, 15:46
- Has thanked: 0 time
- Been thanked: 0 time
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 15 guests