Some fixes
This commit is contained in:
parent
30b01100f0
commit
97d6a783aa
8 changed files with 22 additions and 8 deletions
|
|
@ -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://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://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="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://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="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"]
|
[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")]
|
[node name="WeaponSystem" type="Node" parent="." node_paths=PackedStringArray("default_pistol", "animation_player")]
|
||||||
script = ExtResource("4_qlg0r")
|
script = ExtResource("4_qlg0r")
|
||||||
default_pistol = NodePath("")
|
default_pistol = NodePath("StartingPistol")
|
||||||
animation_player = NodePath("../Camera3D/molikman_hands/AnimationPlayer")
|
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="Camera3D/molikman_hands"]
|
||||||
|
[editable path="WeaponSystem/StartingPistol"]
|
||||||
|
|
|
||||||
|
|
@ -15,14 +15,20 @@ metadata/_custom_type_script = "uid://e6lqknfl4ngt"
|
||||||
|
|
||||||
[node name="Idle" type="Node" parent="."]
|
[node name="Idle" type="Node" parent="."]
|
||||||
script = ExtResource("2_cmn6f")
|
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")
|
script = ExtResource("3_016ti")
|
||||||
|
emptyable = true
|
||||||
|
damage = 22
|
||||||
|
fire_timer = NodePath("../FireTimer")
|
||||||
|
|
||||||
[node name="Reload" type="Node" parent="."]
|
[node name="Reload" type="Node" parent="."]
|
||||||
script = ExtResource("4_hoqxt")
|
script = ExtResource("4_hoqxt")
|
||||||
|
emptyable = true
|
||||||
|
|
||||||
[node name="Intro" type="Node" parent="."]
|
[node name="Intro" type="Node" parent="."]
|
||||||
script = ExtResource("5_ud1dr")
|
script = ExtResource("5_ud1dr")
|
||||||
|
emptyable = true
|
||||||
|
|
||||||
[node name="FireTimer" type="Timer" parent="."]
|
[node name="FireTimer" type="Timer" parent="."]
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@ extends Node
|
||||||
|
|
||||||
class_name State
|
class_name State
|
||||||
|
|
||||||
|
@warning_ignore_start("unused_signal","unused_parameter")
|
||||||
|
|
||||||
signal transition(to: StringName)
|
signal transition(to: StringName)
|
||||||
|
|
||||||
@abstract func enter() -> void
|
@abstract func enter() -> void
|
||||||
|
|
|
||||||
|
|
@ -23,4 +23,4 @@ func init_reload():
|
||||||
transition.emit("Reload")
|
transition.emit("Reload")
|
||||||
|
|
||||||
func with_morphems(animation):
|
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)
|
||||||
|
|
|
||||||
|
|
@ -14,4 +14,4 @@ func on_animation_finished(animation):
|
||||||
transition.emit("Idle")
|
transition.emit("Idle")
|
||||||
|
|
||||||
func with_morphems(animation):
|
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)
|
||||||
|
|
|
||||||
|
|
@ -15,4 +15,4 @@ func on_animation_finished(animation):
|
||||||
transition.emit("Idle")
|
transition.emit("Idle")
|
||||||
|
|
||||||
func with_morphems(animation):
|
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)
|
||||||
|
|
|
||||||
|
|
@ -36,4 +36,4 @@ func fire() -> void:
|
||||||
fire_timer.start()
|
fire_timer.start()
|
||||||
|
|
||||||
func with_morphems(animation):
|
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)
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,6 @@ func _ready() -> void:
|
||||||
slots["knife"] = default_knife
|
slots["knife"] = default_knife
|
||||||
slots["secondary"] = default_pistol
|
slots["secondary"] = default_pistol
|
||||||
current_state.enter()
|
current_state.enter()
|
||||||
current_state.in_use = true
|
|
||||||
|
|
||||||
func can_add(slot: StringName) -> bool:
|
func can_add(slot: StringName) -> bool:
|
||||||
return slots.has(slot)
|
return slots.has(slot)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue