Description:
Set difficulty.
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
@@ -108,6 +108,12 | |||||
|
108 |
|
108 | ||
|
109 | this.game.enqueueDialog(DialogTrees.flatten(DialogTrees.testTree, this.grammar)); |
|
109 | this.game.enqueueDialog(DialogTrees.flatten(DialogTrees.testTree, this.grammar)); |
|
110 | #endregion |
|
110 | #endregion |
|
|
111 | this.simulation.Subsidy = message.Difficulty switch { | ||
|
|
112 | DifficultyLevel.Hard => 0M, | ||
|
|
113 | DifficultyLevel.Medium => 750M, | ||
|
|
114 | DifficultyLevel.Easy => 1000M, | ||
|
|
115 | }; | ||
|
|
116 | |||
|
111 | Logging.Success("Spawned new game."); |
|
117 | Logging.Success("Spawned new game."); |
|
112 |
|
118 | ||
|
113 | } |
|
119 | } |
@@ -2,5 +2,15 | |||||
|
2 |
|
2 | ||
|
3 | namespace isometricparkfna.Messages { |
|
3 | namespace isometricparkfna.Messages { |
|
4 |
|
4 | ||
|
5 | public struct SpawnGameMessage : IMessage { } |
|
5 | public enum DifficultyLevel |
|
|
6 | { | ||
|
|
7 | Easy, | ||
|
|
8 | Medium, | ||
|
|
9 | Hard | ||
|
|
10 | } | ||
|
|
11 | |||
|
|
12 | |||
|
|
13 | public struct SpawnGameMessage : IMessage { | ||
|
|
14 | public DifficultyLevel Difficulty; | ||
|
|
15 | } | ||
|
6 | } |
|
16 | } |
@@ -61,6 +61,8 | |||||
|
61 | public const int MAX_TREES_TO_PLANT = 25; |
|
61 | public const int MAX_TREES_TO_PLANT = 25; |
|
62 | public const int MAX_TREES_TO_CLEAR = 25; |
|
62 | public const int MAX_TREES_TO_CLEAR = 25; |
|
63 |
|
63 | ||
|
|
64 | public decimal Subsidy { get; set; } | ||
|
|
65 | |||
|
64 | public int Tick |
|
66 | public int Tick |
|
65 | { |
|
67 | { |
|
66 | get; |
|
68 | get; |
@@ -297,7 +299,7 | |||||
|
297 | DateTime = this.DateTime, |
|
299 | DateTime = this.DateTime, |
|
298 | money = this.money, |
|
300 | money = this.money, |
|
299 | trees = this.map.tree_count, |
|
301 | trees = this.map.tree_count, |
|
300 |
subsidy = |
|
302 | subsidy = this.Subsidy, |
|
301 | contracts = this.contracts, |
|
303 | contracts = this.contracts, |
|
302 | enforcement = this.enforcement, |
|
304 | enforcement = this.enforcement, |
|
303 | upkeep = (int)(this.map.tree_count * 1.5), |
|
305 | upkeep = (int)(this.map.tree_count * 1.5), |
@@ -49,6 +49,7 | |||||
|
49 |
|
49 | ||
|
50 | bridgeEngine.gameStateMessages.Add(new GameStateMessage{isPlaying = false}); |
|
50 | bridgeEngine.gameStateMessages.Add(new GameStateMessage{isPlaying = false}); |
|
51 | bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage{Window = Window.InGameMenu}); |
|
51 | bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage{Window = Window.InGameMenu}); |
|
|
52 | bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage{Window = Window.MainMenu}); | ||
|
52 | } |
|
53 | } |
|
53 | if (ImGui.Button("Quit", button_size)) |
|
54 | if (ImGui.Button("Quit", button_size)) |
|
54 | { |
|
55 | { |
@@ -12,13 +12,6 | |||||
|
12 | namespace isometricparkfna.UI |
|
12 | namespace isometricparkfna.UI |
|
13 | { |
|
13 | { |
|
14 |
|
14 | ||
|
15 | enum DifficultyLevel |
|
||
|
16 | { |
|
||
|
17 | Easy, |
|
||
|
18 | Medium, |
|
||
|
19 | Hard |
|
||
|
20 | } |
|
||
|
21 |
|
|||
|
22 | public static class NewGameWindow |
|
15 | public static class NewGameWindow |
|
23 | { |
|
16 | { |
|
24 |
|
17 | ||
@@ -47,6 +40,13 | |||||
|
47 |
|
40 | ||
|
48 | public static void Initialize() |
|
41 | public static void Initialize() |
|
49 | { |
|
42 | { |
|
|
43 | NewGameWindow.Reset(); | ||
|
|
44 | |||
|
|
45 | showModal = true; | ||
|
|
46 | |||
|
|
47 | } | ||
|
|
48 | |||
|
|
49 | public static void Reset() { | ||
|
50 | parkNameBuffer = new byte[BUFFER_SIZE]; |
|
50 | parkNameBuffer = new byte[BUFFER_SIZE]; |
|
51 | pos = 0; |
|
51 | pos = 0; |
|
52 |
|
52 | ||
@@ -60,9 +60,6 | |||||
|
60 |
|
60 | ||
|
61 | customTitleBuffer = new byte[BUFFER_SIZE]; |
|
61 | customTitleBuffer = new byte[BUFFER_SIZE]; |
|
62 | customTitlePos = 0; |
|
62 | customTitlePos = 0; |
|
63 |
|
|||
|
64 | showModal = true; |
|
||
|
65 |
|
|||
|
66 | } |
|
63 | } |
|
67 |
|
64 | ||
|
68 | public static void Render(ImFontPtr font, ImFontPtr italicFont, ImGuiWindowBridgeEngine bridgeEngine) |
|
65 | public static void Render(ImFontPtr font, ImFontPtr italicFont, ImGuiWindowBridgeEngine bridgeEngine) |
@@ -197,9 +194,10 | |||||
|
197 | bridgeEngine.setTextVariableMessages.Add(new SetTextVariableMessage { variable = "playerCasual", value = playerName2Buffer }); |
|
194 | bridgeEngine.setTextVariableMessages.Add(new SetTextVariableMessage { variable = "playerCasual", value = playerName2Buffer }); |
|
198 | bridgeEngine.setTextVariableMessages.Add(new SetTextVariableMessage { variable = "playerTitle", value = selectedTitle}); |
|
195 | bridgeEngine.setTextVariableMessages.Add(new SetTextVariableMessage { variable = "playerTitle", value = selectedTitle}); |
|
199 |
|
196 | ||
|
200 | bridgeEngine.spawnGameMessages.Add(new SpawnGameMessage{}); |
|
197 | bridgeEngine.spawnGameMessages.Add(new SpawnGameMessage{ Difficulty = (DifficultyLevel)choice }); |
|
201 | bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage {Window = Window.NewGame}); |
|
198 | bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage {Window = Window.NewGame}); |
|
202 | bridgeEngine.gameStateMessages.Add(new GameStateMessage { isPlaying = true}); |
|
199 | bridgeEngine.gameStateMessages.Add(new GameStateMessage { isPlaying = true}); |
|
|
200 | NewGameWindow.Reset(); | ||
|
203 | } |
|
201 | } |
|
204 |
|
202 | ||
|
205 | ImGui.SameLine(); |
|
203 | ImGui.SameLine(); |
@@ -208,6 +206,7 | |||||
|
208 | bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage {Window = Window.NewGame}); |
|
206 | bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage {Window = Window.NewGame}); |
|
209 |
|
207 | ||
|
210 | bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage { Window = Window.MainMenu }); |
|
208 | bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage { Window = Window.MainMenu }); |
|
|
209 | NewGameWindow.Reset(); | ||
|
211 | } |
|
210 | } |
|
212 |
|
211 | ||
|
213 |
|
212 |
You need to be logged in to leave comments.
Login now