import { MATERIAL_TIER_ORDER, tierMinSkillLevel } from "../definitions/materialTiers.js"; /** Universal Chebyshev range for ranged weapons and magic (players and mobs). */ export const COMBAT_RANGE_TILES = 12; export const RANGED_PROJECTILE_MS = 300; export const SPELL_PROJECTILE_MS = 500; export const SPELL_COOLDOWN_MS = 2000; export const MAX_FAVORITE_SPELLS = 6; /** Torch blocks use 8 tiles; spell lights are slightly dimmer. */ export const SPELL_LIGHT_RANGE_TILES = 6; export const SPELL_LIGHT_INTENSITY = 0.88; /** Dark spell dims local light by this intensity at the centre. */ export const SPELL_DARK_INTENSITY = 0.88; export const LIGHT_DURATION_MS_PER_MIND = 5000; export const LIGHT_MAX_DURATION_MS = 3 * 60 * 1000; export const LIGHT_FADE_MS = 3000; export const LIGHT_OWNER_DISTANCE_CAP_MS = 5000; export const CAST_FLASH_MS = 500; /** * Magic contest die size from spell tier. * Difficulty = unlock Magic level + 1 so cast chance is exactly 50% at the * tier unlock gate (1 / 10 / 20 / 35 / 50 / 70 / 90), then rises with Magic. */ export function spellDifficultyFromTier (tier) { const rank = Math.max(1, Math.min(MATERIAL_TIER_ORDER.length, Math.floor(Number(tier) || 1))); const unlockLevel = tierMinSkillLevel(MATERIAL_TIER_ORDER[rank - 1]); return Math.max(1, unlockLevel + 1); } /** Cast flash radius in tiles = tier / 2. */ export function castFlashRadiusTiles (tier) { return Math.max(0.5, (Number(tier) || 1) / 2); }