Page 1 of 1

Structure of a turn

Posted: January 3rd, 2013, 7:20 pm
by Poofah
Each turn of a pet battle has a structure, but the order that the various events happen in is not well documented. I'm trying to figure out when the game assigns each type of damage or effect, and in particular which effects benefit from going first (or second).

1. Initiative -- the game determines which pet gets to go first. This happens instantaneously from our perspective, as one pet gets the little speed icon immediately as the turn starts.
2. Pets choose actions. If a pet chooses Reflection as an action, the Reflection buff will be applied before phase 3, regardless of speed. If either pet chooses 'swap pet' as an action, then the rest of the turn is skipped, and the new pet becomes the active pet at the beginning of the new turn (and doesn't get an action on that turn).
3. Pet 1 performs its action. If this results in Pet 2's defeat*, then you skip # 4.
4. Pet 2 performs its action.
5. DoTs deal their damage. Pet 1's DoTs (ie the DoTs that are on Pet 1) will deal damage first, but regardless whether Pet 1 dies in this phase, Pet 2's DoTs will still deal damage. This also includes delayed damage effects such as Elementium Bolt or Whirlpool, and aura/environmental effects such as Immolation or Scorched Earth.
6. Reflection phase. If a pet used Reflection, then the most recently prevented ability will be performed after all DoTs and delayed effects.
7. Humanoid passive ability phase. As far as I can tell, this always happens at the very end of the turn--if a humanoid pet dealt any damage in phases 3-6, it will receive one heal for 7% of its max health in this phase.

When a pet dies, the round continues through to the end. This includes reducing the duration of any field effects (Flamethrower), and any delayed damage abilities that would have triggered that round will trigger (e.g. Elementium Bolt). There's no pet to deal damage to, but they trigger nonetheless. On the next round, the new pet will swap in. When the new pet swaps in due to prior pet death, this actually gets its own round, with no other phases, and then the battle will skip to the next round. If the new pet swapped in due to a pet swap action, then the new pet doesn't get an action, but the other phases occur.

I chose to separate phases this way according to when a winner can be determined. Ie, I chose each pet's action phase to be separate because a winner can be determined after the first pet's action. In contrast, I lumped DoT damage from both pets into one phase, since even if pet 2 dies from DoT damage (and is the last pet on its team), this will not cause pet 1's team to immediately win. Instead, pet 1 still takes DoT damage in this phase, and if it dies and is the last pet on its team, the match is a draw.

* I changed this to 'defeat', because in the case of Mechanicals or Undead, the pet immediately gets back up after dying, and the turn continues as if the pet didn't die.

Re: Structure of a turn

Posted: January 3rd, 2013, 7:56 pm
by Shakesbeard
interested.

there are more details, but a final list would be very interesting to me.

#2b, would be pet switch

Hots like tranq i guess would be "aura/environmental" on your list, but i think they are before environmental like whirlpool? not 100% sure... but your #5 should be at least #5(dots/environmental damage) and #6(hots), if not 5(dots) 6(hots) 7(environmental). the list could be further broken down to exact order of environmental damage hits.

aren't dots on back row pets (switched out after dotted) at the end of a turn? i'm guessing a humanoid back-row pet would get dot before racial heal?

back row undead with siphon life on a target, when is that heal?


there are a lot more things to consider, but i like this thread

Re: Structure of a turn

Posted: January 3rd, 2013, 8:42 pm
by Poofah
Yes, good questions. I'll try to pay attention to these when I do dailies tonight. It's possible that backrow pets get their own phase for DoTs, I have to check.

As far as pet swapping, if you choose to swap pets then it seems to just be treated as your action for the turn. So in phase 3 or 4, the pet would swap out for the new pet instead of performing an action, and then everything else would proceed as normal. *edit* I was wrong about this--I edited the OP accordingly.

The exception to this seems to be when a pet swaps in due to the prior pet's death. In this case it seems that any delayed damage effects are cleared. So for example if you have an Elementium Bolt hanging over your head, and you swap pets, the Bolt debuff will not go away. But if your pet dies before the Bolt lands, then the Bolt debuff will be cleared when your new pet swaps in. I don't have a full list of debuffs that behave this way quite yet. *edit* this is happening because when a pet dies, the turn continues, which includes reducing the duration on buffs/debuffs, and also triggering delayed damage effects. If a pet dies with Elementium Bolt having 2 rounds left, then the Bolt duration will reduce to 1 round left, then the new pet will swap in, and will eat the Bolt at the end of that turn. If a pet dies with Elementium Bolt having 1 round left, then the Bolt will trigger, do no damage (because there's no pet to deal damage to), and the debuff will fade.

Re: Structure of a turn

Posted: January 3rd, 2013, 10:07 pm
by Mathew013
Another minor note about Initiative (woo, old school D&D) - when the 2 pets have identical the same speed, it seems there's an unseen coin flip of which goes first (or a pattern I can't discern).

Re: Structure of a turn

Posted: January 4th, 2013, 5:45 am
by Gromagrim
Mechanical/Undead Resurrection seems to pause the usual round sequence, rather than get a phase of it's own. Multiple attacks such as Flurry, Tail Lash (going second) can 'bridge the gap' between death and resurrection - they make the initial kill, then continue to hit the resurrected pet afterwards.

Re: Structure of a turn

Posted: January 4th, 2013, 11:00 am
by Mathew013
Just had a thought:
3. Pet 1 performs its action. If this results in Pet 2's death, then you skip # 4.
4. Pet 2 performs its action.
There are times where a pet SHOULD have initiative, but because the enemy pet uses a "quick attack" (a la pokemon)
like Surge, pet 2 strikes first.

In these cases, does the DoT damage change when it's applied at all?

Re: Structure of a turn

Posted: January 4th, 2013, 12:12 pm
by Poofah
Gromagrim wrote:Mechanical/Undead Resurrection seems to pause the usual round sequence, rather than get a phase of it's own. Multiple attacks such as Flurry, Tail Lash (going second) can 'bridge the gap' between death and resurrection - they make the initial kill, then continue to hit the resurrected pet afterwards.
Yes, this is sort of a special case. When a Mech or UD dies, it immediately rezzes and the turn continues as normal--it's as if the pet didn't actually die, for the purposes of the turn sequence or swapping in a new pet. I'll edit the OP to reflect this.
Mathew013 wrote:Just had a thought:
3. Pet 1 performs its action. If this results in Pet 2's death, then you skip # 4.
4. Pet 2 performs its action.
There are times where a pet SHOULD have initiative, but because the enemy pet uses a "quick attack" (a la pokemon)
like Surge, pet 2 strikes first.

In these cases, does the DoT damage change when it's applied at all?
This is an interesting point, I'll have to check. When a pet uses Surge, what actually happens is the game gives the pet an absurdly large speed bonus (Aki's otter goes up over 2000, for example), which causes them to go first. So if both pets choose Surge, the faster one will still get to Surge first. I didn't notice when that speed bonus expires though. So I don't know if the extra speed will carry over into the rest of the turn, which presumably would let it have initiative throughout the round.

Re: Structure of a turn

Posted: January 4th, 2013, 4:48 pm
by Jordicus
Poofah wrote:3. Pet 1 performs its action. If this results in Pet 2's defeat*, then you skip # 4.
4. Pet 2 performs its action
This is not 100% accurate. There currently appears to be a bug which allows certain multi-hit attacks such as Flurry to hit even after Pet 2 dies. I see this happen almost everytime on Grand Master Yon in Kun-Lai Summit and his rabbit.

Re: Structure of a turn

Posted: January 4th, 2013, 4:58 pm
by Poofah
Can you clarify? Do you mean that Yon's rabbit is Pet #2 in this situation, and that he has died during Pet#1's action phase, but he still gets to Flurry? I've never seen anything like this.

Or do you mean that Yon's rabbit is Pet#1, he kills your pet with the first hit of Flurry, and then continues to flip around and appears to deal the remaining Flurry hits? I've seen this, and I don't think it's a bug, it's just that the Flurry animation is fixed and always does those flips even if there's nothing to hit.

Or, maybe the rabbit has Brittle Webbing or similar debuff on it? In this case, the Rabbit can die in between Flurry hits, and the graphics become a little odd (e.g. he goes into the dead rabbit graphic but continues to move around). I can't remember if he gets to finish dealing Flurry hits in this case though.

Re: Structure of a turn

Posted: January 4th, 2013, 5:26 pm
by Jordicus
Poofah wrote:Can you clarify? Do you mean that Yon's rabbit is Pet #2 in this situation, and that he has died during Pet#1's action phase, but he still gets to Flurry? I've never seen anything like this.

Or do you mean that Yon's rabbit is Pet#1, he kills your pet with the first hit of Flurry, and then continues to flip around and appears to deal the remaining Flurry hits? I've seen this, and I don't think it's a bug, it's just that the Flurry animation is fixed and always does those flips even if there's nothing to hit.

Or, maybe the rabbit has Brittle Webbing or similar debuff on it? In this case, the Rabbit can die in between Flurry hits, and the graphics become a little odd (e.g. he goes into the dead rabbit graphic but continues to move around). I can't remember if he gets to finish dealing Flurry hits in this case though.
the rabbit is pet2. and yes, I do usually see it when Brittle Webbing is applied. The rabbit dies in the middle of Flurry and while dead, slides along the ground and continues his third attack. That's not the only time I've seen it happen, but that's the most memorable one....