RoR2-ChensGradiusMod

Gradius Mod in Risk of Rain 2.

View on GitHub

ChensGradiusMod

Chen.GradiusMod.Drones

Drone Class

The drone class where mod creators should inherit from to ease up development.

public abstract class Drone

Inheritance System.Object 🡒 Drone

Derived
↳ Drone<T>

Fields  
config The config file assigned to this custom drone. Use this to bind config options.
Properties  
affectedByDroneRepairKit Chen’s Classic Items Compatibility: Determines if this drone can be healed by Drone Repair Kit.
affectedByEngineersToolbelt Aetherium Compatibility: Determines if this drone can be revived and duplicated by Engineers Toolbelt.
alreadySetup Used to determine if the custom drone was already set up.
canBeInspired Aetherium Compatibility: Determines if this drone can be inspired by the Inspiring Drone.
canBeRepurchased Allow the drone to be repurchased upon being decommissioned.
The implementation of this config is manual and cannot be automated.
Use the config option by inheriting DroneDeathState and implementing SpawnInteractable.
canHaveOptions Determines if the drone can be spawned with Gradius’ Options. Required to explicitly implement.
configCategory The category that will be used in the config file that contains the custom drone’s config options.
DroneCharacterMasterObject This refers to the CharacterMaster GameObject of the drone.
Implement this method in the drone class and have it return the CharacterMaster GameObject.
droneDef The DroneDef of the custom drone. This registers the drone to the game’s drone systems introduced in Alloyed Collective,
such as drone pickups, the Drone Scrapper, the Drone Combiner, drone upgrades and the drone purchase notifications.
Create it with CreateDroneDef during SetupComponents.
enabled Determines if the drone should be enabled/disabled. Disabled drones will not be set up.
name Fetches the custom drone’s class name.
spawnWeightWithMachinesArtifact Determines if the drone can be spawned in the enemy drone spawn pool with Artifact of Machines.
Methods  
CreateDroneDef(DroneDef, GameObject, GameObject, InteractableSpawnCard, string, Texture, GameObject, DroneDef) Creates and registers the DroneDef of the custom drone, and links it to the broken interactable so it behaves like a vanilla drone.
The language tokens used are {tokenPrefix}_NAME, {tokenPrefix}_PICKUP, {tokenPrefix}_DESCRIPTION and {tokenPrefix}_SKILL_DESCRIPTION.
CreatePickupDisplay(GameObject, float) Creates a model that is displayed when the drone is dropped as a pickup.
Call this before the original model is used for the body, as replacing the body model changes the original object.
FindBrokenDamagePoint(GameObject) Finds the damage point effect in the broken drone effects carried over by ReplaceBrokenModel.
FindChildRecursive(Transform, string) Finds a child transform by name anywhere in the hierarchy.
LoadVanillaDroneDef(string) Loads a vanilla DroneDef to be used as a template in CreateDroneDef.
PostSetup() The fifth step in the setup process. Place here the code for cleanup, or for finalization.
This will still be performed whether the drone is enabled or disabled.
This will still also be performed if the drone was already set up or not.
PreSetup() The first step in the setup process. Place here the logic needed before any processing begins.
ReplaceBrokenModel(GameObject, GameObject, Renderer, GameObject[]) Replaces the model of the broken interactable that was cloned from a vanilla broken drone, and makes the new model interactable and highlightable.
SetupBehavior() The fourth step in the setup process. Place here the code related to the drone’s behavior.
One may place here mod compatibility code. Hooks should also go here.
SetupComponents() The third step in the setup process. Place here all initialization of components, assets, textures, sounds, etc.
SetupConfig() The second step in the setup process. Place here all the code related to adding configurations for the custom drone.
SetupFirstPhase() First phase of the setup process along with required logic. This phase invokes SetupConfig.
This method is exposed for usage outside of this class.
SetupSecondPhase() Second phase of the setup process along with required logic. This method invokes SetupComponents.
This method is exposed for usage outside of this class.
SetupThirdPhase() Third phase of the setup process along with required logic. This method invokes SetupBehavior.
This method is exposed for usage outside of this class.