Skip to content

Class: Shrine ​

csharp
public abstract class Shrine : Actor, ILogicUpdate, ICleanup, ICustomDestroyRoutine, IInteractable, IProp, IBanRoomNodesNearby

Fields ​

NameDeclarationDescription
availableEffect`[BoxGroup("Shrine Settings", true, false, 0)]
public GameObject availableEffect`
baseGoldCost`[BoxGroup("Shrine Settings", true, false, 0)]
public int baseGoldCost`
ClientEvent_OnSuccessfulUsepublic SafeAction<Entity> ClientEvent_OnSuccessfulUseCalled everywhere after an entity uses this shrine successfully.
interactableDelay`[BoxGroup("Shrine Settings", true, false, 0)]
public float interactableDelay`
lockedEffect`[BoxGroup("Shrine Settings", true, false, 0)]
public GameObject lockedEffect`
mapVisibility`[BoxGroup("Shrine Settings", true, false, 0)]
public MapItemVisibility mapVisibility`
maxTotalUseCount`[SaveVar(SaveVarFlags.Default)]
[FormerlySerializedAs("maxUseCount")]
[BoxGroup("Shrine Settings", true, false, 0)]
public int maxTotalUseCount`
maxUseCountPerPlayer`[BoxGroup("Shrine Settings", true, false, 0)]
public int maxUseCountPerPlayer`
model`[BoxGroup("Shrine Settings", true, false, 0)]
public GameObject model`
unavailableByDefault`[ToggleLeft]
[BoxGroup("Shrine Settings", true, false, 0)]
public bool unavailableByDefault`
unavailableEffect`[BoxGroup("Shrine Settings", true, false, 0)]
public GameObject unavailableEffect`
unlockEffect`[BoxGroup("Shrine Settings", true, false, 0)]
public GameObject unlockEffect`
useCooldown`[BoxGroup("Shrine Settings", true, false, 0)]
public float useCooldown`
useEffect`[BoxGroup("Shrine Settings", true, false, 0)]
public GameObject useEffect`
useEffectLocal`[BoxGroup("Shrine Settings", true, false, 0)]
public GameObject useEffectLocal`
useLockedEffect`[BoxGroup("Shrine Settings", true, false, 0)]
public GameObject useLockedEffect`

Properties ​

NameDeclarationDescription
canInteractWithMousepublic virtual bool canInteractWithMouse { get; }
focusDistancepublic float focusDistance { get; }
interactPivotpublic virtual Transform interactPivot { get; }
isAvailable`[SaveVar(SaveVarFlags.Default)]
public bool isAvailable { get; set; }`
isLocked`[SaveVar(SaveVarFlags.Default)]
public bool isLocked { get; set; }`
isOnCooldownpublic bool isOnCooldown { get; }
isRegularRewardpublic virtual bool isRegularReward { get; }
scaleSpawnRateWithPlayerspublic bool scaleSpawnRateWithPlayers { get; }
totalUseCount`[SaveVar(SaveVarFlags.Default)]
public int totalUseCount { get; set; }`

Methods ​

CanAfford(Entity) ​

Checked everywhere.

csharp
public AffordType CanAfford(Entity entity)

Parameters:

NameTypeDescription
entityEntity

Returns: AffordType

CanInteract(Entity) ​

csharp
public virtual bool CanInteract(Entity entity)

Parameters:

NameTypeDescription
entityEntity

Returns: bool

DoPostUseRoutines(Entity) ​

Deduct cost from the entity, increment use count and invoke callbacks.

csharp
public void DoPostUseRoutines(Entity entity)

Parameters:

NameTypeDescription
entityEntity

GetClosestPointOnShrine(Vector3) ​

csharp
public Vector3 GetClosestPointOnShrine(Vector3 pos)

Parameters:

NameTypeDescription
posUnityEngine.Vector3

Returns: UnityEngine.Vector3

GetCost(Entity) ​

Get gold/health cost of this shrine for specified activator. This must return consistent values across server and clients.

csharp
public virtual Cost? GetCost(Entity activator)

Parameters:

NameTypeDescription
activatorEntity

Returns: Cost?

GetRandomSpawnPosition(Vector3) ​

csharp
public Vector3 GetRandomSpawnPosition(Vector3 activatorPos)

Parameters:

NameTypeDescription
activatorPosUnityEngine.Vector3

Returns: UnityEngine.Vector3

GetUseCountByPlayer(DewPlayer) ​

csharp
public int GetUseCountByPlayer(DewPlayer player)

Parameters:

NameTypeDescription
playerDewPlayer

Returns: int

MakeAvailable() ​

Forcibly make the shrine available for use. Callable on server.

csharp
[Button]
public void MakeAvailable()

MakeUnavailable() ​

Forcibly make the shrine unavailable for use. Callable on server.

csharp
[Button]
public void MakeUnavailable()

OnCreate() ​

csharp
protected override void OnCreate()

OnDestroyActor() ​

csharp
protected override void OnDestroyActor()

OnInteract(Entity, bool) ​

csharp
public virtual void OnInteract(Entity entity, bool alt)

Parameters:

NameTypeDescription
entityEntity
altbool

OnUse(Entity) ​

Called on server when an entity uses this shrine. Return value must indicate success of this use.Returning true will play use effect, increment use count, and deduct cost from entity.

csharp
protected abstract bool OnUse(Entity entity)

Parameters:

NameTypeDescription
entityEntity

Returns: bool

ResetUseCounts() ​

csharp
public void ResetUseCounts()

ShouldBeSavedWithRoom() ​

csharp
public override bool ShouldBeSavedWithRoom()

Returns: bool

Maintained by the Shape of Dreams Modding Community