weapon system rework

This commit is contained in:
Rendo 2025-11-26 16:32:09 +05:00
commit 30b01100f0
27 changed files with 352 additions and 190 deletions

View file

@ -1,12 +1,11 @@
[gd_scene load_steps=15 format=3 uid="uid://dpsr6ug3pkb40"]
[gd_scene load_steps=14 format=3 uid="uid://dpsr6ug3pkb40"]
[ext_resource type="Script" uid="uid://3dphlay25fih" path="res://scripts/player/player.gd" id="1_g2els"]
[ext_resource type="Script" uid="uid://dalwlndejfdhm" path="res://scripts/player/crosshair.gd" id="3_dqkch"]
[ext_resource type="Script" uid="uid://bjhbdh6xsjgnn" path="res://scripts/player/player_camera.gd" id="3_qhqgy"]
[ext_resource type="PackedScene" uid="uid://c3hg4ux4j76j2" path="res://models/molikman_hands.glb" id="4_dqkch"]
[ext_resource type="Script" uid="uid://6c14qse4vnra" path="res://scripts/player/player_raycast.gd" id="4_fjrip"]
[ext_resource type="Script" uid="uid://bmecgup3kcua7" path="res://scripts/weapon_system/system.gd" id="4_qlg0r"]
[ext_resource type="Script" uid="uid://c76n6qgu6o4hn" path="res://scripts/weapon_system/gun.gd" id="6_tuyoq"]
[ext_resource type="Script" uid="uid://bmecgup3kcua7" path="res://scripts/weapon_system/weapon_system.gd" id="4_qlg0r"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_u8vuu"]
@ -248,30 +247,9 @@ crosses_offset = 3.0
[node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="."]
replication_config = SubResource("SceneReplicationConfig_qhqgy")
[node name="WeaponSystem" type="Node" parent="." node_paths=PackedStringArray("default_pistol", "default_knife", "animation_player")]
[node name="WeaponSystem" type="Node" parent="." node_paths=PackedStringArray("default_pistol", "animation_player")]
script = ExtResource("4_qlg0r")
default_pistol = NodePath("StartingPistol")
default_knife = NodePath("StartingPistol2")
default_pistol = NodePath("")
animation_player = NodePath("../Camera3D/molikman_hands/AnimationPlayer")
[node name="StartingPistol" type="Node" parent="WeaponSystem" node_paths=PackedStringArray("raycast")]
script = ExtResource("6_tuyoq")
max_ammo = 10
semi_auto = true
emptyable = true
damage = 25
firerate = 0.1
prefix = "baked_sp"
raycast = NodePath("../../Camera3D/RayCast3D")
[node name="StartingPistol2" type="Node" parent="WeaponSystem" node_paths=PackedStringArray("raycast")]
script = ExtResource("6_tuyoq")
max_ammo = 10
semi_auto = true
emptyable = true
damage = 25
firerate = 0.1
prefix = "baked_sp"
raycast = NodePath("../../Camera3D/RayCast3D")
[editable path="Camera3D/molikman_hands"]

View file

@ -0,0 +1,28 @@
[gd_scene load_steps=6 format=3 uid="uid://djwjl8xll53vn"]
[ext_resource type="Script" uid="uid://e6lqknfl4ngt" path="res://scripts/weapon_system/weapon_substate_machine.gd" id="1_g7s1i"]
[ext_resource type="Script" uid="uid://ofv4e3dsfe8" path="res://scripts/weapon_system/gun/idle_state.gd" id="2_cmn6f"]
[ext_resource type="Script" uid="uid://vj13r83l3xyq" path="res://scripts/weapon_system/gun/semi_auto_shoot_state.gd" id="3_016ti"]
[ext_resource type="Script" uid="uid://hmekwp8444ao" path="res://scripts/weapon_system/gun/reload_state.gd" id="4_hoqxt"]
[ext_resource type="Script" uid="uid://bmj0bwy2tlian" path="res://scripts/weapon_system/gun/intro_state.gd" id="5_ud1dr"]
[node name="StartingPistol" type="Node" node_paths=PackedStringArray("enter_state")]
script = ExtResource("1_g7s1i")
animation_prefix = &"baked_sp_"
max_ammo = 20
enter_state = NodePath("Intro")
metadata/_custom_type_script = "uid://e6lqknfl4ngt"
[node name="Idle" type="Node" parent="."]
script = ExtResource("2_cmn6f")
[node name="Shoot" type="Node" parent="."]
script = ExtResource("3_016ti")
[node name="Reload" type="Node" parent="."]
script = ExtResource("4_hoqxt")
[node name="Intro" type="Node" parent="."]
script = ExtResource("5_ud1dr")
[node name="FireTimer" type="Timer" parent="."]