RoR2-ChensGradiusMod

Gradius Mod in Risk of Rain 2.

View on GitHub

ChensGradiusMod

Chen.GradiusMod.Drones

DroneDeathState Class

An Entity State that inherits from the original EntityStates.Drone.DeathState.
It spawns the drone’s broken interactable upon death the same way vanilla drones do, including drone upgrades from the Drone Combiner,
while letting custom drones decide which spawn card to use and if the interactable should spawn at all.
Do not use this class directly. Always inherit from this class and implement the interactable property.

public abstract class DroneDeathState

Inheritance EntityStates.Drone.DeathState 🡒 DroneDeathState

Fields  
CostMultiplierPerUpgrade The additional cost multiplier of the broken drone per drone upgrade. Matches vanilla.
Properties  
GetInteractableSpawnCard A method that should be implemented by the child class. This will be the Spawn Card that will be used to spawn when the drone is destroyed.
SpawnInteractable Flag that is used to check if the interactable will be spawned upon death. Modify this in OnEnter.
Required implementation for its default value.
upgradeCount The number of drone upgrades the drone had when it died.
Methods  
FixedUpdate() Overrideable FixedUpdate method from the original state. Always call base.FixedUpdate.
OnEnter() Overrideable OnEnter method from the original state. Always call base.OnEnter. Initialize values at runtime here.
To perform the death behavior specified in OnImpactServer, destroyOnImpact must be set to true.
This method already does that so long as base.OnEnter is invoked.
OnExit() Overrideable OnExit method from the original state. Always call base.OnExit.
OnImpactServer(Vector3) Overridden method from the original state so that it would instead spawn the specified interactable’s spawn card.
There is no need to override this unless special behavior is needed.
OnInteractableSpawn(GameObject) A method that can be overridden to add or change the logic when the interactable is spawned.
Default logic is to compute for the scaled cost of the drone, and to carry over the drone upgrades to the interactable.