87 lines
4.5 KiB
GDScript
87 lines
4.5 KiB
GDScript
class_name GameConstants
|
|
|
|
# ── Affinity colors ───────────────────────────────────────────────────────────
|
|
|
|
const AFFINITY_COLORS: Dictionary = {
|
|
"Void": Color(0.18, 0.18, 0.22),
|
|
"Aether": Color(0.60, 0.45, 0.85),
|
|
"Lake": Color(0.28, 0.52, 0.88),
|
|
"Hill": Color(0.58, 0.44, 0.26),
|
|
"Forest": Color(0.22, 0.52, 0.24),
|
|
"Field": Color(0.62, 0.72, 0.28),
|
|
"Ocean": Color(0.10, 0.20, 0.72),
|
|
"Island": Color(0.38, 0.68, 0.84),
|
|
"Marsh": Color(0.38, 0.52, 0.34),
|
|
"Swamp": Color(0.24, 0.33, 0.20),
|
|
"Mountain": Color(0.50, 0.44, 0.38),
|
|
"Steppe": Color(0.72, 0.63, 0.38),
|
|
"Fort": Color(0.40, 0.34, 0.30),
|
|
"Plains": Color(0.78, 0.74, 0.50),
|
|
"Grove": Color(0.33, 0.58, 0.28),
|
|
"Jungle": Color(0.15, 0.42, 0.20),
|
|
"PerfectAether": Color(0.88, 0.72, 1.00),
|
|
"PureVoid": Color(0.05, 0.05, 0.10),
|
|
"UnstableAether":Color(0.70, 0.55, 0.90),
|
|
"GatewayLake": Color(0.22, 0.42, 0.70),
|
|
"GatewayHill": Color(0.46, 0.34, 0.18),
|
|
"GatewayForest": Color(0.18, 0.42, 0.18),
|
|
"GatewayField": Color(0.52, 0.60, 0.22),
|
|
}
|
|
|
|
# ── Highlight colors ──────────────────────────────────────────────────────────
|
|
|
|
const HI_GREEN: Color = Color(0.20, 0.90, 0.20, 0.40)
|
|
const HI_RED: Color = Color(1.00, 0.25, 0.25, 0.50)
|
|
const HI_BLUE: Color = Color(0.20, 0.50, 1.00, 0.40)
|
|
const HI_YELLOW: Color = Color(1.00, 0.85, 0.10, 0.50)
|
|
const HI_ORANGE: Color = Color(1.00, 0.60, 0.10, 0.45)
|
|
|
|
# ── Hitsplat ──────────────────────────────────────────────────────────────────
|
|
|
|
const HITSPLAT_LIFETIME: float = 0.75
|
|
const HITSPLAT_RISE_PIXELS: float = 42.0
|
|
|
|
# ── Tile / board geometry ─────────────────────────────────────────────────────
|
|
|
|
## Grid spacing: 1.0 tile + 0.1 gap between tiles (visual only).
|
|
const TILE_SPACING: float = 1.1
|
|
const HEX_TILE_RADIUS: float = 0.5774 # ≈ 1/√3 — flat-to-flat = TILE_SPACING
|
|
const HEX_TILE_SPACING: float = TILE_SPACING * 0.5 # hex boards use tighter spacing
|
|
|
|
# ── Animation timing ──────────────────────────────────────────────────────────
|
|
|
|
## Seconds per grid step when animating unit movement along the BFS path.
|
|
const MOVE_STEP_SECS: float = 0.28
|
|
## How long to hold after one-shot animations (attack / damaged / dying) before rebuilding.
|
|
const POST_ANIM_SECS: float = 1.2
|
|
## Seconds to skip at the start of looping animations on subsequent loop iterations.
|
|
## GLB animations use the first N frames as a transition-in from idle; on repeat loops
|
|
## we jump past them to avoid the bind-pose flash.
|
|
const ANIM_TRANSITION_SECS: float = 5.0 / 30.0 # 5 frames at 30 fps
|
|
|
|
# ── Unit SFX ──────────────────────────────────────────────────────────────────
|
|
|
|
const UNIT_SFX_KEYS: Array = [
|
|
"moveSoundUrl",
|
|
"attackSoundUrl",
|
|
"damagedSoundUrl",
|
|
"deathSoundUrl",
|
|
"blockedSoundUrl",
|
|
]
|
|
|
|
# ── Animation aliases ─────────────────────────────────────────────────────────
|
|
|
|
## Animation name aliases: maps the canonical lower-case action to fallback track names.
|
|
## The AnimationPlayer track list is matched case-insensitively against each entry.
|
|
const ANIM_ALIASES: Dictionary = {
|
|
"idle": ["idle", "idle_a", "idle1", "idle_loop"],
|
|
"attack": ["attack", "attack_a", "attack1", "attack_b", "strike"],
|
|
"damaged": ["damaged", "attacked", "hit", "hurt", "flinch"],
|
|
"dying": ["dying", "death", "die", "dead"],
|
|
"moving": ["moving", "move", "walk", "run", "walk_cycle"],
|
|
}
|
|
|
|
# ── Skybox ────────────────────────────────────────────────────────────────────
|
|
|
|
const SKY_ROTATION_SPEED: float = 0.026 # rad/sec — ~4 min per full revolution
|