Class RoomModifierBase
Inheritance
object
UnityEngine.Object
UnityEngine.Component
UnityEngine.Behaviour
UnityEngine.MonoBehaviour
Mirror.NetworkBehaviour
RoomModifierBase
Assembly: Dew.Core.dll
Syntax
public class RoomModifierBase : Actor, ILogicUpdate, ICleanup, ICustomDestroyRoutine, IExcludeFromPool
Fields
allowedZones
Declaration
[ShowIf("@chance > 0.000001f", true)]
[InfoBox("All zones will be allowed to have this modifier", InfoMessageType.Info, "@allowedZones == null || allowedZones.Length == 0")]
[InfoBox("@GetZoneValidationMessage(allowedZones)", InfoMessageType.Error, "@GetZoneValidationMessage(allowedZones) != null")]
public string[] allowedZones
Field Value
| Type |
Description |
| string[] |
|
chance
Declaration
[LabelText("@spawnType.ToString()")]
public float chance
Field Value
difficultyScaling
Declaration
[ShowIf("@chance > 0.000001f", true)]
public ScaleWithDifficultyMode difficultyScaling
Field Value
disableOtherEnvParticles
Declaration
[ToggleLeft]
public bool disableOtherEnvParticles
Field Value
disallowOtherModifiers
Declaration
[ShowIf("@chance > 0.000001f", true)]
[ToggleLeft]
public bool disallowOtherModifiers
Field Value
enableInnerDecorations
Declaration
[Title("Decorations", null, TitleAlignments.Left, true, true)]
[ToggleLeft]
public bool enableInnerDecorations
Field Value
enableOuterDecorations
Declaration
[ToggleLeft]
public bool enableOuterDecorations
Field Value
excludeFromPool
Declaration
public bool excludeFromPool
Field Value
fxLoop
Declaration
[Title("Effects", null, TitleAlignments.Left, true, true)]
public GameObject fxLoop
Field Value
| Type |
Description |
| UnityEngine.GameObject |
|
hiddenOnVisitedNode
Declaration
[ShowIf("@isMain || visibilityOnWorld != NodeModifierVisibility.Hidden", true)]
public bool hiddenOnVisitedNode
Field Value
innerDecorations
Declaration
[BoxGroup("Inner Decorations", true, false, 0)]
[InlineProperty]
[HideLabel]
[ShowIf("enableInnerDecorations", true)]
public DecorationSettings innerDecorations
Field Value
isMain
Main modifiers will print notification when user enters the node.
A node can only have a single main modifier.
Declaration
[Title("General", null, TitleAlignments.Left, true, true)]
[FormerlySerializedAs("showOnTopRight")]
public bool isMain
Field Value
mainColor
Declaration
[ShowIf("@isMain || visibilityOnWorld != NodeModifierVisibility.Hidden", true)]
public Color mainColor
Field Value
| Type |
Description |
| UnityEngine.Color |
|
mapSprite
Declaration
[ShowIf("@isMain || visibilityOnWorld != NodeModifierVisibility.Hidden", true)]
public Sprite mapSprite
Field Value
| Type |
Description |
| UnityEngine.Sprite |
|
mapSpriteScale
Declaration
[ShowIf("@isMain || visibilityOnWorld != NodeModifierVisibility.Hidden", true)]
public float mapSpriteScale
Field Value
modifiesRewards
Declaration
[ShowIf("@chance > 0.000001f", true)]
[ToggleLeft]
public bool modifiesRewards
Field Value
outerDecorations
Declaration
[BoxGroup("Outer Decorations", true, false, 0)]
[InlineProperty]
[HideLabel]
[ShowIf("enableOuterDecorations", true)]
public DecorationSettings outerDecorations
Field Value
removeModifierWhenOverrideOverwritten
Declaration
[ToggleLeft]
[ShowIf("@!string.IsNullOrEmpty(roomOverride)", true)]
public bool removeModifierWhenOverrideOverwritten
Field Value
roomOverride
Declaration
public string roomOverride
Field Value
spawnedDecorations
Declaration
public readonly List<GameObject> spawnedDecorations
Field Value
| Type |
Description |
| System.Collections.Generic.List<T><UnityEngine.GameObject> |
|
spawnOncePerLoop
Declaration
[ShowIf("@chance > 0.000001f", true)]
[ToggleLeft]
public bool spawnOncePerLoop
Field Value
spawnType
Declaration
[Title("Natural Spawn Settings", null, TitleAlignments.Left, true, true)]
public ModifierSpawnType spawnType
Field Value
visibilityOnWorld
Declaration
public NodeModifierVisibility visibilityOnWorld
Field Value
zoneIndexRange
Declaration
[ShowIf("@chance > 0.000001f", true)]
public Vector2Int zoneIndexRange
Field Value
| Type |
Description |
| UnityEngine.Vector2Int |
|
Properties
id
Modifier id of this modifier instance.
Declaration
[SaveVar(SaveVarFlags.Default)]
public int id { get; }
Property Value
isDestroyedOnRoomChange
Declaration
public override bool isDestroyedOnRoomChange { get; }
Property Value
Overrides
modData
Declaration
public ModifierData modData { get; }
Property Value
Methods
CanSpawnAtNode(int)
Checked on server, on the modifier prefab, when generating the world.
It will be called in the middle of generating the world, but essential things like basic node positions and distances will be provided.
Declaration
public virtual bool CanSpawnAtNode(int nodeIndex)
Parameters
| Type |
Name |
Description |
| int |
nodeIndex |
|
Returns
GetScaledChance()
Declaration
public float GetScaledChance()
Returns
IsAvailableInGame()
Is this modifier available in game? If false, this modifier will not be applied to nodes.
Checked on server everytime when generating world.
NOTE that in-game constellation registration happens AFTER first world generation!!!!
Declaration
public virtual bool IsAvailableInGame()
Returns
ModifyEntities(Action<Entity>, Action<Entity>)
Modify all entities.
onStart is called on all existing entities and entities spawned in the future.
onStop is called on all existing entities when modifier stops.
Declaration
public void ModifyEntities(Action<Entity> onStart, Action<Entity> onStop)
Parameters
| Type |
Name |
Description |
| System.Action<T><Entity> |
onStart |
|
| System.Action<T><Entity> |
onStop |
|
OnCreate()
Declaration
protected override void OnCreate()
Overrides
OnDestroyActor()
Declaration
protected override void OnDestroyActor()
Overrides
OnStart()
Declaration
public override void OnStart()
Overrides
PlaceDecorations(DecorationSettings, IReadOnlyList<(int, int)>)
Declaration
public static List<GameObject> PlaceDecorations(DecorationSettings s, IReadOnlyList<(int, int)> indices)
Parameters
| Type |
Name |
Description |
| DecorationSettings |
s |
|
| System.Collections.Generic.IReadOnlyList<T><(int, int)> |
indices |
|
Returns
| Type |
Description |
| System.Collections.Generic.List<T><UnityEngine.GameObject> |
|
PlaceShrine<T>(PlaceShrineSettings)
Places a shrine on random position.
This function properly handles revisits.
Warning: does not support multiple shrines of same type
Declaration
public void PlaceShrine<T>(PlaceShrineSettings settings) where T : Shrine
Parameters
Type Parameters
RemoveModifier()
Remove and destroy this modifier.
Declaration
public void RemoveModifier()
ShouldBeSavedWithRoom()
Declaration
public override bool ShouldBeSavedWithRoom()
Returns
Overrides
Explicit Interface Implementations
IExcludeFromPool.excludeFromPool
Declaration
bool IExcludeFromPool.excludeFromPool { get; }
Returns
Implements
Extension Methods