Blue Ghost wrote:Newbie here. I'm trying to code
Zedruu the Greathearted, but I can't get its activated ability to work. I'm sure it should be possible, but I don't know of any exact precedent for it. Can someone help?
I made Zedruu and attached it here. It's untested, but it should work.
(I wrote "CARD_QUERY_CHOOSE_PERMANENT_TO_GIVE" for the second target's query text, which is undefined for now, but I couldn't find an already defined string that was fitting enough.)
Blue Ghost wrote:Also, how would one go about implementing how the AI uses the ability?
This may be an unsolvable problem... the AI evaluates the best thing to do by looking ahead a couple of turns and seeing how various combinations of plays affect the game. What you get from Zedruu's upkeep trigger will probably be not enough to convince the AI to give away permanents, unless there's an evident gain (for example, I think that a
Bronze Bombshell might convince the AI to activate Zedruu). The only thing you can do is try and see what happens. If the AI absolutely refuses to use Zedruu, you can at least include some other means to give away permanents that don't need activation (
Puca's Mischief,
Spawnbroker, etc.) so the AI will somehow play your deck properly even without activating Zedruu.