# intro_empire_phase.gd —— 40250 三国阵营地貌 3D 运镜巡览系统 1:1 # 严格对照: # Client/Eternexus/root/introempire.py (SelectEmpireWindow) # ClientVS22/source/UserInterface/PythonApplicationCamera.cpp # Client/Eternexus/root/uiscript/locale/en/empiredesc_*.txt extends RefCounted const EMPIRE_NONE := 0 const EMPIRE_SHINSOO := 1 # 赤蛇国 (进国 / 红色) const EMPIRE_CHUNJO := 2 # 白虎国 (顺天 / 黄色) const EMPIRE_JINNO := 3 # 苍龙国 (忍国 / 蓝色) # 三国官方 3D 摄像机观察预设点位 (Position & Rotation Degrees) const CAMERA_PRESETS := { EMPIRE_SHINSOO: { "cam_pos": Vector3(100.0, 50.0, -200.0), "cam_rot": Vector3(-15.0, 45.0, 0.0), "name": "赤蛇国 (Shinsoo)", "capital": "Yongan", "color": "#FF3333", "desc": "Shinsoo 帝国雄踞大陆南部,商贸繁荣昌盛,是商旅与财富的汇聚之地。", "trait": "商贾通达:全帝国交易税率降低 2%,行商收益提升。" }, EMPIRE_CHUNJO: { "cam_pos": Vector3(-150.0, 60.0, -180.0), "cam_rot": Vector3(-12.0, 135.0, 0.0), "name": "白虎国 (Chunjo)", "capital": "Joan", "color": "#FFCC00", "desc": "Chunjo 帝国坐落大陆西部,是古老圣灵信仰的发源地,奉行神圣天道。", "trait": "神圣庇佑:全帝国子民魔法防御力与精神抗性 +5%。" }, EMPIRE_JINNO: { "cam_pos": Vector3(0.0, 80.0, -250.0), "cam_rot": Vector3(-18.0, 0.0, 0.0), "name": "苍龙国 (Jinno)", "capital": "Pyungmoo", "color": "#3366FF", "desc": "Jinno 帝国占据大陆东部,崇尚武道强权,铁血军纪森严,武士骁勇善战。", "trait": "尚武好战:全帝国子民物理基础攻击力 +5%。" } } var selected_empire: int = EMPIRE_SHINSOO var current_cam_pos: Vector3 = Vector3.ZERO var current_cam_rot: Vector3 = Vector3.ZERO var target_cam_pos: Vector3 = Vector3.ZERO var target_cam_rot: Vector3 = Vector3.ZERO var is_transitioning: bool = false var transition_t: float = 1.0 func _init(initial_empire: int = EMPIRE_SHINSOO) -> void: select_empire(initial_empire) current_cam_pos = target_cam_pos current_cam_rot = target_cam_rot is_transitioning = false transition_t = 1.0 # 1. 选中帝国阵营 (1:1 SelectEmpireWindow.OnSelectEmpire) func select_empire(empire_id: int) -> bool: if not CAMERA_PRESETS.has(empire_id): return false selected_empire = empire_id var preset: Dictionary = CAMERA_PRESETS[empire_id] target_cam_pos = preset["cam_pos"] target_cam_rot = preset["cam_rot"] is_transitioning = true transition_t = 0.0 return true # 2. 摄像机平滑插值运镜更新 (1:1 PythonApplicationCamera::Update) func update_camera_transition(delta_t: float) -> void: if not is_transitioning: return transition_t = clamp(transition_t + delta_t, 0.0, 1.0) current_cam_pos = current_cam_pos.lerp(target_cam_pos, transition_t) current_cam_rot = current_cam_rot.lerp(target_cam_rot, transition_t) if transition_t >= 1.0: is_transitioning = false current_cam_pos = target_cam_pos current_cam_rot = target_cam_rot # 3. 获取当前帝国的详情数据 func get_selected_empire_info() -> Dictionary: return CAMERA_PRESETS.get(selected_empire, {}) # 4. 确认抉择帝国阵营并过渡到选角界面 func confirm_empire_selection() -> Dictionary: var info := get_selected_empire_info() return { "success": true, "empire_id": selected_empire, "empire_name": info.get("name", ""), "capital": info.get("capital", ""), "next_phase": "CHARACTER_SELECT" }