Completed the keyword: Poisonous
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Completed the keyword: Poisonous
by Sloth » 16 Sep 2010, 17:35
The keyword Poisonous only existed as Poisonous 1. I generalized it to take any integer.
Changed code in executePlayerCombatDamageEffects:
Changed code in executePlayerCombatDamageEffects:
- Code: Select all
if (c.hasStartOfKeyword("Poisonous"))
{
int KeywordPosition = c.getKeywordPosition("Poisonous");
String parse = c.getKeyword().get(KeywordPosition).toString();
String k[] = parse.split(" ");
final int poison = Integer.parseInt(k[1]);
final Card crd = c;
Ability ability = new Ability(c, "0")
{
public void resolve()
{
final String player = crd.getController();
final String opponent = AllZone.GameAction.getOpponent(player);
if(opponent.equals(Constant.Player.Human))
AllZone.Human_PoisonCounter.addPoisonCounters(poison);
else
AllZone.Computer_PoisonCounter.addPoisonCounters(poison);
}
};
StringBuilder sb = new StringBuilder();
sb.append(c);
sb.append(" - Poisonous: ");
sb.append(AllZone.GameAction.getOpponent(c.getController()));
sb.append(" gets poison counters.");
ability.setStackDescription(sb.toString());
ArrayList<String> keywords = c.getKeyword();
for (int i=0;i<keywords.size();i++)
{
if (keywords.get(i).contains("Poisonous"))
AllZone.Stack.add(ability);
}
}
- Code: Select all
Name:Snake Cult Initiation
ManaCost:3 B
Types:Enchantment Aura
Text:Enchanted creature has poisonous 3.
K:Enchant creature
K:enPump:Poisonous 3
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Completed the keyword: Poisonous
by Rob Cashwalker » 16 Sep 2010, 21:04
Of course, this only appears on two cards... though one of them is a Sliver.
Maro said that they shot down "Poisonous", hence "Infect".
Maro said that they shot down "Poisonous", hence "Infect".
The Force will be with you, Always.
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: Completed the keyword: Poisonous
by Sloth » 17 Sep 2010, 05:36
Really? Well, one new card, is one new card.Rob Cashwalker wrote:Maro said that they shot down "Poisonous", hence "Infect".
PS: I guess I will make a set of AI poison decks to show that we need each of the cards that deal poison counters.
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Completed the keyword: Poisonous
by Rob Cashwalker » 17 Sep 2010, 11:16
True, I guess it works just as well for the older poison creatures... which were all "Poisonous 1" essentially.
The Force will be with you, Always.
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: Bing [Bot] and 9 guests