Weather system added, mostly decoration. Some tweaks to residents. Moved altar to its own menu, s for sacrifice. You can no longer burn incense outside the base.

This commit is contained in:
Storm Dragon
2026-01-20 12:30:26 -05:00
parent 9b7fbc8266
commit 4caa5caefb
28 changed files with 1973 additions and 72 deletions

View File

@@ -104,9 +104,15 @@ void expand_regular_area() {
notify("A " + width_desc + " stream flows through the new area at x " + actual_start + ".");
} else {
int tree_pos = random(new_start, new_end);
Tree@ t = Tree(tree_pos);
trees.insert_last(t);
// Try to place a tree with proper spacing
for (int attempt = 0; attempt < 20; attempt++) {
int tree_pos = random(new_start, new_end);
if (!tree_too_close(tree_pos)) {
Tree@ t = Tree(tree_pos);
trees.insert_last(t);
break;
}
}
}
area_expanded_today = true;
@@ -210,16 +216,49 @@ void attempt_resident_recruitment() {
return;
}
int chance = random(25, 35);
// Check if base is full
if (residents_count >= MAX_RESIDENTS) {
return;
}
// Recruitment chance based on storage buildings
int storage_count = world_storages.length();
int min_chance = 50;
int max_chance = 60;
if (storage_count >= 2) {
// 2+ storage: 75-100% chance
min_chance = 75;
max_chance = 100;
} else if (storage_count == 1) {
// 1 storage: 50-75% chance
min_chance = 50;
max_chance = 75;
}
// 0 storage: 50-60% chance (defaults above)
int chance = random(min_chance, max_chance);
int roll = random(1, 100);
if (roll > chance) {
return;
}
int added = random(1, 3);
// Don't exceed cap
if (residents_count + added > MAX_RESIDENTS) {
added = MAX_RESIDENTS - residents_count;
}
if (added <= 0) return;
residents_count += added;
string join_message = (added == 1) ? "A survivor joins your base." : "" + added + " survivors join your base.";
notify(join_message);
// Notify if base is now full
if (residents_count >= MAX_RESIDENTS) {
notify("Your base is at maximum capacity.");
}
}
void end_invasion() {
@@ -369,14 +408,34 @@ void update_time() {
}
attempt_daily_invasion();
keep_base_fires_fed();
update_incense_burning();
attempt_hourly_flying_creature_spawn();
check_scheduled_invasion();
attempt_blessing();
check_weather_transition();
attempt_resident_collection();
}
// Proactive resident defense with slings
attempt_resident_sling_defense();
// Manage bandits during active invasion
manage_bandits_during_invasion();
}
void update_incense_burning() {
if (!incense_burning || incense_hours_remaining <= 0) return;
favor += INCENSE_FAVOR_PER_HOUR;
incense_hours_remaining--;
if (incense_hours_remaining <= 0) {
incense_hours_remaining = 0;
incense_burning = false;
notify("The incense has burned out.");
}
}
void check_time_input() {
if (key_pressed(KEY_T)) {
screen_reader_speak(get_time_string(), true);