Add files via upload

This commit is contained in:
Lyssa 2024-10-28 20:42:34 +04:00 committed by GitHub
parent d9b157262f
commit d5e3fcadad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 204 additions and 28 deletions

View File

@ -12,7 +12,7 @@ func SendDialogue():
var fulldia = "" var fulldia = ""
if (len != 1): if (len != 1):
randindex = randi_range(1, len - 1) randindex = randi_range(1, len - 1)
if(randindex == 8): randindex -= 1 if(randindex == 8 or randindex == 7): randindex -= 1
if (sequence[randindex] == "blank"): secondpart = tr("BLANKROUND") % "" if (sequence[randindex] == "blank"): secondpart = tr("BLANKROUND") % ""
else: secondpart = tr("LIVEROUND") % "" else: secondpart = tr("LIVEROUND") % ""
match (randindex): match (randindex):
@ -28,8 +28,6 @@ func SendDialogue():
firstpart = tr("SEQUENCE6") firstpart = tr("SEQUENCE6")
6: 6:
firstpart = tr("SEQUENCE7") firstpart = tr("SEQUENCE7")
7:
firstpart = tr("SEQUENCE7")
fulldia = tr(firstpart) + "\n" + "... " + tr(secondpart) fulldia = tr(firstpart) + "\n" + "... " + tr(secondpart)
else: fulldia = tr("UNFORTUNATE") else: fulldia = tr("UNFORTUNATE")
dia.ShowText_Forever(fulldia) dia.ShowText_Forever(fulldia)

View File

@ -17,6 +17,7 @@ class_name ButtonClass extends Node
@export var ui_opacity_inactive : float = 1 @export var ui_opacity_inactive : float = 1
@export var ui_opacity_active : float = .78 @export var ui_opacity_active : float = .78
@export var resetting : bool @export var resetting : bool
@export var pipe : LobbyManager
@export var adding_cursor : bool @export var adding_cursor : bool
@export var t : Label @export var t : Label
var mainActive = true var mainActive = true
@ -62,4 +63,5 @@ func OnPress():
if (isDynamic && playing): speaker_press.play() if (isDynamic && playing): speaker_press.play()
if (rebind != null): rebindManager.GetRebind(rebind) if (rebind != null): rebindManager.GetRebind(rebind)
if (language): options.AdjustLanguage(alias) if (language): options.AdjustLanguage(alias)
if (pipe != null): pipe.Pipe(alias)
emit_signal("is_pressed") emit_signal("is_pressed")

View File

@ -42,24 +42,21 @@ func _input(event):
if(event is InputEventJoypadButton): if(event is InputEventJoypadButton):
cursor.controller_active = true cursor.controller_active = true
SetPrevFocus(true) SetPrevFocus(true)
if (printing): print("JOYPAD BUTTON")
cursor.SetCursor(cursor.cursor_visible, false) cursor.SetCursor(cursor.cursor_visible, false)
elif(event is InputEventKey): elif(event is InputEventKey):
if (!IsEventAssignedToNavigation(event)): return if (!IsEventAssignedToNavigation(event)): return
cursor.controller_active = true cursor.controller_active = true
SetPrevFocus(true) SetPrevFocus(true)
if (printing):print("EVENT KEY")
cursor.SetCursor(cursor.cursor_visible, false) cursor.SetCursor(cursor.cursor_visible, false)
#DISABLE CONTROLLER #DISABLE CONTROLLER
elif(event is InputEventMouse): elif(event is InputEventMouseMotion):
if event.velocity == Vector2(0, 0): return
cursor.controller_active = false cursor.controller_active = false
SetPrevFocus(false) SetPrevFocus(false)
if (printing):print("EVENT MOUSE")
cursor.SetCursor(cursor.cursor_visible, false) cursor.SetCursor(cursor.cursor_visible, false)
elif(event is InputEventMouseButton): elif(event is InputEventMouseButton):
cursor.controller_active = false cursor.controller_active = false
SetPrevFocus(false) SetPrevFocus(false)
if (printing):print("EVENT MOUSE BUTTON")
cursor.SetCursor(cursor.cursor_visible, false) cursor.SetCursor(cursor.cursor_visible, false)
var navigationBinds = ["ui_up", "ui_down", "ui_left", "ui_right"] var navigationBinds = ["ui_up", "ui_down", "ui_left", "ui_right"]

View File

@ -151,13 +151,14 @@ func FinalScore():
if (endless_overwriting): total_cash = endless_score if (endless_overwriting): total_cash = endless_score
cash_gl = total_cash cash_gl = total_cash
var dots = "................................................................"
var text_congratulations = tr("CONGRATULATIONS") % [playername] var text_congratulations = tr("CONGRATULATIONS") % [playername]
var text_shotsFired = tr("SHOTS FIRED") + " " + str(shots_fired) var text_shotsFired = tr("SHOTS FIRED") + " " + dots; label_array[0].get_child(2).text = str(shots_fired)
if (endless_overwriting): text_shotsFired = tr("ROUNDS BEAT") + " " + str(endless_roundsbeat) if (endless_overwriting): text_shotsFired = tr("ROUNDS BEAT") + " " + dots; label_array[0].get_child(2).text = str(shots_fired)
var text_shellsEjected = tr("SHELLS EJECTED") + " " + str(shells_ejected) var text_shellsEjected = tr("SHELLS EJECTED") + " " + dots; label_array[1].get_child(2).text = str(shots_fired)
var text_doorsKicked = tr("DOORS KICKED") + " " + str(doors_kicked) var text_doorsKicked = tr("DOORS KICKED") + " " + dots; label_array[2].get_child(2).text = str(shots_fired)
var text_cigSmoked = tr("CIGS SMOKED") + " " + str(cigarettes_smoked) var text_cigSmoked = tr("CIGS SMOKED") + " " + dots; label_array[3].get_child(2).text = str(shots_fired)
var text_beerDrank = tr("ML DRANK") + " " + str(ml_of_beer_drank) var text_beerDrank = tr("ML DRANK") + " " + dots; label_array[4].get_child(2).text = str(shots_fired)
var text_totalcash = tr("TOTAL CASH") + " " + str(total_cash) + " $" var text_totalcash = tr("TOTAL CASH") + " " + str(total_cash) + " $"
#if (endless_overwriting): text_shotsFired = "rounds beat ........ " + str(endless_roundsbeat) #if (endless_overwriting): text_shotsFired = "rounds beat ........ " + str(endless_roundsbeat)

View File

@ -1,13 +1,15 @@
extends Node extends Node
var currentVersion_nr = "v1.2.2" var currentVersion_nr = "v1.9.905"
var currentVersion_hotfix = 0 var currentVersion_hotfix = 3
var using_steam = true var using_steam = true
var currentVersion = "" var currentVersion = ""
var versuffix_steam = " (STEAM)" var versuffix_steam = " (STEAM)"
var versuffix_itch = " (ITCH.IO)" var versuffix_itch = " (ITCH.IO)"
var discord_link = "https://discord.gg/UdjMNaKkQe"
var using_gl = false var using_gl = false
var controllerEnabled = false var controllerEnabled = false
var music_enabled = true var music_enabled = true
@ -20,6 +22,99 @@ var default_color_blank = Color(0.29, 0.5, 1)
var colorblind_color_live = Color(1, 1, 1) var colorblind_color_live = Color(1, 1, 1)
var colorblind_color_blank = Color(0.34, 0.34, 0.34) var colorblind_color_blank = Color(0.34, 0.34, 0.34)
var mp_debugging = false #mp debugging with temporary bots
var mp_printing_to_console = true #whether or not disconnect messages, etc are printed to console
var mp_debug_keys_enabled = false #whether or not the debug keys are enabled
var printing_packets = true #whether or not packets get logged
var sending_lobby_change_alerts_to_console = false #whether or not lobby status changes are sent to the console in lobby
var forcing_lobby_enter_from_main_menu = false #whether or not the game immediately goes to lobby scene from main menu
var message_to_forward = "" #message to forward through scenes, for instance a disconnect message
var original_volume_linear_interaction #original volume for bus 3 (interactions)
var original_volume_linear_music #original volume for bus 1 (music)
var debug_round_index_to_end_game_at : int #the game ends when this round index is met
var disband_lobby_after_exiting_main_scene = false #whether or not the lobby is disbanded when exiting to lobby scene from main
var exiting_to_lobby_after_inactivity = false #when a user is inactive for a set amount of time, all users exit to the lobby
var timeouts_enabled = false #whether or not timeouts are enabled for adrenaline, turn, shotgun target selection, item grabbing, etc
var skipping_intro = false #whether or not to skip the intro
var lobby_id_found_in_command_line = 0 #lobby ID for when a player joins through an invite with the game closed
var running_short_intro_in_lobby_scene : bool = false #if the user is entering the lobby scene from mp main, or has a command line lobby ID, skip the bootup animation
var command_line_checked = false #whether or not the command line has been checked on running the game.
var version_to_check : String = "" #full version string that includes major, minor, patch, hotfix
var steam_id_version_checked_array : Array[int] #array of steam IDs that have the version checked. this must match the steam lobby member array IDs.
func _ready(): func _ready():
if using_steam: currentVersion = currentVersion_nr + versuffix_steam if using_steam: currentVersion = currentVersion_nr + versuffix_steam
else: currentVersion = currentVersion_nr + versuffix_itch else: currentVersion = currentVersion_nr + versuffix_itch
debug_round_index_to_end_game_at = 2
original_volume_linear_interaction = db_to_linear(AudioServer.get_bus_volume_db(3))
original_volume_linear_music = db_to_linear(AudioServer.get_bus_volume_db(1))
version_to_check = currentVersion_nr + "." + str(currentVersion_hotfix)
print("running full version name: ", version_to_check)
func _unhandled_input(event):
if GlobalVariables.mp_debugging:
if event.is_action_pressed("debug_q"):
SwapLanguage(false)
if event.is_action_pressed("debug_e"):
SwapLanguage(true)
if event.is_action_pressed("-"):
Engine.time_scale = .05
if event.is_action_pressed(","):
Engine.time_scale = 1
if event.is_action_pressed("."):
Engine.time_scale = 10
if event.is_action_pressed("end"):
Engine.time_scale = 0
var language_array = ["EN", "EE", "RU", "ES LATAM", "ES", "FR", "IT", "JA", "KO", "PL", "PT", "DE", "TR", "UA", "ZHS", "ZHT"]
var index = 0
func SwapLanguage(dir : bool):
return
if dir:
if index == language_array.size() - 1:
index = 0
else:
index += 1
else:
if index == 0:
index = language_array.size() - 1
else:
index -= 1
TranslationServer.set_locale(language_array[index])
print("setting locale to: ", language_array[index])

View File

@ -23,6 +23,8 @@ class_name MenuManager extends Node
@export var anim_creds : AnimationPlayer @export var anim_creds : AnimationPlayer
@export var version : Label @export var version : Label
var viewing_intro : bool
func _ready(): func _ready():
Show("main") Show("main")
buttons[0].connect("is_pressed", Start) buttons[0].connect("is_pressed", Start)
@ -41,6 +43,7 @@ func _ready():
buttons[17].connect("is_pressed", ReturnToLastScreen) buttons[17].connect("is_pressed", ReturnToLastScreen)
buttons[18].connect("is_pressed", ResetControls) buttons[18].connect("is_pressed", ResetControls)
buttons[19].connect("is_pressed", DiscordLink) buttons[19].connect("is_pressed", DiscordLink)
buttons[22].connect("is_pressed", StartMultiplayer)
buttons_options[0].connect("is_pressed", IncreaseVol) buttons_options[0].connect("is_pressed", IncreaseVol)
buttons_options[1].connect("is_pressed", DecreaseVol) buttons_options[1].connect("is_pressed", DecreaseVol)
@ -55,19 +58,49 @@ func _ready():
Intro() Intro()
func _process(delta):
T()
func CheckCommandLine():
var arguments = OS.get_cmdline_args()
for argument in arguments:
if (arguments.size() > 0):
#if (GlobalSteam.LOBBY_INVITE_ARG):
# join_lobby(int(argument))
pass
if argument == "+connect_lobby":
GlobalSteam.LOBBY_INVITE_ARG = true
var failsafed = true var failsafed = true
var fs2 = false
func _input(event): func _input(event):
if (event.is_action_pressed("ui_cancel") && failsafed): if (event.is_action_pressed("ui_cancel") && failsafed):
if (currentScreen != "main"): ReturnToLastScreen() if (currentScreen != "main"): ReturnToLastScreen()
if (event.is_action_pressed("exit game") && failsafed): if (event.is_action_pressed("exit game") && failsafed):
if (currentScreen != "main"): ReturnToLastScreen() if (currentScreen != "main"): ReturnToLastScreen()
if (event.is_action_pressed("exit game") && !fs2 && viewing_intro):
SkipIntro()
fs2 = true
func Intro(): func Intro():
cursor.SetCursor(false, false) cursor.SetCursor(false, false)
await get_tree().create_timer(.5, false).timeout if GlobalVariables.lobby_id_found_in_command_line != 0 && !GlobalVariables.command_line_checked:
print("lobby id found in command line. dont run the menu intro")
return
viewing_intro = true
speaker_music.play() speaker_music.play()
animator_intro.play("splash screen") animator_intro.play("splash screen")
await get_tree().create_timer(9, false).timeout c = true
func SkipIntro():
c = false
animator_intro.stop()
animator_intro.play("skip intro")
FinishIntro()
func FinishIntro():
viewing_intro = false
mouseblocker.visible = false mouseblocker.visible = false
cursor.SetCursor(true, false) cursor.SetCursor(true, false)
controller.settingFilter = true controller.settingFilter = true
@ -76,6 +109,15 @@ func Intro():
controller.previousFocus = firstFocus_main controller.previousFocus = firstFocus_main
assigningFocus = true assigningFocus = true
var t = 0
var c = false
var fs = false
func T():
if c: t+= get_process_delta_time()
if t > 9 && !fs:
FinishIntro()
fs = true
func Buttons(state : bool): func Buttons(state : bool):
if (!state): if (!state):
for i in buttons: for i in buttons:
@ -134,6 +176,7 @@ func Show(what : String):
func ReturnToLastScreen(): func ReturnToLastScreen():
print("return to last screen") print("return to last screen")
if currentScreen == "credits": anim_creds.play("RESET")
if (currentScreen) == "sub options": lastScreen = "main" if (currentScreen) == "sub options": lastScreen = "main"
if (currentScreen) == "rebind controls": lastScreen = "sub options" if (currentScreen) == "rebind controls": lastScreen = "sub options"
if (currentScreen == "audio video" or currentScreen == "language" or currentScreen == "controller" or currentScreen == "rebind controls"): optionmanager.SaveSettings() if (currentScreen == "audio video" or currentScreen == "language" or currentScreen == "controller" or currentScreen == "rebind controls"): optionmanager.SaveSettings()
@ -161,6 +204,22 @@ func Start():
print("changing scene to: main") print("changing scene to: main")
get_tree().change_scene_to_file("res://scenes/main.tscn") get_tree().change_scene_to_file("res://scenes/main.tscn")
func StartMultiplayer():
Buttons(false)
ResetButtons()
for screen in screens: screen.visible = false
title.visible = false
controller.previousFocus = null
speaker_music.stop()
animator_intro.play("snap")
for w in waterfalls: w.pause()
speaker_start.play()
cursor.SetCursor(false, false)
savefile.ClearSave()
await get_tree().create_timer(4, false).timeout
print("changing scene to: lobby")
get_tree().change_scene_to_file("res://multiplayer/scenes/mp_lobby.tscn")
func Credits(): func Credits():
Show("credits") Show("credits")
ResetButtons() ResetButtons()
@ -174,6 +233,13 @@ func Exit():
await get_tree().create_timer(.5, false).timeout await get_tree().create_timer(.5, false).timeout
get_tree().quit() get_tree().quit()
func DisableMenu():
Buttons(false)
ResetButtons()
speaker_music.stop()
animator_intro.play("snap2")
cursor.SetCursor(false, false)
func ResetControls(): func ResetControls():
optionmanager.ResetControls() optionmanager.ResetControls()
ResetButtons() ResetButtons()
@ -183,7 +249,7 @@ func ToggleMusic():
func ToggleColorblind(): func ToggleColorblind():
optionmanager.ToggleColorblind() optionmanager.ToggleColorblind()
func DiscordLink(): func DiscordLink():
OS.shell_open("https://discord.gg/cr-channel-1158444754325999747") OS.shell_open(GlobalVariables.discord_link)
func RebindControls(): func RebindControls():
Show("rebind controls") Show("rebind controls")
ResetButtons() ResetButtons()

View File

@ -49,7 +49,7 @@ var setting_colorblind = false
var setting_music_enabled = true var setting_music_enabled = true
func _ready(): func _ready():
Printout() print("your version %s does not match this %s version" % [900, 400])
LoadSettings() LoadSettings()
if (!receivedFile): if (!receivedFile):
setting_windowed = defaultOption_windowed setting_windowed = defaultOption_windowed
@ -106,7 +106,6 @@ func AdjustLanguage(alias : String):
setting_language = alias setting_language = alias
ApplySettings_language() ApplySettings_language()
menu.ResetButtons() menu.ResetButtons()
return
func ApplySettings_volume(): func ApplySettings_volume():
AudioServer.set_bus_volume_db(0, linear_to_db(setting_volume)) AudioServer.set_bus_volume_db(0, linear_to_db(setting_volume))
@ -121,8 +120,9 @@ func AdjustSettings_music():
func ApplySettings_music(): func ApplySettings_music():
if (setting_music_enabled): anim_vinyl.speed_scale = 1 if (setting_music_enabled): anim_vinyl.speed_scale = 1
else: anim_vinyl.speed_scale = 0 else: anim_vinyl.speed_scale = 0
AudioServer.set_bus_mute(1, !setting_music_enabled) AudioServer.set_bus_mute(1, !setting_music_enabled) #music
AudioServer.set_bus_mute(2, !setting_music_enabled) AudioServer.set_bus_mute(2, !setting_music_enabled) #music secondary
AudioServer.set_bus_mute(4, !setting_music_enabled) #music resolve
AudioServer.get_property_list() AudioServer.get_property_list()
GlobalVariables.music_enabled = setting_music_enabled GlobalVariables.music_enabled = setting_music_enabled

View File

@ -2,14 +2,31 @@ extends Node
var appid : int = 2835570 var appid : int = 2835570
const PACKET_READ_LIMIT: int = 32
var DATA
var LOBBY_ID = 0
var LOBBY_MEMBERS = []
var USER_ID_LIST_TO_IGNORE : Array[int]
var LOBBY_INVITE_ARG = false
var STEAM_ID = 0
var STEAM_NAME = ""
var ONLINE = false
var HOST_ID = 0
func _ready(): func _ready():
if GlobalVariables.using_steam: process_priority = 1000
process_priority = 1000 set_process_internal(true)
set_process_internal(true) InitializeSteam()
InitializeSteam()
ONLINE = Steam.loggedOn()
STEAM_ID = Steam.getSteamID()
STEAM_NAME = Steam.getPersonaName()
print("online ... ", ONLINE, " ... steam id ... ", STEAM_ID, " ... steam name ... ", STEAM_NAME)
func _process(_delta: float) -> void: func _process(_delta: float) -> void:
if GlobalVariables.using_steam: Steam.run_callbacks() #OS.delay_msec(17)
Steam.run_callbacks()
func InitializeSteam(): func InitializeSteam():
if GlobalVariables.using_steam: if GlobalVariables.using_steam: