
BoonAPI
BoonAPI is a BepInEx plugin that allows for easy creation of custom boons.BoonAPI
BoonAPI is a BepInEx plugin that allows for easy creation of custom boons. To use BoonAPI in your mod, just add it as a reference in your project. Custom boon creation example:
NewBoon exampleBoon = new NewBoon("Boon's Rulebook Name Here", typeof(ExampleBoonHandler), "Boon's Description Here", boonRulebookIcon, boonCardArt, trueIfStacks, trueIfAppearsAsLeshyTrialReward, trueIfAppearsInRulebook);
ExampleBoonHandler.boo = exampleBoon.boon.type;
ExampleBoonHandler here would be a class that inherits from BoonBehaviour that handles how the boon affects card battles. You can override any method that would normally be overridable in any TriggerReceivers like AbilityBehaviours or SpecialCardBehaviours (but in BoonBehaviour the RespondsToSomething methods are named RespondToSomething instead). To add your boon you can do RunState.Run.playerDeck.AddBoon(savedBoonType) (this is why the last line (ExampleBoonHandler.boo = exampleBoon.boon.type) is there, to save the boon's type). To remove the boon do the same but RemoveBoon or RemoveAllBoonsOfType instead of AddBoon.
Installation
To use BoonAPI, put BoonAPI.dll inside of your BepInEx plugins folder. It also probably works for Thunderstore Mod Manager or r2modman but I don't know for sure (I don't use them)
Patch Notes
- 1.1.0 - Fixed a bug where
BoonBehaviours would be created when they shouldn't be. RenamedBoonBehaviortoBoonBehaviour. RenamedOnBattleStarttoOnPostBoonActivationandRespondToBattleStarttoRespondToPostBoonActivation. Added new triggers:OnPreBoonActivation(respond method:RespondToPreBoonActivation): activates before all other boons,OnPreBattleCleanup(respond method:RespondToPreBattleCleanup): activates before the battle ends andOnPostBattleCleanup(respond method:RespondToPostBattleCleanup): activates after the battle ends, right before theBoonBehaviouris destroyed. Added a new property and field toBoonBehaviour:instanceNumber(shows which instance of the same boon type thisBoonBehaviourrepresents, starts with 1) andInstanceIndex(same asinstanceNumber, but starts with 0). - 1.0.0 - Released
NOTE: This mod was developed for Kaycee's Mod beta but it should work for the normal game.