Pause button, backspace, added.
This commit is contained in:
+2
-1
@@ -54,7 +54,7 @@ const int ZOMBIE_ATTACK_MAX_HEIGHT = 6;
|
||||
|
||||
// Boar settings
|
||||
const int BOAR_HEALTH = 4;
|
||||
const int BOAR_MAX_COUNT = 3;
|
||||
const int BOAR_MAX_COUNT = 1;
|
||||
const int BOAR_MOVE_INTERVAL_MIN = 800;
|
||||
const int BOAR_MOVE_INTERVAL_MAX = 1500;
|
||||
const int BOAR_ATTACK_INTERVAL = 1500;
|
||||
@@ -66,6 +66,7 @@ const int BOAR_FOOTSTEP_MAX_DISTANCE = 5;
|
||||
const float BOAR_SOUND_VOLUME_STEP = 3.0;
|
||||
const int BOAR_SIGHT_RANGE = 4;
|
||||
const int BOAR_CHARGE_SPEED = 500; // ms per tile when charging
|
||||
const int BOAR_SPAWN_CHANCE_PER_HOUR = 30;
|
||||
|
||||
// Barricade configuration
|
||||
const int BARRICADE_BASE_HEALTH = 100;
|
||||
|
||||
@@ -50,3 +50,6 @@ timer attack_timer;
|
||||
|
||||
// Search state
|
||||
bool searching = false;
|
||||
|
||||
// Pause state
|
||||
bool game_paused = false;
|
||||
|
||||
@@ -403,6 +403,7 @@ void update_time() {
|
||||
keep_base_fires_fed();
|
||||
update_incense_burning();
|
||||
attempt_hourly_flying_creature_spawn();
|
||||
attempt_hourly_boar_spawn();
|
||||
check_scheduled_invasion();
|
||||
attempt_blessing();
|
||||
check_weather_transition();
|
||||
|
||||
@@ -1141,18 +1141,20 @@ void update_boar(GameBoar@ boar) {
|
||||
}
|
||||
|
||||
void update_boars() {
|
||||
// Only spawn if map is expanded
|
||||
if (expanded_area_start != -1) {
|
||||
while (boars.length() < BOAR_MAX_COUNT) {
|
||||
spawn_boar(expanded_area_start, expanded_area_end);
|
||||
}
|
||||
}
|
||||
|
||||
for (uint i = 0; i < boars.length(); i++) {
|
||||
update_boar(boars[i]);
|
||||
}
|
||||
}
|
||||
|
||||
void attempt_hourly_boar_spawn() {
|
||||
if (expanded_area_start == -1) return;
|
||||
if (boars.length() >= BOAR_MAX_COUNT) return;
|
||||
|
||||
if (random(1, 100) <= BOAR_SPAWN_CHANCE_PER_HOUR) {
|
||||
spawn_boar(expanded_area_start, expanded_area_end);
|
||||
}
|
||||
}
|
||||
|
||||
bool damage_boar_at(int pos, int damage) {
|
||||
for (uint i = 0; i < boars.length(); i++) {
|
||||
if (boars[i].position == pos) {
|
||||
|
||||
Reference in New Issue
Block a user