they can hear now too

This commit is contained in:
derek
2025-05-02 15:52:07 -05:00
parent 083f1eec83
commit 88a60d469e
9 changed files with 131 additions and 38 deletions

View File

@@ -153,21 +153,7 @@ func cache_player_pos():
player_last_seen = line_of_sight_ray.get_collision_point()
func add_point_of_interest(point,loudness,max_distance):
var current_state_name = state_machine.current_state.name.to_lower()
if current_state_name == "idle" or current_state_name == "search":
var distance_to_point = global_position.distance_to(point)
if distance_to_point <= max_distance:
var perceived_loudness = 1/distance_to_point * loudness
var add_point = {"point" : point, "loudness" : perceived_loudness}
points_of_interest.append(add_point)
if current_state_name == "idle":
change_state_to("search")
if current_state_name == "search":
pass
#get new waypoint
#state_machine.current_state.investigate_points_of_interest()
state_machine.current_state.investigate_points_of_interest(point,loudness,max_distance)
func investigate_nearby_combat(ally,target):
if ally != self: