AI reveals morph creatures
Posted: 06 Aug 2021, 01:03
Context: https://www.slightlymagic.net/forum/viewtopic.php?f=25&t=30534#p249354
The other issue is the right click>original type> option, which reveals the original card. I was going to try doing a do-si-do with the card and a face-down card, then socking the original card's id in targets[13], so that the original_internal_card_id is a face down card and the id to morph into is the real card's id. The code for a face-down creature (including the special ones for Illusionary Mask and Ixidron and manifest and who knows what else) would than have an option for the controller to view the original card and flip it if legal. No idea if that would work well or at all, but that's the concept I was thinking of. If it doesn't work, just changing the dialog will still be a significant upgrade. Nope. If anything ever changes its type it will revert to a face-down creature permanently. Maybe there's another solution.
While I'm at it I'll change EVENT_TURNED_FACE_UP to dispatch normally. Then, modify the ten or so cards that interact with other cards turning face up, and the others that respond to their own event to check affect_me().
I was going to go with a DIALOG() call as you suggest, probably with options slightly weighed in favor of playing face-down - not sure what other factors to consider. Manifest & Illusionary Mask don't display a dialog and the other two aren't yet coded. Ugh... I hope there's nothing with morph that doesn't call the main functions.The AI's choice for a plain do_dialog() is deterministic - whatever you pass in as the last argument, the AI picks that. All you have to do is not call do_dialog() if the AI's going to pick "Play face-down". Or even not call do_dialog() at all if it's for the AI. Just make sure you only do that if it's actually the AI picking, not just player 1, or you'll break multiplayer even worse. (Of course, that also means if multiplayer ever becomes even sort of playable again, you'd need a different solution, like promoting to a DIALOG() call and passing DIALOG_FULLCARD_CSVID(CARD_ID_FACE_DOWN_CREATURE) when player == 1.)
The only real issue in the short term is making sure every card with morph or megamorph actually calls casting_permanent_with_morph(), and nothing handles it on its own.
Is this also an issue for manifest? How about the other cards that let you move objects from hidden zones to the bf face-down? (I think that's just Illusionary Mask, Tezzeret, Cruel Machinist, and Yedora, Grave Gardener?)
While I'm at it I'll change EVENT_TURNED_FACE_UP to dispatch normally. Then, modify the ten or so cards that interact with other cards turning face up, and the others that respond to their own event to check affect_me().