Class SpawnersClearedCondition
- Namespace
- FishMMO.Server.Implementation.World.SceneServer.Spawner
- Assembly
- FishMMO.Server.dll
Allows a respawn only while nothing the listed spawners produced is still alive.
[Serializable]
public class SpawnersClearedCondition : RespawnCondition
- Inheritance
-
SpawnersClearedCondition
- Inherited Members
Remarks
The boss-encounter rule: a camp does not come back while its guard stands. It replaces a condition that listed NPC scene objects directly, which could never have worked with pooled spawns — the NPCs a spawner produces do not exist in the scene file — and cannot survive the spawner bake either. Naming the spawners instead names every creature they will ever produce.
Fields
SpawnerIndices
The same spawners as indices into the scene's spawn table.
[HideInInspector]
public List<int> SpawnerIndices
Field Value
Spawners
The spawners whose creatures must all be dead. Authoring only; baked into SpawnerIndices.
[Tooltip("Spawners in this scene whose creatures must all be dead before this spawner may respawn.")]
public List<ObjectSpawner> Spawners
Field Value
Methods
Bake(RespawnCondition, Func<ObjectSpawner, int>)
Resolves authoring-time references into the baked table. Called by the baker on the
table's copy of authored.
public override void Bake(RespawnCondition authored, Func<ObjectSpawner, int> resolveSpawnerIndex)
Parameters
authoredRespawnConditionThe condition as it is authored on the scene's spawner.
resolveSpawnerIndexFunc<ObjectSpawner, int>Maps an authoring spawner in the same scene to its index in the table, or -1 when it is not in the table.
Remarks
References are read from authored, not from this copy: a serialized
copy cannot be trusted to carry references to scene objects.
OnCheckCondition(SpawnerRuntime)
Checks whether the condition allows spawner to respawn now.
public override bool OnCheckCondition(SpawnerRuntime spawner)
Parameters
spawnerSpawnerRuntimeThe spawner asking.
Returns
- bool
True if respawn is allowed.