Thankfully I was able to implement GA with minimal fuss. GameAction already had a method called checkStateEffects() which sent creatures to the graveyard if they had enough damage and checked for legendary permanents, so I just added GA to the code. GA is actually implemented in GameActionUtil which also does upkeep effects like Juzam Djinn. There are only 17 cards that do state effects, cards like Soul Warden and Nightmare. I recently programmed Serra Avatar (power and toughness are each equal to your life total) which was a relatively simple.
And finally, design a flexible system but put off what you don’t know how to do. I didn’t know how to program GA but I didn’t sweat it. There were a hundred other things that I wanted to program first, like Shock and creature combat, and I couldn’t let myself be bogged down in details.
I thought about showing you the code for GA, but Serra Avatar is much easier to understand (and it won’t make your eyes glaze over). AllZone is a global variable that keeps track of all player zones and life totals.
//taken from GameActionUtil
//get all creatures
CardList list = new CardList();
list = list.getName("Serra Avatar");
for(int i = 0; i < list.size(); i++)
Card card = list.get(i);
int n = AllZone.GameAction.getPlayerLife(card.getController()).getLife();