Many bosses unlock additional attacks when entering a deeper phase.
E.g. PV, Hornet 2, Hive Knight.
Open questions:
How to automatically detect current boss phase? (Are these even defined?)
How to automatically detect which Choice state is for the current boss phase?
This maybe doable by tracking which highest level Choice state was entered last. So this can only progress from an earlier Choice state to a later one.
What about cases where Choice states are inter-connected? E.g. Winged Nosk has a HALF event which connects phase 1 Choice into phase 2 Choice.
How to handle case where the Choice state is no longer active (e.g. AbsRad phase 3, 5, and 6 don't run the Choice state).
Can have names for each phase.
By default, they are called "Phase 1", "Phase 2"
Can override in config, so that e.g. for AbsRad it's "Phase 1 and 2", "Phase 4".
Plan A
Can use multiple types of Modules
Attack Selectors
A generic selector only handles one GO, one FSM and one Choice state. It can be written in a way to be reused by other selectors. It can ignore specified states (e.g. HALF in Nosk; SLAM in Mantis Lord; FINISHED in God Tamer).
A multi (attack) selector can handle multiple GOs, or multiple FSMs, or multiple Choice states, assuming they are completely parallel and working at the same time (e.g. Sly's Near/Mid/Far/NA Choice; Nosk's Idle/Idle No Spit). Options are combined.
A active (attack) selector can handle multiple GOs, multiple FSMs, multiple Choice states, assuming only one Choice state is active at a time, with a detector of which Choice state is active (via OnEnter) or inactive (via in-game timer). Choice states can be prioritized, so that a lower state's OnEnter cannot override a higher state while the higher state is still active. Options are combined but some of them hidden (for the inactive phases).
Variable Setters
A variable setters resets specified variables (e.g. row counters) to specified values at each at the beginning of each
Choice state.
Behavior Rewirer
A behavior rewirer changes the transitions in a FSM in a specified way. This is useful when certain behavior of the boss should be skipped (e.g. trim White Defender's roll jump; skip grimm's balloon; or infinite balloon).
Modules should be able to react to each other's changes in an automatic way. This can be useful so that certain options automatically turn itself on/off when suitable (e.g. variable setters can be turned on when only one attack is selected; conflicting options can turn themselves off when others are turned on).
Bosses which cannot be handled easily by the above can be handled by 1) set as not-support, and 2) specific per-boss modules.
Plan B
Can use multiple types of Modules
Attack Selectors
Phase Selectors. These are just event emitter added at the beginning of a state, to always emit a certain event. Many bosses use such Phase state to decide what phase the boss is in (usually by judging on its hp).
Compared to phased (attack) selectors, phase selectors** can actively choose which phase the boss is in, which might be more useful (e.g. if the user wants a later phase, they don't have to damage the boss).
Need a way for modules to:
Pull config status from each other
Disable each other
Usages:
Entering a different phase should disable/enable different generic attack selectors (they are one for each phase).
Soul Master/Tyrant phase 2 might be supported by a custom module. When this module is enabled, it irreversibly transits the boss fight to phase 2, which then should disable any phase 1 modules.
All bosses which have phases:
[x] GPZ
[x] active attack selector
[x] phase selector
[x] Hive Knight
[x] active attack selector
[x] phase selector
[x] PV
[x] active attack selector
[x] phase selector
[x] Broken Vessel / Lost Kin
[x] active attack selector
[ ] phase selector
[x] variable setter (for SHAKE, which is controlled from a different FSM "Shake Token Control" via a variable "Do Shake")
[ ] Mantis Lords / Sisters of Battle ??? how to control phase
[ ] active attack selector
[ ] phase selector
[x] Winged Nosk (via HALF)
[x] active attack selector
[ ] phase selector
[x] variable setter
[x] Radiance* (only some phase has attack choice)
[x] active attack selector
[x] phase selector
[x] Sly* (only some phase has attack choice)
[ ] active attack selector
[ ] phase selector
[x] custom (see below, Sly need to use custom module anyways to select attack, can control phase in that custom module, too)
[x] Soul Master / Soul Tyrant (only some phase has attack choice)
[x] active attack selector (can be used to select attacks in phase 1)
[x] phase selector (can be used to select attacks in phase 2)
[x] custom (phase 2 is a different GO and FSM; the jump from phase 1 into phase 2 is probably irreversible)
All bosses which have parallel Choice states:
[x] Hornet 1
[ ] multi attack selector
[x] phase selector
[ ] custom
[x] Hornet 2
[ ] multi attack selector
[x] phase selector
[ ] custom
[x] Sly (need custom module to guide the flow towards a selected attack, which is scattered under near/mid/far/na choice, which making the counters work)
[ ] multi attack selector
[ ] phase selector
[x] custom
[x] Nosk (need custom module to remove constraints; see Idle-3)
Many bosses unlock additional attacks when entering a deeper phase. E.g. PV, Hornet 2, Hive Knight.
Open questions:
Can have names for each phase.
Plan A
Plan B
Need a way for modules to:
All bosses which have phases:
All bosses which have parallel Choice states: