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"
|
PlayerGlobal="*res://scripts/player/player_global.gd"
|
||||||
Lobby="*res://scripts/multiplayer/lobby.gd"
|
Lobby="*res://scripts/multiplayer/lobby.gd"
|
||||||
|
Session="*res://scripts/multiplayer/session.gd"
|
||||||
|
|
||||||
[input]
|
[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://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"]
|
||||||
[ext_resource type="Script" uid="uid://bjhbdh6xsjgnn" path="res://scripts/player/player_camera.gd" id="3_qhqgy"]
|
[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="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://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://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/0/rotation = Quaternion(-0.006717509, 0.6971531, 0.71686494, -0.0060944925)
|
||||||
bones/1/position = Vector3(5.972106e-08, 0.06469955, 0.06380712)
|
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="."]
|
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||||
libraries = {
|
libraries = {
|
||||||
&"": SubResource("AnimationLibrary_qlg0r")
|
&"": SubResource("AnimationLibrary_qlg0r")
|
||||||
|
|
@ -247,11 +253,13 @@ script = ExtResource("4_qlg0r")
|
||||||
default_pistol = NodePath("StartingPistol")
|
default_pistol = NodePath("StartingPistol")
|
||||||
animation_player = NodePath("../Camera3D/molikman_hands/AnimationPlayer")
|
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")
|
script = ExtResource("6_tuyoq")
|
||||||
max_ammo = 10
|
max_ammo = 10
|
||||||
semi_auto = true
|
semi_auto = true
|
||||||
|
damage = 25
|
||||||
firerate = 0.1
|
firerate = 0.1
|
||||||
prefix = "baked_sp"
|
prefix = "baked_sp"
|
||||||
|
raycast = NodePath("../../Camera3D/RayCast3D")
|
||||||
|
|
||||||
[editable path="Camera3D/molikman_hands"]
|
[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
|
extends CharacterBody3D
|
||||||
|
|
||||||
|
class_name Player
|
||||||
|
|
||||||
const MAX_HP = 100
|
const MAX_HP = 100
|
||||||
|
|
||||||
@export var hp: int = 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 prefix: String
|
||||||
|
|
||||||
|
@export var raycast: RayCast3D
|
||||||
|
|
||||||
var ammo_amount: int
|
var ammo_amount: int
|
||||||
var fire_timer: Timer
|
var fire_timer: Timer
|
||||||
|
|
||||||
|
|
@ -44,6 +46,10 @@ func fire() -> void:
|
||||||
system.animation_player.play(prefix+"_shoot")
|
system.animation_player.play(prefix+"_shoot")
|
||||||
system.animation_player.queue(prefix+"_idle")
|
system.animation_player.queue(prefix+"_idle")
|
||||||
|
|
||||||
|
if raycast.is_colliding():
|
||||||
|
raycast.get_collider().hp -= damage
|
||||||
|
|
||||||
|
|
||||||
func alternate_state() -> void:
|
func alternate_state() -> void:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue