Some fixes

This commit is contained in:
Rendo 2025-11-26 16:37:03 +05:00
commit 97d6a783aa
8 changed files with 22 additions and 8 deletions

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=14 format=3 uid="uid://dpsr6ug3pkb40"]
[gd_scene load_steps=15 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"]
@ -6,6 +6,7 @@
[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/weapon_system.gd" id="4_qlg0r"]
[ext_resource type="PackedScene" uid="uid://djwjl8xll53vn" path="res://scenes/weapons/starting_pistol.tscn" id="7_fjrip"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_u8vuu"]
@ -249,7 +250,13 @@ replication_config = SubResource("SceneReplicationConfig_qhqgy")
[node name="WeaponSystem" type="Node" parent="." node_paths=PackedStringArray("default_pistol", "animation_player")]
script = ExtResource("4_qlg0r")
default_pistol = NodePath("")
default_pistol = NodePath("StartingPistol")
animation_player = NodePath("../Camera3D/molikman_hands/AnimationPlayer")
[node name="StartingPistol" parent="WeaponSystem" instance=ExtResource("7_fjrip")]
[node name="Shoot" parent="WeaponSystem/StartingPistol" index="1" node_paths=PackedStringArray("raycast")]
raycast = NodePath("../../../Camera3D/RayCast3D")
[editable path="Camera3D/molikman_hands"]
[editable path="WeaponSystem/StartingPistol"]

View file

@ -15,14 +15,20 @@ metadata/_custom_type_script = "uid://e6lqknfl4ngt"
[node name="Idle" type="Node" parent="."]
script = ExtResource("2_cmn6f")
emptyable = true
[node name="Shoot" type="Node" parent="."]
[node name="Shoot" type="Node" parent="." node_paths=PackedStringArray("fire_timer")]
script = ExtResource("3_016ti")
emptyable = true
damage = 22
fire_timer = NodePath("../FireTimer")
[node name="Reload" type="Node" parent="."]
script = ExtResource("4_hoqxt")
emptyable = true
[node name="Intro" type="Node" parent="."]
script = ExtResource("5_ud1dr")
emptyable = true
[node name="FireTimer" type="Timer" parent="."]

View file

@ -3,6 +3,8 @@ extends Node
class_name State
@warning_ignore_start("unused_signal","unused_parameter")
signal transition(to: StringName)
@abstract func enter() -> void

View file

@ -23,4 +23,4 @@ func init_reload():
transition.emit("Reload")
func with_morphems(animation):
return machine.animation_prefix + (animation+"_empty") if emptyable and machine.ammo == 0 else animation
return machine.animation_prefix + ((animation+"_empty") if emptyable and machine.ammo == 0 else animation)

View file

@ -14,4 +14,4 @@ func on_animation_finished(animation):
transition.emit("Idle")
func with_morphems(animation):
return machine.animation_prefix + (animation+"_empty") if emptyable and machine.ammo == 0 else animation
return machine.animation_prefix + ((animation+"_empty") if emptyable and machine.ammo == 0 else animation)

View file

@ -15,4 +15,4 @@ func on_animation_finished(animation):
transition.emit("Idle")
func with_morphems(animation):
return machine.animation_prefix + (animation+"_empty") if emptyable and machine.ammo == 0 else animation
return machine.animation_prefix + ((animation+"_empty") if emptyable and machine.ammo == 0 else animation)

View file

@ -36,4 +36,4 @@ func fire() -> void:
fire_timer.start()
func with_morphems(animation):
return machine.animation_prefix + (animation+"_empty") if emptyable and machine.ammo == 0 else animation
return machine.animation_prefix + ((animation+"_empty") if emptyable and machine.ammo == 0 else animation)

View file

@ -34,7 +34,6 @@ func _ready() -> void:
slots["knife"] = default_knife
slots["secondary"] = default_pistol
current_state.enter()
current_state.in_use = true
func can_add(slot: StringName) -> bool:
return slots.has(slot)