Fix links in damage pipeline and StartBattle

This commit is contained in:
aldelaro5
2024-03-03 23:40:40 -05:00
parent 8bdd7c2583
commit 82d5492fc8
5 changed files with 85 additions and 85 deletions

View File

@@ -18,13 +18,13 @@ The vast majority are processed in DoDamage, but some are in [CalculateBaseDamag
|8|ShakeLonger|UNUSED|
|9|NoShake|UNUSED|
|10|ShowCombo|Calls [ShowComboMessage](../Visual%20rendering/ShowSuccessWord.md#showcombomessage) right after the damage amount has been calculated in DoDamage|
|11|NoSound|The [DoDamageAnim](DoDamageAnim.md) call towards the end of DoDamage will have nosound set to true. NOTE: this is ignored if `NoDamageAnim` or `BlockSoundOnly` is processed after|
|12|FailSound|The [DoDamageAnim](DoDamageAnim.md) call towards the end of DoDamage will have fail set to true. NOTE: this is ignored if `NoDamageAnim` is processed after|
|13|NoDamageAnim|There will not be a [DoDamageAnim](DoDamageAnim.md) call towards the end of DoDamage. NOTE: processing this overrides any `NoSound`, `BlockSoundOnly`, `FailSound` and `FakeAnim` because the call won't happen|
|14|BlockSoundOnly|The [DoDamageAnim](DoDamageAnim.md) call towards the end of DoDamage will have nosound set to true if block is false. NOTE: this is ignored if `NoDamageAnim` or `NoSound` is processed after|
|11|NoSound|The [DoDamageAnim](../Visual%20rendering/DoDamageAnim.md) call towards the end of DoDamage will have nosound set to true. NOTE: this is ignored if `NoDamageAnim` or `BlockSoundOnly` is processed after|
|12|FailSound|The [DoDamageAnim](../Visual%20rendering/DoDamageAnim.md) call towards the end of DoDamage will have fail set to true. NOTE: this is ignored if `NoDamageAnim` is processed after|
|13|NoDamageAnim|There will not be a [DoDamageAnim](../Visual%20rendering/DoDamageAnim.md) call towards the end of DoDamage. NOTE: processing this overrides any `NoSound`, `BlockSoundOnly`, `FailSound` and `FakeAnim` because the call won't happen|
|14|BlockSoundOnly|The [DoDamageAnim](../Visual%20rendering/DoDamageAnim.md) call towards the end of DoDamage will have nosound set to true if block is false. NOTE: this is ignored if `NoDamageAnim` or `NoSound` is processed after|
|15|NoCounter|There will not be a [ShowDamageCounter](../Visual%20rendering/ShowDamageCounter.md) call in DoDamage (this does not cover a `Frostbite` [medal](../../Enums%20and%20IDs/Medal.md) counter which is done in CalculateBaseDamage)|
|16|NoFall|Prevents an enemy party member from falling under any circumstances in CalculateBaseDamage if one is the target|
|17|NoIceBreak|Prevents an enemy party member from thawing out when they have the `Freeze` [condition](../Actors%20states/Conditions.md) under any circumstances in CalculateBaseDamage if one is the target|
|18|FakeAnim|The [DoDamageAnim](DoDamageAnim.md) call towards the end of DoDamage will have fakeanim set to true. NOTE: this is ignored if `NoDamageAnim` is processed after|
|18|FakeAnim|The [DoDamageAnim](../Visual%20rendering/DoDamageAnim.md) call towards the end of DoDamage will have fakeanim set to true. NOTE: this is ignored if `NoDamageAnim` is processed after|
|19|DontAwake|Prevents the attack from removing the `Sleep` [condition](../Actors%20states/Conditions.md) on the target during the course of DoDamage. NOTE: CalculateBaseDamage can still remove it when inflicting a different status, check its documentation to learn more|
|20|IgnoreNumb|Prevents the `Numb` [condition](../Actors%20states/Conditions.md) to have its defense apply during CalculateBaseDamage under any circumstances|

View File

@@ -114,25 +114,25 @@ If the target doesn't have the `Shield` [condition](../Actors%20states/Condition
[ShowComboMessage](../Visual%20rendering/ShowSuccessWord.md#showcombomessage) is called with target.battleentity and block as block.
#### `NoSound`
The [DoDamageAnim](DoDamageAnim.md) call towards the end will have nosound set to true. NOTE: this is ignored if `NoDamageAnim` or `BlockSoundOnly` is processed after
The [DoDamageAnim](../Visual%20rendering/DoDamageAnim.md) call towards the end will have nosound set to true. NOTE: this is ignored if `NoDamageAnim` or `BlockSoundOnly` is processed after
#### `BlockSoundOnly`
The [DoDamageAnim](DoDamageAnim.md) call towards the end will have nosound set to true if block is false. NOTE: this is ignored if `NoDamageAnim` or `NoSound` is processed after
The [DoDamageAnim](../Visual%20rendering/DoDamageAnim.md) call towards the end will have nosound set to true if block is false. NOTE: this is ignored if `NoDamageAnim` or `NoSound` is processed after
#### `FailSound`
The [DoDamageAnim](DoDamageAnim.md) call towards the end will have fail set to true. NOTE: this is ignored if `NoDamageAnim` is processed after
The [DoDamageAnim](../Visual%20rendering/DoDamageAnim.md) call towards the end will have fail set to true. NOTE: this is ignored if `NoDamageAnim` is processed after
#### `NoDamageAnim`
There will not be a [DoDamageAnim](DoDamageAnim.md) call towards the end of the method. NOTE: processing this overrides any `NoSound`, `BlockSoundOnly`, `FailSound` and `FakeAnim` because the call won't happen
There will not be a [DoDamageAnim](../Visual%20rendering/DoDamageAnim.md) call towards the end of the method. NOTE: processing this overrides any `NoSound`, `BlockSoundOnly`, `FailSound` and `FakeAnim` because the call won't happen
#### `NoCounter`
There will not be a [ShowDamageCounter](../Visual%20rendering/ShowDamageCounter.md) call later
#### `FakeAnim`
The [DoDamageAnim](DoDamageAnim.md) call towards the end will have fakeanim set to true. NOTE: this is ignored if `NoDamageAnim` is processed after
The [DoDamageAnim](../Visual%20rendering/DoDamageAnim.md) call towards the end will have fakeanim set to true. NOTE: this is ignored if `NoDamageAnim` is processed after
#### `DontAwake`
Prevents the attack from removing the `Sleep` [condition](../Actors%20states/Conditions.md) on the target later even if all conditions to do so are fufilled. This is only used as part of poison and fire damages from [AdvanceTurnEntity](../Actors%20states/AdvanceTurnEntity.md).
Prevents the attack from removing the `Sleep` [condition](../Actors%20states/Conditions.md) on the target later even if all conditions to do so are fufilled. This is only used as part of poison and fire damages from [AdvanceTurnEntity](../Battle%20flow/AdvanceTurnEntity.md).
### Player damage processing
This section only happens if the target is a player party member.
@@ -295,8 +295,8 @@ As for the actual condition, it's `DefenseDown` if the property is `DefDownOnBlo
### `NeedlePincer` [medal](../../Enums%20and%20IDs/Medal.md) processing
If a heal was requested earlier as a result of blocking as a player party member with a `NeedlePincer` [medal](../../Enums%20and%20IDs/Medal.md), this is where the [Heal](../Actors%20states/Heal.md) call happens with the target as the entity and the ammount being the amount of `NeedlePincer` equipped on the target.
### [DoDamageAnim](DoDamageAnim.md) call
Unless there was a `NoDamageAnim` damage override processed earlier, [DoDamageAnim](DoDamageAnim.md) is called with these parameters:
### [DoDamageAnim](../Visual%20rendering/DoDamageAnim.md) call
Unless there was a `NoDamageAnim` damage override processed earlier, [DoDamageAnim](../Visual%20rendering/DoDamageAnim.md) is called with these parameters:
- entity: target
- damage: The final amount of damage calculated

View File

@@ -9,7 +9,7 @@ This part only contains miscellaneous initialisations logic mainly about the `pl
- All `enemydata` battleentity have their `rigid` gravity enabled
- The `dimmer` gets childed to the `battlemap` with a clear color and then disabled (this reveals the scene as it was hidden earlier)
- If instance.`firstbattleaction` is false TODO ???
- A [DoAction](Battle%20flow/Action%20coroutines/DoAction.md) call starts with the first `playerdata` battleentity with action -555
- A [DoAction](../Battle%20flow/Action%20coroutines/DoAction.md) call starts with the first `playerdata` battleentity with action -555
- All frames are yielded while `action` is true until it goes to false
- 0.5 seconds are yielded
- instance.`firstbattleaction` gets set to true
@@ -45,18 +45,18 @@ This part only happens if adv is 3:
- `enemy` is set to true (We temporarilly go into the [enemy phase](../Battle%20flow/Main%20turn%20life%20cycle.md#enemies-phase))
- `firststrike` is set to true
- [UpdateAnim](Visual%20rendering/UpdateAnim.md) is called
- [UpdateAnim](../Visual%20rendering/UpdateAnim.md) is called
- instance.`hudcooldown` is set to 10.0 which shows the main HP / TP HUD
- instance.`showmoney` is set to -1.0 which hides the berry count HUD
- `action` is set to true (enter an [uncontrolled flow](../Battle%20flow/Update%20flows/Uncontrolled%20flow.md))
- [RefreshEnemyHP](Visual%20rendering/RefreshEnemyHP.md) is called
- [RefreshEnemyHP](../Visual%20rendering/RefreshEnemyHP.md) is called
- 0.15 seconds are yielded
- A [DoAction](Battle%20flow/Action%20coroutines/DoAction.md) call is started on `enemydata[0]` with action 0
- A [DoAction](../Battle%20flow/Action%20coroutines/DoAction.md) call is started on `enemydata[0]` with action 0
- All frames are yielded while `action` is true until it goes to false (Waits that DoAction is done)
- `enemydata[0].tired` is set to 0
- `enemydata[0].cantmove` is set to 0
- `action` is set to true (goes back into an [uncontrolled flow](../Battle%20flow/Update%20flows/Uncontrolled%20flow.md))
- A [CheckDead](Battle%20flow/Action%20coroutines/CheckDead.md) is started with the coroutine being stored in `checkingdead`
- A [CheckDead](../Battle%20flow/Action%20coroutines/CheckDead.md) is started with the coroutine being stored in `checkingdead`
- All frames are yielded while `checkingdead` is in progress
- All `enemydata` have their `tired` and `cantmove` set to 0
- `currentturns` is set to -1
@@ -77,27 +77,27 @@ If `saveddata` is true (this is a retry), SetStartConditions is called which wil
After, all `playerdata`'s `condition`'s element that have a turn count of 0 or below are removed
From there, the `RandomStart` [medal](../Enums%20and%20IDs/Medal.md) takes effect if it's equipped for each `playerdata` that has it. The effec involves a GetChance test that is performed with 16 weights with outcomes from 0 to 6 and what happens here depends on the result:
From there, the `RandomStart` [medal](../../Enums%20and%20IDs/Medal.md) takes effect if it's equipped for each `playerdata` that has it. The effec involves a GetChance test that is performed with 16 weights with outcomes from 0 to 6 and what happens here depends on the result:
- 0 (3/16): [StatusEffect](Actors%20states/Conditions%20methods/StatusEffect.md) is called on the `playerdata` with [AttackUp](../Actors%20states/BattleCondition/AttackUp.md) for 2 actor turns with effect
- 1 (3/16): [StatusEffect](Actors%20states/Conditions%20methods/StatusEffect.md) is called on the `playerdata` with [DefenseUp](../Actors%20states/BattleCondition/DefenseUp.md) for 2 actor turns with effect
- 0 (3/16): [StatusEffect](../Actors%20states/Conditions%20methods/StatusEffect.md) is called on the `playerdata` with [AttackUp](../Actors%20states/BattleCondition/AttackUp.md) for 2 actor turns with effect
- 1 (3/16): [StatusEffect](../Actors%20states/Conditions%20methods/StatusEffect.md) is called on the `playerdata` with [DefenseUp](../Actors%20states/BattleCondition/DefenseUp.md) for 2 actor turns with effect
- 2 (2/16):
- The `StatUp` sound is played if it wasn't already
- [StatEffect](Visual%20rendering/StatEffect.md) is called with the battleentity using type 4 (green up arrow)
- [StatEffect](../Visual%20rendering/StatEffect.md) is called with the battleentity using type 4 (green up arrow)
- The player party member's `charge` is incremented
- 3 (2/16): If the `playerdata`'s `poisonres` is 100 or above (it's immune to poison), this is treated as an outcome of 2 described above. If it's not:
- The `Poison` sound is played if it wasn't already
- The `PoisonEffect` particles are played on the battleentity position
- [SetCondition](Actors%20states/Conditions%20methods/SetCondition.md) is called with [Poison](../Actors%20states/BattleCondition/Poison.md) on the player party member for 2 actor turns unless the `Eternal Venom` [medal](../Enums%20and%20IDs/Medal.md) is equipped on it where it's 99999 actor turns instead
- 4 (2/16): The `StatUp` sound is played if it wasn't already followed by a [StatEffect](Visual%20rendering/StatEffect.md) coroutine being started with the battleentity using type 5 (yellow up arrow) followed by the `playerdata`'s `cantmove` being decremented (gives an additional actor turn)
- [SetCondition](../Actors%20states/Conditions%20methods/SetCondition.md) is called with [Poison](../Actors%20states/BattleCondition/Poison.md) on the player party member for 2 actor turns unless the `Eternal Venom` [medal](../../Enums%20and%20IDs/Medal.md) is equipped on it where it's 99999 actor turns instead
- 4 (2/16): The `StatUp` sound is played if it wasn't already followed by a [StatEffect](../Visual%20rendering/StatEffect.md) coroutine being started with the battleentity using type 5 (yellow up arrow) followed by the `playerdata`'s `cantmove` being decremented (gives an additional actor turn)
- 5 (2/16):
- The `Heal3` sound is played if it wasn't already
- The `MagicUp` particles being played on the battleentity position without sound
- [SetCondition](Actors%20states/Conditions%20methods/SetCondition.md) is called with [GradualHP](../Actors%20states/BattleCondition/GradualHP.md) on the player party member for 2 actor turns
- [SetCondition](../Actors%20states/Conditions%20methods/SetCondition.md) is called with [GradualHP](../Actors%20states/BattleCondition/GradualHP.md) on the player party member for 2 actor turns
- 6 (2/16):
- The `Heal3` sound is played if it wasn't already
- The `MagicUp` particles are played on the battleentity position without sound
- [SetCondition](Actors%20states/Conditions%20methods/SetCondition.md) is called with [GradualTP](../Actors%20states/BattleCondition/GradualTP.md) on the player party member for 2 actor turns
- [SetCondition](../Actors%20states/Conditions%20methods/SetCondition.md) is called with [GradualTP](../Actors%20states/BattleCondition/GradualTP.md) on the player party member for 2 actor turns
Finally, UpdateConditionIcons is called which calls UpdateConditionBubbles on the battleentity (all `playerdata` with right to false and all `enemydata` with `hp` above 0 with right to true)

View File

@@ -10,12 +10,12 @@ This part only contains miscellaneous initialisations logic:
- The money HUD is hidden by setting instance.showmoney to -1
- MainManager.RefreshHUDValues is called which forces the displayed hp, tp and berry count to their real ones
- If `tskybox` exists (meaning this is a retry as it was saved before the StartBattle call), RenderSettings.skybox is set to it
- All [NPCControl](../Entities/NPCControl/NPCControl.md) have [StopForceBehavior](../Entities/NPCControl/Notable%20methods/StopForceBehavior.md) called on them
- All [NPCControl](../../Entities/NPCControl/NPCControl.md) have [StopForceBehavior](../../Entities/NPCControl/Notable%20methods/StopForceBehavior.md) called on them
- A frame is yielded
- The `LevelUp` music and `Gameover` sound are loaded, but not stored. This is purely to preload them to not get a stutter when they eventually play
- `damcounters` is reset to a new list
- `charmdance` is set to 2 elements being sprite 98 and 99 of `Sprites/Entities/moth0`. These are the 2 Charmy's sprites used when they performs a charm
- `scopeequipped` is set to whether or not the `HPScope` [medal](../Enums%20and%20IDs/Medal.md) is equipped
- `scopeequipped` is set to whether or not the `HPScope` [medal](../../Enums%20and%20IDs/Medal.md) is equipped
- `dimmer` is set to a new Sprite of 1 pure black pixel named `MainDimmer` scaled to 100.0 on layer 5 (UI) uniformely with position Vector3.zero and with a pivot at (0.5, 0.5, 0.5). This covers the whole screen during the load
- If this isn't a retry (meaning it wasn't an existing battle):
- The camera limits are removed, but saved to their temporary fields before
@@ -23,7 +23,7 @@ This part only contains miscellaneous initialisations logic:
- `oldcamrotation` is set to instance.`camangleoffset`
- `oldcamtarget` is set to instance.`camtarget`
- `oldcamspeed` is set to instance.`camspeed`
- [SetDefaultCamera](Visual%20rendering/SetDefaultCamera.md) is called
- [SetDefaultCamera](../Visual%20rendering/SetDefaultCamera.md) is called
- `chompylock` is set to false
- `lockmmatter` is set to false
- `gameover` is set to null
@@ -36,7 +36,7 @@ This part only contains miscellaneous initialisations logic:
This part disables the current map and enables the battle one which is created:
- If the map is enabled:
- MainManager.[RefreshEntities](Actors%20states/RefreshEntities.md) is called
- MainManager.[RefreshEntities](../Actors%20states/RefreshEntities.md) is called
- A frame is yielded
- All `playerdata` entities have the following happen to each of them:
- `flyinganim` is set to false
@@ -45,7 +45,7 @@ This part disables the current map and enables the battle one which is created:
- The entity.gameObject is disabled
- The map is disabled
- `battlemap` is set to a new GameObject named `Battle`
- The corresponding `Prefabs/BattleMaps/X` battle map prefab is instantiated where X is the [BattleMaps](../Enums%20and%20IDs/BattleMaps.md) enum name of the stageid and it is childed to `battlemap`
- The corresponding `Prefabs/BattleMaps/X` battle map prefab is instantiated where X is the [BattleMaps](../../Enums%20and%20IDs/BattleMaps.md) enum name of the stageid and it is childed to `battlemap`
- All colliders in the battle map are disabled
- A BoxCollider is added to `battlemap` with center (0.0, -0.5, 0.0) and size (100.0, 1.0, 50.0)
- `battlemap`.layer is set to 8 (`Ground`)
@@ -57,12 +57,12 @@ This part selects the music to play if any and plays it:
- MainManager.`music[0]` pitch is set to normal
- If MainManager.map.`nobattlemusic` is false or we are instance.`inevent`, the music is changed via MainManager.ChangeMusic with a 1.0 fadespeed where the clip varies depending on some conditions:
- If the sent music isn't null, that will be the clip used
- Otherwise, If the current [area](../Enums%20and%20IDs/librarystuff/Areas.md) is `UpperSnakemouth`, `Battle6` will be used
- Otherwise, if [flag](../Flags%20arrays/flags.md) 348 (Start of chapter 5) is true and the current [area](../Enums%20and%20IDs/librarystuff/Areas.md) is among `BarrenLands`, `FarGrasslands`, `WildGrasslands`, `RubberPrison`, `MetalLake` or `StreamMountain`, `Battle6` will be used
- Otherwise, If the current [area](../../Enums%20and%20IDs/librarystuff/Areas.md) is `UpperSnakemouth`, `Battle6` will be used
- Otherwise, if [flag](../../Flags%20arrays/flags.md) 348 (Start of chapter 5) is true and the current [area](../../Enums%20and%20IDs/librarystuff/Areas.md) is among `BarrenLands`, `FarGrasslands`, `WildGrasslands`, `RubberPrison`, `MetalLake` or `StreamMountain`, `Battle6` will be used
- Otherwise, `Battle0` will be used
## Enemy party setup
This part goes through all the enemyids and initialises the corresponding `enemydata` element. The array is initialised to a new one with a length of enemyids.length for this purpose. The main portion of the data comes from [GetEnemyData](../TextAsset%20Data/Enemies%20data.md) with entity creation.
This part goes through all the enemyids and initialises the corresponding `enemydata` element. The array is initialised to a new one with a length of enemyids.length for this purpose. The main portion of the data comes from [GetEnemyData](../../TextAsset%20Data/Enemies%20data.md) with entity creation.
From there, the following happens on each `enemydata`:
@@ -70,7 +70,7 @@ From there, the following happens on each `enemydata`:
- `turnsnodamage` is set to -1
- battleentity.`alwaysactive` is set to true
- battle.`estimatedexp` is incremented by the `enemydata.exp`
- If the enemy's `animid` (the [enemy](../Enums%20and%20IDs/Enemies.md) id) is less than the amount of instance.`enemyencounter` elements (which is normally 256) and battleentity.`cotunknown` is false (it's not a Cave of Trials battle entity), the corresponding `enemyencounter` element's seen counter is incremented
- If the enemy's `animid` (the [enemy](../../Enums%20and%20IDs/Enemies.md) id) is less than the amount of instance.`enemyencounter` elements (which is normally 256) and battleentity.`cotunknown` is false (it's not a Cave of Trials battle entity), the corresponding `enemyencounter` element's seen counter is incremented
- The battleentity position is determined where it depends on the amount of enemies and this one's position:
- x: This depends on the amount of enemies and half of the `enemydata`'s size clamped from 1.0 to 1.5:
- 2: 1.5 + 3.5 * enemy index * the clamped size
@@ -79,42 +79,42 @@ From there, the following happens on each `enemydata`:
- y: always 0.1
- z: 0.0 for the 1st enemy, 0.15 for the 2nd, 0.30 for the 3rd and 0.45 for the 4th
- The battleentity gets childed to the `battlemap`
- battleentity.`hologram` gets set to the value of [flag](../Flags%20arrays/flags.md) 162 (we are in a B.O.S.S or Cave of Trials battle)
- battleentity.`hologram` gets set to the value of [flag](../../Flags%20arrays/flags.md) 162 (we are in a B.O.S.S or Cave of Trials battle)
- `battlepos` is set to the battleentity position
- Some [enemies](../../Enums%20and%20IDs/Enemies.md) have additional logic here:
- `VenusBoss`: `extraentities` is initialised to a new array with one element being a new entity created via [CreateNewEntity](../Entities/EntityControl/EntityControl%20Creation.md#createnewentity) with a name of `Venus`, an [animid](../Enums%20and%20IDs/AnimIDs.md) of 80 (`Venus`) and a position of (0.0, 0.0, 4.0) childed to the `battlemap`. This entity gets further adjustements:
- `hologram` gets set to the value of [flag](../Flags%20arrays/flags.md) 162 (we are in a B.O.S.S or Cave of Trials battle)
- `VenusBoss`: `extraentities` is initialised to a new array with one element being a new entity created via [CreateNewEntity](../../Entities/EntityControl/EntityControl%20Creation.md#createnewentity) with a name of `Venus`, an [animid](../../Enums%20and%20IDs/AnimIDs.md) of 80 (`Venus`) and a position of (0.0, 0.0, 4.0) childed to the `battlemap`. This entity gets further adjustements:
- `hologram` gets set to the value of [flag](../../Flags%20arrays/flags.md) 162 (we are in a B.O.S.S or Cave of Trials battle)
- `alwaysactive` gets set to true
- `activeonpause` gets set to true
- A VenusBattle component gets added to the gameObject and its SetUp gets called on it with itself as the parent and the battleentity as the target
- `Scarlet`: battleentity.`basesate` is set to 5 (`Angry`)
- `BeeBoss`: `battlepos` and the battleentity position are set to (4.5, 0.0, 0.0)
- `SandWyrmTail`: entity.`height` and entity.`initialheight` are set to 0.0
- `Cenn` and `Pisci`: If [flags](../Flags%20arrays/flags.md) 497 is true (beat them for the first time) , `eventondeath` is set to -1. If it's false, `AlwaysSurvive` is added to the [weakness](../Actors%20states/Enemy%20features.md#weakness). In either cases, `battlepos` and the battleentity position are set to (1.0, 0.0, 0.0)
- `Spuder` and `SpuderReal`: If [flags](../Flags%20arrays/flags.md) 41 is false (before the end of chapter 1) and either flags 613 (RUIGEE) or 614 (HARDEST) is true, the `hp` and `maxhp` are decreased by 15
- `Zasp` and `Mothiva`: If [flags](../Flags%20arrays/flags.md) 606 is true (after the second round of the colosseum in chapter 6), `hp` / `maxhp` are increased by 15, `hardatk` is incremented and `lockrelayreceive` is set to true
- `Cenn` and `Pisci`: If [flags](../../Flags%20arrays/flags.md) 497 is true (beat them for the first time) , `eventondeath` is set to -1. If it's false, `AlwaysSurvive` is added to the [weakness](../Actors%20states/Enemy%20features.md#weakness). In either cases, `battlepos` and the battleentity position are set to (1.0, 0.0, 0.0)
- `Spuder` and `SpuderReal`: If [flags](../../Flags%20arrays/flags.md) 41 is false (before the end of chapter 1) and either flags 613 (RUIGEE) or 614 (HARDEST) is true, the `hp` and `maxhp` are decreased by 15
- `Zasp` and `Mothiva`: If [flags](../../Flags%20arrays/flags.md) 606 is true (after the second round of the colosseum in chapter 6), `hp` / `maxhp` are increased by 15, `hardatk` is incremented and `lockrelayreceive` is set to true
- `Pitcher`: battleentity position is incremented by Vector3.right
- `Maki`, `Kina` and `Yin`: If [flags](../Flags%20arrays/flags.md) 614 (HARDEST) is true, `hp` / `maxhp` are increased by 10 and `def` is incremented
- If the calledfrom.entity or the battleentity is `inice` while it's a `Krawler` or `CursedSkull` [enemy](../Enums%20and%20IDs/Enemies.md):
- `Maki`, `Kina` and `Yin`: If [flags](../../Flags%20arrays/flags.md) 614 (HARDEST) is true, `hp` / `maxhp` are increased by 10 and `def` is incremented
- If the calledfrom.entity or the battleentity is `inice` while it's a `Krawler` or `CursedSkull` [enemy](../../Enums%20and%20IDs/Enemies.md):
- `freezeres` is incremented by 70
- battleentity.`inice` is set to true
- [weakness](../Actors%20states/Enemy%20features.md#weakness) is set to a new list with one element being `HornExtraDamage`
- If battleentity.`forcefire` or we are in the `GiantLair` [area](../Enums%20and%20IDs/librarystuff/Areas.md) except for the `GiantLairFridgeInside` [map](../Enums%20and%20IDs/Maps.md) while the enemy is a `Krawler`, `CursedSkull` or `Cape`:
- If instance.`partylevel` is less than 27 (meaning it's not maxed) and [flags](../Flags%20arrays/flags.md) 613 is false (RUIGEE is inactive), the `exp` is incremented by the floored result of a lerp from 10.0 to 3.0 with a factor of instance.`partylevel` / 27.0
- If battleentity.`forcefire` or we are in the `GiantLair` [area](../../Enums%20and%20IDs/librarystuff/Areas.md) except for the `GiantLairFridgeInside` [map](../../Enums%20and%20IDs/Maps.md) while the enemy is a `Krawler`, `CursedSkull` or `Cape`:
- If instance.`partylevel` is less than 27 (meaning it's not maxed) and [flags](../../Flags%20arrays/flags.md) 613 is false (RUIGEE is inactive), the `exp` is incremented by the floored result of a lerp from 10.0 to 3.0 with a factor of instance.`partylevel` / 27.0
- `freezeres` is set to 110
- `hp` and `maxhp` are increased by 3
- `weakness` is set to a new list with one element being `Magic`
- A frame is yielded
- battleentity.[animstate](../Entities/EntityControl/Animations/animstate.md) is set to its `basesate`
- battleentity.[animstate](../../Entities/EntityControl/Animations/animstate.md) is set to its `basesate`
After, there are more setup logic, but this time, it's based on the entire `enemydata` array instead of each element:
- If it contains a `MotherChomper` [enemy](../Enums%20and%20IDs/Enemies.md) with a length of 3, the `battlepos` are changed as follows:
- If it contains a `MotherChomper` [enemy](../../Enums%20and%20IDs/Enemies.md) with a length of 3, the `battlepos` are changed as follows:
- 0: (1.2, 0.0, 1.0)
- 1: (2.7, 0.0, -0.5)
- 2: (4.6, 0.0, -0.1)
- If it contains a `UltimaxTank` [enemy](../Enums%20and%20IDs/Enemies.md), the `battlepos` of the first element is incremented by (0.0, 0.0, 1.0)
- If it contains a `SandWyrm` [enemy](../Enums%20and%20IDs/Enemies.md), the first 2 elements gets a VenusBattle component added to their battleentity.gameObject with its SetUp called on them where the target is the battleentity itself and the parent being the other of the 2 battleentity. It also changes their `battlepos`:
- If it contains a `UltimaxTank` [enemy](../../Enums%20and%20IDs/Enemies.md), the `battlepos` of the first element is incremented by (0.0, 0.0, 1.0)
- If it contains a `SandWyrm` [enemy](../../Enums%20and%20IDs/Enemies.md), the first 2 elements gets a VenusBattle component added to their battleentity.gameObject with its SetUp called on them where the target is the battleentity itself and the parent being the other of the 2 battleentity. It also changes their `battlepos`:
- 0: (3.0, 0.0, 0.0)
- 1: (5.9, 0.0, 0.0)
- All battleentity in `enemydata` gets their position set to their corresponding `battlepos`
@@ -127,14 +127,14 @@ From there, the following fields gets initialised to each `playerdata`:
|Field|Initial value|
|----:|-------------|
|battleentity|A new entity created via [CreateNewEntity](../Entities/EntityControl/EntityControl%20Creation.md#createnewentity) with the name `PlayerX` where X is the index of the element|
|battleentity|A new entity created via [CreateNewEntity](../../Entities/EntityControl/EntityControl%20Creation.md#createnewentity) with the name `PlayerX` where X is the index of the element|
|`tired`|0|
|`cantmove`|0|
|`charge`|0|
|`atkdownonloseatkup`|false|
|battleentity's position|Depends on the `playerdata` index:<ul><li>0: (-3.0, 0.1, 0.0)</li><li>1: (-5.0, 0.1, 1.0)</li><li>2: (-6.0, 0.1, 0.0)</li></ul>|
|battleentity's tag|`Player`|
|battleentity.[animid](../Enums%20and%20IDs/AnimIDs.md)|The corresponding `trueid` (see [battle party addressing](../playerdata%20addressing.md#methods-of-addressing-durring-battle))|
|battleentity.[animid](../../Enums%20and%20IDs/AnimIDs.md)|The corresponding `trueid` (see [battle party addressing](../playerdata%20addressing.md#methods-of-addressing-durring-battle))|
|battleentity.`flip`|true|
|battleentity.`battle`|true|
|`moreturnnextturn`|0|
@@ -147,15 +147,15 @@ From there, the following fields gets initialised to each `playerdata`:
|battleentity.`nocondition`|false|
|`isnumb`|false|
|`pointer`|The `playerdata` index|
|`plating`|Whether or not the player party member has the `Plating` [medal](../Enums%20and%20IDs/Medal.md) equipped|
|`plating`|Whether or not the player party member has the `Plating` [medal](../../Enums%20and%20IDs/Medal.md) equipped|
|`isasleep`|false|
|`isdefending`|false|
|battleentity.`battleid`|The `playerdata` index|
|battleentity.parent|`battlemap` (gets childed to it)|
|battleentity.gameObject.layer|9 (`Follower`)|
|battleentity.`emoticonoffset`|(0.0, 1.8 + 0.25 * the `playerdata` index, 0.0)|
|battleentity.`destroytype`|[PlayerDeath](../Entities/EntityControl/Notable%20methods/Death.md#playerdeath)|
|battleentity.[animstate](../Entities/EntityControl/Animations/animstate.md)|13 (`BattleIdle`)|
|battleentity.`destroytype`|[PlayerDeath](../../Entities/EntityControl/Notable%20methods/Death.md#playerdeath)|
|battleentity.[animstate](../../Entities/EntityControl/Animations/animstate.md)|13 (`BattleIdle`)|
|`eventondeath`|-1|
|`cursoroffset`|(0.0, 2.5, 0.0)|
|`haspassed`|false|
@@ -172,12 +172,12 @@ Additionally, the following also happens for each `playerdata`:
- Angles of (-45.0, 270.0, 0.0)
- Disabled for now
After initialising all player party members, MainManager.[ApplyBadges](ApplyBadges.md) is called.
After initialising all player party members, MainManager.[ApplyBadges](../ApplyBadges.md) is called.
## Chompy setup
This part involves the initialisation of the `chompy` field. It happens if [flags](../Flags%20arrays/flags.md) 402 is true (Chompy is with Team Snakemouth).
This part involves the initialisation of the `chompy` field. It happens if [flags](../../Flags%20arrays/flags.md) 402 is true (Chompy is with Team Snakemouth).
`chompy` is initialised to a new entity created via [CreateNewEntity](../Entities/EntityControl/EntityControl%20Creation.md#createnewentity) with name `chompy` with the `ChompyChan` [animid](../Enums%20and%20IDs/AnimIDs.md) with a position of (-0.5, 0.0, 1) with the following:
`chompy` is initialised to a new entity created via [CreateNewEntity](../../Entities/EntityControl/EntityControl%20Creation.md#createnewentity) with name `chompy` with the `ChompyChan` [animid](../../Enums%20and%20IDs/AnimIDs.md) with a position of (-0.5, 0.0, 1) with the following:
- Childed to the `battlemap`
- gameObject.layer set to 9 (`Follower`)
@@ -187,26 +187,26 @@ This part involves the initialisation of the `chompy` field. It happens if [flag
## AI setup
This part initialises battle `aiparty` which is a battle AI. A battle AI is an entity that sits closely to the player party, but has scripted actions after the player party's turn is over. They are only added under specific conditions, usually involving having a follower.
The method used for this is called AddAI and it initalises `aiparty` to a new entity created via [CreateNewEntity](../Entities/EntityControl/EntityControl%20Methods.md#createnewentity) with name `ai party` using the matching with position (-3.0, 0.0, 2.0) childed to the `battlemap` and with a `flip` and `battle` field set to true. The method takes an [animid](../Enums%20and%20IDs/AnimIDs.md) and am [animstate](../Entities/EntityControl/Animations/animstate.md) to set to the entity (the animstate parameter is called basestate, but it actually sets the `animstate` field).
The method used for this is called AddAI and it initalises `aiparty` to a new entity created via [CreateNewEntity](../../Entities/EntityControl/EntityControl%20Methods.md#createnewentity) with name `ai party` using the matching with position (-3.0, 0.0, 2.0) childed to the `battlemap` and with a `flip` and `battle` field set to true. The method takes an [animid](../../Enums%20and%20IDs/AnimIDs.md) and am [animstate](../../Entities/EntityControl/Animations/animstate.md) to set to the entity (the animstate parameter is called basestate, but it actually sets the `animstate` field).
While technically, the method can be called multiple time, this isn't supported and will likely result in entities not being tracked by the game should this happen.
Here are the different AIs added and their conditions:
- `Maki` is added with [animstate](../Entities/EntityControl/Animations/animstate.md) 13 (`BattleIdle`) if any of the following is true:
- The MainManager.map.`mapid` is the `FGClearing` [map](../Enums%20and%20IDs/Maps.md)
- [flags](../Flags%20arrays/flags.md) 594 is true (Chapter 7 when maki should be present in battle)
- `Maki` is a [tempfollower](../SetText/Individual%20commands/Addfollower.md#Remarks) while the current [area](../Enums%20and%20IDs/librarystuff/Areas.md) is `FarGrasslands` or `WildGrasslands` or the map is the `TestRoom`
- `KungFuMantis` is added with [animstate](../Entities/EntityControl/Animations/animstate.md) 5 (`Angry`) if they are a [tempfollower](../SetText/Individual%20commands/Addfollower.md#Remarks)
- `Madeleine` is added with [animstate](../Entities/EntityControl/Animations/animstate.md) 0 (`Idle`) if they are a [tempfollower](../SetText/Individual%20commands/Addfollower.md#Remarks)
- `AntCapitain` is added with [animstate](../Entities/EntityControl/Animations/animstate.md) 13 (`BattleIdle`) if map.`mapid` is the `AbandonedCity` [map](../Enums%20and%20IDs/Maps.md) and [flags](../Flags%20arrays/flags.md) 400 is true (reserved temporary flag). If they are added, it also causes every element of `enemydata` to have MainManager.[SetCondition](Actors%20states/Conditions%20methods/SetCondition.md) called twice on them as the entity with `AttackUp` and `DefenseUp` for 999999 actor turns
- `Maki` is added with [animstate](../../Entities/EntityControl/Animations/animstate.md) 13 (`BattleIdle`) if any of the following is true:
- The MainManager.map.`mapid` is the `FGClearing` [map](../../Enums%20and%20IDs/Maps.md)
- [flags](../../Flags%20arrays/flags.md) 594 is true (Chapter 7 when maki should be present in battle)
- `Maki` is a [tempfollower](../../SetText/Individual%20commands/Addfollower.md#Remarks) while the current [area](../../Enums%20and%20IDs/librarystuff/Areas.md) is `FarGrasslands` or `WildGrasslands` or the map is the `TestRoom`
- `KungFuMantis` is added with [animstate](../../Entities/EntityControl/Animations/animstate.md) 5 (`Angry`) if they are a [tempfollower](../../SetText/Individual%20commands/Addfollower.md#Remarks)
- `Madeleine` is added with [animstate](../../Entities/EntityControl/Animations/animstate.md) 0 (`Idle`) if they are a [tempfollower](../../SetText/Individual%20commands/Addfollower.md#Remarks)
- `AntCapitain` is added with [animstate](../../Entities/EntityControl/Animations/animstate.md) 13 (`BattleIdle`) if map.`mapid` is the `AbandonedCity` [map](../../Enums%20and%20IDs/Maps.md) and [flags](../../Flags%20arrays/flags.md) 400 is true (reserved temporary flag). If they are added, it also causes every element of `enemydata` to have MainManager.[SetCondition](../Actors%20states/Conditions%20methods/SetCondition.md) called twice on them as the entity with `AttackUp` and `DefenseUp` for 999999 actor turns
Finally, a frame is yielded.
## Last pre `halfload` initialisations
This part only contains miscellaneous initialisations logic before `halfload` is set to true:
- MainManager.[RefreshEntities](Actors%20states/RefreshEntities.md) is called
- MainManager.[RefreshEntities](../Actors%20states/RefreshEntities.md) is called
- instance.`camspeed` is set to 0.1
- If `actiontext` doesn't exist, it is created as a SpriteRenderer component added to a new GameObject named `ActionText` and the following:
- Childed to the `GUICamera`
@@ -223,25 +223,25 @@ This part only contains miscellaneous initialisations logic before `halfload` is
- Childed to the `battlemap`
- gameObject.layer set to 15 (`3DUI`)
- Angles of (0.0, 0.0, 270.0)
- `avaliableplayers` is set to the return of MainManager.[GetFreePlayerAmmount](Actors%20states/GetFreePlayerAmmount.md)
- `avaliableplayers` is set to the return of MainManager.[GetFreePlayerAmmount](../Actors%20states/Player%20party%20members/GetFreePlayerAmmount.md)
- A frame is yielded
- The `cursor` position is set to (0.0, 999.0, 0.0)
- The SpriteRenderer material of the `cursor` has its renderQueue set to 10000
- [UpdateText](Visual%20rendering/UpdateText.md) is called
- MainManager.[RefreshSkills](RefreshSkills.md) is called
- [UpdateText](../Visual%20rendering/UpdateText.md) is called
- MainManager.[RefreshSkills](../RefreshSkills.md) is called
- RefreshAllData is called which sets `alldata` to a new list which consists of all the `playerdata` followed by all the `enemydata` appended together
- If the `fronticon` doesn't exist, it is initialised to the SpriteRenderer of a new UI object with the name `attackicon` childed to the `GUICamera` with position of Vector.zero, size of Vector3.one / 3.0, sortingOrder of 20 and with a sprite of `guisprites[63]` (the red arrow of the front icon in battle)
- A frame is yielded
- We exit the `pause` entered earlier
- If there's more than one `playerdata` element, then as long as the first `partypointer` doesn't match the first instance.`partyorder` (meaning the `battle` doesn't point to the leading party member), a [SwitchParty](Battle%20flow/Action%20coroutines/SwitchParty.md) action coroutine is started with fast (which ends up calling MainManager.SwitchParty immediately) followed by a frame yield until they both match NOTE: it does mean the coroutine calls can be spammed, but in theory, the while condition gets updated information everytime since the StartCoroutine call immediately causes the party to be updated. For more information on why this is done, check [battle party addressing](../playerdata%20addressing.md#methods-of-addressing-durring-battle).
- If there's more than one `playerdata` element, then as long as the first `partypointer` doesn't match the first instance.`partyorder` (meaning the `battle` doesn't point to the leading party member), a [SwitchParty](../Battle%20flow/Action%20coroutines/SwitchParty.md) action coroutine is started with fast (which ends up calling MainManager.SwitchParty immediately) followed by a frame yield until they both match NOTE: it does mean the coroutine calls can be spammed, but in theory, the while condition gets updated information everytime since the StartCoroutine call immediately causes the party to be updated. For more information on why this is done, check [battle party addressing](../playerdata%20addressing.md#methods-of-addressing-durring-battle).
- If calledfrom exists with a `dizzytime` above 0.0:
- The `playerdata` with a `trueid` (which is the [animid](../Enums%20and%20IDs/AnimIDs.md)) that matches the first `partypointer` is found and its `cantmove` is set to -1 and `receivedrelay` of the corresponding `playerdata` index is set to true. This essentially gives an additional turn to the lead party member and also allows their `tiredpart` to be enabled by [UpdateAnim](../Visual%20rendering/UpdateAnim.md). TODO: seems to neglect more turn next turn and strong start...
- The `playerdata` with a `trueid` (which is the [animid](../../Enums%20and%20IDs/AnimIDs.md)) that matches the first `partypointer` is found and its `cantmove` is set to -1 and `receivedrelay` of the corresponding `playerdata` index is set to true. This essentially gives an additional turn to the lead party member and also allows their `tiredpart` to be enabled by [UpdateAnim](../Visual%20rendering/UpdateAnim.md). TODO: seems to neglect more turn next turn and strong start...
- calledfrom.`dizzytime` is set to 0.0
- If the `StrongStart` [medal](../Enums%20and%20IDs/Medal.md) is equipped on a party member, the corresponding `playerdata` gets its `cantmove` decremented which gives it an additional turn
- If the `StrongStart` [medal](../../Enums%20and%20IDs/Medal.md) is equipped on a party member, the corresponding `playerdata` gets its `cantmove` decremented which gives it an additional turn
- UpdateConditionIcons is called which calls UpdateConditionBubbles on all battleentity (all `playerdata` with right to false and all `enemydata` with `hp` above 0 with right to true)
- All frames are yielded while `action` is true until it goes to false (this is done to ensure all remainings SwitchParty calls done earlier are fully finished)
- [RefreshEXP](Visual%20rendering/RefreshEXP.md) is called
- [RefreshEXP](../Visual%20rendering/RefreshEXP.md) is called
- SetLastTurns is called which resets `lastturns` to a new aray with the length being the amount of free players - 1 and all elements being -1 (this resets the player selection cycle)
- `halfload` is set to true
- All `playerdata` battleentity have their `rigid` gravity enabled, `onground` set to true and [animstate](../Entities/EntityControl/Animations/animstate.md) set to 13 (`BattleIdle`)
- All `playerdata` battleentity have their `rigid` gravity enabled, `onground` set to true and [animstate](../../Entities/EntityControl/Animations/animstate.md) set to 13 (`BattleIdle`)
- 0.1 seconds are yielded

View File

@@ -9,8 +9,8 @@ This part does basic initialisation and creates the instance.`battle` if needed:
- The current MainManager.`screenshake` is zeroed out
- MainManager.`battleenemyfled` is set to false
- instance.`lastdefeated` is reset to a new list
- All [OverWorldProjectile](../Entities/NPCControl/ActionBehaviors/ShootProjectile.md#an-overview-of-overworldprojectile) are destroyed
- [ItemList](../ItemList/ItemList%20State%20Machine.md)'s `inlist` is set to false
- All [OverWorldProjectile](../../Entities/NPCControl/ActionBehaviors/ShootProjectile.md#an-overview-of-overworldprojectile) are destroyed
- [ItemList](../../ItemList/ItemList%20State%20Machine.md)'s `inlist` is set to false
- The `camanglespeed` is set to 0.1 and `camanglechange` to false
- MainManager.`battleresult` is set to true
- MainManager.`battlenoexp` is reset to false
@@ -21,12 +21,12 @@ This part does basic initialisation and creates the instance.`battle` if needed:
## Start data init
This part only occurs when `saveddata` is false which can only happen when the battle was started for the first time because this field is only set to true at the very end of StartBattle.
This part initialises the `sdata` which is a [StartUpData](StartUpData.md) that persists informations about the battle and restored when it's retried. A retry involves calling StartBattle when the current one still exists which doesn't need this part's logic to occur.
This part initialises the `sdata` which is a [StartUpData](../StartUpData.md) that persists informations about the battle and restored when it's retried. A retry involves calling StartBattle when the current one still exists which doesn't need this part's logic to occur.
### EnemyCheck
If calledfrom is null or its `eventid` is 0 or below EnemyCheck is called which can modify the enemyids using 2 special overrides.
The first one involves a potential override to `GoldenSeedling` if instance.`inevent` is false and [flags](../Flags%20arrays/flags.md) 41 is true (chapter 1 ended). This is only applicable for the following [enemies](../Enums%20and%20IDs/Enemies.md):
The first one involves a potential override to `GoldenSeedling` if instance.`inevent` is false and [flags](../../Flags%20arrays/flags.md) 41 is true (chapter 1 ended). This is only applicable for the following [enemies](../../Enums%20and%20IDs/Enemies.md):
- `Seedling`
- `FlyingSeedling`
@@ -37,10 +37,10 @@ The first one involves a potential override to `GoldenSeedling` if instance.`ine
Any of these have a 1% chance to changed to a `GoldenSeedling`. However, there are 2 cases where these odds increases applied in order:
- If the current [map](../Enums%20and%20IDs/Maps.md) is `SeedlingHaven`, the odds are 7.5%
- If the `Seedling` [medal](../Enums%20and%20IDs/Medal.md) is equipped, it multiplies the base odds by 2.5 (meaning 2.5% or 18.75% at `SeedlingHaven`)
- If the current [map](../../Enums%20and%20IDs/Maps.md) is `SeedlingHaven`, the odds are 7.5%
- If the `Seedling` [medal](../../Enums%20and%20IDs/Medal.md) is equipped, it multiplies the base odds by 2.5 (meaning 2.5% or 18.75% at `SeedlingHaven`)
The second override applies if any [enemy](../Enums%20and%20IDs/Enemies.md) is a `SandWyrm` or a `SandWyrmTail`. If this is the case, the entire enemyids array is overriden to be 2 elements with the first being `SandWyrm` and the second being `SandWyrmTail`
The second override applies if any [enemy](../../Enums%20and%20IDs/Enemies.md) is a `SandWyrm` or a `SandWyrmTail`. If this is the case, the entire enemyids array is overriden to be 2 elements with the first being `SandWyrm` and the second being `SandWyrmTail`
### StartData
After, StartData is called:
@@ -51,7 +51,7 @@ After, StartData is called:
- From there, GetStartConditions is invoked in 2.5 seconds which completes this saving process by setting `sdata.psc`, `sdata.esc` and `sdata.enemyweakness` to their respective values (the whole thing is enclosed in a try catch block whose catch will invoke it again in 0.5 seconds).
### Battle fought counter increment
Finally, [flagvar](../Flags%20arrays/flagvar.md) 40 (number of battles fought) is incremented
Finally, [flagvar](../../Flags%20arrays/flagvar.md) 40 (number of battles fought) is incremented
## Essential setups
This part will do further initialisation:
@@ -82,8 +82,8 @@ This part will do further initialisation:
Additionally, the following procedure is done:
- We enter a `pause`
- MainManager.[ApplyBadges](ApplyBadges.md) is called
- MainManager.[ApplyStatBonus](ApplyStatBonus.md) is called
- MainManager.[ApplyBadges](../ApplyBadges.md) is called
- MainManager.[ApplyStatBonus](../ApplyStatBonus.md) is called
- StopMovingEntities is called on the map
## Battle map
@@ -102,7 +102,7 @@ This section setup the battle in transition:
- If the sent adv is 3 (enemy advantage) while we aren't `inevent`:
- A `Hurt` sound is played followed by a `AtkFail` one
- HurtParticle is called on the player position + Vector3.up with the `Hurt` sound (meaning the same sound will play twice on that frame)
- All player party members's battleentity have their [animstate](../Entities/EntityControl/Animations/animstate.md) set to 11 (`Hurt`) with a SetAnimForce call which will force a [SetAnim](../Entities/EntityControl/Animations/SetAnim.md) call with force which renders the animation immediately
- All player party members's battleentity have their [animstate](../../Entities/EntityControl/Animations/animstate.md) set to 11 (`Hurt`) with a SetAnimForce call which will force a [SetAnim](../../Entities/EntityControl/Animations/SetAnim.md) call with force which renders the animation immediately
- If the player.entity.`sound` exists, it is stopped
- PlayTransition is called with id 2 (the battle in transition), the data being the map.`battleleaftype` at 0.075 speed and the color being the map.`battleleafcolor` unless adv was 3 (enemy advantage) when we aren't `inevent` where the color is overriden to pure red
- 1.5 seconds are yieled which lets the transition renders