Date uploaded | 2 years ago |
Version | 1.0.1 |
Download link | willis81808-ModsPlus-1.0.1.zip |
Downloads | 3836 |
Dependency string | willis81808-ModsPlus-1.0.1 |
This mod requires the following mods to function
willis81808-UnboundLib
This is a helpful utility for ROUNDS modders aimed at simplifying common tasks.
Preferred version: 3.2.3Pykess-ModdingUtils
Utilities aimed at making modding easier and more accessible
Preferred version: 0.4.3README
Mods Plus
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<ExampleEffect>
{
public override CardDetails Details => new CardDetails
{
Title = "Example Card",
Description = "Your first effect card",
ModName = "<Your Mod ID>",
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<ExampleCard>();
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 player
var targets = PlayerManager.instance.players.Where(p => p.playerID == playerID);
PlayerSelector.InstantiateOn(Assets.SingleTargetSelector, targets, selectedPlayer =>
{
Debug.Log($"Friendly with ID {selectedPlayer.playerID} selected!");
});
/* make selectors on friends */
PlayerSelector.InstantiateOnFriendlies(Assets.FriendlySelector, selectedPlayer =>
{
Debug.Log($"Friendly with ID {selectedPlayer.playerID} selected!");
});
/* make selectors on enemies */
PlayerSelector.InstantiateOnEnemies(Assets.EnemySelector, selectedPlayer =>
{
Debug.Log($"Enemy with ID {selectedPlayer.playerID} selected!");
});
The GameObject
provided to the utility will be instantiated as a child of each target. It can contain any effects (particles, etc.) you wish, but must have some type of Collider3D
on it for clicks to be detected
Custom HP Bar
This component provides a wrapper around the base game's HealthBar
class, giving you full control of the values to display and when to update them.
GameObject target; // any GameObject you wish to add a health bar to
float startingHp = 100;
float startingMaxHp = 100;
// create the health bar
var healthBar = target.AddComponent<CustomHealthBar>();
// set initial values
healthBar.SetValues(startingHp, startingMaxHp);
// take 10 damage
healthBar.CurrentHealth -= 10;
Patch Notes
0.0.1
- Initial release