Mod API

Interoperability API

Multiple Bombs exposes a public API that can be used by other mods to interoperate with it.
The API is exposed through a GameObject named MultipleBombs_Info that has an IDicionary<string, object> component. This IDictionary contains keys and values (in this text also called properties) that allow for interoperation with the mod. The full set of keys is described in the table below.

If the GameObject doesn't exist you can assume that the Multiple Bombs mod is not installed.

Please note that the IDictionary is delcared with a generic value type of object in order to allow each property to have their own types. The type of each property is detailed in the properties table. Make sure to cast the values to the right type and to pass objects of the right type when using properties.

The available properties are:

Key Type Can Set Description
CurrentMaximumBombCount int False Gets the maximum bomb count allowed by the currently installed gameplay rooms.
CurrentFreePlayBombCount int True Gets or sets the current bomb count in the Free Play settings.
Note: This can only be set while in the Setup state.

Examples

Example of a script using the API:

//Example method that uses the API to get the current maximum number of bombs
public int GetCurrentMaximumBombs()
{
    GameObject multipleBombsAPIGameObject = GameObject.Find("MultipleBombs_Info");
    if(multipleBombsAPIGameObject == null) //If the Multiple Bombs mod is not installed
        return 1;
    IDictionary<string, object> multipleBombsAPI = multipleBombsAPIGameObject.GetComponent<IDictionary<string, object>>();
    return (int)multipleBombsAPI["CurrentMaximumBombCount"];
}