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
enemydataindex ofPitcheris obtained - If
Pitcher'shpis 0 or below:- Their
eventondeathis set to -1 which disables this EventDialogue and prevents CheckDead from triggering it again
- Their
- If
Pitcher'sateisn't null (they are currently eating a player party member):spitoutis set to a new SpitOut call withPitcheras the eater- Yield for 0.5 seconds
gottaspitset to false- Yield all frames until
spitoutis null (the coroutine completed) - If
Pitcher'shpis above 0, theirateis 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
enemydataother thanPitcherwhosedeathcoroutineis null has theirdeathcoroutineset to a new Death call with activatekill followed by theirhpset to 0 - If
alreadyendingis false (AddExperience wasn't called before), EndBattleWon is called with addexp and no skipids which switches the battle to a terminal flow