radar / mtg

Magic: The Gathering, but in Ruby
63 stars 11 forks source link

after ActivateAbility on a Land, check if it's tapped too #500

Closed DanceMore closed 9 months ago

DanceMore commented 9 months ago

amazing, exceedingly cool gem; especially how much of the actual rules and game logic you've implemented.

I have a silly idea that "borrows" a number of ideas from "Magic: The Gathering" so I went hunting for an engine to experiment inside and this one by far seems the most complete on Github, as well as being well-organized. (I'm also a Ruby lover, so that helps.)

in order to implement my silly idea, I've started by experimenting in a fairly unstructured way to see what parts of the engine are fully wired up. finding turns_spec was really useful because I was trying to Actions::Tap a land instead of ActivateAbility it. (turns_spec also teaches one how to use the Ruby state-machine; I basically guessed the method names before finding the example code ...)

however, despite having a defined Costs and also code indicating the ability to pay() a Costs::Tap, the minimal test-case of expect(island).to be_tapped actually fails 😿 (we do correctly get Mana added to our mana_pool tho!)

this might actually be a known issue, I wanted to check in and make sure I'm not doing something obviously incorrect before I dig deeper and attempt to fix/implement it. I also have an interest in Counters related features and some initial experiments have failed to apply counters to a card as it enters-the-battlefield... again, I might be doing something wrong or Counters might not be finished.

radar commented 9 months ago

Thanks for visiting!

I think there was a pay_tap call missing from the turns spec, and I've added that in bd18ffc and fixed another bug further down the spec where it was rotating through the players twice, rather than once.

As for ETB effects and counters, I believe it should be possible. I've implemented a small demo in this commit: 359e5fe.

Which card was it that you were trying to implement?

DanceMore commented 9 months ago

cool, I'll go digging into those specific commits later :)


it's less about specific spells and more about my "silly idea", which is really organizing my ADHD brain in the form of pre-existing "Magic: The Gathering" keywords and ideas. I do have an idea that heavily draws from Isochron Scepter and the Imprint keyword tho.

in an extremely abstract sense, programming and magic are both "words creating more words"... and there's something about TODO Lists and information organization that's also "words creating more words", hence why I think an Artifact that can Imprint a Spell for re-use is a powerful metaphor in my silly idea.....