generated from krampus/template-godot4
Beast tweaks & debugging
All checks were successful
linting & formatting / build (push) Successful in 31s
itch.io publish action / build (linux64, x86_64) (push) Successful in 2m13s
itch.io publish action / build (osx, app) (push) Successful in 2m21s
itch.io publish action / build (win64, exe) (push) Successful in 2m29s
All checks were successful
linting & formatting / build (push) Successful in 31s
itch.io publish action / build (linux64, x86_64) (push) Successful in 2m13s
itch.io publish action / build (osx, app) (push) Successful in 2m21s
itch.io publish action / build (win64, exe) (push) Successful in 2m29s
This commit is contained in:
parent
f60a00dd5e
commit
fa4900c1f1
@ -107,7 +107,7 @@ gameplay/beast/anger_min=0.0
|
||||
gameplay/beast/anger_max=150.0
|
||||
gameplay/beast/anger_decay_rate=1.0
|
||||
gameplay/beast/anger_noise=10.0
|
||||
gameplay/beast/anger_noise_near=30.0
|
||||
gameplay/beast/anger_noise_near=10.0
|
||||
gameplay/beast/provocation_range=5.5
|
||||
gameplay/beast/anger_alarm=60.0
|
||||
gameplay/beast/anger_alarm_extra=60.0
|
||||
@ -123,6 +123,8 @@ gameplay/beast/anger_threshold_pursuit=80.0
|
||||
gameplay/beast/anger_start_tracking=4.0
|
||||
gameplay/beast/anger_extra_alert_level=4
|
||||
gameplay/beast/anger_threshold_pounce=140.0
|
||||
debug/show_beast_info=false
|
||||
debug/show_beast_info.editor_runtime=true
|
||||
|
||||
[global_group]
|
||||
|
||||
|
@ -13,6 +13,8 @@ var _track_list_dirty := false
|
||||
|
||||
@onready var alert_level_label: Label = %AlertLevelLabel
|
||||
|
||||
@onready var show_beast_info: CheckButton = %ShowBeastInfo
|
||||
|
||||
@onready var tracks_collected_list: VBoxContainer = %TracksCollectedList
|
||||
@onready var append_target: Panel = %AppendTarget
|
||||
|
||||
@ -30,6 +32,11 @@ func _ready() -> void:
|
||||
_build_track_list()
|
||||
_update_alert_level()
|
||||
|
||||
@warning_ignore("unsafe_cast")
|
||||
show_beast_info.set_pressed_no_signal(
|
||||
ProjectSettings.get_setting_with_override("game/debug/show_beast_info") as bool
|
||||
)
|
||||
|
||||
|
||||
func _build_track_list() -> void:
|
||||
tracks_collected_list.remove_child(append_target)
|
||||
@ -138,3 +145,7 @@ func spawn_beast() -> void:
|
||||
func kill_beasts() -> void:
|
||||
for c: Node in get_tree().get_nodes_in_group(GrunkBeast.GROUP):
|
||||
c.queue_free()
|
||||
|
||||
|
||||
func set_show_beast_info(toggled_on: bool) -> void:
|
||||
ProjectSettings.set_setting("game/debug/show_beast_info", toggled_on)
|
||||
|
@ -205,6 +205,12 @@ text = "Spawn grunkbeast"
|
||||
layout_mode = 2
|
||||
text = "Despawn all grunkbeasts"
|
||||
|
||||
[node name="ShowBeastInfo" type="CheckButton" parent="MarginContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/HBoxContainer8"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "Show beast info"
|
||||
alignment = 2
|
||||
|
||||
[node name="HBoxContainer6" type="HBoxContainer" parent="MarginContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 16
|
||||
@ -379,6 +385,7 @@ preserve_on_drag = true
|
||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/HBoxContainer7/ResetAlertLevel" to="." method="reset_alert_level"]
|
||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/HBoxContainer8/SpawnBeast" to="." method="spawn_beast"]
|
||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/HBoxContainer8/KillBeasts" to="." method="kill_beasts"]
|
||||
[connection signal="toggled" from="MarginContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/HBoxContainer8/ShowBeastInfo" to="." method="set_show_beast_info"]
|
||||
[connection signal="child_entered_tree" from="MarginContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/HBoxContainer6/TracksCollectedColumn/TracksCollected/MarginContainer/ScrollContainer/MarginContainer/TracksCollectedList" to="." method="_on_track_list_changed" unbinds=1]
|
||||
[connection signal="child_exiting_tree" from="MarginContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/HBoxContainer6/TracksCollectedColumn/TracksCollected/MarginContainer/ScrollContainer/MarginContainer/TracksCollectedList" to="." method="_on_track_list_changed" unbinds=1]
|
||||
[connection signal="child_order_changed" from="MarginContainer/VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/HBoxContainer6/TracksCollectedColumn/TracksCollected/MarginContainer/ScrollContainer/MarginContainer/TracksCollectedList" to="." method="_on_track_list_changed"]
|
||||
|
@ -1,10 +1,13 @@
|
||||
class_name FloorSpawner extends BeastSpawner
|
||||
## Beast spawner on the floor
|
||||
|
||||
@export var y_offset: float = 1.0
|
||||
|
||||
|
||||
func do_spawn() -> void:
|
||||
var instance: GrunkBeast = instantiate()
|
||||
add_sibling(instance)
|
||||
|
||||
instance.global_transform = global_transform
|
||||
instance.global_position.y += y_offset
|
||||
instance.start_spawn()
|
||||
|
@ -14,4 +14,5 @@ func tick(_actor: Node, blackboard: Blackboard) -> int:
|
||||
blackboard.set_value(
|
||||
GrunkBeast.ANGER_KEY, clampf(value + d, GrunkBeast.anger_min, GrunkBeast.anger_max)
|
||||
)
|
||||
print_debug("Beast anger increased by ", d, " by action ", name)
|
||||
return SUCCESS
|
||||
|
11
src/world/grunk_beast/debug_canvas_layer.gd
Normal file
11
src/world/grunk_beast/debug_canvas_layer.gd
Normal file
@ -0,0 +1,11 @@
|
||||
extends CanvasLayer
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
ProjectSettings.settings_changed.connect(_check_setting)
|
||||
_check_setting()
|
||||
|
||||
|
||||
func _check_setting() -> void:
|
||||
visible = ProjectSettings.get_setting_with_override("game/debug/show_beast_info")
|
1
src/world/grunk_beast/debug_canvas_layer.gd.uid
Normal file
1
src/world/grunk_beast/debug_canvas_layer.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://dw3t84dfacj2a
|
@ -109,6 +109,7 @@ func _ready() -> void:
|
||||
|
||||
|
||||
func start_spawn() -> void:
|
||||
apply_floor_snap()
|
||||
model.play_spawn_animation()
|
||||
root_block.await_signal(model.spawn_animation_finished)
|
||||
# Set point of interest to spawn point
|
||||
@ -195,10 +196,10 @@ func on_sound_detected(source: Vector3) -> void:
|
||||
|
||||
point_of_interest = source
|
||||
if sound_detection_cooldown.is_stopped():
|
||||
print_debug("Beast heard something from ", source)
|
||||
print_debug("Beast heard something from ", source, "(+", GrunkBeast.anger_noise, ")")
|
||||
anger_level += GrunkBeast.anger_noise
|
||||
if source.distance_to(self.global_position) <= GrunkBeast.provocation_range:
|
||||
print_debug("... And it was close, too!")
|
||||
print_debug("... And it was close, too! (+", GrunkBeast.anger_noise_near, ")")
|
||||
anger_level += GrunkBeast.anger_noise_near
|
||||
sound_detection_cooldown.start()
|
||||
# TODO animation?
|
||||
@ -224,11 +225,11 @@ func _on_alarm_triggered(source: GunkAlarm) -> void:
|
||||
if root_block.is_blocked():
|
||||
return
|
||||
|
||||
print_debug("The beast was angered by the alarm!")
|
||||
print_debug("The beast was angered by the alarm! (+", GrunkBeast.anger_alarm, ")")
|
||||
point_of_interest = source.global_position
|
||||
anger_level += GrunkBeast.anger_alarm
|
||||
if World.instance.manager.alert_level >= GrunkBeast.anger_extra_alert_level:
|
||||
print_debug("The beast got extra-angry!")
|
||||
print_debug("The beast got extra-angry! (+", GrunkBeast.anger_alarm_extra, ")")
|
||||
anger_level += GrunkBeast.anger_alarm_extra
|
||||
|
||||
|
||||
@ -237,6 +238,6 @@ func _on_touch(_body: Node3D) -> void:
|
||||
return
|
||||
|
||||
if touch_cooldown.is_stopped():
|
||||
print_debug("Touched the beast!")
|
||||
print_debug("Touched the beast! (+", GrunkBeast.anger_touch, ")")
|
||||
anger_level += GrunkBeast.anger_touch
|
||||
touch_cooldown.start()
|
||||
|
@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=45 format=3 uid="uid://ehf5sg3ahvbf"]
|
||||
[gd_scene load_steps=46 format=3 uid="uid://ehf5sg3ahvbf"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b5loa2u6s5l5c" path="res://src/player/rigid_body_physics.gd" id="2_4alar"]
|
||||
[ext_resource type="PackedScene" uid="uid://brrd33217oplv" path="res://src/world/grunk_beast/shambler/shambler.tscn" id="2_csisu"]
|
||||
@ -36,6 +36,7 @@
|
||||
[ext_resource type="Script" uid="uid://o625e667ig2e" path="res://src/world/grunk_beast/behaviors/conditions/point_in_range.gd" id="34_vbkm0"]
|
||||
[ext_resource type="Script" uid="uid://dsf3a8vlolhx8" path="res://addons/beehave/nodes/decorators/succeeder.gd" id="35_4alar"]
|
||||
[ext_resource type="Script" uid="uid://c7n3lak5yhrpv" path="res://src/world/grunk_beast/behaviors/decorators/random_chance.gd" id="36_uy7at"]
|
||||
[ext_resource type="Script" uid="uid://dw3t84dfacj2a" path="res://src/world/grunk_beast/debug_canvas_layer.gd" id="37_uy7at"]
|
||||
|
||||
[sub_resource type="Curve" id="Curve_sm756"]
|
||||
_limits = [0.0, 10.0, 0.0, 150.0]
|
||||
@ -49,7 +50,7 @@ radius = 0.4
|
||||
radius = 9.0
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_1cnlk"]
|
||||
radius = 2.0
|
||||
radius = 1.7
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_3gbao"]
|
||||
radius = 1.4
|
||||
@ -158,7 +159,7 @@ one_shot = true
|
||||
|
||||
[node name="TouchCooldown" type="Timer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
wait_time = 0.5
|
||||
wait_time = 0.8
|
||||
one_shot = true
|
||||
|
||||
[node name="AngerDecay" type="Timer" parent="."]
|
||||
@ -389,7 +390,7 @@ metadata/_custom_type_script = "uid://cg016dbe7gs1x"
|
||||
script = ExtResource("11_mbqcc")
|
||||
mean_time = 4.0
|
||||
st_dev_time = 0.6
|
||||
wait_time = 4.75634
|
||||
wait_time = 4.22028
|
||||
metadata/_custom_type_script = "uid://beyk2xtbjrsg4"
|
||||
|
||||
[node name="PickRandomInvestigationTarget" type="Node" parent="GrunkBeastBehavior/StateSelector/TrackingMode/ActionSelector/InvestigateAction/AlwaysSucceedDecorator/InvestigateSequence/RandomDelay"]
|
||||
@ -483,7 +484,7 @@ metadata/_custom_type_script = "uid://bogt3htgqe12s"
|
||||
script = ExtResource("11_mbqcc")
|
||||
mean_time = 9.0
|
||||
st_dev_time = 1.0
|
||||
wait_time = 9.92344
|
||||
wait_time = 9.39944
|
||||
metadata/_custom_type_script = "uid://beyk2xtbjrsg4"
|
||||
|
||||
[node name="PickRandomLurkTarget" type="Node" parent="GrunkBeastBehavior/StateSelector/LurkingMode/RandomDelay"]
|
||||
@ -509,6 +510,7 @@ metadata/_custom_type_script = "uid://dme5f24l0edsf"
|
||||
[node name="DebugCanvasLayer" type="CanvasLayer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layer = 10
|
||||
script = ExtResource("37_uy7at")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="DebugCanvasLayer"]
|
||||
offset_right = 40.0
|
||||
|
@ -59,6 +59,7 @@ animation = &"walk_front"
|
||||
animation = &"walk_rear"
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_nayyt"]
|
||||
graph_offset = Vector2(-1297.66, 69.5868)
|
||||
nodes/anim_scale/node = SubResource("AnimationNodeTimeScale_s7rwx")
|
||||
nodes/anim_scale/position = Vector2(280, 140)
|
||||
nodes/emerge_floor/node = SubResource("AnimationNodeAnimation_vmxrd")
|
||||
|
Loading…
x
Reference in New Issue
Block a user