Commit b018fa9c authored by Gavin An's avatar Gavin An

작업중

parent dbf019c8
...@@ -23,7 +23,7 @@ func _initialize_unit_templates() -> void: ...@@ -23,7 +23,7 @@ func _initialize_unit_templates() -> void:
striker.damage = 12.0 striker.damage = 12.0
striker.cooldown = 1.5 striker.cooldown = 1.5
striker.move_speed = 6.0 striker.move_speed = 6.0
striker.attack_range = 1.5 striker.attack_range = 2.0
striker.is_ranged = false striker.is_ranged = false
striker.unit_color = Color(0.12, 0.45, 0.85, 1.0) # 청색 striker.unit_color = Color(0.12, 0.45, 0.85, 1.0) # 청색
unit_templates.append(striker) unit_templates.append(striker)
...@@ -35,7 +35,7 @@ func _initialize_unit_templates() -> void: ...@@ -35,7 +35,7 @@ func _initialize_unit_templates() -> void:
guardian.damage = 25.0 guardian.damage = 25.0
guardian.cooldown = 1.0 guardian.cooldown = 1.0
guardian.move_speed = 4.0 guardian.move_speed = 4.0
guardian.attack_range = 1.5 guardian.attack_range = 2.0
guardian.is_ranged = false guardian.is_ranged = false
guardian.unit_color = Color(0.85, 0.65, 0.12, 1.0) # 황금색 guardian.unit_color = Color(0.85, 0.65, 0.12, 1.0) # 황금색
unit_templates.append(guardian) unit_templates.append(guardian)
......
...@@ -11,6 +11,13 @@ signal game_victory ...@@ -11,6 +11,13 @@ signal game_victory
const INIT_GOLD: int = 30000 const INIT_GOLD: int = 30000
@export var skip_selection_in_debug_mode: bool = true
@export var debug_stage_id: String = "stage_1"
@export var debug_stage_map_path: String = "res://src/map/stages/stage_1_map.tscn"
@export var debug_summoner_name: String = "Debug Mage"
@export var debug_summoner_max_mana: float = 100.0
@export var debug_summoner_mana_regen: float = 3.0
var selected_summoner_data: SummonerData = null var selected_summoner_data: SummonerData = null
var selected_stage_id: String = "" var selected_stage_id: String = ""
var selected_stage_map_path: String = "" var selected_stage_map_path: String = ""
...@@ -48,6 +55,27 @@ func _ready() -> void: ...@@ -48,6 +55,27 @@ func _ready() -> void:
stage_changed.emit(current_stage) stage_changed.emit(current_stage)
active_monster_count_changed.emit(active_monster_count) active_monster_count_changed.emit(active_monster_count)
## 디버그 실행 중 선택 씬을 건너뛸지 확인합니다.
## - skip_selection_in_debug_mode 값을 false로 바꾸면 디버그에서도 기존 선택 흐름을 사용할 수 있습니다.
func should_skip_selection_flow() -> bool:
return skip_selection_in_debug_mode and OS.is_debug_build()
## 개발 모드에서 바로 메인 전장으로 진입할 때 사용할 기본 선택값을 주입합니다.
func apply_debug_selection_defaults() -> void:
if not selected_summoner_data:
var data: SummonerData = SummonerData.new()
data.summoner_name = debug_summoner_name
data.max_mana = debug_summoner_max_mana
data.mana_regen = debug_summoner_mana_regen
var portrait_path: String = "res://assets/ui/summoner/portraits/mage_summoner.png"
if ResourceLoader.exists(portrait_path):
data.portrait_texture = load(portrait_path) as Texture2D
selected_summoner_data = data
if selected_stage_map_path == "":
selected_stage_id = debug_stage_id
selected_stage_map_path = debug_stage_map_path
## 골드 획득 ## 골드 획득
func add_gold(amount: int) -> void: func add_gold(amount: int) -> void:
if is_game_over: if is_game_over:
......
...@@ -111,7 +111,7 @@ func _execute_haste() -> bool: ...@@ -111,7 +111,7 @@ func _execute_haste() -> bool:
# 5초 후 원복 # 5초 후 원복
get_tree().create_timer(5.0).timeout.connect(func(): get_tree().create_timer(5.0).timeout.connect(func():
var current_units = get_tree().get_nodes_in_group("units") var current_units: Array[Node] = get_tree().get_nodes_in_group("units")
for unit in current_units: for unit in current_units:
if is_instance_valid(unit) and "attack_speed_mult" in unit: if is_instance_valid(unit) and "attack_speed_mult" in unit:
unit.set("attack_speed_mult", 1.0) unit.set("attack_speed_mult", 1.0)
...@@ -121,7 +121,7 @@ func _execute_haste() -> bool: ...@@ -121,7 +121,7 @@ func _execute_haste() -> bool:
## 2. 강타 주문 (Smite) ## 2. 강타 주문 (Smite)
func _execute_smite() -> bool: func _execute_smite() -> bool:
var monsters = get_tree().get_nodes_in_group("monsters") var monsters: Array[Node] = get_tree().get_nodes_in_group("monsters")
if monsters.is_empty(): if monsters.is_empty():
return false return false
......
class_name BaseUnit class_name BaseUnit
extends CharacterBody3D extends CharacterBody3D
const UnitHelper = preload("res://src/entities/units/unit_helper.gd") const UnitHelper = preload("res://src/entities/units/base/unit_helper.gd")
const MELEE_HIT_CONFIRM_PADDING: float = 0.05 const MELEE_HIT_CONFIRM_PADDING: float = 0.05
const INVALID_PLACEMENT_CELL: Vector3i = Vector3i(2147483647, 2147483647, 2147483647) const INVALID_PLACEMENT_CELL: Vector3i = Vector3i(2147483647, 2147483647, 2147483647)
......
...@@ -149,8 +149,7 @@ static func clean_root_animation_tracks(anim_player: AnimationPlayer) -> void: ...@@ -149,8 +149,7 @@ static func clean_root_animation_tracks(anim_player: AnimationPlayer) -> void:
var path_str: String = str(anim.track_get_path(track_idx)) var path_str: String = str(anim.track_get_path(track_idx))
# 최상위 루트 노드(Armature 등)의 회전/위치 강제 덮어쓰기 트랙 검출 # 최상위 루트 노드(Armature 등)의 회전/위치 강제 덮어쓰기 트랙 검출
# Skeleton3D 하위의 실제 뼈대 애니메이션 트랙은 유지하고 오직 Armature 루트 트랜스폼 트랙만 제거 # Skeleton3D 하위의 실제 뼈대 애니메이션 트랙은 유지하고 오직 Armature 루트 트랜스폼 트랙만 제거
if path_str == "Armature:rotation" or path_str == "Armature:position" or \ if path_str == "Armature:rotation" or path_str == "Armature:position" or path_str.begins_with("Armature:") and not "Skeleton3D" in path_str:
path_str.begins_with("Armature:") and not "Skeleton3D" in path_str:
tracks_to_remove.append(track_idx) tracks_to_remove.append(track_idx)
# 역순으로 정렬하여 트랙 제거 시 인덱스 밀림 방지 # 역순으로 정렬하여 트랙 제거 시 인덱스 밀림 방지
......
...@@ -113,7 +113,7 @@ func _update_animations() -> void: ...@@ -113,7 +113,7 @@ func _update_animations() -> void:
## 마법사(Mage) 전용 화염 불덩이(Fireball) 발사체를 월드에 스폰하는 함수 ## 마법사(Mage) 전용 화염 불덩이(Fireball) 발사체를 월드에 스폰하는 함수
func _spawn_projectile(fire_position: Vector3) -> void: func _spawn_projectile(fire_position: Vector3) -> void:
# 공통 Projectile 스크립트를 로드하여 발사체 인스턴스를 동적 생성합니다. # 공통 Projectile 스크립트를 로드하여 발사체 인스턴스를 동적 생성합니다.
var projectile_script: = preload("res://src/entities/units/projectile.gd") var projectile_script: = preload("res://src/entities/units/base/projectile.gd")
var proj: Node3D = projectile_script.new() as Node3D var proj: Node3D = projectile_script.new() as Node3D
# 발사체의 능력치 및 비행 속성 주입 (공격력, 유도 대상, 비행 속도, 이펙트 색상) # 발사체의 능력치 및 비행 속성 주입 (공격력, 유도 대상, 비행 속도, 이펙트 색상)
......
...@@ -92,7 +92,7 @@ func _update_animations() -> void: ...@@ -92,7 +92,7 @@ func _update_animations() -> void:
## 레인저 전용 발사체 생성 및 스폰 ## 레인저 전용 발사체 생성 및 스폰
func _spawn_projectile(fire_position: Vector3) -> void: func _spawn_projectile(fire_position: Vector3) -> void:
var projectile_script = preload("res://src/entities/units/projectile.gd") var projectile_script = preload("res://src/entities/units/base/projectile.gd")
var proj: Node3D = projectile_script.new() as Node3D var proj: Node3D = projectile_script.new() as Node3D
# 발사체의 속성들을 설정합니다. (공격력, 유도 대상, 비행 속도, 이펙트 색상) # 발사체의 속성들을 설정합니다. (공격력, 유도 대상, 비행 속도, 이펙트 색상)
......
...@@ -4,7 +4,7 @@ extends Control ...@@ -4,7 +4,7 @@ extends Control
## 플레이어 자원 현황, 게임 결과 팝업, 유닛 소환 메커니즘을 총괄합니다. ## 플레이어 자원 현황, 게임 결과 팝업, 유닛 소환 메커니즘을 총괄합니다.
# 유닛 씬 및 데이터 프리로드 # 유닛 씬 및 데이터 프리로드
@export var base_unit_scene: PackedScene = preload("res://src/entities/units/base_unit.tscn") @export var base_unit_scene: PackedScene = preload("res://src/entities/units/base/base_unit.tscn")
const INVALID_TILE_CELL: Vector3i = Vector3i(2147483647, 2147483647, 2147483647) const INVALID_TILE_CELL: Vector3i = Vector3i(2147483647, 2147483647, 2147483647)
# UI 노드 자동 캐싱 # UI 노드 자동 캐싱
...@@ -64,6 +64,13 @@ func _ready() -> void: ...@@ -64,6 +64,13 @@ func _ready() -> void:
add_child(_summoner) add_child(_summoner)
# 선택된 소환사 데이터가 존재하는지 검증 (디버그 모드 대안 포함) # 선택된 소환사 데이터가 존재하는지 검증 (디버그 모드 대안 포함)
if not GameManager.selected_summoner_data:
if GameManager.should_skip_selection_flow():
GameManager.apply_debug_selection_defaults()
else:
SceneChanger.change_scene_to_file("res://src/ui/summoner_selection/summoner_selection.tscn")
return
if not GameManager.selected_summoner_data: if not GameManager.selected_summoner_data:
SceneChanger.change_scene_to_file("res://src/ui/summoner_selection/summoner_selection.tscn") SceneChanger.change_scene_to_file("res://src/ui/summoner_selection/summoner_selection.tscn")
return return
......
...@@ -7,6 +7,10 @@ extends Control ...@@ -7,6 +7,10 @@ extends Control
@onready var btn_stage_2: Button = $VBoxContainer/CardsHBox/Stage2Card/SelectStage2 @onready var btn_stage_2: Button = $VBoxContainer/CardsHBox/Stage2Card/SelectStage2
func _ready() -> void: func _ready() -> void:
if GameManager.should_skip_selection_flow():
call_deferred("_skip_selection_flow_for_debug")
return
btn_stage_1.pressed.connect(_on_select_stage_1_pressed) btn_stage_1.pressed.connect(_on_select_stage_1_pressed)
btn_stage_2.pressed.connect(_on_select_stage_2_pressed) btn_stage_2.pressed.connect(_on_select_stage_2_pressed)
...@@ -23,3 +27,7 @@ func _on_select_stage_2_pressed() -> void: ...@@ -23,3 +27,7 @@ func _on_select_stage_2_pressed() -> void:
func _transition_to_main_game() -> void: func _transition_to_main_game() -> void:
# SceneChanger 페이드 트랜지션 시스템을 활용하여 메인 게임 씬으로 이동 # SceneChanger 페이드 트랜지션 시스템을 활용하여 메인 게임 씬으로 이동
SceneChanger.change_scene_to_file("res://src/core/main.tscn") SceneChanger.change_scene_to_file("res://src/core/main.tscn")
func _skip_selection_flow_for_debug() -> void:
GameManager.apply_debug_selection_defaults()
SceneChanger.change_scene_to_file("res://src/core/main.tscn")
...@@ -10,6 +10,10 @@ extends Control ...@@ -10,6 +10,10 @@ extends Control
@onready var port_warrior: TextureRect = $VBoxContainer/CardsHBox/WarriorCard/Portrait @onready var port_warrior: TextureRect = $VBoxContainer/CardsHBox/WarriorCard/Portrait
func _ready() -> void: func _ready() -> void:
if GameManager.should_skip_selection_flow():
call_deferred("_skip_selection_flow_for_debug")
return
btn_mage.pressed.connect(_on_select_mage_pressed) btn_mage.pressed.connect(_on_select_mage_pressed)
btn_warrior.pressed.connect(_on_select_warrior_pressed) btn_warrior.pressed.connect(_on_select_warrior_pressed)
...@@ -49,3 +53,7 @@ func _on_select_warrior_pressed() -> void: ...@@ -49,3 +53,7 @@ func _on_select_warrior_pressed() -> void:
func _transition_to_main_game() -> void: func _transition_to_main_game() -> void:
# 페이지 이동: 소환사 선택 완료 후 스테이지 선택 씬으로 이동 # 페이지 이동: 소환사 선택 완료 후 스테이지 선택 씬으로 이동
SceneChanger.change_scene_to_file("res://src/ui/stage_selection/stage_selection.tscn") SceneChanger.change_scene_to_file("res://src/ui/stage_selection/stage_selection.tscn")
func _skip_selection_flow_for_debug() -> void:
GameManager.apply_debug_selection_defaults()
SceneChanger.change_scene_to_file("res://src/core/main.tscn")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment