Compare commits
3 commits
rewind-sys
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| af66792e47 | |||
| 88bbe56467 | |||
| 49589d84d6 |
28 changed files with 100 additions and 69 deletions
|
|
@ -41,3 +41,6 @@ version_update_desc,"На сервере обнаружена новая (или
|
||||||
Install it?",
|
Install it?",
|
||||||
video,Видео,Video,
|
video,Видео,Video,
|
||||||
win_rounds,Раундов до победы,Rounds to win,
|
win_rounds,Раундов до победы,Rounds to win,
|
||||||
|
toggle_walk,Переключение ходьбы,Toggle walking,
|
||||||
|
toggle_crouch,Переключение приседания,Toggle crouching,
|
||||||
|
toggle_scope,Переключение прицеливания,Toggle scoping,
|
||||||
|
|
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -1,7 +1,7 @@
|
||||||
key,ru,en,ikg
|
key,ru,en,ikg
|
||||||
au_loading,Подгружаем данные с сервера…,Loading data from server…,
|
au_loading,Подгружаем данные с сервера…,Loading data from server…,
|
||||||
au_err_load,Ошибка загрузки данных: ,Error while loading data: ,
|
au_err_load,[color=red]Ошибка загрузки данных: {error}[/color] ,[color=red]Error while loading data: {error}[/color],
|
||||||
au_err_install,Ошибка загрузки новой версии: ,Error while downloading new version: ,
|
au_err_install,[color=red]Ошибка загрузки новой версии: {error}[/color],[color=red]Error while downloading new version: {error}[/color],
|
||||||
au_new_version,Доступна новая версия!,New version available!,
|
au_new_version,Доступна новая версия!,New version available!,
|
||||||
au_current_version,У вас самая актуальная версия игры!,Your version is the current version!,
|
au_current_version,[color=green]У вас самая актуальная версия игры! [/color],[color=green]Your version is the current version! [/color],
|
||||||
vr_version,Текущая версия игры: ,Game version: ,
|
vr_version,Текущая версия игры: ,Game version: ,
|
||||||
|
|
|
||||||
|
Binary file not shown.
Binary file not shown.
|
|
@ -21,7 +21,7 @@ layout_mode = 2
|
||||||
custom_minimum_size = Vector2(512, 256)
|
custom_minimum_size = Vector2(512, 256)
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
tab_alignment = 1
|
tab_alignment = 1
|
||||||
current_tab = 3
|
current_tab = 2
|
||||||
|
|
||||||
[node name="gameplay" type="VBoxContainer" parent="CenterContainer/VBoxContainer/PanelContainer"]
|
[node name="gameplay" type="VBoxContainer" parent="CenterContainer/VBoxContainer/PanelContainer"]
|
||||||
visible = false
|
visible = false
|
||||||
|
|
@ -38,7 +38,6 @@ layout_mode = 2
|
||||||
text = "fullscreen"
|
text = "fullscreen"
|
||||||
|
|
||||||
[node name="controls" type="VBoxContainer" parent="CenterContainer/VBoxContainer/PanelContainer"]
|
[node name="controls" type="VBoxContainer" parent="CenterContainer/VBoxContainer/PanelContainer"]
|
||||||
visible = false
|
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
metadata/_tab_index = 2
|
metadata/_tab_index = 2
|
||||||
|
|
||||||
|
|
@ -54,6 +53,7 @@ unique_name_in_owner = true
|
||||||
custom_minimum_size = Vector2(256, 0)
|
custom_minimum_size = Vector2(256, 0)
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
|
size_flags_vertical = 1
|
||||||
min_value = 0.001
|
min_value = 0.001
|
||||||
max_value = 0.02
|
max_value = 0.02
|
||||||
step = 0.001
|
step = 0.001
|
||||||
|
|
@ -68,7 +68,23 @@ value = 0.02
|
||||||
allow_greater = true
|
allow_greater = true
|
||||||
allow_lesser = true
|
allow_lesser = true
|
||||||
|
|
||||||
|
[node name="ToggleCrouch" type="CheckButton" parent="CenterContainer/VBoxContainer/PanelContainer/controls"]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
layout_mode = 2
|
||||||
|
text = "toggle_crouch"
|
||||||
|
|
||||||
|
[node name="ToggleScope" type="CheckButton" parent="CenterContainer/VBoxContainer/PanelContainer/controls"]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
layout_mode = 2
|
||||||
|
text = "toggle_scope"
|
||||||
|
|
||||||
|
[node name="ToggleWalk" type="CheckButton" parent="CenterContainer/VBoxContainer/PanelContainer/controls"]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
layout_mode = 2
|
||||||
|
text = "toggle_walk"
|
||||||
|
|
||||||
[node name="audio" type="VBoxContainer" parent="CenterContainer/VBoxContainer/PanelContainer"]
|
[node name="audio" type="VBoxContainer" parent="CenterContainer/VBoxContainer/PanelContainer"]
|
||||||
|
visible = false
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
metadata/_tab_index = 3
|
metadata/_tab_index = 3
|
||||||
|
|
||||||
|
|
@ -83,6 +99,7 @@ text = "audio_gameplay"
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
|
size_flags_vertical = 1
|
||||||
max_value = 1.0
|
max_value = 1.0
|
||||||
step = 0.01
|
step = 0.01
|
||||||
value = 1.0
|
value = 1.0
|
||||||
|
|
@ -102,6 +119,9 @@ text = "Покинуть сессию"
|
||||||
[connection signal="toggled" from="CenterContainer/VBoxContainer/PanelContainer/video/FullscreenButton" to="CenterContainer" method="_on_fullscreen_button_toggled"]
|
[connection signal="toggled" from="CenterContainer/VBoxContainer/PanelContainer/video/FullscreenButton" to="CenterContainer" method="_on_fullscreen_button_toggled"]
|
||||||
[connection signal="value_changed" from="CenterContainer/VBoxContainer/PanelContainer/controls/Sensitivity/SensitivitySlider" to="CenterContainer" method="_on_sensitivity_slider_value_changed"]
|
[connection signal="value_changed" from="CenterContainer/VBoxContainer/PanelContainer/controls/Sensitivity/SensitivitySlider" to="CenterContainer" method="_on_sensitivity_slider_value_changed"]
|
||||||
[connection signal="value_changed" from="CenterContainer/VBoxContainer/PanelContainer/controls/Sensitivity/SensitivityBox" to="CenterContainer" method="_on_sensitivity_box_value_changed"]
|
[connection signal="value_changed" from="CenterContainer/VBoxContainer/PanelContainer/controls/Sensitivity/SensitivityBox" to="CenterContainer" method="_on_sensitivity_box_value_changed"]
|
||||||
|
[connection signal="toggled" from="CenterContainer/VBoxContainer/PanelContainer/controls/ToggleCrouch" to="CenterContainer" method="_on_toggle_crouch_toggled"]
|
||||||
|
[connection signal="toggled" from="CenterContainer/VBoxContainer/PanelContainer/controls/ToggleScope" to="CenterContainer" method="_on_toggle_scope_toggled"]
|
||||||
|
[connection signal="toggled" from="CenterContainer/VBoxContainer/PanelContainer/controls/ToggleWalk" to="CenterContainer" method="_on_toggle_walk_toggled"]
|
||||||
[connection signal="value_changed" from="CenterContainer/VBoxContainer/PanelContainer/audio/GameplayMainAudio/GameplayMainSlider" to="CenterContainer" method="_on_gameplay_main_slider_value_changed"]
|
[connection signal="value_changed" from="CenterContainer/VBoxContainer/PanelContainer/audio/GameplayMainAudio/GameplayMainSlider" to="CenterContainer" method="_on_gameplay_main_slider_value_changed"]
|
||||||
[connection signal="pressed" from="CenterContainer/VBoxContainer/StopSession" to="CenterContainer" method="_on_stop_session_pressed"]
|
[connection signal="pressed" from="CenterContainer/VBoxContainer/StopSession" to="CenterContainer" method="_on_stop_session_pressed"]
|
||||||
[connection signal="pressed" from="CenterContainer/VBoxContainer/LeaveButton" to="CenterContainer" method="_on_leave_button_pressed"]
|
[connection signal="pressed" from="CenterContainer/VBoxContainer/LeaveButton" to="CenterContainer" method="_on_leave_button_pressed"]
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,9 @@ func _ready() -> void:
|
||||||
Lobby.lobby_closed.connect(%StopSession.hide)
|
Lobby.lobby_closed.connect(%StopSession.hide)
|
||||||
%SensitivitySlider.set_value_no_signal(ClientSettings.SENSITIVITY)
|
%SensitivitySlider.set_value_no_signal(ClientSettings.SENSITIVITY)
|
||||||
%SensitivityBox.set_value_no_signal(ClientSettings.SENSITIVITY)
|
%SensitivityBox.set_value_no_signal(ClientSettings.SENSITIVITY)
|
||||||
|
%ToggleCrouch.set_pressed_no_signal(ClientSettings.TOGGLE_CROUCH)
|
||||||
|
%ToggleScope.set_pressed_no_signal(ClientSettings.TOGGLE_SCOPE)
|
||||||
|
%ToggleWalk.set_pressed_no_signal(ClientSettings.TOGGLE_WALK)
|
||||||
|
|
||||||
func _input(event: InputEvent) -> void:
|
func _input(event: InputEvent) -> void:
|
||||||
if event.is_action_pressed("menu_settings"):
|
if event.is_action_pressed("menu_settings"):
|
||||||
|
|
@ -39,3 +42,15 @@ func _on_leave_button_pressed() -> void:
|
||||||
func _on_stop_session_pressed() -> void:
|
func _on_stop_session_pressed() -> void:
|
||||||
if multiplayer.is_server():
|
if multiplayer.is_server():
|
||||||
Session.end_session()
|
Session.end_session()
|
||||||
|
|
||||||
|
|
||||||
|
func _on_toggle_crouch_toggled(toggled_on: bool) -> void:
|
||||||
|
ClientSettings.TOGGLE_CROUCH = toggled_on
|
||||||
|
|
||||||
|
|
||||||
|
func _on_toggle_scope_toggled(toggled_on: bool) -> void:
|
||||||
|
ClientSettings.TOGGLE_SCOPE = toggled_on
|
||||||
|
|
||||||
|
|
||||||
|
func _on_toggle_walk_toggled(toggled_on: bool) -> void:
|
||||||
|
ClientSettings.TOGGLE_WALK = toggled_on
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,18 @@
|
||||||
extends RichTextLabel
|
extends RichTextLabel
|
||||||
|
|
||||||
|
var status: StringName = "au_loading"
|
||||||
|
var error: int
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
AutoUpdate.update_version_text.connect(update_version)
|
AutoUpdate.update_version_text.connect(update_version)
|
||||||
update_version(tr("au_loading"))
|
update_version("au_loading")
|
||||||
|
|
||||||
|
|
||||||
func update_version(version: StringName):
|
func update_version(version: StringName, new_error = -1):
|
||||||
text = tr("vr_version") + preload("res://version.tres").version + "\n" + version
|
status = version
|
||||||
|
error = new_error
|
||||||
|
text = tr("vr_version") + preload("res://version.tres").version + "\n" + tr(version).format({"error":error})
|
||||||
|
|
||||||
|
func _notification(what: int) -> void:
|
||||||
|
if what == NOTIFICATION_TRANSLATION_CHANGED:
|
||||||
|
text = tr("vr_version") + preload("res://version.tres").version + "\n" + tr(status).format({"error":error})
|
||||||
|
|
|
||||||
|
|
@ -12472,7 +12472,7 @@ properties/1/path = NodePath("PlayerInput:compressed_states")
|
||||||
properties/1/spawn = true
|
properties/1/spawn = true
|
||||||
properties/1/replication_mode = 1
|
properties/1/replication_mode = 1
|
||||||
|
|
||||||
[node name="Player" type="CharacterBody3D" node_paths=PackedStringArray("weapon_models") groups=["Player"]]
|
[node name="Player" type="CharacterBody3D" node_paths=PackedStringArray("weapon_models")]
|
||||||
collision_layer = 2
|
collision_layer = 2
|
||||||
collision_mask = 3
|
collision_mask = 3
|
||||||
script = ExtResource("1_l07l8")
|
script = ExtResource("1_l07l8")
|
||||||
|
|
@ -13675,7 +13675,6 @@ offset_top = -0.2800293
|
||||||
offset_right = -0.32000732
|
offset_right = -0.32000732
|
||||||
grow_vertical = 0
|
grow_vertical = 0
|
||||||
mouse_filter = 2
|
mouse_filter = 2
|
||||||
theme_type_variation = &"HPBar"
|
|
||||||
step = 1.0
|
step = 1.0
|
||||||
value = 100.0
|
value = 100.0
|
||||||
fill_mode = 3
|
fill_mode = 3
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,8 @@ const WALK: int = 0b100
|
||||||
signal jumped
|
signal jumped
|
||||||
signal drop
|
signal drop
|
||||||
signal switch_weapon(to_slot: StringName)
|
signal switch_weapon(to_slot: StringName)
|
||||||
signal fire_begin(timestamp: float)
|
signal fire_begin
|
||||||
signal fire_end(timestamp: float)
|
signal fire_end
|
||||||
signal alternate_state
|
signal alternate_state
|
||||||
signal switch_firemode
|
signal switch_firemode
|
||||||
signal reload
|
signal reload
|
||||||
|
|
@ -53,9 +53,9 @@ func _unhandled_input(event: InputEvent) -> void:
|
||||||
switch_on_server.rpc_id(1,"knife")
|
switch_on_server.rpc_id(1,"knife")
|
||||||
|
|
||||||
if event.is_action_pressed("plr_fire"):
|
if event.is_action_pressed("plr_fire"):
|
||||||
fire_on_server.rpc_id(1,false,Rewind.timestamp)
|
fire_on_server.rpc_id(1,false)
|
||||||
if event.is_action_released("plr_fire"):
|
if event.is_action_released("plr_fire"):
|
||||||
fire_on_server.rpc_id(1,true,Rewind.timestamp)
|
fire_on_server.rpc_id(1,true)
|
||||||
if event.is_action_pressed("plr_scope"):
|
if event.is_action_pressed("plr_scope"):
|
||||||
alternate_state_on_server.rpc_id(1)
|
alternate_state_on_server.rpc_id(1)
|
||||||
if event.is_action_pressed("plr_firemode"):
|
if event.is_action_pressed("plr_firemode"):
|
||||||
|
|
@ -126,12 +126,12 @@ func drop_on_server() -> void:
|
||||||
drop.emit()
|
drop.emit()
|
||||||
|
|
||||||
@rpc("authority","call_local","reliable")
|
@rpc("authority","call_local","reliable")
|
||||||
func fire_on_server(end: bool, timestamp: float) -> void:
|
func fire_on_server(end: bool) -> void:
|
||||||
if not multiplayer.is_server(): return
|
if not multiplayer.is_server(): return
|
||||||
if end:
|
if end:
|
||||||
fire_end.emit(timestamp)
|
fire_end.emit()
|
||||||
else:
|
else:
|
||||||
fire_begin.emit(timestamp)
|
fire_begin.emit()
|
||||||
|
|
||||||
@rpc("authority","call_local","reliable")
|
@rpc("authority","call_local","reliable")
|
||||||
func alternate_state_on_server() -> void:
|
func alternate_state_on_server() -> void:
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ Registry="*res://systems/registry.gd"
|
||||||
Shop="*res://gui/buy_menu/shop.gd"
|
Shop="*res://gui/buy_menu/shop.gd"
|
||||||
MouseConfiner="*res://gui/mouse_confiner.gd"
|
MouseConfiner="*res://gui/mouse_confiner.gd"
|
||||||
AutoUpdate="*res://systems/auto_update.gd"
|
AutoUpdate="*res://systems/auto_update.gd"
|
||||||
Rewind="*res://systems/rewind.gd"
|
|
||||||
|
|
||||||
[debug]
|
[debug]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ var popup_scene: PackedScene = preload("uid://5goo8fyxkv33")
|
||||||
var new_version_avaiable: bool
|
var new_version_avaiable: bool
|
||||||
var popup: ConfirmationDialog
|
var popup: ConfirmationDialog
|
||||||
|
|
||||||
signal update_version_text(to: StringName)
|
signal update_version_text(to: StringName,error: int)
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
request_completed.connect(on_request_completed)
|
request_completed.connect(on_request_completed)
|
||||||
|
|
@ -18,22 +18,22 @@ func _ready() -> void:
|
||||||
patch_request.download_file = exec_dir.path_join("chelimbalo.pck")
|
patch_request.download_file = exec_dir.path_join("chelimbalo.pck")
|
||||||
patch_request.request_completed.connect(patch_downloaded)
|
patch_request.request_completed.connect(patch_downloaded)
|
||||||
|
|
||||||
update_version_text.emit(tr("au_loading"))
|
update_version_text.emit("au_loading")
|
||||||
|
|
||||||
request("https://2ndbeam.ru/durenije/chelimbalo/release/deploy_data")
|
request("https://2ndbeam.ru/durenije/chelimbalo/release/deploy_data")
|
||||||
|
|
||||||
func on_request_completed(result: int, _response_code: int, _headers: PackedStringArray, body: PackedByteArray):
|
func on_request_completed(result: int, _response_code: int, _headers: PackedStringArray, body: PackedByteArray):
|
||||||
if result != OK:
|
if result != OK:
|
||||||
update_version_text.emit("[color=red]" + tr("au_err_load") + str(result) +"[/color]")
|
update_version_text.emit("au_err_load",result)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
var ver_hash = body.get_string_from_ascii().split("\n")[1]
|
var ver_hash = body.get_string_from_ascii().split("\n")[1]
|
||||||
if ver_hash != load("res://version.tres").version:
|
if ver_hash != load("res://version.tres").version:
|
||||||
update_version_text.emit(tr("au_new_version"))
|
update_version_text.emit("au_new_version")
|
||||||
popup.popup_centered()
|
popup.popup_centered()
|
||||||
else:
|
else:
|
||||||
update_version_text.emit("[color=green]"+tr("au_current_version")+"[/color]")
|
update_version_text.emit("au_current_version")
|
||||||
|
|
||||||
func download_button_pressed() -> void:
|
func download_button_pressed() -> void:
|
||||||
popup.get_node("HTTPRequest").request("https://2ndbeam.ru/durenije/chelimbalo/release/chelimbalo.pck")
|
popup.get_node("HTTPRequest").request("https://2ndbeam.ru/durenije/chelimbalo/release/chelimbalo.pck")
|
||||||
|
|
@ -43,4 +43,4 @@ func patch_downloaded(result: int, _response_code: int, _headers: PackedStringAr
|
||||||
OS.create_process(OS.get_executable_path(),OS.get_cmdline_args())
|
OS.create_process(OS.get_executable_path(),OS.get_cmdline_args())
|
||||||
get_tree().quit()
|
get_tree().quit()
|
||||||
else:
|
else:
|
||||||
update_version_text.emit("[color=red]" + tr("au_err_install") + str(result) +"[/color]")
|
update_version_text.emit("au_err_install",result)
|
||||||
|
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
extends Node
|
|
||||||
|
|
||||||
const timestamp_range:float = 200.0 #MSEC
|
|
||||||
const timestamps_amount: int = 200
|
|
||||||
|
|
||||||
var timestamp: float = 0
|
|
||||||
|
|
||||||
func _process(delta: float) -> void:
|
|
||||||
if not is_multiplayer_authority():
|
|
||||||
return
|
|
||||||
if Session.session_started_flag:
|
|
||||||
timestamp += delta
|
|
||||||
sync_time.rpc(timestamp)
|
|
||||||
|
|
||||||
@rpc
|
|
||||||
func sync_time(new_timestamp: float) -> void:
|
|
||||||
timestamp = new_timestamp
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
uid://bafcih3g8gi2q
|
|
||||||
|
|
@ -8,23 +8,23 @@ signal return_to_previous
|
||||||
|
|
||||||
var machine: WeaponSubStateMachine
|
var machine: WeaponSubStateMachine
|
||||||
|
|
||||||
func _use_begin(timestamp: float) -> void:
|
func _use_begin() -> void:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@rpc("authority","call_remote","reliable")
|
@rpc("authority","call_remote","reliable")
|
||||||
func use_begin(timestamp: float) -> void:
|
func use_begin() -> void:
|
||||||
_use_begin(timestamp)
|
_use_begin()
|
||||||
if is_multiplayer_authority():
|
if is_multiplayer_authority():
|
||||||
use_begin.rpc(timestamp)
|
use_begin.rpc()
|
||||||
|
|
||||||
func _use_end(timestamp: float):
|
func _use_end():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@rpc("authority","call_remote","reliable")
|
@rpc("authority","call_remote","reliable")
|
||||||
func use_end(timestamp: float) -> void:
|
func use_end() -> void:
|
||||||
_use_end(timestamp)
|
_use_end()
|
||||||
if is_multiplayer_authority():
|
if is_multiplayer_authority():
|
||||||
use_end.rpc(timestamp)
|
use_end.rpc()
|
||||||
|
|
||||||
func _alternate_state() -> void:
|
func _alternate_state() -> void:
|
||||||
pass
|
pass
|
||||||
|
|
|
||||||
|
|
@ -70,12 +70,12 @@ func _enter() -> void:
|
||||||
func _exit() -> void:
|
func _exit() -> void:
|
||||||
super()
|
super()
|
||||||
|
|
||||||
func use_begin(timestamp: float) -> void:
|
func use_begin() -> void:
|
||||||
if current_state != null:
|
if current_state != null:
|
||||||
current_state.use_begin(timestamp)
|
current_state.use_begin()
|
||||||
func use_end(timestamp: float) -> void:
|
func use_end() -> void:
|
||||||
if current_state != null:
|
if current_state != null:
|
||||||
current_state.use_end(timestamp)
|
current_state.use_end()
|
||||||
func alternate_state() -> void:
|
func alternate_state() -> void:
|
||||||
if current_state != null:
|
if current_state != null:
|
||||||
current_state.alternate_state()
|
current_state.alternate_state()
|
||||||
|
|
|
||||||
|
|
@ -218,17 +218,17 @@ func _physics_process(delta: float) -> void:
|
||||||
return
|
return
|
||||||
current_state.physics_update(delta)
|
current_state.physics_update(delta)
|
||||||
|
|
||||||
func use_begin(timestamp: float) -> void:
|
func use_begin() -> void:
|
||||||
if not multiplayer.is_server() or Session.round_state == Session.ROUND_STATES.BUY or disabled:
|
if not multiplayer.is_server() or Session.round_state == Session.ROUND_STATES.BUY or disabled:
|
||||||
return
|
return
|
||||||
if current_state != null:
|
if current_state != null:
|
||||||
current_state.use_begin(timestamp)
|
current_state.use_begin()
|
||||||
|
|
||||||
func use_end(timestamp: float) -> void:
|
func use_end() -> void:
|
||||||
if not multiplayer.is_server() or Session.round_state == Session.ROUND_STATES.BUY or disabled:
|
if not multiplayer.is_server() or Session.round_state == Session.ROUND_STATES.BUY or disabled:
|
||||||
return
|
return
|
||||||
if current_state != null:
|
if current_state != null:
|
||||||
current_state.use_end(timestamp)
|
current_state.use_end()
|
||||||
|
|
||||||
func alternate_state() -> void:
|
func alternate_state() -> void:
|
||||||
if not multiplayer.is_server() or Session.round_state == Session.ROUND_STATES.BUY or disabled:
|
if not multiplayer.is_server() or Session.round_state == Session.ROUND_STATES.BUY or disabled:
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,6 @@ func _enter() -> void:
|
||||||
func _exit() -> void:
|
func _exit() -> void:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
func _use_begin(_timestamp: float) -> void:
|
func _use_begin() -> void:
|
||||||
if Session.is_on_site(machine.player.player_id):
|
if Session.is_on_site(machine.player.player_id):
|
||||||
transition.emit("Plant")
|
transition.emit("Plant")
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ func on_animation_finished(animation: StringName):
|
||||||
machine.ammo -= 1
|
machine.ammo -= 1
|
||||||
return_to_previous.emit()
|
return_to_previous.emit()
|
||||||
|
|
||||||
func use_end(_timestamp: float) -> void:
|
func use_end() -> void:
|
||||||
if is_multiplayer_authority() == false:
|
if is_multiplayer_authority() == false:
|
||||||
return
|
return
|
||||||
transition.emit("Idle")
|
transition.emit("Idle")
|
||||||
|
|
|
||||||
|
|
@ -25,4 +25,11 @@ ignore_time_scale = true
|
||||||
[node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="."]
|
[node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="."]
|
||||||
replication_config = SubResource("SceneReplicationConfig_wpexx")
|
replication_config = SubResource("SceneReplicationConfig_wpexx")
|
||||||
|
|
||||||
|
[node name="Timer2" type="Timer" parent="."]
|
||||||
|
wait_time = 0.06
|
||||||
|
one_shot = true
|
||||||
|
autostart = true
|
||||||
|
ignore_time_scale = true
|
||||||
|
|
||||||
[connection signal="timeout" from="Timer" to="." method="queue_free"]
|
[connection signal="timeout" from="Timer" to="." method="queue_free"]
|
||||||
|
[connection signal="timeout" from="Timer2" to="MultiplayerSynchronizer" method="queue_free"]
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ func _exit() -> void:
|
||||||
if is_multiplayer_authority():
|
if is_multiplayer_authority():
|
||||||
machine.player.get_node("PlayerInput").reload.disconnect(init_reload)
|
machine.player.get_node("PlayerInput").reload.disconnect(init_reload)
|
||||||
|
|
||||||
func _use_begin(timestamp: float) -> void:
|
func _use_begin() -> void:
|
||||||
if machine.ammo > 0:
|
if machine.ammo > 0:
|
||||||
transition.emit("Shoot")
|
transition.emit("Shoot")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@ extends WeaponState
|
||||||
@export var fire_timer: Timer
|
@export var fire_timer: Timer
|
||||||
|
|
||||||
var bullets_shot: int = 0
|
var bullets_shot: int = 0
|
||||||
var cached_timestamp: float = 0
|
|
||||||
|
|
||||||
func _enter() -> void:
|
func _enter() -> void:
|
||||||
fire()
|
fire()
|
||||||
|
|
@ -28,10 +27,9 @@ func on_animation_finished(animation):
|
||||||
if animation == machine.animation_prefix + with_morphems("shoot"):
|
if animation == machine.animation_prefix + with_morphems("shoot"):
|
||||||
transition.emit("Idle")
|
transition.emit("Idle")
|
||||||
|
|
||||||
func _use_begin(timestamp: float) -> void:
|
func _use_begin() -> void:
|
||||||
if fire_timer.time_left > 0:
|
if fire_timer.time_left > 0:
|
||||||
return
|
return
|
||||||
cached_timestamp = timestamp
|
|
||||||
fire()
|
fire()
|
||||||
|
|
||||||
func fire() -> void:
|
func fire() -> void:
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ func on_animation_finished(animation):
|
||||||
if animation == machine.animation_prefix + with_morphems("shoot"):
|
if animation == machine.animation_prefix + with_morphems("shoot"):
|
||||||
transition.emit("Idle")
|
transition.emit("Idle")
|
||||||
|
|
||||||
func _use_begin(timestamp: float) -> void:
|
func _use_begin() -> void:
|
||||||
if fire_timer.time_left > 0:
|
if fire_timer.time_left > 0:
|
||||||
return
|
return
|
||||||
fire()
|
fire()
|
||||||
|
|
|
||||||
|
|
@ -24,8 +24,8 @@ func on_animation_finished(animation):
|
||||||
attack()
|
attack()
|
||||||
machine.animation_player.play(machine.animation_prefix + "attack")
|
machine.animation_player.play(machine.animation_prefix + "attack")
|
||||||
|
|
||||||
func _use_begin(_timestamp: float) -> void:
|
func _use_begin() -> void:
|
||||||
end_it = false
|
end_it = false
|
||||||
|
|
||||||
func _use_end(_timestamp: float) -> void:
|
func _use_end() -> void:
|
||||||
end_it = true
|
end_it = true
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ func _enter() -> void:
|
||||||
func _exit() -> void:
|
func _exit() -> void:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
func _use_begin(_timestamp: float) -> void:
|
func _use_begin() -> void:
|
||||||
transition.emit("Attack")
|
transition.emit("Attack")
|
||||||
|
|
||||||
func _alternate_state() -> void:
|
func _alternate_state() -> void:
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,6 @@ func _enter() -> void:
|
||||||
func _exit() -> void:
|
func _exit() -> void:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
func _use_begin(timestamp: float) -> void:
|
func _use_begin() -> void:
|
||||||
if machine.ammo > 0:
|
if machine.ammo > 0:
|
||||||
transition.emit("Throw")
|
transition.emit("Throw")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue