Skip to content

Class: Treasure ​

csharp
[DewResourceLink(ResourceLinkBy.Type)]
public abstract class Treasure : Actor, ILogicUpdate, ICleanup, ICustomDestroyRoutine, IExcludeFromPool

Fields ​

NameDeclarationDescription
basePrice`[BoxGroup("Treasure Settings", true, false, 0)]
public int basePrice`
chanceWeight`[HideIf("@excludeFromPool", true)]
[BoxGroup("Treasure Settings", true, false, 0)]
public float chanceWeight`
excludeFromPool`[BoxGroup("Treasure Settings", true, false, 0)]
public bool excludeFromPool`
icon`[BoxGroup("Treasure Settings", true, false, 0)]
public Sprite icon`
maxUse`[BoxGroup("Treasure Settings", true, false, 0)]
public int maxUse`

Properties ​

NameDeclarationDescription
customDatapublic string customData { get; set; }
heropublic Hero hero { get; set; }
merchantpublic PropEnt_Merchant_Base merchant { get; set; }
playerpublic DewPlayer player { get; set; }
pricepublic int price { get; set; }

Methods ​

CanBePurchased() ​

This is checked on server upon purchase. If this returns false, purchase will not be made. You should show some kind of message to the user if this returns false.This is invoked on a prefab, and before being invoked, relevant fields like hero / player will be populated.

csharp
public virtual bool CanBePurchased()

Returns: bool

GetCustomDescription() ​

csharp
public virtual string GetCustomDescription()

Returns: string

GetCustomName() ​

csharp
public virtual string GetCustomName()

Returns: string

OnAddMerchandise(out Cost, out string) ​

csharp
public virtual void OnAddMerchandise(out Cost mercPrice, out string customData)

Parameters:

NameTypeDescription
mercPriceCost
customDatastring

ShouldBeIncludedInPool() ​

This is checked on server when populating for each player. If this returns false, this treasure will not be included in the pool.

csharp
public virtual bool ShouldBeIncludedInPool()

Returns: bool

Maintained by the Shape of Dreams Modding Community