Refactoring and added unit testing framework

This commit is contained in:
anyreso 2024-04-12 22:23:39 +00:00
parent 06346b2d98
commit 080ce479da
145 changed files with 16250 additions and 470 deletions

Binary file not shown.

View file

@ -0,0 +1,50 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://b83leo1ca47d7"
path="res://.godot/imported/player_mesh.blend-b5697f48af9161c855a7a3326936546b.scn"
[deps]
source_file="res://entities/target_dummy/assets/player_mesh.blend"
dest_files=["res://.godot/imported/player_mesh.blend-b5697f48af9161c855a7a3326936546b.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/apply_root_scale=true
nodes/root_scale=1.0
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
import_script/path=""
_subresources={}
gltf/naming_version=1
gltf/embedded_image_handling=1
blender/nodes/visible=0
blender/nodes/punctual_lights=true
blender/nodes/cameras=true
blender/nodes/custom_properties=true
blender/nodes/modifiers=1
blender/meshes/colors=false
blender/meshes/uvs=true
blender/meshes/normals=true
blender/meshes/tangents=true
blender/meshes/skins=2
blender/meshes/export_bones_deforming_mesh_only=false
blender/materials/unpack_enabled=true
blender/materials/export_materials=1
blender/animation/limit_playback=true
blender/animation/always_sample=true
blender/animation/group_tracks=true

View file

@ -0,0 +1,21 @@
class_name DummyTarget extends RigidBody3D
@export var respawn_time := 0.0 # seconds
@onready var health_component: HealthComponent = $HealthComponent
@onready var collision_shape_3d: CollisionShape3D = $CollisionShape3D
var start_pos : Vector3
func _ready() -> void:
health_component.health_zeroed.connect(spawn)
start_pos = global_position
func spawn():
hide()
collision_shape_3d.disabled = true
await get_tree().create_timer(respawn_time).timeout
health_component.heal_full()
global_position = start_pos
show()
collision_shape_3d.disabled = false

View file

@ -0,0 +1,102 @@
[gd_scene load_steps=5 format=3 uid="uid://dpnu1lvfncx6q"]
[ext_resource type="Script" path="res://entities/target_dummy/target_dummy.gd" id="1_r02ch"]
[ext_resource type="PackedScene" uid="uid://b83leo1ca47d7" path="res://entities/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="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_r02ch")
[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="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, 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.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.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.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/31/rotation = Quaternion(0.0237032, 0.0123211, -0.0433656, 0.998702)
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.0486079, 0.0407853, -0.0142859, 0.997883)
bones/38/rotation = Quaternion(0.0934222, 0.536709, 0.031309, 0.837995)
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.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, 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="PlayerMesh" index="4"]
autoplay = "gunOneHanded"
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
shape = SubResource("CapsuleShape3D_rk1ox")
[node name="HealthComponent" parent="." instance=ExtResource("3_g1ap4")]
max_health = 300
[editable path="PlayerMesh"]