Cultist Simulator

Cultist Simulator

The Roost Machine
 This topic has been pinned, so it's probably important
Chelnoque  [developer] 11 Jan, 2022 @ 7:42am
BIRDSONG - Miscellaneous DLL Modding Tools
using Roost;



Birdsong.Sing(message or messages)

Improved logger. Accepts and displays any amount of arguments (including null), can format them as String.Format()[docs.microsoft.com] does. Accepts NoonUtility.VerbosityLevel.

Examples:
Birdsong.Sing("Hello World!"); Birdsong.Sing(1, 2f, null, Vector2.zero, Watchman.Get<Compendium>().GetSingleEntityById<Element>("lantern").icon); Birdsong.Sing("The element {0} uses icon {1}", elementId, Watchman.Get<Compendium>().GetEntityById<Element>(elementId).Icon);




AtTimeOfPower.[Time].Schedule(MyMethod, PatchType)

Quick-access patcher. Allows to schedule an execution of your own method each time when one of the significant game events happen. Allows all the same things that Harmony[harmony.pardeike.net] does since it's essentialy just a wrapper (if this doesn't sound like anything to you, you can just use simple parameterless method).

Currently available Times of Power:
- MainMenuLoaded;
- NewGameStarted;
- TabletopLoaded;
- RecipeRequirementsCheck;
- RecipeExecution, along with: RecipeMutations, RecipeXtriggers, RecipeDeckEffects, RecipeEffects, RecipeVerbManipulations, RecipePurges, RecipePortals, RecipeVfx;

PatchType.Prefix/PatchType.Postfix specify whether your method will be executed before or after the desired Time of Power.

Examples:
void Initialse() { AtTimeOfPower.MainMenuLoaded.Schedule(MyMainMenuMethod, PatchType.Postfix); } void MyMainMenuMethod() { Birdsong.Sing("Main menu has loaded and now I can do all the wonderful things with it"); }
void Initialse() { AtTimeOfPower.RecipeExecution.Schedule(MyChangesToRecipeExecution, PatchType.Prefix); } void MyChangesToRecipeExecution(RecipeCompletionCommand __instance) { ///do something }

Last edited by Chelnoque; 3 Mar, 2022 @ 6:37am