royitaqi / HollowKnight.BossAttacks

4 stars 1 forks source link

Feature: automatically track current phase and only show attacks for current phase #10

Closed royitaqi closed 1 year ago

royitaqi commented 1 year ago

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

  1. Can use multiple types of Modules
    1. Attack Selectors
      1. 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).
      2. 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.
      3. 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).
    2. Variable Setters
      1. A variable setters resets specified variables (e.g. row counters) to specified values at each at the beginning of each Choice state.
    3. Behavior Rewirer
      1. 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).
  2. 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).
  3. 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

  1. Can use multiple types of Modules
    1. Attack Selectors
    2. 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).
      1. 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:

  1. Pull config status from each other
  2. Disable each other Usages:
  3. Entering a different phase should disable/enable different generic attack selectors (they are one for each phase).
  4. 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:

All bosses which have parallel Choice states: