Skip to content

Boss modules

Qkrisi edited this page Jun 25, 2023 · 13 revisions

Helping features for boss modules

New stage delegate

protected Action<string, bool> OnNewStage;

Declaring method: -

This delegate will be called every time a non-ignored* module is solved.

The passed string is the name of the solved module, the passed bool will be true if every non-ignored module is solved or there's only one unsolved module left, otherwise false.

Note: This delegate won't be triggered if there's no KMBombInfo component attached to the module.

Example:

protected override void Start()
{
    base.Start();
    OnNewStage += (ModuleName, ReadyToSolve) => {     //Can be replaced with delegate(string ModuleName, bool ReadyToSolve)
        Debug.LogFormat("New solved module: {0}", ModuleName);
    };
}

Ignored modules

*To update the list of ignored modules, call the GetIgnoredModules() function:

protected string[] GetIgnoredModules(string ModuleName, string[] @default = null);
protected string[] GetIgnoredModules(KMBombModule Module, string[] @default = null);

Declaring method: Start

These functions internally call KMBossModule.GetIgnoredModules and stores the returned values in a string[]: IgnoredModules - The returned value is a reference to said array.

Use this function, so the above delegate can skip ignored modules!

ModuleException: There is no KMBossModule component attached.


protected string[] IgnoredModules;

Declaring method: GetIgnoredModules

Array of ignored modules


protected bool WatchSolves = true;

Declaring method: -

When set to false, the OnNewStage delegate won't be triggered.

Clone this wiki locally