Pitcher EventDialogue¶
Pitcher
has an EventDialogue that is meant to trigger as their eventondeath or when the Eaten condition turn advance found that the player party member just died after sustaining damages.
If it is triggered as a result of the death, it ensures that all enemydata
dies such as the PitcherFlytrap and if it is triggered as a result of the Eaten
condition, it spits out the player party member.
Logic sequence¶
- The
enemydata
index ofPitcher
is obtained - If
Pitcher
'shp
is 0 or below:- Their
eventondeath
is set to -1 which disables this EventDialogue and prevents CheckDead from triggering it again
- Their
- If
Pitcher
'sate
isn't null (they are currently eating a player party member):spitout
is set to a new SpitOut call withPitcher
as the eater- Yield for 0.5 seconds
gottaspit
set to false- Yield all frames until
spitout
is null (the coroutine completed) - If
Pitcher
'shp
is above 0, theirate
is set to null (so they aren't eating anyone)
From there, the logic only continues if Pitcher
's hp
is 0 or below where all enemydata
will be killed and the battle ended:
- All
enemydata
other thanPitcher
whosedeathcoroutine
is null has theirdeathcoroutine
set to a new Death call with activatekill followed by theirhp
set to 0 - If
alreadyending
is false (AddExperience wasn't called before), EndBattleWon is called with addexp and no skipids which switches the battle to a terminal flow