Centipede¶
Assumptions¶
It is assumed this enemy gets loaded with SurviveWith10 in their weakness as it is necessary for the low hp phase transition move to work.
It is also assumed for the same reason that Beetle is present in the player party at playerdata[1].
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]: UNUSEDdata[1]: A value set to 1 when gaining an AttackUp boost in the pre move logic and decremented (effectively set to 0) after using certain moves. This restricts the usage of the charging move where the move will not be used if this value is 1 and a reroll will occur instead. It prevents the charging move to be used on the same actor turn than gaining theAttackUpcondition. However, it doesn't prevent thechargeandAttackUpcondition from stacking at the same time: when using another move than charge (which is guaranteed to happen), the value is set to 0 which makes the charging move usable on the next actor turn while theAttackUpcondition hasn't expirred yet. Here are the moves where this value is set to 0 after their usage:- Draining bite attack
- Bite attack with Flip
- Poison breath attack
- Digging underground
data[2]: A cooldown for having their position remain atUnderground. When using the digging move, this is set to 3 and it gets decremented everytime the underground attack move is used. After this decrement, if the value reaches 0, this enemy will undig themselves setting theirpositiontoGround. Effectively, it means this enemy can remainUndergroundfor up to 3 actor turns in a row.
HardMode changes¶
HardMode being true does the following changes:
- The odds to gain an AttackUp condition in the pre move logic when this enemy didn't already have the condition and their HPPercent is 0.65 or lower changes to 6/10 from 5/10
- In the poison breath move, the DoCommand call (which is a TappingKey) has
barfilldecrease 25% faster each frame. However, this change doesn't affect anything ifmashcommandaltis true making the command a SequentialKeys - In the digging underground move,
cantmovenow gets decremented at the end of the move usage which grants a free actor turn to this enemy
Move selection¶
8 moves are possible:
- A single target bite attack that can drain
hp - A single target bite attack with Flip
- A party wide poison breath attack
- Digs which sets their position to
Underground - Prepares themselves to deliver a big attack by setting their
chargeto 3 - A party wide dash attack
- A single target underground attack that can drain
hp - Initiate a low hp phase transition where the player party is killed except
Beetle
Move 8 is always (and only) used when the following conditions are all fufilled:
hpis 10 or lower- This enemy still has SurviveWith10 in their weakness (meaning this move wasn't used yet as it gets removed during the move's usage)
Move 7 is always (and only) used if move 8 wasn't and position is Underground.
Move 6 is always (and only) used when move 7 and 8 wasn't and basestate isn't 0 (Idle) which means move 5 wasn't used on the previous actor turn.
Move 1 through 5 can only be used when move 6 through 8 wasn't. When this is the case, the decision of which move to use among them is based on odds, but they change if locktri is true which means move 8 was used previously. Here are the move usage odds in either situation:
| Move | Odds when locktri is false |
Odds when locktri is true |
|---|---|---|
| 1 | 2/13 | 1/2 |
| 2 | 3/13 | 1/2 |
| 3 | 2/13 | Never used |
| 4 | 2/13 | Never used |
| 5 | 4/13 | Never Used |
However, move 5 has these additional requirements that must be fufilled for the move to be used after it is selected:
- HPPercent must be 0.6 or lower
data[1]must be 0 (meaning this enemy didn't get the AttackUp condition on the same actor turn in the pre move logic)cantmoveis 0 (meaning this enemy is doing the last actor turn they have available on this main turn)
If these requirements aren't fufilled and the move is selected, a continue directive is issued on the enemy action loop which restarts the entire action and rerolls the move selection process until another move is selected without ending the actor turn.
Pre move logic¶
The following logic happens before the usage of every move except the following ones:
- Low
hpphase transition - Underground attack
- Party wide dash
It is composed of 3 parts that happens in order.
AttackUp condition¶
This part of the pre move only happens if all of the following are fufilled:
- HPPercent is 0.65 or lower
- This enemy doesn't already have the
AttackUpcondition - A 5/10 RNG check passes (6/10 instead if hardmode is true)
When the above are fufilled, this is what the logic does:
- animstate set to 105
Roar2sound plays- ShakeScreen called with an ammount of 0.1 and 0.75 time
- Yield for 0.75 seconds
- SetCondition called to inflict the AttackUp condition on this enemy for 3 main turns
- StatEffect called on this enemy with type 0 (red up arrow)
StatUpsound playsbasestateset to 100- Yield for 0.5 seconds
data[1]is set to 1 (will prevent the charging move to be used on this actor turn)
moves set to 2 excluding the current main turn¶
This part of the pre move only happens if all of the following are fufilled:
- HPPercent is 0.35 or lower
movesis 1 (meaning this logic hasn't happened yet)
When the above are fufilled, this is what the logic does:
- If the AttackUp part of the pre move didn't happen:
- animstate set to 105
Roar2sound plays- ShakeScreen called with an ammount of 0.1 and 0.75 time
- Yield for 0.75 seconds
movesis set to 2 which grants 2 actor turn per main turns (excluding the current main turn)- StatEffect called on this enemy with type 5 (yellow up arrow)
StatUpsound plays- Yield for 0.5 seconds
basestate logic¶
This part of the pre move always happen:
basestateset to 0 (Idle)- The local startstate is set to 0 (
Idle)
Move 1 - Draining bite attack¶
A single target bite attack that can drain hp.
DoDamage calls¶
| # | Conditions | attacker | target | damageammount | property | overrides | block |
|---|---|---|---|---|---|---|---|
| 1 | Always happen | This enemy | playertargetID after GetSingleTarget |
3 | null | null | commandsuccess |
Logic sequence¶
- GetSingleTarget called
Stepsound plays on loop usingsounds[9]- MoveTowards
playertargetentityposition + (3.5, 0.0, -0.15) with a 2.0 multiplier - Camera moves to look near
playertargetentity - Yield all frames until
forcemoveis done sounds[9]stoppedBite3sound plays- animstate set to 100
- Yield for 0.6 seconds
- animstate set to 101
Bite4sound plays- Yield for 0.05 seconds
- DoDamage 1 call happens
- If
lastdamageis higher than 0, Heal called on this enemy to heal theirhpbylastdamage/ 2 floored clamped from 1 tolastdamage - Yield for 0.65 seconds
- If
data[1]is higher than 0 (meaning the AttackUp condition was inflicted in the pre move logic), it is decremented (effectively set to 0)
Move 2 - Bite attack with Flip¶
A single target bite attack with Flip.
DoDamage calls¶
| # | Conditions | attacker | target | damageammount | property | overrides | block |
|---|---|---|---|---|---|---|---|
| 1 | Always happen | This enemy | playertargetID after GetSingleTarget |
4 | Flip1 | null | commandsuccess |
1: This property gets overriden to null in CalculateBaseDamage as the target is a player party member so it does nothing.
Logic sequence¶
- GetSingleTarget called
Stepsound plays on loop usingsounds[9]- MoveTowards
playertargetentityposition + (4.5, 0.0, -0.15) with a 2.0 multiplier - Camera moves to look near
playertargetentity - Yield all frames until
forcemoveis done sounds[9]stoppedBite3sound plays- animstate set to 102
- Yield for 0.6 seconds
- animstate set to 103
Woosh6sound plays- Yield for 0.05 seconds
- DoDamage 1 call happens
- Yield for 0.65 seconds
- If
data[1]is higher than 0 (meaning the AttackUp condition was inflicted in the pre move logic), it is decremented (effectively set to 0)
Move 3 - Poison breath¶
A party wide poison breath attack.
nonphyscal set to true¶
This move always sets nonphyscal to true which affects the effects of the FrostBite, SpikeBod and PoisonTouch medal if equipped on the target.
DoCommand calls¶
| # | Conditions | timer | commandtype | data |
|---|---|---|---|---|
| 1 | None | 165.0 | TappingKey |
|
1: Due to the clamping logic related to this value, it means that the decrease value per frame is 0.005 * the game's frametime when hardmode is false and 0.00625 * the game's frametime when hardmode is true. Effectively, it means that hardmode being true makes barfil decrease 25% more per frame
DoDamage calls¶
| # | Conditions | attacker | target | damageammount | property | overrides | block |
|---|---|---|---|---|---|---|---|
| 1 | Always happen for each player party member whose hp is above 0 |
This enemy | The player party member | 2 | Poison | null | true if barfill is 1.0 or above after DoCommand 1 (meaning the bar got filled), false otherwise |
Logic sequence¶
Clompsound plays with 0.7 pitch- animstate set to 107
- Camera moves to look at this enemy, but zoomed in
- Yield for 0.85 seconds
- SetDefaultCamera called
- Camera moves to look near (-1.0, -0.5, 1.0)
- animstate set to 109
Mistsound playspoisonsmokeparticles plays near this enemy- CreateHelpBox called with 4 (the
TappingKeycommand's help) - DoCommand 1 call happens
- All player party member whose
hpis above 0 has their yspinset to 15.0 - Yield all frames until
doingactiongoes to false. Before each frame yield, all player party member whosehpis above 0 has their animstate set to 11 (Hurt) (but ifblockcooldownis above 0 meaning a block was done, it's set to 24 (Block) instead) - All player party member whose
hpis above 0 has DoDamage 1 call happen on them followed by theirspingetting zeroed out - DestroyHelpBox is called which sets
helpboxidto -1 and destroyshelpboxif it existed in 0.5 seconds with shrink before setting it to null - Yield for 0.5 seconds
- If
data[1]is higher than 0 (meaning the AttackUp condition was inflicted in the pre move logic), it is decremented (effectively set to 0)
Move 4 - Digs underground¶
Digs which sets their position to Underground. No damages are dealt.
Logic sequence¶
- animstate set to 110
- Yield for 0.5 seconds
Dig2sound plays with 0.75 pitchDirtFlyingparticles plays at this enemy postion - 0.1 in x with a time of -1.0- Yield for 0.35 seconds
- animstate set to 112
- A new sprite object is created rooted using the
Sprites/Entities/centipedesprite at index 9 (a patch of dirt) positioned at this enemy + (-0.5, 0.0, -0.2) with a scale of (3.0, 2.0, 1.0) - Over the course of 51.0 frames, this enemy moves from startp - 1.0 in x to starp + (-1.0, -6.0, 0.0) via a lerp
DirtFlyingparticles moved offscreen at 999.0 in y then destroyed in 2.0 secondsdiggingset to truedigscaleset to (3.0, 1.0, 1.0)- Yield for 0.5 seconds
- The patch of dirt is set to MainManager.Shrink over the course of 31.0 frames followed by their destruction (this is done in paralell)
- Yield for 0.5 seconds
- Yield for a frame
- animstate set to 0 (
Idle) - position set to startp
data[2]set to 3 (this is the cooldown to remainUnderground)- position set to
Underground - If hardmode is true,
cantmoveis decremented which gives another free actor turn to this enemy - If
data[1]is higher than 0 (meaning the AttackUp condition was inflicted in the pre move logic), it is decremented (effectively set to 0)
Move 5 - Charging¶
Prepares themselves to deliver a big attack by setting their charge to 3. 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.
Logic sequence¶
- animstate set to 105
Roar2sound plays with 0.8 pitch- ShakeScreen called with an ammount of 0.1 and time of 0.75
- Yield for 0.75 seconds
chargeis set to 3- StatEffect called on this enemy with type 4 (green up arrow)
StatUpsound plays- The local startstate and
basestateset to 108 (this will allow the party wide dash attack move to be used on the next actor turn) - Yield for 0.5 seconds
Move 6 - Party wide dash¶
A party wide dash attack.
PartyDamage¶
| # | Conditions | caller | damage | property | block | jumpheight | spinammount | jumpevenonblock | overrides |
|---|---|---|---|---|---|---|---|---|---|
| 1 | Always happen | This enemy | 2 | Flip1 | commandsuccess |
20.0 | (0.0, 30.0, 0.0) | true | null |
1: This property gets overriden to null in CalculateBaseDamage as the target is a player party member so it does nothing.
Logic sequence¶
- animstate set to 105
Roar2sound plays- ShakeScreen called with 0.1 ammount and 0.75 time
- Yield for 0.8 seconds
- ShakeScreen called with 0.025 ammount and -1.0 time
CentipedeChargesound plays- animstate set to 23 (
Chase) - Over the course of 61.0 frames, this enemy moves to + 2.0 in x via a lerp
- ShakeSprite called with intensity of (0.1, 0.0, 0.0) and 60.0 frametimer
- Yield for 0.75 seconds
CentipedeCharge2sound plays- Over the course of 61.0 frames, this enemy moves to (-25.0, 0.0, 0.0) via a lerp. On the first frame their x position becomes lower than -4.5:
- DoDamage 1 call happens
- ShakeScreen called with 0.3 ammount and 0.75 time
- animstate set to 1 (
Walk) - Over the course of 61.0 frames, this enemy moves from (17.0, 0.0, 0.0) to startp via a lerp. Before each frame yield, their animstate is set to 1 (
Walk) basestateand the local startstate set to 0 (Idle)
Move 7 - Underground attack¶
A single target underground attack that can drain hp.
DoDamage calls¶
| # | Conditions | attacker | target | damageammount | property | overrides | block |
|---|---|---|---|---|---|---|---|
| 1 | Always happen | This enemy | playertargetID after GetSingleTarget |
4 | Flip1 | null | commandsuccess |
1: This property gets overriden to null in CalculateBaseDamage as the target is a player party member so it does nothing.
Logic sequence¶
- GetSingleTarget called
- Camera moves to look near
playerdata[playertargetID] Diggingsound plays on loop usingsounds[9]with 0.75 pitch- MoveTowards
playertargetentityposition + (3.0, 0.0. -0.25) using 113 both as walkstate and stopstate - Yield all frames until
forcemoveis done sounds[9]stopped- animstate set to 113
- position decreased by 2.0 in y
diggingset to falseDigPopsound plays with 0.75 pitchDirtExplodeparticles plays at this enemy with a y component to 0.0- A new sprite object is created rooted using the
Sprites/Entities/centipedesprite at index 9 (a patch of dirt) positioned at this enemy with a y component of 0.0 and -0.2 in z with a scale of (3.0, 2.0, 1.0) - Yield for a random interval between 0.75 and 0.87 seconds
- animstate set to 114
Bitesound plays- Yield for 0.075 seconds
- DoDamage 1 call happens
- Heal called to heal this enemy by
lastdamage/ 2 floored amount ofhp - Yield for 0.65 seconds
diggingset to trueDigsound plays- The patch of dirt is set to MainManager.Shrink over the course of 26.0 frames followed by their destruction (this is done in paralell)
- Yield all frames until
digtimereaches 29.0 - y position set to 0.0
- Yield for a frame
- Yield for a frame
data[2]is decremented (the cooldown to have their position stayUnderground)- If
data[2]just reached 0 (the cooldown expired):- SetDefaultCamera called
Diggingsound plays oin loop usingsounds[9]with 0.75 pitch- MoveTowards startp
- Yield all frames until
forcemoveis done sounds[9]stoppeddiggingset to false- position set to
Ground DigPopsound plays with 0.75 pitchDirtExplodeparticle plays at this enemy position
Move 8 - Low hp phase transition¶
Initiate a low hp phase transition where the player party is killed except Beetle.
DoDamage calls¶
| # | Conditions | attacker | target | damageammount | property | overrides | block |
|---|---|---|---|---|---|---|---|
| 1 | Always happen to every player party members whose hp is above 0 |
This enemy | The player party member | The player party member's entire hp value1 |
NoExceptions | null | false |
1: For Beetle specifically, this cannot be lethal as enforced after this call
Logic sequence¶
- ClearStatus called
- Each player party member gets their Shield condition removed and their
shieldenabledset to false - animstate set to 105
Roar2sound plays- ShakeScreen called with 0.1 ammount and 0.75 time
- Yield for 0.75 seconds
- RevivePlayer called to revive
playerdata[1](should always beBeetle) leaving them at 5hpwithout showcounter - UpdateAnim called
Then, the followuing is done for each player party member in the order Bee, Moth and Beetle:
- If it's
Beetle:- Both
BeeandMothhave theirdeathroutineset to a new Death call with activatekill - Camera moves to look near (-2.1, 0.0, 2.5)
- MoveTowards Vector3.zero with 2.0 multiplier using 1 (
Walk) as walkstate and 105 as stopstate - Yield all frames until
forcemoveis done - If
chompyexists:- Their
flipis set to false - They ForceMove to (-25.0, 0.0, 0.0) with 30.0 multiplier using 1 (
Walk) both as walkstate and stopstate
- Their
- If
aipartyexists, it is destroyed - SetText is called in dialogue with the following:
- Yield all frames until the message lock is released
- Both
- GetSingleTarget called with the player party member so it sets
playertargetIDandplayertargetentityto their player party member information - If the player party member's
hpis above 0:- Camera moves to look near
playerdata[playertargetID] - This enemy MoveTowards
playertargetentityposition + (3.5, 0.0, -0.1) with a 4.0 multiplier using 1 (Walk) as walkstate and 100 as stopstate - Yield all frames until
forcemoveis done - ShakeSprite called with intensity 0.1 and 0.5 frametimer
- Yield for 0.5 seconds
- animstate set to 101
- Yield for 0.05 seconds
- ShakeScreen called with 0.15 ammount and 0.5 time
- RemoveCondition called to remove the Shield condition from the player party member and their
shieldenabledis set to false - DoDamage 1 call happens
- If it's
Beetle, theirhpis set to 1 which makes the damage non lethal - Otherwise:
- ClearStatus called on the player party member
- animstate of
playerdata[1](Beetle) set to 9 (Surprised)
- Yield for 0.5 seconds
- Camera moves to look near
After, the logic continues after the hits were done on the player party members:
- SetDefaultCamera called
- MoveTowards startp
- Yield all frames until
forcemoveis done flipset to false- SetText is called in dialogue with the following:
- Yield all frames until the message lock is released
- This enemy animstate set to 105
Roar2sound plays- ShakeScreen called with ammount of 0.1 and 0.75 time
- Yield for 0.75 seconds
- SetText is called in dialogue with the following:
- Yield all frames until the message lock is released
Beetlehas ShakeSprite called with 0.1 intensity and 30.0 frametimer- Yield for 0.5 seconds
- StatusEffect called on
Beetleto inflict them them AttackUp condition for 9999999 main turns (effectively infinite) with effect - Yield for 0.5 seconds
- flags 98 set to false (this disables PepTalk)
chompylockset to true (this prevents Chompy to be called if they are present)lockmmateris set to true (this prevents theMiracleMattermedal from taking effect)Beetlehas itslockitemsset to true which prevents them to use any itemsBeetlehas itsbasestateset to 5 (Angry)- Heal called on
Beetleto heal them to 999hp - This enemy's
chargeset to 0 - This enemy's
basestateset to 0 (Idle) - This enemy's
locktriset to true (this is how the game tracks that this phase transition happened) - This enemy's
movesset to 1 (reverts them to have only 1 actor turn per main turn) - The SurviveWith10 is removed from this enemy's weakness
- SetCondition called to inflict the AttackDown condition on this enemy for 9999999 main turns (effectively infinite)