Re: Formal Request Thread
I've accounted for the first scenario, already. If it doesn't work as is, I might have to redo it slightly, but it checks when a colorless token leaves the battlefield, and if at any point there are fewer tokens than the current number of creatures that you can grant haste, it drops that number to the number of colorless tokens. If you cast a sol ring, you end up with one colorless mana, at which point the code lowers the number of creatures remaining to 1 even though it hasn't granted haste to anything yet.RiiakShiNal wrote:There are more problems with your method as for example if you use Generator Servant and then cast a Sol Ring which you then tapped so you could cast 3 copies of Arcbound Worker. Your method would give 2 of those Arcbound Workers haste even though only 1 should get it. The case here is that you aren't considering that the mana was used for something that isn't a creature.
Another problem you be if you manually produced amana and then used Generator Servant and cast in this order Soul Warden and 2 copies of Arcbound Worker the Soul Warden and 1 Arcbound Worker would get haste instead of the correct case where both Arcbound Workers would get haste. The problem here is that you aren't considering the case where the player casts a creature that doesn't colourless mana.
Another case would be if you used some of the colourless mana for an ability to say generate coloured mana to use to cast a spell (such as passing it into a Dimir Signet to then cast a Tidehollow Strix). You can have any amount of mana in the pool at any given time (up to 100 of each type as that is a hardcoded limit on tokens placed by the engine) as such any specific mana can be used for anything. For example if you are hoarding mana with Upwelling you aren't even guaranteed to use that mana in that turn it could be much later that you actually end up using it.
So in short yes, my method is more reliable and will behave better in most cases at the moment. Yes, it has issues with fringe cases where a user would want to save the mana and/or split it up to cast multiple creatures, but it behaves better in other cases where some of that mana would get used for some other reason such as increasing the amount of mana available, not using it for creatures without colourless mana, converting it to coloured mana, etc....
I accounted for the second scenario, already, too. When a player considers a card for casting, I count the colorless mana, then when they cast a card, if it's the one that was just considered, it counts the colorless mana again to see if any colorless mana was used, and if so, it decrements the creatures remaining and waits for it to resolve. If it resolves, it gives the resulting creature haste.
The third one does need accounted for. I even thought about that specifically but didn't consider that it wouldn't work if the player tapped it for mana while they still had the previous mana. That's an easy fix, though. Just changing the set_int to int_inc should correct that (well, not the set_int that reset everything, but the set_int that gets it ready).
mana and then used