AdvanceTurnEntity¶
This is a method only called by AdvanceMainTurn that takes in an actor whose turn will be advanced and a ref to a bool value that will be set to true if there should be a delay after the turn advancement.
private void AdvanceTurnEntity(ref MainManager.BattleData t, ref bool delay)
Parameters¶
t: The actor to advance the turndelay: a dummy ref bool value. It should always have a false value before calling this method as the method only sets it to true in some cases, but never to false
Procedure¶
There are 2 parts to this: Conditions advances and state advance.
Conditions advances¶
This part goes through each condition and acts on them. This part refers to what happens to each individual condition unless stated otherwise.
There's 2 sections to this: alive advance and last advance.
Alive advance¶
This section occur if the actor is alive and it depends on the BattleCondtion.
Reflection¶
The turn count of the condition is set to 0.
Poison¶
If there is at least one enemy party member:
- If the actor is a player party member with a
ReversePoisonmedal equipped:- The actor's
hpis increased by the actor'smaxhp* 0.1 rounded to nearest clamped from 1 to 3. NOTE: the nearest rounding has a quirk where if it ends in .5, the even number will be chosen over the odd one no matter if it is actually the lower or higher bound that is correct mathematically - If the
Healsound isn't playing or its more than halfway done player, it is played - ShowDamageCounter is called with type 1 with the damage amount as the amount healed earlier with the start being the battleentity position + (0.0, 1.0, 0.0) and the end being (0.0, 2.0, 0.0)
- The actor's
- Otherwise, DoDamage is called to the actor with no attacker with a
NoExceptionsproperty without block. The damageammount is the actor'smaxhp/ 10.0 ceiled - 1 and then clamped from 1 to 3 for a player party member and from 1 to 2 for an enemy party member. The call also has these overrides:NoFallNoIceBreakFakeAnimDontAwakeIgnoreNumb
- If the actor's
hpbecame 0, battleentity.overrideanimis set to false followed by an OverrideOver call being invoked on the battleentity in 1.0 seconds - The actor's
hpis clamped from 1 to itsmaxhp - delay is set to true
Fire¶
If there is at least one enemy party member:
- The
Flamesound is played - DoDamage is called to the actor with no attacker with a
NoExceptionsproperty without block. The damageammount is the player party member'smaxhp/ 7.5 ceiled - 1 and then clamped from 2 to 3. The call also has these overrides:NoFallNoIceBreakFakeAnimDontAwakeIgnoreNumb
- If the actor's
hpbecame 0, battleentity.overrideanimis set to false followed by an OverrideOver call being invoked on the battleentity in 1.0 seconds - The actor's
hpis clamped from 1 to itsmaxhp - delay is set to true
Eaten¶
It is assumed the actor is a player party member here:
- delay is set to true
- If
eatenbyexists backed by an enemy party member, the player party member'shpis above 0 and there is at least one enemy party member:- DoDamage is called to the player party member with no attacker with a
NoExceptionsproperty, aNoCounteroverrides without block. The damageammount is the player party member'smaxhp/ 10.0 + 1 ceiled and then clamped from 1 to 99 - ShowDamageCounter is called with type 0 (damage) with the damage amount as the amount with the start being the
eatenbyenemy party member'scursoroffsetand the end being (0.0, 2.0, 0.0) - Heal is called on the
eatenbyenemy party member for the same damage amount dealt to the player party member
- DoDamage is called to the player party member with no attacker with a
- If the player party member's
hpis 0 or below while there are at least 1 player party member with anhpabove 0 while not having aneatenby:eatenkillis set to true (used for AdvanceMainTurn to handle this later)- EventDialogue 19 is started and stored in
checkingdead
Freeze¶
- The
Freezesound is played on the battleentity at 1.5 pitch - battleentity.
shakeiceis set to true - delay is set to true
Numb¶
- delay is set to true
- The
ElecFastparticles are played at the battleentity position + Vector3.up - A ShakeSprite coroutine is started on the battleentity with the intensity being (0.1, 0.15, 0.0) for 40.0 frames
- The
Shocksound is played on the battleentity at 1.25 pitch
GradualHP¶
Nothing happens if the actor's hp is at least its maxhp, but if it doesn't:
- ShowDamageCounter is called with type 1 (HP) with the amount being 2 earlier with a start of the actor position + its
cursoroffsetand an end of Vector3.up - The actor's
hpis incremented by 2 clamped from 0 to the actor'smaxhp - The
Healsound is played - delay is set to true
Sleep¶
Nothing happens if the actor's hp is at least its maxhp, but if it doesn't, it depends on if they are an enemy party member while the BadDream medal is equipped. If this is the case, it's processed the same as a Fire condition.
Otherwise, it's the same as a GradualHP, but the amount to heal and show is determined with a more complex logic. The amount is determined with a starting value of the actor's maxhp * 0.1 ceiled. If the HeavySleeper medal is equipped on the actor (no checks if it's necesarily a player party member), the amount is tripled. On top of this, if it's not a player party member (checked by the battleentity tag not being Player), the amount is clamped from 0 to 4
GradualTP¶
If instance.tp is less than instance.maxtp:
- The
Heal2sound is played - ShowDamageCounter is called with type 2 (TP) for 2 as the ammount with a start of battleentity position + the actor's
cursoroffsetand an end of Vector3.up - instance.
tpis increased by 2 clamped from 0 to instance.maxtp - delay is set to true
From there, the condition turn counter is decremented with some exceptional cases when this doesn't happen:
- The condition is Eaten
- The condition is Poison while the
EternalPoisonmedal is equipped - The condition is Flipped while the turn count on the first
Flippedcondition (this is assumed to be the same one) is 1 or lower
Last advance¶
The first thing that happens is frozenlastturn is set to whether or not the actor still has the Freeze condition even after the alive update above.
This section only does something if the condition's turn counter just reached 0 and what happens depends on the condition:
- Numb:
isnumbis set to false followed bycantmoveis set to 1 (resets to one actor turn before an action is available, but it will be exhausted later on this actor turn advance) - Sleep:
isasleepis set to false followed bycantmoveis set to 1 (resets to one actor turn before an action is available, but it will be exhausted later on this actor turn advance) - Freeze / EventStop: If the battleentity.
icecubeexists, BreakIce is called on the battleentity. Also,cantmoveis set to 1 (resets to one actor turn before an action is available, but it will be exhausted later on this actor turn advance) - Shield: battleentity.
shieldenabledis set to false - AttackUp: If the actor's
atkdownloseatkupis true, an AttackDown condition is slated to be added later followed byatkdownonloseatkupbeing set to false
State advance¶
- All the conditions whose turn count reached 0 are removed
- If an AttackUp condition's turn count reached 0 while
atkdownonloseatkupwas true earlier:- SetCondition is called with AttackDown for 2 actor turns on the actor
- The
StatDownsound is played - StatEffect is called on the battleentity with type 2 (red arrow down)
- The actor's
isasleepis set to whether or not the actor has the Sleep condition - The actor's
isnumbis set to whether or not the actor has the Numb condition - If firststrike is false (the enemy party isn't performing a first strike), the actor's
turnsaliveorturnssincedeathis incremented (the one chosen depends on thehpbeing above 0) - If the actor has the Freeze or EventStop condition or their
isnumborisasleepis true, theircantmoveis set to 0 (one action available) if they are a player party member (checked by having thePlayertag), 1 (one turn before an action is available) if it's an enemy party member - Otherwise, if the actor's
hpis above 0 and it's not a firststrike:cantmoveis decremented which passes a turn in the counter- If
moreturnnextturnis above 0,cantmoveis decreased by it followed bymoreturnnextturnbeing set to 0 - If the actor is a player party member with the
LastWindmedal equipped and theirhpis 4 or less, theircantmoveis decremented which gives them an additional actor turn for the new main turn
- Otherwise, if the actor's
hpis 0,cantmoveis set to 0 - The actor's
blockTimesis reset to 0 - The actor's
tiredis set to 0 - The actor's
didnothingis set to false - The actor's
haspassedis set to false