Skip to content

Class: GameManager ​

csharp
public class GameManager : NetworkedManagerBase<GameManager>, ILogicUpdate

Fields ​

NameDeclarationDescription
ClientEvent_OnAmbientLevelChangedpublic SafeAction&lt;int, int&gt; ClientEvent_OnAmbientLevelChangedCalled everywhere when ambient level changes
ClientEvent_OnDifficultyChangedpublic SafeAction&lt;DewDifficultySettings, DewDifficultySettings&gt; ClientEvent_OnDifficultyChangedCalled everywhere when threat level changes
ClientEvent_OnGameConcludedpublic SafeAction ClientEvent_OnGameConcludedCalled everywhere when game is concluded
disableStuckCheckpublic bool disableStuckCheck
gainedExpMultiplier`[NonSerialized]
public float gainedExpMultiplier`
gespublic DewGameplayExperienceSettings ges
gesTemplate`[FormerlySerializedAs("gss")]
public DewGameplayExperienceSettings gesTemplate`
goldCostMultiplier`[NonSerialized]
public float goldCostMultiplier`
goldIncomeMultiplier`[NonSerialized]
public float goldIncomeMultiplier`
playerRejoinData`[SaveVar(SaveVarFlags.Default)]
public Dictionary<string, DewPersistence.PlayerData> playerRejoinData`
predictionStrengthOverridepublic Func&lt;float&gt; predictionStrengthOverride

Properties ​

NameDeclarationDescription
ambientLevel`[SaveVar(SaveVarFlags.Default)]
public int ambientLevel { get; set; }`
difficulty`[SaveVar(SaveVarFlags.Default)]
public DewDifficultySettings difficulty { get; set; }`
elapsedGameTime`[SaveVar(SaveVarFlags.Default)]
public float elapsedGameTime { get; set; }`Elapsed game time in seconds.
isGameConcludedpublic bool isGameConcluded { get; }
isGameOverEnabledpublic bool isGameOverEnabled { get; set; }
isGameTimePausedpublic bool isGameTimePaused { get; }
isGameTimePausedByAfkpublic bool isGameTimePausedByAfk { get; set; }
isGameTimePausedByGamepublic bool isGameTimePausedByGame { get; set; }
isMidRunSaveLockedpublic bool isMidRunSaveLocked { get; }Is continue save blocked by LockMidRunSave()? Available everywhere.
isSpawnOverPopulationpublic bool isSpawnOverPopulation { get; }
maxAndSpawnedPopulationMultiplierpublic float maxAndSpawnedPopulationMultiplier { get; set; }
maxSpawnedPopulationpublic float maxSpawnedPopulation { get; }
runId`[SaveVar(SaveVarFlags.Default)]
public string runId { get; set; }`Globally unique identifier of this run. This is consistent across all clients.
spawnedPopulationpublic float spawnedPopulation { get; }Total population excluding env spawns. => Spawns from combat areas.

Methods ​

Awake() ​

csharp
protected override void Awake()

CallOnReady(Action) ​

Call provided function if the game is ready. (Client is ready, Server is not loading scene, has local hero, map is loaded, screen is shown)If not ready, the function call will be delayed until it is.Available on server and clients.

csharp
public static void CallOnReady(Action action)

Parameters:

NameTypeDescription
actionSystem.Action

CollectAllPlayersRejoinData() ​

csharp
public void CollectAllPlayersRejoinData()

CollectPlayerRejoinData(DewPlayer) ​

csharp
public void CollectPlayerRejoinData(DewPlayer p)

Parameters:

NameTypeDescription
pDewPlayer

ConcludePureWhiteDream() ​

csharp
public void ConcludePureWhiteDream()

ConcludeUnknownFate() ​

csharp
public void ConcludeUnknownFate()

GetAdjustedDroppedExperienceAmount(float) ​

csharp
public float GetAdjustedDroppedExperienceAmount(float original)

Parameters:

NameTypeDescription
originalfloat

Returns: float

GetAdjustedGoldAmount_Cost_Service(float) ​

csharp
public float GetAdjustedGoldAmount_Cost_Service(float baseAmount)

Parameters:

NameTypeDescription
baseAmountfloat

Returns: float

GetAdjustedGoldAmount_Cost(float) ​

csharp
public float GetAdjustedGoldAmount_Cost(float amount)

Parameters:

NameTypeDescription
amountfloat

Returns: float

GetAdjustedGoldAmount_Income(float) ​

csharp
public float GetAdjustedGoldAmount_Income(float amount)

Parameters:

NameTypeDescription
amountfloat

Returns: float

GetAdjustedGoldAmount(float) ​

csharp
public float GetAdjustedGoldAmount(float amount)

Parameters:

NameTypeDescription
amountfloat

Returns: float

GetAdjustedMonsterSpawnPopulation(float, bool, bool) ​

csharp
public float GetAdjustedMonsterSpawnPopulation(float original, bool ignoreTurnMultiplier = false, bool ignoreCoopMultiplier = false)

Parameters:

NameTypeDescription
originalfloat
ignoreTurnMultiplierbool
ignoreCoopMultiplierbool

Returns: float

GetAdjustedMonsterWaves(int, DewRandom) ​

csharp
public int GetAdjustedMonsterWaves(int original, DewRandom random = null)

Parameters:

NameTypeDescription
originalint
randomDewRandom

Returns: int

GetAdjustedMonsterWavesMultiplier() ​

csharp
public float GetAdjustedMonsterWavesMultiplier()

Returns: float

GetBossMonsterDamageMultiplierByScaling(float) ​

csharp
public float GetBossMonsterDamageMultiplierByScaling(float customZoneIndex = NaN)

Parameters:

NameTypeDescription
customZoneIndexfloat

Returns: float

GetBossMonsterHealthMultiplierByScaling(float) ​

csharp
public float GetBossMonsterHealthMultiplierByScaling(float customZoneIndex = NaN)

Parameters:

NameTypeDescription
customZoneIndexfloat

Returns: float

GetCleanseGemMinQuality() ​

csharp
public int GetCleanseGemMinQuality()

Returns: int

GetCleanseGoldCost(Gem) ​

csharp
public int GetCleanseGoldCost(Gem gem)

Parameters:

NameTypeDescription
gemGem

Returns: int

GetCleanseGoldCost(SkillTrigger) ​

csharp
public int GetCleanseGoldCost(SkillTrigger skill)

Parameters:

NameTypeDescription
skillSkillTrigger

Returns: int

GetCleanseReturnedDreamDust(DewPlayer, Gem) ​

csharp
public int GetCleanseReturnedDreamDust(DewPlayer player, Gem gem)

Parameters:

NameTypeDescription
playerDewPlayer
gemGem

Returns: int

GetCleanseReturnedDreamDust(DewPlayer, SkillTrigger) ​

csharp
public int GetCleanseReturnedDreamDust(DewPlayer player, SkillTrigger skill)

Parameters:

NameTypeDescription
playerDewPlayer
skillSkillTrigger

Returns: int

GetCleanseSkillMinLevel() ​

csharp
public int GetCleanseSkillMinLevel()

Returns: int

GetDifficulty() ​

csharp
protected virtual DewDifficultySettings GetDifficulty()

Returns: DewDifficultySettings

GetExpDropFromEntity(Entity) ​

csharp
public float GetExpDropFromEntity(Entity ent)

Parameters:

NameTypeDescription
entEntity

Returns: float

GetGainedSkillHastePerSkillLevel(SkillTrigger) ​

csharp
public float GetGainedSkillHastePerSkillLevel(SkillTrigger skillTrigger)

Parameters:

NameTypeDescription
skillTriggerSkillTrigger

Returns: float

GetGemUpgradeAddedQuality() ​

csharp
public int GetGemUpgradeAddedQuality()

Returns: int

GetGemUpgradeDreamDustCost(Gem) ​

csharp
public int GetGemUpgradeDreamDustCost(Gem gem)

Parameters:

NameTypeDescription
gemGem

Returns: int

GetGemUpgradeDreamDustCost(int) ​

csharp
public int GetGemUpgradeDreamDustCost(int quality)

Parameters:

NameTypeDescription
qualityint

Returns: int

GetKillGoldAmount(Entity) ​

csharp
public int GetKillGoldAmount(Entity ent)

Parameters:

NameTypeDescription
entEntity

Returns: int

GetLucidDreams() ​

csharp
public virtual IList<string> GetLucidDreams()

Returns: System.Collections.Generic.IList&lt;T&gt;&lt;string&gt;

GetMiniBossMonsterDamageMultiplierByScaling(float) ​

csharp
public float GetMiniBossMonsterDamageMultiplierByScaling(float customZoneIndex = NaN)

Parameters:

NameTypeDescription
customZoneIndexfloat

Returns: float

GetMiniBossMonsterHealthMultiplierByScaling(float) ​

csharp
public float GetMiniBossMonsterHealthMultiplierByScaling(float customZoneIndex = NaN)

Parameters:

NameTypeDescription
customZoneIndexfloat

Returns: float

GetMonsterBonusHealthPercentageByMultiplayer(Monster) ​

csharp
public float GetMonsterBonusHealthPercentageByMultiplayer(Monster m)

Parameters:

NameTypeDescription
mMonster

Returns: float

GetMonsterBonusPowerPercentage(Monster) ​

csharp
public float GetMonsterBonusPowerPercentage(Monster m)

Parameters:

NameTypeDescription
mMonster

Returns: float

GetMultiplayerDifficultyFactor(bool) ​

Get amount of extra players. Solo: 0, Two: 1, ...If reduceWhenDead is set, dead player will contribute 55% percent instead of 100% to the factor.

csharp
public float GetMultiplayerDifficultyFactor(bool reduceWhenDead)

Parameters:

NameTypeDescription
reduceWhenDeadbool

Returns: float

GetMultiplier_Imp(double, double, double, double, double, int) ​

csharp
public static float GetMultiplier_Imp(double x, double a, double b, double c, double d, int linearStart)

Parameters:

NameTypeDescription
xdouble
adouble
bdouble
cdouble
ddouble
linearStartint

Returns: float

GetPredictionStrength() ​

csharp
public float GetPredictionStrength()

Returns: float

GetRegularMonsterDamageMultiplierByScaling(float) ​

csharp
public float GetRegularMonsterDamageMultiplierByScaling(float customZoneIndex = NaN)

Parameters:

NameTypeDescription
customZoneIndexfloat

Returns: float

GetRegularMonsterHealthMultiplierByScaling(float) ​

csharp
public float GetRegularMonsterHealthMultiplierByScaling(float customZoneIndex = NaN)

Parameters:

NameTypeDescription
customZoneIndexfloat

Returns: float

GetSkillUpgradeDreamDustCost(SkillTrigger) ​

csharp
public int GetSkillUpgradeDreamDustCost(SkillTrigger skill)

Parameters:

NameTypeDescription
skillSkillTrigger

Returns: int

GetSkillUpgradeDreamDustCost(int) ​

csharp
public int GetSkillUpgradeDreamDustCost(int level)

Parameters:

NameTypeDescription
levelint

Returns: int

GetSpecialRewardAmount_DreamDust() ​

csharp
public float GetSpecialRewardAmount_DreamDust()

Returns: float

GetSpecialRewardAmount_Gold() ​

csharp
public float GetSpecialRewardAmount_Gold()

Returns: float

GetSpecialSkillChanceMultiplier() ​

csharp
public float GetSpecialSkillChanceMultiplier()

Returns: float

GetStrongHealthScalingMultiplier_Imp(float) ​

csharp
public static float GetStrongHealthScalingMultiplier_Imp(float zi)

Parameters:

NameTypeDescription
zifloat

Returns: float

GetUniversalDamageScalingMultiplier_Imp(float) ​

csharp
public static float GetUniversalDamageScalingMultiplier_Imp(float zi)

Parameters:

NameTypeDescription
zifloat

Returns: float

GetWeakHealthScalingMultiplier_Imp(float) ​

csharp
public static float GetWeakHealthScalingMultiplier_Imp(float zi)

Parameters:

NameTypeDescription
zifloat

Returns: float

IsContinueSaveSupported() ​

Is continue-saving a normal thing in this game manager? If not, no continue save will be made, and user will not be notified with any save-related things.Used to tell apart from normal game and special games like tutorial.

csharp
public virtual bool IsContinueSaveSupported()

Returns: bool

IsEligibleForMidRunSave() ​

Can the game be saved mid-run right now? Usually save is made every travel, but after clearing the room, the game can be saved mid-run e.g. before exiting the game.

csharp
public bool IsEligibleForMidRunSave()

Returns: bool

IsLazyCallReady() ​

csharp
public virtual bool IsLazyCallReady()

Returns: bool

LoadNextZone() ​

csharp
public virtual void LoadNextZone()

LockMidRunSave() ​

Calling this will lock mid-run save.If a continue save hasn't been made for more than 20 seconds, a continue save will be immediately made.This call MUST BE ACCOMPANIED by the same number of UnlockMidRunSave() calls.

csharp
public void LockMidRunSave()

LogicUpdate(float) ​

csharp
public override void LogicUpdate(float dt)

Parameters:

NameTypeDescription
dtfloat

OnDestroy() ​

csharp
protected override void OnDestroy()

OnStart() ​

csharp
public override void OnStart()

OnStartServer() ​

csharp
public override void OnStartServer()

ResetGameplayExperienceSettings() ​

csharp
public void ResetGameplayExperienceSettings()

SaveContinueData(LoadNodeSettings) ​

csharp
public void SaveContinueData(LoadNodeSettings s)

Parameters:

NameTypeDescription
sLoadNodeSettings

SaveContinueDataMidRun() ​

csharp
public void SaveContinueDataMidRun()

SetAmbientLevel(int) ​

Level will be clamped accordingly to GSS.

csharp
public void SetAmbientLevel(int newLevel)

Parameters:

NameTypeDescription
newLevelint

SetDisconnectedForEveryoneElse() ​

csharp
public void SetDisconnectedForEveryoneElse()

SetElapsedGameTime(float) ​

csharp
public void SetElapsedGameTime(float newTime)

Parameters:

NameTypeDescription
newTimefloat

UnlockMidRunSave() ​

Calling this will unlock and allow mid-run saves.This call MUST BE DONE AFTER LockMidRunSave() calls.

csharp
public void UnlockMidRunSave()

UpdateSpawnedPopulation() ​

csharp
public void UpdateSpawnedPopulation()

WrapUpAndShowResult(ResultType) ​

csharp
public void WrapUpAndShowResult(DewGameResult.ResultType type)

Parameters:

NameTypeDescription
typeDewGameResult.ResultType

Maintained by the Shape of Dreams Modding Community