Masticore

Hi Everyone,
This is my debut onto the Forge seen, so be gentile please. Anyways, I'm trying to implement Masticore and need a little help with the discard part.
I dropped this first bit into cards.txt
Masticore
4
Artifact Creature Masticore
During your upkeep discard a card at random or sacrafice Masticore.
4/4
RegenerateMe:2
abDamageC 2:1
and the following into GameActionUtil.java:
I added 'upkeep_Masticore();' into the UpkeepEffects like so:
public static void executeUpkeepEffects(){ upkeep_Masticore(); }
and the rest down below:
private static void upkeep_Masticore()
{
final String player = AllZone.Phase.getActivePlayer();
PlayerZone playZone = AllZone.getZone(Constant.Zone.Play, player);
CardList list = new CardList(playZone.getCards());
list = list.getName("Masticore");
Ability ability;
for (int i = 0; i < list.size(); i++)
{
ability = new Ability(list.get(i), "0")
{
public void resolve()
{
AllZone.GameAction.discardRandom(player);
}
};// Ability
ability.setStackDescription(player + "discards a card at random");
AllZone.Stack.add(ability);
}// for
}//upkeep_Masticore
Any help with the discarding bit would be great. I tried to simplify his effect by just having him making you discard every upkeep, but even that hasn't worked so far.
This is my debut onto the Forge seen, so be gentile please. Anyways, I'm trying to implement Masticore and need a little help with the discard part.
I dropped this first bit into cards.txt
Masticore
4
Artifact Creature Masticore
During your upkeep discard a card at random or sacrafice Masticore.
4/4
RegenerateMe:2
abDamageC 2:1
and the following into GameActionUtil.java:
I added 'upkeep_Masticore();' into the UpkeepEffects like so:
public static void executeUpkeepEffects(){ upkeep_Masticore(); }
and the rest down below:
private static void upkeep_Masticore()
{
final String player = AllZone.Phase.getActivePlayer();
PlayerZone playZone = AllZone.getZone(Constant.Zone.Play, player);
CardList list = new CardList(playZone.getCards());
list = list.getName("Masticore");
Ability ability;
for (int i = 0; i < list.size(); i++)
{
ability = new Ability(list.get(i), "0")
{
public void resolve()
{
AllZone.GameAction.discardRandom(player);
}
};// Ability
ability.setStackDescription(player + "discards a card at random");
AllZone.Stack.add(ability);
}// for
}//upkeep_Masticore
Any help with the discarding bit would be great. I tried to simplify his effect by just having him making you discard every upkeep, but even that hasn't worked so far.