RoR2-ChensGradiusMod

Gradius Mod in Risk of Rain 2.

View on GitHub

ChensGradiusMod

Chen.GradiusMod.Drones

DroneDeathState Class

An Entity State that should inherit from the original EntityStates.Drone.DeathState.
The original code does not support custom spawn cards to be detected when dying so that the interactable can spawn again.
This state will cater to custom drones so they are also able to spawn interactables upon death.
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

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.
Methods  
FixedUpdate() Overrideable OnEnter 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 OnEnter 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.