Spuder EventDialogues¶
Spuder
has very complex action logic involving EventDialgoue because there are 3 different encounters behavior for them that greatly changes their action logic:
- The first encounter happens when flags 27 is false (not yet met with
Moth
) and flagvar 11 is 0 - The second encounter happens when flags 27 is false (not yet met with
Moth
) and flagvar 11 is 2 - The third encounter happens when flags 27 is true (met with
Moth
)
These encounters involve different EventDialogue and flows. The first 2 encounters logic differences will be documented here as they are more scripted alongside. For the third encounter, most of the logic is documented in the Spuder action page, but it involves 2 EventDialogues that will be documented here since they still affect the logic greatly.
These EventDialogue frequently makes use of CheckEvent to guide the flow. They also makes use of flagvar
11 to track the state of the encounters accross them.
First encounter¶
This is the first encounter that requires flags 27 to be false (not yet met with Moth
) and flagvar 11 to be 0. It's assumed here that the player party is only composed of Beetle
.
CheckEvent will detect these conditions when the first enemydata
is Spuder
and make it effectively unbeatable by setting its hp
to 999 and its def
to 99 as well as add an AntiPierce
weakness if it wasn't present which cancels out any Pierce
attacks. Even if the player can defeat them, the event will proceed as normal.
From there, the battle goes on as normal, but the Spuder
action receives some heavy restrictions due to the same conditions above:
Spuder
will always decide to use his bite attack move if their position isGround
- Due to the above,
Spuder
will never attempt to rise in the air toFlying
, but an exception to this occurs where it will always do it ifdemomode
is true ortempdata
is 1 (the latter is assumed to never be the case for this encounter) Spuder
will never drop down toGround
if it has risen in the air toFlying
even for more than 2 main turns
Effectively, until demomode
is set to true, Spuder
is stuck using his biting attack move.
This continues until turns
is 2 meaning after 2 main turns, CheckEvent detects this and starts EventDialogue 4.
EventDialogue 4¶
This EventDialogue represents the dialogue and scripted action of Spuder
rising in the air:
- SetText is called in dialogue with the following:
- text:
commondialogue[27]
which is some dialogue about the fight - fonttype: 0 (
BubblegumSans
) - linebreak:
messagebreak
- tridimensional: false
- position: Vector3.zero
- size: Vector3.one
- parent:
playerdata[0]
- caller: null
- text:
- Yield all frames until the message lock is released
- instance.
camtargetpos
is set toenemydata[0]
's position (should always beSpuder
) with an instance.camspeed
set to 0.03 - Yield for 0.5 seconds
demomode
is set to true- DoAction is called with
enemydata[0]
as the entity and 0 as the actionid. Effectively, it forcesSpuder
to do an actor turn, but becausedemomode
is true, he always will rise in the air toFlying
in his action - Yield all frames until
action
goes to false (until DoAction is done) demomode
is set back to false- SetText is called in dialogue with the following:
- text:
commondialogue[28]
which is some dialogue about the actionSpuder
did - fonttype: 0 (
BubblegumSans
) - linebreak:
messagebreak
- tridimensional: false
- position: Vector3.zero
- size: Vector3.one
- parent:
playerdata[0]
(should beBeetle
) - caller: null
- text:
- Yield all frames until the message lock is released
enemydata[0]
(should always beSpuder
) has itscantmove
set to 0 which allows them to act for this main turn since it technically hasn't occured yet (the game forced them to act so this is needed to resync thecantmove
counter to where it would be)flagvar
11 is set to 1 which advances to the next phase of the encounter
Encounter end¶
Since flagvar
is 11, this now means that CheckEvent will call ExitBattle once turns
is 3 meaning a full main turn passed since EventDialogue 4. This ends the first encounter.
Second encounter¶
The second encounter is similar to the first, but with some key differences with the most notable one being it is assumed a MothWeb
is present alongside Spuder
as enemydata[1]
. MothWeb
is a special enemy because it has no action logic, but it is assumed to have an eventondeath set to EventDialogue 6. Triggering this EventDialogue will ultimately end the battle and it is the overall goal of the second encounter. It is also assumed that the player party is composed of Bee
and Beetle
in default party order.
flagvar
11 must be 2 and tempdata
must be 1. This is normally set by the event that started the battle. CheckEvent detects this which causes to trigger EventDialogue 5 when turns
is 2 meaning 2 main turns passed. This EventDialogue is a reminder to defeat MothWeb
via some dialogues.
This goes on infinetely because Spuder
's hp
starts at 999 and def
starts at 99. He is effectively not beatable (even if defeated, the event will proceed as normal). One thing does changes with its action logic compared to their first encounter: tempdata
should be 1 at this point as it was set by the event that started this encounter.
This means that he will always rise in the air to Flying
on their first main turn. He still will not drop down to Ground
on his own even after 2 main turns, but if they fall as a result of a DoDamage, their move selection changes to be a 50/50 between their bite attack and rising in the air. This is because at the end of the air rising move, tempdata
is set to 0 if it was 1 so it won't get overriden again.
EventDialogue 5¶
This EventDialogue is some dialogues that reminds the player to defeat MothWeb
after 2 main turns have passed:
- If
playerdata[1]
(should always beBeetle
)'shp
is above 0:- SetText is called in dialogue with the following:
- text:
commondialogue[29]
which is some dialogue to remind to defeatMothWeb
- fonttype: 0 (
BubblegumSans
) - linebreak:
messagebreak
- tridimensional: false
- position: Vector3.zero
- size: Vector3.one
- parent:
playerdata[1]
(should always beBeetle
) - caller: null
- text:
- Yield all frames until the message lock is released
- SetText is called in dialogue with the following:
flagvar
11 is set to 3 which prevents this EventDialogue from triggering again
EventDialogue 6¶
This EventDialogue is assumed to be the eventondeath of MothWeb
and marks the end of the second encounter as it ultimately leads to the end of the battle. It is assumed that enemydata[1]
is MothWeb
:
MothWeb
animstate set to 11 (Hurt
)MothWeb
's model has all ParticlesSystem starting playing- All
playerdata
has their animstate set to 13 (BattleIdle
) Spin2
sound played on loop usingsounds[9]
with pitch 0.7 and volume 0.9- Yield for 1 second
sounds[9]
stoppedSpin4
sound plays with 1.1 volume- A new entity is created via CreateNewEntity named
tmoth
with animid of 2 (Moth
) atplayerdata[1]
position + (0.0, 3.5, 0.0) childed to thebattlemap
tmoth
animstate set to 11 (Hurt
)tmoth
y spin set to -20.0tomoth
'songround
set to false- CreateFeet called on
tmoth
enemydata[1]
(should always beMothWeb
)'s position is set offscreen at (0.0, -1000.0, 0.0)- Yield for a frame
tmoth
'soverridejump
set to truetmoth
animstate set to 11 (Hurt
)- Yield all frames until
tmoth
'songround
gets to true. Before each yield, theiroverridejump
is set to true and their animstate is set to 11 (Hurt
) tmoth
'sspin
is zeroed outtmoth
animstate set to 18 (KO
)- Yield for 0.5 seconds
- SetText is called in dialogue with the following:
- text:
commondialogue[30]
which is some dialogue after defeatingMothWeb
- fonttype: 0 (
BubblegumSans
) - linebreak:
messagebreak
- tridimensional: false
- position: Vector3.zero
- size: Vector3.one
- parent:
playerdata[0]
(should always beBee
) - caller: null
- text:
- Yield all frames until the message lock is released
- Yield for 0.25 seconds
- ExitBattle is called which ends the battle and the second encounter
Third encounter¶
This is essentially the typical encounter of Spuder
. This encounter is in effect when flags 27 is true (met Moth
), but it is assumed that flagvar
11 has a value below 150 for the EventDialogues to work correctly. It is also assumed that flags
37 is false as if it is true, the EventDialogues won't occur. It is assumed Spuder
is the only enemy party member of the battle.
CheckEvent will detect the third encounter when turns
is 0 meaning the first main turn and flagvar
11 being lower than 150. When that happens, EventDialogue 8 starts followed by flagvar
11 being set to 150 so it only triggers once at the start of the battle.
EventDialogue 8¶
This EventDialogue is a mini cutscene where Spuder
gains 2 moves
:
Roar
sound playsenemydata[0]
(should always beSpuder
) animstate set to 100- All player party member whose
hp
is above 0 has their animstate set to 11 (Hurt
) - Yield for a second
- StatEffect called on
enemydata[0]
(should always beSpuder
) with type 5 (up yellow arrow) enemydata[0]
(should always beSpuder
) animstate set to 102enemydata[0]
(should always beSpuder
)'smoves
set to 2 giving them 2 actor turns per main turns- UpdateAnim called
- Yield for 0.75 seconds
- UpdateConditionIcons is called which calls UpdateConditionBubbles on all battleentity (all
playerdata
with right to false and allenemydata
withhp
above 0 with right to true)
First encounter phase¶
After, the encounter proceeds as normal. Most of the logic is described in the Spuder action page, but it's mostly an unrestricted version of their first 2 encounters.
This occurs until their hp
becomes lower than their maxhp
/ 2 floored. When this happens, CheckEvent detects this which causes EventDialogue 7 to start followed by flagvar
11 being set to 200 so it only triggers once for the rest of the battle. This EventDialogue transitions to the second phase of the encounter.
EventDialogue 7¶
This EventDialogue transitions the third Spuder
encounter to its second phase:
- HealConditions called on
enemydata[0]
(should always beSpuder
) Roar
sound playsenemydata[0]
(should always beSpuder
) animstate set to 100- All player party member whose
hp
is above 0 has their animstate set to 11 (Hurt
) - Yield for a second
- AddNewEnemy called with id 8 (
ArmoredPoly
) and position (20.0, 0.0, 0.0) - AddNewEnemy called with id 1 (
Mushroom
) and position (20.0, 0.0, 0.0) - Yield for a frame
enemydata[1]
'sbattlepos
set to (0.85, 0.0, 0.0)enemydata[2]
'sbattlepos
set to (7.2, 0.0, 0.0)- Both
enemydata[1]
andenemydata[2]
has theircantmove
set to 1 meaning they will need to wait a main turn before being able to act - Over the course of 1 / 0.015 frames (~66.6666667), every enemy party members has their position lerped from (20.0, 0.0, 0.0) to their
battlepos
. Before the position change on each frame, theirrigid
gravity gets disabled andoverrideanim
set to true (theMushroom
also gets their animstate set to 23 (Chase
)) - All enemy party members has their
rigid
gravity enabled, animstate set to 0 (Idle
) andoverrideanim
set to false - UpdateAnim called
enemydata[0]
(should beSpuder
) animstate set to 102- ReorganizeEnemies called wit order {1, 0, 2}
- Yield for 0.75 seconds