Is it possible to re-route events flow in Forge?

I would like to talk about the way abilities are handled.
The what I see in Upkeep.java now is a bit confusing:
I wish there were a different organization of events handling:
There should be an event bus, where all the interested executors (small classes encapsulating some mechanics or hardcoded rules for a single card) can subscribe to some events. Executors subscribe when a matching permanent appears in game, and unsubscribe when it gets exiled or dies (or maybe otherwise subscribes if that is an ability like Flashback or Bloodghast's one). But anyway presence of only actual cards would eliminate searches like this: AllZoneUtil.getCardsIn(Zone.Battlefield, "Aluren").
Changes in game state lead to events generation, be that some card etb or die or beginning of new phase or turn. So, the executors recieve a notice, check whether any extra conditions are met (according to their card rules) and change game state appropriatelly, that might include generation of some new events. Some events might also be cancelled ("whenever hydra would receive damage prevent it, remove a counter from it instead")
So, is there a chance to do something like that in Forge?
The what I see in Upkeep.java now is a bit confusing:
- Code: Select all
/**
* <p>executeAt.</p>
*/
public void executeAt() {
AllZone.getStack().freezeStack();
upkeep_Braid_Of_Fire();
upkeep_Slowtrips(); // for "Draw a card at the beginning of the next turn's upkeep."
upkeep_UpkeepCost(); //sacrifice unless upkeep cost is paid
upkeep_Echo();
upkeep_The_Abyss();
upkeep_Yawgmoth_Demon();
upkeep_Lord_of_the_Pit();
upkeep_Drop_of_Honey();
upkeep_Demonic_Hordes();
upkeep_Carnophage();
upkeep_Sangrophage();
upkeep_Dega_Sanctuary();
upkeep_Ceta_Sanctuary();
upkeep_Tangle_Wire();
upkeep_Shapeshifter();
upkeep_Vesuvan_Doppelganger_Keyword();
//Kinship cards
upkeep_Ink_Dissolver();
upkeep_Kithkin_Zephyrnaut();
upkeep_Leaf_Crowned_Elder();
upkeep_Mudbutton_Clanger();
upkeep_Nightshade_Schemers();
upkeep_Pyroclast_Consul();
upkeep_Sensation_Gorger();
upkeep_Squeaking_Pie_Grubfellows();
upkeep_Wandering_Graybeard();
upkeep_Waterspout_Weavers();
upkeep_Winnower_Patrol();
upkeep_Wolf_Skull_Shaman();
// upkeep_Dragon_Broodmother(); //put this before bitterblossom and mycoloth, so that they will resolve FIRST
//Win / Lose
// Checks for can't win or can't lose happen in Player.altWinConditionMet()
upkeep_Mortal_Combat();
upkeep_Near_Death_Experience();
upkeep_Test_of_Endurance();
upkeep_Helix_Pinnacle();
upkeep_Barren_Glory();
upkeep_Felidar_Sovereign();
upkeep_Karma();
upkeep_Oath_of_Druids();
upkeep_Oath_of_Ghouls();
upkeep_Suspend();
upkeep_Vanishing();
upkeep_Fading();
upkeep_Masticore();
upkeep_Eldrazi_Monument();
upkeep_Blaze_Counters();
//upkeep_Dark_Confidant(); // keep this one semi-last
upkeep_Power_Surge();
upkeep_AI_Aluren();
// experimental, AI abuse aluren
AllZone.getStack().unfreezeStack();
}
I wish there were a different organization of events handling:
There should be an event bus, where all the interested executors (small classes encapsulating some mechanics or hardcoded rules for a single card) can subscribe to some events. Executors subscribe when a matching permanent appears in game, and unsubscribe when it gets exiled or dies (or maybe otherwise subscribes if that is an ability like Flashback or Bloodghast's one). But anyway presence of only actual cards would eliminate searches like this: AllZoneUtil.getCardsIn(Zone.Battlefield, "Aluren").
Changes in game state lead to events generation, be that some card etb or die or beginning of new phase or turn. So, the executors recieve a notice, check whether any extra conditions are met (according to their card rules) and change game state appropriatelly, that might include generation of some new events. Some events might also be cancelled ("whenever hydra would receive damage prevent it, remove a counter from it instead")
So, is there a chance to do something like that in Forge?