Prikoliki
This commit is contained in:
parent
74e37f8a18
commit
66fbad750c
22 changed files with 11192 additions and 42 deletions
|
|
@ -13,7 +13,5 @@ Current plans:
|
|||
Icon
|
||||
Behaviour
|
||||
Visuals
|
||||
Primary weapons:
|
||||
МЦ-255
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -30,18 +30,35 @@ layout_mode = 2
|
|||
[node name="WeaponsContainer" type="VBoxContainer" parent="CenterContainer/PanelContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="CenterContainer/PanelContainer/WeaponsContainer"]
|
||||
[node name="MoneyLabel" type="Label" parent="CenterContainer/PanelContainer/WeaponsContainer"]
|
||||
layout_mode = 2
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
script = ExtResource("2_ll0n6")
|
||||
|
||||
[node name="WeaponsContainer" type="GridContainer" parent="CenterContainer/PanelContainer/WeaponsContainer"]
|
||||
[node name="WeaponsContainer" type="HBoxContainer" parent="CenterContainer/PanelContainer/WeaponsContainer"]
|
||||
layout_mode = 2
|
||||
columns = 5
|
||||
|
||||
[node name="BuyButton" parent="CenterContainer/PanelContainer/WeaponsContainer/WeaponsContainer" instance=ExtResource("1_8guql")]
|
||||
[node name="ShotgunContainer" type="VBoxContainer" parent="CenterContainer/PanelContainer/WeaponsContainer/WeaponsContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Shotgun" type="Label" parent="CenterContainer/PanelContainer/WeaponsContainer/WeaponsContainer/ShotgunContainer"]
|
||||
layout_mode = 2
|
||||
text = "Дробовики"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="MC255Button" parent="CenterContainer/PanelContainer/WeaponsContainer/WeaponsContainer/ShotgunContainer" instance=ExtResource("1_8guql")]
|
||||
layout_mode = 2
|
||||
weapon = ExtResource("4_8uk5y")
|
||||
|
||||
[node name="AbilitiesLabel" type="Label" parent="CenterContainer/PanelContainer/WeaponsContainer"]
|
||||
layout_mode = 2
|
||||
text = "Способности"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="AbilitiesContainer" type="HBoxContainer" parent="CenterContainer/PanelContainer/WeaponsContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
|
|
|
|||
BIN
models/characters/molikman_hands_tex_Molikman.png
Normal file
BIN
models/characters/molikman_hands_tex_Molikman.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 461 KiB |
44
models/characters/molikman_hands_tex_Molikman.png.import
Normal file
44
models/characters/molikman_hands_tex_Molikman.png.import
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://ct8b5dcenubms"
|
||||
path.s3tc="res://.godot/imported/molikman_hands_tex_Molikman.png-ccd86400adbab09a67b0605e2bae3fe8.s3tc.ctex"
|
||||
metadata={
|
||||
"imported_formats": ["s3tc_bptc"],
|
||||
"vram_texture": true
|
||||
}
|
||||
generator_parameters={
|
||||
"md5": "adf17223cdac27afac207ae40df37427"
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://models/characters/molikman_hands_tex_Molikman.png"
|
||||
dest_files=["res://.godot/imported/molikman_hands_tex_Molikman.png-ccd86400adbab09a67b0605e2bae3fe8.s3tc.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=2
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=true
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=0
|
||||
BIN
models/characters/molikman_hands_tex_bomb.png
Normal file
BIN
models/characters/molikman_hands_tex_bomb.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 94 KiB |
44
models/characters/molikman_hands_tex_bomb.png.import
Normal file
44
models/characters/molikman_hands_tex_bomb.png.import
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://ba0xi4ts40yb3"
|
||||
path.s3tc="res://.godot/imported/molikman_hands_tex_bomb.png-6e48ea8587f348fc8c0188faec0617d2.s3tc.ctex"
|
||||
metadata={
|
||||
"imported_formats": ["s3tc_bptc"],
|
||||
"vram_texture": true
|
||||
}
|
||||
generator_parameters={
|
||||
"md5": "478cd944aa7bbc08b6e05bea8b51b71e"
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://models/characters/molikman_hands_tex_bomb.png"
|
||||
dest_files=["res://.godot/imported/molikman_hands_tex_bomb.png-6e48ea8587f348fc8c0188faec0617d2.s3tc.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=2
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=true
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=0
|
||||
BIN
models/characters/molikman_hands_tex_knife.png
Normal file
BIN
models/characters/molikman_hands_tex_knife.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.7 KiB |
44
models/characters/molikman_hands_tex_knife.png.import
Normal file
44
models/characters/molikman_hands_tex_knife.png.import
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cne3m4lsqaag5"
|
||||
path.s3tc="res://.godot/imported/molikman_hands_tex_knife.png-14e609ed7efd05ea01238d295ced16c5.s3tc.ctex"
|
||||
metadata={
|
||||
"imported_formats": ["s3tc_bptc"],
|
||||
"vram_texture": true
|
||||
}
|
||||
generator_parameters={
|
||||
"md5": "4e73f55f15c15350685cfd902157007e"
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://models/characters/molikman_hands_tex_knife.png"
|
||||
dest_files=["res://.godot/imported/molikman_hands_tex_knife.png-14e609ed7efd05ea01238d295ced16c5.s3tc.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=2
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=true
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=0
|
||||
BIN
models/characters/molikman_hands_tex_mc255.png
Normal file
BIN
models/characters/molikman_hands_tex_mc255.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 627 KiB |
44
models/characters/molikman_hands_tex_mc255.png.import
Normal file
44
models/characters/molikman_hands_tex_mc255.png.import
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cydet5mugcv2y"
|
||||
path.s3tc="res://.godot/imported/molikman_hands_tex_mc255.png-783083fd6f59893d1f5994f40b2f4e54.s3tc.ctex"
|
||||
metadata={
|
||||
"imported_formats": ["s3tc_bptc"],
|
||||
"vram_texture": true
|
||||
}
|
||||
generator_parameters={
|
||||
"md5": "4c4e74ad08b505b93eeacccff4d2ee72"
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://models/characters/molikman_hands_tex_mc255.png"
|
||||
dest_files=["res://.godot/imported/molikman_hands_tex_mc255.png-783083fd6f59893d1f5994f40b2f4e54.s3tc.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=2
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=true
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=0
|
||||
BIN
models/characters/molikman_hands_tex_sp_albedo.png
Normal file
BIN
models/characters/molikman_hands_tex_sp_albedo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 63 KiB |
44
models/characters/molikman_hands_tex_sp_albedo.png.import
Normal file
44
models/characters/molikman_hands_tex_sp_albedo.png.import
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bnfvn64lqad84"
|
||||
path.s3tc="res://.godot/imported/molikman_hands_tex_sp_albedo.png-f215d17851010b3798c57ae0584fbbca.s3tc.ctex"
|
||||
metadata={
|
||||
"imported_formats": ["s3tc_bptc"],
|
||||
"vram_texture": true
|
||||
}
|
||||
generator_parameters={
|
||||
"md5": "6643bd50a4e6b8c34195f1c0b3363b30"
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://models/characters/molikman_hands_tex_sp_albedo.png"
|
||||
dest_files=["res://.godot/imported/molikman_hands_tex_sp_albedo.png-f215d17851010b3798c57ae0584fbbca.s3tc.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=2
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=true
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=0
|
||||
BIN
models/characters/molikman_hands_tex_sp_roughness.png
Normal file
BIN
models/characters/molikman_hands_tex_sp_roughness.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
44
models/characters/molikman_hands_tex_sp_roughness.png.import
Normal file
44
models/characters/molikman_hands_tex_sp_roughness.png.import
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://c4enoo2ke23m8"
|
||||
path.s3tc="res://.godot/imported/molikman_hands_tex_sp_roughness.png-f8a5e100a388929d559f72b52c5e5e55.s3tc.ctex"
|
||||
metadata={
|
||||
"imported_formats": ["s3tc_bptc"],
|
||||
"vram_texture": true
|
||||
}
|
||||
generator_parameters={
|
||||
"md5": "8efa9a6c4e818d6467103a6b5a25a7bc"
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://models/characters/molikman_hands_tex_sp_roughness.png"
|
||||
dest_files=["res://.godot/imported/molikman_hands_tex_sp_roughness.png-f8a5e100a388929d559f72b52c5e5e55.s3tc.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=2
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=true
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=0
|
||||
BIN
models/characters/viewmodels/meshes/molikman_cloak.res
Normal file
BIN
models/characters/viewmodels/meshes/molikman_cloak.res
Normal file
Binary file not shown.
|
|
@ -8263,6 +8263,24 @@ _subresources={
|
|||
"slice_99/start_frame": 0,
|
||||
"slices/amount": 0
|
||||
}
|
||||
},
|
||||
"materials": {
|
||||
"mat_Molikman.001": {
|
||||
"use_external/enabled": true,
|
||||
"use_external/fallback_path": "res://materials/players/molikman/mat_Molikman.tres",
|
||||
"use_external/path": "uid://cjb0h3of85nc2"
|
||||
}
|
||||
},
|
||||
"meshes": {
|
||||
"molikman_hands_Plane_004": {
|
||||
"generate/lightmap_uv": 0,
|
||||
"generate/lods": 0,
|
||||
"generate/shadow_meshes": 0,
|
||||
"lods/normal_merge_angle": 20.0,
|
||||
"save_to_file/enabled": true,
|
||||
"save_to_file/fallback_path": "res://models/characters/viewmodels/meshes/molikman_cloak.res",
|
||||
"save_to_file/path": "uid://uv03iu0vvniq"
|
||||
}
|
||||
}
|
||||
}
|
||||
gltf/naming_version=2
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ enum ROUND_STATES {
|
|||
|
||||
const WIN_MONEY: int = 3400
|
||||
const LOSE_MONEY: int = 2000
|
||||
const START_MONEY: int = 800
|
||||
|
||||
const ATTACK_LAYER: int = 0b10000
|
||||
const DEFENCE_LAYER: int = 0b100000
|
||||
|
|
@ -55,6 +56,7 @@ var bomb_timer: Timer
|
|||
var round_timer: Timer
|
||||
var buy_timer: Timer
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
if multiplayer.is_server() == false:
|
||||
return
|
||||
|
|
@ -155,8 +157,9 @@ func start_session() -> void:
|
|||
all_players.append(multiplayer.get_unique_id())
|
||||
for player in all_players:
|
||||
player_data[player] = {
|
||||
"money" : 800,
|
||||
"nickname" : "Seliboba"
|
||||
"money" : START_MONEY,
|
||||
"nickname" : Lobby.client_nicknames[player],
|
||||
"saved_slots" : {}
|
||||
}
|
||||
|
||||
start_round()
|
||||
|
|
@ -178,6 +181,8 @@ func end_session() -> void:
|
|||
session_started_flag = false
|
||||
plants = []
|
||||
plant_deadzones = {}
|
||||
player_nodes.clear()
|
||||
player_data.clear()
|
||||
|
||||
dynamic_objects_parent = null
|
||||
|
||||
|
|
@ -200,6 +205,21 @@ func start_round() -> void:
|
|||
start_round.rpc()
|
||||
round_timer.stop()
|
||||
bomb_timer.stop()
|
||||
if not current_round == LobbySettings.half_rounds:
|
||||
for player_id in player_nodes.keys():
|
||||
var player: Player = player_nodes[player_id]
|
||||
if player.dead:
|
||||
player_data[player_id].saved_slots = {}
|
||||
continue
|
||||
var weapon_system: WeaponSystem = player.get_node("%WeaponSystem")
|
||||
var saved_slots: Dictionary[StringName,StringName] = {}
|
||||
for slot in weapon_system.slots:
|
||||
if slot == "bomb" or slot == "knife" or weapon_system.slots[slot] == null:
|
||||
continue
|
||||
saved_slots[slot] = weapon_system.slots[slot].weapon_gid
|
||||
player_data[player_id].saved_slots = saved_slots
|
||||
|
||||
|
||||
for container in object_containers:
|
||||
container.despawn()
|
||||
attackers_alive = 0
|
||||
|
|
@ -246,6 +266,9 @@ func end_round(win_team: int) -> void:
|
|||
var temp_rounds = attacker_score
|
||||
attacker_score = defender_score
|
||||
defender_score = temp_rounds
|
||||
for id in player_data:
|
||||
player_data[id].money = START_MONEY
|
||||
player_data[id].saved_slots = {}
|
||||
sync_score.rpc(attacker_score,defender_score)
|
||||
|
||||
round_state = ROUND_STATES.AFTER_ROUND
|
||||
|
|
@ -347,14 +370,14 @@ func shoot(id:int , limb_damage: int, torso_damage: int,head_damage: int, distan
|
|||
reduction = damage_reduction_curve.sample(distance_to_hit)
|
||||
|
||||
hit_player.take_damage(int(float(damage) * reduction))
|
||||
|
||||
var bullet_hole: Decal = BULLET_HOLE.instantiate()
|
||||
dynamic_objects_parent.add_child(bullet_hole,true)
|
||||
|
||||
var rotation_quat: Quaternion = Quaternion(Vector3.UP,collision["normal"])
|
||||
bullet_hole.quaternion *= rotation_quat
|
||||
bullet_hole.global_position = collision["position"]
|
||||
|
||||
else:
|
||||
var bullet_hole: Decal = BULLET_HOLE.instantiate()
|
||||
dynamic_objects_parent.add_child(bullet_hole,true)
|
||||
|
||||
var rotation_quat: Quaternion = Quaternion(Vector3.UP,collision["normal"])
|
||||
|
||||
bullet_hole.quaternion *= rotation_quat
|
||||
bullet_hole.global_position = collision["position"]
|
||||
|
||||
|
||||
func shoot_pellets(id:int,limb_pellet_damage: int, torso_pellet_damage: int,head_pellet_damage: int, distance: float, pellets: PackedVector2Array, damage_reduction_curve: Curve = null):
|
||||
|
|
@ -404,14 +427,14 @@ func shoot_pellets(id:int,limb_pellet_damage: int, torso_pellet_damage: int,head
|
|||
reduction = damage_reduction_curve.sample(distance_to_hit)
|
||||
|
||||
hit_player.take_damage(int(float(damage) * reduction))
|
||||
|
||||
var bullet_hole: Decal = BULLET_HOLE.instantiate()
|
||||
dynamic_objects_parent.add_child(bullet_hole,true)
|
||||
|
||||
var rotation_quat: Quaternion = Quaternion(Vector3.UP,collision["normal"])
|
||||
|
||||
bullet_hole.quaternion *= rotation_quat
|
||||
bullet_hole.global_position = collision["position"]
|
||||
else:
|
||||
var bullet_hole: Decal = BULLET_HOLE.instantiate()
|
||||
dynamic_objects_parent.add_child(bullet_hole,true)
|
||||
|
||||
var rotation_quat: Quaternion = Quaternion(Vector3.UP,collision["normal"])
|
||||
|
||||
bullet_hole.quaternion *= rotation_quat
|
||||
bullet_hole.global_position = collision["position"]
|
||||
|
||||
func interact(id: int) -> void:
|
||||
if multiplayer.is_server() == false:
|
||||
|
|
@ -474,7 +497,8 @@ func delete_player(id: int):
|
|||
delete_player.rpc_id(id)
|
||||
|
||||
player_data.erase(id)
|
||||
|
||||
|
||||
# For clients only
|
||||
func get_player_data() -> Dictionary:
|
||||
var id: int = multiplayer.get_unique_id()
|
||||
if player_data.has(id):
|
||||
|
|
|
|||
10842
players/molikman.tscn
10842
players/molikman.tscn
File diff suppressed because one or more lines are too long
|
|
@ -36,6 +36,10 @@ const MAX_HP = 100
|
|||
|
||||
var dead: bool
|
||||
|
||||
func _ready() -> void:
|
||||
for model in weapon_models.values():
|
||||
model.hide()
|
||||
|
||||
func _physics_process(_delta: float) -> void:
|
||||
if not multiplayer.is_server():
|
||||
return
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
extends Node
|
||||
|
||||
@export var player: Player
|
||||
|
||||
@export var starting_pistol: PackedScene
|
||||
@export var starting_knife: PackedScene
|
||||
@export var weapon_system: WeaponSystem
|
||||
|
|
@ -9,6 +11,12 @@ func _ready() -> void:
|
|||
|
||||
func deferred_ready() -> void:
|
||||
if is_multiplayer_authority():
|
||||
weapon_system.add(starting_pistol.instantiate(),"secondary")
|
||||
var saved_slots = Session.player_data[player.player_id].saved_slots
|
||||
if saved_slots != {}:
|
||||
for slot in saved_slots:
|
||||
var weapon = Registry.weapons[saved_slots[slot]]
|
||||
weapon_system.add(weapon.weapon_system_scene.instantiate(),weapon.slot)
|
||||
else:
|
||||
weapon_system.add(starting_pistol.instantiate(),"secondary")
|
||||
weapon_system.add(starting_knife.instantiate(),"knife")
|
||||
queue_free()
|
||||
|
|
|
|||
|
|
@ -53,6 +53,8 @@ func can_add(slot: StringName) -> bool:
|
|||
func add(state: WeaponSubStateMachine, slot: StringName) -> void:
|
||||
if not multiplayer.is_server():
|
||||
return
|
||||
if slot == "ability":
|
||||
slot = get_empty_ability_slot()
|
||||
if can_add(slot) == false:
|
||||
return
|
||||
|
||||
|
|
|
|||
|
|
@ -5,12 +5,13 @@
|
|||
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_wpexx"]
|
||||
properties/0/path = NodePath(".:position")
|
||||
properties/0/spawn = true
|
||||
properties/0/replication_mode = 1
|
||||
properties/0/replication_mode = 0
|
||||
properties/1/path = NodePath(".:rotation")
|
||||
properties/1/spawn = true
|
||||
properties/1/replication_mode = 1
|
||||
properties/1/replication_mode = 0
|
||||
|
||||
[node name="BulletHole" type="Decal"]
|
||||
layers = 4
|
||||
size = Vector3(0.25, 0.5, 0.25)
|
||||
texture_albedo = ExtResource("1_wpexx")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue