diff --git a/max-effort/Scenes/.idea/.gitignore b/max-effort/Scenes/.idea/.gitignore
deleted file mode 100644
index bc420b8..0000000
--- a/max-effort/Scenes/.idea/.gitignore
+++ /dev/null
@@ -1,15 +0,0 @@
-# Default ignored files
-/shelf/
-/workspace.xml
-# Rider ignored files
-/projectSettingsUpdater.xml
-/.idea.Scenes.iml
-/modules.xml
-/contentModel.xml
-# Ignored default folder with query files
-/queries/
-# Datasource local storage ignored files
-/dataSources/
-/dataSources.local.xml
-# Editor-based HTTP Client requests
-/httpRequests/
diff --git a/max-effort/Scenes/.idea/copilot.data.migration.ask2agent.xml b/max-effort/Scenes/.idea/copilot.data.migration.ask2agent.xml
deleted file mode 100644
index 1f2ea11..0000000
--- a/max-effort/Scenes/.idea/copilot.data.migration.ask2agent.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/max-effort/Scenes/.idea/encodings.xml b/max-effort/Scenes/.idea/encodings.xml
deleted file mode 100644
index df87cf9..0000000
--- a/max-effort/Scenes/.idea/encodings.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/max-effort/Scenes/.idea/indexLayout.xml b/max-effort/Scenes/.idea/indexLayout.xml
deleted file mode 100644
index 7b08163..0000000
--- a/max-effort/Scenes/.idea/indexLayout.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/max-effort/Scenes/.idea/inspectionProfiles/Project_Default.xml b/max-effort/Scenes/.idea/inspectionProfiles/Project_Default.xml
deleted file mode 100644
index 03d9549..0000000
--- a/max-effort/Scenes/.idea/inspectionProfiles/Project_Default.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/rust/src/consts.rs b/rust/src/consts.rs
index d8ad44e..5ad3e6a 100644
--- a/rust/src/consts.rs
+++ b/rust/src/consts.rs
@@ -10,5 +10,6 @@ pub const LIFT_VISUAL_HEIGHT: &str = "lift_visual_height";
pub const CAMERA_TRAUMA: &str = "camera_trauma";
pub const HAZARD_SPAWNED: &str = "hazard_spawned";
pub const HAZARD_RESOLVED: &str = "hazard_resolved";
+pub const DAY_STARTED: &str = "day_started";
pub const VIGNETTE_INTENSITY_PARAM: &str = "vignette_intensity";
diff --git a/rust/src/core/event_bus.rs b/rust/src/core/event_bus.rs
index 964e46e..823adc2 100644
--- a/rust/src/core/event_bus.rs
+++ b/rust/src/core/event_bus.rs
@@ -43,6 +43,9 @@ impl EventBus {
#[signal]
fn hazard_resolved(type_: HazardType);
+ #[signal]
+ fn day_started(day_index: i32);
+
#[func]
pub fn publish_lift_effort(&mut self, strength: f32) {
self.base_mut()
@@ -95,4 +98,10 @@ impl EventBus {
self.base_mut()
.emit_signal("hazard_resolved", &[type_.to_variant()]);
}
+
+ #[func]
+ pub fn publish_day_started(&mut self, day_index: i32) {
+ self.base_mut()
+ .emit_signal("day_started", &[day_index.to_variant()]);
+ }
}
diff --git a/rust/src/systems/bench_press_system.rs b/rust/src/systems/bench_press_system.rs
index 0068c13..5bc669d 100644
--- a/rust/src/systems/bench_press_system.rs
+++ b/rust/src/systems/bench_press_system.rs
@@ -93,12 +93,13 @@ impl BenchPressSystem {
self.current_progress += self.power_per_click * delta;
if self.current_progress >= self.target_value {
- bus.clone().bind_mut().publish_lift_completed(true);
+ self.is_lift_complete = true;
+ bus.call_deferred("publish_lift_completed", &[true.to_variant()]);
}
}
#[func]
- fn on_lift_completed(&mut self) {
+ fn on_lift_completed(&mut self, _success: bool) {
self.is_lift_complete = true;
}
diff --git a/rust/src/systems/camera_shake_system.rs b/rust/src/systems/camera_shake_system.rs
index 74d5f00..363c0af 100644
--- a/rust/src/systems/camera_shake_system.rs
+++ b/rust/src/systems/camera_shake_system.rs
@@ -52,6 +52,7 @@ impl INode for CameraShakeSystem {
&self.base().callable("on_focus_changed"),
);
bus.connect(consts::CAMERA_TRAUMA, &self.base().callable("add_trauma"));
+ bus.connect(consts::DAY_STARTED, &self.base().callable("on_day_started"));
self.event_bus = Some(bus);
}
@@ -103,4 +104,15 @@ impl CameraShakeSystem {
self.trauma += amount;
self.trauma = self.trauma.clamp(0.0, 1.0);
}
+
+ #[func]
+ fn on_day_started(&mut self, _day_index: i32) {
+ self.trauma = 0.0;
+ self.current_focus = 0.0;
+
+ if let Some(camera) = &mut self.camera {
+ camera.set_offset(Vector2::ZERO);
+ camera.set_rotation(0.0);
+ }
+ }
}
diff --git a/rust/src/systems/deadlift_system.rs b/rust/src/systems/deadlift_system.rs
index 53591d6..a3c1f1e 100644
--- a/rust/src/systems/deadlift_system.rs
+++ b/rust/src/systems/deadlift_system.rs
@@ -116,7 +116,9 @@ impl INode for DeadliftSystem {
if self.hold_timer >= self.target_value {
bus.clone().bind_mut().publish_camera_trauma(1.0);
- bus.clone().bind_mut().publish_lift_completed(true);
+
+ bus.call_deferred("publish_lift_completed", &[true.to_variant()]);
+ self.is_lift_complete = true;
}
}
}
@@ -134,7 +136,7 @@ impl DeadliftSystem {
}
#[func]
- fn on_lift_completed(&mut self) {
+ fn on_lift_completed(&mut self, _success: bool) {
self.is_lift_complete = true;
}
diff --git a/rust/src/systems/game_manager.rs b/rust/src/systems/game_manager.rs
index fa871df..0160924 100644
--- a/rust/src/systems/game_manager.rs
+++ b/rust/src/systems/game_manager.rs
@@ -120,6 +120,10 @@ impl GameManager {
.set_available_hazards(config_bind.available_hazards.clone());
}
+ if let Some(bus) = &mut self.event_bus {
+ bus.clone().bind_mut().publish_day_started(index);
+ }
+
if let Some(l) = &mut self.day_label {
l.set_text(&config_bind.day_title);
}
@@ -136,9 +140,6 @@ impl GameManager {
game.queue_free();
self.current_mini_game = None;
}
- if let Some(hs) = &mut self.hazard_system {
- hs.bind_mut().clear_hazards();
- }
}
fn handle_win(&mut self) {
diff --git a/rust/src/systems/hazard_system.rs b/rust/src/systems/hazard_system.rs
index 8654bbe..612bbc2 100644
--- a/rust/src/systems/hazard_system.rs
+++ b/rust/src/systems/hazard_system.rs
@@ -56,6 +56,8 @@ impl INode for HazardSystem {
&self.base().callable("on_hazard_resolved"),
);
+ bus.connect(consts::DAY_STARTED, &self.base().callable("on_day_started"));
+
self.event_bus = Some(bus);
}
@@ -170,4 +172,11 @@ impl HazardSystem {
}
}
}
+
+ #[func]
+ fn on_day_started(&mut self, _day_index: i32) {
+ self.clear_hazards();
+ self.timer = 0.0;
+ self.current_focus = 0.0;
+ }
}
diff --git a/rust/src/systems/tunnel_system.rs b/rust/src/systems/tunnel_system.rs
index c29a44b..4b841db 100644
--- a/rust/src/systems/tunnel_system.rs
+++ b/rust/src/systems/tunnel_system.rs
@@ -43,6 +43,7 @@ impl INode for TunnelSystem {
consts::FOCUS_RELEASED,
&self.base().callable("on_focus_release"),
);
+ bus.connect(consts::DAY_STARTED, &self.base().callable("on_day_started"));
self.event_bus = Some(bus);
}
@@ -114,4 +115,22 @@ impl TunnelSystem {
fn on_focus_release(&mut self) {
self.is_efforting = false;
}
+
+ #[func]
+ fn on_day_started(&mut self, _day_index: i32) {
+ self.current_focus = 0.0;
+ self.is_efforting = false;
+
+ if let Some(overlay) = &mut self.vignette_overlay {
+ if let Some(material) = overlay.get_material() {
+ if let Ok(mut mat) = material.try_cast::() {
+ mat.set_shader_parameter(consts::VIGNETTE_INTENSITY_PARAM, &0.0.to_variant());
+ }
+ }
+ }
+
+ if let Some(bus) = &mut self.event_bus {
+ bus.bind_mut().publish_focus_changed(0.0);
+ }
+ }
}