We are establishing an engineering culture here
Is this correct
I've understood you do this thing "Deal {0} damage"
and then spellDamage = 5
- presumably so you can modify it with spell amps
But why's the primary spell damage set to 0 and secondary its real value (I see the same pattern for Wrath and Swipe)
Also have not understood yet why Shapeshift, Excess Mana are c.TOKEN = true
the other one is {1} not {2}
{0} and {1} are indices for string formatting, not numbers.
Shapeshift and excess mana are tokens because they are "uncollectible" cards. You can't add them to your deck. In the same way all the "Choice" cards are token spells/minions too.
Understood all thanks
Another one that does multiple things
The 5 damage could be lethal but player still draws
This resolveTriggerQueue
I saw on small Wrath - is this how I should do it or should I use spell.match.midPhase
again
keeping our most, and only, productive dev up past his slumbering hours smh
Technically you should flag it as midphase because you're supposed to Draw the card before the death takes effect. That's the only effect the midphase flag has, it is specifically to prevent the death phase from occurring until the spell entirely resolves.
But, in all honesty, I only added the midphsae flag like a few days ago as a quick fix to Blizzard freezing nerubian egg spawn, so I didn't bother going back to change all the spells because they do not really ever have a relevant case where it matters.
An example where this could make the difference: You have 1 health and on fatigue, your opponent has 1 health too.
You have a friendly boombot on the board - you starfire the boombot.
In the case where midPhase is not set, the boombot deathrattle will trigger before you draw, causing you to win. But if midPhase WAS set, the deathrattle triggers after you draw, causing a Draw (? Not 100% sure, might count as a loss)
Refer back to the advanced rulebook. Advanced rulebook - New Hearthstone Wiki
Yes exactly - in this case if you would die from fatigue from Starfire and your opponent would also die from the spell damage, the order of operations makes a difference between a won and lost game
If you are to add the midphase, you should set it before resolving the trigger queue and set if off after.
Look at Blizzard:
What does resolving the trigger queue do?
Will it resolve lethal if there is a lethal?
In all honesty midphase should be set before ALL spells and battlecries, but I don't know why that's not set up, maybe I saw something wrong with that at the time and I don't remember it now.
Resolving triggers such as "On Damage Taken", Hero deaths only happen during the WinCheck phase after a sequence ends.
Again, refer to the advanced rulebook and if you want to learn more, read the Match.EventSequencer.cs
file
I also believe that WinCheck should not trigger if the match is in midPhase - but I don't think that clause is in the game code right now.
I read this whole page multiple times and so should you. Advanced rulebook - New Hearthstone Wiki
So in this case the correct order is:
midPhase = true
resolve triggers
draw card
midPhase = false
Because I believe in HS you still draw the card when your opponent takes lethal damage
however if you draw in fatigue, how will WinCheck resolve (opponent takes lethal damage, player takes lethal fatigue)
Does draw card instead need to come after the resolution of midphase in order to set two distinct phases & resolve the 1st lethal
You've linked it like 3 times I'm not gonna read it
This is what he wants me to read - for everyone's reference
Since I know none of you are clicking the link
Yes I suppose that is correct, I forgot that in this case it's different from Blizzard because "Draw" is a sequence event, while "Add Freeze Aura" is an instant-speed event.
Rule 7: If one or more Deaths happened after the outermost Phase ended, a new Phase (called a “Death Phase”) begins, where Deaths are Queued in order of play . For each Death, all Death Event triggers (Deathrattles, on-Death Secrets and on-Death triggered effects) are Queued and resolved in order of play , then the Death is resolved .
This is what we need