Final cleanup on the root of actor states

This commit is contained in:
aldelaro5
2024-03-09 20:46:26 -05:00
parent bc8cb38ba4
commit 22a145e551
11 changed files with 213 additions and 96 deletions

View File

@@ -4,104 +4,219 @@ This is defined in MainManager, but it is primarily used for the battle system.
## Player party members fields
These fields only applies to player party members.
### Addressing
|Name|Type|Description|
|---|---|---|
|trueid|int|The [animid](../../Enums%20and%20IDs/AnimIDs.md#animids) of the player party member|
|---:|---|---|
|trueid|int|The [animid](../../Enums%20and%20IDs/AnimIDs.md#animids) of the player party member (learn more why this is equivalent to the `animid` in the [playerdata addressing](../playerdata%20addressing.md) documentation)|
### Stats
|Name|Type|Description|
|---:|---|---|
|basehp|int|The max HP after applying all the `statbonus` from the initial one (this is initially 7 except for the `Beetle` [animid](../../Enums%20and%20IDs/AnimIDs.md#animids) where it's 9)|
|hpt|int|The displayed HUD value of the `hp`|
|baseatk|int|The attack after applying all the `statbonus` from the initial one (initially 2)|
|basedef|int|The defense after applying all the `statbonus` from the initial one (initially 0)|
### Abilities
|Name|Type|Description|
|---:|---|---|
|skills|List<int>|The list of available [skills](../../Enums%20and%20IDs/Skills.md), set to the return of [RefreshSkills](../RefreshSkills.md) for this player party member|
|lockskills|bool|If true, prevents [skills](../../Enums%20and%20IDs/Skills.md) to be used|
|lockitems|bool|If true, prevents items to be used|
|lockitems|bool|If true, prevents [items](../../Enums%20and%20IDs/Items.md) to be used|
|locktri|bool|If true, prevents relay to be used|
|haspassed|bool|If true, this player party member has already relayed which prevents it to relay again|
|lockrelayreceive|bool|If true, prevents to be relayed to from another player party member|
|plating|bool|Tells if the `Plating` [medal](../../Enums%20and%20IDs/Medal.md) is equipped on this player party member|
|didnothing|bool|Tells if the player party member already has chosen to do nothing on a previous action in the same turn which prevents to benefits from some [medals](../../Enums%20and%20IDs/Medal.md)'s effects. See [Do Nothing](../Player%20UI/SetItem.md#2-do-nothing) for details|
|lockcantmove|bool|If true, prevents `cantmove` to be set to 0 (one action available) whenever the `MiracleMatter` [medal](../../Enums%20and%20IDs/Medal.md) triggers. It is set to false after the medal triggers|
|eatenby|EntityControl|If not null, this player party member is trapped via eating by the entity corresponding to the value (this is only used when a `Pitcher` [enemy](../../Enums%20and%20IDs/Enemies.md) eats a player party member and it not being null is treated the same as having an `hp` of 0 or below which is death)|
|didnothing|bool|Tells if the player party member already has chosen to [do nothing](../Player%20UI/ItemList%20confirmation%20handling/Battle%20strategy%20list%20type.md#2-do-nothing) on a previous action in the same main turn which prevents to benefits from some [medals](../../Enums%20and%20IDs/Medal.md)'s effects|
### Special states
|Name|Type|Description|
|---:|---|---|
|plating|bool|Tells if the `Plating` [medal](../../Enums%20and%20IDs/Medal.md) is equipped on this player party member and it is active|
|eatenby|EntityControl|If not null, this player party member is trapped via [eating](BattleCondition/Eaten.md) by the entity corresponding to the value (this is only used when a `Pitcher` [enemy](../../Enums%20and%20IDs/Enemies.md) eats a player party member and it not being null is treated the same as having an `hp` of 0 or below which is death)|
## Enemy party members fields
These fields only applies to enemy party members.
These fields only applies to enemy party members. Some of them are relayed to specific [enemy features](Enemy%20features.md) which are documented separately.
### Core state
|Name|Type|Description|
|---|---|---|
|exp|int|The amount of EXP given when defeated (see the [EXP documentation](../../TextAsset%20Data/Enemies%20data.md#exp-logic) for details)|
|money|int|The base amount of berries this enemy drops|
|moves|int|The amount of actions allowed per turn|
|---:|---|---|
|weakness|List<[AttackProperty](../Damage%20pipeline/AttackProperty.md)>|The list of properties that applies on this enemy party member during the damage pipeline|
|position|[BattlePosition](BattlePosition.md)|The logical battle position frequently used to determine target availability|
|[delayedcondition](Delayed%20condition.md)|List<int>|A list of [conditions](Conditions.md) (only the `BattleCondition` part) added by the damage pipeline that will be inflicted later un [DoAction](../Battle%20flow/Action%20coroutines/DoAction.md)|
### Stats
|Name|Type|Description|
|---:|---|---|
|hardatk|int|The attack gained when the [hard dfficulty scaling](../../TextAsset%20Data/Enemies%20data.md#stats-difficulty-scaling) applies (this is 0 if it doesn't)|
|onhitaction|int|If it's 1, `hitaction` will be set to true when hit. If it's 2, it will only if `position` is `Flying` and if it's 3, only if it's `Ground`|
|chargeonotherenemy|int\[\]|The list of [enemy](../../Enums%20and%20IDs/Enemies.md) ids that when hit, will cause this enemy to have its `hitaction` set to true|
|size|float|The width used for calculating positioning in battle|
|entityname|string|The [SetText](../../SetText/SetText.md) string of its name|
### Rewards
|Name|Type|Description|
|---:|---|---|
|exp|int|The amount of EXP given when defeated (see the [EXP documentation](../../TextAsset%20Data/Enemies%20data.md#exp-logic) for details)|
|fixedexp|bool|Tells if the exp field should not be scaled and is a fixed number (see the [EXP documentation](../../TextAsset%20Data/Enemies%20data.md#exp-logic) for details)|
|hidehp|bool|Tells if its battleentity.`hpbar` should always be hidden even after spying|
|isdefending|bool|Tells if the enemy is guarding which increases its effective defense by `defenseonhit`|
|notattle|bool|Tells if the enemy is not spy-able (this can be overriden to true, see the documentation about [special fields logic](../../TextAsset%20Data/Enemies%20data.md#special-fields-logic) for details)|
|hitaction|bool|When set to true, the enemy will perform a [hitation](../Battle%20flow/Update.md#enemies-hitaction) on the next controlled update flow|
|defenseonhit|int|The amount to increase the defense when `isdefending` is true|
|weight|float|A modifier to apply when animating the enemy when it gets hurt by certain attacks|
|fled|bool|If true, it indicates the enemy party member fled the battle which is seen the same way than if the `hp` reached 0 during [CheckDead](../Battle%20flow/Action%20coroutines/CheckDead.md) which means it's the same than dying, but with less logic involved to kill the enemy party member|
|destroyentity|bool|If the enemy party member `fled` and this is true while the fleeing is found by [CheckDead](../Battle%20flow/Action%20coroutines/CheckDead.md), the battleentity will be disabled as part of the killing process|
|money|int|The base amount of berries this enemy party member drops|
### Action features
|Name|Type|Description|
|---:|---|---|
|[moves](Enemy%20features.md#moves)|int|The amount of actions allowed per turn|
|[actimmobile](Enemy%20features.md#actimmobile)|bool|When true, it allows the enemy party member to act even if they have a stopping [condition](Conditions.md). Check the feature documentation to learn more|
|[hitaction](Enemy%20features.md#hitaction)|bool|When set to true, the enemy party member will perform a hitation on the next controlled update flow|
|[onhitaction](Enemy%20features.md#onhitaction)|int|If it's 1, [hitaction](Enemy%20features.md#hitaction) will be set to true when hit. If it's 2, it will only if [position](BattlePosition.md#battleposition) is `Flying` and if it's 3, only if it's `Ground`|
|[chargeonotherenemy](Enemy%20features.md#chargeonotherenemy)|int\[\]|The list of [enemy](../../Enums%20and%20IDs/Enemies.md) ids that when hit, will cause this enemy to have its [hitaction](Enemy%20features.md#hitaction) set to true|
### Guard feature
|Name|Type|Description|
|---:|---|---|
|[defenseonhit](Enemy%20features.md#defenseonhit-and-isdefending)|int|The amount to increase the defense when [isdefending](Enemy%20features.md#isdefending) is true|
|[isdefending](Enemy%20features.md#isdefending)|bool|Tells if the enemy party member is guarding which increases its effective defense by [defenseonhit](Enemy%20features.md#defenseonhit-and-isdefending) (It can also affect [hitaction](Enemy%20features.md#hitaction) if it's -1, check the feature documentation to learn more)|
### Conditional [EventDialogue](../Battle%20flow/EventDialogue.md)
|Name|Type|Description|
|---:|---|---|
|[eventondeath](Enemy%20features.md#eventondeath)|int|The [EventDialogue](../Battle%20flow/EventDialogue.md) id to trigger during [CheckDead](../Battle%20flow/Action%20coroutines/CheckDead.md) when it detects that the enemy party member died. -1 means no EventDialogue will occur|
|[eventonfall](Enemy%20features.md#eventonfall)|int|The [EventDialogue](../Battle%20flow/EventDialogue.md) to trigger when the enemy party member falls to the ground when sustaining damage (meaning [Drop](../../Entities/EntityControl/Notable%20methods/Drop.md#drop) is called on the battleentity as a result of sustaining damage). -1 means no EventDialogue will occur|
### Override features
|Name|Type|Description|
|---:|---|---|
|[cantfall](Enemy%20features.md)|bool|If true, the enemy party member cannot fall to the ground as a result of sustaining damage in [CalculateBaseDamage](../Damage%20pipeline/CalculateBaseDamage.md)|
|lockposition|bool|Similar to [cantfall](Enemy%20features.md#cantfall) for [CalculateBaseDamage](../Damage%20pipeline/CalculateBaseDamage.md) specifically, but it takes effect even if the enemy party member's [position](BattlePosition.md) isn't `Flying`|
|[notaunt](Enemy%20features.md#notaunt)|bool|If true, the enemy party member cannot be inflicted by the [Taunted](BattleCondition/Taunted.md) condition from the player party (this doesn't remove the logic, see the documentation of the feature to learn more)|
|[notattle](Enemy%20features.md#notattle)|bool|Tells if the enemy party member is not spy-able (this can be overriden to true, see the documentation about [special fields logic](../../TextAsset%20Data/Enemies%20data.md#special-fields-logic) for details)|
### Death behavior
|Name|Type|Description|
|---:|---|---|
|[fled](Enemy%20features.md#fled)|bool|If true, it indicates the enemy party member fled the battle which is seen the same way than if the `hp` reached 0 during [CheckDead](../Battle%20flow/Action%20coroutines/CheckDead.md) which means it's the same than dying, but with less logic involved to kill the enemy party member|
|notired|bool|If true, the enemy party member will not cumulated any `tired` (meaning it can't gain exhaustion) whenever the `DoublePain` [medal](../../Enums%20and%20IDs/Medal.md) is not equipped. NOTE: This doesn't cover HARDEST correctly, see the [EndEnemyTurn](../Battle%20flow/EndEnemyTurn.md) documentation to learn more|
|[deathtype](Enemy%20features.md#deathtype)|int|Dictates the manner in which the enemy party member dies|
|[diebyitself](Enemy%20features.md#diebyitself)|bool|If true, it means the enemy party member will die if all of the ones left have this field set to true automatically when [CheckDead](../Battle%20flow/Action%20coroutines/CheckDead.md) detects this situation after it had killed any other enemy party members. This is done by setting the `hp` to 0 manually before running a second check on all enemy party members which will kill them|
|alreadycounted|bool|Indicates to [CheckDead](../Battle%20flow/Action%20coroutines/CheckDead.md) that the enemy party member was already killed prior and therefore, shouldn't cause another increment of the [bestiary entry](../../Enums%20and%20IDs/librarystuff/Bestiary%20entry.md)'s defeat counter the next time the enemy party member dies|
|eventondeath|int|The [EventDialogue](../Battle%20flow/EventDialogue.md) id to trigger during [CheckDead](../Battle%20flow/Action%20coroutines/CheckDead.md) when it detects that the enemy party member died|
|diebyitself|bool|If true, it means the enemy party member will die if all of the ones left have this field set to true automatically when [CheckDead](../Battle%20flow/Action%20coroutines/CheckDead.md) detects this situation after it had killed any other enemy party members. This is done by setting the `hp` to 0 manually before running a second check on all enemy party members which will kill them|
|deathtype|int|For an enemy, dictates the manner in which the enemy dies (this isn't a DeathType, see the [battleentity initialisation documentation](../../TextAsset%20Data/Enemies%20data.md#battleentity-special-initialisation) for more details)|
|eventonfall|int|The [EventDialogue](../Battle%20flow/EventDialogue.md) to trigger when the enemy party member falls to the ground when sustaining damage (meaning [Drop](../../Entities/EntityControl/Notable%20methods/Drop.md#drop) is called on the battleentity as a result of sustaining damage)|
|sizeonfreeze|float|The size returned by GetEnemySize when the enemy party member has the `Frozen` [condition](Conditions.md) instead of its `size`|
|destroyentity|bool|If the enemy party member `fled` and this is true while the fleeing is found by [CheckDead](../Battle%20flow/Action%20coroutines/CheckDead.md), the battleentity will be disabled as part of the killing process|
### Size calculation
|Name|Type|Description|
|---:|---|---|
|size|float|The width used for calculating positioning in battle|
|initialsize|float|The initial `size` value of the enemy party member. `size` will be set to this value when [BreakIce](../../Entities/EntityControl/Notable%20methods/Freeze%20handling.md#breakice) is called on the battleentity|
|[sizeonfreeze](Enemy%20features.md#sizeonfreeze)|float|The size returned by GetEnemySize when the enemy party member has the [Freeze](BattleCondition/Freeze.md#freeze) condition instead of its `size`|
### Visual modifiers
|Name|Type|Description|
|---:|---|---|
|[hidehp](Enemy%20features.md#hidehp)|bool|Tells if its battleentity.`hpbar` should always be hidden even after spying|
|[weight](Enemy%20features.md#weight)|float|A visual modifier to apply when animating the enemy when it gets hurt by certain attacks|
### General purpose
|Name|Type|Description|
|---:|---|---|
|[data](Enemy%20features.md#data)|int\[\]|General purpose data array for use in [DoAction](../Battle%20flow/Action%20coroutines/DoAction.md)|
|[extrastuff](Enemy%20features.md)|Transform\[\]|A general purspose transforms array for use in [DoAction](../Battle%20flow/Action%20coroutines/DoAction.md)|
### Visual rendering
|Name|Type|Description|
|---:|---|---|
|battlepos|Vector3|The resting battle position of the enemy party members used only in an [EventDialogue](../Battle%20flow/EventDialogue.md)|
|delayedcondition|List<int>|A list of [conditions](Conditions.md) (only the `BattleCondition` part) added by the damage pipeline that will be inflicted later un [DoAction](../Battle%20flow/Action%20coroutines/DoAction.md)|
|data|int\[\]|General purpose data array for use in [DoAction](../Battle%20flow/Action%20coroutines/DoAction.md)|
|ate|EntityControl|The entity this enemy party member is trapping via eating (this is only used for the `Pitcher` [enemy](../../Enums%20and%20IDs/Enemies.md))|
|position|BattlePosition|The logical battle position frequently used to determine target availability|
|extrastuff|Transform\[\]|A general purspose transforms array for use in [DoAction](../Battle%20flow/Action%20coroutines/DoAction.md)|
|frostbitep|ParticleSystem|An instance of `Prefabs/Particles/Snowflakes` childed to the battleentity that is initialised whenever the `Freeze` [condition](Conditions.md) is added as a delayed condition|
|cantfall|bool|If true, the enemy party member cannot fall to the ground as a result of sustaining damage|
|notaunt|bool|If true, the enemy party member cannot be inflicted by the `Taunted` [condition](Conditions.md) from the player party|
|notired|bool|If true, the enemy will not cumulated any `tired` (meaning it can't gain exhaustion) whenever the `DoublePain` [medal](../../Enums%20and%20IDs/Medal.md) is not equipped|
|actimmobile|bool|???|
|weakness|List<AttackProperty>|The list of properties that applies for attacks on this ???|
|lockposition|bool|???|
|entityname|string|The [SetText](../../SetText/SetText.md) string of its name|
### [Conditions](Conditions.md) specific
|Name|Type|Description|
|---:|---|---|
|ate|EntityControl|The entity this enemy party member is trapping via [eating](BattleCondition/Eaten.md) (this is only used for the `Pitcher` [enemy](../../Enums%20and%20IDs/Enemies.md))|
|frostbitep|ParticleSystem|An instance of `Prefabs/Particles/Snowflakes` childed to the battleentity that is initialised whenever the [Freeze](BattleCondition/Freeze.md) condition is added as a [delayed condition](Delayed%20condition.md#delayed-condition)|
## Common actor fields
These fields applies to actors for either parties.
These fields applies to actors from either parties.
### [EntityControl](../../Entities/EntityControl/EntityControl.md)
|Name|Type|Description|
|---|---|---|
|---:|---|---|
|battleentity|EntityControl|The entity used during the battle|
|entity|EntityControl|For a player party member, the overworld entity. For an enemy party member, the same than `battleentity`|
### Identification
|Name|Type|Description|
|---:|---|---|
|animid|int|For an enemy, the [enemy](../../Enums%20and%20IDs/Enemies.md) id. For a player, the same as the `trueid` (learn more in the [playerdata addressing](../playerdata%20addressing.md) documentation)|
### Stats
|Name|Type|Description|
|---:|---|---|
|hp|int|The HP, (for a player party member, this is clamped from 0 to `maxhp`)|
|maxhp|int|The maximum amount of HP (for a player party member, this is `basehp` after all [medal](../../Enums%20and%20IDs/Medal.md) effects applied)|
|atk|int|The attack (for a player party member, this is `baseatk` after all [medal](../../Enums%20and%20IDs/Medal.md) effects applied)|
|def|int|The base defense (for a player party member, this is `basedef` after all [medal](../../Enums%20and%20IDs/Medal.md) effects applied)|
|freezeres|int|The freeze resistance|
|poisonres|int|The poison resistance|
|numbres|int|The numb resistance|
|sleepres|int|The sleep resistance|
|cantmove|int|The amount of actor turns that needs to pass until an action is possible. 0 Means one action is possible and anything negative further adds possible actions on the same turn|
|tired|int|The amount of exhaustion cumulated|
|holditem|int|The [item](../../Enums%20and%20IDs/Items.md) id the actor is holding. Defaults to -1 which is no item held|
|cursoroffset|Vector3|The offset to apply to the cursor when selecting this|
### Actor turn tracking
|Name|Type|Description|
|---:|---|---|
|cantmove|int|The amount of actor turns that needs to pass until an action is possible. 0 Means one action is possible and anything negative further adds possible actions on the same main turn|
|moreturnnextturn|int|When above 0, on the next main turn, the actor's `cantmove` will be decreased by it which gives it this amount of additional actor turns available|
### [Conditions] tracking
|Name|Type|Description|
|---:|---|---|
|[condition](Conditions.md#conditions)|List<int\[\]>|The list of condition applied. Each element is an array of 2 elements, the first being the `BattleCondition` id and the second being the amount of actor turns it is in effect|
|freezeres|int|The [Freeze](BattleCondition/Freeze.md) resistance|
|poisonres|int|The [Poison](BattleCondition/Poison.md) resistance|
|numbres|int|The [Numb](BattleCondition/Numb.md) resistance|
|sleepres|int|The [Sleep](BattleCondition/Sleep.md) resistance|
|isasleep|bool|Tells if the actor has a [Sleep](BattleCondition/Sleep.md) condition, updated at multiple places|
|isnumb|bool|Tells if the actor has a [Numb](BattleCondition/Numb.md) condition, updated at multiple places|
|frozenlastturn|bool|Tells if the actor still had the [Freeze](BattleCondition/Freeze.md) condition after their last actor turn advance via [AdvanceTurnEntity](../Battle%20flow/AdvanceTurnEntity.md)|
|atkdownonloseatkup|bool|If true, the actor will get an [AttackDown](BattleCondition/AttackDown.md) condition inflicted the next time an [AttackUp](BattleCondition/AttackUp.md) condition runs out of main turns|
### Damage modifiers
|Name|Type|Description|
|---:|---|---|
|tired|int|The amount of exhaustion cumulated which have an impact in [CalculateBaseDamage](../Damage%20pipeline/CalculateBaseDamage.md)|
|charge|int|The amount of charges cumulated which have an impact in [CalculateBaseDamage](../Damage%20pipeline/CalculateBaseDamage.md)|
### [Item](../../Enums%20and%20IDs/Items.md) holding
|Name|Type|Description|
|---:|---|---|
|holditem|int|The [item](../../Enums%20and%20IDs/Items.md) id the actor is holding. Defaults to -1 which is no item held. For enemy party members, see the [holditem](Enemy%20features.md#holditem-and-helditem) feature documentation|
|helditem|SpriteRenderer|The `sprite` of the [item](../../Enums%20and%20IDs/Items.md) held by the actor whose id is `holditem`||cursoroffset|Vector3|The offset to apply to the cursor when selecting this actor|
|itemoffset|Vector3|The offset to render the item relative to the entity|
|condition|List<int\[\]>|The list of condition applied. Each element is an array of 2 elements, the first being the `BattleCondition` id and the second being the amount of actor turns it is in effect|
|battleentity|EntityControl|The entity used during the battle|
|isasleep|bool|Tells if the actor has a `Sleep` condition, set on HasCondition if that condition exist|
|isnumb|bool|Tells if the actor has a `Numb` condition, set on FixCondition which is called by SetCondition|
|entity|EntityControl|For a player party member, the overworld entity. For an enemy party member, the same than `battleentity`|
|charge|int|The amount of charges cumulated|
|turnssincedeath|int|The amount of actor turns since death, 0 if the actor is alive|
|turnsalive|int|The amount of actor turns since the battle started or their last death if any occured|
|frozenlastturn|bool|Tells if the actor still had the `Freeze` [condition](Conditions.md) after their last actor turn advance via [AdvanceTurnEntity](../Battle%20flow/AdvanceTurnEntity.md)|
|atkdownonloseatkup|bool|If true, the actor will get an `AttackDown` [condition](Conditions.md) inflicted the next time an `AttackUp` condition runs out of actor turns|
|moreturnnextturn|int|When above 0, on the next actor turn, the actor's `cantmove` will be decreased by it which gives it this amount of additional actions available|
|animid|int|For an enemy, the [enemy](../../Enums%20and%20IDs/Enemies.md) id. For a player, the same as the `trueid` (the actual [animid](../../Enums%20and%20IDs/AnimIDs.md) can be fetched via battleentity.`animid`)|
|helditem|SpriteRenderer|The `sprite` of the [item](../../Enums%20and%20IDs/Items.md) held by the actor whose id is `holditem`|
### Alive and death turn tracking
|Name|Type|Description|
|---:|---|---|
|turnssincedeath|int|The amount of main turns since death, 0 if the actor is alive|
|turnsalive|int|The amount of main turns since the battle started or their last death if any occured|
## Unused fields
These fields are never referenced or never used in any meaningful ways.
|Name|Type|Description|
|---|---|---|
|---:|---|---|
|tiredpart|ParticleSystem|UNUSED|
|noblock|bool|UNUSED|
|pointer|int|UNUSED, This field is maintained to be the same value as `partypointer`, but by indexing `playerdata` instead. This means that `playerdata[X].pointer` is the same than `partypointer[X]` where `X` is a valid `playerdata` index. In practice, this field is only written into making it unused|

View File

@@ -4,7 +4,7 @@ This is an enum that influences the ability for an enemy party member to be targ
|Value|Name|Description|
|-----|----|-----------|
|0|Ground|The enemy party member is grounded and a [GetAvaliableTargets](Targetting/GetAvaliableTargets.md) call with onlyground to true will include the target. This is also the position when the battleentity.`height` isn't above `minheight` + 0.5|
|1|Flying|The enemy isn't grounded and a [GetAvaliableTargets](Targetting/GetAvaliableTargets.md) call with onlyground to true will exclude the target. This is also the position when the battleentity.`height` is above `minheight` + 0.5|
|1|Flying|The enemy party member isn't grounded and a [GetAvaliableTargets](Targetting/GetAvaliableTargets.md) call with onlyground to true will exclude the target. This is also the position when the battleentity.`height` is above `minheight` + 0.5. Depending on many factors such as [cantfall](Enemy%20features.md#cantfall) or having a topple [weakness](Enemy%20features.md#weakness), the enemy party member may be subject to a [Drop](../../Entities/EntityControl/Notable%20methods/Drop.md) during [CalculateBaseDamage](../Damage%20pipeline/CalculateBaseDamage.md)|
|2|OutOfReach|The enemy party member cannot be targeted and [GetAvaliableTargets](Targetting/GetAvaliableTargets.md) will always exclude it|
|3|Random|A value only used during [GetEnemyData](../../TextAsset%20Data/Enemies%20data.md#getenemydata) where the position will get changed to `Ground` or `Flying` so this value is never used in battle, only during data loading|
|4|Underground|The enemy party member is underground which imposes restrictions for the target to be included in [GetAvaliableTargets](Targetting/GetAvaliableTargets.md)|
|4|Underground|The enemy party member is underground which imposes restrictions for the target to be included in [GetAvaliableTargets](Targetting/GetAvaliableTargets.md) and for using [items](../../Enums%20and%20IDs/Items.md)|

View File

@@ -13,4 +13,4 @@ private Vector3 CenterPos(MainManager.BattleData entity, bool world)
### Procedure
- If the actor's `position` is `Underground`, return Vector3.up with entity.battleentity's position added if world is true
- Otherwise, return entity.`cursoroffset` + (0.0, entity.battleentity.`height` - 1.0, 0.0) with entity.battleentity's position added if world is true
- Otherwise, return entity.`cursoroffset` + (0.0, entity.battleentity.`height` - 1.0, 0.0) with entity.battleentity's position added if world is true

View File

@@ -1,5 +1,5 @@
# Conditions
A condition is a temporary effect applied for a limited amount of actor turns on an actor. They are tracked in the actor's `condition` array.
A condition is a temporary effect applied for a limited amount of main turns on an actor. They are tracked in the actor's `condition` array.
A `condition` element contains an int\[\] of 2 elements:

View File

@@ -1,7 +1,7 @@
# Delayed condition
A delayed condition is a [condition](Conditions.md) placed on an enemy party member that whose infliction attempt occurs during the [post action](../Battle%20flow/Action%20coroutines/DoAction.md#post-action) phase of DoAction when the actionid isn't -555 (player first strike), it's an enemy action that didn't cause them to flee and it didn't cause them to kill themselves (`selfsacrifice` is false).
A delayed condition is a [condition](Conditions.md) placed on an enemy party member that whose infliction attempt occurs during the [post action](../Battle%20flow/Action%20coroutines/DoAction.md#post-action) phase of [DoAction](../Battle%20flow/Action%20coroutines/DoAction.md) when the actionid isn't -555 (a dummy value to perform a blank call), it's an enemy action that didn't cause them to flee and it didn't cause them to kill themselves (`selfsacrifice` is false).
NOTE: Only `Freeze`, `Numb` and `Sleep` are supported because they are the only ones that gets processed.
NOTE: Only [Freeze](BattleCondition/Freeze.md), [Numb](BattleCondition/Numb.md) and [Sleep](BattleCondition/Sleep.md) are supported because they are the only ones that gets processed.
The list of them is tracked in the `delayedcondition` field of the enemy party member and are ephemeral in nature: once processed, they are removed so they are only valid per action.
@@ -14,10 +14,10 @@ private void AddDelayedCondition(int enid, MainManager.BattleCondition cond)
enid is the `enemydata` index and `cond` is the condition to add to the corresponding `delayedcondition` list. The method will ensure the list isn't null and if the condition didn't already exist (duplicates aren't allowed), it will be added.
Specifically, if a `Freeze` condition is added via this method, the `frostbitep` of the enemy party member is initialised to be the ParticleSystem of a new instance of the `Prefabs/Particles/Snowflakes` prefab childed to the battleentity and with a local position of the enemy party member's non world [CenterPos](CenterPos.md#centerpos).
Specifically, if a [Freeze](BattleCondition/Freeze.md) condition is added via this method, the `frostbitep` of the enemy party member is initialised to be the ParticleSystem of a new instance of the `Prefabs/Particles/Snowflakes` prefab childed to the battleentity and with a local position of the enemy party member's non world [CenterPos](CenterPos.md#centerpos).
## Delayed conditions's processing
As mentioned above, they are processed during the post action phase of DoAction for the enemy party member that was performing its action. Only `Freeze`, `Numb` and `Sleep` are supported.
As mentioned above, they are processed during the post action phase of DoAction for the enemy party member that was performing its action. Only [Freeze](BattleCondition/Freeze.md), [Numb](BattleCondition/Numb.md) and [Sleep](BattleCondition/Sleep.md) are supported.
### `Freeze` processing
@@ -31,14 +31,14 @@ As mentioned above, they are processed during the post action phase of DoAction
- [SetCondition](Conditions%20methods/SetCondition.md) is called with the `Freeze` condition on the enemy party member for 3 turns
### `Numb` processing
There's only logic if the `numbres` is below 100 (it's not immunte). If it is:
There's only logic if the `numbres` is below 100 (it's not immune). If it is:
- The `Numb` sound is played
- [SetCondition](Conditions%20methods/SetCondition.md) is called with the `Numb` condition on the enemy party member for 2 turns
- `isnumb` is set to true
### `Sleep` processing
There's only logic if the `sleepres` is below 100 (it's not immunte). If it is:
There's only logic if the `sleepres` is below 100 (it's not immune). If it is:
- The `Sleep` sound is played
- DeathSmoke particles are played at the world's [CenterPos](CenterPos.md) of the enemy party member with a size of (2.0, 2.0, 2.0)

View File

@@ -19,7 +19,7 @@ This struct defines the entirety of a delproj, here are all the fields and their
|whilesound|string|A `Resources/audio/sounds` audio clip's name that will be play while the projectile is landing on loop. For the clip to play only once instead of looping, the name needs to be prepended by `@`|
|args|string|`@` separated strings containing optional configurations, see the section below for details|
|calledby|MainManager.BattleData|UNUSED|
|property|AttackProperty?|The property of the damage dealt|
|property|[AttackProperty](../Damage%20pipeline/AttackProperty.md)?|The property of the damage dealt (null means no property applies)|
### `args` field
The `args` of the `DelayedProjectileData` are a list of commands which is `@` separated while each command is a list of string that is `,` separated.

View File

@@ -9,7 +9,7 @@ If the value isn't -1 and the enemy party member was detected dead (without `fle
## `eventonfall`
This feature allows to trigger an [EventDialogue](../Battle%20flow/EventDialogue.md) when the enemy party member drops.
When set to any non negative value, whenever [CalculateBaseDamage](../Damage%20pipeline/CalculateBaseDamage.md) detects that the enemy party memeber should be dropped, it not do the drop as it would have normally. Instead, it will set `calleventnext` to `eventonfall` which has the effect that on the next [CheckEvent](../Battle%20flow/Update%20flows/Controlled%20flow.md), the [EventDialogue](../Battle%20flow/EventDialogue.md) whose id was `eventonfall` will be triggered.
When set to any non negative value, whenever [CalculateBaseDamage](../Damage%20pipeline/CalculateBaseDamage.md) detects that the enemy party memeber should be dropped, it won't do it as it would have normally. Instead, it will set `calleventnext` to `eventonfall` which has the effect that on the next [CheckEvent](../Battle%20flow/Update%20flows/Controlled%20flow.md), the [EventDialogue](../Battle%20flow/EventDialogue.md) whose id was `eventonfall` will be triggered.
## `moves`
The value of this field determines the base amount of actor turn an enemy is allowed to have per main turn.
@@ -79,8 +79,8 @@ Details are in the sub sections below.
There is a standard way to have `hitaction` set automatically when the enemy party member is targetted during [DoDamage](../Damage%20pipeline/DoDamage.md) and it's done by the `onhitaction` field. The conditions required to set `hitaction` to true is that `enemy` is false (we are in the [player phase](../Battle%20flow/Main%20turn%20life%20cycle.md#player-phase)) and something else that depends on the field's value:
- If it's 1, it's always fufilled
- If it's 2, it's only fufilled if target.`position` is `Flying`
- If it's 3, it's only fufilled if target.`position` is `Ground`
- If it's 2, it's only fufilled if target.[position](BattlePosition.md) is `Flying`
- If it's 3, it's only fufilled if target.[position](BattlePosition.md) is `Ground`
This allows the `hitaction` to happen whenever the enemy party member is targetted while in any or in specific positions.
@@ -90,7 +90,7 @@ There is an alternative way to get `hitaction` set to true automatically during
How it works is when the target sustains the damage, every other enemy party members who has the target.`animid` (their [enemy](../../Enums%20and%20IDs/Enemies.md) id) in their `chargeonotherenemy` has their `hitaction` set to !`enemy` (false during the [enemy phase](../Battle%20flow/Main%20turn%20life%20cycle.md#enemies-phase), true during the [player phase](../Battle%20flow/Main%20turn%20life%20cycle.md#player-phase)).
### About `isdefending` being -1
There is a second way to automatically set `hitaction` to true when the enemy party member is targetted during [DoDamage](../Damage%20pipeline/DoDamage.md). That was is by having `isdefending` be -1 and the `position` of the enemy party member must not be `Underground`. If this applies, it will override `onhitaction` and take priority by always setting `hitaction` to true.
There is a second way to automatically set `hitaction` to true when the enemy party member is targetted during [DoDamage](../Damage%20pipeline/DoDamage.md). That was is by having `isdefending` be -1 and the [position](BattlePosition.md) of the enemy party member must not be `Underground`. If this applies, it will override `onhitaction` and take priority by always setting `hitaction` to true.
In practice, only the `Underling` [enemy](../../Enums%20and%20IDs/Enemies.md) does this, every other Enemy defined in the game would rather use `onhitaction` or `chargeonotherenemy`.
@@ -101,7 +101,7 @@ The value of this field has 3 modes of operations:
- 0: The enemy party member is opting out of the `hitaction` and the `isdefending` logic
- 1 or above: No `hiaction` logic, but it will get the `isdefending` logic.
As for the `isdefending`, it's where the enemy party member guards and it gain points of defenses during [DefaultDamageCalc](../Damage%20pipeline/CalculateBaseDamage.md) when piercing doesn't apply with the amount corresponding to the value and those defense are recognised by [TrueDef](../Visual%20rendering/RefreshEnemyHP.md#truedef). They will apply when `isdefending` is true unless the enemy party member is [Flipped](BattleCondition/Flipped.md). This also enables `isdefending`'s toggling during [DoDamage](../Damage%20pipeline/DoDamage.md) (See the section below for more details). NOTE: There are several caveats with this, check the [CalculateBaseDamage](../Damage%20pipeline/CalculateBaseDamage.md) documentation to learn more.
As for the `isdefending`, it's where the enemy party member guards and it gain points of defenses during [DefaultDamageCalc](../Damage%20pipeline/CalculateBaseDamage.md) when piercing doesn't apply with the amount corresponding to the value and those defense points are recognised by [TrueDef](../Visual%20rendering/RefreshEnemyHP.md#truedef). They will apply when `isdefending` is true unless the enemy party member is [Flipped](BattleCondition/Flipped.md). This also enables `isdefending`'s toggling during [DoDamage](../Damage%20pipeline/DoDamage.md) (See the section below for more details). NOTE: There are several caveats with this, check the [CalculateBaseDamage](../Damage%20pipeline/CalculateBaseDamage.md) documentation to learn more.
### `isdefending`
As for `isdefending`, it is a field that tells if the enemy party member is guarding. Its initial value is false set by [StartBattle](../StartBattle.md).
@@ -143,7 +143,11 @@ This is a general purpose transform array for use by enemy party members only du
The name of this field is a missnomer because it doesn't represent only weaknesses, but rather a general purpose list of [AttackProperties](../Damage%20pipeline/AttackProperty.md) that can change the damage pipeline, especially during [CalculateBaseDamage](../Damage%20pipeline/CalculateBaseDamage.md).
## `cantfall`
When this field is true, it will never be dropped or have its `position` set to `Ground` by RefreshEnemyPos (used by [GetAvailableTargets](Targetting/GetAvaliableTargets.md) or [Chompy](../Battle%20flow/Action%20coroutines/Chompy.md)).
When this field is true, it will never be dropped by [CalculateBaseDamage](../Damage%20pipeline/CalculateBaseDamage.md) when its [position](BattlePosition.md) is `Flying`.
It will also prevent having its [position](BattlePosition.md) set to `Ground` by RefreshEnemyPos (used by [GetAvailableTargets](Targetting/GetAvaliableTargets.md) or [Chompy](../Battle%20flow/Action%20coroutines/Chompy.md)).
`lockposition` is a field that does the same logic in [CalculateBaseDamage](../Damage%20pipeline/CalculateBaseDamage.md) specifically, but it doesn't require the [position](BattlePosition.md) to be `Flying`. It doesn't include the other logic `cantfall` has.
## `notaunt`
When this field is true, it specifically affects the `BeetleTaunt` [skill](../../Enums%20and%20IDs/Skills.md) by preventing the [Taunted](BattleCondition/Taunted.md) infliction.

View File

@@ -8,20 +8,18 @@ private bool IsStopped(MainManager.BattleData entity, bool skipimmobile)
## Parameters
- `entity`: The actor to check
- `skipimmobile`: Whether or not to exclude the `actimmobile` check. There is an overload without this parameter that sends false
- `skipimmobile`: Whether or not to exclude the [actimmobile](Enemy%20features.md#actimmobile) check. There is an overload without this parameter that sends false
## Procedure
If skipimmobile is false and the actor's `actimmobile` is true, the result is false.
If skipimmobile is false and the actor's [actimmobile](Enemy%20features.md#actimmobile) is true, the result is false.
Otherwise, the result is only true if any of the following are true (it's false otherwise):
- The actor has a `Freeze` [condition](Conditions.md)
- The actor has a `Numb` [condition](Conditions.md)
- The actor has a `Flipped` [condition](Conditions.md)
- The actor has a `Sleep` [condition](Conditions.md)
- The actor has a `Eaten` [condition](Conditions.md)
- The actor has a `EventStop` [condition](Conditions.md)
- The actor `isnumb`
- The actor `isasleep`
- The actor has a [Freeze](BattleCondition/Freeze.md) condition
- The actor has a [Numb](BattleCondition/Numb.md) condition (or `isnumb` is true)
- The actor has a [Flipped](BattleCondition/Flipped.md) condition
- The actor has a [Sleep](BattleCondition/Sleep.md) condition (or `isasleep` is true)
- The actor has a [Eaten](BattleCondition/Eaten.md) condition
- The actor has a [EventStop](BattleCondition/EventStop.md) condition
- The actor's `hp` is 0 or below

View File

@@ -7,8 +7,8 @@ public static void RefreshEntities(bool forceanim, bool refreshmap, bool onlypla
## Parameters:
- `forceanim`: Tells if FroceAnim will be caolled on each entity which will call Play on the entity's `anim` using its the current [animstate](../../Entities/EntityControl/Animations/animstate.md) (`f` is appended if the entity's `height` is aboe 0.1 and it has the same meaning than its normal argument)
- `refreshmap`: Tells if the [NPCControl](../../Entities/NPCControl/NPCControl.md) specific logics will apply
- `forceanim`: Tells if ForceAnim will be called on each entity which will call Play on the entity's `anim` using its the current [animstate](../../Entities/EntityControl/Animations/animstate.md) (`f` is appended if the entity's `height` is aboe 0.1 and it has the same meaning than its normal argument)
- `refreshmap`: Tells if the [NPCControl](../../Entities/NPCControl/NPCControl.md) specific logic will apply
- `onlyplayer`: Tells if only the `playerdata` entities part will have their fields reset
There are 3 overloads: one where `onlyplayer` is ommited and false is sent, one without parameter where all the parameters will have false sent and one where the only parameter is `onlyplayer` and the other 2 will have false sent.
@@ -30,4 +30,4 @@ There are 3 overloads: one where `onlyplayer` is ommited and false is sent, one
- [Dropplet](../../Entities/NPCControl/ObjectTypes/Dropplet.md)
- [PushRock](../../Entities/NPCControl/ObjectTypes/PushRock.md)
- [Geizer](../../Entities/NPCControl/ObjectTypes/Geizer.md)
- If refreshmap is true and the map exists, all TrailRenderer has Clear called on them which clears all the wind trails currently active
- If refreshmap is true and the map exists, all TrailRenderer has Clear called on them which clears all the wind trails currently active

View File

@@ -8,7 +8,7 @@ Here are the different AttackProperty, how they are meant to be passed to the da
|Value|Name|DoDamage parameter?|`weakness`?|Description|
|-----|----|-------------------|-----------|-----------|
|0|Pierce|Yes|No|Ignores all calculations related to defense in CalculateBaseDamage. Only valid for enemy party member targets that do not have `AntiPierce` in their `weakness`|
|1|Flip|Yes|Yes|When used as a DoDamage parameter, 1 point of defense in CalculateBaseDamage will be ignored when the target doesn't have the [Flipped](../Actors%20states/BattleCondition/Flipped.md) condition (this is done incorrectly, see the CalculateBaseDamage documentation to learn more). It will also attempt to inflict the `Flipped` condition if the target has this property in its `weakness` and some other conditions are fufilled|
|1|Flip|Yes|Yes|When used as a DoDamage parameter, 1 point of defense in CalculateBaseDamage will be ignored when the target doesn't have the [Flipped](../Actors%20states/BattleCondition/Flipped.md) condition (this is done incorrectly, see the CalculateBaseDamage documentation to learn more). It will also attempt to inflict the `Flipped` condition if the target has this property in its `weakness` and some other conditions are fufilled. It will also bypass [defenseonhit](../Actors%20states/Enemy%20features.md#defenseonhit-and-isdefending) and prevent `isdefending` from being set to true (it can even break the guard)|
|2|Freeze|Yes|No|Attempts to inflict the [Freeze](../Actors%20states/BattleCondition/Freeze.md) condition during CalculateBaseDamage|
|3|Poison|Yes|No|Attempts to inflict the [Poison](../Actors%20states/BattleCondition/Poison.md) condition during CalculateBaseDamage|
|4|Numb|Yes|No|Attempts to inflict the [Numb](../Actors%20states/BattleCondition/Numb.md) condition during CalculateBaseDamage|

View File

@@ -20,7 +20,7 @@ This input is only processed if [GetFreePlayerAmmount](../../Actors%20states/Pla
- `currentturn` is set to -1 which unselects the player (the new one will be cycle on the next [player phase](../../Battle%20flow/Main%20turn%20life%20cycle.md#player-phase) update)
## Input 6 (switch party)
This input is only processed when AllPartyFree returns true (all `playerdata` have a `cantmove` of 0 or below) or GetAlivePlayerAmmount returns exactly 1 (there is only one player with an `hp` above 0 with no `eatenby`). NOTE: this implies that it is possible to switch after an action if that action killed all, but one party member TODO: recheck.
This input is only processed when AllPartyFree returns true (all `playerdata` have a `cantmove` of 0 or below) or GetAlivePlayerAmmount returns exactly 1 (there is only one player with an `hp` above 0 with no `eatenby`):
- `caninputcooldown` is set to 2.0
- The `Switch` sound is played