[Dev] Hosting active vs. inactive cards
Just leaving a note here... I think the hosting system will need to be upgraded to indicate active vs. inactive hosting, e.g., the difference between a card hosted on Dinosaurus vs. one on Personal Workshop is that the Dinosaurus card can be used but the PW one cannot. Inactive cards should have abilities disabled and should not receive events.
Right now, hosting a card by calling (host) manually breaks the event handling system, because the card registering the events is now in a different zone (hosted). I thought about adding event registration to (host), but that should NOT happen for inactively-hosted cards like those on PW. I discovered this while working on Bishop. Parasite can receive events while hosted because it is hosted automatically on installation, so (runner-install) sees the updated zone of the card before registering its events. But Bishop is installed to the rig and then hosted via a click ability, which seems to break the event registration. I think I can hack around it (manually register events in Bishop's card-def), but a more thorough hosting system would probably be the better call.
The way cards are stored at the moment leads to complicated code indeed. I'm thinking about rewriting the state structure to have 1 hash containing all the cards. Any card could easily be accessed by its cid and moving a card is a matter of changing its zone field. It would simplify a lot of things but basically requires a complete rewrite.
In the meanwhile, you have to update the card stored in the :events hash.
I believe this is why Patch is not working: as an Operation, it does not register any events on play, and even if it did, it would not receive them once hosted. I hacked around this for Bishop (not submitted) but a system-level fix would be a better long term solution.