Files
agentic-labs-challenge/underdepths/data/constants.py
T
2026-08-14 09:46:04 +02:00

127 lines
4.1 KiB
Python

"""Tuning constants, palettes, and progression tables for Underdepths.
No magic numbers in game logic — everything tunable lives here.
"""
from __future__ import annotations
# --- viewport / grid -------------------------------------------------------
TILE: int = 20
MAP_W: int = 80
MAP_H: int = 50
SIGHT_RADIUS: int = 8
FLOOR_COUNT: int = 10
# --- dungeon generation ----------------------------------------------------
ROOM_MIN_W: int = 4
ROOM_MIN_H: int = 4
ROOM_MAX_W: int = 10
ROOM_MAX_H: int = 8
BSP_MIN_HALF: int = 12 # min half-axis before a region may split
BSP_LEAVES_MIN: int = 6
BSP_LEAVES_MAX: int = 10
BOSS_ROOM_W: int = 20
BOSS_ROOM_H: int = 15
WALL: int = 0
FLOOR: int = 1
# --- player base stats (plan.md Core Data Model) ---------------------------
PLAYER_BASE: dict = {
"hp": 50,
"max_hp": 50,
"power": 4,
"armor": 0,
"accuracy": 5,
"evasion": 2,
"crit_chance": 0.10,
"speed": 1,
}
# --- leveling: (cumulative_xp_to_next_level, hp_gain, power_gain) ----------
LEVEL_TABLE: list[tuple[int, int, int]] = [
(30, 10, 1),
(70, 10, 1),
(140, 10, 1),
(250, 10, 1),
(400, 15, 2),
(600, 15, 2),
(850, 15, 2),
(1150, 15, 2),
(1500, 20, 3),
]
LEVEL_CAP: int = 10
POTION_HEAL: int = 30
STRENGTH_POTION_POWER: int = 5
# --- named colors (plan.md Colors & viewport) ------------------------------
COLORS: dict = {
"bg": (8, 7, 10),
"wall_visible": (66, 66, 80),
"wall_top": (96, 96, 112),
"wall_explored": (44, 48, 64), # remembered walls: visible dark blue-gray
"floor_visible": (72, 62, 50),
"floor_explored": (36, 40, 56), # remembered floors: visible dark blue-gray
"stairs": (245, 215, 70),
"player": (235, 235, 235),
"rat": (140, 100, 70),
"goblin": (90, 160, 70),
"skeleton_archer": (210, 210, 200),
"orc_warrior": (150, 50, 50),
"wraith": (150, 90, 200),
"green_slime": (120, 200, 90),
"ancient_dragon": (200, 60, 50),
"item_weapon": (240, 200, 80),
"item_armor": (90, 140, 220),
"item_potion": (220, 80, 80),
"item_scroll": (90, 220, 220),
"hp_full": (80, 200, 80),
"hp_empty": (60, 30, 30),
"xp_bar": (90, 160, 230),
"panel": (18, 16, 22),
"panel_border": (90, 85, 110),
"text": (220, 220, 220),
"text_dim": (150, 145, 140),
"shadow": (0, 0, 0),
"heart": (224, 64, 74), # HP heart icon
"star": (255, 214, 92), # XP / level star icon
"log_bad": (236, 96, 96), # damage / death log
"log_good": (120, 222, 116), # level-up / victory log
"empty_slot": (52, 50, 64),
}
# --- single-char palette keys for procedural pixel-art grids (render layer) -
PALETTE: dict = {
".": None, # transparent
" ": None,
"K": (16, 14, 20), # darkest outline
"k": (40, 36, 46), # outline shade
"W": (60, 60, 70), # wall base
"w": (82, 82, 96), # wall highlight (top edge)
"e": (30, 30, 35), # explored wall
"F": (40, 35, 30), # floor base
"f": (54, 48, 41), # floor fleck
"E": (20, 18, 15), # explored floor
"s": (245, 215, 70), # stairs / yellow glow
"y": (240, 200, 80), # yellow accent (weapons)
"b": (90, 140, 220), # blue accent (armor)
"r": (200, 60, 50), # red accent (dragon / potions)
"g": (90, 200, 90), # green accent (goblin / slime)
"p": (150, 90, 200), # purple accent (wraith)
"c": (210, 210, 200), # bone white (skeleton)
"C": (90, 220, 220), # cyan accent (scrolls)
"G": (172, 178, 190), # steel (weapon blades)
"o": (140, 100, 70), # brown (rat)
"n": (150, 50, 50), # dark red (orc)
"h": (235, 235, 235), # light / player highlight
"H": (180, 60, 60), # blood / damage flash
"q": (170, 245, 245), # eerie glow (skeleton eye sockets)
}
# --- combat tuning (plan.md Systems) ---------------------------------------
HIT_BASE: float = 0.70
HIT_PER_POINT: float = 0.05
HIT_FLOOR: float = 0.10
HIT_CEIL: float = 0.95
# --- persistence ----------------------------------------------------------------
SAVE_FILE: str = "save.json"