Documentation sort of updated, food consumption also updated for residents.

This commit is contained in:
Storm Dragon
2026-01-23 23:39:12 -05:00
parent 32a6894401
commit 78e8d434a3
8 changed files with 307 additions and 89 deletions

View File

@@ -406,6 +406,8 @@ void update_time() {
attempt_resident_collection();
}
ensure_ambience_running();
// Proactive resident defense with slings
attempt_resident_sling_defense();
@@ -533,6 +535,9 @@ void complete_crossfade() {
}
if (night_sound_handle != -1) p.update_sound_start_values(night_sound_handle, 0.0, 0.0, 1.0);
is_daytime = false;
if (night_sound_handle == -1 || !p.sound_is_active(night_sound_handle)) {
update_ambience(false);
}
} else {
// Destroy night sound, ensure day is at full volume
if (night_sound_handle != -1) {
@@ -541,6 +546,23 @@ void complete_crossfade() {
}
if (day_sound_handle != -1) p.update_sound_start_values(day_sound_handle, 0.0, 0.0, 1.0);
is_daytime = true;
if (day_sound_handle == -1 || !p.sound_is_active(day_sound_handle)) {
update_ambience(false);
}
}
}
void ensure_ambience_running() {
if (crossfade_active) return;
if (is_daytime) {
if (day_sound_handle == -1 || !p.sound_is_active(day_sound_handle)) {
update_ambience(false);
}
} else {
if (night_sound_handle == -1 || !p.sound_is_active(night_sound_handle)) {
update_ambience(false);
}
}
}