HearthSim / hs-bugs

Unofficial Hearthstone issue tracker
https://hearthsim.info
65 stars 3 forks source link

Demon Hunter Prologue: The Xavius encounter does not end if an extra Energy minion dies in the death phase after the thirtieth one #1326

Open Jetz72 opened 4 years ago

Jetz72 commented 4 years ago

Original report here: https://www.reddit.com/r/hearthstone/comments/fu1f2l/turns_out_giving_xavius_armour_breaks_the_game/ Actual cause is a bit more elaborate though.

Example setup: The portal has 29/30 minions dead. Enemy board has one Fel Unstable Energy (Deathrattle: 2 damage AoE) and one Dark Unstable Energy (3/1 Taunt). You Frostbolt the Fel Energy. It dies, bringing the portal to 30/30. Its Deathrattle then kills the Dark Energy. The counter on the portal doesn't seem affected. However, after the end cutscene plays out, the victory screen does not appear. The game continues.

That doesn't happen normally. Usually the portal seems to summon minions and give you cards in a way such that you'll be able to Flamestrike the board and have exactly 30 kills at the end. But if you pass up that opportunity, you can cause this.

Hearthstone Screenshot 04-03-20 18 33 09

You're healed to 30, but have no hero power. Xavius' stats are hidden and the Immune overlay on him during your turn is invisible, but he otherwise continues where he left off. As in the normal game, his death will be considered a victory. His scripted draws come to an end and he begins playing random cards from his deck. I've yet to manage to keep him alive long enough to see the whole thing though. The portal also runs out of scripted sets of energy minions and begins spawning one of each every turn, infinitely. The game effectively becomes a cool survival mode.

So as for why this apparently happens: After an energy dies, the portal triggers, increases its counter. Upon reaching the requisite number of kills, the Portal sets TAG_SCRIPT_DATA_NUM_1 on the GameEntity to 1. That's evidently the flag to end the mission. Any excess kills normally won't be a problem; it's already 1, being set to 1 again. When the GameEntity sees that tag, it triggers, queues some dialog, and bumps it to 2. It then starts another trigger, which meddles with Xavius to make him look nice for the final cutscene, does the hero replacement, and sets that tag to 3. That tag being 3 causes the final trigger which sets the player's PLAYSTATE to "WINNING".

Where that all seems to go wrong then is between the tag being set to 3 and that final trigger. Apparently if you split it into two death phases, the order of triggers come out like this:

The triggers seem to be flagged as one time only so the cutscene doesn't repeat. That or there's a check to make sure you're not Demon Hunter Illidan in the first one.

Replay of a turn where it happened: https://hsreplay.net/replay/PTUj2sX5uhMjkhAarQJ9aa#turn=10a

Log of that: https://gist.github.com/Jetz72/f5c31bb821c7093b681076fb91ef0b74

Another replay of it: https://hsreplay.net/replay/4sPChb6thiWZdCGvX6o6SY#turn=9b

Replay of it not happening when the minions all die in the same death phase: https://hsreplay.net/replay/EyBYRmgLQUzsgGX3uLXvam#turn=9b

Log of that: https://gist.github.com/Jetz72/585bfb37ddcc677f41c9fb7107ad4e86