Files
draugnorak/src/constants.nvgt

278 lines
10 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// Map configuration
int MAP_SIZE = 35;
const int BASE_END = 4; // 0-4
const int GRASS_END = 19; // 5-19
const int GRAVEL_START = 20; // 20-34
const int GRAVEL_END = 34; // 20-34
// Expansion configuration
const int EXPANSION_SIZE = 30;
const int EXPANSION_CHANCE = 30; // 30% chance per hour before noon
int expanded_area_start = -1; // -1 means not expanded yet
int expanded_area_end = -1;
// Movement configuration
int movetime = 400; // Time between steps/movements
const int BASE_WALK_SPEED = 400;
const int MOCCASINS_WALK_SPEED = 360;
int walk_speed = BASE_WALK_SPEED;
int jump_speed = 170;
const int MAX_ITEM_STACK = 9;
const int POUCH_STACK_BONUS = 2;
const int BASE_STORAGE_MAX = 50;
const int BLESSING_HEAL_AMOUNT = 3;
const int BLESSING_BARRICADE_REPAIR = 20;
const int BLESSING_SPEED_DURATION = 300000;
const int BLESSING_RESIDENT_DURATION = 300000;
const int BLESSING_TRIGGER_CHANCE = 10;
const int BLESSING_WALK_SPEED = 320;
const int FISH_WEIGHT_MIN = 1;
const int FISH_WEIGHT_MAX = 30;
// Player sex constants
const int SEX_MALE = 0;
const int SEX_FEMALE = 1;
// Weapon damage
const int SPEAR_DAMAGE = 3;
const int AXE_DAMAGE = 4;
const int SLING_DAMAGE_MIN = 5;
const int SLING_DAMAGE_MAX = 8;
const int SLING_RANGE = 8;
// Bow settings
const int BOW_DAMAGE_MIN = 0;
const int BOW_DAMAGE_MAX = 10;
const int BOW_RANGE = 12;
const int BOW_DRAW_TIME_MS = 1000;
const int ARROW_FLIES_DURATION_MS = 230;
const int BOW_MISS_EXTRA_TILES = 3;
const int ARROWS_PER_CRAFT = 12;
const int ARROW_CAPACITY_PER_QUIVER = 12;
// Zombie settings
const int ZOMBIE_HEALTH = 12;
const int ZOMBIE_MAX_COUNT = 5;
const int ZOMBIE_MAX_COUNT_CAP = 12;
const int ZOMBIE_MOVE_INTERVAL = 1000;
const int ZOMBIE_ATTACK_INTERVAL = 1600;
const int ZOMBIE_DAMAGE_MIN = 4;
const int ZOMBIE_DAMAGE_MAX = 6;
const int ZOMBIE_GROAN_MIN_DELAY = 2000;
const int ZOMBIE_GROAN_MAX_DELAY = 3000;
const int ZOMBIE_FOOTSTEP_MAX_DISTANCE = 5;
const float ZOMBIE_SOUND_VOLUME_STEP = 3.0;
const int ZOMBIE_ATTACK_MAX_HEIGHT = 6;
// Undead resident settings (stronger than zombies)
const int UNDEAD_RESIDENT_HEALTH = 16;
const int UNDEAD_RESIDENT_DAMAGE_MIN = 5;
const int UNDEAD_RESIDENT_DAMAGE_MAX = 7;
// Wight settings (undead elite)
const int WIGHT_HEALTH = 40;
const int WIGHT_DAMAGE_MIN = 6;
const int WIGHT_DAMAGE_MAX = 8;
const int WIGHT_SPAWN_CHANCE_START = 5;
const int WIGHT_SPAWN_CHANCE_STEP = 5;
// Vampyr settings (undead abductor)
const int VAMPYR_HEALTH = 40;
const int VAMPYR_SPAWN_CHANCE_START = 5;
const int VAMPYR_SPAWN_CHANCE_STEP = 5;
const int VAMPYR_CAPTURE_CHANCE = 50;
const int VAMPYR_CAPTURE_INTERVAL = 1000;
// Boar settings
const int BOAR_HEALTH = 4;
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;
const int BOAR_DAMAGE_MIN = 1;
const int BOAR_DAMAGE_MAX = 3;
const int BOAR_SOUND_MIN_DELAY = 3000;
const int BOAR_SOUND_MAX_DELAY = 6000;
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 = 40;
const int BARRICADE_MAX_HEALTH = 500;
const int BARRICADE_STICK_COST = 3;
const int BARRICADE_STICK_HEALTH = 10;
const int BARRICADE_VINE_COST = 5;
const int BARRICADE_VINE_HEALTH = 15;
const int BARRICADE_LOG_COST = 1;
const int BARRICADE_LOG_HEALTH = 30;
const int BARRICADE_STONE_COST = 5;
const int BARRICADE_STONE_HEALTH = 20;
// Building costs
const int STORAGE_LOG_COST = 6;
const int STORAGE_STONE_COST = 9;
const int STORAGE_VINE_COST = 8;
const int PASTURE_LOG_COST = 8;
const int PASTURE_VINE_COST = 20;
const int STABLE_LOG_COST = 10;
const int STABLE_STONE_COST = 15;
const int STABLE_VINE_COST = 10;
const int ALTAR_STONE_COST = 9;
const int ALTAR_STICK_COST = 3;
const int INCENSE_STICK_COST = 6;
const int INCENSE_VINE_COST = 2;
const int INCENSE_REED_COST = 1;
const int INCENSE_HOURS_PER_STICK = 4;
const double INCENSE_FAVOR_PER_HOUR = 0.3;
// Bandit settings
const int BANDIT_HEALTH = 4;
const int BANDIT_MAX_COUNT = 3;
const int BANDIT_MOVE_INTERVAL_MIN = 600;
const int BANDIT_MOVE_INTERVAL_MAX = 800;
const int BANDIT_ATTACK_INTERVAL = 1200;
const int BANDIT_DAMAGE_MIN = 1;
const int BANDIT_DAMAGE_MAX = 2;
const int BANDIT_ALERT_MIN_DELAY = 3000;
const int BANDIT_ALERT_MAX_DELAY = 5000;
const int BANDIT_FOOTSTEP_MAX_DISTANCE = 7;
const float BANDIT_SOUND_VOLUME_STEP = 3.0;
const int BANDIT_ATTACK_MAX_HEIGHT = 6;
const int INVASION_DURATION_HOURS = 1;
const int BANDIT_DETECTION_RADIUS = 5;
const int BANDIT_WANDER_DIRECTION_CHANGE_MIN = 3000;
const int BANDIT_WANDER_DIRECTION_CHANGE_MAX = 8000;
const int INVADER_SOUND_VARIANTS_MAX = 5;
// Audio ranges and volume falloff
// Formula: final_volume = start_volume - (volume_step × distance)
// Using 30 dB fade over range for gradual but noticeable falloff
const int AUDIO_TILE_SCALE = 10;
const float AUDIO_PAN_STEP = 2.0;
const float AUDIO_VOLUME_STEP = 3.0;
const int SNARE_SOUND_RANGE = 2;
const float SNARE_SOUND_VOLUME_STEP = 4.0; // More audible for locating snares
const float SNARE_SOUND_PAN_STEP = 4.0; // Stronger pan for direction
const int SNARE_COLLECT_RANGE = 1;
const int FIRE_SOUND_RANGE = 3;
const float FIRE_SOUND_VOLUME_STEP = 5.0; // 15 dB over 3 tiles (FIRE_SOUND_RANGE)
const int FIREPIT_SOUND_RANGE = 5;
const float FIREPIT_SOUND_VOLUME_STEP = 6.0; // 30 dB over 5 tiles
const int STREAM_SOUND_RANGE = 7;
const float STREAM_SOUND_VOLUME_STEP = 4.3; // 30 dB over 7 tiles
const float TREE_SOUND_VOLUME_STEP = 4.0; // Similar to snares for good audibility
const int TREE_SOUND_RANGE = 4;
const int TREE_MIN_DISTANCE = 10;
const int TREE_MAX_PER_AREA = 2;
const float RESIDENT_DEFENSE_VOLUME_STEP = 3.0; // Default volume for resident counter-attacks
const float PLAYER_WEAPON_SOUND_VOLUME_STEP = 3.0;
const int FLYING_CREATURE_FADE_OUT_DURATION = 1500; // ms
const float FLYING_CREATURE_FADE_OUT_MIN_VOLUME = -40.0; // dB
// Mountain configuration
const int MOUNTAIN_SIZE = 60;
const int MOUNTAIN_MIN_ELEVATION = 0;
const int MOUNTAIN_MAX_ELEVATION = 40;
const int MOUNTAIN_STEEP_THRESHOLD = 7;
const int MOUNTAIN_MAX_SLOPE = 20;
const int ROPE_CLIMB_SPEED = 1000;
const int MOUNTAIN_STREAM_SOUND_RANGE = 7;
const float MOUNTAIN_STREAM_VOLUME_STEP = 4.3; // 30 dB over 7 tiles
const int QUEST_MAX_ACTIVE = 4;
const int QUEST_CHANCE_PER_FAVOR = 10;
const int QUEST_MIN_CHANCE = 5;
const double QUEST_FAVOR_PER_POINT = 0.05;
const int QUEST_STONE_SCORE = 6;
const int QUEST_LOG_SCORE = 10;
const int QUEST_SKIN_SCORE = 14;
// Resident settings
const int MAX_RESIDENTS = 4; // Max residents per base (+ player = 5 total)
const int RESIDENT_WEAPON_BREAK_CHANCE = 10;
const int RESIDENT_SPEAR_DAMAGE = 2;
const int RESIDENT_SLING_DAMAGE_MIN = 3;
const int RESIDENT_SLING_DAMAGE_MAX = 5;
const int RESIDENT_SNARE_ESCAPE_CHANCE = 5; // 5% chance game escapes when resident retrieves
const int RESIDENT_SNARE_CHECK_CHANCE = 15; // 15% chance per hour to check snares
const int RESIDENT_FISHING_CHANCE = 6; // 6% chance per resident per hour to catch a fish
const int RESIDENT_SMOKE_FISH_CHANCE = 10; // 10% chance per hour to smoke a stored fish
const int RESIDENT_TOOL_BREAK_CHANCE = 2; // 2% chance tools break during resident use (fishing poles, knives, baskets)
// Goose settings
const int GOOSE_HEALTH = 1;
const int GOOSE_MOVE_INTERVAL_MIN = 800; // Faster movement
const int GOOSE_MOVE_INTERVAL_MAX = 2000;
const int GOOSE_FLYING_HEIGHT_MIN = 10;
const int GOOSE_FLYING_HEIGHT_MAX = 30;
const float GOOSE_SOUND_VOLUME_STEP = 3.0;
const int GOOSE_FLIGHT_SOUND_DELAY_MIN = 2000; // Honk more often
const int GOOSE_FLIGHT_SOUND_DELAY_MAX = 5000;
const int GOOSE_FALL_SPEED = 100; // ms per foot
const int GOOSE_FLY_AWAY_CHANCE = 0; // Chance out of 1000 per tick to fly away
const int GOOSE_MAX_DIST_FROM_WATER = 4; // How far they can wander from water
const int GOOSE_MAX_COUNT = 3;
const int GOOSE_HOURLY_SPAWN_CHANCE = 35; // Percent chance per hour to spawn a goose
const int GOOSE_SIGHT_RANGE = 0;
// Weather settings
const int WEATHER_FADE_DURATION = 8000; // 8 seconds for smooth audio transitions
const float WEATHER_MIN_VOLUME = -30.0;
const float WEATHER_MAX_VOLUME = 0.0;
const float RAIN_VOLUME_LIGHT = -18.0;
const float RAIN_VOLUME_MODERATE = -10.0;
const float RAIN_VOLUME_HEAVY = -3.0;
const int WIND_GUST_MIN_DELAY = 30000; // Min 30 seconds between gusts
const int WIND_GUST_MAX_DELAY = 60000; // Max 60 seconds between gusts
const int THUNDER_MIN_INTERVAL = 8000; // Min 8 seconds between thunder
const int THUNDER_MAX_INTERVAL = 35000; // Max 35 seconds between thunder
const int THUNDER_MOVEMENT_SPEED = 250; // ms per tile movement (faster roll across sky)
const float THUNDER_SOUND_VOLUME_STEP = 0.5; // Gentler volume falloff
const int THUNDER_SPAWN_DISTANCE_MIN = 0; // Min distance from player
const int THUNDER_SPAWN_DISTANCE_MAX = 20; // Max distance from player
const int CHANCE_CLEAR_TO_WINDY = 15;
const int CHANCE_CLEAR_TO_RAINY = 6;
const int CHANCE_CLEAR_TO_STORMY = 5;
const int CHANCE_WINDY_STAY = 55;
const int CHANCE_WINDY_TO_CLEAR = 25;
const int CHANCE_WINDY_TO_STORMY = 12;
const int CHANCE_RAINY_STAY = 40;
const int CHANCE_RAINY_TO_STORMY = 35;
const int CHANCE_STORMY_STAY = 40;
const int CHANCE_STORMY_TO_RAINY = 35;
// Weather States
const int WEATHER_CLEAR = 0;
const int WEATHER_WINDY = 1;
const int WEATHER_RAINY = 2;
const int WEATHER_STORMY = 3;
// Weather Intensity levels (0 = none, 1-3 = low/medium/high)
const int INTENSITY_NONE = 0;
const int INTENSITY_LOW = 1;
const int INTENSITY_MEDIUM = 2;
const int INTENSITY_HIGH = 3;
const string RAIN_SOUND = "sounds/nature/rain.ogg";
// Environment / Fall Damage
const int SAFE_FALL_HEIGHT = 10;
const int FALL_DAMAGE_MIN = 0;
const int FALL_DAMAGE_MAX = 4;
// Base Automation
const int RESIDENT_SLING_COOLDOWN = 4000; // 4 seconds between shots
const int RESIDENT_COLLECTION_CHANCE = 10; // 10% chance per basket per hour
const int RESIDENT_FORAGING_CHANCE = 50; // 50% chance per resident per attempt (daily)
// Utility functions
int abs(int value) {
return value < 0 ? -value : value;
}