Repository navigation
Expand file tree
/
Copy pathGameDifficultySettingsController.cs
More file actions
56 lines (49 loc) · 2.27 KB
/
Copy pathGameDifficultySettingsController.cs
File metadata and controls
56 lines (49 loc) · 2.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
using Kitchen;
using KitchenData;
namespace KitchenCustomDifficulty
{
internal class GameDifficultySettingsController : DaySystem
{
private GameDifficultySettings _defaultValues;
bool _isInit = false;
protected override void Initialise()
{
base.Initialise();
}
protected override void OnUpdate()
{
if (!_isInit)
{
GameDifficultySettings difficulty = GameData.Main.Difficulty;
_defaultValues = new GameDifficultySettings()
{
CustomersPerHourBase = difficulty.CustomersPerHourBase,
CustomersPerHourIncreasePerDay = difficulty.CustomersPerHourIncreasePerDay,
CustomerSideChance = difficulty.CustomerSideChance,
QueuePatienceTime = difficulty.QueuePatienceTime,
QueuePatienceBoost = difficulty.QueuePatienceBoost,
CustomerStarterChance = difficulty.CustomerStarterChance,
GroupDessertChance = difficulty.GroupDessertChance
};
_isInit = true;
}
GameData.Main.Difficulty.CustomerStarterChance = _defaultValues.CustomerStarterChance * GetMultiplier(Main.ORDER_STARTER_MODIFIER_ID);
GameData.Main.Difficulty.CustomerSideChance = _defaultValues.CustomerSideChance * GetMultiplier(Main.ORDER_SIDES_MODIFIER_ID);
GameData.Main.Difficulty.GroupDessertChance = _defaultValues.GroupDessertChance * GetMultiplier(Main.ORDER_DESSERT_MODIFIER_ID);
if (Main.PrefSysManager.Get<int>(Main.PHASE_PATIENCE_ENABLED_ID) == 1)
{
GameData.Main.Difficulty.QueuePatienceTime = _defaultValues.QueuePatienceTime * GetMultiplier(Main.PATIENCE_QUEUE_ID);
GameData.Main.Difficulty.QueuePatienceBoost = _defaultValues.QueuePatienceBoost * GetMultiplier(Main.PATIENCE_QUEUE_BOOST_ID);
}
}
private float GetMultiplier(string preferenceID)
{
float prefVal = Main.PrefSysManager.Get<int>(preferenceID);
if (prefVal == -1)
{
prefVal = Main.DefaultValuesDict[preferenceID];
}
return prefVal / 100f;
}
}
}