Unsafe shootage
This commit is contained in:
parent
cc26793ab6
commit
a046ae5288
8 changed files with 27 additions and 2 deletions
|
|
@ -19,6 +19,7 @@ config/icon="res://icon.svg"
|
|||
|
||||
PlayerGlobal="*res://scripts/player/player_global.gd"
|
||||
Lobby="*res://scripts/multiplayer/lobby.gd"
|
||||
Session="*res://scripts/multiplayer/session.gd"
|
||||
|
||||
[input]
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
[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"]
|
||||
[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"]
|
||||
|
||||
|
|
@ -199,6 +200,11 @@ bones/0/position = Vector3(-0.22279283, 0.7100338, -0.19202478)
|
|||
bones/0/rotation = Quaternion(-0.006717509, 0.6971531, 0.71686494, -0.0060944925)
|
||||
bones/1/position = Vector3(5.972106e-08, 0.06469955, 0.06380712)
|
||||
|
||||
[node name="RayCast3D" type="RayCast3D" parent="Camera3D"]
|
||||
target_position = Vector3(0, 0, -1000)
|
||||
collision_mask = 2
|
||||
script = ExtResource("4_fjrip")
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
libraries = {
|
||||
&"": SubResource("AnimationLibrary_qlg0r")
|
||||
|
|
@ -247,11 +253,13 @@ script = ExtResource("4_qlg0r")
|
|||
default_pistol = NodePath("StartingPistol")
|
||||
animation_player = NodePath("../Camera3D/molikman_hands/AnimationPlayer")
|
||||
|
||||
[node name="StartingPistol" type="Node" parent="WeaponSystem"]
|
||||
[node name="StartingPistol" type="Node" parent="WeaponSystem" node_paths=PackedStringArray("raycast")]
|
||||
script = ExtResource("6_tuyoq")
|
||||
max_ammo = 10
|
||||
semi_auto = true
|
||||
damage = 25
|
||||
firerate = 0.1
|
||||
prefix = "baked_sp"
|
||||
raycast = NodePath("../../Camera3D/RayCast3D")
|
||||
|
||||
[editable path="Camera3D/molikman_hands"]
|
||||
|
|
|
|||
1
scripts/multiplayer/session.gd
Normal file
1
scripts/multiplayer/session.gd
Normal file
|
|
@ -0,0 +1 @@
|
|||
extends Node
|
||||
1
scripts/multiplayer/session.gd.uid
Normal file
1
scripts/multiplayer/session.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://djmsesf818ovp
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
extends CharacterBody3D
|
||||
|
||||
class_name Player
|
||||
|
||||
const MAX_HP = 100
|
||||
|
||||
@export var hp: int = 100:
|
||||
|
|
|
|||
5
scripts/player/player_raycast.gd
Normal file
5
scripts/player/player_raycast.gd
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
extends RayCast3D
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
add_exception($"../..")
|
||||
1
scripts/player/player_raycast.gd.uid
Normal file
1
scripts/player/player_raycast.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://6c14qse4vnra
|
||||
|
|
@ -9,6 +9,8 @@ extends Usable
|
|||
|
||||
@export var prefix: String
|
||||
|
||||
@export var raycast: RayCast3D
|
||||
|
||||
var ammo_amount: int
|
||||
var fire_timer: Timer
|
||||
|
||||
|
|
@ -43,6 +45,10 @@ func fire() -> void:
|
|||
system.animation_player.stop()
|
||||
system.animation_player.play(prefix+"_shoot")
|
||||
system.animation_player.queue(prefix+"_idle")
|
||||
|
||||
if raycast.is_colliding():
|
||||
raycast.get_collider().hp -= damage
|
||||
|
||||
|
||||
func alternate_state() -> void:
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue