···131314141515func _ready() -> void:
1616- cured_people.max_value = 20 # Change to cured people to win
1616+ cured_people.max_value = Global.CURED_CITIZENS_FOR_VICTORY # Change to cured people to win
1717 sick_people.max_value = Global.population_total
18181919 update_ui_metrics()
···21212222func update_ui_metrics():
2323 # Access and set the Global variables to the UI metrics
2424- sick_people.value = Global.people_sick + Global.STARTER_SICK_COUNTER
2525- sick_people_counter.text = str(Global.people_sick + Global.STARTER_SICK_COUNTER)
2424+ sick_people.value = Global.people_sick
2525+ sick_people_counter.text = str(Global.people_sick)
26262727 cured_people.value = Global.people_cured
2828 cured_people_counter.text = str(Global.people_cured)
+22-6
Scripts/global.gd
···11extends Node
2233#region DEV OPTIONS
44-const PAUSE_ON_EVENT: bool = true # Pauses the game while the player is making decisions
44+const PAUSE_ON_EVENT: bool = false # Pauses the game while the player is making decisions
55+const APPLY_MULT_TO_FAILED_CHOICE: bool = true # Pauses the game while the player is making decisions
56#endregion
6778#region Varaibles
···910var is_currently_in_decision: bool = false
1011@onready var rng := RandomNumberGenerator.new()
11121212-var population_total: int = 150
1313+const population_total: int = 120
13141415var people_cured: int = 0:
1516 get:
···1718 set(value):
1819 people_cured = value
1920 SignalBus.update_ui_metrics.emit()
2121+ SignalBus.updated_scores.emit()
20222123var people_sick: int = 0:
2224 get:
···2426 set(value):
2527 people_sick = value
2628 SignalBus.update_ui_metrics.emit()
2929+ SignalBus.updated_scores.emit()
27302831var available_doctors: int = 2:
2932 get:
···4144enum UnitType {DOCTOR, PRIEST}
4245enum HouseType {PEASANT, NOBLE}
43464747+const CURED_CITIZENS_FOR_VICTORY: int = 20
4448const STARTER_SICK_COUNTER: int = 15
45494650var target_location: Vector2
···5155 return (available_doctors + available_priests > 0)
52565357func handle_choice_result(result: bool, house_type: HouseType) -> void:
5454- if result:
5555- var mult: int = 1
5656- if house_type == HouseType.NOBLE:
5858+ var mult: int = 1
5959+ if house_type == HouseType.NOBLE:
5760 mult = 2
6161+6262+ if result:
5863 people_cured += 1 * mult
5964 people_sick -= 3 * mult
6065 #SignalBus.play_cured.emit()
6166 else:
6262- people_sick += 2
6767+ var incr_value := 2
6868+ if APPLY_MULT_TO_FAILED_CHOICE:
6969+ incr_value = incr_value * mult
7070+ people_sick += incr_value
6371 #SignalBus.play_sick.emit()
64726573func _init() -> void:
6674 Console.register_custom_command("debug", _toggle_debug_mode)
6775 Console.register_custom_command("fps", _get_fps)
6876 #Console.register_custom_command("spawn_doctor", _spawn_unit)
7777+7878+ people_sick = STARTER_SICK_COUNTER
7979+8080+# In reality all these values should be moved to gameplay but it's not necesary for what is effectively a demo
8181+func reset() -> void:
8282+ people_cured = 0
8383+ people_sick = STARTER_SICK_COUNTER
8484+ is_currently_in_decision = false
69857086func get_target_location() -> Vector2:
7187 return target_location