parent
83102bea31
commit
a86f69ecf1
|
@ -13,8 +13,8 @@ func SendDialogue():
|
|||
if (len != 1):
|
||||
randindex = randi_range(1, len - 1)
|
||||
if(randindex == 8): randindex -= 1
|
||||
if (sequence[randindex] == "blank"): secondpart = tr("BLANKROUND")
|
||||
else: secondpart = tr("LIVEROUND")
|
||||
if (sequence[randindex] == "blank"): secondpart = tr("BLANKROUND") % ""
|
||||
else: secondpart = tr("LIVEROUND") % ""
|
||||
match (randindex):
|
||||
1:
|
||||
firstpart = tr("SEQUENCE2")
|
||||
|
|
|
@ -30,10 +30,10 @@ func _ready():
|
|||
func SetUI(state : bool):
|
||||
if (state):
|
||||
if (!is3D): ui.modulate.a = ui_opacity_active
|
||||
else: ui_3D.transparency = 0
|
||||
else: ui_3D.visible = true
|
||||
else:
|
||||
if (!is3D): ui.modulate.a = ui_opacity_inactive
|
||||
else: ui_3D.transparency = 1
|
||||
else: ui_3D.visible = false
|
||||
|
||||
func OnHover():
|
||||
if (isActive && mainActive):
|
||||
|
|
|
@ -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
|
|
@ -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
|
|
@ -230,7 +230,7 @@ func DealerChoice():
|
|||
if (dealerWantsToUse == "expired medicine"):
|
||||
var medicine_outcome = randf_range(0.0, 1.0)
|
||||
var dying
|
||||
if (medicine_outcome < .4): dying = false
|
||||
if (medicine_outcome < .5): dying = false
|
||||
else: dying = true
|
||||
medicine.dealerDying = dying
|
||||
returning = true
|
||||
|
|
|
@ -142,6 +142,7 @@ func MainDeathRoutine():
|
|||
if (rm.endscore != null):
|
||||
if (rm.endscore > 1000000): ach.UnlockAchievement("ach10")
|
||||
await get_tree().create_timer(.5, false).timeout
|
||||
print("changing scene to: death")
|
||||
get_tree().change_scene_to_file("res://scenes/death.tscn")
|
||||
return
|
||||
if (shotgunShooting.roundManager.wireIsCut_player):
|
||||
|
@ -150,8 +151,12 @@ func MainDeathRoutine():
|
|||
shotgunShooting.roundManager.playerData.playerEnteringFromDeath = true
|
||||
await(savefile.SaveGame())
|
||||
await get_tree().create_timer(.5, false).timeout
|
||||
if (!loadingHeaven): get_tree().change_scene_to_file("res://scenes/death.tscn")
|
||||
else: get_tree().change_scene_to_file("res://scenes/heaven.tscn")
|
||||
if (!loadingHeaven):
|
||||
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
|
||||
|
||||
func DisableSpeakers():
|
||||
|
|
18
Debugging.gd
18
Debugging.gd
|
@ -1,10 +1,12 @@
|
|||
class_name Debug extends Node
|
||||
|
||||
#@export var timescale : TimeScaleManager
|
||||
#func _unhandled_input(event):
|
||||
# if (event.is_action_pressed(",")):
|
||||
# Engine.time_scale = 1
|
||||
# timescale.moving = false
|
||||
# if (event.is_action_pressed(".")):
|
||||
# Engine.time_scale = 10
|
||||
# timescale.moving = false
|
||||
@export var debugging : bool
|
||||
@export var timescale : TimeScaleManager
|
||||
func _unhandled_input(event):
|
||||
if (debugging):
|
||||
if (event.is_action_pressed(",")):
|
||||
Engine.time_scale = 1
|
||||
timescale.moving = false
|
||||
if (event.is_action_pressed(".")):
|
||||
Engine.time_scale = 10
|
||||
timescale.moving = false
|
||||
|
|
|
@ -1,11 +1,14 @@
|
|||
class_name DecisionTextManager extends Node
|
||||
|
||||
@export var inter : InteractionManager
|
||||
@export var array_obj : Array[Node3D]
|
||||
@export var textArray : Array[TextInteraction]
|
||||
@export var colliderArray : Array[StaticBody3D]
|
||||
@export var animator : AnimationPlayer
|
||||
@export var uiParent : Control
|
||||
|
||||
func _ready():
|
||||
if (GlobalVariables.using_gl): for i in array_obj: i.visible = false
|
||||
for i in range(colliderArray.size()):
|
||||
colliderArray[i].collision_layer = 0
|
||||
colliderArray[i].collision_mask = 0
|
||||
|
@ -16,9 +19,13 @@ func SetUI(state : bool):
|
|||
colliderArray[i].collision_layer = 1
|
||||
colliderArray[i].collision_mask = 1
|
||||
animator.play("show text")
|
||||
if (GlobalVariables.using_gl): for i in array_obj: i.visible = true
|
||||
inter.fs_dec = false
|
||||
else:
|
||||
for i in range(colliderArray.size()):
|
||||
colliderArray[i].collision_layer = 0
|
||||
colliderArray[i].collision_mask = 0
|
||||
animator.play("hide text")
|
||||
uiParent.visible = false
|
||||
if (GlobalVariables.using_gl): for i in array_obj: i.visible = false
|
||||
inter.fs_dec = false
|
||||
|
|
|
@ -17,6 +17,7 @@ func UnlockRoutine():
|
|||
await get_tree().create_timer(4, false).timeout
|
||||
anim.play("fade")
|
||||
await get_tree().create_timer(1, false).timeout
|
||||
print("changing scene to: menu")
|
||||
get_tree().change_scene_to_file("res://scenes/menu.tscn")
|
||||
|
||||
func UnlockMode():
|
||||
|
|
|
@ -36,7 +36,7 @@ var waitingForInput = false
|
|||
# ExitGame()
|
||||
# waitingForInput = false
|
||||
|
||||
func _unhandled_key_input(event):
|
||||
func _unhandled_input(event):
|
||||
if (event.is_pressed()):
|
||||
if (waitingForInput):
|
||||
ExitGame()
|
||||
|
@ -100,6 +100,7 @@ func ExitGame():
|
|||
await get_tree().create_timer(4, false).timeout
|
||||
var unlocked = FileAccess.file_exists(unlocker.savepath)
|
||||
if (unlocked):
|
||||
print("changing scene to: menu")
|
||||
get_tree().change_scene_to_file("res://scenes/menu.tscn")
|
||||
return
|
||||
else:
|
||||
|
|
|
@ -1,3 +1,13 @@
|
|||
extends Node
|
||||
|
||||
var currentVersion = "v1.2.1 (STEAM)"
|
||||
var using_gl = 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)
|
||||
|
|
|
@ -45,6 +45,7 @@ func Button_Main(tag : String):
|
|||
await get_tree().create_timer(3.12, false).timeout
|
||||
match tag:
|
||||
"retry":
|
||||
print("changing scene to: death")
|
||||
get_tree().change_scene_to_file("res://scenes/death.tscn")
|
||||
"exit":
|
||||
get_tree().quit()
|
||||
|
|
|
@ -41,16 +41,21 @@ func CheckIfHovering():
|
|||
else:
|
||||
cursor.SetCursorImage("point")
|
||||
|
||||
var fs_dec = false
|
||||
func InteractWith(alias : String):
|
||||
match(alias):
|
||||
"shotgun":
|
||||
shotgun.GrabShotgun()
|
||||
"text dealer":
|
||||
shotgun.Shoot("dealer")
|
||||
decision.SetUI(false)
|
||||
if (!fs_dec):
|
||||
shotgun.Shoot("dealer")
|
||||
decision.SetUI(false)
|
||||
fs_dec = true
|
||||
"text you":
|
||||
shotgun.Shoot("self")
|
||||
decision.SetUI(false)
|
||||
if (!fs_dec):
|
||||
shotgun.Shoot("self")
|
||||
decision.SetUI(false)
|
||||
fs_dec = true
|
||||
"briefcase intake":
|
||||
itemManager.GrabItem()
|
||||
"item":
|
||||
|
|
|
@ -271,7 +271,9 @@ func RevertCRT():
|
|||
if (cursor.controller_active): btn_bathroomdoor.grab_focus()
|
||||
controller.previousFocus = btn_bathroomdoor
|
||||
|
||||
@export var statue : Statue
|
||||
func Interaction_BackroomDoor():
|
||||
statue.CheckStatus()
|
||||
roundManager.playerData.stat_doorsKicked += 1
|
||||
animator_camera.play("camera enter backroom")
|
||||
intbranch_backroomdoor.interactionAllowed = false
|
||||
|
@ -315,6 +317,8 @@ func KickDoorLobby():
|
|||
filter.BeginPan(filter.lowPassDefaultValue, filter.lowPassMaxValue)
|
||||
speaker_amb_restroom.stop()
|
||||
|
||||
@export var pipeline : PipelineManager
|
||||
func RestRoomIdle():
|
||||
pipeline.AdjustSettings(pipeline.scene)
|
||||
animator_camera.play("camera idle bathroom")
|
||||
pass
|
||||
|
|
|
@ -152,7 +152,7 @@ func BeginItemGrabbing():
|
|||
var stringIndex = roundManager.roundArray[roundManager.currentRound].numberOfItemsToGrab
|
||||
var string = stringNumberArray[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
|
||||
dialogue.ShowText_Forever(tr("MORE ITEMS"))
|
||||
await get_tree().create_timer(2.5, false).timeout
|
||||
|
@ -163,7 +163,7 @@ func BeginItemGrabbing():
|
|||
var stringIndex = roundManager.roundArray[roundManager.currentRound].numberOfItemsToGrab
|
||||
var string = stringNumberArray[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
|
||||
dialogue.HideText()
|
||||
roundManager.playerData.hasReadItemDistributionIntro2 = true
|
||||
|
@ -232,6 +232,8 @@ func GrabItem():
|
|||
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)
|
||||
|
||||
numberOfItemsGrabbed += 1
|
||||
|
@ -351,6 +353,10 @@ func GrabItems_Enemy():
|
|||
continue
|
||||
if (res.amount_dealer != res.amount_active):
|
||||
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 selectedItem = availableItemsToGrabArray_dealer[randindex]
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
extends Node
|
||||
|
||||
@export var isHeaven : bool = false
|
||||
@export var text_dealer : Label3D
|
||||
|
||||
func _ready():
|
||||
await get_tree().create_timer(1, false).timeout
|
||||
|
@ -11,6 +12,7 @@ func Prevent():
|
|||
if (!isHeaven):
|
||||
await get_tree().create_timer(1, false).timeout
|
||||
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:
|
||||
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 = "< >"
|
||||
|
|
|
@ -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
|
||||
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)
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -71,5 +71,5 @@ func Perms(d : float):
|
|||
|
||||
func GetFlip():
|
||||
var value = randf_range(0.0, 1.0)
|
||||
if (value < .4): return false
|
||||
if (value < .5): return false
|
||||
else: return true
|
||||
|
|
|
@ -21,6 +21,7 @@ class_name MenuManager extends Node
|
|||
@export var controller : ControllerManager
|
||||
@export var mouseblocker : Control
|
||||
@export var anim_creds : AnimationPlayer
|
||||
@export var version : Label
|
||||
|
||||
func _ready():
|
||||
Show("main")
|
||||
|
@ -47,6 +48,9 @@ func _ready():
|
|||
buttons_options[3].connect("is_pressed", SetWindowed)
|
||||
buttons_options[4].connect("is_pressed", ControllerEnable)
|
||||
buttons_options[5].connect("is_pressed", ControllerDisable)
|
||||
buttons_options[6].connect("is_pressed", ToggleColorblind)
|
||||
|
||||
version.text = GlobalVariables.currentVersion
|
||||
|
||||
Intro()
|
||||
|
||||
|
@ -128,6 +132,7 @@ func Show(what : String):
|
|||
controller.previousFocus = focus
|
||||
|
||||
func ReturnToLastScreen():
|
||||
print("return to last screen")
|
||||
if (currentScreen) == "sub options": lastScreen = "main"
|
||||
if (currentScreen) == "rebind controls": lastScreen = "sub options"
|
||||
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)
|
||||
savefile.ClearSave()
|
||||
await get_tree().create_timer(4, false).timeout
|
||||
print("changing scene to: main")
|
||||
get_tree().change_scene_to_file("res://scenes/main.tscn")
|
||||
|
||||
func Credits():
|
||||
|
@ -171,6 +177,8 @@ func ResetControls():
|
|||
optionmanager.ResetControls()
|
||||
ResetButtons()
|
||||
|
||||
func ToggleColorblind():
|
||||
optionmanager.ToggleColorblind()
|
||||
func DiscordLink():
|
||||
OS.shell_open("https://discord.gg/cr-channel-1158444754325999747")
|
||||
func RebindControls():
|
||||
|
|
|
@ -34,6 +34,7 @@ var defaultOption_inputmap_controller = {
|
|||
@export var button_fullscreen : ButtonClass
|
||||
@export var menu : MenuManager
|
||||
@export var ui_volume : Label
|
||||
@export var checkmark_colorblind : Checkmark
|
||||
|
||||
const savePath := "user://buckshotroulette_options_12.shell"
|
||||
var data = {}
|
||||
|
@ -44,8 +45,10 @@ var setting_volume = 1
|
|||
var setting_windowed = false
|
||||
var setting_language = "EN"
|
||||
var setting_controllerEnabled = false
|
||||
var setting_colorblind = false
|
||||
|
||||
func _ready():
|
||||
Printout()
|
||||
LoadSettings()
|
||||
if (!receivedFile):
|
||||
setting_windowed = defaultOption_windowed
|
||||
|
@ -58,6 +61,9 @@ func _ready():
|
|||
ApplySettings_language()
|
||||
ApplySettings_inputmap()
|
||||
|
||||
func Printout():
|
||||
print("user current version: ", GlobalVariables.currentVersion)
|
||||
|
||||
func Adjust(alias : String):
|
||||
match(alias):
|
||||
"increase":
|
||||
|
@ -89,6 +95,10 @@ func Adjust(alias : String):
|
|||
|
||||
if (alias != "increase" && alias != "decrease"): menu.ResetButtons()
|
||||
|
||||
func ToggleColorblind():
|
||||
setting_colorblind = !setting_colorblind
|
||||
checkmark_colorblind.UpdateCheckmark(setting_colorblind)
|
||||
ApplySettings_colorblind()
|
||||
|
||||
func AdjustLanguage(alias : String):
|
||||
setting_language = alias
|
||||
|
@ -177,6 +187,9 @@ func ApplySettings_inputmap():
|
|||
func ApplySettings_language():
|
||||
TranslationServer.set_locale(setting_language)
|
||||
|
||||
func ApplySettings_colorblind():
|
||||
GlobalVariables.colorblind = setting_colorblind
|
||||
|
||||
func SaveSettings():
|
||||
data = {
|
||||
#"has_read_introduction": roundManager.playerData.hasReadIntroduction,
|
||||
|
@ -185,15 +198,20 @@ func SaveSettings():
|
|||
"setting_language" : setting_language,
|
||||
"setting_controllerEnabled" : setting_controllerEnabled,
|
||||
"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)
|
||||
file.store_var(data)
|
||||
file.close()
|
||||
print("file closed")
|
||||
|
||||
var receivedFile = false
|
||||
func LoadSettings():
|
||||
if (FileAccess.file_exists(savePath)):
|
||||
print("settings file found, attempting to load settings: ")
|
||||
print("")
|
||||
var file = FileAccess.open(savePath, FileAccess.READ)
|
||||
data = file.get_var()
|
||||
setting_volume = data.setting_volume
|
||||
|
@ -202,11 +220,20 @@ func LoadSettings():
|
|||
setting_controllerEnabled = data.setting_controllerEnabled
|
||||
setting_inputmap_keyboard = data.setting_inputmap_keyboard
|
||||
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()
|
||||
print("---------------------------------")
|
||||
print("user settings: ", data)
|
||||
print("---------------------------------")
|
||||
print("settings file closed")
|
||||
setting = true
|
||||
ApplySettings_volume()
|
||||
ApplySettings_window()
|
||||
ApplySettings_language()
|
||||
ApplySettings_controller()
|
||||
ApplySettings_inputmap()
|
||||
ApplySettings_colorblind()
|
||||
receivedFile = true
|
||||
else: print("user does not have settings 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)
|
|
@ -2,9 +2,29 @@ class_name ResetManager extends Node
|
|||
|
||||
@export var save : SaveFileManager
|
||||
var fs = false
|
||||
var reset_pressed = false
|
||||
var reset_timer = 0.0
|
||||
|
||||
func _unhandled_input(event):
|
||||
if (event.is_action_pressed("reset") && !fs):
|
||||
save.ClearSave()
|
||||
get_tree().change_scene_to_file("res://scenes/death.tscn")
|
||||
fs = true
|
||||
if event.is_action_pressed("reset") && !fs:
|
||||
reset_timer = 0
|
||||
reset_pressed = 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
|
||||
|
|
|
@ -60,6 +60,7 @@ var trueDeathActive = false
|
|||
var playerCurrentTurnItemArray = []
|
||||
|
||||
func _ready():
|
||||
Engine.time_scale = 1
|
||||
HideDealer()
|
||||
#await get_tree().create_timer(.2, false).timeout
|
||||
pass
|
||||
|
@ -137,10 +138,12 @@ func ParseMainGameAmounts():
|
|||
for res in amounts.array_amounts:
|
||||
res.amount_active = res.amount_main
|
||||
|
||||
var curhealth = 0
|
||||
func GenerateRandomBatches():
|
||||
for b in batchArray:
|
||||
for i in range(b.roundArray.size()):
|
||||
b.roundArray[i].startingHealth = randi_range(2, 4)
|
||||
curhealth = b.roundArray[i].startingHealth
|
||||
|
||||
var total_shells = randi_range(2, 8)
|
||||
var amount_live = max(1, total_shells / 2)
|
||||
|
@ -165,6 +168,7 @@ func SetupRoundArray():
|
|||
pass
|
||||
pass
|
||||
|
||||
@export var statue : Statue
|
||||
#SHOW ROUND INDICATOR
|
||||
func RoundIndicator():
|
||||
roundIndicator.visible = false
|
||||
|
@ -172,6 +176,7 @@ func RoundIndicator():
|
|||
animator_roundIndicator.play("RESET")
|
||||
camera.BeginLerp("health counter")
|
||||
await get_tree().create_timer(.8, false).timeout
|
||||
statue.CheckStatus()
|
||||
var activePos = roundIndicatorPositions[roundArray[0].indicatorNumber]
|
||||
roundIndicator.transform.origin = activePos
|
||||
roundIndicatorParent.visible = true
|
||||
|
@ -337,6 +342,7 @@ func SetupDeskUI():
|
|||
deskUI_shotgun.visible = true
|
||||
if (roundArray[currentRound].usingItems):
|
||||
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()
|
||||
controller.previousFocus = deskUI_shotgun
|
||||
|
@ -367,7 +373,7 @@ var doubled = false
|
|||
|
||||
var lerpingscore = false
|
||||
var startscore
|
||||
var endscore
|
||||
var endscore = 0
|
||||
@export var ui_score : Label3D
|
||||
@export var ui_doubleornothing : Label3D
|
||||
@export var speaker_key : AudioStreamPlayer2D
|
||||
|
|
|
@ -12,6 +12,7 @@ func _ready():
|
|||
pass
|
||||
|
||||
func SaveGame():
|
||||
print("attempting to save game")
|
||||
data = {
|
||||
"has_read_introduction": roundManager.playerData.hasReadIntroduction,
|
||||
"has_read_item_swap_introduction": roundManager.playerData.hasReadItemSwapIntroduction,
|
||||
|
@ -39,9 +40,12 @@ func SaveGame():
|
|||
var file = FileAccess.open(savePath, FileAccess.WRITE)
|
||||
file.store_var(data)
|
||||
file.close()
|
||||
print("save file closed")
|
||||
print("user save file dictionary: ", data)
|
||||
|
||||
func LoadGame():
|
||||
if (FileAccess.file_exists(savePath)):
|
||||
print("attempting to load save file")
|
||||
var file = FileAccess.open(savePath, FileAccess.READ)
|
||||
data = file.get_var()
|
||||
roundManager.playerData.hasReadIntroduction = data.has_read_introduction
|
||||
|
@ -67,6 +71,10 @@ func LoadGame():
|
|||
roundManager.playerData.stat_cigSmoked = data.stat_cigSmoked
|
||||
roundManager.playerData.stat_beerDrank = data.stat_beerDrank
|
||||
file.close()
|
||||
print("closing save file")
|
||||
print("loaded data dictionary: ", data)
|
||||
else: print("user does not have save file")
|
||||
|
||||
func ClearSave():
|
||||
print("clearing save file")
|
||||
if (FileAccess.file_exists(savePath)): DirAccess.remove_absolute(savePath)
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
extends Node
|
||||
|
||||
func _ready():
|
||||
print("user entered scene: ", get_tree().current_scene.name)
|
|
@ -15,6 +15,8 @@ var hasFaded = false
|
|||
|
||||
func _ready():
|
||||
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():
|
||||
shellSpawner.roundManager.playerData.stat_shellsEjected += 1
|
||||
|
|
|
@ -13,6 +13,7 @@ func _ready():
|
|||
func SetupShell():
|
||||
var color_blue = Color(0, 0, 1)
|
||||
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]
|
||||
if (shellState == "live"):
|
||||
mesh.set_surface_override_material(1, mat_live)
|
||||
|
|
|
@ -60,11 +60,13 @@ func MainShellRoutine():
|
|||
#DIALOGUE
|
||||
var text_lives
|
||||
var text_blanks
|
||||
if (temp_live == 1): text_lives = tr("LIVEROUND")
|
||||
else: text_lives = tr("LIVEROUNDS")
|
||||
if (temp_blank == 1): text_blanks = tr("BLANKROUND")
|
||||
else: text_blanks = tr("BLANKROUNDS")
|
||||
var finalstring : String = str(temp_live) + " " + text_lives + " " + str(temp_blank) + " " + text_blanks
|
||||
if (temp_live == 1): text_lives = tr("LIVEROUND") % str(temp_live)
|
||||
else: text_lives = tr("LIVEROUNDS") % str(temp_live)
|
||||
if (temp_blank == 1): text_blanks = tr("BLANKROUND") % str(temp_blank)
|
||||
else: text_blanks = tr("BLANKROUNDS") % str(temp_blank)
|
||||
var finalstring : String
|
||||
#finalstring = str(temp_live) + " " + text_lives + " " + str(temp_blank) + " " + text_blanks
|
||||
finalstring = text_lives + " " + text_blanks
|
||||
var maindur = 1.3
|
||||
if (roundManager.playerData.currentBatchIndex == 2):
|
||||
roundManager.playerData.skippingShellDescription = true
|
||||
|
|
|
@ -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
|
|
@ -9,6 +9,7 @@ var fs = false
|
|||
|
||||
func _ready():
|
||||
if (isDeathScreen):
|
||||
print("changing scene to: main")
|
||||
get_tree().change_scene_to_file("res://scenes/main.tscn")
|
||||
|
||||
#func _unhandled_input(event):
|
||||
|
|
|
@ -44,4 +44,5 @@ func CheckExit():
|
|||
exitAllowed = false
|
||||
|
||||
func ExitGame():
|
||||
print("changing scene to: menu")
|
||||
get_tree().change_scene_to_file("res://scenes/menu.tscn")
|
||||
|
|
Loading…
Reference in New Issue