Content Bases - TeamMoonstorm/MoonstormSharedUtils GitHub Wiki
Content Bases
The Content Bases are a type of class found inside MSU. Their main function is handling the code and functionality of the content found inside Risk of Rain 2. They work by inheriting from them, so you can populate any needed properties or fields.
A good way of thinking about these is the following: For each item you want to create, you create a new Class that inherits from ItemBase.
A ContentBase will usually include the following properties:
- Abstract Type so you can inherit from it.
- Virtual Property for the Content's main asset (ArtifactDef for Artifacts, EquipmentDef for Equipment, GameObject for Projectiles/Characters, etc)
Content Bases work alongside their respective module bases. The module base that manages them will find all the instances of classes that inherit from a content base, create a new instance of it and then adding them to the game via the provided content pack in the module base.
There are a total of 10 Content Bases.
Content Name | Abstract Property Types | Can use ItemBehaviors | Notes |
---|---|---|---|
ArtifactBase | ArtifactDef | No | Has 2 Abstract methods where you hook and unhook |
BuffBase | BuffDef | Yes | You should create a static buffDef field and populate it. |
CharacterBase | GameObject(Body Prefab); GameObject(Master Prefab) | No | You should probably use SurvivorBase or MonsterBase instead. |
DamageTypeBase | ModdedDamageType | No | Contains Virtual methods for using Delegates/Hooks. The Abstract method called "GetDamageType" should return your ModdedDamageType |
EliteEquipmentBase | EliteDef; EquipmentDef | Yes | Inherits from EquipmentBase |
EquipmentBase | EquipmentDef | Yes | Contains a virtual method for writing the Equipment logic, called FireAction. |
InteractableBase | GameObject(Interactable Prefab); MSInteractableDirectorCard | No | |
ItemBase | ItemDef | Yes | |
MonsterBase | MSMonsterDirectorCardHolder; GameObject(Body Prefab); GameObject(Master Prefab) | No | Inherits from CharacterBase. MonsterDirectorCardHolder holds the director cards for your monster |
ProjectileBase | GameObject (Projectile Prefab) | No | |
StageBase | SceneDef | No | Scene Def accepts Scene Definitions from ROS |
SurvivorBase | SurvivorDef; GameObject(Body Prefab); GameObject(Master Prefab) | No | Inherits From CharacterBase |
UnlockableBase | MSUnlockableDef | No | Has the ability to have dependencies on other content bases |