ModsPlus
Willis' amazing modding utilities
About this mod Author’s original text
Mods Plus
Status bar manager
Automatically position and scale status bars above the player's default health bar. No need to worry about other mods adding overlapping information above the player, so long as you are both using this system!
// Create and add a second health bar above the player
var statusBar = new GameObject("Status Bar", typeof(CustomHealthBar)).GetComponent();
player.AddStatusIndicator(statusBar.gameObject);
Custom Card Bar abbreviations
When registering a card you can set a custom two character abbreviation to be displayed in the card bar, simply do the following:
CustomCard.BuildCard(c => c.SetAbbreviation("Ex"));
- An exception will be thrown if the string passed is null or only whitespace characters.
- If the abbreviation passed is longer than 2 characters it will be truncated.
Easy access to important events with PlayerHook
Simply extend PlayerHook to define your custom behaviors then attach it to a player.
public class ExampleHooks: PlayerHook
{
override void OnJump()
{
UnityEngine.Debug.Log("Player jumped!");
}
public override IEnumerator OnBattleStart(IGameModeHandler gameModeHandler)
{
yield return new WaitForSeconds(5f);
UnityEngine.Debug.Log("The battle started 5 seconds ago!");
}
}
Cleaner card creation with SimpleCard
Make a card with fewer lines by extending SimpleCard instead of CustomCard!
using UnityEngine;
using ModsPlus;
public class ExampleCard: SimpleCard
{
public override CardDetails Details => new CardDetails
{
Title = "Example Card",
Description = "Your first effect card",
ModName = "",
Art = Assets.YourCoolArt,
Rarity = CardInfo.Rarity.Common,
Theme = CardThemeColor.CardThemeColorType.TechWhite
};
public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
{
statModifiers.health = 0.5f;
gun.damage = 2f;
}
protected override void Added(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
Debug.Log("Card added to the player!");
}
protected override void Removed(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
Debug.Log("Card removed from the player!");
}
}
Streamlined (and safe) CardEffect wrapper
Do you find yourself writing the same boilerplate over and over when defining cards that attach a MonoBehaviour to the player?
Are you tired of writing the same code for registering and deregistering actions (such as Block::BlockAction or Gun::ShootProjectileAction) repeatedly?
If so, then this is the library for you.
Creating an on block/attack effect
All actions will be automatically registered and deregistered when the card is added or removed, so you can focus on your cool features!
using UnityEngine;
using ModsPlus;
public class ExampleCard: CustomEffectCard
{
public override CardDetails Details => new CardDetails
{
Title = "Example Card",
Description = "Your first effect card",
ModName = "",
Art = Assets.YourCoolArt,
Rarity = CardInfo.Rarity.Common,
Theme = CardThemeColor.CardThemeColorType.TechWhite
};
}
public class ExampleEffect: CardEffect
{
public override void OnBlock(BlockTrigger.BlockTriggerType trigger)
{
Debug.Log("[ExampleEffect] Player blocked!");
}
public override void OnShoot(GameObject projectile)
{
Debug.Log("[ExampleEffect] Player fired a shot!");
}
}
Once defined you can register this card as you normally would:
CustomCard.BuildCard();
For additional overrides check your IDE's auto-complete, or view the source code
PlayerSelector tools
This interface allows you to easily create selectors on players and react when the user clicks one (think Cards+ "Adware" or "Quickhack" abilities for reference)
Creating selectors and responding to a selection event
/ make selectors on a specific player /
int playerID; // ID of any specific pl
Install & use Install: BepInEx plugin
- The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
- Recommended: use a community mod manager (such as r2modman) — pick this game, import the mod, and the manager sets up BepInEx and its dependencies for you.
- Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
- Launch the game — the BepInEx console logs every plugin it loads; seeing this mod in the log means it is installed.
Mods with listed dependencies need those installed too, or they will not load. Options are usually changed in-game or in the plugin's config file.
Install these first, or the mod will not work: