reverse v1.2.1 changes

goddammit bob
This commit is contained in:
Lyssa 2024-04-10 22:19:04 +04:00 committed by GitHub
parent 83102bea31
commit a86f69ecf1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
32 changed files with 5149 additions and 35 deletions

View File

@ -13,8 +13,8 @@ func SendDialogue():
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): 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):
1: 1:
firstpart = tr("SEQUENCE2") firstpart = tr("SEQUENCE2")

View File

@ -30,10 +30,10 @@ func _ready():
func SetUI(state : bool): func SetUI(state : bool):
if (state): if (state):
if (!is3D): ui.modulate.a = ui_opacity_active if (!is3D): ui.modulate.a = ui_opacity_active
else: ui_3D.transparency = 0 else: ui_3D.visible = true
else: else:
if (!is3D): ui.modulate.a = ui_opacity_inactive if (!is3D): ui.modulate.a = ui_opacity_inactive
else: ui_3D.transparency = 1 else: ui_3D.visible = false
func OnHover(): func OnHover():
if (isActive && mainActive): if (isActive && mainActive):

9
ChecmarkBranch.gd Normal file
View File

@ -0,0 +1,9 @@
class_name Checkmark extends Node
@export var ui : TextureRect
@export var checkmark_active : CompressedTexture2D
@export var checkmark_ianctive : CompressedTexture2D
func UpdateCheckmark(state : bool):
if (state): ui.texture = checkmark_active
else: ui.texture = checkmark_ianctive

9
ColorblindManager.gd Normal file
View File

@ -0,0 +1,9 @@
class_name Colorblind extends Node
@export var mat_live : StandardMaterial3D
@export var mat_blank : StandardMaterial3D
@export var mat_emission : StandardMaterial3D
func _ready():
if (GlobalVariables.colorblind): mat_live.albedo_color = GlobalVariables.colorblind_color_live; mat_blank.albedo_color = GlobalVariables.colorblind_color_blank
else: mat_live.albedo_color = GlobalVariables.default_color_live; mat_blank.albedo_color = GlobalVariables.default_color_blank

View File

@ -230,7 +230,7 @@ func DealerChoice():
if (dealerWantsToUse == "expired medicine"): if (dealerWantsToUse == "expired medicine"):
var medicine_outcome = randf_range(0.0, 1.0) var medicine_outcome = randf_range(0.0, 1.0)
var dying var dying
if (medicine_outcome < .4): dying = false if (medicine_outcome < .5): dying = false
else: dying = true else: dying = true
medicine.dealerDying = dying medicine.dealerDying = dying
returning = true returning = true

View File

@ -142,6 +142,7 @@ func MainDeathRoutine():
if (rm.endscore != null): if (rm.endscore != null):
if (rm.endscore > 1000000): ach.UnlockAchievement("ach10") if (rm.endscore > 1000000): ach.UnlockAchievement("ach10")
await get_tree().create_timer(.5, false).timeout await get_tree().create_timer(.5, false).timeout
print("changing scene to: death")
get_tree().change_scene_to_file("res://scenes/death.tscn") get_tree().change_scene_to_file("res://scenes/death.tscn")
return return
if (shotgunShooting.roundManager.wireIsCut_player): if (shotgunShooting.roundManager.wireIsCut_player):
@ -150,8 +151,12 @@ func MainDeathRoutine():
shotgunShooting.roundManager.playerData.playerEnteringFromDeath = true shotgunShooting.roundManager.playerData.playerEnteringFromDeath = true
await(savefile.SaveGame()) await(savefile.SaveGame())
await get_tree().create_timer(.5, false).timeout await get_tree().create_timer(.5, false).timeout
if (!loadingHeaven): get_tree().change_scene_to_file("res://scenes/death.tscn") if (!loadingHeaven):
else: get_tree().change_scene_to_file("res://scenes/heaven.tscn") print("changing scene to: death")
get_tree().change_scene_to_file("res://scenes/death.tscn")
else:
print("changing scene to: heaven")
get_tree().change_scene_to_file("res://scenes/heaven.tscn")
pass pass
func DisableSpeakers(): func DisableSpeakers():

View File

@ -1,10 +1,12 @@
class_name Debug extends Node class_name Debug extends Node
#@export var timescale : TimeScaleManager @export var debugging : bool
#func _unhandled_input(event): @export var timescale : TimeScaleManager
# if (event.is_action_pressed(",")): func _unhandled_input(event):
# Engine.time_scale = 1 if (debugging):
# timescale.moving = false if (event.is_action_pressed(",")):
# if (event.is_action_pressed(".")): Engine.time_scale = 1
# Engine.time_scale = 10 timescale.moving = false
# timescale.moving = false if (event.is_action_pressed(".")):
Engine.time_scale = 10
timescale.moving = false

View File

@ -1,11 +1,14 @@
class_name DecisionTextManager extends Node class_name DecisionTextManager extends Node
@export var inter : InteractionManager
@export var array_obj : Array[Node3D]
@export var textArray : Array[TextInteraction] @export var textArray : Array[TextInteraction]
@export var colliderArray : Array[StaticBody3D] @export var colliderArray : Array[StaticBody3D]
@export var animator : AnimationPlayer @export var animator : AnimationPlayer
@export var uiParent : Control @export var uiParent : Control
func _ready(): func _ready():
if (GlobalVariables.using_gl): for i in array_obj: i.visible = false
for i in range(colliderArray.size()): for i in range(colliderArray.size()):
colliderArray[i].collision_layer = 0 colliderArray[i].collision_layer = 0
colliderArray[i].collision_mask = 0 colliderArray[i].collision_mask = 0
@ -16,9 +19,13 @@ func SetUI(state : bool):
colliderArray[i].collision_layer = 1 colliderArray[i].collision_layer = 1
colliderArray[i].collision_mask = 1 colliderArray[i].collision_mask = 1
animator.play("show text") animator.play("show text")
if (GlobalVariables.using_gl): for i in array_obj: i.visible = true
inter.fs_dec = false
else: else:
for i in range(colliderArray.size()): for i in range(colliderArray.size()):
colliderArray[i].collision_layer = 0 colliderArray[i].collision_layer = 0
colliderArray[i].collision_mask = 0 colliderArray[i].collision_mask = 0
animator.play("hide text") animator.play("hide text")
uiParent.visible = false uiParent.visible = false
if (GlobalVariables.using_gl): for i in array_obj: i.visible = false
inter.fs_dec = false

View File

@ -17,6 +17,7 @@ func UnlockRoutine():
await get_tree().create_timer(4, false).timeout await get_tree().create_timer(4, false).timeout
anim.play("fade") anim.play("fade")
await get_tree().create_timer(1, false).timeout await get_tree().create_timer(1, false).timeout
print("changing scene to: menu")
get_tree().change_scene_to_file("res://scenes/menu.tscn") get_tree().change_scene_to_file("res://scenes/menu.tscn")
func UnlockMode(): func UnlockMode():

View File

@ -36,7 +36,7 @@ var waitingForInput = false
# ExitGame() # ExitGame()
# waitingForInput = false # waitingForInput = false
func _unhandled_key_input(event): func _unhandled_input(event):
if (event.is_pressed()): if (event.is_pressed()):
if (waitingForInput): if (waitingForInput):
ExitGame() ExitGame()
@ -100,6 +100,7 @@ func ExitGame():
await get_tree().create_timer(4, false).timeout await get_tree().create_timer(4, false).timeout
var unlocked = FileAccess.file_exists(unlocker.savepath) var unlocked = FileAccess.file_exists(unlocker.savepath)
if (unlocked): if (unlocked):
print("changing scene to: menu")
get_tree().change_scene_to_file("res://scenes/menu.tscn") get_tree().change_scene_to_file("res://scenes/menu.tscn")
return return
else: else:

View File

@ -1,3 +1,13 @@
extends Node extends Node
var currentVersion = "v1.2.1 (STEAM)"
var using_gl = false
var controllerEnabled = false var controllerEnabled = false
var colorblind = false
var colorblind_color = Color(1, 1, 0)
var default_color_live = Color(1, 0.28, 0.29)
var default_color_blank = Color(0.29, 0.5, 1)
var colorblind_color_live = Color(1, 1, 1)
var colorblind_color_blank = Color(0.34, 0.34, 0.34)

View File

@ -45,6 +45,7 @@ func Button_Main(tag : String):
await get_tree().create_timer(3.12, false).timeout await get_tree().create_timer(3.12, false).timeout
match tag: match tag:
"retry": "retry":
print("changing scene to: death")
get_tree().change_scene_to_file("res://scenes/death.tscn") get_tree().change_scene_to_file("res://scenes/death.tscn")
"exit": "exit":
get_tree().quit() get_tree().quit()

View File

@ -41,16 +41,21 @@ func CheckIfHovering():
else: else:
cursor.SetCursorImage("point") cursor.SetCursorImage("point")
var fs_dec = false
func InteractWith(alias : String): func InteractWith(alias : String):
match(alias): match(alias):
"shotgun": "shotgun":
shotgun.GrabShotgun() shotgun.GrabShotgun()
"text dealer": "text dealer":
shotgun.Shoot("dealer") if (!fs_dec):
decision.SetUI(false) shotgun.Shoot("dealer")
decision.SetUI(false)
fs_dec = true
"text you": "text you":
shotgun.Shoot("self") if (!fs_dec):
decision.SetUI(false) shotgun.Shoot("self")
decision.SetUI(false)
fs_dec = true
"briefcase intake": "briefcase intake":
itemManager.GrabItem() itemManager.GrabItem()
"item": "item":

View File

@ -271,7 +271,9 @@ func RevertCRT():
if (cursor.controller_active): btn_bathroomdoor.grab_focus() if (cursor.controller_active): btn_bathroomdoor.grab_focus()
controller.previousFocus = btn_bathroomdoor controller.previousFocus = btn_bathroomdoor
@export var statue : Statue
func Interaction_BackroomDoor(): func Interaction_BackroomDoor():
statue.CheckStatus()
roundManager.playerData.stat_doorsKicked += 1 roundManager.playerData.stat_doorsKicked += 1
animator_camera.play("camera enter backroom") animator_camera.play("camera enter backroom")
intbranch_backroomdoor.interactionAllowed = false intbranch_backroomdoor.interactionAllowed = false
@ -315,6 +317,8 @@ func KickDoorLobby():
filter.BeginPan(filter.lowPassDefaultValue, filter.lowPassMaxValue) filter.BeginPan(filter.lowPassDefaultValue, filter.lowPassMaxValue)
speaker_amb_restroom.stop() speaker_amb_restroom.stop()
@export var pipeline : PipelineManager
func RestRoomIdle(): func RestRoomIdle():
pipeline.AdjustSettings(pipeline.scene)
animator_camera.play("camera idle bathroom") animator_camera.play("camera idle bathroom")
pass pass

View File

@ -152,7 +152,7 @@ func BeginItemGrabbing():
var stringIndex = roundManager.roundArray[roundManager.currentRound].numberOfItemsToGrab var stringIndex = roundManager.roundArray[roundManager.currentRound].numberOfItemsToGrab
var string = stringNumberArray[stringIndex] var string = stringNumberArray[stringIndex]
string = str(stringIndex) string = str(stringIndex)
dialogue.ShowText_Forever(string+" "+tr("ITEMS EACH")) dialogue.ShowText_Forever(tr("ITEMS EACH") % string)
await get_tree().create_timer(2.5, false).timeout await get_tree().create_timer(2.5, false).timeout
dialogue.ShowText_Forever(tr("MORE ITEMS")) dialogue.ShowText_Forever(tr("MORE ITEMS"))
await get_tree().create_timer(2.5, false).timeout await get_tree().create_timer(2.5, false).timeout
@ -163,7 +163,7 @@ func BeginItemGrabbing():
var stringIndex = roundManager.roundArray[roundManager.currentRound].numberOfItemsToGrab var stringIndex = roundManager.roundArray[roundManager.currentRound].numberOfItemsToGrab
var string = stringNumberArray[stringIndex] var string = stringNumberArray[stringIndex]
string = str(stringIndex) string = str(stringIndex)
dialogue.ShowText_Forever(string+" "+tr("ITEMS EACH")) dialogue.ShowText_Forever(tr("ITEMS EACH") % string)
await get_tree().create_timer(2.5, false).timeout await get_tree().create_timer(2.5, false).timeout
dialogue.HideText() dialogue.HideText()
roundManager.playerData.hasReadItemDistributionIntro2 = true roundManager.playerData.hasReadItemDistributionIntro2 = true
@ -232,6 +232,8 @@ func GrabItem():
availableItemsToGrabArray_player.append(res.itemName) availableItemsToGrabArray_player.append(res.itemName)
#for res in amountArray: availableItemsToGrabArray_player.append(res.itemName) #for res in amountArray: availableItemsToGrabArray_player.append(res.itemName)
if (roundManager.currentRound == 0 && roundManager.roundArray[roundManager.currentRound].startingHealth == 2):
if ("handsaw" in availableItemsToGrabArray_player): availableItemsToGrabArray_player.erase("handsaw")
randindex = randi_range(0, availableItemsToGrabArray_player.size() - 1) randindex = randi_range(0, availableItemsToGrabArray_player.size() - 1)
numberOfItemsGrabbed += 1 numberOfItemsGrabbed += 1
@ -351,6 +353,10 @@ func GrabItems_Enemy():
continue continue
if (res.amount_dealer != res.amount_active): if (res.amount_dealer != res.amount_active):
availableItemsToGrabArray_dealer.append(res.itemName) availableItemsToGrabArray_dealer.append(res.itemName)
if (roundManager.currentRound == 0 && roundManager.roundArray[roundManager.currentRound].startingHealth == 2):
if ("handsaw" in availableItemsToGrabArray_dealer): availableItemsToGrabArray_dealer.erase("handsaw")
var randindex = randi_range(0, availableItemsToGrabArray_dealer.size() - 1) var randindex = randi_range(0, availableItemsToGrabArray_dealer.size() - 1)
var selectedItem = availableItemsToGrabArray_dealer[randindex] var selectedItem = availableItemsToGrabArray_dealer[randindex]

View File

@ -1,6 +1,7 @@
extends Node extends Node
@export var isHeaven : bool = false @export var isHeaven : bool = false
@export var text_dealer : Label3D
func _ready(): func _ready():
await get_tree().create_timer(1, false).timeout await get_tree().create_timer(1, false).timeout
@ -11,6 +12,7 @@ func Prevent():
if (!isHeaven): if (!isHeaven):
await get_tree().create_timer(1, false).timeout await get_tree().create_timer(1, false).timeout
if (loc == "ES" or loc == "JA"): self.get_parent().visible = false if (loc == "ES" or loc == "JA"): self.get_parent().visible = false
if (loc == "JA"): text_dealer.scale = Vector3(1.409, 2.466, 1.752)
else: else:
if (loc == "DE" or loc == "ES" or loc == "ES LATAM" or loc == "BR" or loc == "PT" or loc == "PL" or loc == "TR"): self.get_parent().text = "< >" if (loc == "DE" or loc == "ES" or loc == "ES LATAM" or loc == "BR" or loc == "PT" or loc == "PL" or loc == "TR"): self.get_parent().text = "< >"
else: self.get_parent().text = "< >" else: self.get_parent().text = "< >"

View File

@ -224,7 +224,12 @@ func _on_leaderboard_scores_downloaded(message: String, this_leaderboard_handle:
for this_result in result: if (print_cur <= print_max): print("leaderboard result (", print_cur, "/", print_max, ")", this_result); print_cur += 1 for this_result in result: if (print_cur <= print_max): print("leaderboard result (", print_cur, "/", print_max, ")", this_result); print_cur += 1
UpdateDisplay() UpdateDisplay()
func val2compressed(val):
var accuracy_bits = 17
var a = max(0, floor(log(val) / log(2)) + 1 - accuracy_bits)
if 2**accuracy_bits * (2**a - 1) > val: a -= 1
var b = (val - 2**accuracy_bits * (2**a - 1)) / (2**a)
return floor((a * 2**accuracy_bits) + b)

View File

@ -71,5 +71,5 @@ func Perms(d : float):
func GetFlip(): func GetFlip():
var value = randf_range(0.0, 1.0) var value = randf_range(0.0, 1.0)
if (value < .4): return false if (value < .5): return false
else: return true else: return true

View File

@ -21,6 +21,7 @@ class_name MenuManager extends Node
@export var controller : ControllerManager @export var controller : ControllerManager
@export var mouseblocker : Control @export var mouseblocker : Control
@export var anim_creds : AnimationPlayer @export var anim_creds : AnimationPlayer
@export var version : Label
func _ready(): func _ready():
Show("main") Show("main")
@ -47,6 +48,9 @@ func _ready():
buttons_options[3].connect("is_pressed", SetWindowed) buttons_options[3].connect("is_pressed", SetWindowed)
buttons_options[4].connect("is_pressed", ControllerEnable) buttons_options[4].connect("is_pressed", ControllerEnable)
buttons_options[5].connect("is_pressed", ControllerDisable) buttons_options[5].connect("is_pressed", ControllerDisable)
buttons_options[6].connect("is_pressed", ToggleColorblind)
version.text = GlobalVariables.currentVersion
Intro() Intro()
@ -128,6 +132,7 @@ func Show(what : String):
controller.previousFocus = focus controller.previousFocus = focus
func ReturnToLastScreen(): func ReturnToLastScreen():
print("return to last screen")
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()
@ -152,6 +157,7 @@ func Start():
cursor.SetCursor(false, false) cursor.SetCursor(false, false)
savefile.ClearSave() savefile.ClearSave()
await get_tree().create_timer(4, false).timeout await get_tree().create_timer(4, false).timeout
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 Credits(): func Credits():
@ -171,6 +177,8 @@ func ResetControls():
optionmanager.ResetControls() optionmanager.ResetControls()
ResetButtons() ResetButtons()
func ToggleColorblind():
optionmanager.ToggleColorblind()
func DiscordLink(): func DiscordLink():
OS.shell_open("https://discord.gg/cr-channel-1158444754325999747") OS.shell_open("https://discord.gg/cr-channel-1158444754325999747")
func RebindControls(): func RebindControls():

View File

@ -34,6 +34,7 @@ var defaultOption_inputmap_controller = {
@export var button_fullscreen : ButtonClass @export var button_fullscreen : ButtonClass
@export var menu : MenuManager @export var menu : MenuManager
@export var ui_volume : Label @export var ui_volume : Label
@export var checkmark_colorblind : Checkmark
const savePath := "user://buckshotroulette_options_12.shell" const savePath := "user://buckshotroulette_options_12.shell"
var data = {} var data = {}
@ -44,8 +45,10 @@ var setting_volume = 1
var setting_windowed = false var setting_windowed = false
var setting_language = "EN" var setting_language = "EN"
var setting_controllerEnabled = false var setting_controllerEnabled = false
var setting_colorblind = false
func _ready(): func _ready():
Printout()
LoadSettings() LoadSettings()
if (!receivedFile): if (!receivedFile):
setting_windowed = defaultOption_windowed setting_windowed = defaultOption_windowed
@ -58,6 +61,9 @@ func _ready():
ApplySettings_language() ApplySettings_language()
ApplySettings_inputmap() ApplySettings_inputmap()
func Printout():
print("user current version: ", GlobalVariables.currentVersion)
func Adjust(alias : String): func Adjust(alias : String):
match(alias): match(alias):
"increase": "increase":
@ -89,6 +95,10 @@ func Adjust(alias : String):
if (alias != "increase" && alias != "decrease"): menu.ResetButtons() if (alias != "increase" && alias != "decrease"): menu.ResetButtons()
func ToggleColorblind():
setting_colorblind = !setting_colorblind
checkmark_colorblind.UpdateCheckmark(setting_colorblind)
ApplySettings_colorblind()
func AdjustLanguage(alias : String): func AdjustLanguage(alias : String):
setting_language = alias setting_language = alias
@ -177,6 +187,9 @@ func ApplySettings_inputmap():
func ApplySettings_language(): func ApplySettings_language():
TranslationServer.set_locale(setting_language) TranslationServer.set_locale(setting_language)
func ApplySettings_colorblind():
GlobalVariables.colorblind = setting_colorblind
func SaveSettings(): func SaveSettings():
data = { data = {
#"has_read_introduction": roundManager.playerData.hasReadIntroduction, #"has_read_introduction": roundManager.playerData.hasReadIntroduction,
@ -185,15 +198,20 @@ func SaveSettings():
"setting_language" : setting_language, "setting_language" : setting_language,
"setting_controllerEnabled" : setting_controllerEnabled, "setting_controllerEnabled" : setting_controllerEnabled,
"setting_inputmap_keyboard": setting_inputmap_keyboard, "setting_inputmap_keyboard": setting_inputmap_keyboard,
"setting_inputmap_controller": setting_inputmap_controller "setting_inputmap_controller": setting_inputmap_controller,
"setting_colorblind": setting_colorblind
} }
print("attempting to save settings")
var file = FileAccess.open(savePath, FileAccess.WRITE) var file = FileAccess.open(savePath, FileAccess.WRITE)
file.store_var(data) file.store_var(data)
file.close() file.close()
print("file closed")
var receivedFile = false var receivedFile = false
func LoadSettings(): func LoadSettings():
if (FileAccess.file_exists(savePath)): if (FileAccess.file_exists(savePath)):
print("settings file found, attempting to load settings: ")
print("")
var file = FileAccess.open(savePath, FileAccess.READ) var file = FileAccess.open(savePath, FileAccess.READ)
data = file.get_var() data = file.get_var()
setting_volume = data.setting_volume setting_volume = data.setting_volume
@ -202,11 +220,20 @@ func LoadSettings():
setting_controllerEnabled = data.setting_controllerEnabled setting_controllerEnabled = data.setting_controllerEnabled
setting_inputmap_keyboard = data.setting_inputmap_keyboard setting_inputmap_keyboard = data.setting_inputmap_keyboard
setting_inputmap_controller = data.setting_inputmap_controller setting_inputmap_controller = data.setting_inputmap_controller
if (data.has('setting_colorblind')):
setting_colorblind = data.setting_colorblind
if (checkmark_colorblind != null): checkmark_colorblind.UpdateCheckmark(setting_colorblind)
file.close() file.close()
print("---------------------------------")
print("user settings: ", data)
print("---------------------------------")
print("settings file closed")
setting = true setting = true
ApplySettings_volume() ApplySettings_volume()
ApplySettings_window() ApplySettings_window()
ApplySettings_language() ApplySettings_language()
ApplySettings_controller() ApplySettings_controller()
ApplySettings_inputmap() ApplySettings_inputmap()
ApplySettings_colorblind()
receivedFile = true receivedFile = true
else: print("user does not have settings file")

44
PipelineManager.gd Normal file
View File

@ -0,0 +1,44 @@
class_name PipelineManager extends Node
@export var env : WorldEnvironment
@export var cam : CameraManager
@export var scene : String
@export var overlay : Control
@export var main_array_hide : Array[Node3D]
@export var main_array_toggle : Array[Node3D]
@export var main_restroom : Node3D
@export var main_light_tabletop2 : Light3D
@export var main_light_tabletop : Light3D
func _ready():
CheckStatus()
if (scene == "menu"): CheckStatus()
AdjustSettings(scene)
func CheckStatus():
GlobalVariables.using_gl = !is_instance_valid(RenderingServer.get_rendering_device())
print("running openGL: ", GlobalVariables.using_gl)
func Toggle():
if (GlobalVariables.using_gl):
main_restroom.visible = false
main_restroom.visible = true
func AdjustSettings(scene : String):
if (GlobalVariables.using_gl):
print("adjusting settings in scene: ", scene)
overlay.visible = true
match scene:
"menu":
print("adjust menu")
"main":
for i in main_array_hide: i.visible = false
main_light_tabletop.visible = false
for i in main_array_toggle: i.visible = false
await get_tree().create_timer(.1, false).timeout
for i in main_array_toggle: i.visible = true
main_light_tabletop2.light_energy = -3.54
"heaven":
env.environment.background_color = Color(1, 1, 1)

View File

@ -2,9 +2,29 @@ class_name ResetManager extends Node
@export var save : SaveFileManager @export var save : SaveFileManager
var fs = false var fs = false
var reset_pressed = false
var reset_timer = 0.0
func _unhandled_input(event): func _unhandled_input(event):
if (event.is_action_pressed("reset") && !fs): if event.is_action_pressed("reset") && !fs:
save.ClearSave() reset_timer = 0
get_tree().change_scene_to_file("res://scenes/death.tscn") reset_pressed = true
fs = true if (event.is_action_released("reset")):
reset_timer = 0
reset_pressed = false
func _process(delta):
if reset_pressed:
reset_timer += delta
if reset_timer >= 0.8:
reset_pressed = false
Reset()
reset_timer = 0.0
else:
reset_timer = 0.0
func Reset():
save.ClearSave()
print("changing scene to: death")
get_tree().change_scene_to_file("res://scenes/death.tscn")
fs = true

View File

@ -60,6 +60,7 @@ var trueDeathActive = false
var playerCurrentTurnItemArray = [] var playerCurrentTurnItemArray = []
func _ready(): func _ready():
Engine.time_scale = 1
HideDealer() HideDealer()
#await get_tree().create_timer(.2, false).timeout #await get_tree().create_timer(.2, false).timeout
pass pass
@ -137,10 +138,12 @@ func ParseMainGameAmounts():
for res in amounts.array_amounts: for res in amounts.array_amounts:
res.amount_active = res.amount_main res.amount_active = res.amount_main
var curhealth = 0
func GenerateRandomBatches(): func GenerateRandomBatches():
for b in batchArray: for b in batchArray:
for i in range(b.roundArray.size()): for i in range(b.roundArray.size()):
b.roundArray[i].startingHealth = randi_range(2, 4) b.roundArray[i].startingHealth = randi_range(2, 4)
curhealth = b.roundArray[i].startingHealth
var total_shells = randi_range(2, 8) var total_shells = randi_range(2, 8)
var amount_live = max(1, total_shells / 2) var amount_live = max(1, total_shells / 2)
@ -165,6 +168,7 @@ func SetupRoundArray():
pass pass
pass pass
@export var statue : Statue
#SHOW ROUND INDICATOR #SHOW ROUND INDICATOR
func RoundIndicator(): func RoundIndicator():
roundIndicator.visible = false roundIndicator.visible = false
@ -172,6 +176,7 @@ func RoundIndicator():
animator_roundIndicator.play("RESET") animator_roundIndicator.play("RESET")
camera.BeginLerp("health counter") camera.BeginLerp("health counter")
await get_tree().create_timer(.8, false).timeout await get_tree().create_timer(.8, false).timeout
statue.CheckStatus()
var activePos = roundIndicatorPositions[roundArray[0].indicatorNumber] var activePos = roundIndicatorPositions[roundArray[0].indicatorNumber]
roundIndicator.transform.origin = activePos roundIndicator.transform.origin = activePos
roundIndicatorParent.visible = true roundIndicatorParent.visible = true
@ -337,6 +342,7 @@ func SetupDeskUI():
deskUI_shotgun.visible = true deskUI_shotgun.visible = true
if (roundArray[currentRound].usingItems): if (roundArray[currentRound].usingItems):
for b in deskUI_grids: b.visible = true for b in deskUI_grids: b.visible = true
else: for b in deskUI_grids: b.visible = false
if (cursor.controller_active): deskUI_shotgun.grab_focus() if (cursor.controller_active): deskUI_shotgun.grab_focus()
controller.previousFocus = deskUI_shotgun controller.previousFocus = deskUI_shotgun
@ -367,7 +373,7 @@ var doubled = false
var lerpingscore = false var lerpingscore = false
var startscore var startscore
var endscore var endscore = 0
@export var ui_score : Label3D @export var ui_score : Label3D
@export var ui_doubleornothing : Label3D @export var ui_doubleornothing : Label3D
@export var speaker_key : AudioStreamPlayer2D @export var speaker_key : AudioStreamPlayer2D

View File

@ -12,6 +12,7 @@ func _ready():
pass pass
func SaveGame(): func SaveGame():
print("attempting to save game")
data = { data = {
"has_read_introduction": roundManager.playerData.hasReadIntroduction, "has_read_introduction": roundManager.playerData.hasReadIntroduction,
"has_read_item_swap_introduction": roundManager.playerData.hasReadItemSwapIntroduction, "has_read_item_swap_introduction": roundManager.playerData.hasReadItemSwapIntroduction,
@ -39,9 +40,12 @@ func SaveGame():
var file = FileAccess.open(savePath, FileAccess.WRITE) var file = FileAccess.open(savePath, FileAccess.WRITE)
file.store_var(data) file.store_var(data)
file.close() file.close()
print("save file closed")
print("user save file dictionary: ", data)
func LoadGame(): func LoadGame():
if (FileAccess.file_exists(savePath)): if (FileAccess.file_exists(savePath)):
print("attempting to load save file")
var file = FileAccess.open(savePath, FileAccess.READ) var file = FileAccess.open(savePath, FileAccess.READ)
data = file.get_var() data = file.get_var()
roundManager.playerData.hasReadIntroduction = data.has_read_introduction roundManager.playerData.hasReadIntroduction = data.has_read_introduction
@ -67,6 +71,10 @@ func LoadGame():
roundManager.playerData.stat_cigSmoked = data.stat_cigSmoked roundManager.playerData.stat_cigSmoked = data.stat_cigSmoked
roundManager.playerData.stat_beerDrank = data.stat_beerDrank roundManager.playerData.stat_beerDrank = data.stat_beerDrank
file.close() file.close()
print("closing save file")
print("loaded data dictionary: ", data)
else: print("user does not have save file")
func ClearSave(): func ClearSave():
print("clearing save file")
if (FileAccess.file_exists(savePath)): DirAccess.remove_absolute(savePath) if (FileAccess.file_exists(savePath)): DirAccess.remove_absolute(savePath)

View File

@ -0,0 +1,4 @@
extends Node
func _ready():
print("user entered scene: ", get_tree().current_scene.name)

View File

@ -15,6 +15,8 @@ var hasFaded = false
func _ready(): func _ready():
mesh.set_surface_override_material(0, mat_brass) mesh.set_surface_override_material(0, mat_brass)
if (GlobalVariables.colorblind): mat_live.albedo_color = GlobalVariables.colorblind_color_live; mat_blank.albedo_color = GlobalVariables.colorblind_color_blank
else: mat_live.albedo_color = GlobalVariables.default_color_live; mat_blank.albedo_color = GlobalVariables.default_color_blank
func EjectShell(): func EjectShell():
shellSpawner.roundManager.playerData.stat_shellsEjected += 1 shellSpawner.roundManager.playerData.stat_shellsEjected += 1

View File

@ -13,6 +13,7 @@ func _ready():
func SetupShell(): func SetupShell():
var color_blue = Color(0, 0, 1) var color_blue = Color(0, 0, 1)
var color_red = Color(1, 0, 0) var color_red = Color(1, 0, 0)
if (GlobalVariables.colorblind): color_red = GlobalVariables.colorblind_color_live; color_blue = GlobalVariables.colorblind_color_blank
var shellState = shellSpawner.sequenceArray[0] var shellState = shellSpawner.sequenceArray[0]
if (shellState == "live"): if (shellState == "live"):
mesh.set_surface_override_material(1, mat_live) mesh.set_surface_override_material(1, mat_live)

View File

@ -60,11 +60,13 @@ func MainShellRoutine():
#DIALOGUE #DIALOGUE
var text_lives var text_lives
var text_blanks var text_blanks
if (temp_live == 1): text_lives = tr("LIVEROUND") if (temp_live == 1): text_lives = tr("LIVEROUND") % str(temp_live)
else: text_lives = tr("LIVEROUNDS") else: text_lives = tr("LIVEROUNDS") % str(temp_live)
if (temp_blank == 1): text_blanks = tr("BLANKROUND") if (temp_blank == 1): text_blanks = tr("BLANKROUND") % str(temp_blank)
else: text_blanks = tr("BLANKROUNDS") else: text_blanks = tr("BLANKROUNDS") % str(temp_blank)
var finalstring : String = str(temp_live) + " " + text_lives + " " + str(temp_blank) + " " + text_blanks var finalstring : String
#finalstring = str(temp_live) + " " + text_lives + " " + str(temp_blank) + " " + text_blanks
finalstring = text_lives + " " + text_blanks
var maindur = 1.3 var maindur = 1.3
if (roundManager.playerData.currentBatchIndex == 2): if (roundManager.playerData.currentBatchIndex == 2):
roundManager.playerData.skippingShellDescription = true roundManager.playerData.skippingShellDescription = true

10
StatueManager.gd Normal file
View File

@ -0,0 +1,10 @@
class_name Statue extends Node
@export var rm : RoundManager
@export var statue : Node3D
@export var cup : Node3D
func CheckStatus():
if (rm.playerData.playername == " vellon"):
cup.visible = false
statue.visible = true

View File

@ -9,6 +9,7 @@ var fs = false
func _ready(): func _ready():
if (isDeathScreen): if (isDeathScreen):
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 _unhandled_input(event): #func _unhandled_input(event):

View File

@ -44,4 +44,5 @@ func CheckExit():
exitAllowed = false exitAllowed = false
func ExitGame(): func ExitGame():
print("changing scene to: menu")
get_tree().change_scene_to_file("res://scenes/menu.tscn") get_tree().change_scene_to_file("res://scenes/menu.tscn")

4913
test.gd Normal file

File diff suppressed because it is too large Load Diff