mirror of
https://gitlab.com/open-fpsz/open-fpsz.git
synced 2026-07-16 08:55:33 +00:00
✨ flag refactoring
This commit is contained in:
parent
69c8b65093
commit
6ba368c76e
21 changed files with 389 additions and 198 deletions
|
|
@ -18,6 +18,7 @@ enum PlayerState { PLAYER_ALIVE, PLAYER_DEAD }
|
|||
|
||||
@export var iff : Control
|
||||
@export var health_component : HealthComponent
|
||||
@export var flag_carry_component : FlagCarryComponent
|
||||
@export var walkable_surface_sensor : ShapeCast3D
|
||||
|
||||
## The inventory component can store up to [member Inventory.slots] objects. It
|
||||
|
|
@ -49,7 +50,6 @@ enum PlayerState { PLAYER_ALIVE, PLAYER_DEAD }
|
|||
@onready var hud : CanvasLayer = $HUD
|
||||
@onready var animation_player : AnimationPlayer = $AnimationPlayer
|
||||
@onready var collision_shape : CollisionShape3D = $CollisionShape3D
|
||||
@onready var flag_carry_component : FlagCarryComponent = %Pivot/FlagCarryComponent
|
||||
@onready var jetpack_particles : Array = $Smoothing/ThirdPerson/Mesh/JetpackFX.get_children()
|
||||
@onready var match_participant_component : MatchParticipantComponent = $MatchParticipantComponent
|
||||
|
||||
|
|
@ -65,7 +65,6 @@ static var pawn_player : Player
|
|||
func _ready() -> void:
|
||||
match_participant_component.player_id_changed.connect(_setup_pawn)
|
||||
match_participant_component.player_id_changed.connect(input.update_multiplayer_authority)
|
||||
match_participant_component.nickname_changed.connect(iff.set_nickname)
|
||||
health_component.health_changed.connect(hud._on_health_changed)
|
||||
health_component.health_changed.connect(iff._on_health_changed)
|
||||
health_component.health_changed.emit(health_component.health)
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
[gd_scene load_steps=45 format=3 uid="uid://cbhx1xme0sb7k"]
|
||||
|
||||
[ext_resource type="Script" path="res://entities/player/player.gd" id="1_mk68k"]
|
||||
[ext_resource type="Shape3D" uid="uid://cb8esdlnottdn" path="res://entities/player/collision_shape.tres" id="2_vjqny"]
|
||||
[ext_resource type="PackedScene" uid="uid://bcv81ku26xo" path="res://interfaces/hud/hud.tscn" id="3_ccety"]
|
||||
[ext_resource type="Shape3D" uid="uid://cb8esdlnottdn" path="res://entities/player/resources/collider.tres" id="4_8kvcy"]
|
||||
[ext_resource type="Script" path="res://entities/components/match_participant_component.gd" id="6_lrose"]
|
||||
[ext_resource type="Script" path="res://entities/player/player_input.gd" id="6_ymcrr"]
|
||||
[ext_resource type="PackedScene" uid="uid://dsysi2rd3bu76" path="res://interfaces/hud/iffs/iff.tscn" id="7_8hc80"]
|
||||
|
|
@ -206,8 +206,9 @@ particles_anim_loop = false
|
|||
[sub_resource type="QuadMesh" id="QuadMesh_uc7ts"]
|
||||
material = SubResource("StandardMaterial3D_2jwv2")
|
||||
|
||||
[node name="Player" type="RigidBody3D" node_paths=PackedStringArray("iff", "health_component", "walkable_surface_sensor", "inventory", "tp_mesh") groups=["Player"]]
|
||||
[node name="Player" type="RigidBody3D" node_paths=PackedStringArray("iff", "health_component", "flag_carry_component", "walkable_surface_sensor", "inventory", "tp_mesh") groups=["Player"]]
|
||||
collision_mask = 2147483649
|
||||
collision_priority = 9.0
|
||||
axis_lock_angular_x = true
|
||||
axis_lock_angular_y = true
|
||||
axis_lock_angular_z = true
|
||||
|
|
@ -216,27 +217,20 @@ physics_material_override = SubResource("PhysicsMaterial_clur0")
|
|||
can_sleep = false
|
||||
continuous_cd = true
|
||||
script = ExtResource("1_mk68k")
|
||||
iff = NodePath("Smoothing/ThirdPerson/IFF")
|
||||
iff = NodePath("Smoothing/ThirdPerson/IFFAttachment/IFF")
|
||||
health_component = NodePath("HealthComponent")
|
||||
flag_carry_component = NodePath("Pivot/FlagCarryComponent")
|
||||
walkable_surface_sensor = NodePath("WalkableSurfaceSensor")
|
||||
inventory = NodePath("Pivot/Inventory")
|
||||
tp_mesh = NodePath("Smoothing/ThirdPerson/Mesh")
|
||||
jump_height = 1.5
|
||||
|
||||
[node name="Sensor" type="Area3D" parent="."]
|
||||
collision_layer = 0
|
||||
collision_mask = 8
|
||||
monitorable = false
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Sensor"]
|
||||
shape = ExtResource("2_vjqny")
|
||||
|
||||
[node name="HealthComponent" type="Area3D" parent="." node_paths=PackedStringArray("match_participant_component")]
|
||||
script = ExtResource("14_ctgxn")
|
||||
match_participant_component = NodePath("../MatchParticipantComponent")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="HealthComponent"]
|
||||
shape = ExtResource("2_vjqny")
|
||||
shape = ExtResource("4_8kvcy")
|
||||
|
||||
[node name="WalkableSurfaceSensor" type="ShapeCast3D" parent="."]
|
||||
transform = Transform3D(1.05, 0, 0, 0, 1.05, 0, 0, 0, 1.05, 0, -0.85, 0)
|
||||
|
|
@ -245,7 +239,7 @@ target_position = Vector3(0, 0, 0)
|
|||
collision_mask = 2147483648
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
shape = ExtResource("2_vjqny")
|
||||
shape = ExtResource("4_8kvcy")
|
||||
|
||||
[node name="HUD" parent="." instance=ExtResource("3_ccety")]
|
||||
|
||||
|
|
@ -295,19 +289,17 @@ visible = false
|
|||
[node name="GrenadeLauncher" parent="Pivot/Inventory" instance=ExtResource("16_4xs2j")]
|
||||
visible = false
|
||||
|
||||
[node name="FlagCarryComponent" type="Node3D" parent="Pivot" node_paths=PackedStringArray("sensor", "carrier")]
|
||||
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, 0)
|
||||
visible = false
|
||||
script = ExtResource("8_pdfbn")
|
||||
sensor = NodePath("../../Sensor")
|
||||
carrier = NodePath("../..")
|
||||
|
||||
[node name="FlagMesh" parent="Pivot/FlagCarryComponent" instance=ExtResource("18_7nkei")]
|
||||
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 1.559e-08, -0.462981, -0.178329)
|
||||
|
||||
[node name="SpineIKTarget" type="Marker3D" parent="Pivot"]
|
||||
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, 0)
|
||||
|
||||
[node name="FlagCarryComponent" type="Node3D" parent="Pivot" node_paths=PackedStringArray("mesh")]
|
||||
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, -0.25, 0.377972)
|
||||
visible = false
|
||||
script = ExtResource("8_pdfbn")
|
||||
mesh = NodePath("FlagMesh")
|
||||
|
||||
[node name="FlagMesh" parent="Pivot/FlagCarryComponent" instance=ExtResource("18_7nkei")]
|
||||
|
||||
[node name="Smoothing" type="Node3D" parent="."]
|
||||
script = ExtResource("11_k330l")
|
||||
target = NodePath("..")
|
||||
|
|
@ -329,7 +321,6 @@ bones/6/rotation = Quaternion(0.160951, 0.00623474, 0.0096637, 0.986895)
|
|||
bones/8/rotation = Quaternion(0.675761, -0.399581, 0.409695, 0.464577)
|
||||
bones/10/rotation = Quaternion(0.212344, -0.0870591, -0.287653, 0.929831)
|
||||
bones/12/rotation = Quaternion(0.0811501, 0.206806, -0.754068, 0.618084)
|
||||
bones/14/position = Vector3(-0.074525, 0.220475, 0.075475)
|
||||
bones/14/rotation = Quaternion(0.00943715, 0.0971687, -0.145046, 0.984597)
|
||||
bones/20/rotation = Quaternion(-0.123455, 0.0248346, 0.23344, 0.964183)
|
||||
bones/24/rotation = Quaternion(0.0450683, -0.000817796, 0.0508488, 0.997689)
|
||||
|
|
@ -347,9 +338,8 @@ bones/56/rotation = Quaternion(-0.0254885, 0.0439755, -0.00910637, 0.998666)
|
|||
bones/58/rotation = Quaternion(-0.0119802, 0.289956, -0.0527053, 0.955513)
|
||||
bones/62/rotation = Quaternion(0.689943, 0.375565, -0.410267, 0.463261)
|
||||
bones/64/rotation = Quaternion(0.337746, -0.290519, 0.159479, 0.880961)
|
||||
bones/66/position = Vector3(0.055475, 0.231475, 0.000474975)
|
||||
bones/66/rotation = Quaternion(0.540371, -0.580679, 0.406779, 0.453147)
|
||||
bones/68/position = Vector3(-0.014525, 0.270475, -0.054525)
|
||||
bones/68/position = Vector3(-1.77636e-17, 0.240718, 0)
|
||||
bones/68/rotation = Quaternion(0.0150529, -0.289001, 0.0720108, 0.954498)
|
||||
bones/70/rotation = Quaternion(0.155965, 0.0109114, -0.00107202, 0.987702)
|
||||
bones/72/rotation = Quaternion(0.563923, 4.19095e-08, -0.0577906, 0.823803)
|
||||
|
|
@ -376,7 +366,7 @@ bones/124/rotation = Quaternion(0.417677, -0.0431149, 0.00625689, 0.90755)
|
|||
bones/126/rotation = Quaternion(0.397818, -0.0427722, -0.00601182, 0.916447)
|
||||
|
||||
[node name="HandAttachment" parent="Smoothing/ThirdPerson/Mesh/Node/Skeleton3D" index="0"]
|
||||
transform = Transform3D(-0.152214, 0.0548832, 0.986823, 0.933991, 0.334546, 0.125459, -0.323252, 0.94078, -0.102183, -0.191759, 1.06335, 0.0698007)
|
||||
transform = Transform3D(-0.152214, 0.0548832, 0.986823, 0.933991, 0.334546, 0.125459, -0.323252, 0.94078, -0.102183, -0.261612, 1.14328, 0.0896011)
|
||||
|
||||
[node name="grip" parent="Smoothing/ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/SpaceGun/Mesh/Armature/Skeleton3D" index="0"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.84217e-14, 1.19209e-07, 2.38419e-07)
|
||||
|
|
@ -400,7 +390,13 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.692504, 1.30946)
|
|||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.692504, 1.30946)
|
||||
|
||||
[node name="Barrels" parent="Smoothing/ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/ChainGun" index="3"]
|
||||
transform = Transform3D(-1, 0, 8.9407e-08, 8.47504e-08, 0, 1, 0, 1, -3.72529e-09, 0, -2.38419e-07, -0.55315)
|
||||
transform = Transform3D(-1, -1.49012e-08, 8.801e-08, 8.19564e-08, -3.72529e-09, 1, 0, 1, -7.45058e-09, 5.96046e-08, 0, -0.55315)
|
||||
|
||||
[node name="Skeleton3D" parent="Smoothing/ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/GrenadeLauncher/Armature" index="0"]
|
||||
bones/0/rotation = Quaternion(0, 0.707107, 0.707107, 0)
|
||||
bones/1/rotation = Quaternion(0, 0.707107, 0.707107, 0)
|
||||
bones/2/rotation = Quaternion(0, 0.707107, 0.707107, 0)
|
||||
bones/3/rotation = Quaternion(0, 0.707107, 0.707107, 0)
|
||||
|
||||
[node name="barrel" parent="Smoothing/ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/GrenadeLauncher/Armature/Skeleton3D" index="0"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.19209e-07, 0)
|
||||
|
|
@ -443,11 +439,13 @@ draw_pass_1 = SubResource("QuadMesh_uc7ts")
|
|||
|
||||
[node name="IFFAttachment" type="Marker3D" parent="Smoothing/ThirdPerson"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.27457, 0)
|
||||
visible = false
|
||||
|
||||
[node name="IFF" parent="Smoothing/ThirdPerson" node_paths=PackedStringArray("player", "match_participant_component", "attach_point") instance=ExtResource("7_8hc80")]
|
||||
player = NodePath("../../..")
|
||||
match_participant_component = NodePath("../../../MatchParticipantComponent")
|
||||
attach_point = NodePath("../IFFAttachment")
|
||||
[node name="IFF" parent="Smoothing/ThirdPerson/IFFAttachment" node_paths=PackedStringArray("player", "match_participant_component", "attach_point") instance=ExtResource("7_8hc80")]
|
||||
visible = false
|
||||
player = NodePath("../../../..")
|
||||
match_participant_component = NodePath("../../../../MatchParticipantComponent")
|
||||
attach_point = NodePath("..")
|
||||
|
||||
[connection signal="energy_changed" from="." to="HUD" method="_on_player_energy_changed"]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue