diff --git a/PCs/FSM/building_state.gd b/PCs/FSM/building_state.gd index 45e1e86..015da74 100644 --- a/PCs/FSM/building_state.gd +++ b/PCs/FSM/building_state.gd @@ -7,6 +7,14 @@ extends HeroState func enter_state() -> void: hero.edit_tool.enabled = true hero.game_manager.level.enable_non_path_tower_frames() + var tween: Tween = create_tween() + tween.set_ease(Tween.EASE_OUT) + tween.set_trans(Tween.TRANS_CUBIC) + tween.tween_method(anim, hero.anim_tree.get("parameters/Blend3/blend_amount"), -1.0, 0.5) + + +func anim(x: float) -> void: + hero.anim_tree.set("parameters/Blend3/blend_amount", x) func exit_state() -> void: diff --git a/PCs/FSM/carding_state.gd b/PCs/FSM/carding_state.gd index b8e0e83..00c2db8 100644 --- a/PCs/FSM/carding_state.gd +++ b/PCs/FSM/carding_state.gd @@ -6,8 +6,17 @@ extends HeroState func enter_state() -> void: hero.set_card_elements_visibility(true) - hero.left_hand.visible = true + #hero.left_hand.visible = true hero.carding_tool.enabled = true + var tween: Tween = create_tween() + tween.set_ease(Tween.EASE_OUT) + tween.set_trans(Tween.TRANS_CUBIC) + tween.tween_method(anim, hero.anim_tree.get("parameters/Blend3/blend_amount"), 0.0, 0.5) + + + +func anim(x: float) -> void: + hero.anim_tree.set("parameters/Blend3/blend_amount", x) func exit_state() -> void: diff --git a/PCs/FSM/fighting_state.gd b/PCs/FSM/fighting_state.gd index e6325b7..a4df169 100644 --- a/PCs/FSM/fighting_state.gd +++ b/PCs/FSM/fighting_state.gd @@ -20,6 +20,16 @@ func enter_state() -> void: hero.discard_pile.add(hero.hand.remove_at(hero.hand.contents.size() - 1)) hero.weapon_swap_timer.start() hero.hud.energy_label.visible = false + var tween: Tween = create_tween() + tween.set_ease(Tween.EASE_OUT) + tween.set_trans(Tween.TRANS_CUBIC) + tween.tween_method(anim, hero.anim_tree.get("parameters/Blend3/blend_amount"), 1.0, 0.5) + var tween2: Tween = create_tween() + tween2.tween_property(hero.right_hand, "position", Vector3(0.385, -0.19, -0.275), 0.5) + + +func anim(x: float) -> void: + hero.anim_tree.set("parameters/Blend3/blend_amount", x) func exit_state() -> void: @@ -34,6 +44,8 @@ func exit_state() -> void: #hero.hud.secondary_duration.visible = true if hero.game_manager.card_gameplay: hero.hud.energy_label.visible = true + var tween: Tween = create_tween() + tween.tween_property(hero.right_hand, "position", Vector3(0.17, -0.085, -0.195), 0.5) func process_state(_delta: float) -> void: diff --git a/PCs/hero.gd b/PCs/hero.gd index 25ca7a2..9a04774 100644 --- a/PCs/hero.gd +++ b/PCs/hero.gd @@ -39,6 +39,9 @@ signal ready_state_changed(state: bool) @export var swap_off_audio: AudioStreamPlayer @export var swap_on_audio: AudioStreamPlayer +@export var anim_tree: AnimationTree +@export var weapon_pivot: Node3D + var current_state: HeroState var pre_fighting_state: HeroState var hand_card_scene: PackedScene = preload("res://UI/card_hand.tscn") @@ -353,7 +356,7 @@ func equip_weapon(slot: int = 0) -> void: hud.set_secondary_button(cards[slot]) weapons[slot].set_hero(self) weapons[slot].visible = false - right_hand.add_child(weapons[slot]) + weapon_pivot.add_child(weapons[slot]) if slot == 0: weapons[slot].energy_changed.connect(hud.set_energy_pips) hud.energy_pips.max_energy = weapons[slot].max_energy diff --git a/PCs/hero.tscn b/PCs/hero.tscn index 1748a28..31c1e98 100644 --- a/PCs/hero.tscn +++ b/PCs/hero.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=68 format=3 uid="uid://dxgxbtf68lcv5"] +[gd_scene load_steps=74 format=3 uid="uid://dxgxbtf68lcv5"] [ext_resource type="Script" uid="uid://1fqpoegbdm6n" path="res://PCs/hero.gd" id="1_pihpe"] [ext_resource type="Resource" uid="uid://b5pc3frhx467q" path="res://Classes/Engineer/class.tres" id="2_dbyo0"] @@ -15,6 +15,7 @@ [ext_resource type="PackedScene" uid="uid://bj2q72ch8nkek" path="res://card_placing_tool.tscn" id="8_7d213"] [ext_resource type="Script" uid="uid://b6kjrl7ae1mi0" path="res://PCs/hud.gd" id="8_yl6ka"] [ext_resource type="Script" uid="uid://hy51bq7x0fy8" path="res://Scripts/on_top_camera.gd" id="11_4sdwe"] +[ext_resource type="PackedScene" uid="uid://rc0qcrcbmw7p" path="res://gauntlet.glb" id="11_h1yfy"] [ext_resource type="PackedScene" uid="uid://ckl5tw5rmewhp" path="res://left_hand/card_hand_model.glb" id="11_h82f6"] [ext_resource type="Script" uid="uid://ckkioruqgbs8p" path="res://Scripts/minimap_cam.gd" id="12_3hpi3"] [ext_resource type="Texture2D" uid="uid://c60fh34ttgcvh" path="res://Assets/Textures/minimap_player.png" id="15_nhlam"] @@ -60,6 +61,36 @@ radius = 0.3 height = 1.8 +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_o55s8"] +animation = &"read" + +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_h1yfy"] +animation = &"hold_gun" + +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_r2yb6"] +animation = &"point" + +[sub_resource type="AnimationNodeBlend3" id="AnimationNodeBlend3_o55s8"] + +[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_hueaw"] +graph_offset = Vector2(-465.524, 74.1432) +nodes/Animation/node = SubResource("AnimationNodeAnimation_r2yb6") +nodes/Animation/position = Vector2(-80, 120) +"nodes/Animation 2/node" = SubResource("AnimationNodeAnimation_o55s8") +"nodes/Animation 2/position" = Vector2(-180, 300) +"nodes/Animation 3/node" = SubResource("AnimationNodeAnimation_h1yfy") +"nodes/Animation 3/position" = Vector2(0, 400) +nodes/Blend3/node = SubResource("AnimationNodeBlend3_o55s8") +nodes/Blend3/position = Vector2(200, 140) +nodes/output/position = Vector2(460, 140) +node_connections = [&"Blend3", 0, &"Animation", &"Blend3", 1, &"Animation 2", &"Blend3", 2, &"Animation 3", &"output", 0, &"Blend3"] + +[sub_resource type="ViewportTexture" id="ViewportTexture_v8f6r"] +viewport_path = NodePath("FirstPersonViewport/Head2/LeftHand/SubViewport2") + +[sub_resource type="ViewportTexture" id="ViewportTexture_xme80"] +viewport_path = NodePath("FirstPersonViewport/Head2/LeftHand/SubViewport3") + [sub_resource type="Environment" id="Environment_cilxe"] background_mode = 1 background_color = Color(0.282353, 0.615686, 0.278431, 1) @@ -115,7 +146,7 @@ stream_0/stream = ExtResource("36_lsvj8") streams_count = 1 stream_0/stream = ExtResource("37_kv1mg") -[node name="Hero" type="CharacterBody3D" node_paths=PackedStringArray("camera", "gun_camera", "left_hand", "right_hand", "edit_tool", "carding_tool", "sprite", "interaction_raycast", "draw_pile", "hand", "discard_pile", "hud", "movement", "player_name_tag", "weapon_swap_timer", "editing_states", "fighting_state", "default_state", "ears", "place_card_audio", "swap_card_audio", "ready_audio", "unready_audio", "fullpower_audio", "zeropower_audio", "swap_off_audio", "swap_on_audio")] +[node name="Hero" type="CharacterBody3D" node_paths=PackedStringArray("camera", "gun_camera", "left_hand", "right_hand", "edit_tool", "carding_tool", "sprite", "interaction_raycast", "draw_pile", "hand", "discard_pile", "gauntlet_cards", "hud", "movement", "player_name_tag", "weapon_swap_timer", "editing_states", "fighting_state", "default_state", "ears", "place_card_audio", "swap_card_audio", "ready_audio", "unready_audio", "fullpower_audio", "zeropower_audio", "swap_off_audio", "swap_on_audio", "anim_tree", "weapon_pivot")] collision_layer = 2 collision_mask = 37 script = ExtResource("1_pihpe") @@ -151,6 +182,8 @@ fullpower_audio = NodePath("FullPowerAudio") zeropower_audio = NodePath("ZeroPowerAudio") swap_off_audio = NodePath("SwapOffAudio") swap_on_audio = NodePath("SwapOnAudio") +anim_tree = NodePath("FirstPersonViewport/Head2/RightHand/AnimationTree") +weapon_pivot = NodePath("FirstPersonViewport/Head2/RightHand/WeaponPivot") [node name="AudioListener3D" type="AudioListener3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.5, 0) @@ -199,7 +232,7 @@ script = ExtResource("11_4sdwe") clone_camera = NodePath("../../ViewMovement/Head") [node name="RightHand" type="Node3D" parent="FirstPersonViewport/Head2" node_paths=PackedStringArray("player")] -transform = Transform3D(0.7, 0, 0, 0, 0.7, 0, 0, 0, 0.7, 0.41, -0.17, -0.495) +transform = Transform3D(0.7, 0, 0, 0, 0.7, 0, 0, 0, 0.7, 0.17, -0.085, -0.195) script = ExtResource("7_14ugt") player = NodePath("../../..") enable_strafe_tilt = true @@ -207,6 +240,45 @@ tilt_amount_x = 12.0 tilt_amount_y = 3.0 weapon_rotation_amount = 0.001 +[node name="WeaponPivot" type="Node3D" parent="FirstPersonViewport/Head2/RightHand"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0414536, 0.0611196, -0.21211) + +[node name="gauntlet" parent="FirstPersonViewport/Head2/RightHand" instance=ExtResource("11_h1yfy")] +transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 0, 0, -0.136704) + +[node name="Skeleton3D" parent="FirstPersonViewport/Head2/RightHand/gauntlet/Armature_001" index="0"] +bones/0/position = Vector3(0.447738, -0.00470265, -0.00198592) +bones/0/rotation = Quaternion(0.00247606, 0.00245146, 0.70252, 0.711655) +bones/4/rotation = Quaternion(0.105534, 0.106025, 0.700766, 0.69753) +bones/5/rotation = Quaternion(0.288152, -0.000666995, -0.00221661, 0.957582) +bones/6/rotation = Quaternion(0.399595, -0.00287466, -0.00659437, 0.916663) +bones/7/rotation = Quaternion(0.199494, 0.196378, 0.673471, 0.68416) +bones/8/rotation = Quaternion(0.707098, 0.00349973, 0.00349977, 0.707098) +bones/9/rotation = Quaternion(0.465232, 0.00294272, 0.005599, 0.885166) +bones/12/rotation = Quaternion(0.204347, -0.197904, -0.666953, 0.688659) +bones/13/rotation = Quaternion(0.565223, -0.00627945, -0.00916402, 0.824864) +bones/14/rotation = Quaternion(0.251991, 0.00117743, 0.00452201, 0.967718) +bones/15/rotation = Quaternion(0.204079, -0.198503, -0.668395, 0.687166) +bones/16/rotation = Quaternion(0.707103, 0.00233569, 0.00233565, 0.707103) +bones/17/rotation = Quaternion(0.418178, 0.00746156, 0.0162048, 0.90819) +bones/18/rotation = Quaternion(0.614035, -0.337092, -0.360225, 0.616091) +bones/19/rotation = Quaternion(0.00975128, -0.00888968, 0.673639, 0.738943) + +[node name="Cube" parent="FirstPersonViewport/Head2/RightHand/gauntlet/Armature_001/Skeleton3D" index="0"] +layers = 2 + +[node name="door" parent="FirstPersonViewport/Head2/RightHand/gauntlet/Armature_001/Skeleton3D" index="1"] +layers = 2 + +[node name="door_001" parent="FirstPersonViewport/Head2/RightHand/gauntlet/Armature_001/Skeleton3D" index="2"] +layers = 2 + +[node name="AnimationTree" type="AnimationTree" parent="FirstPersonViewport/Head2/RightHand"] +root_node = NodePath("../gauntlet") +tree_root = SubResource("AnimationNodeBlendTree_hueaw") +anim_player = NodePath("../gauntlet/AnimationPlayer") +parameters/Blend3/blend_amount = 1.0 + [node name="LeftHand" type="Node3D" parent="FirstPersonViewport/Head2"] transform = Transform3D(0.235, 0, 0, 0, 0.235, 0, 0, 0, 0.235, -0.645, -0.26, -1.04) @@ -825,5 +897,6 @@ size = 2.243 [connection signal="timeout" from="WeaponSwapTimer" to="." method="_on_timer_timeout"] +[editable path="FirstPersonViewport/Head2/RightHand/gauntlet"] [editable path="FirstPersonViewport/Head2/LeftHand/card_hand_model"] [editable path="CoinViewport/Coin"] diff --git a/Weapons/Assault/rifle.tscn b/Weapons/Assault/rifle.tscn index 6747b6d..f5ac058 100644 --- a/Weapons/Assault/rifle.tscn +++ b/Weapons/Assault/rifle.tscn @@ -31,7 +31,7 @@ stream = SubResource("AudioStreamRandomizer_1hdrg") bus = &"SFX" [node name="Gun Thing" parent="." instance=ExtResource("3_2k4c7")] -transform = Transform3D(-0.175, 0, -2.64243e-08, 0, 0.175, 0, 2.64243e-08, 0, -0.175, 0, 0.156021, 0) +transform = Transform3D(-0.175, 0, -2.64243e-08, 0, 0.175, 0, 2.64243e-08, 0, -0.175, 0, 0.132477, -0.0524789) [node name="Cube" parent="Gun Thing" index="0"] layers = 2 diff --git a/Weapons/Assault/weapon_assault.tscn b/Weapons/Assault/weapon_assault.tscn deleted file mode 100644 index d0907b6..0000000 --- a/Weapons/Assault/weapon_assault.tscn +++ /dev/null @@ -1,25 +0,0 @@ -[gd_scene load_steps=7 format=3 uid="uid://2eehfcrsednw"] - -[ext_resource type="PackedScene" uid="uid://difwo7wlyqr3h" path="res://Scenes/Weapons/hitscan_weapon.tscn" id="1_wkxf7"] -[ext_resource type="Resource" uid="uid://smctw4ogm4rx" path="res://Weapons/Assault/weapon_stats.tres" id="2_fnp5x"] -[ext_resource type="Texture2D" uid="uid://celay30i4soud" path="res://Weapons/Assault/g_assault.png" id="3_kuj4t"] -[ext_resource type="AudioStream" uid="uid://dknygn5eyuhxt" path="res://Audio/shot1.wav" id="4_gdaci"] - -[sub_resource type="AtlasTexture" id="AtlasTexture_604rb"] -resource_local_to_scene = true -atlas = ExtResource("3_kuj4t") -region = Rect2(0, 0, 64, 64) - -[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_rhtcf"] -random_pitch = 1.1 -streams_count = 1 -stream_0/stream = ExtResource("4_gdaci") - -[node name="HitscanWeapon" instance=ExtResource("1_wkxf7")] -stats = ExtResource("2_fnp5x") - -[node name="Sprite3D" parent="." index="0"] -texture = SubResource("AtlasTexture_604rb") - -[node name="AudioStreamPlayer3D" parent="." index="5"] -stream = SubResource("AudioStreamRandomizer_rhtcf") diff --git a/cassette.glb b/cassette.glb new file mode 100644 index 0000000..a3f6a4e Binary files /dev/null and b/cassette.glb differ diff --git a/cassette.glb.import b/cassette.glb.import new file mode 100644 index 0000000..1a4b3ed --- /dev/null +++ b/cassette.glb.import @@ -0,0 +1,44 @@ +[remap] + +importer="scene" +importer_version=1 +type="PackedScene" +uid="uid://4g0vatb73duj" +path="res://.godot/imported/cassette.glb-1cbd398a8dbb0bf6eed1678045f0135f.scn" + +[deps] + +source_file="res://cassette.glb" +dest_files=["res://.godot/imported/cassette.glb-1cbd398a8dbb0bf6eed1678045f0135f.scn"] + +[params] + +nodes/root_type="" +nodes/root_name="" +nodes/apply_root_scale=true +nodes/root_scale=1.0 +nodes/import_as_skeleton_bones=false +nodes/use_node_type_suffixes=true +meshes/ensure_tangents=true +meshes/generate_lods=false +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 +animation/import_rest_as_RESET=false +import_script/path="" +_subresources={ +"materials": { +"Material": { +"use_external/enabled": true, +"use_external/path": "uid://d224ea5fdnmh2" +} +} +} +gltf/naming_version=1 +gltf/embedded_image_handling=1 diff --git a/cassette_cassette_tex.png b/cassette_cassette_tex.png new file mode 100644 index 0000000..7da6f77 Binary files /dev/null and b/cassette_cassette_tex.png differ diff --git a/cassette_cassette_tex.png.import b/cassette_cassette_tex.png.import new file mode 100644 index 0000000..f1ad253 --- /dev/null +++ b/cassette_cassette_tex.png.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://epo8me1kxpba" +path="res://.godot/imported/cassette_cassette_tex.png-da7d4a59937ccdc92dab6cdfdc532ae5.ctex" +metadata={ +"vram_texture": false +} +generator_parameters={ +"md5": "8ffcdbb0faa5691927b8256d695d090b" +} + +[deps] + +source_file="res://cassette_cassette_tex.png" +dest_files=["res://.godot/imported/cassette_cassette_tex.png-da7d4a59937ccdc92dab6cdfdc532ae5.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/cassette_mat.tres b/cassette_mat.tres new file mode 100644 index 0000000..5a6e782 --- /dev/null +++ b/cassette_mat.tres @@ -0,0 +1,10 @@ +[gd_resource type="ShaderMaterial" load_steps=3 format=3 uid="uid://d224ea5fdnmh2"] + +[ext_resource type="Shader" uid="uid://c5bffujq0l70k" path="res://Shaders/jitter.gdshader" id="1_j6syw"] +[ext_resource type="Texture2D" uid="uid://epo8me1kxpba" path="res://cassette_cassette_tex.png" id="2_wj756"] + +[resource] +render_priority = 0 +shader = ExtResource("1_j6syw") +shader_parameter/albedo = ExtResource("2_wj756") +shader_parameter/alpha_scissor = 0.5 diff --git a/gauntlet.glb b/gauntlet.glb new file mode 100644 index 0000000..2b1d159 Binary files /dev/null and b/gauntlet.glb differ diff --git a/gauntlet.glb.import b/gauntlet.glb.import new file mode 100644 index 0000000..de6ec31 --- /dev/null +++ b/gauntlet.glb.import @@ -0,0 +1,37 @@ +[remap] + +importer="scene" +importer_version=1 +type="PackedScene" +uid="uid://rc0qcrcbmw7p" +path="res://.godot/imported/gauntlet.glb-78b26d9fed4e516d8c367a4e620c81d2.scn" + +[deps] + +source_file="res://gauntlet.glb" +dest_files=["res://.godot/imported/gauntlet.glb-78b26d9fed4e516d8c367a4e620c81d2.scn"] + +[params] + +nodes/root_type="" +nodes/root_name="" +nodes/apply_root_scale=true +nodes/root_scale=1.0 +nodes/import_as_skeleton_bones=false +nodes/use_node_type_suffixes=true +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 +animation/import_rest_as_RESET=false +import_script/path="" +_subresources={} +gltf/naming_version=1 +gltf/embedded_image_handling=1 diff --git a/gauntlet_cassette_tex.png b/gauntlet_cassette_tex.png new file mode 100644 index 0000000..7da6f77 Binary files /dev/null and b/gauntlet_cassette_tex.png differ diff --git a/gauntlet_cassette_tex.png.import b/gauntlet_cassette_tex.png.import new file mode 100644 index 0000000..09c95af --- /dev/null +++ b/gauntlet_cassette_tex.png.import @@ -0,0 +1,38 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c7euohgr24npi" +path.s3tc="res://.godot/imported/gauntlet_cassette_tex.png-dc1a0549b9b71df517e06af04d78fd59.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} +generator_parameters={ +"md5": "8ffcdbb0faa5691927b8256d695d090b" +} + +[deps] + +source_file="res://gauntlet_cassette_tex.png" +dest_files=["res://.godot/imported/gauntlet_cassette_tex.png-dc1a0549b9b71df517e06af04d78fd59.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0