You are viewing a potentially older version of this package. View all versions.
willuwontu-WillsWackyManagers-1.0.3 icon

WillsWackyManagers

Various managers for community usage.

Date uploaded 3 years ago
Version 1.0.3
Download link willuwontu-WillsWackyManagers-1.0.3.zip
Downloads 10062
Dependency string willuwontu-WillsWackyManagers-1.0.3

This mod requires the following mods to function

BepInEx-BepInExPack_ROUNDS-5.4.1100 icon
BepInEx-BepInExPack_ROUNDS

BepInEx pack for ROUNDS. Preconfigured and ready to use.

Preferred version: 5.4.1100
willis81808-MMHook-1.0.0 icon
willis81808-MMHook

MonoMod Runtime Hooks generated for ROUNDS

Preferred version: 1.0.0
Pykess-PlayerJumpPatch-0.0.2 icon
Pykess-PlayerJumpPatch

Patches the erroneous PlayerJump.Jump function in the base game

Preferred version: 0.0.2
Pykess-CardChoiceSpawnUniqueCardPatch-0.1.2 icon
Pykess-CardChoiceSpawnUniqueCardPatch

Patches erroneous logic in the base game CardChoice method SpawnUniqueCard

Preferred version: 0.1.2
Pykess-ModdingUtils-0.1.3 icon
Pykess-ModdingUtils

Utilities aimed at making modding easier and more accessible

Preferred version: 0.1.3
willis81808-UnboundLib-2.6.2 icon
willis81808-UnboundLib

This is a helpful utility for ROUNDS modders aimed at simplifying common tasks.

Preferred version: 2.6.2
Root-RarityLib-1.0.7 icon
Root-RarityLib

A utility library for adding custom rarities to the game.

Preferred version: 1.0.7
Root-CardThemeLib-1.1.1 icon
Root-CardThemeLib

A utility library for adding custom card themes to the game.

Preferred version: 1.1.1
CrazyCoders-RarityBundle-0.0.0 icon
CrazyCoders-RarityBundle

A small bundle of rarities for use by other mods

Preferred version: 0.0.0

README

Wills Wacky Managers

Provides 2 different managers for the community to use:

  • CurseManager
  • RerollManager

v 1.0.3

  • Added 3 new functions to the curse manager and documented them.

v 1.0.2

  • Fixed an issue where a curse may not always return when cursing someone.

v 1.0.1

  • Fixed an error in reroll's logic that would cause it to stop after rerolling a player.

CurseManager

This manager provides the various utilities needed for using curses.

Any added curses must utilize RegisterCurse() via CustomCard.BuildCard<MyCurse>(cardInfo => { CurseManager.instance.RegisterCurse(cardInfo); });.

Additionally, they should use the curseCategory in order to not be pickable for players.

The curseInteractionCategory can be used to denote cards that should only show up when a player has a curse.

Properties

instance

CurseManager instance { get;}

Description

A static reference of the class for accessibility from within static functions.

curseCategory

CardCategory curseCategory { get;}

Description

The card category for every curse. If not utilized, curses may show up for regular picking.

curseInteractionCategory

CardCategory curseInteractionCategory { get;}

Description

The card category for cards that interacted with cursed players. When utilized, cards with it will only show up when a player has a curse.

Functions

RandomCurse()

CardInfo RandomCurse(Player player)

Description

Returns a random curse that is valid for the target player. Respects card rarity.

Parameters

  • Player player the player to get the curse for.

Example Usage

var player = PlayerManager.instance.players[0];
var curse = CurseManager.instance.RandomCurse(player);

CursePlayer()

void CursePlayer(Player player)
void CursePlayer(Player player, Action<CardInfo> callback)

Description

Adds a random valid curse to the targeted player. Respects card rarity.

Parameters

  • Player player the player to curse.
  • Action<CardInfo> callback an optional action to run with the card info of the added curse.

Example Usage

var player = PlayerManager.instance.players[0];
CurseManager.instance.CursePlayer(player, (curse) => { ModdingUtils.Utils.CardBarUtils.instance.ShowImmediate(player, curse); });

RegisterCurse()

void RegisterCurse(CardInfo cardInfo)

Description

Registers a card as a curse with the curse manager. The card still needs to apply curseCategory on its own.

Parameters

  • CardInfo cardInfo the card to register.

Example Usage

CustomCard.BuildCard<MyCurse>(cardInfo => { CurseManager.instance.RegisterCurse(cardInfo); });

GetRaw()

CardInfo[] GetRaw()

Description

Registers a card as a curse with the curse manager. The card still needs to apply curseCategory on its own.

Parameters

Example Usage

var curse = CurseManager.instance.GetRaw();

HasCurse()

bool HasCurse(Player player)

Description

Returns true if a player has a curse.

Parameters

  • Player player the player to check.

Example Usage

var player = PlayerManager.instance.players[0];
var cursed = CurseManager.instance.HasCurse(player);

IsCurse()

bool IsCurse(CardInfo cardInfo)

Description

Returns true if the card is a registered curse.

Parameters

  • CardInfo cardInfo the card to check.

Example Usage

var card = PlayerManager.instance.players[0].data.currentCards[0];
var isCurse = CurseManager.instance.IsCurse(card);

RemoveAllCurses()

void RemoveAllCurses(Player player)
void RemoveAllCurses(Player player, Action<CardInfo> callback)

Description

Removes all curses on the target player.

Parameters

  • Player player the player to remove curses from.
  • Action<CardInfo> callback an optional action to run with the card info of the removed curse.

Example Usage


GetAllCursesOnPlayer()

bool CardInfo[] GetAllCursesOnPlayer(Player player)

Description

Returns true if the card is a registered curse.

Parameters

  • Player player the player whose curses to get.

Example Usage


RerollManager

This manager provides the various utilities for rerolling a player's cards.

Properties

instance

RerollManager instance { get;}

Description

A static reference of the class for accessibility from within static functions.

NoFlip

CardCategory NoFlip { get;}

Description

The card category for cards that should not be given out after a table flip.

flippingPlayer

Player flippingPlayer

Description

The player responsible for the tableflip. Used to add the table flip card to the player.

tableFlipped

bool tableFlipped

Description

When set to true, a table flip will be initiated at the next end of a player's pick. Initiate the FlipTable() method if you wish to flip before then.

tableFlipCard

CardInfo tableFlipCard

Description

The table flip card itself. It's automatically given out to the flipping player after a table flip.

rerollPlayers

List<Player> rerollPlayers

Description

A list of players to reroll when the next reroll is initiated.

reroll

bool reroll

Description

When set to true, a reroll will be initiated at the next end of a player's pick. Initiate the Reroll() method if you wish to reroll before then.

rerollCard

CardInfo rerollCard

Description

The reroll card itself. It's automatically given out to the rerolling player after a table flip.

Functions

FlipTable()

IEnumerator FlipTable(bool addCard = true)

Description

Initiates a table flip for all players.

Parameters

  • bool addCard whether the flipping player (if one exists) shoul be given the Table Flip Card (if it exists).

Example Usage



InitiateRerolls()

IEnumerator InitiateRerolls(bool addCard = true)

Description

Initiates any rerolls in the queue.

Parameters

  • bool addCard whether a player should be given the Reroll card after they reroll.

Example Usage



Reroll()

IEnumerator Reroll(Player player, bool addCard = true)

Description

Initiates any rerolls in the queue.

Parameters

  • Player player the player whose cards to reroll
  • bool addCard whether the player should be given the Reroll card afterwards.

Example Usage