diff --git a/docs/Battle system/Enemy actions/Enemies/Beetle.md b/docs/Battle system/Enemy actions/Enemies/Beetle.md index f7d6310af..dac68d20e 100644 --- a/docs/Battle system/Enemy actions/Enemies/Beetle.md +++ b/docs/Battle system/Enemy actions/Enemies/Beetle.md @@ -64,9 +64,11 @@ A single target horn slash |#|Conditions|attacker|target|damageammount|property|overrides|block| |-:|---|---|---|---|---|---|---| -|1|Always happen|This enemy|`playertargetID` after [GetSingleTarget](../../Actors%20states/Targetting/GetRandomAvaliablePlayer.md#getsingletarget)|3|[Flip](../../Damage%20pipeline/AttackProperty.md)1|null|`commandsuccess`| +|1|Always happen|`enemydata[actionid]`1|`playertargetID` after [GetSingleTarget](../../Actors%20states/Targetting/GetRandomAvaliablePlayer.md#getsingletarget)|3|[Flip](../../Damage%20pipeline/AttackProperty.md)2|null|`commandsuccess`| -1: This property gets overriden to null in [CalculateBaseDamage](../../Damage%20pipeline/CalculateBaseDamage.md) as the target is a player party member so it does nothing. +1: This is technically incorrect because `actionid` is unused so it's always 0. However, it ends up accidentally working because under normal gameplay, this enemy is `enemydata[0]` so it still ends up being correct in practice. + +2: This property gets overriden to null in [CalculateBaseDamage](../../Damage%20pipeline/CalculateBaseDamage.md) as the target is a player party member so it does nothing. ### Logic sequence This is done by yield returning the EnemyHeavyStrike coroutine with the entity: @@ -98,9 +100,11 @@ A single target underground strike |#|Conditions|attacker|target|damageammount|property|overrides|block| |-:|---|---|---|---|---|---|---| -|1|Always happen|This enemy|`playertargetID` after [GetSingleTarget](../../Actors%20states/Targetting/GetRandomAvaliablePlayer.md#getsingletarget)|4|[Pierce](../../Damage%20pipeline/AttackProperty.md)1|null|`commandsuccess`| +|1|Always happen|`enemydata[actionid]`1|`playertargetID` after [GetSingleTarget](../../Actors%20states/Targetting/GetRandomAvaliablePlayer.md#getsingletarget)|4|[Pierce](../../Damage%20pipeline/AttackProperty.md)2|null|`commandsuccess`| + +1: This is technically incorrect because `actionid` is unused so it's always 0. However, it ends up accidentally working because under normal gameplay, this enemy is `enemydata[0]` so it still ends up being correct in practice. -1: Enemy piercing damages are disabled so this property does nothing, see the [CalculateBaseDamage](../../Damage%20pipeline/CalculateBaseDamage.md#piercing) documentation to learn more +2: Enemy piercing damages are disabled so this property does nothing, see the [CalculateBaseDamage](../../Damage%20pipeline/CalculateBaseDamage.md#piercing) documentation to learn more ### Logic sequence This is done by yield returning the EnemyKabbuDig coroutine with the entity: diff --git a/docs/Battle system/Enemy actions/Enemies/HoloKabbu.md b/docs/Battle system/Enemy actions/Enemies/HoloKabbu.md index 4fb9a4635..fb30377a7 100644 --- a/docs/Battle system/Enemy actions/Enemies/HoloKabbu.md +++ b/docs/Battle system/Enemy actions/Enemies/HoloKabbu.md @@ -1,3 +1,368 @@ # `HoloKabbu` -TODO \ No newline at end of file +## Assumptions +This enemy is assumed to be fought with [HoloVi](HoloVi.md) and [HoloLeif](HoloLeif.md) for certain moves to be usable and for the move selection process to work correctly. + +It is also assume that this enemy's [chargeonotherenemy](../../Actors%20states/Enemy%20features.md#chargeonotherenemy) contains [HoloVi](HoloVi.md) and [HoloLeif](HoloLeif.md) because of specific logic that involves their `hitaction` logic expecting it to be triggered by hitting this enemy (more specifically, an enemy with an [animid](../../../Enums%20and%20IDs/AnimIDs.md) of `Beetle`). + +By the same token, it is assumed that this enemy's `animid` is `Beetle`. + +## `data` usage +At the start of the action, if `data` is null or empty, it's initialised to be 5 element with a starting value of 0. + +- `data[0]`: This reperesents the amount of time some specific moves were used in the battle by incrementing the value on each usage. If the value reaches 5, this enemy will no longer be able to use any moves in the list. Here are the implicated moves: + - Revives [HoloVi](HoloVi.md) and [HoloLeif](HoloLeif.md) from `reservedata` + - Revives another enemy party member from `reservedata` leaving them at 7 `hp` + - Inflict the [Poison](../../Actors%20states/BattleCondition/Poison.md) condition on [HoloVi](HoloVi.md) bypassing the `poisonres` check for 3 main turns. NOTE: For this move specifically, `data[0]` will NOT increment, but the move still won't be used if `data[0]` reaches 5 +- `data[1]`: An actor turn cooldown on the usage of the any moves managed by `data[0]`. On usage of 2 of the 3 moves, the value is set to 3. The value is always decremented in the pre move logic when above 0 and the value must be 0 for any of the 3 moves managed by `data[0]` to be usable. Effectively, it's a 2 actor turns cooldown before any of the 3 moves become usable again. NOTE: The [Poison](../../Actors%20states/BattleCondition/Poison.md) infliction on [HoloVi](HoloVi.md) move exceptionally does NOT change the value of `data[1]` upon usage, but the usage of the move is still forbidden if `data[1]` is above 0 +- `data[2]`: An actor turn cooldown on the usage of the turn relay simulation move. On every usage of the move, the value is set to 3 and it is always decremented in the pre move logic when above 0. For the move to be usable, the value needs to be 0. Effectively, it's a 2 actor turn cooldown on the move before it becomes usable again. NOTE: If [HoloVi](HoloVi.md) uses their turn relay simulation move to this enemy, this enemy's `data[2]` is set to 2 which is a 1 actor turn cooldown on the usage of this enemy's turn relay simulation move +- `data[3]`: This enforces a 1 time usage constraint of the move that revives [HoloVi](HoloVi.md) and [HoloLeif](HoloLeif.md) from `reservedata`. On usage of the move, the value is set to 1 while the move requires a value of 0. This means that once the move is used once in the battle, it is not usable again for the remainder of the battle. In these circumstances, the singular 7 `hp` revive move will be used instead when applicable +- `data[4]`: An actor turn cooldown on the usage of the move with a [Taunted](../../Actors%20states/BattleCondition/Taunted.md) infliction on all player party members for 2 main turns. When the move is used, the value is set to 3 and it is always decremented in the pre move logic if it is above 0. For the move to be usable, the value needs to be 0. Effectively, this is a 2 actor turns cooldown before the move becomes usable again + +## Move selection +10 moves are possible: + +1. A single target horn slash +2. Revives [HoloVi](HoloVi.md) and [HoloLeif](HoloLeif.md) from `reservedata` leaving their at 6 `hp` with canmove (so they can take an actor turn immediately on the same main turn) +3. Revives another enemy party member from `reservedata` leaving them at 7 `hp` with canmove (so they can take an actor turn immediately on the same main turn) +4. Inflict the [Poison](../../Actors%20states/BattleCondition/Poison.md) condition on [HoloVi](HoloVi.md) bypassing the `poisonres` check for 3 main turns (effectively 2 main turns since the current main turn ends soon) +5. Inflicts the [Taunted](../../Actors%20states/BattleCondition/Taunted.md) condition on all player party members for 2 main turns (effectively 1 main turn since the current main turn ends soon) +6. Revives another enemy party member from `reservedata` leaving them at 4 `hp` with canmove (so they can take an actor turn immediately on the same main turn) +7. A party wide dash attack +8. A single target rock throw +9. Simulate a turn relay by decrementing the `cantmove` of [HoloVi](HoloVi.md) or [HoloLeif](HoloLeif.md) which grants them an additional actor turn on this main turn +10. A single target underground strike + +Move 1 is always used if `turns` is 0 (the first main turn). + +Otherwise, the decision of which move to use is based on the weigthed odds. However, these weighted odds have 3 possible distribution sets which will be numbered as follows (the first one that applies is used): + +1. All of the following conditions are fufilled: + - Both [HoloVi](HoloVi.md) and [HoloLeif](HoloLeif.md) are present + - This enemy has no `charge` + - This enemy doesn't have the [AttackUp](../../Actors%20states/BattleCondition/AttackUp.md) condition +2. Both [HoloVi](HoloVi.md) and [HoloLeif](HoloLeif.md) are present, but this enemy either has at least 1 `charge` or it has the [AttackUp](../../Actors%20states/BattleCondition/AttackUp.md) condition +3. Either [HoloVi](HoloVi.md) or [HoloLeif](HoloLeif.md) isn't present (assumed to be dead) + +In all sets, move 2 and 3 belong together as one unit used in the move selection process. To simplify this fact, it will be refered to as move 2-3 when refering to the move selection. + +Also, each moves have additional requirements that if they aren't fufilled, the move won't be used and instead cause a reroll of the move selection process. However the amount of attempts to a move selection is tracked and after 5 failures to select a move, move 1 is always used. + +There is a special case for move 2-3 because when selected, the decision if either move can be used and which one to use is nested inside the main move selection. This means that when move 2-3 is selected, the following decision logic happens to handle this: + +- If both [HoloVi](HoloVi.md) and [HoloLeif](HoloLeif.md) aren't present (assumed to be dead) and `data[3]` is 0 (move 2 wasn't used before), move 2 is always used. Due to `data[3]`, this can only happen once per battle +- If the above conditions aren't fufilled, but the `reservedata` isn't empty still (meaning it's assumed either [HoloVi](HoloVi.md) or [HoloLeif](HoloLeif.md) is dead), move 3 is used +- If none of the conditions above are fufilled, the move selection process is rerolled + +Here are the odds for all distributions sets, their usage requirements and the step to take if those requirements aren't fufilled. + +|Move|Odds set 1|Odds set 2|Odds set 3|Requirements| +|---:|----------|----------|----------|------------| +|1|6/42|6/39|0/11|None, the move is always used when selected|| +|2-3|4/42|2/39|2/11|Also, the decision logic mentioned above applies which has additional requirements| +|4|2/42|1/39|1/11|| +|5|3/42|0/39|1/11|`data[4]` is 0 or less (this move wasn't used in the last 2 actor turns of this enemy)| +|6|3/42|3/39|3/11|`reservedata` isn't empty (there is someone available to be revived)| +|7|9/42|15/39|1/11|None, the move is always used when selected| +|8|6/42|0/39|1/11|None, the move is always used when selected| +|9|3/42|3/39|1/11|| +|10|6/42|6/39|1/11|None, the move is always used when selected| + +As a sidenote, the entire move selection process occurs in the HoloKabbu coroutine who is yield returned by DoAction. + +## Pre move logic +The following logic always happens before the usage of a move (this happens in DoAction, the rest happens in HoloKabbu): + +- entity.`sprite`.material.renderQueue set to 2500 +- CreateShield called on the entity which initialises their `bubbleshield` if it didn't exist yet + +## Move 1 - Horn slash +A single target horn slash. + +### [DoDamage](../../Damage%20pipeline/DoDamage.md) calls + +|#|Conditions|attacker|target|damageammount|property|overrides|block| +|-:|---|---|---|---|---|---|---| +|1|Always happen|`enemydata[actionid]`1|`playertargetID` after [GetSingleTarget](../../Actors%20states/Targetting/GetRandomAvaliablePlayer.md#getsingletarget)|3|[Flip](../../Damage%20pipeline/AttackProperty.md)2|null|`commandsuccess`| + +1: This is incorrect because `actionid` is unused so it's always 0 and under normal gameplay, this enemy should always be `enemydata[1]`. The overall affect is the attacker is incorrectly set to be [HoloVi](HoloVi.md) while `HoloKabbu` should have been the attacker here. + +2: This property gets overriden to null in [CalculateBaseDamage](../../Damage%20pipeline/CalculateBaseDamage.md) as the target is a player party member so it does nothing. + +### Logic sequence +This is done by yield returning the EnemyHeavyStrike coroutine with the battleentity: + +- [GetSingleTarget](../../Actors%20states/Targetting/GetRandomAvaliablePlayer.md#getsingletarget) called +- Camera moves to look near `playerdata[playertargetID]` +- [MoveTowards](../../../Entities/EntityControl/EntityControl%20Methods.md) `playertargetentity` position + (1.5, 0.0, -0.1) with 2.0 multiplier +- Yield all frames until `forcemove` is done +- animstate set to 103 +- `Charge3` sound plays using `sounds[9]` with 1.2 pitch +- ShakeSprite called with intensity (0.25, 0.0, 0.0) and 45.0 frametimer +- Yield for 0.75 seconds +- `sounds[9]` stopped +- animstate set to 104 +- `HugeHit` sound plays +- ShakeScreen called with 0.2 ammount for 0.75 time with dontreset +- DoDamage 1 call happens +- `playertargetentity`'s y `spin` set to 35.0 +- `playertargetentity` has [Jump](../../../Entities/EntityControl/EntityControl%20Methods.md#jump) called on them with an h of 15.0 +- Yield for 0.5 seconds +- Yield all frames until `playertargetentity` is `onground` +- `playertargetentity`'s `spin` zeroed out +- Yield for 0.5 seconds + +## Move 2 - Revives [HoloVi](HoloVi.md) and [HoloLeif](HoloLeif.md) +Revives [HoloVi](HoloVi.md) and [HoloLeif](HoloLeif.md) from `reservedata` leaving their at 6 `hp` with canmove (so they can take an actor turn immediately on the same main turn). No damages are dealt. + +### `dontusecharge` set to true +This move always sets `dontusecharge` to true which means `charges` will not get zeroed out in [post action](../../Battle%20flow/Action%20coroutines/DoAction.md#post-action). + +### Logic sequence + +- Yield return ItemAnim with the battleentity with the `MiracleShake` [item](../../../Enums%20and%20IDs/Items.md): + - animstate set to 4 (`ItemGet`) + - `ItemHold` sound plays + - A new sprite object gets created rooted at this enemy + its `itemoffset` using the item's icon as sprite + - Yield for 1.0 second + - The sprite gets destroyed +- `data[3]` is set to 1 which prevents this move from being used again in the battle (move 3 will be used instead if applicable, see the move selection section above for details) +- `data[0]` is incremented. If it reaches 5, this move, move 3 and move 4 can't be used anymore +- `data[1]` is set to 3 so this move, move 3 and move 4 can't be used for the next 2 actor turns +- For each `reservedata`: + - [ReviveEnemy](../ReviveEnemy.md) called to revive the enemy party member with an hppercent of 6.0 (leaves them at 6 `hp`) with canmove and showcounter +- Yield for 1.0 second + +## Move 3 - Revives another enemy party member with 7 `hp` +Revives another enemy party member from `reservedata` leaving them at 7 `hp` with canmove (so they can take an actor turn immediately on the same main turn). No damages are dealt. + +### `dontusecharge` set to true +This move always sets `dontusecharge` to true which means `charges` will not get zeroed out in [post action](../../Battle%20flow/Action%20coroutines/DoAction.md#post-action). + +### Logic sequence + +- Yield return ItemAnim with the battleentity with the `MagicDrops` [item](../../../Enums%20and%20IDs/Items.md): + - animstate set to 4 (`ItemGet`) + - `ItemHold` sound plays + - A new sprite object gets created rooted at this enemy + its `itemoffset` using the item's icon as sprite + - Yield for 1.0 second + - The sprite gets destroyed +- `data[0]` is incremented. If it reaches 5, this move, move 2 and move 4 can't be used anymore +- `data[1]` is set to 3 so this move, move 2 and move 4 can't be used for the next 2 actor turns +- [ReviveEnemy](../ReviveEnemy.md) called to revive a random `reservedata` with an hppercent of 7.0 (leaves them at 7 `hp`) with canmove and showcounter +- Yield for 1.0 second + +## Move 4 - [Poison](../../Actors%20states/BattleCondition/Poison.md) infliction on [HoloVi](HoloVi.md) +Inflict the [Poison](../../Actors%20states/BattleCondition/Poison.md) condition on [HoloVi](HoloVi.md) bypassing the `poisonres` check for 3 main turns (effectively 2 main turns since the current main turn ends soon). No damages are dealt. + +### `dontusecharge` set to true +This move always sets `dontusecharge` to true which means `charges` will not get zeroed out in [post action](../../Battle%20flow/Action%20coroutines/DoAction.md#post-action). + +### Logic sequence + +- Yield return ItemAnim with the battleentity with the `DangerShroom` [item](../../../Enums%20and%20IDs/Items.md): + - animstate set to 4 (`ItemGet`) + - `ItemHold` sound plays + - A new sprite object gets created rooted at this enemy + its `itemoffset` using the item's icon as sprite + - Yield for 1.0 second + - The sprite gets destroyed +- [StatusEffect](../../Actors%20states/Conditions%20methods/StatusEffect.md) called on [HoloVi](HoloVi.md) to inflict them the [Poison](../../Actors%20states/BattleCondition/Poison.md) condition for 3 main turns without effect with force (effectively for 2 main turns since the current main turn ends soon). This will bypass `poisonres` check +- `Poison` sound plays +- `PoisonEffect` particles plays at [HoloVi](HoloVi.md) position +- Yield return [ItemSpinAnim](../../Visual%20rendering/ItemSpinAnim.md) with a pos of [HoloVi](HoloVi.md) position + 1.0 in y and a sprite of the `PoisonAttacker` [medal](../../../Enums%20and%20IDs/Medal.md) icon + +## Move 5 - Party wide [Taunted](../../Actors%20states/BattleCondition/Taunted.md) infliction +Inflicts the [Taunted](../../Actors%20states/BattleCondition/Taunted.md) condition on all player party members for 2 main turns (effectively 1 main turn since the current main turn ends soon). No damages are dealt. + +### `dontusecharge` set to true +This move always sets `dontusecharge` to true which means `charges` will not get zeroed out in [post action](../../Battle%20flow/Action%20coroutines/DoAction.md#post-action). + +### Logic sequence +This is done by yield returning the EnemyTaunt coroutine with the battleentity with all: + +- `dontusecharge` is set to true +- animstate set to 109 +- Camera moves to look near this enemy +- `Taunt2` sound plays on loop using `sounds[9]` +- Yield for 0.5 seconds +- Yield for 0.25 seconds +- [SetDefaultCamera](../../Visual%20rendering/SetDefaultCamera.md) called +- For each player party members whose `hp` is above 0: + - [SetCondition](../../Actors%20states/Conditions%20methods/SetCondition.md) called to inflict the [Taunted](../../Actors%20states/BattleCondition/Taunted.md) condition on the player party member for 2 main turns (effectively 1 since the main turn advances soon after) + - `Taunt` sound plays + - animstate of the player party member set depending on `playertargetID` (NOTE: This is incorrect because this move isn't single target so the value depends on whatever it happened to be assigned before): + - 0 (`Bee`): 10 (`Flustered`) + - 1 (`Beetle`): 5 (`Angry`) + - 2 (`Moth`): 102 + - `Prefabs/Particles/AngryParticle` instantiated childed to the player party member with local position being Vector3.up + - Yield for 0.5 seconds + - Yield for 0.25 seconds + - `sounds[9]` stopped + - `Prefabs/Particles/AngryParticle` destroyed + - the player party member animstate restored to its value before this action + +Finally, `data[4]` is set to 3 so this move isn't usable for the next 2 actor turns. + +## Move 6 - Revives another enemy party member with 4 `hp` +Revives another enemy party member from `reservedata` leaving them at 4 `hp` with canmove (so they can take an actor turn immediately on the same main turn). No damages are dealt. + +### `dontusecharge` set to true +This move always sets `dontusecharge` to true which means `charges` will not get zeroed out in [post action](../../Battle%20flow/Action%20coroutines/DoAction.md#post-action). + +### Logic sequence +This is done by yield returning the EnemyPepTalk coroutine with the battleentity and targetting a random `reservedata` enemy party member: + +- `dontusecharge` is set to true +- SetCamera called to move the camera without target at the selected `reservedata` with a speed of 0.05 and an offset of (0.0, 2.0, -6.0) which basically zooms in on the target +- [MoveTowards](../../../Entities/EntityControl/EntityControl%20Methods.md#movetowards) the selected `reservedata` + (-1.25, 0.0, -0.1) +- Yield all frames until `forcemove` is done +- `flip` set to true +- `Taunt2` sound plays on loop +- animstate set to 5 (`Angry`) +- Yield for 0.75 seconds +- `Taunt2` sound stops +- Yield return a ShakeSprite call on the selected `reservedata` with an intensity of 0.1 in x for 40.0 framtimer +- [ReviveEnemy](../ReviveEnemy.md) called to revive the target with an hppercent of 4.0 (leaves them at 4 `hp`) with canmove and showcounter +- Yield for 0.5 seconds + +## Move 7 - Party wide dash attack +A party wide dash attack. + +### [PartyDamage](../../Damage%20pipeline/PartyDamage.md) + +|#|Conditions|caller|damage|property|block|jumpheight|spinammount|jumpevenonblock|overrides| +|-:|---------|-----|-------|-------|-----|----------|-----------|--------------|---------| +|1|Always happen|This enemy|3|[Flip](../../Damage%20pipeline/AttackProperty.md)1|`commandsuccess`|0.0|Vector3.zero|false|null| + +1: This property gets overriden to null in [CalculateBaseDamage](../../Damage%20pipeline/CalculateBaseDamage.md) as the target is a player party member so it does nothing. + +### Logic sequence +This is done by yield returning the BeetleDash coroutine with the following parameters: + +- enemyid: This enemy +- damage: 3 +- animprepare: 116 +- animdash: 117 +- startp: This enemy's position +- speed: 29.0 + +This is what the coroutine effectively ends up doing: + +- `playertargetID` set to -1 +- Camera moves slightly to the left +- [MoveTowards](../../../Entities/EntityControl/EntityControl%20Methods.md#movetowards) (-0.5, 0.0, 0.0) at 2.0 multiplier +- Yield all frames until `forcemove` is done +- `Charge3` sound plays using `sounds[9]` with 1.2 pitch +- animstate set to 116 +- ShakeSprite called with (0.25, 0.0, 0.0) intensity and 60.0 frametimer +- Over the course of 41.0 frames, this enemy moves 2.0 to the left via a lerp +- ShakeSprite called with 0.1 intensity and 40.0 frametimer +- Yield for 41.0 frames counted by framestep +- `sounds[9]` stopped +- animstate set to 117 +- `trail` set to true +- `FastWoosh` sound plays +- Over the course of 29.0 frames, this enemy moves to (-15.0, 0.0, 0.0) via a lerp. On the first frame that the x position is less than -4.5, the following happens only once: + - ShakeScreen called with an ammount of (0.25, 0.0, 0.0) for 0.65 time with dontreset + - `HugeHit` sound plays + - PartyDamage 1 call happens +- position set to (15.0, 0.0, 0.0) +- `trail` set to false +- [SetDefaultCamera](../../Visual%20rendering/SetDefaultCamera.md) called +- animstate set to 1 (`Walk`) +- Over the course of 61.0 frames, this enemy moves to startp via a lerp while having its animstate set to 1 (`Walk`) +- `sprite` local position reset to Vector3.zero +- `checkingdead` set to null which signals the caller that this coroutine completed + +## Move 8 - Rock throw +A single target rock throw. + +### `nonphyscal` set to true +This move always sets `nonphyscal` to true which affects the effects of the `FrostBite`, `SpikeBod` and `PoisonTouch` [medal](../../../Enums%20and%20IDs/Medal.md) if equipped on the target + +### [DoDamage](../../Damage%20pipeline/DoDamage.md) calls + +|#|Conditions|attacker|target|damageammount|property|overrides|block| +|-:|---|---|---|---|---|---|---| +|1|Always happen|null|`playertargetID` after [GetSingleTarget](../../Actors%20states/Targetting/GetRandomAvaliablePlayer.md#getsingletarget)|3|null|null|`commandsuccess`| + +### Logic sequence +This is done by yield returning the EnemyPebbleToss coroutine with the battleentity: + +- [GetSingleTarget](../../Actors%20states/Targetting/GetRandomAvaliablePlayer.md#getsingletarget) called +- animstate set to 28 (`TossItem`) +- `Toss` sound plays +- A new sprite object is created rooted at this enemy postion + (0.5, 2.0, -0.1) using the `MightyPeeble` [medal](../../../Enums%20and%20IDs/Medal.md) sprite +- Over the course of 48.0 frames, the `MightyPeeble` sprite moves to `playertargetentity` position + (0.0, 2.0, -0.1) via a BeizierCurve3 with a ymax of 3.5. Before each frame yield, `MightyPeeble`'s z angle increses by 15.0 * framestep +- DoDamage 1 call happens +- `MightyPeeble` object is destroyed +- Yield for 0.5 seconds + +## Move 9 - Decrements the `cantmove` of [HoloVi](HoloVi.md) or [HoloLeif](HoloLeif.md) +Simulate a turn relay by decrementing the `cantmove` of [HoloVi](HoloVi.md) or [HoloLeif](HoloLeif.md) which grants them an additional actor turn on this main turn. No damages are dealt. + +### `dontusecharge` set to true +This move always sets `dontusecharge` to true which means `charges` will not get zeroed out in [post action](../../Battle%20flow/Action%20coroutines/DoAction.md#post-action). + +### Logic sequence +The target is selected randomly between [HoloVi](HoloVi.md) and [HoloLeif](HoloLeif.md). As explained in the move selection above, the target must be present and not be IsStoppedLite (same as [IsStopped](../../Actors%20states/IsStopped.md), but [Flipped](../../Actors%20states/BattleCondition/Flipped.md) doesn't count as stopped). This will assume this is the case: + +- Yield return on EnemyRelay with the battleentity to the target: + - `dontusecharge` set to true + - This enemy animstate set to 4 (`ItemGet`) + - The target animstate set to 2 (`Jump`) + - This enemy's y `spin` set to 15.0 + - The target's y `spin` set to 15.0 + - The target's `cantmove` is decremented which grants them an additional actor turn on this main turn + - `Relay` sound plays + - Yield for 0.5 seconds + - This enemy `spin` zeroed out + - The target `spin` zeroed out + - The target animstate reset to its `basestate` + - This enemy animstate reset to its `basestate` +- `data[2]` set to 3 so this move isn't usable for the next 2 actor turns +- If the target of the move's `data` isn't yet initialised, it is initialised to 10 blank slots (even if not all of them will be used) +- The target's `data[2]` is set to 2 which prevents them from using their version of this move on the current main turn + +## Move 10 - Underground strike +A single target underground strike. + +### [DoDamage](../../Damage%20pipeline/DoDamage.md) calls + +|#|Conditions|attacker|target|damageammount|property|overrides|block| +|-:|---|---|---|---|---|---|---| +|1|Always happen|`enemydata[actionid]`1|`playertargetID` after [GetSingleTarget](../../Actors%20states/Targetting/GetRandomAvaliablePlayer.md#getsingletarget)|4|[Pierce](../../Damage%20pipeline/AttackProperty.md)2|null|`commandsuccess`| + +1: This is incorrect because `actionid` is unused so it's always 0 and under normal gameplay, this enemy should always be `enemydata[1]`. The overall affect is the attacker is incorrectly set to be [HoloVi](HoloVi.md) while `HoloKabbu` should have been the attacker here. + +2: Enemy piercing damages are disabled so this property does nothing, see the [CalculateBaseDamage](../../Damage%20pipeline/CalculateBaseDamage.md#piercing) documentation to learn more + +### Logic sequence +This is done by yield returning the EnemyKabbuDig coroutine with the battleentity: + +- [GetSingleTarget](../../Actors%20states/Targetting/GetRandomAvaliablePlayer.md#getsingletarget) called +- `Dig` sound plays +- animstate set to 101 +- `digging` set to true +- Yield for 0.65 seconds +- Camera moves to look near `playerdata[playertargetID]` +- [MoveTowards](../../../Entities/EntityControl/EntityControl%20Methods.md) `playertargetentity` position with 2.0 multiplier +- `Digging` sound plays on loop using `sounds[9]` +- Yield all frames until `forcemove` is done +- Yield for 0.25 seconds +- ShakeScreen called with 0.1 ammount for 0.75 time with dontreset +- `sounds[9]` stopped +- DoDamage 1 call happens +- [SetDefaultCamera](../../Visual%20rendering/SetDefaultCamera.md) called +- `digging` set to false +- `sprite` angles reset to Vector3.zero +- y `spin` set to 20.0 +- animstate set to 119 +- `sprite` scale set to `startscale` +- `DigPop` sound plays +- `DirtExplode` particles plays at `playertargetentity` position +- Over the course of 46.0 frames, this enemy moves to the value before this coroutine + Vector3.up via a BeizierCurve3 with a ymax of 0.0 +- position set to the value before this coroutine +- animstate set to 13 (`BattleIdle`) +- SetAnimForce called +- `spin` zeroed out diff --git a/docs/Battle system/Enemy actions/Enemies/HoloLeif.md b/docs/Battle system/Enemy actions/Enemies/HoloLeif.md index ad171d607..4e6f5e0ac 100644 --- a/docs/Battle system/Enemy actions/Enemies/HoloLeif.md +++ b/docs/Battle system/Enemy actions/Enemies/HoloLeif.md @@ -1,3 +1,424 @@ # `HoloLeif` -TODO \ No newline at end of file +## Assumptions +This enemy is assumed to be fought with [HoloVi](HoloVi.md) and [HoloKabbu](HoloKabbu.md) for certain moves to be usable and for the move selection process to work correctly. + +## `data` usage +At the start of the action, if `data` is null or empty, it's initialised to be 5 element with a starting value of 0. + +- `data[0]`: This reperesents the amount of time some specific moves were used in the battle by incrementing the value on each usage. If the value reaches 5, this enemy will no longer be able to use any moves in the list. Here are the implicated moves: + - Revives another enemy party member from `reservedata` + - Heal another enemy party member for 7 `hp` + - A single target attack involving the same effects as the [LongLegSummoner](../../Player%20actions/Items%20usage/LonglegSummoner.md) action where the target is a player party member +- `data[1]`: An actor turn cooldown on the usage of the any moves managed by `data[0]`. On usage of any of these moves, the value is set to 3. The value is always decremented in the pre move logic when above 0 and the value must be 0 for any of the 3 moves managed by `data[0]` to be usable. Effectively, it's a 2 actor turns cooldown before any of the 3 moves become usable again +- `data[2]`: UNUSED. This is because that's because this enemy doesn't have a turn relay simulation move unlike [HoloVi](HoloVi.md) and [HoloKabbu](HoloKabbu.md). Since these 2 enemnies still needs to set `data[2]` on the receiver of the relay, this slot is allocated, but not used in any way. It is only set when either of these 2 enemies uses their turn relay simulation move to 2 and it is decremented at the start of the actor turn if above 0, but it is not used to influence move selection +- `data[3]`: An actor turn cooldown on the usage of some specific moves. The value is always decremented in the pre move logic when above 0 and the value must be 0 for any of moves to be usable. It is set to 2 every time any of the moves is used. Effectively, it's a 1 actor turn cooldown before any of the moves become usable again. Here are the affected moves: + - Gives the [AttackUp](../../Actors%20states/BattleCondition/AttackUp.md) condition to all enemy party members including themselves + - Gives the [Shield](../../Actors%20states/BattleCondition/Shield.md) condition on an enemy party member + - Gives the [AttackDown](../../Actors%20states/BattleCondition/AttackDown.md) condition to all alive player party members + - Gives the [DefenseUp](../../Actors%20states/BattleCondition/DefenseUp.md) condition to all enemy party members + - Gives the [DefenseDown](../../Actors%20states/BattleCondition/DefenseDown.md) condition to all alive player party members +- `data[4]`: UNUSED. The only thing that happens with this value is it is decremented at the start of the actor turn if above 0, but it is never set to a value above it and it is not used in any way + +## [hitaction](../../Battle%20flow/Update%20flows/Controlled%20flow.md#enemies-hitaction) support +This enemy supports `hitaction` logic and it will be performed when `hitaction` is true instead of any moves. + +### `dontusecharge` set to true +This move always sets `dontusecharge` to true which means `charges` will not get zeroed out in [post action](../../Battle%20flow/Action%20coroutines/DoAction.md#post-action). + +### Logic sequence +The following all happens in the HoloLeif coroutine: + +- The first `enemydata` with an [animid](../../../Enums%20and%20IDs/AnimIDs.md) of `Beetle` is obtained (should be [HoloKabbu](HoloKabbu.md) under normal gameplay) and if it exists, [ItemSpinAnim](../../Visual%20rendering/ItemSpinAnim.md) is called on them with a pos of their position + 1.0 in y using the `FavoriteOne` [medal](../../../Enums%20and%20IDs/Medal.md) icon as sprite and without playSound +- Yield return on a EnemyAngryCharge call with this enemy's battleentity: + - Set `dontusecharge` to true + - If `charge` is less than 3, it is incremented with the following: + - animstate set to 102 + - `Wam` sound plays + - [Emoticon](../../../Entities/EntityControl/EntityControl%20Methods.md#emoticon) called on this enemy with the `Exclamation` emote with 20 time + - Yield all frames until `emoticoncooldown` expires + - `StatUp` sound plays + - [StatEffect](../../Visual%20rendering/StatEffect.md) called on this enemy with type 4 (green up arrow) + - Yield for 0.5 seconds + - `charge` is incremented + +## Move selection +12 moves are possible: + +1. A single target ice attack +2. Revives another enemy party member from `reservedata` leaving them at 7 `hp` with canmove (so they can take an actor turn immediately on the same main turn) +3. Heal an enemy party member (including themselves) for 7 `hp` +4. A single target attack involving the same effects as the [LongLegSummoner](../../Player%20actions/Items%20usage/LonglegSummoner.md) action where the target is a player party member +5. A party wide icicle throw +6. Gives the [AttackUp](../../Actors%20states/BattleCondition/AttackUp.md) condition to all enemy party members including themselves for 3 main turns (effectively 2 main turns since the current main turn ends soon) +7. A multiple hits icicle fall attack that hits 4 times where each hit is single target +8. Calls [ClearStatus](../../Actors%20states/Conditions%20methods/ClearStatus.md) on a player party member +9. Gives the [Shield](../../Actors%20states/BattleCondition/Shield.md) condition on an enemy party member (including themselves) +10. Gives the [AttackDown](../../Actors%20states/BattleCondition/AttackDown.md) condition to all alive player party members for 3 main turns (effectively 2 main turns since the current main turn ends soon) +11. Gives the [DefenseUp](../../Actors%20states/BattleCondition/DefenseUp.md) condition to all enemy party members including themselves for 3 main turns (effectively 2 main turns since the current main turn ends soon) +12. Gives the [DefenseDown](../../Actors%20states/BattleCondition/DefenseDown.md) condition to all alive player party members for 3 main turns (effectively 2 main turns since the current main turn ends soon) + +If `turns` is 0 (the first main turn), the selected move is alwauys deterministic and is determined with the following logic: + +- If this enemy's `cantmove` is -1, move 6 is used. This means this enemy has 2 actor turns available which can only happen if [HoloVi](HoloVi.md) or [HoloKabbu](HoloKabbu.md) used their turn relay simulation move on this enemy on the first main turn +- Otherwise, move 5 is used + +Otherwise (not on the first main turn), the decision of which move to use is based on weighted odds. However, these weights have 2 possible distribution sets which will be numbered as follows: + +1. [HoloVi](HoloVi.md) is present (assumed to not be dead yet) +2. [HoloVi](HoloVi.md) is not present (assumed to be dead) + +Also, each moves have additional requirements that if they aren't fufilled, the move won't be used and instead cause a reroll of the move selection process. However the amount of attempts to a move selection is tracked and after 5 failures to select a move, move 1 is always used. + +Here are the odds for all distributions sets, their usage requirements and the step to take if those requirements aren't fufilled. + +|Move|Odds set 1|Odds set 2|Requirements| +|---:|----------|----------|------------| +|1|0/32|8/60|None, the move is always used when selected| +|2|2/32|2/60|| +|3|1/32|1/60|| +|4|1/32|1/60|None, the move is always used when selected| +|5|2/32|8/60|None, the move is always used when selected| +|6|4/32|4/60|`data[3]` is 0 or less (move 6, 9, 10, 11 and 12 weren't used on the last actor turn of this enemy)| +|7|2/32|20/60|None, the move is always used when selected| +|8|4/32|4/60|There is at least 1 player party member whose `hp` is above 0 and either they have more than 0 `charge` or they have the [AttackUp](../../Actors%20states/BattleCondition/AttackUp.md) condition| +|9|4/32|4/60|`data[3]` is 0 or less (move 6, 9, 10, 11 and 12 weren't used on the last actor turn of this enemy)| +|10|4/32|4/60|`data[3]` is 0 or less (move 6, 9, 10, 11 and 12 weren't used on the last actor turn of this enemy)| +|11|4/32|4/60|`data[3]` is 0 or less (move 6, 9, 10, 11 and 12 weren't used on the last actor turn of this enemy)| +|12|4/32|0/60|`data[3]` is 0 or less (move 6, 9, 10, 11 and 12 weren't used on the last actor turn of this enemy)| + +As a sidenote, the entire move selection process occurs in the HoloLeif coroutine who is yield returned by DoAction. + +## Pre move logic +The following logic always happens before the usage of a move (this happens in DoAction, the rest happens in HoloLeif): + +- entity.`sprite`.material.renderQueue set to 2500 +- CreateShield called on the entity which initialises their `bubbleshield` if it didn't exist yet + +## Move 1 - Single target ice attack with potential [Freeze](../../Actors%20states/BattleCondition/Freeze.md) infliction +A single target ice attack. + +### `nonphyscal` set to true +This move always sets `nonphyscal` to true which affects the effects of the `FrostBite`, `SpikeBod` and `PoisonTouch` [medal](../../../Enums%20and%20IDs/Medal.md) if equipped on the target. + +### [DoDamage](../../Damage%20pipeline/DoDamage.md) calls + +|#|Conditions|attacker|target|damageammount|property|overrides|block| +|-:|---|---|---|---|---|---|---| +|1|Always happen|This enemy|`playertargetID` after [GetSingleTarget](../../Actors%20states/Targetting/GetRandomAvaliablePlayer.md#getsingletarget)|3|[Freeze](../../Damage%20pipeline/AttackProperty.md)|null|`commandsuccess`| + +### Logic sequence +This is done by yield returning the EnemyIceAttackBasic coroutine with the battleentity: + +- [GetSingleTarget](../../Actors%20states/Targetting/GetRandomAvaliablePlayer.md#getsingletarget) +- animstate set to 108 +- `IceMothThrow` sound plays +- A new `Prefabs/Objects/SingleSphere` GameObject is created childed to a new `Prefabs/AnimSpecific/mothbattlesphere` GameObject +- Over the course of 31.0 frames, the `Prefabs/AnimSpecific/mothbattlesphere` moves from this enemy position + (1.1, 1.85, -0.1) to this enemy position + (-2.0, -0.5, 5.0) via a BeizierCurve3 with a ymax of 5.0 +- The `Prefabs/Objects/SingleSphere` gets rooted +- If `hologram` is true, the `Prefabs/Objects/SingleSphere` Renderer's color is set to 8080FF (mostly blue) with half opacity +- `Prefabs/AnimSpecific/mothbattlesphere` gets destroyed +- `WatcherIce` sound plays +- Over the course of 81.0 frames (71.0 instead if hardmode is true), `Prefabs/Objects/SingleSphere` moves from its position with the y component at 0.0 to `playertargetentity` position via a SmoothLerp +- `Prefabs/Objects/SingleSphere` gets destroyed +- animstate set to 111 +- `IceMothHit` sound plays +- A new `Prefabs/Particles/mothicenormal` GameObject is created rooted at `playertargetentity` position + 0.5 in y then destroyed in 2.0 seconds +- A new `Prefabs/Objects/icepillar` is created rooted at `playertargetentity` position with a DialogueAnim that has a `targetscale` of (0.5, 0.5, 1.0) +- DoDamage 1 call happens +- Yield for 0.65 seconds +- The `Prefabs/Objects/icepillar`'s DialogueAnim has its `shrink` set to true with a `shrinkspeed` of 0.025 +- The `Prefabs/Objects/icepillar` gets destroyed in 5.0 seconds +- Yield for 0.5 seconds + +## Move 2 - Revives another enemy party member with 7 `hp` +Revives another enemy party member from `reservedata` leaving them at 7 `hp` with canmove (so they can take an actor turn immediately on the same main turn). No damages are dealt. + +### `dontusecharge` set to true +This move always sets `dontusecharge` to true which means `charges` will not get zeroed out in [post action](../../Battle%20flow/Action%20coroutines/DoAction.md#post-action). + +### Logic sequence + +- Yield return ItemAnim with the battleentity with the `MagicDrops` [item](../../../Enums%20and%20IDs/Items.md): + - animstate set to 4 (`ItemGet`) + - `ItemHold` sound plays + - A new sprite object gets created rooted at this enemy + its `itemoffset` using the item's icon as sprite + - Yield for 1.0 second + - The sprite gets destroyed +- `data[0]` is incremented. If it reaches 5, this move, move 2 and move 4 can't be used anymore +- `data[1]` is set to 3 so this move, move 2 and move 4 can't be used for the next 2 actor turns +- [ReviveEnemy](../ReviveEnemy.md) called to revive a random `reservedata` with an hppercent of 7.0 (leaves them at 7 `hp`) with canmove and showcounter +- Yield for 1.0 second + +## Move 3 - Heal another enemy party member for 7 `hp` +Heal an enemy party member (including themselves) for 7 `hp`. No damages are dealt. + +### `dontusecharge` set to true +This move always sets `dontusecharge` to true which means `charges` will not get zeroed out in [post action](../../Battle%20flow/Action%20coroutines/DoAction.md#post-action). + +### Logic sequence + +- Yield return ItemAnim with the battleentity with the `JaydeStew` [item](../../../Enums%20and%20IDs/Items.md): + - animstate set to 4 (`ItemGet`) + - `ItemHold` sound plays + - A new sprite object gets created rooted at this enemy + its `itemoffset` using the item's icon as sprite + - Yield for 1.0 second + - The sprite gets destroyed +- `data[0]` is incremented. If it reaches 5, this move, move 2 and move 4 can't be used anymore +- `data[1]` is set to 3 so this move, move 2 and move 4 can't be used for the next 2 actor turns +- [Heal](../../Actors%20states/Heal.md) called on a random enemy party member to heal them for 7 `hp`. The selection of the enemy party member to heal only includes those whose `hp` is above 0, but their [HPPercent](../../Actors%20states/HPPercent.md) is less than 0.8 (this includes this enemy) +- Yield for 1.0 second + +## Move 4 - [LongLegSummoner](../../Player%20actions/Items%20usage/LonglegSummoner.md) equivalent action +A single target attack involving the same effects as the [LongLegSummoner](../../Player%20actions/Items%20usage/LonglegSummoner.md) action where the target is a player party member. + +### `dontusecharge` set to true +This move always sets `dontusecharge` to true which means `charges` will not get zeroed out in [post action](../../Battle%20flow/Action%20coroutines/DoAction.md#post-action). + +### [DoDamage](../../Damage%20pipeline/DoDamage.md) calls + +|#|Conditions|attacker|target|damageammount|property|overrides|block| +|-:|---|---|---|---|---|---|---| +|1|Always happen|null|`playerdata[playertargetID]` after [GetSingleTarget](../../Actors%20states/Targetting/GetRandomAvaliablePlayer.md#getsingletarget)|6|[Flip](../../Damage%20pipeline/AttackProperty.md)1|empty array|`commandsuccess`| + +1: This property gets overriden to null in [CalculateBaseDamage](../../Damage%20pipeline/CalculateBaseDamage.md) as the target is a player party member so it does nothing. + +### Logic sequence + +- Yield return ItemAnim with the battleentity with the `LonglegSummoner` [item](../../../Enums%20and%20IDs/Items.md): + - animstate set to 4 (`ItemGet`) + - `ItemHold` sound plays + - A new sprite object gets created rooted at this enemy + its `itemoffset` using the item's icon as sprite + - Yield for 1.0 second + - The sprite gets destroyed +- [GetSingleTarget](../../Actors%20states/Targetting/GetRandomAvaliablePlayer.md#getsingletarget) called +- Yield return a LongLeg coroutine with this enemy's battleentity and `playerdata[playertargetID]` as the target: + - Camera moves slowly towards the target slightly to the left, up and behind + - animstate set to 28 (`TossItem`) + - A new sprite is created rooted using the `LonglegSummoner` [item](../../../Enums%20and%20IDs/Items.md)'s sprite positioned at this enemy + (0.25, 2.25, -0.1) + - `Toss` sound plays + - Over the course of 51.0 frames, the sprite moves to the target position + (1.5, 0.0, 1.25) via a BeizierCurve3 with a ymax of 5.0. Before each frame yield, the sprite's z angle is increased by 10.0 * MainManager.`framestep` + - animstate reset to the value before this action + - `LongLegsGrow` sound plays + - `Prefabs/Objects/LongLegs` instantiated offscreen with 0.0x scale + - DeathSmoke particles plays at the sprite position + - The sprite is destroyed + - Yield for a frame + - `Prefabs/Objects/LongLegs` position set to where the sprite was before its destruction + - Over the course of 31.0 frames, the `Prefabs/Objects/LongLegs` moves to + 4.75 in y via a SmoothLerp and its scale changes to (1.0, 1.0, -1.0) via a SmoothLerp + - The `Stomp` animation clip plays from `Prefabs/Objects/LongLegs` + - `Grow1` sound plays + - Yield for 0.75 seconds + - The `Stomp2` animation clip plays from `Prefabs/Objects/LongLegs` + - `longLegsStomp` sound plays + - Yield for 0.15 seconds + - DoDamage 1 call happens + - Yield for 0.75 seconds + - Over the course of 31.0 frames, the `Prefabs/Objects/LongLegs` moves to - 4.75 in y via a SmoothLerp and its scale changes to 0.0x via a SmoothLerp + - DeathSmoke particles plays at the `Prefabs/Objects/LongLegs` position + - `ChargeDown2` sound plays + - `Prefabs/Objects/LongLegs` is destroyed + - Yield for 0.5 seconds + - `checkingdead` is set to null which signals the caller that the coroutine is done +- `data[0]` is incremented. If it reaches 5, this move, move 2 and move 4 can't be used anymore +- `data[1]` is set to 3 so this move, move 2 and move 4 can't be used for the next 2 actor turns + +## Move 5 - Party wide icicle throw with potential [Freeze](../../Actors%20states/BattleCondition/Freeze.md) infliction +A party wide icicle throw. + +### `nonphyscal` set to true +This move always sets `nonphyscal` to true which affects the effects of the `FrostBite`, `SpikeBod` and `PoisonTouch` [medal](../../../Enums%20and%20IDs/Medal.md) if equipped on the target. + +### [PartyDamage](../../Damage%20pipeline/PartyDamage.md) + +|#|Conditions|caller|damage|property|block|jumpheight|spinammount|jumpevenonblock|overrides| +|-:|---------|-----|-------|-------|-----|----------|-----------|--------------|---------| +|1|Always happen|This enemy|4|[Freeze](../../Damage%20pipeline/AttackProperty.md)|`commandsuccess`|0.0|Vector3.zero|false|null| + +### Logic sequence +This is done by yield returning the EnemyIceFall coroutine with the battleentity: + +- animstate set to 105 +- A new `Prefabs/Objects/icecle` GameObject is created rooted positioned at this enemy position + (-2.0, 4.5, 0.0) with a scale of 0.0x and its BoxCollider destroyed +- `Spin` sound plays on loop using `sounds[8]` +- Over the course of 60.0 frames, `Prefabs/Objects/icecle` scale changes to 1.25x via a lerp, the y angle goes towards 10.0 and the `sounds[8]` pitch changes from 0.0 to 1.0 +- A new UI object is created named `t` childed to the `GUICamera` using the `guisprites[41]` sprite (a crosshair) on layer 15 (`3DUI`) +- animstate set to 107 +- `Crosshair` sound plays on loop using `sounds[9]` with 0.9 pitch and 0.35 volume +- Over the course of 81.0 frames, `t` moves from (0.0, 3.0, 0.0) to (-4.5, 1.0, 0.0) via a SmoothLerp + a number in the y component that goes from Sin(Time.time * 2.0) * -3.0 to 0.0. Before each yield, `t` z angle increases by 5x the game's frametime and `Prefabs/Objects/icecle` y angles increases by 10.0 +- `sounds[8]` and `sounds[9]` stopped +- `IceMothThrow` sound plays +- `t` gets destroyed +- `Prefabs/Objects/icecle` angles set to (0.0, 0.0, -45.0) +- Over the course of 26.0 frames, `Prefabs/Objects/icecle` moves to (-4.5, 1.0, 0.0) via a lerp +- `IceMothHit` sound plays +- `mothicenormal` particles plays at the `Prefabs/Objects/icecle` position with a scale of 2.0x +- `Prefabs/Objects/icecle` gets destroyed +- PartyDamage 1 call happens +- Yield for 0.5 seconds + +## Move 6 - Enemy party wide [AttackUp](../../Actors%20states/BattleCondition/AttackUp.md) infliction +Gives the [AttackUp](../../Actors%20states/BattleCondition/AttackUp.md) condition to all enemy party members including themselves for 3 main turns (effectively 2 main turns since the current main turn ends soon). No damages are dealt. + +### `dontusecharge` set to true +This move always sets `dontusecharge` to true which means `charges` will not get zeroed out in [post action](../../Battle%20flow/Action%20coroutines/DoAction.md#post-action). + +### Logic sequence +This is done by yield returning the EnemyLeifBuffDebuff coroutine with the battleentity and the type being the `EmpowerPlus` [Skill](../../../Enums%20and%20IDs/Skills.md): + +- `dontusecharge` is set to true +- `Magic` sound plays +- `Prefabs/Particles/MagicUp` instantiated rooted at this enemy + 0.5 in y +- animstate set to 4 (`ItemGet`) +- y `spin` set to -20.0 (this is ignored soon) +- All enemy party members (including this enemy) has their y `spin` set to -15.0 +- Yield for 0.75 seconds +- All enemy party members (including this enemy) has their `spin` zeroed out followed by [StatusEffect](../../Actors%20states/Conditions%20methods/StatusEffect.md) called on them to give them the [AttackUp](../../Actors%20states/BattleCondition/AttackUp.md) condition for 3 main turns with effect (effectively 2 main turns since the current main turn ends soon) +- `Prefabs/Particles/MagicUp` moved offscreen at 999.0 in y +- `spin` zeroed out +- `Prefabs/Particles/MagicUp` destroyed in 5.0 seconds + +After the yield return, `data[3]` is set to 2 so this move alongside move 9, 10, 11 and 12 can't be used on the next actor turn. + +## Move 7 - Multiple hits icicle fall attack with potential [Freeze](../../Actors%20states/BattleCondition/Freeze.md) infliction +A multiple hits icicle fall attack that hits 4 times where each hit is single target. + +### [DoDamage](../../Damage%20pipeline/DoDamage.md) calls + +|#|Conditions|attacker|target|damageammount|property|overrides|block| +|-:|---|---|---|---|---|---|---| +|1|Always happen 4 times, but each call can only happen if at least 1 player party member is alive (`hp` more than 0 and not [eatenby](../../Actors%20states/BattleCondition/Eaten.md#eatenby-influences))|This enemy|`playertargetID` after [GetSingleTarget](../../Actors%20states/Targetting/GetRandomAvaliablePlayer.md#getsingletarget) (target changes for each calls)|5|[Freeze](../../Damage%20pipeline/AttackProperty.md)|null|`commandsuccess`| + +### Logic sequence +This is done by yield returning the EnemyIceRain coroutine with the battleentity: + +- Some camera fields changes to look closer to the player party: + - `camoffset`: increases by (-1.5, 1.25, 1.0) + - `camtargetpos`: Vector3.zero +- animstate set to 105 +- Yield for 0.5 seconds +- The following happens up to 4 times (the iteration doesn't happen if all player party member have an `hp` of 0 or are [eatenby](../../Actors%20states/BattleCondition/Eaten.md#eatenby-influences)): + - [GetSingleTarget](../../Actors%20states/Targetting/GetRandomAvaliablePlayer.md#getsingletarget) called + - `Prefabs/Objects/icecle` instantiated rooted at (`playertargetentity` x position, 15.0, 0.0) + - `Toss4` sound plays + - animstate set to 100 + - Over the course of 50.0 frames, `Prefabs/Objects/icecle` position is lerped to `playertargetentity` position + 1.0 in y + - DoDamage 1 call happens + - `mothicenormal` particles plays at `playertargetentity` position + 1.0 in y with a scale of 2.0x + - `IceMothHit` sound plays + - `Prefabs/Objects/icecle` gets destroyed + - Yield for 0.33 seconds + - animstate set to 105 +- animstate set to 102 +- Yield for 0.5 seconds + +## Move 8 - [ClearStatus](../../Actors%20states/Conditions%20methods/ClearStatus.md) on a player party member +Calls [ClearStatus](../../Actors%20states/Conditions%20methods/ClearStatus.md) on a player party member. No damages are dealt. + +### `dontusecharge` set to true +This move always sets `dontusecharge` to true which means `charges` will not get zeroed out in [post action](../../Battle%20flow/Action%20coroutines/DoAction.md#post-action). + +### Logic sequence + +- Select a random player party members as the target that fufill all of the following conditiosn (as explained in the move selection above, at least one target exists for this move to be used): + - Their `hp` is above 0 + - They either have more than 0 `charge` or they have the [AttackUp](../../Actors%20states/BattleCondition/AttackUp.md) condition +- This enemy animstate set to 111 +- `FastWoosh` sound plays +- Yield for 0.5 seconds +- `Heal3` sound plays +- The target animstate set to 11 (`Hurt`) +- [ClearStatus](../../Actors%20states/Conditions%20methods/ClearStatus.md) called on the target +- DeathSmoke particles plays at the target position with a size of 3.0x +- Yield for 1.0 second + +## Move 9 - [Shield](../../Actors%20states/BattleCondition/Shield.md) infliction on another enemy party member +Gives the [Shield](../../Actors%20states/BattleCondition/Shield.md) condition on an enemy party member (including themselves). No damages are dealt. + +### `dontusecharge` set to true +This move always sets `dontusecharge` to true which means `charges` will not get zeroed out in [post action](../../Battle%20flow/Action%20coroutines/DoAction.md#post-action). + +### Logic sequence + +- `data[3]` is set to 2 so this move alongside move 6, 10, 11 and 12 can't be used on the next actor turn +- Some camera fields changes to look closer at this enemy: + - `camtargetpos`: This enemy position + 2.0 in x + - `camspeed`: 0.01 + - `camoffset`: (0.0, 2.65, -7.0) +- animstate set to 102 +- Yield for 0.75 seconds +- animstate set to 119 +- Yield for 0.25 seconds +- [SetDefaultCamera](../../Visual%20rendering/SetDefaultCamera.md) called +- `Shield` sound played +- [SetCondition](../../Actors%20states/Conditions%20methods/SetCondition.md) called to give the [Shield](../../Actors%20states/BattleCondition/Shield.md) condition to a random enemy party member whose `hp` is above 0 (including themselves) for 2 main turns (effectively 1 main turn since the current main turn ends soon) +- Yield for 0.75 seconds + +## Move 10 - Player party wide [AttackDown](../../Actors%20states/BattleCondition/AttackDown.md) infliction +Gives the [AttackDown](../../Actors%20states/BattleCondition/AttackDown.md) condition to all alive player party members for 3 main turns (effectively 2 main turns since the current main turn ends soon). No damages are dealt. + +### `dontusecharge` set to true +This move always sets `dontusecharge` to true which means `charges` will not get zeroed out in [post action](../../Battle%20flow/Action%20coroutines/DoAction.md#post-action). + +### Logic sequence +This is done by yield returning the EnemyLeifBuffDebuff coroutine with the battleentity and the type being the `AttackDownPlus` [Skill](../../../Enums%20and%20IDs/Skills.md): + +- `dontusecharge` is set to true +- `Magic` sound plays +- `Prefabs/Particles/MagicUp` instantiated rooted at this enemy + 0.5 in y +- animstate set to 4 (`ItemGet`) +- y `spin` set to -20.0 (this is ignored soon) +- All alive player party members (`hp` above 0 and not [eatenby](../../Actors%20states/BattleCondition/Eaten.md#eatenby-influences)) has their y `spin` set to -15.0 +- Yield for 0.75 seconds +- All alive player party members (`hp` above 0 and not [eatenby](../../Actors%20states/BattleCondition/Eaten.md#eatenby-influences)) has their `spin` zeroed out followed by [StatusEffect](../../Actors%20states/Conditions%20methods/StatusEffect.md) called on them to give them the [AttackDown](../../Actors%20states/BattleCondition/AttackDown.md) condition for 3 main turns with effect (effectively 2 main turns since the current main turn ends soon) +- `Prefabs/Particles/MagicUp` moved offscreen at 999.0 in y +- `spin` zeroed out +- `Prefabs/Particles/MagicUp` destroyed in 5.0 seconds + +After the yield return, `data[3]` is set to 2 so this move alongside move 6, 9, 11 and 12 can't be used on the next actor turn. + +## Move 11 - Enemy party wide [DefenseUp](../../Actors%20states/BattleCondition/DefenseUp.md) infliction +Gives the [DefenseUp](../../Actors%20states/BattleCondition/DefenseUp.md) condition to all enemy party members including themselves for 3 main turns (effectively 2 main turns since the current main turn ends soon). No damages are dealt. + +### `dontusecharge` set to true +This move always sets `dontusecharge` to true which means `charges` will not get zeroed out in [post action](../../Battle%20flow/Action%20coroutines/DoAction.md#post-action). + +### Logic sequence +This is done by yield returning the EnemyLeifBuffDebuff coroutine with the battleentity and the type being the `DefenseUpPlus` [Skill](../../../Enums%20and%20IDs/Skills.md): + +- `dontusecharge` is set to true +- `Magic` sound plays +- `Prefabs/Particles/MagicUp` instantiated rooted at this enemy + 0.5 in y +- animstate set to 4 (`ItemGet`) +- y `spin` set to -20.0 (this is ignored soon) +- All enemy party members (including this enemy) has their y `spin` set to -15.0 +- Yield for 0.75 seconds +- All enemy party members (including this enemy) has their `spin` zeroed out followed by [StatusEffect](../../Actors%20states/Conditions%20methods/StatusEffect.md) called on them to give them the [DefenseUp](../../Actors%20states/BattleCondition/DefenseUp.md) condition for 3 main turns with effect (effectively 2 main turns since the current main turn ends soon) +- `Prefabs/Particles/MagicUp` moved offscreen at 999.0 in y +- `spin` zeroed out +- `Prefabs/Particles/MagicUp` destroyed in 5.0 seconds + +After the yield return, `data[3]` is set to 2 so this move alongside move 6, 9, 10 and 12 can't be used on the next actor turn. + +## Move 12 - Player party wide [DefenseDown](../../Actors%20states/BattleCondition/DefenseDown.md) infliction +Gives the [DefenseDown](../../Actors%20states/BattleCondition/DefenseDown.md) condition to all alive player party members for 3 main turns (effectively 2 main turns since the current main turn ends soon). No damages are dealt. + +### `dontusecharge` set to true +This move always sets `dontusecharge` to true which means `charges` will not get zeroed out in [post action](../../Battle%20flow/Action%20coroutines/DoAction.md#post-action). + +### Logic sequence +This is done by yield returning the EnemyLeifBuffDebuff coroutine with the battleentity and the type being the `DefenseBreakAll` [Skill](../../../Enums%20and%20IDs/Skills.md): + +- `dontusecharge` is set to true +- `Magic` sound plays +- `Prefabs/Particles/MagicUp` instantiated rooted at this enemy + 0.5 in y +- animstate set to 4 (`ItemGet`) +- y `spin` set to -20.0 (this is ignored soon) +- All alive player party members (`hp` above 0 and not [eatenby](../../Actors%20states/BattleCondition/Eaten.md#eatenby-influences)) has their y `spin` set to -15.0 +- Yield for 0.75 seconds +- All alive player party members (`hp` above 0 and not [eatenby](../../Actors%20states/BattleCondition/Eaten.md#eatenby-influences)) has their `spin` zeroed out followed by [StatusEffect](../../Actors%20states/Conditions%20methods/StatusEffect.md) called on them to give them the [DefenseDown](../../Actors%20states/BattleCondition/DefenseDown.md) condition for 3 main turns with effect (effectively 2 main turns since the current main turn ends soon) +- `Prefabs/Particles/MagicUp` moved offscreen at 999.0 in y +- `spin` zeroed out +- `Prefabs/Particles/MagicUp` destroyed in 5.0 seconds + +After the yield return, `data[3]` is set to 2 so this move alongside move 6, 9, 10 and 11 can't be used on the next actor turn. diff --git a/docs/Battle system/Enemy actions/Enemies/HoloVi.md b/docs/Battle system/Enemy actions/Enemies/HoloVi.md index b538d426f..a50008aa5 100644 --- a/docs/Battle system/Enemy actions/Enemies/HoloVi.md +++ b/docs/Battle system/Enemy actions/Enemies/HoloVi.md @@ -1,3 +1,371 @@ # `HoloVi` -TODO +## Assumptions +This enemy is assumed to be fought with [HoloKabbu](HoloKabbu.md) and [HoloLeif](HoloLeif.md) for certain moves to be usable and for the move selection process to work correctly. + +It is also loosely assumed that this enemy has [PoisonDamUp](../../Damage%20pipeline/AttackProperty.md) in their [weakness](../../Actors%20states/Enemy%20features.md#weakness). This is because [HoloKabbu](HoloKabbu.md) features a move that can inflict the [Poison](../../Actors%20states/BattleCondition/Poison.md) condition on this enemy which is logically intended to be paired with the damage bonuses of `PoisonDamUp`. + +## `data` usage +At the start of the action, if `data` is null or empty, it's initialised to be 3 element with a starting value of 0. + +- `data[0]`: This reperesents the amount of time some specific moves were used in the battle by incrementing the value on each usage. If the value reaches 5, this enemy will no longer be able to use any moves in the list. Here are the implicated moves: + - Revives another enemy party member from `reservedata` leaving them at 7 `hp` + - Gives themselves the [AttackUp](../../Actors%20states/BattleCondition/AttackUp.md) condition for 3 main turns + - Heals all enemy party members (including themselves) for 5 `hp` and gives each of them the [GradualHP](../../Actors%20states/BattleCondition/GradualHP.md) condition for 3 main turns. NOTE: For this move specifically, `data[0]` will NOT increment, but the move still won't be used if `data[0]` reaches 5 +- `data[1]`: An actor turn cooldown on the usage of the any moves managed by `data[0]`. On usage of any of these moves, the value is set to 2. The value is always decremented in the pre move logic when above 0 and the value must be 0 for any of the 3 moves managed by `data[0]` to be usable. Effectively, it's a 1 actor turn cooldown before any of the 3 moves become usable again +- `data[2]`: An actor turn cooldown on the usage of the turn relay simulation move. On every usage of the move, the value is set to 3 and it is always decremented in the pre move logic when above 0. For the move to be usable, the value needs to be 0. Effectively, it's a 2 actor turn cooldown on the move before it becomes usable again. NOTE: If [HoloKabbu](HoloKabbu.md) uses their turn relay simulation move to this enemy, this enemy's `data[2]` is set to 2 which is a 1 actor turn cooldown on the usage of this enemy's turn relay simulation move + +## [hitaction](../../Battle%20flow/Update%20flows/Controlled%20flow.md#enemies-hitaction) support +This enemy supports `hitaction` logic and it will be performed when `hitaction` is true instead of any moves. + +### `dontusecharge` set to true +This move always sets `dontusecharge` to true which means `charges` will not get zeroed out in [post action](../../Battle%20flow/Action%20coroutines/DoAction.md#post-action). + +### Logic sequence +The following all happens in the HoloVi coroutine: + +- The first `enemydata` with an [animid](../../../Enums%20and%20IDs/AnimIDs.md) of `Beetle` is obtained (should be [HoloKabbu](HoloKabbu.md) under normal gameplay) and if it exists, [ItemSpinAnim](../../Visual%20rendering/ItemSpinAnim.md) is called on them with a pos of their position + 1.0 in y using the `FavoriteOne` [medal](../../../Enums%20and%20IDs/Medal.md) icon as sprite and without playSound +- Yield return on a EnemyAngryCharge call with this enemy's battleentity: + - Set `dontusecharge` to true + - If `charge` is less than 3, it is incremented with the following: + - animstate set to 102 + - `Wam` sound plays + - [Emoticon](../../../Entities/EntityControl/EntityControl%20Methods.md#emoticon) called on this enemy with the `Exclamation` emote with 20 time + - Yield all frames until `emoticoncooldown` expires + - `StatUp` sound plays + - [StatEffect](../../Visual%20rendering/StatEffect.md) called on this enemy with type 4 (green up arrow) + - Yield for 0.5 seconds + - `charge` is incremented + +## Move selection +9 moves are possible: + +1. A single target beemerang throw +2. Revives another enemy party member from `reservedata` leaving them at 7 `hp` with canmove (so they can take an actor turn immediately on the same main turn) +3. Gives themselves the [AttackUp](../../Actors%20states/BattleCondition/AttackUp.md) condition for 3 main turns (effectively 2 main turns since the current main turn ends soon) +4. Heals all enemy party members (including themselves) for 5 `hp` and gives each of them the [GradualHP](../../Actors%20states/BattleCondition/GradualHP.md) condition for 3 main turns +5. Simulate a turn relay by decrementing the `cantmove` of [HoloKabbu](HoloKabbu.md) or [HoloLeif](HoloLeif.md) which grants them an additional actor turn on this main turn +6. A single target heavy beemerang throw that inflicts the [DefenseDown](../../Actors%20states/BattleCondition/DefenseDown.md) condition for 3 main turns (effectively 2 main turns since the current main turn ends soon), with a chance to cause recoil damages to this enemy +7. A single targets multiple hits beemerang throws +8. Gets 3 `charge` while loosing 3 `hp` +9. A single target multiple hits needles attack that may inflict the [Numb](../../Actors%20states/BattleCondition/Numb.md), [Poison](../../Actors%20states/BattleCondition/Poison.md) or [Sleep](../../Actors%20states/BattleCondition/Sleep.md) condition + +Move 5 is always used if `turns` is 0 (the first main turn) and it will always relay to [HoloKabbu](HoloKabbu.md) instead being determined randomly. However, if this target doesn't meet the requirements outlined in the table below, the move selection process reverts to the normal procedure described below and this first attempt is counted as a failure. + +Otherwise, the decision of which move to use is based on weigthed odds. However, these weighted odds have 3 possible distribution sets which will be numbered as follows (the first one that applies is used): + +1. All of the following conditions are fufilled: + - Both [HoloKabbu](HoloKabbu.md) and [HoloLeif](HoloLeif.md) are present + - This enemy has no `charge` + - This enemy doesn't have the [AttackUp](../../Actors%20states/BattleCondition/AttackUp.md) condition +2. This enemy has no `charge` and doesn't have the [AttackUp](../../Actors%20states/BattleCondition/AttackUp.md) condition, but either [HoloKabbu](HoloKabbu.md) or [HoloLeif](HoloLeif.md) isn't present (assumed to be dead) +3. This enemy has at least 1 `charge` or they have the [AttackUp](../../Actors%20states/BattleCondition/AttackUp.md) condition + +Also, each moves have additional requirements that if they aren't fufilled, the move won't be used and instead cause a reroll of the move selection process. However the amount of attempts to a move selection is tracked and after 5 failures to select a move, move 1 is always used. + +Here are the odds for all distributions sets, their usage requirements and the step to take if those requirements aren't fufilled. + +|Move|Odds set 1|Odds set 2|Odds set 3|Requirements| +|---:|----------|----------|----------|------------| +|1|14/91|7/56|1/13|None, the move is always used when selected|| +|2|4/91|8/56|0/13|| +|3|4/91|8/56|0/13|| +|4|6/91|12/56|0/13|| +|5|7/91|0/56|0/13|| +|6|21/91|7/56|2/13|None, the move is always used when selected| +|7|14/91|0/56|7/13|None, the move is always used when selected| +|8|7/91|7/56|1/13|| +|9|14/91|7/56|2/13|None, the move is always used when selected| + +As a sidenote, the entire move selection process occurs in the HoloVi coroutine who is yield returned by DoAction. + +## Pre move logic +The following logic always happens before the usage of a move (this happens in DoAction, the rest happens in HoloVi): + +- entity.`sprite`.material.renderQueue set to 2500 +- CreateShield called on the entity which initialises their `bubbleshield` if it didn't exist yet + +## Move 1 - Simple beemerang throw +A single target beemerang throw. + +### `nonphyscal` set to true +This move always sets `nonphyscal` to true which affects the effects of the `FrostBite`, `SpikeBod` and `PoisonTouch` [medal](../../../Enums%20and%20IDs/Medal.md) if equipped on the target. + +### [DoDamage](../../Damage%20pipeline/DoDamage.md) calls + +|#|Conditions|attacker|target|damageammount|property|overrides|block| +|-:|---|---|---|---|---|---|---| +|1|Always happen|This enemy|`playertargetID` after [GetSingleTarget](../../Actors%20states/Targetting/GetRandomAvaliablePlayer.md#getsingletarget)|3|null|null|`commandsuccess`| + +### Logic sequence +This is done by yield returning the EnemyViRegular coroutine with the battleentity: + +- [GetSingleTarget](../../Actors%20states/Targetting/GetRandomAvaliablePlayer.md#getsingletarget) called +- `nonphscal` set to true +- Camera moves to look near the midpoint of this enemy and `playertargetentity` +- animstate set to 103 +- Yield for 0.5 seconds +- animstate set to 104 +- Yield return a ShakeSprite call on the battleentity with an intensity of 0.1 in x and 20.0 frametimer +- `Woosh` sound plays on `sounds[8]` at 1.1 pitch on loop +- `Prefabs/Objects/BeerangBattle` instantiated rooted at this enemy position + 1.0 in y +- animstate set to 105 +- Over the course of 40.0 frames: + - `Prefabs/Objects/BeerangBattle` moves from its position + (0.5, 0.5, 0.0) to `playertargetentity` position + 0.75 in y via a BeizierCurve3. The parameters of the curve changes depedning if we are on the first 20.0 frames or the last 20.0 frames (it essentially travels to the target and back to where it was): + - First 20.0 frames: Midpoint is the actual midpoint between from and destination + -5.0 in z and the factor goes from 0.0 to 1.0 + - Last 20.0 frames: Midpoint is (0.0, 0.0, 5.0) and the factor goes from 1.0 to 0.0 + - `Prefabs/Objects/BeerangBattle` angles changes like the following: + - x: Always 80.0 + - y: Always 0.0 + - z: Decreases by 20.0 * MainManager.`framestep` + - On the first frame after 20.0 frames, DoDamage 1 call happen and the `Prefabs/Objects/BeerangBattle` starts its second trajectory as explained above +- `Prefabs/Objects/BeerangBattle` gets destroyed +- `sounds[8]` stops playing with a delay of 0.1 + +## Move 2 - Revives another enemy party member with 7 `hp` +Revives another enemy party member from `reservedata` leaving them at 7 `hp` with canmove (so they can take an actor turn immediately on the same main turn). No damages are dealt. + +### `dontusecharge` set to true +This move always sets `dontusecharge` to true which means `charges` will not get zeroed out in [post action](../../Battle%20flow/Action%20coroutines/DoAction.md#post-action). + +### Logic sequence + +- `data[1]` is set to 2 so this move, move 3 and move 4 can't be used for the next actor turn +- `data[0]` is incremented. If it reaches 5, this move, move 3 and move 4 can't be used anymore +- Yield return ItemAnim with the battleentity with the `MagicDrops` [item](../../../Enums%20and%20IDs/Items.md): + - animstate set to 4 (`ItemGet`) + - `ItemHold` sound plays + - A new sprite object gets created rooted at this enemy + its `itemoffset` using the item's icon as sprite + - Yield for 1.0 second + - The sprite gets destroyed +- [ReviveEnemy](../ReviveEnemy.md) called to revive a random `reservedata` with an hppercent of 7.0 (leaves them at 7 `hp`) with canmove and showcounter +- Yield for 1.0 second + +## Move 3 - Gives themselves the [AttackUp](../../Actors%20states/BattleCondition/AttackUp.md) condition +Gives themselves the [AttackUp](../../Actors%20states/BattleCondition/AttackUp.md) condition for 3 main turns (effectively 2 main turns since the current main turn ends soon). No damages are dealt. + +### `dontusecharge` set to true +This move always sets `dontusecharge` to true which means `charges` will not get zeroed out in [post action](../../Battle%20flow/Action%20coroutines/DoAction.md#post-action). + +### Logic sequence + +- `data[1]` is set to 2 so this move, move 2 and move 4 can't be used for the next actor turn +- `data[0]` is incremented. If it reaches 5, this move, move 2 and move 4 can't be used anymore +- Yield return ItemAnim with the battleentity with the `VitalitySeed` [item](../../../Enums%20and%20IDs/Items.md): + - animstate set to 4 (`ItemGet`) + - `ItemHold` sound plays + - A new sprite object gets created rooted at this enemy + its `itemoffset` using the item's icon as sprite + - Yield for 1.0 second + - The sprite gets destroyed +- [StatusEffect](../../Actors%20states/Conditions%20methods/StatusEffect.md) called on this enemy to give them the [AttackUp](../../Actors%20states/BattleCondition/AttackUp.md) condition for 3 main turns with effect +- Yield for 1.0 second + +## Move 4 - Heals all enemy party members for 5 `hp` with a [GradualHP](../../Actors%20states/BattleCondition/GradualHP.md) condition +Heals all enemy party members (including themselves) for 5 `hp` and gives each of them the [GradualHP](../../Actors%20states/BattleCondition/GradualHP.md) condition for 3 main turns. No damages are dealt. + +### `dontusecharge` set to true +This move always sets `dontusecharge` to true which means `charges` will not get zeroed out in [post action](../../Battle%20flow/Action%20coroutines/DoAction.md#post-action). + +### Logic sequence + +- `data[1]` is set to 2 so this move, move 2 and move 3 can't be used for the next 1 actor turn +- Yield return an EnemySharingStash call with the battleentity: + - animstate set to 112 + - `BagRustle` sound plays + - Yield for 0.5 seconds + - animstate set to 109 + - `ItemHold` sound plays + - For each `enemydata`, a new sprite object is created childed to the battleentity using a random [item](../../../Enums%20and%20IDs/Items.md) sprite each among `CrunchyLeaf`, `Mushroom` and `AphidEgg` with no angles. The positioning logic is complex and won't be detailed here for the sake of brevity, but it involves positioning the sprites to be close from each other while being far apart enough to see them + - Yield for 0.5 seconds + - y `spin` set to 15.0 + - Yield for 0.5 seconds + - `spin` zeroed out + - animstate set to 101 + - All items sprites gets rooted and their angles zeroed out + - `Toss` sound plays + - Over the course of 40.0 frames, each item sprites goes to their matching `enemydata` by moving towards to their position + 1.0 in y using a BeizierCurve with a ymax of 5.0 + - For each `enemydata`: + - Their item sprite gets destroyed + - [Heal](../../Actors%20states/Heal.md) called on them to heal 5 `hp` + - [StatusEffect](../../Actors%20states/Conditions%20methods/StatusEffect.md) called on them to give them the [GradualHP](../../Actors%20states/BattleCondition/GradualHP.md) condition for 3 main turns + - Yield for 1.0 second + +## Move 5 - Decrements the `cantmove` of [HoloKabbu](HoloKabbu.md) or [HoloLeif](HoloLeif.md) +Simulate a turn relay by decrementing the `cantmove` of [HoloKabbu](HoloKabbu.md) or [HoloLeif](HoloLeif.md) which grants them an additional actor turn on this main turn. No damages are dealt. + +### `dontusecharge` set to true +This move always sets `dontusecharge` to true which means `charges` will not get zeroed out in [post action](../../Battle%20flow/Action%20coroutines/DoAction.md#post-action). + +### Logic sequence +The target is selected randomly between [HoloKabbu](HoloKabbu.md) and [HoloLeif](HoloLeif.md) unless `turns` is 0 (first main turn) where [HoloKabbu](HoloKabbu.md) is always selected. As explained in the move selection above, the target must be present and not be IsStoppedLite (same as [IsStopped](../../Actors%20states/IsStopped.md), but [Flipped](../../Actors%20states/BattleCondition/Flipped.md) doesn't count as stopped). This will assume this is the case: + +- Yield return on EnemyRelay with the battleentity to the target: + - `dontusecharge` set to true + - This enemy animstate set to 4 (`ItemGet`) + - The target animstate set to 2 (`Jump`) + - This enemy's y `spin` set to 15.0 + - The target's y `spin` set to 15.0 + - The target's `cantmove` is decremented which grants them an additional actor turn on this main turn + - `Relay` sound plays + - Yield for 0.5 seconds + - This enemy `spin` zeroed out + - The target `spin` zeroed out + - The target animstate reset to its `basestate` + - This enemy animstate reset to its `basestate` +- `data[2]` set to 2 so this move isn't usable for the next actor turn +- If the target of the move's `data` isn't yet initialised, it is initialised to 10 blank slots (even if not all of them will be used) +- The target's `data[2]` is set to 2 which prevents them from using their version of this move on the current main turn + +## Move 6 - Heavy beemerang throw with [DefenseDown](../../Actors%20states/BattleCondition/DefenseDown.md) infliction and a chance of recoil damages +A single target heavy beemerang throw that inflicts the [DefenseDown](../../Actors%20states/BattleCondition/DefenseDown.md) condition for 3 main turns (effectively 2 main turns since the current main turn ends soon), with a chance to cause recoil damages to this enemy. + +### `nonphscal` set to true +This move always sets `nonphyscal` to true which affects the effects of the `FrostBite`, `SpikeBod` and `PoisonTouch` [medal](../../../Enums%20and%20IDs/Medal.md) if equipped on the target. + +### [DoDamage](../../Damage%20pipeline/DoDamage.md) calls + +|#|Conditions|attacker|target|damageammount|property|overrides|block| +|-:|---|---|---|---|---|---|---| +|1|Always happen|This enemy|`playertargetID` after [GetSingleTarget](../../Actors%20states/Targetting/GetRandomAvaliablePlayer.md#getsingletarget)|5|null|{ `NoSound` }|`commandsuccess`| +|2|Only happens after DoDamage 1 if this enemy `hp` is above 20 and a 33% RNG check passes|null|This enemy|3|[NoExceptions](../../Damage%20pipeline/AttackProperty.md)|null|false| + +### Logic sequence +This is done by yield returning the EnemyHeavyThrow coroutine with the battleentity: + +- [GetSingleTarget](../../Actors%20states/Targetting/GetRandomAvaliablePlayer.md#getsingletarget) called +- `nonphyscal` set to true +- Camera moves to look near the midpoint of this enemy and `playertargetentity` +- animstate set to 100 +- `Woosh` sound plays on `sounds[8]` at 0.5 pitch on loop +- Over the course of 120.0 frames: + - y `spin` smoothly increases towards 60.0 + - `sounds[8]` pitch changes from 0.5 to 1.2 via a lerp + - After 36.0 frames passed, the following happens once: + - `Charge3` sound plays + - Yield return a ShakeSprite on the battleentity with an intensity of 0.1 in x and 2.0 frametimer + - After 36.0 frames, each time that Time.frameCount is divisible by 10, DeathSmoke particles plays on the battleentity +- `sprite` local position is reset to Vector3.zero +- animstate set to 101 +- `Prefabs/Objects/BeerangBattle` instantiated without angles and with a SpinAround component with an itself of (0.0, 0.0, 30.0) +- `sounds[8]` stops +- `Toss8` sound plays +- Over the course of 16.0 frames, `Prefabs/Objects/BeerangBattle` moves from this enemy position + 1.0 in y to the world [CenterPos](../../Actors%20states/CenterPos.md) of `playerdata[playertargetID]` via a lerp +- ShakeScreen called with an ammount of 0.4 and a time of 0.75 +- DoDamage 1 call happens +- [StatusEffect](../../Actors%20states/Conditions%20methods/StatusEffect.md) called to inflict the [DefenseDown](../../Actors%20states/BattleCondition/DefenseDown.md) condition on `playerdata[playertargetID]` for 3 main turns with effect +- `HugeHit` sound plays +- Over the course of 80.0 frames, `Prefabs/Objects/BeerangBattle` moves to this enemy position + 1.0 via a BeizierCurve3 with a ymax of 15.0 +- `Prefabs/Objects/BeerangBattle` gets destroyed +- If this enemy has more than 20 `hp` and a 33% RNG check passes: + - ShakeScreen called with an ammount of 0.1 and a time of 0.75 + - animstate set to 11 (`Hurt`) with `overrideanim` set to true + - DoDamage 2 call happens +- Otherwise (no recoil damage) + - `Ding2` sound plays + - `DLGammaStep` sound plays + - animstate set to 100 +- Yield return a SlowSpinStop call on the battleentity with a spinammount of 30.0 in y and 60.0 frametime +- `spin` zeroed out +- `overrideanim` reset to false +- FlipAngle called with setangle + +## Move 7 - Multiple hits beemerang throws +A single targets multiple hits beemerang throws. + +### `nonphyscal` set to true +This move always sets `nonphyscal` to true which affects the effects of the `FrostBite`, `SpikeBod` and `PoisonTouch` [medal](../../../Enums%20and%20IDs/Medal.md) if equipped on the target. + +### [DoDamage](../../Damage%20pipeline/DoDamage.md) calls + +|#|Conditions|attacker|target|damageammount|property|overrides|block| +|-:|---|---|---|---|---|---|---| +|1|Always happen|This enemy|`playertargetID` after [GetSingleTarget](../../Actors%20states/Targetting/GetRandomAvaliablePlayer.md#getsingletarget)|3|null|null|`commandsuccess`| +|2_a|Happens up to 3 times (4 times if [HPPercent](../../Actors%20states/HPPercent.md) is less than 0.5), but each hit requires that the previous DoDamage call dealt more than 0 damage|This enemy|The same as DoDamage 1|DoDamage 1's damageammount - `x` clamped from 1 to 99 where `x` starts at 1 on the first hit and increments after each hit|[Raw](../../Damage%20pipeline/AttackProperty.md)|null|`commandsuccess`| +|2_b|Happens each time that DoDamage 2_a didn't happen due to the previous DoDamage call dealing 0 damages|This enemy|The same as DoDamage 1|0|null|null|false| + +NOTE: This enemy `charge` is zeroed out after DoDamage 1. + +### Logic sequence +This is done by yield returning the EnemyTornadoToss coroutine with the battleentity with a damage of 3: + +- [GetSingleTarget](../../Actors%20states/Targetting/GetRandomAvaliablePlayer.md#getsingletarget) called +- Camera moves to look near the midpoint of this enemy and `playertargetentity` +- `nonphscal` set to true +- animstate set to 100 +- Yield for 0.3 seconds +- `Woosh` sound plays on `sounds[9]` at 0.5 pitch 0.6 volume on loop +- Over the course of 100.0 frames: + - y `spin` changes smoothly towards 30.0 + - `sounds[9]` pitch changes smoothly towards 1.25 clamped from 0.5 to 1.5 +- `sounds[9]` stops playing with a 0.1 delay +- `Toss` sound plays +- `Woosh` sound plays on `sounds[8]` at 0.9 pitch 0.5 volume on loop +- `spin` zeroed out +- animstate set to 101 +- `Prefabs/Objects/BeerangBattle` instantiated rooted at this enemy position +- [SetDefaultCamera](../../Visual%20rendering/SetDefaultCamera.md) called +- Done 4 times (5 times instead if [HPPercent](../../Actors%20states/HPPercent.md) is lower than 5): + - Over the course of 12.5 frames (40.0 frames instead on the first iteration): + - `Prefabs/Objects/BeerangBattle` moves from its position to `playertargetentity` position + 1.0 in y via a BeizierCurve3 with a mid of `playertargetentity` position + (0.0, 3.5, -3.0) + - On each frame, `Prefabs/Objects/BeerangBattle` z angle is set to 20.0 + - What happens here varies (the first one that applies is done): + - First iteration: DoDamage 1 call happens followed by `charge` being set to 0 + - Second and further iterations where the last DoDamage call dealt more than 0 damage: DoDamage 2_a happens + - Second and further iteration where the last DoDamage call dealt 0 or less damage: DoDamage 2_b happens + - Over the course of 22.222222 frames: + - `Prefabs/Objects/BeerangBattle` moves from its position to `playertargetentity` position + 4.0 in y via a BeizierCurve3 with a mid of `playertargetentity` position + (0.0, 3.0, 2.0) + - On each frame, `Prefabs/Objects/BeerangBattle` z angle is set to 20.0 + - `sounds[8]` pitch increases by 0.07 +- Over the course of 40.0 frames: + - `Prefabs/Objects/BeerangBattle` moves from its position to this enemy position via a BeizierCurve3 with a ymax of 5.0 + - On each frame, `Prefabs/Objects/BeerangBattle` z angle is set to 20.0 +- `sounds[8]` stops playing +- animstate set to 13 (`BattleIdle`) +- `Prefabs/Objects/BeerangBattle` gets destroyed +- If `playerdata[playertargetID]`'s `hp` is still above 0, their animstate is set to their `basestate` + +## Move 8 - Gets 3 `charge` and looses 3 `hp` +Gets 3 `charge` while loosing 3 `hp`. No damages are dealt. + +### `dontusecharge` set to true +This move always sets `dontusecharge` to true which means `charges` will not get zeroed out in [post action](../../Battle%20flow/Action%20coroutines/DoAction.md#post-action). + +### Logic sequence + +- `Charge7` sound plays +- animstate set to 24 (`Block`) +- Yield return ShakeSprite on the battleentity with an intensity of 0.1 in x and 30.0 frametimer +- Done 3 times: + - [StatEffect](../../Visual%20rendering/StatEffect.md) called on battleentity with type 4 (green up arrow) + - `StatUp` sound plays with a pitch of 0.9 + (`x` + 1) * 0.1 where `x` starts at 0 and increments on each iterations + - Yield for 0.1 seconds + - Yield for 0.1 seconds +- `charge` set to 3 +- `hp` decreased by 3 + +## Move 9 - Multiple hits needles attack with potential [Numb](../../Actors%20states/BattleCondition/Numb.md), [Poison](../../Actors%20states/BattleCondition/Poison.md) or [Sleep](../../Actors%20states/BattleCondition/Sleep.md) infliction +A single target multiple hits needles attack that may inflict the [Numb](../../Actors%20states/BattleCondition/Numb.md), [Poison](../../Actors%20states/BattleCondition/Poison.md) or [Sleep](../../Actors%20states/BattleCondition/Sleep.md) condition. + +### [DoDamage](../../Damage%20pipeline/DoDamage.md) calls + +|#|Conditions|attacker|target|damageammount|property|overrides|block| +|-:|---|---|---|---|---|---|---| +|1|Always happen 3 times|This enemy|`playertargetID` after [GetSingleTarget](../../Actors%20states/Targetting/GetRandomAvaliablePlayer.md#getsingletarget) (same target for each hits)|3|Random between the following (all hits uses the same property):|null|`commandsuccess`| + +### Logic sequence +This is done by yield returning the EnemyNeedlePincer coroutine with the battleentity: + +- [GetSingleTarget](../../Actors%20states/Targetting/GetRandomAvaliablePlayer.md#getsingletarget) called +- animstate set to 115 +- `WamSoft` sound plays +- Yield for 0.65 seconds +- Camera moves to look near `playertargetentity` +- [MoveTowards](../../../Entities/EntityControl/EntityControl%20Methods.md#movetowards) `playertargetentity` position + 1.5 in x +- Yield until `forcemove` is done +- Done 3 times: + - If it's the first or third iteration, animstate is set to 121 + - Yield return a ShakeSprite call on the battleentity with an intensity of 0.1 in x and 35.0 frametimer + - position set to `playertargetentity` + 0.65 in x + - DoDamage 1 call happens + - animstate set to 122 except on the second iteration where it's set to 123 instead + - For the next 30.0 frames, this enemy position is set to a lerp from its current position to `playertargetentity` + 1.5 via a lerp with a factor of 0.2 * MainManager.`framestep` diff --git a/docs/Battle system/Enemy actions/Enemies/ZombieRoach.md b/docs/Battle system/Enemy actions/Enemies/ZombieRoach.md index 4812e8d63..04cfc4c53 100644 --- a/docs/Battle system/Enemy actions/Enemies/ZombieRoach.md +++ b/docs/Battle system/Enemy actions/Enemies/ZombieRoach.md @@ -185,7 +185,7 @@ This move always sets `nonphyscal` to true which affects the effects of the `Fro |1|Always happen|This enemy|`playertargetID` after [GetSingleTarget](../../Actors%20states/Targetting/GetRandomAvaliablePlayer.md#getsingletarget)|3|[Freeze](../../Damage%20pipeline/AttackProperty.md)|null|`commandsuccess`| ### Logic sequence -This is done by yield returning the EnemyPebbleToss coroutine with the battleentity: +This is done by yield returning the EnemyIceAttackBasic coroutine with the battleentity: - [GetSingleTarget](../../Actors%20states/Targetting/GetRandomAvaliablePlayer.md#getsingletarget) - animstate set to 101 diff --git a/docs/index.md b/docs/index.md index 1a4052de6..476cec10b 100644 --- a/docs/index.md +++ b/docs/index.md @@ -5,6 +5,3 @@ Use the links on your left to naviguate this documentation. The table of content This site defaults to dark mode, but you can toggle it to light mode by clicking the icon on the left of the search bar. Every document will have an eye icon to consult its source md file on GitHub and a pencil icon to edit it on your fork if you want to submit a pull request. - -## About missing documentation since the 1.2.0 update -All documentation should be up to date to the 1.2.0 game version with the exception of `HoloVi`, `HoloKabbu` and `HoloLeif` enemies's action logic which will be done at a later time.