Class: Shrine
- Namespace:
Global - Assembly:
Dew.Core.dll - Inheritance / Derived: DewNetworkBehaviour → Actor → ChoiceShrine → EditSkillShrine
public abstract class Shrine : Actor, ILogicUpdate, ICleanup, ICustomDestroyRoutine, IInteractable, IProp, IBanRoomNodesNearbyFields
| Name | Declaration | Description |
|---|---|---|
availableEffect | `[BoxGroup("Shrine Settings", true, false, 0)] | |
| public GameObject availableEffect` | ||
baseGoldCost | `[BoxGroup("Shrine Settings", true, false, 0)] | |
| public int baseGoldCost` | ||
ClientEvent_OnSuccessfulUse | public SafeAction<Entity> ClientEvent_OnSuccessfulUse | Called 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
| Name | Declaration | Description |
|---|---|---|
canInteractWithMouse | public virtual bool canInteractWithMouse { get; } | |
focusDistance | public float focusDistance { get; } | |
interactPivot | public virtual Transform interactPivot { get; } | |
isAvailable | `[SaveVar(SaveVarFlags.Default)] | |
| public bool isAvailable { get; set; }` | ||
isLocked | `[SaveVar(SaveVarFlags.Default)] | |
| public bool isLocked { get; set; }` | ||
isOnCooldown | public bool isOnCooldown { get; } | |
isRegularReward | public virtual bool isRegularReward { get; } | |
scaleSpawnRateWithPlayers | public bool scaleSpawnRateWithPlayers { get; } | |
totalUseCount | `[SaveVar(SaveVarFlags.Default)] | |
| public int totalUseCount { get; set; }` |
Methods
CanAfford(Entity)
Checked everywhere.
public AffordType CanAfford(Entity entity)Parameters:
| Name | Type | Description |
|---|---|---|
entity | Entity |
Returns: AffordType
CanInteract(Entity)
public virtual bool CanInteract(Entity entity)Parameters:
| Name | Type | Description |
|---|---|---|
entity | Entity |
Returns: bool
DoPostUseRoutines(Entity)
Deduct cost from the entity, increment use count and invoke callbacks.
public void DoPostUseRoutines(Entity entity)Parameters:
| Name | Type | Description |
|---|---|---|
entity | Entity |
GetClosestPointOnShrine(Vector3)
public Vector3 GetClosestPointOnShrine(Vector3 pos)Parameters:
| Name | Type | Description |
|---|---|---|
pos | UnityEngine.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.
public virtual Cost? GetCost(Entity activator)Parameters:
| Name | Type | Description |
|---|---|---|
activator | Entity |
Returns: Cost?
GetRandomSpawnPosition(Vector3)
public Vector3 GetRandomSpawnPosition(Vector3 activatorPos)Parameters:
| Name | Type | Description |
|---|---|---|
activatorPos | UnityEngine.Vector3 |
Returns: UnityEngine.Vector3
GetUseCountByPlayer(DewPlayer)
public int GetUseCountByPlayer(DewPlayer player)Parameters:
| Name | Type | Description |
|---|---|---|
player | DewPlayer |
Returns: int
MakeAvailable()
Forcibly make the shrine available for use. Callable on server.
[Button]
public void MakeAvailable()MakeUnavailable()
Forcibly make the shrine unavailable for use. Callable on server.
[Button]
public void MakeUnavailable()OnCreate()
protected override void OnCreate()OnDestroyActor()
protected override void OnDestroyActor()OnInteract(Entity, bool)
public virtual void OnInteract(Entity entity, bool alt)Parameters:
| Name | Type | Description |
|---|---|---|
entity | Entity | |
alt | bool |
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.
protected abstract bool OnUse(Entity entity)Parameters:
| Name | Type | Description |
|---|---|---|
entity | Entity |
Returns: bool
ResetUseCounts()
public void ResetUseCounts()ShouldBeSavedWithRoom()
public override bool ShouldBeSavedWithRoom()Returns: bool