Skip to main content

DeathFern

A class in Root.Township, Alta.Intelligence.

Creature class for the death ferns and for some creature-less hazards and spawners (geysers, ash bombs). It only has a body and a passive action set, and turns off its collision on death. Server AI; Killed runs on both sides.

Constructors​

MemberWhat it is
DeathFern()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

3 private and internal fields
MemberWhat it is
private Transform bodyTransform whose position is the creature's Position.
private ActionComponentSet passiveActionsThe action set the creature starts with.
private static Dictionary<ActionComponentSet, ActionSet<DeathFern>> passiveActionSetMapStatic cache of the action set built from each passive set asset.

Properties​

MemberWhat it is
override Vector3 Position { get; }The body transform's position.

Methods​

MemberWhat it is
protected override void InitializeAi()Server: picks the passive set as the starting choices, building it once per set asset.
protected override void InitializeStatic()Creates the shared set cache, once per class.
protected override void Killed(HealthObject healthobject)Turns off the creature's collision after the base death handling.