mirror of
https://gitlab.com/open-fpsz/open-fpsz.git
synced 2026-07-12 06:55:18 +00:00
Merge branch 'feat/various-improvements' into 'develop'
✨ Various improvements to the demo game mode See merge request open-fpsz/open-fpsz!7
This commit is contained in:
commit
47d6aa1986
8 changed files with 57 additions and 41 deletions
|
|
@ -103,7 +103,7 @@ func die():
|
|||
$PlayerInput.disable()
|
||||
var tween = create_tween()
|
||||
tween.tween_property(input, "camera_rotation:y", -PI/2, 0.25)
|
||||
tween.tween_property($SpringArm3D, "position:y", 0, 0.25)
|
||||
tween.tween_property($SpringArm3D, "position:y", -0.75, 0.25)
|
||||
tween.tween_interval(2)
|
||||
tween.tween_callback(func(): died.emit(self))
|
||||
|
||||
|
|
@ -111,5 +111,6 @@ func respawn(location):
|
|||
$SpringArm3D.position.y = spring_arm_height
|
||||
input.camera_rotation.y = 0
|
||||
linear_velocity = Vector3()
|
||||
$HealthComponent.heal_full()
|
||||
position = location
|
||||
$PlayerInput.enable()
|
||||
|
|
|
|||
|
|
@ -4,12 +4,12 @@ importer="scene"
|
|||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://ckgate4oq25l5"
|
||||
path="res://.godot/imported/playermesh.blend-ced1b274adcccb114d1d1a807b1c25c0.scn"
|
||||
path="res://.godot/imported/player_mesh.blend-9b0ba05784202760bb9e3cab54d4633e.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://characters/target/assets/playermesh.blend"
|
||||
dest_files=["res://.godot/imported/playermesh.blend-ced1b274adcccb114d1d1a807b1c25c0.scn"]
|
||||
source_file="res://characters/target_dummy/assets/player_mesh.blend"
|
||||
dest_files=["res://.godot/imported/player_mesh.blend-9b0ba05784202760bb9e3cab54d4633e.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
|
|
@ -1,10 +1,9 @@
|
|||
class_name Target
|
||||
extends RigidBody3D
|
||||
class_name TargetDummy
|
||||
|
||||
@export var respawn_time_seconds := 5.0
|
||||
|
||||
@onready var health_component: HealthComponent = $HealthComponent
|
||||
@onready var graphics: Node3D = $Graphics
|
||||
@onready var collision_shape_3d: CollisionShape3D = $CollisionShape3D
|
||||
|
||||
var start_pos : Vector3
|
||||
|
|
@ -16,10 +15,10 @@ func _ready() -> void:
|
|||
|
||||
|
||||
func respawn_target():
|
||||
graphics.hide()
|
||||
hide()
|
||||
collision_shape_3d.disabled = true
|
||||
await get_tree().create_timer(respawn_time_seconds).timeout
|
||||
health_component.reset()
|
||||
health_component.heal_full()
|
||||
global_position = start_pos
|
||||
graphics.show()
|
||||
show()
|
||||
collision_shape_3d.disabled = false
|
||||
|
|
@ -1,55 +1,60 @@
|
|||
[gd_scene load_steps=5 format=3 uid="uid://dpnu1lvfncx6q"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://ckgate4oq25l5" path="res://characters/target/assets/playermesh.blend" id="1_0ljam"]
|
||||
[ext_resource type="Script" path="res://characters/target/target.gd" id="1_opjsn"]
|
||||
[ext_resource type="PackedScene" uid="uid://bof3mg7wgxrmn" path="res://components/health_component.tscn" id="2_kskm1"]
|
||||
[ext_resource type="Script" path="res://characters/target_dummy/target_dummy.gd" id="1_r02ch"]
|
||||
[ext_resource type="PackedScene" uid="uid://ckgate4oq25l5" path="res://characters/target_dummy/assets/player_mesh.blend" id="2_x73k8"]
|
||||
[ext_resource type="PackedScene" uid="uid://bof3mg7wgxrmn" path="res://components/health_component.tscn" id="3_g1ap4"]
|
||||
|
||||
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_rk1ox"]
|
||||
radius = 0.3
|
||||
|
||||
[node name="Target" type="RigidBody3D"]
|
||||
[node name="TargetDummy" type="RigidBody3D"]
|
||||
axis_lock_angular_x = true
|
||||
axis_lock_angular_y = true
|
||||
axis_lock_angular_z = true
|
||||
mass = 75.0
|
||||
continuous_cd = true
|
||||
script = ExtResource("1_opjsn")
|
||||
script = ExtResource("1_r02ch")
|
||||
|
||||
[node name="Graphics" type="Node3D" parent="."]
|
||||
[node name="PlayerMesh" parent="." instance=ExtResource("2_x73k8")]
|
||||
transform = Transform3D(0.75, 0, 0, 0, 0.75, 0, 0, 0, 0.75, 0, -0.916438, 0)
|
||||
|
||||
[node name="playermesh" parent="Graphics" instance=ExtResource("1_0ljam")]
|
||||
|
||||
[node name="Skeleton3D" parent="Graphics/playermesh/playerrig" index="0"]
|
||||
bones/0/position = Vector3(0, 0.995864, -0.0552)
|
||||
[node name="Skeleton3D" parent="PlayerMesh/playerrig" index="0"]
|
||||
bones/0/rotation = Quaternion(0.12582, -1.79059e-15, -1.33409e-23, 0.992053)
|
||||
bones/0/scale = Vector3(1, 1, 1)
|
||||
bones/1/rotation = Quaternion(-0.0644764, 5.62483e-23, -9.26994e-23, 0.997919)
|
||||
bones/1/rotation = Quaternion(-0.0644764, 1.78006e-15, -6.67523e-16, 0.997919)
|
||||
bones/2/rotation = Quaternion(-0.0774641, 0, 0, 0.996995)
|
||||
bones/4/rotation = Quaternion(0.201738, -3.62729e-15, 4.53412e-16, 0.97944)
|
||||
bones/6/rotation = Quaternion(-0.605155, -0.345862, -0.356135, 0.622363)
|
||||
bones/7/rotation = Quaternion(-0.244994, 0.787594, -0.344589, 0.448255)
|
||||
bones/7/rotation = Quaternion(-0.0464025, 0.68865, -0.38959, 0.609777)
|
||||
bones/7/scale = Vector3(1, 1, 1)
|
||||
bones/8/rotation = Quaternion(0.185291, 0.0266179, 0.00595018, 0.982305)
|
||||
bones/8/scale = Vector3(1, 1, 1)
|
||||
bones/9/rotation = Quaternion(0.126866, -0.0346058, -0.00662176, 0.991294)
|
||||
bones/9/scale = Vector3(1, 1, 1)
|
||||
bones/10/rotation = Quaternion(0.0557877, -0.312038, -0.196665, 0.927816)
|
||||
bones/11/rotation = Quaternion(-0.0630718, -0.16283, 0.0971492, 0.979832)
|
||||
bones/13/rotation = Quaternion(0.0299552, -0.545663, -0.00259936, 0.837465)
|
||||
bones/13/scale = Vector3(1, 1, 1)
|
||||
bones/14/rotation = Quaternion(-0.0636278, -0.0624373, 0.0299354, 0.995569)
|
||||
bones/15/rotation = Quaternion(0.01399, 0.0251671, 0.0278526, 0.999197)
|
||||
bones/16/rotation = Quaternion(-0.1, -0.561252, 0.0324573, 0.82094)
|
||||
bones/17/rotation = Quaternion(0.0486079, -0.0407852, 0.014286, 0.997883)
|
||||
bones/19/rotation = Quaternion(-0.12453, -0.526036, 0.129609, 0.831252)
|
||||
bones/20/rotation = Quaternion(-0.0225172, -0.0668488, 0.0231689, 0.99724)
|
||||
bones/20/scale = Vector3(1, 1, 1)
|
||||
bones/21/rotation = Quaternion(-0.00114936, 0.0252308, -0.0174874, 0.999528)
|
||||
bones/21/scale = Vector3(1, 1, 1)
|
||||
bones/22/rotation = Quaternion(-0.192536, -0.535774, 0.0761884, 0.818579)
|
||||
bones/23/rotation = Quaternion(0.0104723, -0.0704384, 0.0293146, 0.99703)
|
||||
bones/23/scale = Vector3(1, 1, 1)
|
||||
bones/24/rotation = Quaternion(0.0334518, 0.0259883, -0.0178538, 0.998943)
|
||||
bones/25/rotation = Quaternion(-0.605155, 0.345863, 0.356135, 0.622363)
|
||||
bones/25/scale = Vector3(1, 1, 1)
|
||||
bones/26/rotation = Quaternion(0.0407172, -0.246634, 0.858112, 0.448506)
|
||||
bones/26/rotation = Quaternion(-0.0464025, -0.68865, 0.38959, 0.609777)
|
||||
bones/26/scale = Vector3(1, 1, 1)
|
||||
bones/27/rotation = Quaternion(0.185291, -0.0266179, -0.00595018, 0.982305)
|
||||
bones/27/scale = Vector3(1, 1, 1)
|
||||
bones/28/rotation = Quaternion(-0.217102, 0.0422089, 0.0230507, 0.974963)
|
||||
bones/28/rotation = Quaternion(-0.144176, 0.0367847, -0.00247504, 0.988865)
|
||||
bones/28/scale = Vector3(1, 1, 1)
|
||||
bones/30/rotation = Quaternion(-0.0630717, 0.16283, -0.0971492, 0.979832)
|
||||
bones/30/scale = Vector3(1, 1, 1)
|
||||
|
|
@ -58,39 +63,41 @@ bones/31/scale = Vector3(1, 1, 1)
|
|||
bones/32/rotation = Quaternion(0.243143, 0.523041, 0.164477, 0.800161)
|
||||
bones/32/scale = Vector3(1, 1, 1)
|
||||
bones/33/rotation = Quaternion(-0.0636278, 0.0624373, -0.0299354, 0.995569)
|
||||
bones/34/rotation = Quaternion(0.0139901, -0.0251671, -0.0278526, 0.999197)
|
||||
bones/35/rotation = Quaternion(0.113348, 0.545076, 0.134205, 0.819776)
|
||||
bones/36/rotation = Quaternion(-0.4266, 0.0977703, 0.332942, 0.835226)
|
||||
bones/37/rotation = Quaternion(-0.632018, -0.129105, 0.241206, 0.725056)
|
||||
bones/36/rotation = Quaternion(0.0486079, 0.0407853, -0.0142859, 0.997883)
|
||||
bones/38/rotation = Quaternion(0.0934222, 0.536709, 0.031309, 0.837995)
|
||||
bones/39/rotation = Quaternion(-0.479327, 0.030236, 0.338389, 0.809212)
|
||||
bones/40/rotation = Quaternion(-0.540176, -0.0581251, 0.395197, 0.740709)
|
||||
bones/39/rotation = Quaternion(-0.0225172, 0.0668488, -0.023169, 0.99724)
|
||||
bones/40/rotation = Quaternion(-0.00114935, -0.0252307, 0.0174875, 0.999528)
|
||||
bones/40/scale = Vector3(1, 1, 1)
|
||||
bones/41/rotation = Quaternion(0.0241847, 0.530538, 0.0849425, 0.843048)
|
||||
bones/41/scale = Vector3(1, 1, 1)
|
||||
bones/42/rotation = Quaternion(-0.451682, -0.0170104, 0.326969, 0.829931)
|
||||
bones/43/rotation = Quaternion(-0.512965, -0.0942157, 0.391943, 0.757873)
|
||||
bones/44/rotation = Quaternion(0.986515, -3.3762e-16, 1.34771e-25, 0.163672)
|
||||
bones/42/rotation = Quaternion(0.0104724, 0.0704385, -0.0293146, 0.99703)
|
||||
bones/43/rotation = Quaternion(0.0334518, -0.0259883, 0.0178538, 0.998943)
|
||||
bones/44/rotation = Quaternion(0.986515, -3.3762e-16, 5.03093e-24, 0.163672)
|
||||
bones/44/scale = Vector3(1, 1, 0.999997)
|
||||
bones/45/rotation = Quaternion(0.143207, -4.28623e-07, 5.19845e-06, 0.989693)
|
||||
bones/45/scale = Vector3(1, 1, 1)
|
||||
bones/46/rotation = Quaternion(-0.574131, 2.92207e-06, -4.58343e-06, 0.818763)
|
||||
bones/47/rotation = Quaternion(1.99048e-05, 0.961249, -0.27568, 4.3124e-06)
|
||||
bones/47/scale = Vector3(1, 1, 1)
|
||||
bones/48/rotation = Quaternion(0.679706, 0.679706, -0.194936, 0.194936)
|
||||
bones/49/rotation = Quaternion(0.986515, -3.3762e-16, 1.34771e-25, 0.163672)
|
||||
bones/49/rotation = Quaternion(0.986515, -3.3762e-16, 5.03093e-24, 0.163672)
|
||||
bones/49/scale = Vector3(1, 1, 0.999997)
|
||||
bones/50/rotation = Quaternion(0.143207, 4.28623e-07, -5.19845e-06, 0.989693)
|
||||
bones/50/scale = Vector3(1, 1, 1)
|
||||
bones/51/rotation = Quaternion(-0.574131, -2.92207e-06, 4.58343e-06, 0.818763)
|
||||
bones/52/rotation = Quaternion(-1.99048e-05, 0.961249, -0.27568, -4.3124e-06)
|
||||
bones/52/scale = Vector3(1, 1, 1)
|
||||
bones/53/rotation = Quaternion(0.679706, -0.679706, 0.194936, 0.194936)
|
||||
|
||||
[node name="AnimationPlayer" parent="Graphics/playermesh" index="4"]
|
||||
[node name="AnimationPlayer" parent="PlayerMesh" index="4"]
|
||||
autoplay = "gunOneHanded"
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
shape = SubResource("CapsuleShape3D_rk1ox")
|
||||
|
||||
[node name="HealthComponent" parent="." instance=ExtResource("2_kskm1")]
|
||||
[node name="HealthComponent" parent="." instance=ExtResource("3_g1ap4")]
|
||||
max_health = 300
|
||||
|
||||
[editable path="Graphics/playermesh"]
|
||||
[editable path="PlayerMesh"]
|
||||
|
|
@ -11,13 +11,16 @@ func _ready():
|
|||
area_entered.connect(_on_area_entered)
|
||||
|
||||
func damage(amount : int):
|
||||
health -= amount
|
||||
if health <= 0:
|
||||
health = clampf(health - amount, 0.0, max_health)
|
||||
if health == 0.0:
|
||||
health_zeroed.emit()
|
||||
|
||||
func reset():
|
||||
func heal_full():
|
||||
health = max_health
|
||||
|
||||
func _on_area_entered(area):
|
||||
func heal(amount : int):
|
||||
health = clampf(health + amount, 0.0, max_health)
|
||||
|
||||
func _on_area_entered(area : Area3D):
|
||||
if area is AreaDamageComponent:
|
||||
damage(area.damage)
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
extends Node
|
||||
|
||||
@onready var player : Player = $Player
|
||||
@onready var target_dummy = $TargetDummy
|
||||
|
||||
@onready var respawn_location = player.position
|
||||
@onready var player_respawn_location = player.position
|
||||
|
||||
func _ready():
|
||||
player.died.connect(respawn_player)
|
||||
|
||||
func respawn_player(player):
|
||||
player.respawn(respawn_location)
|
||||
player.respawn(player_respawn_location)
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
[gd_scene load_steps=5 format=3 uid="uid://boviiugcnfyrj"]
|
||||
[gd_scene load_steps=6 format=3 uid="uid://boviiugcnfyrj"]
|
||||
|
||||
[ext_resource type="Script" path="res://game_modes/demo.gd" id="1_gytim"]
|
||||
[ext_resource type="PackedScene" uid="uid://chbno00ugl6te" path="res://maps/genesis/genesis.tscn" id="2_lsep7"]
|
||||
[ext_resource type="PackedScene" uid="uid://cbhx1xme0sb7k" path="res://characters/player/player.tscn" id="3_j1li7"]
|
||||
[ext_resource type="PackedScene" uid="uid://dpnu1lvfncx6q" path="res://characters/target_dummy/target_dummy.tscn" id="4_qndi7"]
|
||||
|
||||
[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_c5jqv"]
|
||||
resource_local_to_scene = true
|
||||
|
|
@ -17,3 +18,6 @@ script = ExtResource("1_gytim")
|
|||
[node name="Player" parent="." instance=ExtResource("3_j1li7")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 92.7007, 0)
|
||||
physics_material_override = SubResource("PhysicsMaterial_c5jqv")
|
||||
|
||||
[node name="TargetDummy" parent="." instance=ExtResource("4_qndi7")]
|
||||
transform = Transform3D(-0.995746, 0, -0.0921446, 0, 1, 0, 0.0921446, 0, -0.995746, 15.757, 95.1745, 0)
|
||||
|
|
|
|||
|
|
@ -31,3 +31,4 @@ process_material = SubResource("ParticleProcessMaterial_3mf41")
|
|||
draw_pass_1 = SubResource("SphereMesh_k3pnh")
|
||||
|
||||
[node name="AreaDamageComponent" parent="." instance=ExtResource("2_reyvo")]
|
||||
damage = 35
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue