Table of Contents

Class WeatherRespawnCondition

Namespace
FishMMO.Server.Implementation.World.SceneServer.Spawner
Assembly
FishMMO.Server.dll

Allows a respawn only while the weather over the spawner is, or is not, doing something (Q16).

[Serializable]
public class WeatherRespawnCondition : RespawnCondition
Inheritance
WeatherRespawnCondition
Inherited Members

Remarks

The creature that only comes out in the rain, and the one that will not. Both are this one condition with Invert either way, dropped onto a spawner beside any other condition it already has — nothing about the spawner knows or cares that it is weather doing the gating.

It gates the respawn, not the life. Something that spawned in a storm stays when the storm passes; it simply is not replaced while the sky is clear. Despawning a creature the moment the weather turned would take a mob out from under whoever was fighting it.

Server-side, and not predicted. A spawn is authoritative and always was — the client is told what appeared. So unlike everything else in this weather pass, this reads the server's own WeatherQuery sample at whatever tick it is called on, and there is nothing for a client to agree with.

Fields

AllowWhenSceneHasNoWeather

[Tooltip("What to do when the scene has no weather at all. Most scenes without weather should spawn normally, so this defaults to allowing it.")]
public bool AllowWhenSceneHasNoWeather

Field Value

bool

Invert

[Tooltip("Flip it: allow the respawn only while the weather is NOT doing this. The creature that hides from the rain.")]
public bool Invert

Field Value

bool

MinimumSeverity

[Tooltip("How hard it has to be doing it. 0 means any trace counts.")]
[Range(0, 1)]
public float MinimumSeverity

Field Value

float

Weather

[Tooltip("The kinds of weather this looks for over the spawner.")]
public WeatherKindMask Weather

Field Value

WeatherKindMask

Methods

OnCheckCondition(SpawnerRuntime)

Checks whether the condition allows spawner to respawn now.

public override bool OnCheckCondition(SpawnerRuntime spawner)

Parameters

spawner SpawnerRuntime

The spawner asking.

Returns

bool

True if respawn is allowed.

SeverityOf(in WeatherReading)

How hard the chosen kinds are coming down, 0..1: the worst of them.

public float SeverityOf(in WeatherReading sample)

Parameters

sample WeatherReading

Returns

float

Remarks

Read from the kinds actually chosen, so a spawner waiting on a thunderstorm is not released by heavy rain with no lightning in it.