Teams
This commit is contained in:
parent
af094878b9
commit
6d34205ba2
7 changed files with 31 additions and 2 deletions
|
|
@ -1,3 +1,5 @@
|
||||||
|
^ - completed
|
||||||
|
|
||||||
Current plans:
|
Current plans:
|
||||||
^ Add world model
|
^ Add world model
|
||||||
^ Separate Viewmodel
|
^ Separate Viewmodel
|
||||||
|
|
|
||||||
|
|
@ -148,3 +148,5 @@ plr_bomb={
|
||||||
3d_physics/layer_2="Players"
|
3d_physics/layer_2="Players"
|
||||||
3d_physics/layer_3="Gadgets"
|
3d_physics/layer_3="Gadgets"
|
||||||
3d_physics/layer_4="Projectiles"
|
3d_physics/layer_4="Projectiles"
|
||||||
|
3d_physics/layer_5="Players Attack Team"
|
||||||
|
3d_physics/layer_6="Players Defence Team"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
[gd_scene load_steps=22 format=3 uid="uid://dpsr6ug3pkb40"]
|
[gd_scene load_steps=23 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"]
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
[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="Script" uid="uid://dd5mp72dq43v6" path="res://scripts/multiplayer/own_visibility_toggle.gd" id="4_smehm"]
|
[ext_resource type="Script" uid="uid://dd5mp72dq43v6" path="res://scripts/multiplayer/own_visibility_toggle.gd" id="4_smehm"]
|
||||||
|
[ext_resource type="Script" uid="uid://5gwpjiswnegn" path="res://scripts/player/collision_team_updater.gd" id="7_a8ls1"]
|
||||||
[ext_resource type="PackedScene" uid="uid://djwjl8xll53vn" path="res://scenes/weapons/starting_pistol.tscn" id="7_fjrip"]
|
[ext_resource type="PackedScene" uid="uid://djwjl8xll53vn" path="res://scenes/weapons/starting_pistol.tscn" id="7_fjrip"]
|
||||||
[ext_resource type="Script" uid="uid://7gmgcaxfh8sb" path="res://scripts/debug/property_shower.gd" id="7_oprun"]
|
[ext_resource type="Script" uid="uid://7gmgcaxfh8sb" path="res://scripts/debug/property_shower.gd" id="7_oprun"]
|
||||||
[ext_resource type="Script" uid="uid://3777rkbebgjm" path="res://scripts/state_machine/machine.gd" id="8_f1ej7"]
|
[ext_resource type="Script" uid="uid://3777rkbebgjm" path="res://scripts/state_machine/machine.gd" id="8_f1ej7"]
|
||||||
|
|
@ -122,6 +123,7 @@ _data = {
|
||||||
|
|
||||||
[node name="Player" type="CharacterBody3D"]
|
[node name="Player" type="CharacterBody3D"]
|
||||||
collision_layer = 2
|
collision_layer = 2
|
||||||
|
collision_mask = 3
|
||||||
script = ExtResource("1_g2els")
|
script = ExtResource("1_g2els")
|
||||||
|
|
||||||
[node name="molikman_ingame" parent="." instance=ExtResource("8_smehm")]
|
[node name="molikman_ingame" parent="." instance=ExtResource("8_smehm")]
|
||||||
|
|
@ -213,9 +215,13 @@ script = ExtResource("4_smehm")
|
||||||
|
|
||||||
[node name="RayCast3D" type="RayCast3D" parent="Camera3D"]
|
[node name="RayCast3D" type="RayCast3D" parent="Camera3D"]
|
||||||
target_position = Vector3(0, 0, -1000)
|
target_position = Vector3(0, 0, -1000)
|
||||||
collision_mask = 2
|
collision_mask = 0
|
||||||
script = ExtResource("4_fjrip")
|
script = ExtResource("4_fjrip")
|
||||||
|
|
||||||
|
[node name="TeamUpdater" type="Node" parent="Camera3D/RayCast3D" node_paths=PackedStringArray("player")]
|
||||||
|
script = ExtResource("7_a8ls1")
|
||||||
|
player = NodePath("../../..")
|
||||||
|
|
||||||
[node name="StandArea" type="Area3D" parent="."]
|
[node name="StandArea" type="Area3D" parent="."]
|
||||||
collision_layer = 0
|
collision_layer = 0
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1 +1,7 @@
|
||||||
extends Node
|
extends Node
|
||||||
|
|
||||||
|
enum TEAMS {
|
||||||
|
DEFENCE,
|
||||||
|
ATTACK,
|
||||||
|
SPECTATE
|
||||||
|
}
|
||||||
|
|
|
||||||
10
scripts/player/collision_team_updater.gd
Normal file
10
scripts/player/collision_team_updater.gd
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
extends Node
|
||||||
|
|
||||||
|
@export var player: Player
|
||||||
|
|
||||||
|
const ATTACK_LAYER: int = 0b10000
|
||||||
|
const DEFENCE_LAYER: int = 0b100000
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
|
||||||
|
get_parent().collision_mask |= (ATTACK_LAYER if player.team == Session.TEAMS.DEFENCE else DEFENCE_LAYER)
|
||||||
1
scripts/player/collision_team_updater.gd.uid
Normal file
1
scripts/player/collision_team_updater.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://5gwpjiswnegn
|
||||||
|
|
@ -2,6 +2,8 @@ extends CharacterBody3D
|
||||||
|
|
||||||
class_name Player
|
class_name Player
|
||||||
|
|
||||||
|
@export var team: Session.TEAMS
|
||||||
|
|
||||||
const MAX_HP = 100
|
const MAX_HP = 100
|
||||||
|
|
||||||
@export var hp: int = 100:
|
@export var hp: int = 100:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue