style: apply gdformat formatting across the entire project
Auto-format all GDScript files using gdformat from gdtoolkit. This is a baseline formatting pass to ensure consistent style: - Normalizes indentation and spacing - Wraps long lines to 100 characters - Removes trailing whitespace - Standardizes blank lines between functions 68 files reformatted, 8 files left unchanged (3rd-party addon files with parse errors excluded).
This commit is contained in:
+13
-9
@@ -30,25 +30,28 @@ var path_pending := false
|
||||
var is_dead_visual := false
|
||||
var dead_material := StandardMaterial3D.new()
|
||||
|
||||
|
||||
func debug_log(message: String) -> void:
|
||||
if DEBUG_LOGS:
|
||||
print("[NPCVisual] ", name, " | ", message)
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
dead_material.albedo_color = Color(0.25, 0.25, 0.25, 1.0)
|
||||
|
||||
|
||||
func setup_from_sim(npc: SimNPC) -> void:
|
||||
sim_id = npc.id
|
||||
npc_name = npc.npc_name
|
||||
profession = npc.profession
|
||||
name = "NPC_%s_%s" % [sim_id, npc_name]
|
||||
set_carried_food_visible(
|
||||
npc.get_inventory_amount(SimulationIds.RESOURCE_FOOD) > 0.0
|
||||
)
|
||||
set_carried_food_visible(npc.get_inventory_amount(SimulationIds.RESOURCE_FOOD) > 0.0)
|
||||
|
||||
|
||||
func set_carried_food_visible(is_visible: bool) -> void:
|
||||
carried_food_visual.visible = is_visible and not is_dead_visual
|
||||
|
||||
|
||||
func set_target_position(pos: Vector3) -> void:
|
||||
path_request_id += 1
|
||||
var request_id := path_request_id
|
||||
@@ -72,10 +75,7 @@ func set_target_position(pos: Vector3) -> void:
|
||||
return
|
||||
|
||||
current_path = NavigationServer3D.map_get_path(
|
||||
get_world_3d().navigation_map,
|
||||
global_position,
|
||||
pos,
|
||||
true
|
||||
get_world_3d().navigation_map, global_position, pos, true
|
||||
)
|
||||
|
||||
path_pending = false
|
||||
@@ -87,6 +87,7 @@ func set_target_position(pos: Vector3) -> void:
|
||||
else:
|
||||
debug_log("New target: %s Path points: %s" % [pos, current_path.size()])
|
||||
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
if is_dead_visual:
|
||||
velocity = Vector3.ZERO
|
||||
@@ -146,7 +147,8 @@ func _physics_process(delta: float) -> void:
|
||||
|
||||
var target_angle := atan2(direction.x, direction.z)
|
||||
rotation.y = lerp_angle(rotation.y, target_angle, rotation_speed * delta)
|
||||
|
||||
|
||||
|
||||
func _report_arrival_once() -> void:
|
||||
if has_reported_arrival:
|
||||
return
|
||||
@@ -158,6 +160,7 @@ func _report_arrival_once() -> void:
|
||||
debug_log("Arrived at target")
|
||||
arrived_at_target.emit(sim_id)
|
||||
|
||||
|
||||
func _report_navigation_failure_once() -> void:
|
||||
if has_reported_arrival:
|
||||
return
|
||||
@@ -172,6 +175,7 @@ func _report_navigation_failure_once() -> void:
|
||||
debug_log("Navigation failed")
|
||||
navigation_failed.emit(sim_id)
|
||||
|
||||
|
||||
func apply_dead_visual_state() -> void:
|
||||
is_dead_visual = true
|
||||
carried_food_visual.visible = false
|
||||
@@ -189,7 +193,7 @@ func apply_dead_visual_state() -> void:
|
||||
for child in get_children():
|
||||
if child is MeshInstance3D:
|
||||
child.material_override = dead_material
|
||||
|
||||
|
||||
collision_layer = 0
|
||||
collision_mask = 0
|
||||
debug_log("Applied dead visual state")
|
||||
|
||||
Reference in New Issue
Block a user