Initial Android commit

This commit is contained in:
OleSTEEP 2024-11-10 03:34:28 +03:00
commit 1e2b80c13d
8521 changed files with 231475 additions and 0 deletions

View file

@ -0,0 +1,137 @@
extends Node2D
enum CursorState{Normal, Walk, Talk, Press, Crash};
onready var root;
signal endOfChoice;
var localization = [];
var cursorStates = [];
var isHovering;
var setLabelsPosition:bool = true;
onready var arrowCursor = preload("res://resources/cursors/arrow2.webp");
onready var dialogCursor = preload("res://resources/cursors/dialog2.webp");
onready var zoomCursor = preload("res://resources/cursors/magnifier2.webp");
onready var walkCursor = preload("res://resources/cursors/man2.webp");
onready var crashCursor = preload("res://resources/cursors/crash_cursor.webp");
func _ready():
root = get_tree().root.get_node("Root");
SetCursorStates();
Localization();
SetLabels();
SetHover();
CheckForVariables();
func Localization():
pass
func SetCursorStates():
pass
func SetLabels():
var buttons = $SpriteButtons.get_children();
var labels = $Labels.get_children();
for i in labels.size():
var label = labels[i];
label.text = tr(localization[i]).trim_suffix(".");
if setLabelsPosition:
label.connect("resized", self, "labelResized", [label, buttons[i]]);
func labelResized(label, button):
var center = button.rect_position + button.rect_size * button.rect_scale / 2.0;
label.rect_position = center - label.rect_size / 2.0;
AdjustLabels();
func AdjustLabels():
pass
func SetHover():
var buttons = $SpriteButtons.get_children();
var labels = $Labels.get_children();
PreventCursorCrash();
for i in buttons.size():
var button = buttons[i];
button.connect("mouse_entered", self, "onButtonHoverOn_sprite", [button, labels[i], cursorStates[i]]);
button.connect("mouse_exited", self, "onButtonHoverOff_sprite", [button, labels[i]]);
func PreventCursorCrash():
for i in 5:
cursorStates.push_back(CursorState.Crash)
func onButtonHoverOn_sprite(button, label, cursorState):
if not (root.isMenuVisible or root.isSaveLoadVisible):
UpdateCursor(cursorState);
button.material.set_shader_param("mixing", 0.15);
label.visible = true;
isHovering = true;
func onButtonHoverOff_sprite(button, label):
if not (root.isMenuVisible or root.isSaveLoadVisible):
UpdateCursor(CursorState.Normal);
button.material.set_shader_param("mixing", 0.0);
label.visible = false;
isHovering = false;
func UpdateCursor(state:int):
match state:
CursorState.Normal:
Input.set_custom_mouse_cursor(arrowCursor)
CursorState.Talk:
Input.set_custom_mouse_cursor(dialogCursor, Input.CURSOR_ARROW, Vector2(19, 19))
CursorState.Walk:
Input.set_custom_mouse_cursor(walkCursor, Input.CURSOR_ARROW, Vector2(19, 19))
CursorState.Press:
Input.set_custom_mouse_cursor(zoomCursor, Input.CURSOR_ARROW, Vector2(19, 19))
CursorState.Crash:
Input.set_custom_mouse_cursor(crashCursor, Input.CURSOR_ARROW, Vector2(19, 19))
func CheckForVariables():
pass;
func End():
UpdateCursor(CursorState.Normal);
emit_signal("endOfChoice");
func CheckHover()->bool:
return not (get_tree().root.get_node("Root").isMenuVisible or get_tree().root.get_node("Root").isSaveLoadVisible)
var shaderValue = 0.0;
var tempDelta = 0.0;
var isRising;
func _process(delta):
if isHovering:
return ;
tempDelta += delta;
if tempDelta > 0.2:
tempDelta = 0;
if shaderValue <= - 0.05:
isRising = true
if shaderValue >= 0.13:
isRising = false;
if isRising:
shaderValue += 0.01;
else :
shaderValue -= 0.01;
var buttons = $SpriteButtons.get_children();
for i in buttons:
i.material.set_shader_param("mixing", shaderValue);
else :
tempDelta += delta;

View file

@ -0,0 +1,23 @@
extends "res://scripts/AlternativeChoices/AlternativeChoiceBase.gd"
func Localization():
localization = [""];
func SetCursorStates():
cursorStates = [CursorState.Press];
func CheckForVariables():
$Timer.start();
$PhonePlayer.play();
func _on_Orange_button_up():
if CheckHover():
$PhonePlayer.stop();
$Timer.stop();
Dialogic.set_variable("PreviousTimelineChoice", "answer");
End()
func _on_Timer_timeout():
$PhonePlayer.stop();
Dialogic.set_variable("PreviousTimelineChoice", "no_answer");
End();

View file

@ -0,0 +1,35 @@
extends "res://scripts/AlternativeChoices/AlternativeChoiceBase.gd"
func Localization():
localization = ["", "choice12.3", "choice21.1", "choice12.3"];
func SetCursorStates():
cursorStates = [CursorState.Walk, CursorState.Walk, CursorState.Walk, CursorState.Walk, ];
func AdjustLabels():
$Labels / LoungeLabel.rect_global_position.y = $Labels / LoungeLabel.rect_global_position.y - 10;
$Labels / GoBackLabel.rect_global_position.y = $Labels / GoBackLabel.rect_global_position.y - 25;
$Labels / GarageLabel.rect_global_position.y = $Labels / GarageLabel.rect_global_position.y - 25;
func _on_Door_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "25.fakedoor");
End()
func _on_GoBack_button_up():
if not CheckHover():return ;
if int(Dialogic.get_variable("Time")) >= 45:
Dialogic.set_variable("PreviousTimelineChoice", "25.time");
else :
Dialogic.set_variable("PreviousTimelineChoice", "25.2");
End()
func _on_Lounge_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "25.lounge");
End()
func _on_Garage_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "25.garage");
End()

View file

@ -0,0 +1,224 @@
extends "res://scripts/AlternativeChoices/AlternativeChoiceBase.gd"
var cursorRight = preload("res://resources/cursors/man_right.webp")
var cursorLeft = preload("res://resources/cursors/man_left.webp")
var movingLeft = false;
var movingRight = false;
const movingSpeed = 310;
const edgePosition = - 920;
func Localization():
localization = ["", "choice22.8", "", "", "", "", "", "", "", "", "choice22.4", "choice22.5", "choice22.6", ];
func AdjustLabels():
var goOutside = get_node("Labels/2");
goOutside.rect_global_position = Vector2(goOutside.rect_global_position.x - 10, goOutside.rect_global_position.y - 10);
get_node("Labels/11").rect_global_position.y = get_node("Labels/11").rect_global_position.y - 20;
get_node("Labels/12").rect_global_position.y = get_node("Labels/12").rect_global_position.y - 20;
get_node("Labels/13").rect_global_position.y = 950;
func SetCursorStates():
cursorStates = [CursorState.Walk, CursorState.Walk, CursorState.Talk, CursorState.Talk, CursorState.Talk, CursorState.Talk, CursorState.Talk, CursorState.Talk, CursorState.Talk, CursorState.Talk, CursorState.Walk, CursorState.Walk, CursorState.Walk, ];
func CheckForVariables():
get_node("SpriteButtons/Amanda").visible = s("Is_Pink_Dead") and s("Timeline121_a");
get_node("SpriteButtons/White").visible = s("Is_White_Dead")
get_node("SpriteButtons/Robert").visible = s("Is_Gray_Dead")
get_node("SpriteButtons/Red").visible = s("Is_Red_Dead")
get_node("SpriteButtons/Blue_M").visible = s("Is_Blue_M_Dead")
get_node("SpriteButtons/Black").visible = s("Is_Black_Dead")
get_node("SpriteButtons/Green").visible = s("Is_Green_Dead")
get_node("SpriteButtons/Dana").visible = s("Is_Purple_Dead")
if Dialogic.get_variable("LightsOn") == "0":
$SpriteButtons / Garage.texture_normal = load("res://resources/AlternativeChoices/Timeline_120/Door_night.webp");
var xPos = int(Dialogic.get_variable("PanoramaPosition"));
$SpriteButtons.position.x = xPos;
$Labels.position.x = xPos;
func s(variable:String)->bool:
return Dialogic.get_variable(variable) == "0";
func _on_1_button_up():
if not CheckHover():return ;
if s("Timeline121_a"):
Dialogic.set_variable("PreviousTimelineChoice", "121_a");
else :
Dialogic.set_variable("PreviousTimelineChoice", "girls");
End()
func _on_2_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "121");
End()
func _on_3_button_up():
if not CheckHover():return ;
if s("Timeline122"):
Dialogic.set_variable("PreviousTimelineChoice", "122");
else :
Dialogic.set_variable("PreviousTimelineChoice", "boys");
End()
func _on_4_button_up():
if not CheckHover():return ;
if s("Timeline123"):
Dialogic.set_variable("PreviousTimelineChoice", "123");
else :
Dialogic.set_variable("PreviousTimelineChoice", "boys");
End()
func _on_5_button_up():
if not CheckHover():return ;
if s("Timeline124"):
Dialogic.set_variable("PreviousTimelineChoice", "124");
else :
Dialogic.set_variable("PreviousTimelineChoice", "boys");
End()
func _on_6_button_up():
if not CheckHover():return ;
if s("Timeline125"):
Dialogic.set_variable("PreviousTimelineChoice", "125");
else :
Dialogic.set_variable("PreviousTimelineChoice", "boys");
End()
func _on_7_button_up():
if not CheckHover():return ;
if s("Timeline126"):
Dialogic.set_variable("PreviousTimelineChoice", "126");
else :
Dialogic.set_variable("PreviousTimelineChoice", "girls");
End()
func _on_8_button_up():
if not CheckHover():return ;
if s("Timeline127"):
Dialogic.set_variable("PreviousTimelineChoice", "127");
else :
Dialogic.set_variable("PreviousTimelineChoice", "girls");
End()
func _on_9_button_up():
if not CheckHover():return ;
if s("Timeline128"):
Dialogic.set_variable("PreviousTimelineChoice", "128");
else :
Dialogic.set_variable("PreviousTimelineChoice", "girls");
End()
func _on_Kitchen_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "120_r");
End()
func _on_Garage_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "120_h");
End()
func _on_13_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "stairs");
End()
func _on_Basement_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "120_basement");
End()
func _on_LeftMove_mouse_entered():
if get_tree().root.get_node("Root/Background/Panorama").position.x < 0:
Input.set_custom_mouse_cursor(cursorLeft)
movingLeft = true
$WalkingEffect.play()
func _on_LeftMove_mouse_exited():
Input.set_custom_mouse_cursor(arrowCursor)
movingLeft = false
Dialogic.set_variable("PanoramaPosition", get_tree().root.get_node("Root/Background/Panorama").position.x)
$WalkingEffect.stop()
func _on_RightMove_mouse_entered():
if get_tree().root.get_node("Root/Background/Panorama").position.x > edgePosition:
Input.set_custom_mouse_cursor(cursorRight, 0, Vector2(50, 0))
movingRight = true
$WalkingEffect.play()
func _on_RightMove_mouse_exited():
Input.set_custom_mouse_cursor(arrowCursor)
movingRight = false
Dialogic.set_variable("PanoramaPosition", get_tree().root.get_node("Root/Background/Panorama").position.x)
$WalkingEffect.stop()
func _process(delta):
if not get_tree().root.has_node("Root/Background/Panorama"):
return ;
if get_tree().root.get_node("Root/Background/Panorama").position.x == 0:
if $MovingControls / LeftMove.visible:
$MovingControls / LeftMove.visible = false;
_on_LeftMove_mouse_exited();
elif get_tree().root.get_node("Root/Background/Panorama").position.x == edgePosition:
if $MovingControls / RightMove.visible:
$MovingControls / RightMove.visible = false;
_on_RightMove_mouse_exited();
else :
if not $MovingControls / LeftMove.visible:
$MovingControls / LeftMove.visible = true
if not $MovingControls / RightMove.visible:
$MovingControls / RightMove.visible = true;
if movingLeft:
$SpriteButtons.position.x += delta * movingSpeed
$Labels.position.x += delta * movingSpeed
var back = get_tree().root.get_node("Root/Background/Panorama");
back.position.x += delta * movingSpeed
back.UpdateContainerSound(back.position.x);
if back.position.x > 0:
back.position.x = 0
$SpriteButtons.position.x = 0
$Labels.position.x = 0
movingLeft = false
elif movingRight:
$SpriteButtons.position.x -= delta * movingSpeed
$Labels.position.x -= delta * movingSpeed
var back = get_tree().root.get_node("Root/Background/Panorama");
back.position.x -= delta * movingSpeed
back.UpdateContainerSound(back.position.x);
if back.position.x < edgePosition:
back.position.x = edgePosition
$SpriteButtons.position.x = edgePosition
$Labels.position.x = edgePosition
movingRight = false
if isHovering:
return ;
tempDelta += delta;
if tempDelta > 0.2:
tempDelta = 0;
if shaderValue <= - 0.05:
isRising = true
if shaderValue >= 0.13:
isRising = false;
if isRising:
shaderValue += 0.01;
else :
shaderValue -= 0.01;
var buttons = $SpriteButtons.get_children();
for i in buttons:
i.material.set_shader_param("mixing", shaderValue);
else :
tempDelta += delta;

View file

@ -0,0 +1,15 @@
extends "res://scripts/AlternativeChoices/AlternativeChoiceBase.gd"
func Localization():
localization = ["choice21.8"]
func SetCursorStates():
cursorStates = [CursorState.Walk, ];
func AdjustLabels():
get_node("Labels/1").rect_global_position.y = 140;
func _on_Back_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "back");
End()

View file

@ -0,0 +1,35 @@
extends "res://scripts/AlternativeChoices/AlternativeChoiceBase.gd"
func Localization():
localization = ["", "choice21.1", "choice12.3", ""]
func SetCursorStates():
cursorStates = [CursorState.Walk, CursorState.Walk, CursorState.Walk, CursorState.Walk];
func CheckForVariables():
if Dialogic.get_variable("LightsOn") == "0":
$SpriteButtons / Door.texture_normal = load("res://resources/AlternativeChoices/Timeline_32/door_night_lightsOff.webp");
func AdjustLabels():
$Labels / Arrow.rect_global_position.y = 625;
$Labels / Arrow2.rect_global_position.y = 675;
func _on_Door_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "120_w_inside");
End()
func _on_ArrowSmoking_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "120_w_smoking");
End()
func _on_ArrowGarage_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "120_w_garage");
End()
func _on_LightHouse_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "120_w_lighthouse");
End()

View file

@ -0,0 +1,35 @@
extends "res://scripts/AlternativeChoices/AlternativeChoiceBase.gd"
func Localization():
localization = ["choice21.9", "choice22.1", "", "choice22.11"]
func SetCursorStates():
cursorStates = [CursorState.Walk, CursorState.Walk, CursorState.Talk, CursorState.Press, ];
func AdjustLabels():
$Labels / ArrowLabel.rect_global_position = Vector2(10, 600);
$Labels / ArrowLabel2.rect_global_position.y = 600;
func CheckForVariables():
$SpriteButtons / Blue.visible = Dialogic.get_variable("Timeline121") == "0" and Dialogic.get_variable("Killer") != "Blue";
$SpriteButtons / Body.visible = Dialogic.get_variable("Timeline106") == "0";
func _on_ArrowFront_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "120_w_front");
End()
func _on_ArrowGarage_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "120_w_garage");
End()
func _on_Blue_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "120_smoking_blue");
End()
func _on_Body_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "120_smoking_body");
End()

View file

@ -0,0 +1,174 @@
extends "res://scripts/AlternativeChoices/AlternativeChoiceBase.gd"
var cursorRight = preload("res://resources/cursors/man_right.webp")
var cursorLeft = preload("res://resources/cursors/man_left.webp")
var movingLeft = false;
var movingRight = false;
const movingSpeed = 310;
const edgePosition = - 920;
func Localization():
localization = ["", "", "", "choice22.8", "choice22.6", "choice22.5", "choice22.4"];
func SetCursorStates():
cursorStates = [CursorState.Walk, CursorState.Talk, CursorState.Talk, CursorState.Walk, CursorState.Walk, CursorState.Walk, CursorState.Walk, ];
func AdjustLabels():
var goOutside = get_node("Labels/4");
goOutside.rect_global_position = Vector2(goOutside.rect_global_position.x - 10, goOutside.rect_global_position.y - 10);
get_node("Labels/5").rect_global_position.y = get_node("Labels/5").rect_global_position.y - 35;
get_node("Labels/6").rect_global_position.y = get_node("Labels/6").rect_global_position.y - 20;
get_node("Labels/7").rect_global_position.y = get_node("Labels/7").rect_global_position.y - 20;
func CheckForVariables():
get_node("SpriteButtons/Red").visible = Dialogic.get_variable("Is_Red_Dead") == "0";
get_node("SpriteButtons/White").visible = Dialogic.get_variable("Is_White_Dead") == "0";
if Dialogic.get_variable("LightsOn") == "0":
$SpriteButtons / Garage.texture_normal = load("res://resources/AlternativeChoices/Timeline_120/Door_night.webp");
var xPos = int(Dialogic.get_variable("PanoramaPosition"));
$SpriteButtons.position.x = xPos;
$Labels.position.x = xPos;
func s(variable:String)->bool:
return Dialogic.get_variable(variable) == "0";
func _on_2_button_up():
if not CheckHover():return ;
if Dialogic.get_variable("Timeline144") == "0":
Dialogic.set_variable("PreviousTimelineChoice", "144");
else :
Dialogic.set_variable("PreviousTimelineChoice", "boys");
End()
func _on_4_button_up():
if not CheckHover():return ;
if Dialogic.get_variable("Timeline142") == "0":
Dialogic.set_variable("PreviousTimelineChoice", "142");
else :
Dialogic.set_variable("PreviousTimelineChoice", "boys");
End()
func _on_15_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "141");
End()
func _on_Stairs_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "2nd_floor");
End()
func _on_Garage_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "142_h");
End()
func _on_Basement_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "143");
End()
func _on_Kitchen_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "149");
End()
func _on_LeftMove_mouse_entered():
if get_tree().root.get_node("Root/Background/Panorama").position.x < 0:
Input.set_custom_mouse_cursor(cursorLeft)
movingLeft = true
$WalkingEffect.play()
func _on_LeftMove_mouse_exited():
Input.set_custom_mouse_cursor(arrowCursor)
movingLeft = false
Dialogic.set_variable("PanoramaPosition", get_tree().root.get_node("Root/Background/Panorama").position.x)
$WalkingEffect.stop()
func _on_RightMove_mouse_entered():
if get_tree().root.get_node("Root/Background/Panorama").position.x > edgePosition:
Input.set_custom_mouse_cursor(cursorRight, 0, Vector2(50, 0))
movingRight = true
$WalkingEffect.play()
func _on_RightMove_mouse_exited():
Input.set_custom_mouse_cursor(arrowCursor)
movingRight = false
Dialogic.set_variable("PanoramaPosition", get_tree().root.get_node("Root/Background/Panorama").position.x)
$WalkingEffect.stop()
func _process(delta):
if not get_tree().root.has_node("Root/Background/Panorama"):
return ;
if get_tree().root.get_node("Root/Background/Panorama").position.x == 0:
if $MovingControls / LeftMove.visible:
$MovingControls / LeftMove.visible = false;
_on_LeftMove_mouse_exited();
elif get_tree().root.get_node("Root/Background/Panorama").position.x == edgePosition:
if $MovingControls / RightMove.visible:
$MovingControls / RightMove.visible = false;
_on_RightMove_mouse_exited();
else :
if not $MovingControls / LeftMove.visible:
$MovingControls / LeftMove.visible = true
if not $MovingControls / RightMove.visible:
$MovingControls / RightMove.visible = true;
if movingLeft:
$SpriteButtons.position.x += delta * movingSpeed
$Labels.position.x += delta * movingSpeed
var back = get_tree().root.get_node("Root/Background/Panorama");
back.position.x += delta * movingSpeed
back.UpdateContainerSound(back.position.x);
if back.position.x > 0:
back.position.x = 0
$SpriteButtons.position.x = 0
$Labels.position.x = 0
movingLeft = false
elif movingRight:
$SpriteButtons.position.x -= delta * movingSpeed
$Labels.position.x -= delta * movingSpeed
var back = get_tree().root.get_node("Root/Background/Panorama");
back.position.x -= delta * movingSpeed
back.UpdateContainerSound(back.position.x);
if back.position.x < edgePosition:
back.position.x = edgePosition
$SpriteButtons.position.x = edgePosition
$Labels.position.x = edgePosition
movingRight = false
if isHovering:
return ;
tempDelta += delta;
if tempDelta > 0.2:
tempDelta = 0;
if shaderValue <= - 0.05:
isRising = true
if shaderValue >= 0.13:
isRising = false;
if isRising:
shaderValue += 0.01;
else :
shaderValue -= 0.01;
var buttons = $SpriteButtons.get_children();
for i in buttons:
i.material.set_shader_param("mixing", shaderValue);
else :
tempDelta += delta;

View file

@ -0,0 +1,21 @@
extends "res://scripts/AlternativeChoices/AlternativeChoiceBase.gd"
func Localization():
localization = ["choice21.2", "choice22.9"];
func SetCursorStates():
cursorStates = [CursorState.Walk, CursorState.Walk];
func AdjustLabels():
$Labels / a1.rect_global_position.y = 450;
$Labels / a2.rect_global_position.y = 794;
func _on_Arrow_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "140_lighthouse_back");
End()
func _on_Behind_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "140_lighthouse_behind");
End()

View file

@ -0,0 +1,23 @@
extends "res://scripts/AlternativeChoices/AlternativeChoiceBase.gd"
func Localization():
localization = ["choice21.2", "choice22.10"];
func SetCursorStates():
cursorStates = [CursorState.Walk, CursorState.Press];
func CheckForVariables():
pass;
func AdjustLabels():
$Labels / a1.rect_global_position.y = $Labels / a1.rect_global_position.y - 40;
func _on_Arrow_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "140_lighthouse_back");
End()
func _on_Cliff_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "140_lighthouse_back_cliff");
End()

View file

@ -0,0 +1,38 @@
extends "res://scripts/AlternativeChoices/AlternativeChoiceBase.gd"
func Localization():
localization = ["choice21.9", "choice22.1", "", "choice22.11"]
func AdjustLabels():
$Labels / ArrowLabel.rect_global_position = Vector2(10, 600);
$Labels / ArrowLabel2.rect_global_position.y = 600;
func SetCursorStates():
cursorStates = [CursorState.Walk, CursorState.Walk, CursorState.Talk, CursorState.Press, ];
func CheckForVariables():
$SpriteButtons / Blue.visible = Dialogic.get_variable("Timeline141") == "0" and Dialogic.get_variable("Killer") != "Blue";
$SpriteButtons / Body.visible = Dialogic.get_variable("Timeline106") == "0";
func _on_ArrowFront_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "front");
End()
func _on_ArrowGarage_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "garage");
End()
func _on_Blue_button_up():
if not CheckHover():return ;
if Dialogic.get_variable("Timeline141") == "1":
Dialogic.set_variable("PreviousTimelineChoice", "141_2");
else :
Dialogic.set_variable("PreviousTimelineChoice", "141_1");
End()
func _on_Body_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "140_smoking_body");
End()

View file

@ -0,0 +1,108 @@
extends "res://scripts/AlternativeChoices/AlternativeChoiceBase.gd"
func Localization():
localization = [tr("ui_sit_near_justin"),
tr("ui_sit_near_robert"),
tr("ui_sit_near_amanda"),
tr("ui_sit_near_henry"),
tr("ui_sit_near_renata"),
tr("ui_sit_near_linda"),
tr("ui_sit_near_alexander"),
tr("ui_sit_near_martin"),
tr("ui_sit_near_emilia"),
tr("ui_sit_near_dana"),
tr("ui_sit_near_agatha")];
func SetCursorStates():
cursorStates = [];
for i in range(0, 11):
cursorStates.push_back(CursorState.Talk);
func CheckForVariables():
$SpriteButtons / White.visible = Dialogic.get_variable("Is_White_Dead") == "0";
$SpriteButtons / Gray.visible = Dialogic.get_variable("Is_Gray_Dead") == "0";
$SpriteButtons / Pink.visible = Dialogic.get_variable("Is_Pink_Dead") == "0";
$SpriteButtons / Yellow.visible = Dialogic.get_variable("Is_Yellow_Dead") == "0";
$SpriteButtons / Orange.visible = Dialogic.get_variable("Is_Orange_Dead") == "0";
$SpriteButtons / Black.visible = Dialogic.get_variable("Is_Black_Dead") == "0";
$SpriteButtons / Red.visible = Dialogic.get_variable("Is_Red_Dead") == "0";
$SpriteButtons / Blue_M.visible = Dialogic.get_variable("Is_Blue_M_Dead") == "0";
$SpriteButtons / Blue_F.visible = Dialogic.get_variable("Is_Blue_F_Dead") == "0";
$SpriteButtons / Purple.visible = Dialogic.get_variable("Is_Purple_Dead") == "0";
$SpriteButtons / Green.visible = Dialogic.get_variable("Is_Green_Dead") == "0";
if not $SpriteButtons / Blue_M.visible:
return
if Dialogic.get_variable("SleepingBlue") == "1":
$SpriteButtons / Blue_F.texture_normal = load("res://resources/AlternativeChoices/Timeline_157_1/Blue_F_sleeping.webp")
$SpriteButtons / Blue_F.rect_position = Vector2(497, 286);
func AdjustLabels():
pass;
func _on_White_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "boys");
End()
func _on_Gray_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "boys");
End()
func _on_Pink_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "girls");
End()
func _on_Yellow_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "boys");
End()
func _on_Orange_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "boys");
End()
func _on_Black_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "girls");
End()
func _on_Red_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "boys");
End()
func _on_Blue_M_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "girls");
End()
func _on_Blue_F_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "girls");
End()
func _on_Purple_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "girls");
End()
func _on_Green_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "boys");
End()

View file

@ -0,0 +1,59 @@
extends "res://scripts/AlternativeChoices/AlternativeChoiceBase.gd"
func Localization():
var res = ["choice3024.1", "choice3024.2", "choice3024.3"];
for i in res.size():
localization.push_back(str("#", i + 1, " ", tr(res[i])));
func SetCursorStates():
cursorStates = [CursorState.Talk, CursorState.Talk, CursorState.Talk, ];
func CheckForVariables():
if Dialogic.get_variable("Is_Red_Dead") == "0":
$SpriteButtons / Center.texture_normal = load("res://resources/AlternativeChoices/Timeline_165/red.webp");
$SpriteButtons / Center.texture_click_mask = load("res://resources/AlternativeChoices/Timeline_165/red_mask.webp");
$SpriteButtons / Center.rect_size = Vector2(595, 43);
$SpriteButtons / Center.rect_size = Vector2(0.48, 0.48)
$SpriteButtons / Left.disabled = true;
$SpriteButtons / Center.disabled = true;
$SpriteButtons / Right.disabled = true;
$WaitTimer.start(1);
func _on_WaitTimer_timeout():
$SpriteButtons / Left.disabled = false;
$SpriteButtons / Center.disabled = false;
$SpriteButtons / Right.disabled = false;
func AdjustLabels():
$Labels / a1.rect_position = Vector2(20, 700);
$Labels / a2.rect_position = Vector2(645, 527);
$Labels / a3.rect_position = Vector2(1380, 620);
func _on_Left_button_up():
if not CheckHover():return ;
if Dialogic.get_variable("Killer") == "Pink":
Dialogic.set_variable("PreviousTimelineChoice", "167");
else :
Dialogic.set_variable("PreviousTimelineChoice", "173");
End()
func _on_Center_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "174");
End()
func _on_Right_button_up():
if not CheckHover():return ;
if Dialogic.get_variable("Killer") == "Blue":
Dialogic.set_variable("PreviousTimelineChoice", "167");
else :
Dialogic.set_variable("PreviousTimelineChoice", "173");
End()

View file

@ -0,0 +1,22 @@
extends "res://scripts/AlternativeChoices/AlternativeChoiceBase.gd"
func Localization():
localization = ["ui_walk", "ui_walk"]
func SetCursorStates():
setLabelsPosition = false;
cursorStates = [CursorState.Walk, CursorState.Walk];
func AdjustLabels():
pass
func _on_Left_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "backward");
End()
func _on_Right_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "forward");
End()

View file

@ -0,0 +1,22 @@
extends "res://scripts/AlternativeChoices/AlternativeChoiceBase.gd"
func Localization():
localization = ["ui_walk", "ui_walk"]
func SetCursorStates():
setLabelsPosition = false;
cursorStates = [CursorState.Walk, CursorState.Walk];
func AdjustLabels():
pass
func _on_Left_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "forward");
End()
func _on_Right_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "backward");
End()

View file

@ -0,0 +1,22 @@
extends "res://scripts/AlternativeChoices/AlternativeChoiceBase.gd"
func Localization():
localization = ["ui_walk", "ui_walk"]
func SetCursorStates():
setLabelsPosition = false;
cursorStates = [CursorState.Walk, CursorState.Walk, CursorState.Walk, ];
func AdjustLabels():
pass
func _on_Left_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "backward");
End()
func _on_Right_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "forward");
End()

View file

@ -0,0 +1,27 @@
extends "res://scripts/AlternativeChoices/AlternativeChoiceBase.gd"
func Localization():
localization = ["", "", "", ""];
func SetCursorStates():
cursorStates = [CursorState.Talk, CursorState.Talk, CursorState.Press, CursorState.Normal];
func _on_Orange_button_up():
if CheckHover():
Dialogic.set_variable("PreviousTimelineChoice", "6.1");
End()
func _on_Yellow_button_up():
if CheckHover():
Dialogic.set_variable("PreviousTimelineChoice", "6.2");
End()
func _on_Sofa_button_up():
if CheckHover():
Dialogic.set_variable("PreviousTimelineChoice", "6.3");
End()
func _on_Oldman_button_up():
if CheckHover():
Dialogic.set_variable("PreviousTimelineChoice", "oldman");
End()

View file

@ -0,0 +1,47 @@
extends "res://scripts/AlternativeChoices/AlternativeChoiceBase.gd"
func Localization():
localization = ["choice21.7", "", "choice21.1", "choice21.4", "choice21.5", "choice21.6"];
func AdjustLabels():
$Labels / a1.rect_global_position.y = $Labels / a1.rect_global_position.y - 12;
$Labels / a3.rect_global_position.y = $Labels / a3.rect_global_position.y - 13;
$Labels / a5.rect_global_position.y = 920;
$Labels / a6.rect_global_position.y = $Labels / a6.rect_global_position.y - 12;
func SetCursorStates():
cursorStates = [CursorState.Walk, CursorState.Walk, CursorState.Walk, CursorState.Walk, CursorState.Walk, CursorState.Walk, ];
func CheckForVariables():
if Dialogic.get_variable("LightsOn") == "0":
$SpriteButtons / GoBack.texture_normal = load("res://resources/AlternativeChoices/Timeline_32/door_night_lightsOff.webp");
func _on_Parking_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "190.4");
End()
func _on_GoBack_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "190.6");
End()
func _on_Smoking_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "190.2");
End()
func _on_LightHouse_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "190.3");
End()
func _on_Pristan_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "190.5");
End()
func _on_Ovrag_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "190.1");
End()

View file

@ -0,0 +1,33 @@
extends "res://scripts/AlternativeChoices/AlternativeChoiceBase.gd"
func Localization():
localization = ["", "", "", ""];
func SetCursorStates():
cursorStates = [CursorState.Talk, CursorState.Talk, CursorState.Press, CursorState.Walk];
func _on_Orange_button_up():
if not CheckHover():return ;
if Dialogic.get_variable("Talked_to_Orange") == "0":
Dialogic.set_variable("PreviousTimelineChoice", "8.4");
else :
Dialogic.set_variable("PreviousTimelineChoice", "8.orange");
End()
func _on_Yellow_button_up():
if not CheckHover():return ;
if Dialogic.get_variable("Talked_to_Yellow") == "0":
Dialogic.set_variable("PreviousTimelineChoice", "8.2");
else :
Dialogic.set_variable("PreviousTimelineChoice", "8.yellow");
End()
func _on_Sofa_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "8.3");
End()
func _on_Door_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "8.1");
End()

View file

@ -0,0 +1,67 @@
extends "res://scripts/AlternativeChoices/AlternativeChoiceBase.gd"
func Localization():
localization = ["choice12.3", "choice12.7", "choice12.3", "", "choice12.1", "", ""];
func SetCursorStates():
cursorStates = [CursorState.Walk, CursorState.Walk, CursorState.Walk, CursorState.Walk, CursorState.Walk, CursorState.Talk, CursorState.Walk];
func CheckForVariables():
var time = int(Dialogic.get_variable("Time"));
if time >= 45:
var array = [$SpriteButtons / White, $SpriteButtons / LightHouse, $SpriteButtons / Around];
for i in array:
i.visible = false;
func AdjustLabels():
$Labels / a1.rect_global_position = Vector2(12, 675);
$Labels / a2.rect_global_position.y = 935;
$Labels / AroundLabel.rect_global_position.y = 625;
$Labels / a5.rect_global_position.y = 730;
func _on_a1_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "walk_garage");
End()
func _on_a2_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "walk_sarai");
End()
func _on_Around_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "12.3");
End()
func _on_LightHouse_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "walk_mayak");
End()
func _on_a5_button_up():
if not CheckHover():return ;
if Dialogic.get_variable("Talked_to_Gray") == "0":
Dialogic.set_variable("PreviousTimelineChoice", "12.1");
else :
Dialogic.set_variable("PreviousTimelineChoice", "12.gray");
End()
func _on_White_button_up():
if not CheckHover():return ;
if Dialogic.get_variable("Talked_to_White") == "0":
Dialogic.set_variable("PreviousTimelineChoice", "12.2");
else :
Dialogic.set_variable("PreviousTimelineChoice", "12.white");
End()
func _on_Inside_button_up():
if not CheckHover():return ;
var time = int(Dialogic.get_variable("Time"));
if time < 45:
Dialogic.set_variable("PreviousTimelineChoice", "12.sofa");
else :
Dialogic.set_variable("PreviousTimelineChoice", "12.4");
End()

View file

@ -0,0 +1,28 @@
extends "res://scripts/AlternativeChoices/AlternativeChoiceBase.gd"
func Localization():
localization = ["", "choice15.3", ""];
func SetCursorStates():
cursorStates = [CursorState.Walk, CursorState.Walk, CursorState.Press];
func AdjustLabels():
$Labels / a2.rect_global_position.y = $Labels / a2.rect_global_position.y - 25;
func CheckForVariables():
$SpriteButtons / a2.visible = int(Dialogic.get_variable("Time")) < 45;
func _on_a1_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "back");
End()
func _on_a2_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "smoking");
End()
func _on_a3_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "text");
End()

View file

@ -0,0 +1,32 @@
extends "res://scripts/AlternativeChoices/AlternativeChoiceBase.gd"
func Localization():
localization = ["choice21.2", "", "choice22.9"];
func SetCursorStates():
cursorStates = [CursorState.Walk, CursorState.Talk, CursorState.Walk];
func CheckForVariables():
if Dialogic.get_variable("TwinsNPC") == "dog_show":
$SpriteButtons / Lady.visible = true;
func AdjustLabels():
$Labels / a1.rect_global_position.y = 450;
$Labels / a3.rect_global_position.y = 794;
func _on_Arrow_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "back");
End()
func _on_Lady_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "lady");
Dialogic.set_variable("TwinsNPC", "");
End()
func _on_Behind_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "behind");
End()

View file

@ -0,0 +1,20 @@
extends "res://scripts/AlternativeChoices/AlternativeChoiceBase.gd"
func Localization():
localization = ["choice21.2"];
func SetCursorStates():
cursorStates = [CursorState.Walk];
func CheckForVariables():
if Dialogic.get_variable("TwinsNPC") == "dog":
Dialogic.set_variable("TwinsNPC", "dog_show");
func AdjustLabels():
$Labels / a1.rect_global_position.y = $Labels / a1.rect_global_position.y - 40;
func _on_Arrow_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "back");
End()

View file

@ -0,0 +1,36 @@
extends "res://scripts/AlternativeChoices/AlternativeChoiceBase.gd"
func Localization():
localization = ["choice21.2", "", "", "", ""];
func SetCursorStates():
setLabelsPosition = false;
cursorStates = [CursorState.Walk, CursorState.Talk, CursorState.Press, CursorState.Press, CursorState.Press, ];
func CheckForVariables():
if Dialogic.get_variable("TwinsNPC") == "fish":
$SpriteButtons / Fisher.visible = true;
func _on_Arrow_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "back");
End()
func _on_Fisher_button_up():
if not CheckHover():return ;
if Dialogic.get_variable("VisitedFisher") == "0":
Dialogic.set_variable("PreviousTimelineChoice", "ribak");
else :
Dialogic.set_variable("PreviousTimelineChoice", "ribak_text");
End()
func _on_Yacht_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "yacht");
End()
func _on_Boat_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "lodka");
End()

View file

@ -0,0 +1,24 @@
extends "res://scripts/AlternativeChoices/AlternativeChoiceBase.gd"
func Localization():
localization = ["choice21.5", "", "choice22.7"];
func SetCursorStates():
setLabelsPosition = false;
cursorStates = [CursorState.Walk, CursorState.Press, CursorState.Walk, ];
func _on_a1_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "walk_pristan");
End()
func _on_door_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "door");
End()
func _on_a3_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "back");
End()

View file

@ -0,0 +1,35 @@
extends "res://scripts/AlternativeChoices/AlternativeChoiceBase.gd"
func Localization():
localization = ["", "", "", ""];
func SetCursorStates():
cursorStates = [CursorState.Talk, CursorState.Talk, CursorState.Press, CursorState.Walk, ];
func _on_Orange_button_up():
if not CheckHover():return ;
if Dialogic.get_variable("Talked_to_Orange") == "0":
Dialogic.set_variable("PreviousTimelineChoice", "13.4");
else :
Dialogic.set_variable("PreviousTimelineChoice", "13.orange");
End()
func _on_Yellow_button_up():
if not CheckHover():return ;
if Dialogic.get_variable("Talked_to_Yellow") == "0":
Dialogic.set_variable("PreviousTimelineChoice", "13.3");
else :
Dialogic.set_variable("PreviousTimelineChoice", "13.yellow");
End()
func _on_Sofa_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "13.2");
End()
func _on_Door_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "13.1");
End()

View file

@ -0,0 +1,19 @@
extends "res://scripts/AlternativeChoices/AlternativeChoiceBase.gd"
func Localization():
localization = ["choice21.2"];
func SetCursorStates():
cursorStates = [CursorState.Walk, ];
func AdjustLabels():
$Labels / Back.rect_global_position.y = 500;
func _on_Back_button_up():
if not CheckHover():return ;
var time = int(Dialogic.get_variable("Time"));
if time >= 45:
Dialogic.set_variable("PreviousTimelineChoice", "20.time");
else :
Dialogic.set_variable("PreviousTimelineChoice", "20.1");
End()

View file

@ -0,0 +1,35 @@
extends "res://scripts/AlternativeChoices/AlternativeChoiceBase.gd"
func Localization():
localization = ["choice21.1", "choice12.3", "", "choice12.3"];
func SetCursorStates():
cursorStates = [CursorState.Walk, CursorState.Walk, CursorState.Walk, CursorState.Walk, ];
func AdjustLabels():
$Labels / LoungeLabel.rect_global_position.y = $Labels / LoungeLabel.rect_global_position.y - 10;
$Labels / GoBackLabel.rect_global_position.y = $Labels / GoBackLabel.rect_global_position.y - 25;
$Labels / GarageLabel.rect_global_position.y = $Labels / GarageLabel.rect_global_position.y - 25;
func _on_Lounge_button_up():
if not CheckHover():return ;
if int(Dialogic.get_variable("Talked_to_Blue_and_Red")) == 1:
Dialogic.set_variable("PreviousTimelineChoice", "21.lounge");
else :
Dialogic.set_variable("PreviousTimelineChoice", "21.1");
End()
func _on_GoBack_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "21.2");
End()
func _on_Door_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "21.fakedoor");
End()
func _on_Garage_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "21.garage");
End()

View file

@ -0,0 +1,33 @@
extends "res://scripts/AlternativeChoices/AlternativeChoiceBase.gd"
func Localization():
localization = ["", "", "", ""];
func SetCursorStates():
cursorStates = [CursorState.Talk, CursorState.Talk, CursorState.Press, CursorState.Walk, ];
func _on_Orange_button_up():
if not CheckHover():return ;
if Dialogic.get_variable("Talked_to_Orange") == "0":
Dialogic.set_variable("PreviousTimelineChoice", "127.3");
else :
Dialogic.set_variable("PreviousTimelineChoice", "127.orange");
End()
func _on_Yellow_button_up():
if not CheckHover():return ;
if Dialogic.get_variable("Talked_to_Yellow") == "0":
Dialogic.set_variable("PreviousTimelineChoice", "127.2");
else :
Dialogic.set_variable("PreviousTimelineChoice", "127.yellow");
End()
func _on_Sofa_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "127.1");
End()
func _on_Door_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "127.4");
End()

View file

@ -0,0 +1,30 @@
extends "res://scripts/AlternativeChoices/AlternativeChoiceBase.gd"
func Localization():
localization = ["", "choice22.3", ""]
func AdjustLabels():
$Labels / Back.rect_global_position.y = $Labels / Back.rect_global_position.y - 35;
$Labels / Back.rect_global_position.x = $Labels / Back.rect_global_position.x + 20;
func SetCursorStates():
cursorStates = [CursorState.Talk, CursorState.Walk, CursorState.Press];
func _on_Orange_button_up():
if not CheckHover():return ;
if Dialogic.get_variable("129") == "1":
Dialogic.set_variable("PreviousTimelineChoice", "129.2");
else :
Dialogic.set_variable("PreviousTimelineChoice", "129.1");
End()
func _on_Knife_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "129_knife");
End()
func _on_Arrow_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "129_back");
End()

View file

@ -0,0 +1,34 @@
extends "res://scripts/AlternativeChoices/AlternativeChoiceBase.gd"
func Localization():
localization = ["", "choice22.3", "choice21.1", "choice21.9"]
func SetCursorStates():
cursorStates = [CursorState.Talk, CursorState.Walk, CursorState.Walk, CursorState.Walk, ];
func AdjustLabels():
$Labels / a1.rect_global_position = Vector2(10, 605);
$Labels / a2.rect_global_position.y = 605;
func _on_Yellow_button_up():
if not CheckHover():return ;
if Dialogic.get_variable("130") == "1":
Dialogic.set_variable("PreviousTimelineChoice", "130.2");
else :
Dialogic.set_variable("PreviousTimelineChoice", "130.1");
End()
func _on_Door_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "back");
End()
func _on_ArrowFront_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "120_w_front");
End()
func _on_ArrowSmoking_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "120_w_smoking");
End()

View file

@ -0,0 +1,35 @@
extends "res://scripts/AlternativeChoices/AlternativeChoiceBase.gd"
func Localization():
localization = ["", "choice22.1", "choice21.1", ""]
func SetCursorStates():
cursorStates = [CursorState.Walk, CursorState.Walk, CursorState.Walk, CursorState.Walk];
func CheckForVariables():
if Dialogic.get_variable("LightsOn") == "0":
$SpriteButtons / Door.texture_normal = load("res://resources/AlternativeChoices/Timeline_32/door_night_lightsOff.webp");
func AdjustLabels():
$Labels / Arrow.rect_global_position.y = $Labels / Arrow.rect_global_position.y - 25;
$Labels / Arrow2.rect_global_position.y = $Labels / Arrow2.rect_global_position.y - 25;
func _on_Door_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "141_rest");
End()
func _on_ArrowGarage_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "141_garage");
End()
func _on_ArrowSmoking_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "141_smoking");
End()
func _on_LightHouse_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "141_lighthouse");
End()

View file

@ -0,0 +1,43 @@
extends "res://scripts/AlternativeChoices/AlternativeChoiceBase.gd"
func Localization():
localization = ["", "", "", "choice21.9", "choice21.1"]
func SetCursorStates():
cursorStates = [CursorState.Talk, CursorState.Walk, CursorState.Press, CursorState.Walk, CursorState.Walk, CursorState.Walk, ];
func AdjustLabels():
$Labels / ArrowLabel.rect_global_position.y = $Labels / ArrowLabel.rect_global_position.y - 25;
$Labels / ArrowLabel2.rect_global_position.y = $Labels / ArrowLabel2.rect_global_position.y - 25;
func CheckForVariables():
get_node("SpriteButtons/Yellow").visible = Dialogic.get_variable("Is_Yellow_Dead") == "0";
func _on_Yellow_button_up():
if not CheckHover():return ;
if Dialogic.get_variable("Timeline142_h") == "1":
Dialogic.set_variable("PreviousTimelineChoice", "142_2");
else :
Dialogic.set_variable("PreviousTimelineChoice", "142_1");
End()
func _on_Door_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "142_back");
End()
func _on_Car_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "142_car");
End()
func _on_ArrowFront_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "142_3");
End()
func _on_ArrowSmoking_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "142_smoking");
End()

View file

@ -0,0 +1,36 @@
extends "res://scripts/AlternativeChoices/AlternativeChoiceBase.gd"
func Localization():
localization = ["", "choice21.8", "", ""]
func SetCursorStates():
cursorStates = [CursorState.Talk, CursorState.Walk, CursorState.Press, CursorState.Press, ];
func AdjustLabels():
$Labels / Arrow.rect_global_position.y = $Labels / Arrow.rect_global_position.y - 40;
func CheckForVariables():
get_node("SpriteButtons/Gray").visible = Dialogic.get_variable("Is_Gray_Dead") == "0";
func _on_Gray_button_up():
if not CheckHover():return ;
if Dialogic.get_variable("Timeline143") == "1":
Dialogic.set_variable("PreviousTimelineChoice", "143_2");
else :
Dialogic.set_variable("PreviousTimelineChoice", "143_1");
End()
func _on_Arrow_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "143_back");
End()
func _on_Elec_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "143_elec");
End()
func _on_Window_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "143_window");
End()

View file

@ -0,0 +1,37 @@
extends "res://scripts/AlternativeChoices/AlternativeChoiceBase.gd"
func Localization():
localization = ["", "choice22.3", ""]
func SetCursorStates():
cursorStates = [CursorState.Talk, CursorState.Walk, CursorState.Press];
func AdjustLabels():
$Labels / ArrowLabel.rect_global_position.y = $Labels / ArrowLabel.rect_global_position.y - 35;
$Labels / ArrowLabel.rect_global_position.x = $Labels / ArrowLabel.rect_global_position.x + 20;
func CheckForVariables():
var orange = get_node("SpriteButtons/Orange");
orange.visible = Dialogic.get_variable("Is_Orange_Dead") == "0";
if orange.visible and Dialogic.get_variable("LightsOn"):
orange.modulate = Color(0.49, 0.49, 0.49, 1);
func _on_Orange_button_up():
if not CheckHover():return ;
if Dialogic.get_variable("Timeline149") == "1":
Dialogic.set_variable("PreviousTimelineChoice", "149_2");
else :
Dialogic.set_variable("PreviousTimelineChoice", "149_1");
End()
func _on_Arrow_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "149_back");
End()
func _on_Knife_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "149_knife");
End()

View file

@ -0,0 +1,57 @@
extends "res://scripts/AlternativeChoices/AlternativeChoiceBase.gd"
func Localization():
localization = ["", "", "1", "2", "choice22.2"];
func SetCursorStates():
cursorStates = [CursorState.Walk, CursorState.Walk, CursorState.Walk, CursorState.Walk, CursorState.Walk, ];
func AdjustLabels():
get_node("Labels/Down").rect_position = Vector2(1424, 750);
get_node("Labels/Up").rect_position = Vector2(1452, 410);
get_node("Labels/1").rect_position = Vector2(300, 240);
get_node("Labels/2").rect_position = Vector2(885, 254);
get_node("Labels/Office").rect_position = Vector2(1105, 245);
func CheckForVariables():
get_node("SpriteButtons/1").visible = Dialogic.get_variable("Timeline146") == "0";
get_node("SpriteButtons/2").visible = Dialogic.get_variable("Timeline147") == "0";
if get_node("SpriteButtons/1").visible:
get_node("SpriteButtons/1").visible = Dialogic.get_variable("Is_Black_Dead") == "0"
if get_node("SpriteButtons/2").visible:
get_node("SpriteButtons/2").visible = Dialogic.get_variable("Is_Green_Dead") == "0"
if Dialogic.get_variable("LightsOn") == "0":
if get_node("SpriteButtons/1").visible:
get_node("SpriteButtons/1").texture_normal = load("res://resources/AlternativeChoices/Before_2nd_floor/lightsOff1.webp");
if get_node("SpriteButtons/2").visible:
get_node("SpriteButtons/2").texture_normal = load("res://resources/AlternativeChoices/Before_2nd_floor/lightsOff2.webp");
if $SpriteButtons / Office.visible:
$SpriteButtons / Office.texture_normal = load("res://resources/AlternativeChoices/Before_2nd_floor/lightsOffOffice.webp");
func _on_Down_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "2nd_down");
End()
func _on_Up_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "2nd_up");
End()
func _on_1_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "2nd_1");
End()
func _on_2_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "2nd_2");
End()
func _on_Office_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "2nd_office");
End()

View file

@ -0,0 +1,57 @@
extends "res://scripts/AlternativeChoices/AlternativeChoiceBase.gd"
func Localization():
localization = ["", "", "3", "4", "5"];
func SetCursorStates():
cursorStates = [CursorState.Walk, CursorState.Press, CursorState.Walk, CursorState.Walk, CursorState.Walk, ];
func CheckForVariables():
get_node("SpriteButtons/3").visible = Dialogic.get_variable("Timeline145") == "0";
get_node("SpriteButtons/4").visible = Dialogic.get_variable("Timeline146_a") == "0";
get_node("SpriteButtons/5").visible = Dialogic.get_variable("Timeline148") == "0";
if get_node("SpriteButtons/3").visible:
get_node("SpriteButtons/3").visible = Dialogic.get_variable("Is_Blue_M_Dead") == "0";
if get_node("SpriteButtons/5").visible:
get_node("SpriteButtons/5").visible = Dialogic.get_variable("Is_Purple_Dead") == "0";
if Dialogic.get_variable("LightsOn") == "0":
if get_node("SpriteButtons/3").visible:
get_node("SpriteButtons/3").texture_normal = load("res://resources/AlternativeChoices/Before_3rd_floor/lightsOff3.webp");
if get_node("SpriteButtons/4").visible:
get_node("SpriteButtons/4").texture_normal = load("res://resources/AlternativeChoices/Before_3rd_floor/lightsOff4.webp");
if get_node("SpriteButtons/5").visible:
get_node("SpriteButtons/5").texture_normal = load("res://resources/AlternativeChoices/Before_3rd_floor/lightsOff5.webp");
get_node("SpriteButtons/Window").texture_normal = load("res://resources/AlternativeChoices/Before_3rd_floor/Window_lightsOff.webp")
func AdjustLabels():
get_node("Labels/Down").rect_position = Vector2(1391, 650);
get_node("Labels/3").rect_position = Vector2(300, 240);
get_node("Labels/4").rect_position = Vector2(885, 254);
get_node("Labels/5").rect_position = Vector2(1143, 245);
func _on_Down_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "3rd_down");
End()
func _on_Window_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "3rd_window");
End()
func _on_3_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "3rd_3");
End()
func _on_4_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "3rd_4");
End()
func _on_5_button_up():
if not CheckHover():return ;
Dialogic.set_variable("PreviousTimelineChoice", "3rd_5");
End()

View file

@ -0,0 +1,170 @@
extends Node
var twoGirls;
signal endOfChoice;
const imagesBackgroupLoading:String = "res://resources/customControls/Timeline_17_Images/Images.tscn";
var previousImage:TextureRect = null;
var currentImage:TextureRect = null;
func _ready():
PrepareTextures();
Localization();
SetHover()
ChechVariables();
func PrepareTextures():
var _temp = SceneLoader.connect("on_scene_loaded", self, "LoadTextures")
SceneLoader.load_scene(imagesBackgroupLoading);
func LoadTextures(obj):
if obj.path != imagesBackgroupLoading:
return ;
var scene = obj.instance;
var array:Array = scene.GetTextures();
for i in $Girls.get_child_count():
var image:TextureRect = $Girls.get_child(i);
image.texture = array[i];
scene.queue_free()
SceneLoader.disconnect("on_scene_loaded", self, "LoadTextures")
var buttons = $Buttons.get_children();
for i in buttons:
i.disabled = false;
func Localization():
$Buttons / Pink.text = tr("ui_name_pink").to_upper();
$Buttons / Purple.text = tr("ui_name_purple").to_upper();
$Buttons / Green.text = tr("ui_name_green").to_upper();
$Buttons / Black.text = tr("ui_name_black").to_upper();
$Buttons / Blue.text = tr("ui_name_blue_f").to_upper();
$Buttons / Orange.text = tr("choice109.2").to_upper();
$Buttons / Guys.text = tr("choice109.1").to_upper();
func SetHover():
var hover = [
{"button":$Buttons / Pink, "texture":$Girls / Pink},
{"button":$Buttons / Purple, "texture":$Girls / Purple},
{"button":$Buttons / Green, "texture":$Girls / Green},
{"button":$Buttons / Black, "texture":$Girls / Black},
{"button":$Buttons / Blue, "texture":$Girls / Blue},
{"button":$Buttons / Orange, "texture":$Girls / Orange},
]
for i in hover:
i["button"].connect("mouse_entered", self, "onButtonHoverOn", [i["button"], i["texture"]]);
i["button"].connect("mouse_exited", self, "onButtonHoverOff", [i["button"]]);
func onButtonHoverOn(button, texture):
if not CheckHover():return
button.get("custom_fonts/font").outline_color = Color(255, 255, 255, 255);
button.set("custom_colors/font_color", Color(0, 0, 0, 255));
for i in $Girls.get_children():
if i == texture:
continue;
i.modulate = Color(1, 1, 1, 0);
if currentImage != texture:
currentImage = texture;
texture.modulate = Color(1, 1, 1, 1);
if previousImage != texture and previousImage != null:
previousImage.modulate = Color(1, 1, 1, 0);
func onButtonHoverOff(button):
if not CheckHover():return
button.get("custom_fonts/font").outline_color = Color(0, 0, 0, 255);
button.set("custom_colors/font_color", Color(255, 255, 255, 255));
previousImage = currentImage;
func _on_Guys_mouse_entered():
$Buttons / Guys.get("custom_fonts/font").outline_color = Color(255, 255, 255, 255);
$Buttons / Guys.set("custom_colors/font_color", Color(255, 0, 0, 255));
currentImage = null;
previousImage = null;
for i in $Girls.get_children():
i.modulate = Color(1, 1, 1, 0);
func _on_Guys_mouse_exited():
$Buttons / Guys.get("custom_fonts/font").outline_color = Color(0, 0, 0, 255);
$Buttons / Guys.set("custom_colors/font_color", Color(255, 255, 255, 255));
func ChechVariables():
twoGirls = int(Dialogic.get_variable("TwoGirls"));
if twoGirls == 0:
for i in $Buttons.get_children():
i.visible = true;
elif twoGirls == 2:
$Buttons / Pink.visible = int(Dialogic.get_variable("Pink_Karma")) >= 5;
$Buttons / Purple.visible = int(Dialogic.get_variable("Purple_Karma")) >= 5;
$Buttons / Green.visible = int(Dialogic.get_variable("Green_Karma")) >= 5;
$Buttons / Black.visible = int(Dialogic.get_variable("Black_Karma")) >= 5;
$Buttons / Blue.visible = int(Dialogic.get_variable("Blue_F_Karma")) >= 5;
var buttons = $Buttons.get_children();
for i in buttons:
i.disabled = true;
func _on_Pink_button_up():
if not CheckHover():return
Dialogic.set_variable("Chosen_Girl", "Pink");
Dialogic.set_variable("ChosenAlibi", "Pink");
EndOfChoice();
func _on_Purple_button_up():
if not CheckHover():return
Dialogic.set_variable("Chosen_Girl", "Purple");
Dialogic.set_variable("ChosenAlibi", "Purple");
EndOfChoice();
func _on_Green_button_up():
if not CheckHover():return
Dialogic.set_variable("Chosen_Girl", "Green");
Dialogic.set_variable("ChosenAlibi", "Green");
EndOfChoice();
func _on_Black_button_up():
if not CheckHover():return
Dialogic.set_variable("Chosen_Girl", "Black");
Dialogic.set_variable("ChosenAlibi", "Black");
EndOfChoice();
func _on_Blue_button_up():
if not CheckHover():return
Dialogic.set_variable("Chosen_Girl", "Blue");
Dialogic.set_variable("ChosenAlibi", "Blue");
EndOfChoice();
func _on_Orange_button_up():
if not CheckHover():return
Dialogic.set_variable("Chosen_Girl", "Loser");
var game = get_tree().root.get_node("Root/GameLogic");
game.after17result = "Bar";
EndOfChoice();
func _on_Guys_button_up():
if not CheckHover():return
Dialogic.set_variable("Chosen_Girl", "Loser");
var game = get_tree().root.get_node("Root/GameLogic");
game.after17result = "Guys";
EndOfChoice();
func CheckHover()->bool:
return not (get_tree().root.get_node("Root").isMenuVisible or get_tree().root.get_node("Root").isSaveLoadVisible)
func EndOfChoice():
emit_signal("endOfChoice");
for i in $Girls.get_children():
i.queue_free();

97
scripts/BGMScene.gd Normal file
View file

@ -0,0 +1,97 @@
extends Node
const defaultVolume:float = 0.0;
func _ready():
StartMenuMusic();
func StartMenuMusic():
var tween = $Tween;
if tween.is_active():
yield (tween, "tween_all_completed")
var audioPlayer = $Tween / AudioStreamPlayer;
var lowVolume = - 80.0;
var fadeMusicTime = 2.0;
audioPlayer.volume_db = lowVolume;
audioPlayer.stream = load("res://resources/audio/bgm/1.ogg");
tween.interpolate_property(audioPlayer, "volume_db", lowVolume, defaultVolume, fadeMusicTime, Tween.TRANS_EXPO, 0)
audioPlayer.play(0.0);
tween.start();
func StopMenuMusic():
var tween = $Tween;
var audioPlayer = $Tween / AudioStreamPlayer;
var lowVolume = - 80.0;
var fadeMusicTime = 1.0;
tween.interpolate_property(audioPlayer, "volume_db", defaultVolume, lowVolume, fadeMusicTime, Tween.TRANS_EXPO, 0)
tween.start();
yield (tween, "tween_all_completed")
audioPlayer.stop()
func SetBGM(bgmIndex):
var bgmPath = "res://resources/audio/bgm/" + bgmIndex + ".ogg"
if bgmIndex == "Survive":
bgmPath = "res://resources/audio/bgm/Survive.ogg"
Dialogic.set_variable("CurrentBGM", bgmIndex)
var bgmStreamPlaying = $TweenBGM.bgmStream.is_playing()
if bgmPath == "res://resources/audio/bgm/99.ogg":
$TweenBGM.StopBGM();
elif bgmStreamPlaying:
$TweenBGM.ChangeBGM(bgmPath)
else :
$TweenBGM.PlayBGM(bgmPath)
GallerySingleton.AddMusic(bgmIndex);
func SetSFXforBGM(sfxPath):
var player = $TweenBGMsfx.bgmStream;
if player.stream != null and player.stream.resource_path == sfxPath and not $TweenBGMsfx.isStoping:
return ;
if player.is_playing():
$TweenBGMsfx.ChangeBGM(sfxPath)
else :
$TweenBGMsfx.PlayBGM(sfxPath)
func SetSFXforBGMNoFade(sfxPath):
var player = $TweenBGMsfx.bgmStream;
if player.stream != null and player.stream.resource_path == sfxPath and not $TweenBGMsfx.isStoping:
return ;
if player.is_playing():
$TweenBGMsfx.ChangeBGMNoFade(sfxPath)
else :
$TweenBGMsfx.PlayBGMNoFade(sfxPath)
func StopSFX():
var sfxStreamPlaying = $TweenBGMsfx.bgmStream.is_playing()
if (sfxStreamPlaying):
$TweenBGMsfx.StopBGM()
func SetTriptych(bgmName):
var bgmPath = "res://resources/audio/bgm/" + bgmName + ".ogg"
Dialogic.set_variable("CurrentBGM", bgmName)
var bgmStreamPlaying = $TweenBGM.bgmStream.is_playing()
if not "tript" in $TweenBGM.bgmStream.stream.resource_path:
$TweenBGM.PlayBGM(bgmPath)
return ;
if bgmStreamPlaying:
$TweenBGM.SetNextTriptych(bgmPath);
else :
$TweenBGM.PlayBGM(bgmPath)
GallerySingleton.AddMusic("29");

11
scripts/Blood_floor.gd Normal file
View file

@ -0,0 +1,11 @@
extends Node2D
func _ready():
GallerySingleton.AddBackground("Blood_floor");
func InitForGallery()->Array:
scale = Vector2(0.5, 0.5)
return [];
func SetSettings(setting):
pass;

15
scripts/BookShelfHover.gd Normal file
View file

@ -0,0 +1,15 @@
extends TextureRect
func _ready():
self.connect("mouse_entered", self, "_hoverON");
self.connect("mouse_exited", self, "_hoverOFF");
func _hoverON():
get_parent().get_parent().get_node("MovingLens").visible = true
Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN)
func _hoverOFF():
get_parent().get_parent().get_node("MovingLens").visible = false
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)

66
scripts/Camera.gd Normal file
View file

@ -0,0 +1,66 @@
extends Camera2D
var zoomArray = [
Vector2(0.53, 0.53),
Vector2(0.53, 0.53),
Vector2(0.33, 0.33),
Vector2(0.48, 0.48),
Vector2(0.48, 0.48),
Vector2(1.0, 1.0),
Vector2(0.45, 0.45),
Vector2(0.35, 0.35)
]
var positionArray = [
Vector2(2716, 928),
Vector2(2800, 1129),
Vector2(1587, 835),
Vector2(977, 1076),
Vector2(1614, 1607),
Vector2(1920, 1080),
Vector2(1620, 880),
Vector2(1290, 960),
]
func ZoomToPosition(positionIndex, scaleX, scaleY, zoomTime):
var tween = get_node("Tween")
var newZoom = zoomArray[positionIndex]
var newPosition = Vector2(positionArray[positionIndex].x * scaleX, positionArray[positionIndex].y * scaleY)
tween.interpolate_method(self, "ChangePosition", self.position, newPosition, zoomTime, Tween.TRANS_LINEAR, 0)
tween.interpolate_method(self, "ChangeZoom", self.zoom, newZoom, zoomTime, Tween.TRANS_LINEAR, 0)
if positionIndex == 2:
get_tree().root.get_node("Root").SetSFXforBGMNoFade("res://resources/audio/sfx/shagi_gromkie.ogg")
tween.start()
if (positionIndex == 2):
Dialogic.set_variable("cameraPosition", 5)
else :
Dialogic.set_variable("cameraPosition", positionIndex)
var time = int(Dialogic.get_variable("Time"))
if (positionIndex == 5) and time <= 45:
if time > 0 and get_parent().get_node("removables").get_node("Man2").visible == true:
get_parent().RemoveCharacterSlowly("Man2")
if time > 15 and get_parent().get_node("removables").get_node("Man1").visible == true:
get_parent().RemoveCharacterSlowly("Man1")
func SetPosition(positionIndex, scaleX, scaleY):
var newZoom = zoomArray[positionIndex]
var newPosition = Vector2(positionArray[positionIndex].x * scaleX, positionArray[positionIndex].y * scaleY)
self.position = newPosition
self.zoom = newZoom
func ChangePosition(newPosition):
self.position = newPosition
func ChangeZoom(newZoom):
self.zoom = newZoom
func _on_Tween_tween_all_completed():
get_tree().root.get_node("Root").StopSFX()

41
scripts/Config.gd Normal file
View file

@ -0,0 +1,41 @@
extends Node
const WindowStateEnum = {
Windowed = 0,
Borderless = 1,
Fullscreen = 2,
}
var Language = "";
var VoiceLanguage = "en";
var WindowState = WindowStateEnum.Fullscreen;
var ScreenResolution = "-";
var LowProcessor = false;
var GeneralVolume = 40;
var MusicVolume = 50;
var DialogueVolume = 60;
var EffectsVolume = 30;
var AutoRead:bool = false;
var SkipSeen:bool = false;
var TextSpeed:int = 5;
var DefaultTheme:bool = true
var TextColor:int = Color.white.to_rgba32();
var BackgroundColor:int = Color.black.to_rgba32();
var TwitchEnabled:bool = false;
var TwitchChannel:String = "";
var TwitchTimer:int = 60;
var Explanation:bool = true;
var AsyncBackgroundLoading:bool = true;
var UseDlc:bool = true;
var Version:String = "1.3";

116
scripts/ConfigManager.gd Normal file
View file

@ -0,0 +1,116 @@
extends Node
var configPath = OS.get_user_data_dir() + "/config.cfg";
var configObject;
const version:String = "1.3";
func Init():
LoadConfig();
return GetConfig();
func LoadConfig():
var config = load("res://scripts/Config.gd");
configObject = config.new();
var fileObj = File.new();
if not (fileObj.file_exists(configPath)):
SettingsSingleton.SetFirstStartup(true);
else :
fileObj.open(configPath, File.READ);
var content = fileObj.get_as_text();
fileObj.close();
DeserializeConfig(content);
func CreateConfigFile():
var file = File.new();
file.open(configPath, File.WRITE);
var content = SerializeConfig();
file.store_string(content);
file.close();
func DeserializeConfig(content):
var dict = parse_json(content);
if content == "":
return
var updateConfig:bool = false;
if dict.has("Version") and dict["Version"] != version:
updateConfig = true;
dict["Version"] = version;
DeleteDialogicSlots();
for i in dict.keys():
configObject[i] = dict[i];
if updateConfig:
SaveConfig();
func SerializeConfig():
var properties = [
"Language", "VoiceLanguage", "WindowState", "ScreenResolution", "LowProcessor",
"GeneralVolume", "MusicVolume", "EffectsVolume", "AutoRead", "SkipSeen",
"TextSpeed", "DefaultTheme", "TextColor", "BackgroundColor", "TwitchEnabled", "TwitchChannel", "TwitchTimer",
"Explanation", "AsyncBackgroundLoading", "UseDlc",
"Version"]
var save = {};
for i in properties:
save[i] = configObject[i];
return to_json(save);
func GetConfig():
return configObject;
func SaveConfig():
var file = File.new();
file.open(configPath, File.WRITE);
var content = SerializeConfig();
file.store_string(content);
file.close();
func DeleteDialogicSlots():
var dialogicFolder = OS.get_user_data_dir() + "/dialogic"
remove_recursive(dialogicFolder)
var slotImagesFolder = OS.get_user_data_dir() + "/slotImages"
remove_recursive(slotImagesFolder)
var dir = Directory.new();
if not dir.dir_exists(slotImagesFolder):
dir.make_dir(slotImagesFolder);
func DeleteAchievementsForReleaseVersion():
var directory = Directory.new()
var files = ["globalSeen.txt"];
for i in files:
var file = str(OS.get_user_data_dir(), "/", i);
var _kek = directory.remove(file);
func remove_recursive(path):
var directory = Directory.new()
var error = directory.open(path)
if error == OK:
directory.list_dir_begin(true)
var file_name = directory.get_next()
while file_name != "":
if directory.current_is_dir():
remove_recursive(path + "/" + file_name)
else :
directory.remove(file_name)
file_name = directory.get_next()
directory.remove(path)
else :
print("Error removing " + path)

85
scripts/Credits.gd Normal file
View file

@ -0,0 +1,85 @@
extends Node2D
var thresHold:int = - 4470;
func _ready():
if SettingsSingleton.GetCurrentLanguage() == "en":
thresHold = - 4440;
SetBackground();
SetAuthorText();
func _input(ev):
if ev is InputEventKey:
BackToMenu();
elif Input.is_mouse_button_pressed(1):
BackToMenu();
elif Input.is_mouse_button_pressed(5):
if ($authors.position.y >= thresHold):
var newPos = $authors.position.y - 100
if newPos < thresHold:
$authors.position.y = thresHold
else :$authors.position.y -= 100
elif Input.is_mouse_button_pressed(4):
if ($authors.position.y <= 0):
var newPos = $authors.position.y + 100
if newPos > 0:
$authors.position.y = 0
else :$authors.position.y += 100
func SetBackground():
var windowSize = SettingsSingleton.GetCurrectScreenResolutionVector2()
$Blur.set_polygon(PoolVector2Array([
Vector2(0, 0),
Vector2(0, windowSize.y),
Vector2(windowSize.x, windowSize.y),
Vector2(windowSize.x, 0)
]))
var backgroundsSize = Vector2(3840, 2160);
var scaleX = 1 / float(backgroundsSize.x / windowSize.x);
var scaleY = 1 / float(backgroundsSize.y / windowSize.y);
$House.scale = Vector2(scaleX, scaleY);
var cloudH = 2160;
var cloudScale = windowSize.y * 0.53 / cloudH;
$Cloud1.scale = Vector2(cloudScale, cloudScale);
$Cloud3.scale = Vector2(cloudScale, cloudScale);
func SetAuthorText():
$authors / AuthorText.bbcode_text = tr("ui_authors")
func BackToMenu():
if not SceneLoader.is_connected("on_scene_loaded", self, "MenuLoaded"):
SceneLoader.connect("on_scene_loaded", self, "MenuLoaded");
SceneLoader.load_scene("res://scenes/MainMenu.tscn")
func MenuLoaded(obj):
if obj.path == "res://scenes/MainMenu.tscn":
if obj.instance != null:
get_tree().root.add_child(obj.instance);
for i in get_tree().root.get_children():
if i.name == "Credits":
get_tree().root.remove_child(i);
break;
SceneLoader.disconnect("on_scene_loaded", self, "MenuLoaded");
var thanksSeen:bool = false;
func _process(delta):
if ($authors.position.y >= thresHold):
$authors.position.y -= 30 * delta
else :
if thanksSeen == false:
thanksSeen = true;
# Steam.set_achievement("Credits");

View file

@ -0,0 +1,24 @@
extends Node2D
onready var timer = $Timer;
onready var player = $AnimationPlayer;
onready var birdAnimation = $BirdsAnimation / BirdsAnimation;
onready var animationContainer = $BirdsAnimation;
func Init():
player.play("BirdsAnimation");
func _on_AnimationPlayer_animation_finished(_anim_name):
animationContainer.position.x = - 135;
birdAnimation.frame = 0;
timer.start(55);
func _on_Timer_timeout():
player.play("BirdsAnimation");

View file

@ -0,0 +1,117 @@
extends Node2D
var catState;
var stopCatTime = 0;
onready var dialogNode;
onready var anglyCatSound = load("res://resources/audio/sfx/cat_tail_angry.ogg");
onready var meowCatSound = load("res://resources/audio/sfx/cat_meows.ogg");
var meows = [[0.0, 1.53], [2.47, 3.72], [4.75, 6.39], [8.07, 9.75], [11.82, 13.12], [14.31, 16.13],
[18.87, 20.3], [21.99, 23.45], [25.09, 26.7], [27.15, 29.27], [30.6, 31.93]];
func Init(zIndex:int, state:int):
z_index = zIndex;
catState = state;
match state:
1:
$catTexture.texture = load("res://resources/graphics/backgrounds/cat/1_1.webp");
$pawTexture.texture = load("res://resources/graphics/backgrounds/cat/1_2.webp");
$pawTexture.visible = true;
$Tail.rect_position = Vector2(220, 40);
$Tail.rect_size = Vector2(80, 80);
2:
$catTexture.texture = load("res://resources/graphics/backgrounds/cat/2.webp");
$Tail.rect_position = Vector2(80, 40);
$Tail.rect_size = Vector2(100, 80);
3:
$catTexture.texture = load("res://resources/graphics/backgrounds/cat/3.webp");
$Tail.rect_position = Vector2(100, 200);
$Tail.rect_size = Vector2(140, 150);
4:
$catTexture.texture = load("res://resources/graphics/backgrounds/cat/4.webp");
$Tail.rect_position = Vector2(280, 20);
$Tail.rect_size = Vector2(120, 180);
10:
catState = 4;
$catTexture.texture = load("res://resources/graphics/backgrounds/cat/10.webp");
$Tail.rect_position = Vector2(280, 20);
$Tail.rect_size = Vector2(120, 180);
5:
$catTexture.texture = load("res://resources/graphics/backgrounds/cat/5.webp");
$Tail.rect_position = Vector2(100, 200);
$Tail.rect_size = Vector2(150, 140);
6:
$catTexture.texture = load("res://resources/graphics/backgrounds/cat/6.webp");
$Tail.rect_position = Vector2(220, 140);
$Tail.rect_size = Vector2(150, 140);
7:
$catTexture.texture = load("res://resources/graphics/backgrounds/cat/7.webp");
$Tail.rect_position = Vector2(0, 60);
$Tail.rect_size = Vector2(150, 50);
8:
$catTexture.texture = load("res://resources/graphics/backgrounds/cat/8.webp");
$Tail.rect_position = Vector2(10, 60);
$Tail.rect_size = Vector2(100, 60);
9:
$catTexture.texture = load("res://resources/graphics/backgrounds/cat/9.webp");
$Tail.rect_position = Vector2(10, 300);
$Tail.rect_size = Vector2(200, 160);
dialogNode = get_tree().root.get_node("Root/Game").get_child(0).get_node("DialogNode");
func _on_catTexture_resized():
$Body.rect_size = $catTexture.rect_size;
func Scale(scaleValue:float):
yield (get_tree().create_timer(0.1), "timeout");
scale = Vector2(scaleValue, scaleValue);
func _on_Cat_mouse_entered():
if get_tree().root.get_node("Root/Game").get_child_count() != 0:
dialogNode.catOnHover = true;
func _on_Cat_mouse_exited():
if get_tree().root.get_node("Root/Game").get_child_count() != 0:
dialogNode.catOnHover = false;
func _on_Body_pressed():
CatPressed();
$CatStreamPlayer.stream = meowCatSound;
var meowTime = meows[rand_range(0, meows.size() - 1)];
stopCatTime = meowTime[1];
$CatStreamPlayer.play(meowTime[0]);
func _on_Tail_pressed():
CatPressed();
$CatStreamPlayer.stream = anglyCatSound;
stopCatTime = 1.28;
$CatStreamPlayer.play();
func CatPressed():
var number = ProgressAchievementsSingleton.AddCat(catState);
# if number != - 1:
# if number == 9:
# Steam.set_achievement("Cat_Progress")
# else :
# var _res = Steam.user_stats.indicate_achievement_progress("Cat_Progress", number, 9)
var _res = false;
func _process(_delta):
if ($CatStreamPlayer.playing and $CatStreamPlayer.get_playback_position() >= stopCatTime):
$CatStreamPlayer.stop()

View file

@ -0,0 +1,32 @@
extends HBoxContainer
signal Deleted;
var defaultFont = null;
func SetName(charName:String, color:String):
if charName == tr("ui_name_black"):
var font = $Name.get("custom_fonts/normal_font").duplicate();
font.outline_color = Color(1, 1, 1, 1);
font.outline_size = 1;
$Name.set("custom_fonts/normal_font", font);
defaultFont = $Attitude.get("custom_fonts/normal_font");
$Name.bbcode_text = str("[color=", color, "] ", charName, "[/color]");
$Name.rect_min_size = Vector2(Resize(str(" ", charName)), 50);
func SetAttitude(attribute:String):
$Attitude.bbcode_text = attribute;
$Attitude.rect_min_size = Vector2(Resize(attribute), 50);
func Resize(temp:String)->float:
return defaultFont.get_string_size(temp).x;
func StartAppearing():
self_modulate = Color(1, 1, 1, 1);
$AnimationPlayer.play("ChangeKarmaAnimation");
func _on_AnimationPlayer_animation_finished(_anim_name):
emit_signal("Deleted");
queue_free();

View file

@ -0,0 +1,68 @@
extends Control
onready var textScene = preload("res://resources/customControls/ChangeKarma/ChangeKarma.tscn");
var linesAmount:int = 0;
func AddText(event, charStructure):
var locale = TranslationServer.get_locale();
var charName = tr(charStructure["charName"]);
var color = charStructure["color"];
var sex:bool = charStructure["sex"];
var changedKarmaText = "";
match locale:
"en":
if sex:
changedKarmaText = "changes his attitude";
else :
changedKarmaText = "changes her attitude";
"ja":
changedKarmaText = "が関係を";
_:
changedKarmaText = tr("ui_karma_changes_attitude");
var value = str(event["operation"], event["set_value"]);
if event["operation"] == "=":
match locale:
"en":
value = str("to ", event["set_value"])
"ru":
value = str("на ", event["set_value"]);
"uk":
value = str("до ", event["set_value"]);
"ja":
value = str(event["set_value"]);
_:
pass;
var attribute:String = "";
match locale:
"ja":
attribute = str(" ", changedKarmaText, value, "変えます。");
_:
attribute = str(" ", changedKarmaText, " ", value);
var inst = textScene.instance();
inst.SetName(charName, color);
inst.SetAttitude(attribute);
add_child(inst);
linesAmount += 1;
inst.StartAppearing();
var _t = inst.connect("Deleted", self, "LineDeleted", [inst]);
func LineDeleted(line):
Resize();
line.disconnect("Deleted", self, "LineDeleted");
func Resize():
linesAmount -= 1;
rect_size = Vector2(600, linesAmount * 50);

View file

@ -0,0 +1,18 @@
extends Control
func Place(index:int):
rect_position = Vector2(0, index * 42)
rect_size = Vector2(750, 40)
$Label.rect_size = Vector2(200, 40)
$Label.rect_position = Vector2(0, 0);
$TextEdit.rect_size = Vector2(200, 40)
$TextEdit.rect_position = Vector2(450, 0);
func Init(variableName:String):
$Label.text = variableName;
$TextEdit.text = Dialogic.get_variable(variableName);
func SaveVariable():
var varName = $Label.text;
var varValue = $TextEdit.text;
Dialogic.set_variable(varName, varValue);

View file

@ -0,0 +1,53 @@
extends Button
onready var ExplanationControl = preload("res://resources/customControls/DifficultySelector/Explanation.tscn");
onready var NormalBackground = preload("res://resources/graphics/GUI/Menu/Difficulties/normal_background.webp");
onready var HardBackground = preload("res://resources/graphics/GUI/Menu/Difficulties/hard_background.webp");
func Init(type:String):
if type == "Normal":
InitNormal();
elif type == "Hard":
InitHard();
var normalExplanations = [
"ui_difficulty_normal_explanation_1",
"ui_difficulty_normal_explanation_2",
"ui_difficulty_normal_explanation_3",
"ui_difficulty_normal_explanation_4",
];
func InitNormal():
$Background.texture = NormalBackground;
$Header.text = tr("ui_difficulty_normal_header");
$Title.text = tr("ui_difficulty_normal_title");
for i in normalExplanations:
var control = ExplanationControl.instance();
control.Init(i);
$Explanations.add_child(control);
var hardExplanations = [
"ui_difficulty_hard_explanation_1",
"ui_difficulty_hard_explanation_2",
"ui_difficulty_hard_explanation_3",
"ui_difficulty_hard_explanation_4",
];
func InitHard():
$Background.texture = HardBackground;
$Header.text = tr("ui_difficulty_hard_header");
$Title.text = tr("ui_difficulty_hard_title");
for i in hardExplanations:
var control = ExplanationControl.instance();
control.Init(i);
$Explanations.add_child(control);
func _on_Control_mouse_entered():
$Background.modulate.a = 0.85;
func _on_Control_mouse_exited():
$Background.modulate.a = 1;

View file

@ -0,0 +1,4 @@
extends HBoxContainer
func Init(text:String):
$Label.text = tr(text);

View file

@ -0,0 +1,74 @@
extends Control
signal galleryPressed;
var unlocked;
var sceneName;
var path;
func _ready():
pass
func Init(content, type):
sceneName = content["name"]
if content.has("multi"):
var multi = content["multi"];
for i in multi:
if GallerySingleton.HaveImage(i):
unlocked = true;
$TextureRect.texture = load(str("res://resources/graphics/Gallery/Images/", i, ".webp"));
$TextureRect.material = $TextureRect.material.duplicate()
return ;
unlocked = false;
$TextureRect.texture = load("res://resources/graphics/Gallery/locked.webp")
return ;
if content.has("multiB"):
var multi = content["multiB"];
for i in multi:
if GallerySingleton.HaveBackground(i):
unlocked = true;
$TextureRect.texture = load(str("res://resources/graphics/Gallery/Backgrounds/", i, ".webp"));
$TextureRect.material = $TextureRect.material.duplicate()
return ;
unlocked = false;
$TextureRect.texture = load("res://resources/graphics/Gallery/locked.webp")
return
if type == "background":
unlocked = GallerySingleton.HaveBackground(sceneName);
else :
unlocked = GallerySingleton.HaveImage(sceneName);
if unlocked:
path = content["path"];
$TextureRect.texture = load(path);
$TextureRect.material = $TextureRect.material.duplicate()
else :
$TextureRect.texture = load("res://resources/graphics/Gallery/locked.webp")
func setShaderOn():
if unlocked:
$TextureRect.material.set_shader_param("mixing", 0.15);
func setShaderOff():
if unlocked:
$TextureRect.material.set_shader_param("mixing", 0.0);
func _on_ResizeTimer_timeout():
var scale = 288.0 / $TextureRect.rect_size.x * 1.0;
$TextureRect.rect_scale = Vector2(scale, scale);
func _on_Control_gui_input(event):
if not unlocked:
return ;
if event is InputEventMouseButton:
if event.button_index == BUTTON_LEFT and event.pressed:
emit_signal("galleryPressed")

View file

@ -0,0 +1,39 @@
extends Control
onready var playIcon = preload("res://resources/graphics/GUI/Gallery/Play.webp")
onready var stopIcon = preload("res://resources/graphics/GUI/Gallery/Stop.webp")
var musicPath;
var unlocked;
var state = false;
signal PlayerStarted;
func Init(object, index:int):
state = false
var name = object["name"];
unlocked = GallerySingleton.HaveMusic(name)
if unlocked:
$Label.text = str("%02d" % index, " ", name);
musicPath = object["path"];
else :
$Label.text = tr("ui_gallery_locked");
func _on_Button_pressed():
if not unlocked:
return ;
state = not state;
DrawButtonIcon();
emit_signal("PlayerStarted");
func DrawButtonIcon():
if state:
$Button.icon = stopIcon;
else :
$Button.icon = playIcon;
func GetAudioStream()->AudioStream:
if not ResourceLoader.exists(musicPath):
return null
var stream = load(musicPath);
return stream;

View file

@ -0,0 +1,16 @@
extends Button
func _ready():
var font = self.get_font("font");
self.add_font_override("font", font.duplicate())
func _on_Button_mouse_entered():
(self as Button).get("custom_fonts/font").outline_color = Color(213, 55, 29, 255)
func _on_Button_mouse_exited():
if not self.disabled:
(self as Button).get("custom_fonts/font").outline_color = Color(0, 0, 0, 255)
func _on_Button_pressed():
(self as Button).get("custom_fonts/font").outline_color = Color(255, 255, 255, 255)

View file

@ -0,0 +1,15 @@
extends Button
func _ready():
var font = self.get_font("font");
self.add_font_override("font", font.duplicate())
func _on_Button_mouse_entered():
(self as Button).get("custom_fonts/font").outline_color = Color(213, 55, 29, 255)
func _on_Button_mouse_exited():
(self as Button).get("custom_fonts/font").outline_color = Color(0, 0, 0, 255)
func _on_Button_pressed():
if self.pressed:
(self as Button).get("custom_fonts/font").outline_color = Color(255, 255, 255, 255)

View file

@ -0,0 +1,74 @@
extends Node2D
var state;
var playerReference:AudioStreamPlayer;
var scenePath;
var imagesLoaded;
func _ready():
pass;
func Init(number:int, audioPlayer:AudioStreamPlayer):
state = number;
playerReference = audioPlayer;
imagesLoaded = false;
var _temp = SceneLoader.connect("on_scene_loaded", self, "ImagesLoaded");
scenePath = str("res://resources/customControls/Lightning/Lightning", number, ".tscn");
if not ResourceLoader.exists(scenePath):
OS.alert("МОЛНИИ НЕТ!!!");
SceneLoader.load_scene(scenePath)
func SetPosition(pos:Vector2, _scale:Vector2):
yield (get_tree().create_timer(0.1), "timeout");
position = pos;
scale = _scale;
func ImagesLoaded(obj):
if obj.path != scenePath:
return ;
add_child(obj.instance);
obj.instance.connect("animation_finished", self, "_on_Animation_animation_finished");
imagesLoaded = true;
SceneLoader.disconnect("on_scene_loaded", self, "ImagesLoaded");
func StartAnimation():
if not has_node("Animation"):
return ;
var sprite:AnimatedSprite = $Animation;
if sprite.is_playing():
return ;
sprite.visible = true;
sprite.frame = 0;
sprite.play("default");
func _process(_delta):
if not imagesLoaded:
return ;
if playerReference == null:
return
var time = playerReference.get_playback_position();
match playerReference.stream.resource_path:
"res://resources/audio/sfx/Rain Loop.ogg":
if time >= 2.4 and time <= 2.5:
StartAnimation();
"res://resources/audio/sfx/Mayak_night.ogg":
if time >= 3.1 and time <= 3.2:
StartAnimation();
_:
pass;
func _on_Animation_animation_finished():
if has_node("Animation"):
$Animation.visible = false;

View file

@ -0,0 +1,108 @@
extends Control
signal SlotNameClicked;
var imagesFolder = OS.get_user_data_dir() + "/slotImages/";
var slotNumber;
var width = 1920 * 3.0 / 10.0;
var height = 1080 * 3.0 / 10.0;
var isDisabled;
var thread;
func Init(slotnumber:String, slotName:String):
$SlotName.text = slotName;
slotNumber = slotnumber;
thread = Thread.new();
thread.start(self, "UpdateImage");
var font = $SlotName.get_font("font").duplicate();
$SlotName.add_font_override("font", font);
func CheckIfDisabled():
var folderName;
match slotNumber:
"AutosaveNormal":
folderName = OS.get_user_data_dir() + "/dialogic/AutosaveNormal";
"AutosaveCasual":
folderName = OS.get_user_data_dir() + "/dialogic/AutosaveCasual";
_:
folderName = OS.get_user_data_dir() + "/dialogic/slot" + slotNumber;
var directory = Directory.new();
if not directory.dir_exists(folderName):
Disable();
func ResizeForInGame():
width = 384;
height = 216;
rect_size = Vector2(width, height);
$SlotName.rect_size = Vector2(width, height);
$Date.rect_size.x = width;
$Date.rect_position.y = height - 56;
$Date.get_font("font").size = 38;
func Disable():
isDisabled = true;
$SlotName.set("custom_colors/font_color", Color(0.6, 0.6, 0.6, 255))
func Enable():
isDisabled = false;
func UpdateImage():
var imagePath = str(imagesFolder, slotNumber, ".png");
var file = File.new();
if file.file_exists(imagePath):
var dateTime = OS.get_datetime_from_unix_time(file.get_modified_time(imagePath));
var utcDiff = OS.get_datetime(false).hour - OS.get_datetime(true).hour;
if utcDiff + dateTime.hour >= 24:
dateTime.day += 1;
dateTime.hour = utcDiff + dateTime.hour - 24;
elif utcDiff + dateTime.hour < 0:
dateTime.day -= 1;
dateTime.hour = utcDiff + dateTime.hour + 24;
var strDate = "%1d.%02d.%02d %02d:%02d" % [dateTime.day, dateTime.month, dateTime.year, dateTime.hour + utcDiff, dateTime.minute]
$Date.text = str(strDate);
var image = Image.new()
image.load(imagePath)
image.flip_y()
var t = ImageTexture.new()
t.create_from_image(image)
$SlotImage.texture_normal = t;
var scaleValue = width / 1920.0;
$SlotImage.rect_scale = Vector2(scaleValue, scaleValue);
else :
$SlotImage.rect_size = Vector2(width, height);
func _on_SlotImage_button_up():
if not isDisabled:
emit_signal("SlotNameClicked");
func _on_SlotImage_mouse_entered():
if not isDisabled:
$SlotName.get("custom_fonts/font").outline_color = Color(213, 55, 29, 255)
$SlotName.set("custom_colors/font_color", Color(0, 0, 0, 255))
func _on_SlotImage_mouse_exited():
if not isDisabled:
$SlotName.get("custom_fonts/font").outline_color = Color(0, 0, 0, 255)
$SlotName.set("custom_colors/font_color", Color(213, 55, 29, 255));
func _exit_tree():
thread.wait_to_finish();

View file

@ -0,0 +1,159 @@
extends Node2D
var client_id = ""
var oauth = "oauth:"
onready var twicil = get_node("TwiCIL");
onready var label = $TimerLabel;
onready var PollItem = preload("res://resources/customControls/Twitch/TwitchPollItem.tscn");
var voted_users:Array = [];
var votes = {};
var timeToVote:int;
var numOfChoices:int;
var isPolling:bool;
var inited:bool;
func _ready():
isPolling = false;
inited = false;
func Clear():
for i in $VBoxContainer.get_children():
$VBoxContainer.remove_child(i);
voted_users.clear();
votes.clear();
func Init(amount:int):
inited = true;
var nick = CreateNickname();
var channelName = SettingsSingleton.GetTwitchChannel();
var attemps = 0;
while true:
attemps += 1;
var _temp = twicil.connect_to_twitch_chat()
yield (twicil, "ConnectedToTwitch");
if attemps == 4:
print("TWITCH CONNECTION KAPETS")
return
if twicil.IsConnected():
break;
twicil.connect_to_channel(channelName, client_id, oauth, nick)
$SizeTimer.start(0.01);
Clear();
numOfChoices = amount;
for i in amount:
votes[i + 1] = 0;
var pollItem = PollItem.instance();
$VBoxContainer.add_child(pollItem);
if not twicil.is_connected("message_recieved", self, "_on_message_recieved"):
twicil.connect("message_recieved", self, "_on_message_recieved")
func StartTimer():
if not inited:
Disconnect();
return ;
z_index = 10;
visible = true;
isPolling = true;
$Timer.start(SettingsSingleton.GetTwitchTimer());
func Disconnect():
visible = false;
isPolling = false;
Clear();
if twicil.is_connected("message_recieved", self, "_on_message_recieved"):
twicil.disconnect("message_recieved", self, "_on_message_recieved")
twicil.Disconnect();
label.text = "";
inited = false;
const messageCap:int = 5;
func _on_message_recieved(user_name:String, text:String, _emotes)->void :
if user_name in voted_users:
return ;
if text.length() > messageCap:
text = text.left(messageCap)
var number = int(text);
if not votes.has(number):
return ;
votes[number] += 1
voted_users.push_back(user_name)
$VBoxContainer.get_child(number - 1).AddVote(user_name);
func _process(_delta):
if not isPolling:
return ;
var timer = $Timer;
if timer.time_left < 6.0:
label.set("custom_colors/font_color", Color(0.78, 0, 0, 1))
else :
label.set("custom_colors/font_color", Color(0.75, 0.75, 0.75, 1))
label.text = "%d" % $Timer.time_left;
func CreateNickname()->String:
var rnd = RandomNumberGenerator.new();
rnd.randomize();
var nick = str("justinfan", rnd.randi_range(10000, 99999));
return nick;
func Result()->int:
var candidates = [];
var values = votes.values();
values.sort();
var maxValue = values.max();
for i in votes.keys():
if votes[i] == maxValue:
candidates.push_back(i);
if candidates.size() > 1:
candidates.shuffle()
return candidates[0];
func StopTimerInMenu():
if not isPolling:
return
if $Timer.is_stopped():
return
z_index = 0;
$Timer.set_paused(true)
func ResumeTimerInMenu():
if not isPolling:
return
if $Timer.paused:
z_index = 10;
$Timer.set_paused(false)
func AppearTimer():
visible = isPolling;

View file

@ -0,0 +1,12 @@
extends Control
var count:int;
func _ready():
count = 0;
func AddVote(nickname:String):
count += 1;
$Count.text = str(count);
$Nickname.text = nickname;

View file

@ -0,0 +1,60 @@
extends Control
signal value_changed(value);
var mouseInSlider;
var scaleX;
func setName(name):
$Label.text = tr(name)
func resize():
var size = SettingsSingleton.GetCurrectScreenResolutionVector2()
var font = $Label.get_font("font");
var fontSize = round(0.0708 * size.y - 6.3) / 1.2 / 1.5;
var outline = int(0.00555556 * size.y - 1) / 1.2 / 1.5;
font.size = fontSize;
font.outline_size = outline;
font.outline_color = Color(0, 0, 0)
$Label.add_font_override("font", font);
$ValueLabel.add_font_override("font", font);
var labelSize = font.get_string_size("Dialogue");
$Label.rect_size = Vector2(labelSize.x, labelSize.y);
$TextureProgress.rect_position = Vector2(labelSize.x * 1.1, labelSize.y * 0.3);
scaleX = 100 * size.x / 1000 / 500;
$TextureProgress.rect_scale = Vector2(scaleX, 1);
$ValueLabel.rect_position = Vector2($TextureProgress.rect_position.x + $TextureProgress.rect_size.x * scaleX, $ValueLabel.rect_position.y)
func setValue(value):
$TextureProgress.value = float(value);
$ValueLabel.text = str(value);
func _input(_event):
if mouseInSlider and Input.is_mouse_button_pressed(BUTTON_LEFT):
setSlider()
func setSlider():
var slider = $TextureProgress
slider.value = ratioInBody() * slider.max_value;
emit_signal("value_changed", slider.value);
$ValueLabel.text = str(slider.value);
func ratioInBody():
var slider = $TextureProgress
var posClicked = get_local_mouse_position() - slider.rect_position;
var ratio = posClicked.x / slider.rect_size.x * (1 / (scaleX * 0.8));
if ratio > 1.0:
ratio = 1.0
elif ratio < 0.0:
ratio = 0.0;
return ratio;
func _on_TextureProgress_mouse_entered():
mouseInSlider = true
func _on_TextureProgress_mouse_exited():
mouseInSlider = false

6
scripts/CustomTooltip.gd Normal file
View file

@ -0,0 +1,6 @@
extends Control
func _make_custom_tooltip(for_text)->Control:
var tooltip = preload("res://CustomTooltip.tscn").instance()
tooltip.get_node("Node2D").get_node("Label").text = for_text
return tooltip

View file

@ -0,0 +1,6 @@
extends Control
func _make_custom_tooltip(for_text)->Control:
var tooltip = preload("res://CustomTooltipInGame.tscn").instance()
tooltip.get_node("Node2D").get_node("Label").text = for_text
return tooltip

View file

@ -0,0 +1,25 @@
extends Control
onready var player = $AnimationPlayer;
func _make_custom_tooltip(for_text)->Control:
var tooltip = preload("res://CustomTooltipInGame.tscn").instance()
tooltip.get_node("Node2D").get_node("Label").text = for_text
return tooltip
func StartBlinking():
player.play("Blinking");
func _on_KarmaButton_mouse_entered():
if player.is_playing():
player.stop();
modulate = Color(1, 1, 1, 1);
rect_scale = Vector2(0.3, 0.3);
rect_position = Vector2(1325, 1029);
func _on_MapButton_mouse_entered():
if player.is_playing():
player.stop();
modulate = Color(1, 1, 1, 1);
rect_scale = Vector2(0.3, 0.3);
rect_position = Vector2(1374, 1029);

View file

@ -0,0 +1,63 @@
extends Control
onready var tween = $Tween;
const time:float = 0.2;
var state:int = 0;
var controls:Array = [];
var mem = preload("res://CustomTooltipInGame.tscn")
var tooltip = null;
var tooltipHidden = null;
var hidden:bool = false;
func _make_custom_tooltip(for_text)->Control:
if hidden:
if is_instance_valid(tooltipHidden):
return tooltipHidden;
tooltipHidden = mem.instance();
tooltipHidden.get_node("Node2D").get_node("Label").text = "";
tooltipHidden.get_node("Node2D").position.x = - 1000;
return tooltipHidden;
if is_instance_valid(tooltip):
return tooltip;
tooltip = mem.instance()
tooltip.get_node("Node2D").get_node("Label").text = for_text
return tooltip;
func HoverOn(_controls:Array):
if is_instance_valid(tooltip):
tooltip.visible = false;
hidden = true;
Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN)
controls = _controls;
StartTween(1);
func HoverOff(_controls:Array):
if is_instance_valid(tooltip):
tooltip.visible = true;
hidden = false;
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
controls = _controls;
StartTween(2);
func StartTween(value):
if (state == 1 and value == 2) or (state == 2 and value == 1):
tween.remove_all();
state = value;
var modulateValue = Color(1, 1, 1, 1);
if state == 1:
modulateValue = Color(1, 1, 1, 0);
for i in controls:
tween.interpolate_property(i, "modulate", i.modulate, modulateValue, time, Tween.TRANS_LINEAR, Tween.EASE_IN_OUT, 0)
tween.start()
func _on_Tween_tween_all_completed():
state = 0;

37
scripts/Darkening.gd Normal file
View file

@ -0,0 +1,37 @@
extends Sprite
var interpolateTime:float = 1.75;
var state:bool = true;
var tween:Tween;
signal completed;
func _ready():
tween = get_node("Tween");
func Fade(value):
state = value;
var _temp;
if value:
_temp = tween.interpolate_method(self, "SetAlpha", 0.0, 1.0, interpolateTime, Tween.TRANS_LINEAR, 0);
if get_parent().name == "Root":
get_parent().InvisibleHistory()
else :
_temp = tween.interpolate_method(self, "SetAlpha", 1.0, 0.0, interpolateTime, Tween.TRANS_LINEAR, 0);
_temp = tween.start();
func SetAlpha(alphaChannel):
self.material.set_shader_param("alphaChannel", alphaChannel);
func IsPlaying()->bool:
return tween.is_active();
func _on_Tween_tween_all_completed():
emit_signal("completed");
if get_parent().name == "Root":
get_parent().VisibleHistory()

233
scripts/DebugScene.gd Normal file
View file

@ -0,0 +1,233 @@
extends Control
onready var scenes = $"Scenes";
onready var timelines = $"Timelines/ScrollContainer/VBoxContainer";
onready var haveSaves = $"CheckBox";
var karmaArray = [
"130",
"129",
"Time",
"ItIsDay",
"Talked_to_White",
"Orange_Karma",
"Pink_Karma",
"Purple_Karma",
"Green_Karma",
"Black_Karma",
"Blue_F_Karma",
"Yellow_Karma",
"White_Karma",
"Gray_Karma",
"Red_Karma",
"Blue_M_Karma",
"Drunk",
"Talked_to_Orange",
"Talked_to_Yellow",
"TwoGirls",
"Chosen_Girl",
"Chosen_Karma",
"TwoGirlNames",
"Chosen_Girl_Name",
"Timeline_30_Red_Blue_Boys",
"Timeline_30_Gray_White_Boys",
"Is_Green_Dead",
"Dead_Girl",
"Dead_Girl_Name",
]
var scenesArray = [
"Scene2",
"Scene2_1",
"Scene2_2",
"Scene4",
"Scene6",
"Scene7",
"Scene8",
"Scene9",
"Scene12",
]
var timelineArray = [
["Timeline_16_4", "Scene2_1", "3", "0"],
["Test", "Scene8", "2", "5"],
["Timeline_139", "Scene9", "2", "5"],
["Timeline_120_main", "Panorama", "2", "5"],
["Timeline_140_main", "Panorama", "2", "5"],
["Timeline_165", "Death_stairs_girl", "2", "5"],
["Timeline_1", "Scene8", "2", "5"],
["Timeline_2", "Scene7", "2", "5"],
["Timeline_3", "Scene2_1", "3", "0"],
["Timeline_3_1", "Scene2_1", "3", "0"],
["Timeline_4", "Scene2_1", "3", "1"],
["Timeline_5", "Scene2", "3", "5"],
["Timeline_6", "Scene2_1", "3", "5"],
["Timeline_7", "Scene2", "3", "5"],
["Timeline_7_1", "Scene2", "3", "5"],
["Timeline_8", "Scene12", "3", "5"],
["Timeline_9", "Scene9", "3", "5"],
["Timeline_Alt_1", "Scene8", "2", "5"],
["Timeline_10", "Scene9", "5", "5"],
["Timeline_10_2", "Scene9", "3", "5"],
["Timeline_11", "Scene2_1", "4", "5"],
["Timeline_12", "Scene2_1", "4", "4"],
["Timeline_13", "Scene2_1", "4", "4"],
["Timeline_14", "Scene2_1", "16", "4"],
["Timeline_15", "Scene2_1", "4", "4"],
["Timeline_16", "Scene2_1", "5", "4"],
["Timeline_17", "Scene2_1", "4", "5"],
["Timeline_18", "Scene2_1", "4", "5"],
["Timeline_19", "Scene2_1", "4", "5"],
["Timeline_20", "Scene2_1", "4", "5"],
["Timeline_22", "Scene2_1", "4", "5"],
["Timeline_23", "Scene2_1", "5", "3"],
["Timeline_24", "Scene2_1", "5", "3"],
["Timeline_25", "Scene2_1", "5", "3"],
["Timeline_26", "Scene2_1", "3", "0"],
["Timeline_27", "Scene6", "16", "5"],
["Timeline_28", "Scene7", "16", "5"],
["Timeline_29", "Scene7", "10", "5"],
["Timeline_30", "Scene2_1", "4", "5"],
["Timeline_31", "Scene2_1", "15", "5"],
["Timeline_32", "Scene2_1", "15", "5"],
["Timeline_33", "Scene2_1", "14", "5"],
["Timeline_35", "Scene2", "10", "5"],
["Timeline_36", "Scene2", "2", "5"],
["Timeline_38", "Scene2_1", "4", "0"],
["Timeline_39", "Scene2_1", "4", "5"],
["Timeline_40", "Scene2_1", "4", "3"],
["Timeline_41", "Scene2_1", "4", "3"],
["Timeline_42", "Scene2_1", "4", "3"],
["Timeline_43", "Scene2_1", "4", "5"],
["Timeline_44", "Scene2_1", "4", "5"],
["Timeline_Sofa", "Scene2_1", "3", "5"],
["Timeline_Pink", "Scene2_1", "4", "4"],
["Timeline_Black", "Scene2_1", "8", "4"],
["Timeline_Green", "Scene2_1", "16", "4"],
["Timeline_Purple", "Scene2_1", "16", "4"],
["Timeline_Blue", "Scene2_1", "5", "4"],
["Timeline_dlc_pink", "AmandaDLC", "5", "4"]
]
func _ready():
$Label.text = tr("text604.2");
haveSaves.pressed = SettingsSingleton.GetHaveSave();
Dialogic.load("debug")
Dialogic.set_variable("DialogIndex", "0")
Dialogic.set_variable("TwinsNPC", "fish")
Dialogic.set_variable("numberOfActions", "5")
Dialogic.set_variable("CurrentLabel", "a1")
Dialogic.set_variable("Footprint", "1")
Dialogic.set_variable("Knife", "1")
Dialogic.set_variable("choice1", "0")
Dialogic.set_variable("choice2", "0")
Dialogic.set_variable("choice3", "0")
Dialogic.set_variable("choice4", "0")
Dialogic.set_variable("choice5", "0")
Dialogic.set_variable("Dead_Girl", "Green_Karma")
Dialogic.set_variable("Killer", "Pink")
LoadKarmas();
LoadScenes();
LoadTimeLines();
func LoadKarmas():
var DialogicVarControl = load("res://resources/customControls/DialogicVarControl.tscn");
var karmaIndex = 0;
for i in karmaArray:
var panel = DialogicVarControl.instance();
panel.Init(i);
panel.Place(karmaIndex);
$Karma.add_child(panel);
karmaIndex += 1;
func _on_Button_pressed():
for i in $"Karma".get_children():
i.SaveVariable();
Dialogic.save("debug")
func LoadScenes():
return ;
var buttonsIndex = 0;
for i in scenesArray:
var button = Button.new();
button.text = i;
button.rect_scale = Vector2(2, 2);
button.rect_position = Vector2(300, 40 + buttonsIndex * 40);
buttonsIndex += 1;
button.connect("pressed", self, "openScene", [i]);
scenes.add_child(button);
func openScene(sceneName):
get_tree().change_scene("res://scenes/BackgroundScenes/" + sceneName + ".tscn")
func LoadTimeLines():
var buttonsIndex = 0;
var font = DynamicFont.new();
font.font_data = load("res://resources/fonts/TimesNewerRoman-Regular.otf");
font.size = 30;
for i in timelineArray:
var button = Button.new();
button.text = i[0];
button.rect_scale = Vector2(2, 2);
button.rect_position = Vector2(700, 40 + buttonsIndex * 40);
button.set("custom_fonts/font", font);
buttonsIndex += 1;
button.connect("pressed", self, "openTimeline", [i]);
timelines.add_child(button);
func openTimeline(timelineName):
Dialogic.set_variable("SaveSlotName", "debug")
Dialogic.save("debug")
Dialogic.set_variable("NeedCharacter", 1)
Dialogic.set_variable("TimelineSave", timelineName[0])
Dialogic.set_variable("CurrentBackground", timelineName[1])
Dialogic.set_variable("CurrentBGM", timelineName[2])
Dialogic.set_variable("cameraPosition", timelineName[3])
if not SceneLoader.is_connected("on_scene_loaded", self, "MenuLoaded"):
SceneLoader.connect("on_scene_loaded", self, "MenuLoaded");
SceneLoader.load_scene("res://scenes/Game.tscn")
func _on_CheckBox_pressed():
SettingsSingleton.SetHaveSave(haveSaves.pressed);
func _on_CloseButton_pressed():
if not SceneLoader.is_connected("on_scene_loaded", self, "MenuLoaded"):
SceneLoader.connect("on_scene_loaded", self, "MenuLoaded");
SceneLoader.load_scene("res://scenes/MainMenu.tscn")
func MenuLoaded(obj):
if obj.path == "res://scenes/MainMenu.tscn" or obj.path == "res://scenes/Game.tscn":
if obj.instance != null:
get_tree().root.add_child(obj.instance);
for i in get_tree().root.get_children():
if i.name == "Debug":
get_tree().root.remove_child(i);
break;
SceneLoader.disconnect("on_scene_loaded", self, "MenuLoaded");
func _input(ev):
if ev is InputEventKey and ev.scancode == KEY_ESCAPE and ev.pressed == false:
_on_CloseButton_pressed();

627
scripts/Gallery.gd Normal file
View file

@ -0,0 +1,627 @@
extends Control
onready var paginationButton = preload("res://resources/customControls/GalleryControls/GalleryPaginationButton.tscn")
onready var stateButton = preload("res://resources/customControls/GalleryControls/GalleryStateButton.tscn")
onready var musicPlayerInstance = preload("res://resources/customControls/GalleryControls/GalleryMusicPlayer.tscn")
onready var backgroundInstance = preload("res://resources/customControls/GalleryControls/GalleryBackground.tscn")
var menuMusicRestart:bool = false;
var backgroundsLoaded:bool = false;
var imagesLoaded:bool = false;
var dlcLoaded:bool = false;
var musics;
var backgrounds;
var images;
var dlcs:Array;
var isLoading = false;
func _ready():
SetBackground();
GallerySingleton.CheckForGreatCollector();
musics = GallerySingleton.GetMusicSettings();
backgrounds = GallerySingleton.GetBackgroundsSettings();
images = GallerySingleton.GetImagesSettings();
dlcs = GallerySingleton.GetDlcsSettings();
var backbutton = $UIRoot / CenterContainer / BackToMenu;
var backRoot = $BigViewBackgroundsImages / BackRoot;
backbutton.text = tr("ui_back_to_menu");
backRoot.text = tr("ui_back");
CheckForMusic();
func SetBackground():
var windowSize = SettingsSingleton.GetCurrectScreenResolutionVector2()
$Blur.set_polygon(PoolVector2Array([
Vector2(0, 0),
Vector2(0, windowSize.y),
Vector2(windowSize.x, windowSize.y),
Vector2(windowSize.x, 0)
]))
var backgroundsSize = Vector2(3840, 2160);
var scaleX = 1 / float(backgroundsSize.x / windowSize.x);
var scaleY = 1 / float(backgroundsSize.y / windowSize.y);
$House.scale = Vector2(scaleX, scaleY);
var cloudH = 2160;
var cloudScale = windowSize.y * 0.53 / cloudH;
$Cloud1.scale = Vector2(cloudScale, cloudScale);
$Cloud3.scale = Vector2(cloudScale, cloudScale);
$Loading / LoadingLabel.text = tr("ui_loading");
var localization = ["ui_music_tab_name", "ui_background_tab_name", "ui_images_tab_name", "ui_dlc_tab_name"]
var container = $UIRoot / TabContainer;
for i in localization.size():
container.set_tab_title(i, tr(localization[i]));
if not SettingsSingleton.GetDLC():
var dlcTab = $UIRoot / TabContainer / DlcTab
container.remove_child(dlcTab)
func _on_TabContainer_tab_changed(tab):
match tab:
1:
if backgroundsLoaded:
return
CheckForBackgrounds();
backgroundsLoaded = true;
2:
if imagesLoaded:
return
CheckForImages();
imagesLoaded = true;
3:
if dlcLoaded:
return ;
CheckForDlc();
dlcLoaded = true;
func CheckForMusic():
var musicSize = musics.size();
if musicSize > 15:
var musicPageContainer = $UIRoot / TabContainer / MusicTab / MusicPagination;
musicPageContainer.visible = true;
var amountOfPages = ceil(musicSize / 15.0);
for i in amountOfPages:
var pagButton = paginationButton.instance();
pagButton.text = str(i + 1);
pagButton.connect("pressed", self, "LoadMusicOnPage", [i]);
musicPageContainer.add_child(pagButton);
LoadMusicOnPage(0);
func LoadMusicOnPage(page:int):
var musicContainer = $UIRoot / TabContainer / MusicTab / VBoxContainer;
var paginationContainer = $UIRoot / TabContainer / MusicTab / MusicPagination;
for i in musicContainer.get_children():
musicContainer.remove_child(i);
var temp = musics.slice(page * 15, (page + 1) * 15 - 1, 1, true);
var musicSize = temp.size();
var index = page * 15;
for i in temp.size():
if i % 3 != 0:
continue
var hBoxContainer = HBoxContainer.new();
hBoxContainer.set("custom_constants/separation", 488);
for j in range(3):
if i + j >= musicSize:
break;
var musicPlayer = musicPlayerInstance.instance();
index += 1;
musicPlayer.name = str("MusicPlayer", index);
musicPlayer.Init(temp[i + j], index);
musicPlayer.connect("PlayerStarted", self, "StartMusicPlayer", [musicPlayer]);
hBoxContainer.add_child(musicPlayer);
musicContainer.add_child(hBoxContainer);
for i in paginationContainer.get_child_count():
var button = paginationContainer.get_child(i);
if i == page:
button.disabled = true;
button._on_Button_mouse_entered();
else :
button.disabled = false;
button._on_Button_mouse_exited();
func StartMusicPlayer(playerControl):
menuMusicRestart = true;
get_node("/root/BgmScene").StopMenuMusic()
var player = $MusicPlayer;
if player.playing and not playerControl.state:
player.stop();
return
else :
player.stop();
var container = $UIRoot / TabContainer / MusicTab / VBoxContainer;
for i in container.get_children():
for j in i.get_children():
if j == playerControl:
continue;
j.state = false;
j.DrawButtonIcon();
var stream = playerControl.GetAudioStream();
if stream == null:
return ;
player.stream = stream;
if stream is AudioStreamMP3:
stream.loop = true;
else :
player.stream.set_loop_mode(1);
player.play()
func CheckForBackgrounds():
var backgroundSize = backgrounds.size();
if backgroundSize > 12:
var backgroundPageContainer = $UIRoot / TabContainer / BackgroundsTab / BackgroundPagination;
backgroundPageContainer.visible = true;
var amountOfPages = ceil(backgroundSize / 12.0);
for i in amountOfPages:
var pagButton = paginationButton.instance();
pagButton.text = str(i + 1);
pagButton.connect("pressed", self, "LoadBackgroundOnPage", [i]);
backgroundPageContainer.add_child(pagButton);
LoadBackgroundOnPage(0);
func LoadBackgroundOnPage(page:int):
var backgroundContainer = $UIRoot / TabContainer / BackgroundsTab / VBoxContainer;
var paginationContainer = $UIRoot / TabContainer / BackgroundsTab / BackgroundPagination;
for i in backgroundContainer.get_children():
backgroundContainer.remove_child(i);
var temp = backgrounds.slice(page * 12, (page + 1) * 12 - 1, 1, true);
var backgroundSize = temp.size();
for i in temp.size():
if i % 4 != 0:
continue
var hBoxContainer = HBoxContainer.new();
hBoxContainer.set("custom_constants/separation", 360);
for j in range(4):
if i + j >= backgroundSize:
break;
var backgroundControl = backgroundInstance.instance();
backgroundControl.Init(temp[i + j], "background");
backgroundControl.connect("mouse_entered", self, "onButtonHoverOn_background", [backgroundControl]);
backgroundControl.connect("mouse_exited", self, "onButtonHoverOff_background", [backgroundControl]);
backgroundControl.connect("galleryPressed", self, "onBackgroundPressed", [backgroundControl]);
hBoxContainer.add_child(backgroundControl);
backgroundContainer.add_child(hBoxContainer);
for i in paginationContainer.get_child_count():
var button = paginationContainer.get_child(i);
if i == page:
button.disabled = true;
button._on_Button_mouse_entered();
else :
button.disabled = false;
button._on_Button_mouse_exited();
func onButtonHoverOn_background(control):
control.setShaderOn();
func onButtonHoverOff_background(control):
control.setShaderOff();
func onBackgroundPressed(control):
if not isLoading:
onButtonHoverOff_background(control)
LoadToBigView(control);
func CheckForImages():
var imagesSize = images.size();
if imagesSize > 12:
var imagesPageContainer = $UIRoot / TabContainer / ImagesTab / ImagesPagination;
imagesPageContainer.visible = true;
var amountOfPages = ceil(imagesSize / 12.0);
for i in amountOfPages:
var pagButton = paginationButton.instance();
pagButton.text = str(i + 1);
pagButton.connect("pressed", self, "LoadImagesOnPage", [i]);
imagesPageContainer.add_child(pagButton);
LoadImagesOnPage(0);
func LoadImagesOnPage(page:int):
var imagesContainer = $UIRoot / TabContainer / ImagesTab / VBoxContainer;
var paginationContainer = $UIRoot / TabContainer / ImagesTab / ImagesPagination;
for i in imagesContainer.get_children():
imagesContainer.remove_child(i);
var temp = images.slice(page * 12, (page + 1) * 12 - 1, 1, true);
var imagesSize = temp.size();
for i in temp.size():
if i % 4 != 0:
continue
var hBoxContainer = HBoxContainer.new();
hBoxContainer.set("custom_constants/separation", 360);
for j in range(4):
if i + j >= imagesSize:
break;
var imagesControl = backgroundInstance.instance();
imagesControl.Init(temp[i + j], "image");
imagesControl.connect("mouse_entered", self, "onButtonHoverOn_background", [imagesControl]);
imagesControl.connect("mouse_exited", self, "onButtonHoverOff_background", [imagesControl]);
imagesControl.connect("galleryPressed", self, "onImagePressed", [imagesControl]);
hBoxContainer.add_child(imagesControl);
imagesContainer.add_child(hBoxContainer);
for i in paginationContainer.get_child_count():
var button = paginationContainer.get_child(i);
if i == page:
button.disabled = true;
button._on_Button_mouse_entered();
else :
button.disabled = false;
button._on_Button_mouse_exited();
func CheckForDlc():
var dlcsSize = dlcs.size();
if dlcsSize > 12:
var dlcsPageContainer = $UIRoot / TabContainer / DlcTab / ImagesPagination;
dlcsPageContainer.visible = true;
var amountOfPages = ceil(dlcsSize / 12.0);
for i in amountOfPages:
var pagButton = paginationButton.instance();
pagButton.text = str(i + 1);
pagButton.connect("pressed", self, "LoadDlcsOnPage", [i]);
dlcsPageContainer.add_child(pagButton);
LoadDlcsOnPage(0);
func LoadDlcsOnPage(page:int):
var dlcsContainer = $UIRoot / TabContainer / DlcTab / VBoxContainer;
var paginationContainer = $UIRoot / TabContainer / DlcTab / ImagesPagination;
for i in dlcsContainer.get_children():
dlcsContainer.remove_child(i);
var temp = dlcs.slice(page * 12, (page + 1) * 12 - 1, 1, true);
var dlcsSize = temp.size();
for i in temp.size():
if i % 4 != 0:
continue
var hBoxContainer = HBoxContainer.new();
hBoxContainer.set("custom_constants/separation", 360);
for j in range(4):
if i + j >= dlcsSize:
break;
var imagesControl = backgroundInstance.instance();
imagesControl.Init(temp[i + j], "image");
imagesControl.connect("mouse_entered", self, "onButtonHoverOn_background", [imagesControl]);
imagesControl.connect("mouse_exited", self, "onButtonHoverOff_background", [imagesControl]);
imagesControl.connect("galleryPressed", self, "onImagePressed", [imagesControl]);
hBoxContainer.add_child(imagesControl);
dlcsContainer.add_child(hBoxContainer);
for i in paginationContainer.get_child_count():
var button = paginationContainer.get_child(i);
if i == page:
button.disabled = true;
button._on_Button_mouse_entered();
else :
button.disabled = false;
button._on_Button_mouse_exited();
func onImagePressed(control):
if not isLoading:
onButtonHoverOff_background(control)
LoadToBigView(control);
func _input(ev):
if ev is InputEventKey and ev.scancode == KEY_ESCAPE and ev.pressed == false:
if $BigViewBackgroundsImages.visible:
_on_BackRoot_pressed();
else :
_on_BackToMenu_pressed();
func _on_BackToMenu_pressed():
if isLoading:
return ;
if menuMusicRestart:
get_tree().root.get_node("BgmScene").StartMenuMusic();
if not SceneLoader.is_connected("on_scene_loaded", self, "MenuLoaded"):
SceneLoader.connect("on_scene_loaded", self, "MenuLoaded");
SceneLoader.load_scene("res://scenes/MainMenu.tscn")
func MenuLoaded(obj):
if obj.path != "res://scenes/MainMenu.tscn":
return ;
if obj.instance != null:
get_tree().root.add_child(obj.instance);
for i in get_tree().root.get_children():
if i.name == "Gallery":
get_tree().root.remove_child(i);
break;
SceneLoader.disconnect("on_scene_loaded", self, "MenuLoaded");
func _on_BackToMenu_mouse_entered():
$UIRoot / CenterContainer / BackToMenu.get("custom_fonts/font").outline_color = Color(213, 55, 29, 255)
$UIRoot / CenterContainer / BackToMenu.set("custom_colors/font_color", Color(0, 0, 0, 255))
func _on_BackToMenu_mouse_exited():
$UIRoot / CenterContainer / BackToMenu.get("custom_fonts/font").outline_color = Color(0, 0, 0, 255)
$UIRoot / CenterContainer / BackToMenu.set("custom_colors/font_color", Color(213, 55, 29, 255));
var thread:Thread;
func LoadToBigView(control):
if thread == null:
thread = Thread.new();
if thread.is_active():
return
var path = str("res://scenes/BackgroundScenes/", control["sceneName"], ".tscn");
SetLoading(true);
thread.start(self, "LoadScene", path, Thread.PRIORITY_HIGH);
func LoadScene(path:String):
var scene = load(path);
var instance = scene.instance();
call_deferred("async_scene_loaded");
return instance;
func async_scene_loaded():
var scene = thread.wait_to_finish();
$BigViewBackgroundsImages / SceneContainer.add_child(scene);
SetLoading(false);
var settings = scene.InitForGallery();
var isToggle = false;
var toggleScenes = ["Podval", "Garaj", "Pistol", "Scene2_1", "Panorama", "Car", "Room_Agatha", "Room_Dana", "Room_Linda", "Room_Martin"];
if scene.name in toggleScenes:
isToggle = true;
if settings.size() != 0:
for i in settings:
var settingsButton = stateButton.instance();
var text = tr(i)
settingsButton.text = text;
if isToggle:
settingsButton.toggle_mode = true;
settingsButton.connect("pressed", self, "GalleryToggleSettingsPressed", [scene, settingsButton]);
else :
settingsButton.connect("pressed", self, "GallerySettingsPressed", [scene, text]);
$BigViewBackgroundsImages / SettingsContainer.add_child(settingsButton)
elif scene.has_method("IsItDLCScene"):
var dlcCount = $BigViewBackgroundsImages / DlcCount;
var check = $BigViewBackgroundsImages / DlcAutoCheck;
var left = $BigViewBackgroundsImages / DlcLeft;
var right = $BigViewBackgroundsImages / DlcRight;
scene.AddCountLabel(dlcCount);
if check.is_connected("toggled", scene, "AutoPressed"):
check.disconnect("toggled", scene, "AutoPressed");
check.connect("toggled", scene, "AutoPressed");
if left.is_connected("pressed", self, "GalleryDlcButtonPressed"):
left.disconnect("pressed", self, "GalleryDlcButtonPressed");
if right.is_connected("pressed", self, "GalleryDlcButtonPressed"):
right.disconnect("pressed", self, "GalleryDlcButtonPressed");
left.connect("pressed", self, "GalleryDlcButtonPressed", [scene, "previous"]);
right.connect("pressed", self, "GalleryDlcButtonPressed", [scene, "next"]);
left.visible = true;
right.visible = true;
dlcCount.visible = true;
check.visible = true;
$BigViewBackgroundsImages / DLCAutoIcon.visible = true;
$BigViewBackgroundsImages.visible = true;
$Sky.visible = false;
$UIRoot.visible = false;
$Cloud1.visible = false;
$Cloud3.visible = false;
$House.visible = false;
$Blur.visible = false;
func GallerySettingsPressed(scene, settings):
scene.SetSettings(settings);
func GalleryToggleSettingsPressed(scene, button):
scene.SetToggleSettings(button);
func GalleryDlcButtonPressed(scene, direciton):
if direciton == "previous":
scene.ShowPrevious();
elif direciton == "next":
scene.ShowNext();
func SetLoading(value:bool):
isLoading = value;
if value:
$Blur.z_index = 1;
$Loading.visible = true;
else :
$Blur.z_index = 0;
$Loading.visible = false;
func _on_SettingsContainer_resized():
var settingsContainer = $BigViewBackgroundsImages / SettingsContainer;
var width = settingsContainer.rect_size.x;
if width != 0:
settingsContainer.rect_global_position = Vector2(1920 - settingsContainer.rect_size.x - 50, 540 - settingsContainer.rect_size.y / 2)
func _on_BackRoot_pressed():
for i in $BigViewBackgroundsImages / SceneContainer.get_children():
$BigViewBackgroundsImages / SceneContainer.remove_child(i);
for i in $BigViewBackgroundsImages / SettingsContainer.get_children():
$BigViewBackgroundsImages / SettingsContainer.remove_child(i)
$BigViewBackgroundsImages / SettingsContainer.rect_size = Vector2(0, 0);
$BigViewBackgroundsImages.visible = false;
$UIRoot.visible = true;
$Sky.visible = true;
$Cloud1.visible = true;
$Cloud3.visible = true;
$House.visible = true;
$Blur.visible = true;
$BigViewBackgroundsImages / DlcCount.visible = false;
$BigViewBackgroundsImages / DlcAutoCheck.visible = false;
$BigViewBackgroundsImages / DLCAutoIcon.visible = false;
$BigViewBackgroundsImages / DlcLeft.visible = false;
$BigViewBackgroundsImages / DlcRight.visible = false;
_on_BackRoot_mouse_exited();
var iconPressed:bool = false;
var iconHover:bool = false;
onready var checkIcon = $BigViewBackgroundsImages / DLCAutoIcon as TextureRect;
onready var nonHoverNonPressedCheckIcon = preload("res://resources/graphics/GUI/InGameMenu/forward.webp");
onready var hoverNonPressedCheckIcon = preload("res://resources/graphics/GUI/InGameMenu/forward_lighted.webp");
onready var nonHoverPressedCheckIcon = preload("res://resources/graphics/GUI/InGameMenu/forward_pressed.webp");
onready var hoverPressedCheckIcon = preload("res://resources/graphics/GUI/InGameMenu/forward_pressed_lighted.webp");
func _on_DlcAutoCheck_toggled(button_pressed):
iconPressed = button_pressed;
UpdateCheckIcon()
func _on_DlcAutoCheck_mouse_entered():
iconHover = true;
UpdateCheckIcon()
func _on_DlcAutoCheck_mouse_exited():
iconHover = false;
UpdateCheckIcon()
func UpdateCheckIcon():
var offsetIcon:bool = true;
if iconPressed and iconHover:
checkIcon.texture = hoverPressedCheckIcon;
elif iconPressed and not iconHover:
checkIcon.texture = nonHoverPressedCheckIcon;
elif not iconPressed and iconHover:
checkIcon.texture = hoverNonPressedCheckIcon;
elif not iconPressed and not iconHover:
checkIcon.texture = nonHoverNonPressedCheckIcon;
offsetIcon = false;
if offsetIcon:
checkIcon.rect_position = Vector2(1020, 2);
else :
checkIcon.rect_position = Vector2(1028, 10);
func _on_BackRoot_mouse_entered():
$BigViewBackgroundsImages / BackRoot.get("custom_fonts/font").outline_color = Color(213, 55, 29, 255)
$BigViewBackgroundsImages / BackRoot.set("custom_colors/font_color", Color(0, 0, 0, 255))
func _on_BackRoot_mouse_exited():
$BigViewBackgroundsImages / BackRoot.get("custom_fonts/font").outline_color = Color(0, 0, 0, 255)
$BigViewBackgroundsImages / BackRoot.set("custom_colors/font_color", Color(213, 55, 29, 255));
func _exit_tree():
if thread != null and thread.is_active():
var _temp = thread.wait_to_finish();
var state:int = 0;
var controls:Array = [];
onready var tween = $BigViewBackgroundsImages / Tween;
func _on_TextureButton_mouse_entered():
Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN)
controls = [
$BigViewBackgroundsImages / FullView,
$BigViewBackgroundsImages / BackRoot,
$BigViewBackgroundsImages / SettingsContainer,
$BigViewBackgroundsImages / DlcCount,
$BigViewBackgroundsImages / DlcAutoCheck,
$BigViewBackgroundsImages / DLCAutoIcon,
$BigViewBackgroundsImages / DlcLeft,
$BigViewBackgroundsImages / DlcRight
];
StartTween(1);
func _on_TextureButton_mouse_exited():
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
controls = [
$BigViewBackgroundsImages / FullView,
$BigViewBackgroundsImages / BackRoot,
$BigViewBackgroundsImages / SettingsContainer,
$BigViewBackgroundsImages / DlcCount,
$BigViewBackgroundsImages / DlcAutoCheck,
$BigViewBackgroundsImages / DLCAutoIcon,
$BigViewBackgroundsImages / DlcLeft,
$BigViewBackgroundsImages / DlcRight
];
StartTween(2);
func StartTween(value):
if (state == 1 and value == 2) or (state == 2 and value == 1):
tween.remove_all();
state = value;
var modulateValue = Color(1, 1, 1, 1);
if state == 1:
modulateValue = Color(1, 1, 1, 0);
for i in controls:
tween.interpolate_property(i, "modulate", i.modulate, modulateValue, 0.2, Tween.TRANS_LINEAR, Tween.EASE_IN_OUT, 0)
tween.start()
func _on_Tween_tween_all_completed():
state = 0;

1006
scripts/Game.gd Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,72 @@
extends Node2D
const fadeTime = 4.0
const labelDelayTime = 3.0
onready var isIncreasing = true
var bloodIncrement
var zoomIncrement
var currentZoom
var currentEnergy
var screenWidth;
var screenHeight;
var xOffset;
var yOffset
const zoomStart = 1.0
const zoomEnd = 0.97
const bloodStart = 0.2
const bloodEnd = 0.9
const timeParam = 1.7
func _ready():
Dialogic.set_variable("DoNotSave", 1)
bloodIncrement = (bloodEnd - bloodStart) / timeParam;
zoomIncrement = (zoomEnd - zoomStart) / timeParam;
currentZoom = zoomStart
isIncreasing = true
currentEnergy = 0
screenWidth = SettingsSingleton.GetCurrectScreenResolutionVector2().x
screenHeight = SettingsSingleton.GetCurrectScreenResolutionVector2().y
var endLabel = $ForScale / EndText
var localizedTextArray = LanguageLocalization.GetGameEndings()
var timeline = Dialogic.get_variable("TimelineSave")
var neededText = tr(localizedTextArray[timeline]);
endLabel.text = neededText
yield (get_tree().create_timer(labelDelayTime), "timeout")
$Tween.interpolate_property(endLabel, "modulate", Color(1, 1, 1, 0), Color(1, 1, 1, 1), fadeTime, Tween.TRANS_LINEAR, 0)
$Tween.start()
func _process(delta):
if (isIncreasing):
if (currentEnergy <= bloodEnd):
currentEnergy += bloodIncrement * delta
currentZoom += zoomIncrement * delta
$death / Light2D.self_modulate.a = currentEnergy
xOffset = (1 - currentZoom) * ($death / Polygon2D.get_global_transform_with_canvas().origin.x) / (screenWidth);
yOffset = (1 - currentZoom) * (screenHeight - $death / Polygon2D.get_global_transform_with_canvas().origin.y) / screenHeight;
var offset = Vector2(xOffset, yOffset);
var tiling = Vector2(currentZoom, currentZoom)
$death / Polygon2D.material.set_shader_param("offset", offset)
$death / Polygon2D.material.set_shader_param("tiling", tiling);
else :
isIncreasing = false
if ( not isIncreasing):
if (currentEnergy >= bloodStart):
currentEnergy -= bloodIncrement * delta
currentZoom -= zoomIncrement * delta
$death / Light2D.self_modulate.a = currentEnergy
xOffset = (1 - currentZoom) * ($death / Polygon2D.get_global_transform_with_canvas().origin.x) / (screenWidth);
yOffset = (1 - currentZoom) * (screenHeight - $death / Polygon2D.get_global_transform_with_canvas().origin.y) / screenHeight;
var offset = Vector2(xOffset, yOffset);
$death / Polygon2D.material.set_shader_param("offset", offset)
$death / Polygon2D.material.set_shader_param("tiling", Vector2(currentZoom, currentZoom));
else :
isIncreasing = true

View file

@ -0,0 +1,79 @@
extends Node2D
const fadeTime = 4.0
const creditsTime = 155
onready var creditsProcessing = false
onready var canExit = false
onready var timerC = 0.0
onready var thresHold:int = - 4870
func _ready():
$authors / AuthorText.bbcode_text = tr("ui_authors")
Dialogic.set_variable("DoNotSave", 1)
var endLabel = $ForScale / EndText
var localizedTextArray = LanguageLocalization.GetGameEndings()
var timeline = Dialogic.get_variable("TimelineSave")
var neededText = tr(localizedTextArray[timeline])
if timeline == "Timeline_peremoga":
neededText = tr("ui_game_end_survived")
endLabel.text = neededText
$Tween.interpolate_property(endLabel, "modulate", Color(1, 1, 1, 0), Color(1, 1, 1, 1), fadeTime, Tween.TRANS_LINEAR, 0)
$Tween.start()
if (Dialogic.get_variable("TimelineSave") != "Timeline_Alt_1" and Dialogic.get_variable("TimelineSave") != "Timeline_EasterZakviel"):
var killer = Dialogic.get_variable("Killer");
ProgressAchievementsSingleton.AddKillersAchievement(killer);
canExit = true
get_tree().root.get_node("Root").allowToDisplayMenu = false
get_tree().root.get_node("Root").get_node("Game").get_child(0).queue_free()
$Timer.set_wait_time(fadeTime * 2.0)
$Timer.set_one_shot(true)
$Timer.start()
yield ($Timer, "timeout")
ShowCredits()
func ShowCredits():
$Tween.interpolate_property($ForScale / EndText, "modulate", Color(1, 1, 1, 1), Color(1, 1, 1, 0), fadeTime, Tween.TRANS_LINEAR, 0)
$Tween.start()
$Timer.set_wait_time(fadeTime)
$Timer.set_one_shot(true)
$Timer.start()
yield ($Timer, "timeout")
$authors.visible = true
creditsProcessing = true
func _process(delta):
if creditsProcessing:
$authors.position.y -= 30 * delta
timerC += delta
if timerC >= creditsTime:
creditsProcessing = false
ExitToMenu()
if $authors.position.y < thresHold:
creditsProcessing = false
ExitToMenu()
func ExitToMenu():
# Steam.set_achievement("Credits");
get_tree().root.get_node("Root").BackToMenu()
func _input(ev):
if ev is InputEventKey and ev.scancode == KEY_ESCAPE and canExit:
ExitToMenu()
elif Input.is_mouse_button_pressed(5):
if ($authors.position.y >= thresHold):
var newPos = $authors.position.y - 100
if newPos < thresHold:
$authors.position.y = thresHold
else :$authors.position.y -= 100
elif Input.is_mouse_button_pressed(4):
if ($authors.position.y <= 0):
var newPos = $authors.position.y + 100
if newPos > 0:
$authors.position.y = 0
else :$authors.position.y += 100

364
scripts/GameLogic.gd Normal file
View file

@ -0,0 +1,364 @@
extends Node
func _ready():
pass
func KillerSelection():
var rng = RandomNumberGenerator.new()
rng.randomize()
var randomInt = rng.randi_range(0, 1)
if randomInt == 0:
Dialogic.set_variable("Killer", "Blue")
elif randomInt == 1:
Dialogic.set_variable("Killer", "Pink")
rng.randomize()
randomInt = rng.randi_range(0, 1)
if randomInt == 0:
Dialogic.set_variable("TwinsNPC", "fish");
elif randomInt == 1:
Dialogic.set_variable("TwinsNPC", "dog");
func WhoDead131():
var boysNamesArray = []
var boysKarmaArray = []
if Dialogic.get_variable("Is_Blue_M_Dead") == "0":
boysNamesArray.push_back("Blue_M")
boysKarmaArray.push_back(int(Dialogic.get_variable("Blue_M_Karma")))
if (Dialogic.get_variable("Is_Red_Dead") == "0" and Dialogic.get_variable("Is_White_Dead") == "0"):
boysNamesArray.push_back("Red")
boysKarmaArray.push_back(int(Dialogic.get_variable("Red_Karma")))
boysNamesArray.push_back("White")
boysKarmaArray.push_back(int(Dialogic.get_variable("White_Karma")))
if Dialogic.get_variable("Is_Gray_Dead") == "0":
boysNamesArray.push_back("Gray")
boysKarmaArray.push_back(int(Dialogic.get_variable("Gray_Karma")))
var maxKarma = boysKarmaArray.max()
var maxKarmaIndex = boysKarmaArray.find(maxKarma)
var neededBoy = boysNamesArray[maxKarmaIndex]
Dialogic.set_variable("3_Death_Electricity", neededBoy)
match neededBoy:
"Blue_M":
Dialogic.set_variable("Is_Blue_M_Dead", 1)
"Red":
Dialogic.set_variable("Is_Red_Dead", 1)
"White":
Dialogic.set_variable("Is_White_Dead", 1)
"Gray":
Dialogic.set_variable("Is_Gray_Dead", 1)
func Who135_1():
var boysNamesArray = []
var boysKarmaArray = []
if Dialogic.get_variable("Is_Blue_M_Dead") == "0":
boysNamesArray.push_back("Blue")
boysKarmaArray.push_back(int(Dialogic.get_variable("Blue_M_Karma")))
if (Dialogic.get_variable("Is_Red_Dead") == "0" and Dialogic.get_variable("Is_White_Dead") == "0"):
boysNamesArray.push_back("Red")
boysKarmaArray.push_back(int(Dialogic.get_variable("Red_Karma")))
boysNamesArray.push_back("White")
boysKarmaArray.push_back(int(Dialogic.get_variable("White_Karma")))
if Dialogic.get_variable("Is_Gray_Dead") == "0":
boysNamesArray.push_back("Gray")
boysKarmaArray.push_back(int(Dialogic.get_variable("Gray_Karma")))
var maxKarma = boysKarmaArray.max()
var maxKarmaIndex = boysKarmaArray.find(maxKarma)
var neededBoy = boysNamesArray[maxKarmaIndex]
Dialogic.set_variable("Who135_1", neededBoy)
func CheckCluesAmount():
var numberOfClues = int(Dialogic.get_variable("Tea")) + int(Dialogic.get_variable("Knife")) + int(Dialogic.get_variable("Footprint")) + int(Dialogic.get_variable("Bottle")) + int(Dialogic.get_variable("AbsentPerson1")) + int(Dialogic.get_variable("AbsentPerson2")) + int(Dialogic.get_variable("NonProfessional"))
Dialogic.set_variable("NumberOfClues", numberOfClues)
func Choice5():
var choice5 = int(Dialogic.get_variable("choice1")) + int(Dialogic.get_variable("choice2")) + int(Dialogic.get_variable("choice3")) + int(Dialogic.get_variable("choice4"))
Dialogic.set_variable("choice5", choice5)
func Phrase147_2():
var rng = RandomNumberGenerator.new()
rng.randomize()
var randomInt = rng.randi_range(1, 4)
Dialogic.set_variable("RandomPhrase", randomInt)
func Phrase120_premain():
var rng = RandomNumberGenerator.new()
rng.randomize()
var randomInt = rng.randi_range(0, 1)
Dialogic.set_variable("RandomPhrase120", randomInt)
func Male2():
if Dialogic.get_variable("Is_Blue_M_Dead") == "1":
Dialogic.set_variable("Who135_1", "Red")
return
if Dialogic.get_variable("Is_Red_Dead") == "1":
Dialogic.set_variable("Who135_1", "Blue")
return
var blueKarma = int(Dialogic.get_variable("Blue_M_Karma"))
var redKarma = int(Dialogic.get_variable("Red_Karma"))
if blueKarma >= redKarma:
Dialogic.set_variable("Who135_1", "Blue")
else :
Dialogic.set_variable("Who135_1", "Red")
func NoCluesCheck():
CheckCluesAmount()
if int(Dialogic.get_variable("NumberOfClues")) == 0:
Dialogic.set_variable("NoClues", 1)
func WhoBigKarma():
var girlsNamesArray = []
var girlsKarmaArray = []
if (Dialogic.get_variable("Is_Green_Dead") == "0" and Dialogic.get_variable("Chosen_Girl") != "Green"):
girlsNamesArray.push_back("Green")
girlsKarmaArray.push_back(int(Dialogic.get_variable("Green_Karma")))
if (Dialogic.get_variable("Is_Purple_Dead") == "0" and Dialogic.get_variable("Chosen_Girl") != "Purple"):
girlsNamesArray.push_back("Purple")
girlsKarmaArray.push_back(int(Dialogic.get_variable("Purple_Karma")))
if (Dialogic.get_variable("Is_Black_Dead") == "0" and Dialogic.get_variable("Chosen_Girl") != "Black"):
girlsNamesArray.push_back("Black")
girlsKarmaArray.push_back(int(Dialogic.get_variable("Black_Karma")))
var maxKarma = girlsKarmaArray.max()
var maxKarmaIndex = girlsKarmaArray.find(maxKarma)
var neededGirl = girlsNamesArray[maxKarmaIndex]
Dialogic.set_variable("WhoBigKarma", neededGirl)
func CheckBlueRedDeath():
if (int(Dialogic.get_variable("Red_Karma")) == int(Dialogic.get_variable("Blue_M_Karma"))):
var rng = RandomNumberGenerator.new()
rng.randomize()
var randomInt = rng.randi_range(0, 1)
if randomInt == 0:
Dialogic.set_variable("Is_Blue_M_Dead", 1)
Dialogic.set_variable("SecondDeathBoy", "Blue")
else :
Dialogic.set_variable("Is_Red_Dead", 1)
Dialogic.set_variable("SecondDeathBoy", "Red")
elif (int(Dialogic.get_variable("Red_Karma")) < int(Dialogic.get_variable("Blue_M_Karma"))):
Dialogic.set_variable("Is_Blue_M_Dead", 1)
Dialogic.set_variable("SecondDeathBoy", "Blue")
else :
Dialogic.set_variable("Is_Red_Dead", 1)
Dialogic.set_variable("SecondDeathBoy", "Red")
func IfHenry131():
var boysKarmaArray = []
if Dialogic.get_variable("Is_Blue_M_Dead") == "0":
boysKarmaArray.push_back(int(Dialogic.get_variable("Blue_M_Karma")))
if Dialogic.get_variable("Is_Red_Dead") == "0":
boysKarmaArray.push_back(int(Dialogic.get_variable("Red_Karma")))
if Dialogic.get_variable("Is_Gray_Dead") == "0":
boysKarmaArray.push_back(int(Dialogic.get_variable("Gray_Karma")))
if Dialogic.get_variable("Is_White_Dead") == "0":
boysKarmaArray.push_back(int(Dialogic.get_variable("White_Karma")))
var maxKarma = boysKarmaArray.max()
if int(Dialogic.get_variable("Yellow_Karma")) >= maxKarma:
Dialogic.set_variable("If_Henry", 1)
func CheckKarma156():
Dialogic.set_variable("CheckKarma156", 1)
if Dialogic.get_variable("Is_Green_Dead") == "0":
if float(Dialogic.get_variable("Green_Karma")) > 4:
Dialogic.set_variable("CheckKarma156", 2)
if Dialogic.get_variable("Is_Purple_Dead") == "0":
if float(Dialogic.get_variable("Purple_Karma")) > 4:
Dialogic.set_variable("CheckKarma156", 2)
if Dialogic.get_variable("Is_Black_Dead") == "0":
if float(Dialogic.get_variable("Black_Karma")) > 4:
Dialogic.set_variable("CheckKarma156", 2)
if Dialogic.get_variable("Is_Blue_M_Dead") == "0":
if float(Dialogic.get_variable("Blue_M_Karma")) > 4:
Dialogic.set_variable("CheckKarma156", 2)
if Dialogic.get_variable("Is_Gray_Dead") == "0":
if float(Dialogic.get_variable("Gray_Karma")) > 4:
Dialogic.set_variable("CheckKarma156", 2)
if Dialogic.get_variable("Is_White_Dead") == "0":
if float(Dialogic.get_variable("White_Karma")) > 4:
Dialogic.set_variable("CheckKarma156", 2)
if Dialogic.get_variable("Is_Red_Dead") == "0":
if float(Dialogic.get_variable("Red_Karma")) > 4:
Dialogic.set_variable("CheckKarma156", 2)
if float(Dialogic.get_variable("Orange_Karma")) > 4:
Dialogic.set_variable("CheckKarma156", 2)
if float(Dialogic.get_variable("Blue_F_Karma")) > 4:
Dialogic.set_variable("CheckKarma156", 2)
if float(Dialogic.get_variable("Pink_Karma")) > 4:
Dialogic.set_variable("CheckKarma156", 2)
func CheckClues157_rw():
var numberOfClues = int(Dialogic.get_variable("Knife")) + int(Dialogic.get_variable("Footprint")) + int(Dialogic.get_variable("AbsentPerson1")) + int(Dialogic.get_variable("AbsentPerson2")) + int(Dialogic.get_variable("NonProfessional"))
if numberOfClues == 5:
Dialogic.set_variable("AllCluesGathered", 1)
else :Dialogic.set_variable("AllCluesGathered", 0)
func CalcConditions157():
if ((Dialogic.get_variable("Killer") == "Blue") and int(Dialogic.get_variable("Is_Green_Dead")) == 0):
Dialogic.set_variable("Condition_pink", 1)
func CheckClues167():
var numberOfClues = int(Dialogic.get_variable("Knife")) + int(Dialogic.get_variable("Footprint")) + int(Dialogic.get_variable("AbsentPerson1")) + int(Dialogic.get_variable("AbsentPerson2")) + int(Dialogic.get_variable("NonProfessional"))
if numberOfClues >= 3:
Dialogic.set_variable("AllCluesGathered", 1)
else :Dialogic.set_variable("AllCluesGathered", 0)
func CheckKarma167():
var mainKarma = 0
if int(Dialogic.get_variable("Is_White_Dead")) == 0:
mainKarma = int(Dialogic.get_variable("White_Karma"))
else :
mainKarma = int(Dialogic.get_variable("Red_Karma"))
if Dialogic.get_variable("EasyMode") == "1":
if mainKarma >= 0:
Dialogic.set_variable("EnoughKarma", 1)
else :
Dialogic.set_variable("EnoughKarma", 0)
else :
if mainKarma >= 2:
Dialogic.set_variable("EnoughKarma", 1)
else :
Dialogic.set_variable("EnoughKarma", 0)
func CheckWhoDead33():
var rng = RandomNumberGenerator.new()
rng.randomize()
var randomInt = rng.randi_range(0, 3)
if randomInt == 0:
Dialogic.set_variable("Is_Blue_M_Dead", 1)
Dialogic.set_variable("2_Death_Missing", "Blue_M")
if randomInt == 1:
Dialogic.set_variable("Is_White_Dead", 1)
Dialogic.set_variable("2_Death_Missing", "White")
if randomInt == 2:
Dialogic.set_variable("Is_Red_Dead", 1)
Dialogic.set_variable("2_Death_Missing", "Red")
if randomInt == 3:
Dialogic.set_variable("Is_Gray_Dead", 1)
Dialogic.set_variable("2_Death_Missing", "Gray")
func CheckWhoDied110():
var rng = RandomNumberGenerator.new()
rng.randomize()
var randomInt = rng.randi_range(0, 2)
if randomInt == 0:
Dialogic.set_variable("Is_Blue_M_Dead", 1)
Dialogic.set_variable("2_Death_Missing", "Blue_M")
if randomInt == 1:
Dialogic.set_variable("Is_Red_Dead", 1)
Dialogic.set_variable("2_Death_Missing", "Red")
if randomInt == 2:
Dialogic.set_variable("Is_Gray_Dead", 1)
Dialogic.set_variable("2_Death_Missing", "Gray")
func RandomWoundFire140():
var boysNamesArray = []
var rng = RandomNumberGenerator.new()
var woundedBoy = "none"
rng.randomize()
if Dialogic.get_variable("Is_Yellow_Dead") == "0":
if Dialogic.get_variable("PreviousTimelineChoice") == "1089.3":
Dialogic.set_variable("5_Wounded_Fire", "Gray")
Dialogic.set_variable("Is_Gray_Dead", 1)
if Dialogic.get_variable("PreviousTimelineChoice") == "1089.4":
Dialogic.set_variable("5_Wounded_Fire", "White")
Dialogic.set_variable("Is_White_Dead", 1)
if Dialogic.get_variable("PreviousTimelineChoice") == "1089.5":
Dialogic.set_variable("5_Wounded_Fire", "Red")
Dialogic.set_variable("Is_Red_Dead", 1)
if Dialogic.get_variable("PreviousTimelineChoice") == "1089.6":
Dialogic.set_variable("5_Wounded_Fire", "Blue_M")
Dialogic.set_variable("Is_Blue_M_Dead", 1)
if Dialogic.get_variable("PreviousTimelineChoice") == "1089.7":
if Dialogic.get_variable("Is_Blue_M_Dead") == "0":
boysNamesArray.push_back("Blue_M")
if (Dialogic.get_variable("Is_Red_Dead") == "0" and Dialogic.get_variable("Is_White_Dead") == "0"):
boysNamesArray.push_back("Red")
boysNamesArray.push_back("White")
if Dialogic.get_variable("Is_Gray_Dead") == "0":
boysNamesArray.push_back("Gray")
var randomInt = rng.randi_range(0, boysNamesArray.size() - 1)
woundedBoy = boysNamesArray[randomInt]
Dialogic.set_variable("5_Wounded_Fire", woundedBoy)
match woundedBoy:
"Blue_M":
Dialogic.set_variable("Is_Blue_M_Dead", 1)
"Red":
Dialogic.set_variable("Is_Red_Dead", 1)
"White":
Dialogic.set_variable("Is_White_Dead", 1)
"Gray":
Dialogic.set_variable("Is_Gray_Dead", 1)
else :
if Dialogic.get_variable("PreviousTimelineChoice") == "1089.3":
Dialogic.set_variable("4_Death_Fire", "Gray")
Dialogic.set_variable("Is_Gray_Dead", 1)
if Dialogic.get_variable("PreviousTimelineChoice") == "1089.4":
Dialogic.set_variable("4_Death_Fire", "White")
Dialogic.set_variable("Is_White_Dead", 1)
if Dialogic.get_variable("PreviousTimelineChoice") == "1089.5":
Dialogic.set_variable("4_Death_Fire", "Red")
Dialogic.set_variable("Is_Red_Dead", 1)
if Dialogic.get_variable("PreviousTimelineChoice") == "1089.6":
Dialogic.set_variable("4_Death_Fire", "Blue_M")
Dialogic.set_variable("Is_Blue_M_Dead", 1)
if Dialogic.get_variable("Is_Blue_M_Dead") == "0":
boysNamesArray.push_back("Blue_M")
if (Dialogic.get_variable("Is_Red_Dead") == "0" and Dialogic.get_variable("Is_White_Dead") == "0"):
boysNamesArray.push_back("Red")
boysNamesArray.push_back("White")
if Dialogic.get_variable("Is_Gray_Dead") == "0":
boysNamesArray.push_back("Gray")
var randomInt = rng.randi_range(0, boysNamesArray.size() - 1)
woundedBoy = boysNamesArray[randomInt]
Dialogic.set_variable("5_Wounded_Fire", woundedBoy)
match woundedBoy:
"Blue_M":
Dialogic.set_variable("Is_Blue_M_Dead", 1)
"Red":
Dialogic.set_variable("Is_Red_Dead", 1)
"White":
Dialogic.set_variable("Is_White_Dead", 1)
"Gray":
Dialogic.set_variable("Is_Gray_Dead", 1)
func CheckKarma174():
var karmaOK = 0
if Dialogic.get_variable("Killer") == "Pink":
if float(Dialogic.get_variable("Pink_Karma")) > float(Dialogic.get_variable("Blue_F_Karma")):
karmaOK = 1
else :
if float(Dialogic.get_variable("Blue_F_Karma")) > float(Dialogic.get_variable("Pink_Karma")):
karmaOK = 1
Dialogic.set_variable("KarmaKillerOK", karmaOK)
func Timeline151WhiteRedSpeaks():
if Dialogic.get_variable("Chosen_Girl") != "Green" or Dialogic.get_variable("Chosen_Girl") != "Purple":
Dialogic.set_variable("WhiteRedSpeaks151", 1)
func RandomRiddle():
var rng = RandomNumberGenerator.new()
rng.randomize()
Dialogic.set_variable("RiddleRandom", rng.randi_range(0, 3))
func RandomSister():
var rng = RandomNumberGenerator.new()
rng.randomize()
Dialogic.set_variable("RiddleRandom", rng.randi_range(0, 1))
var after17result:String = "";
func GetAfter17Result():
Dialogic.set_variable("PreviousTimelineChoice", after17result);

258
scripts/GameText.gd Normal file
View file

@ -0,0 +1,258 @@
extends Node
func _ready():
pass
func SetNames():
var deathArray = ["1_Death_Knife",
"2_Death_Missing",
"3_Death_Electricity",
"4_Death_Fire",
"5_Wounded_Fire",
"6_Death_Poison",
"7_Death_Stairs",
"9_Death_Pistol"
]
var deathArrayColors = []
var deathArrayNames = LanguageLocalization.GetCharNames()
var deathArrayNamesDialogic = ["1_Death_Knife_Name",
"2_Death_Missing_Name",
"3_Death_Electricity_Name",
"4_Death_Fire_Name",
"5_Wounded_Fire_Name",
"6_Death_Poison_Name",
"7_Death_Stairs_Name",
"9_Death_Pistol_Name"
]
for i in deathArray.size():
deathArrayColors.push_back(Dialogic.get_variable(deathArray[i]))
for i in deathArrayNamesDialogic.size():
if Dialogic.get_variable("Killer") != "none":
var killerNameColor = Dialogic.get_variable("Killer")
if killerNameColor == "Blue":
killerNameColor += "_F"
Dialogic.set_variable("Killer_Name", tr(deathArrayNames[killerNameColor]))
if deathArrayColors[i] != "none":
Dialogic.set_variable(deathArrayNamesDialogic[i], tr(deathArrayNames[deathArrayColors[i]]))
else :
Dialogic.set_variable(deathArrayNamesDialogic[i], "None")
if Dialogic.get_variable("Is_White_Dead") == "0":
Dialogic.set_variable("RedWhite_Name", tr(deathArrayNames["White"]))
else :
Dialogic.set_variable("RedWhite_Name", tr(deathArrayNames["Red"]))
func Text300311():
if int(Dialogic.get_variable("Is_Green_Dead")) == 0:
Dialogic.set_variable("TempTextRus", "Агата")
Dialogic.set_variable("TempTextEng", "Agatha")
else :
Dialogic.set_variable("TempTextRus", "Рената")
Dialogic.set_variable("TempTextEng", "Renata")
func Text300316():
if int(Dialogic.get_variable("Is_Green_Dead")) == 0:
Dialogic.set_variable("TempTextRus", "Агата")
Dialogic.set_variable("TempTextEng", "Agatha")
else :
Dialogic.set_variable("TempTextRus", "Рената")
Dialogic.set_variable("TempTextEng", "Renata")
func Text300317():
if int(Dialogic.get_variable("Is_Green_Dead")) == 0:
Dialogic.set_variable("TempTextRus", "Агата")
Dialogic.set_variable("TempTextEng", "Agatha")
else :
Dialogic.set_variable("TempTextRus", "Рената")
Dialogic.set_variable("TempTextEng", "Renata")
func Text301353():
if int(Dialogic.get_variable("Is_Green_Dead")) == 0:
Dialogic.set_variable("TempTextRus", "Агата")
Dialogic.set_variable("TempTextEng", "Agatha")
else :
Dialogic.set_variable("TempTextRus", "Рената")
Dialogic.set_variable("TempTextEng", "Renata")
func Text301811():
if int(Dialogic.get_variable("Is_Green_Dead")) == 0:
Dialogic.set_variable("TempTextRus", "Агата")
Dialogic.set_variable("TempTextEng", "Agatha")
elif int(Dialogic.get_variable("Is_Purple_Dead")) == 0:
Dialogic.set_variable("TempTextRus", "Дана")
Dialogic.set_variable("TempTextEng", "Dana")
elif int(Dialogic.get_variable("Is_Black_Dead")) == 0:
Dialogic.set_variable("TempTextRus", "Линда")
Dialogic.set_variable("TempTextEng", "Linda")
elif int(Dialogic.get_variable("Is_Orange_Dead")) == 0:
Dialogic.set_variable("TempTextRus", "Рената")
Dialogic.set_variable("TempTextEng", "Renata")
func Text302261():
if int(Dialogic.get_variable("Is_Green_Dead")) == 0:
Dialogic.set_variable("TempTextRus", "Агата")
Dialogic.set_variable("TempTextEng", "Agatha")
elif int(Dialogic.get_variable("Is_Purple_Dead")) == 0:
Dialogic.set_variable("TempTextRus", "Дана")
Dialogic.set_variable("TempTextEng", "Dana")
elif int(Dialogic.get_variable("Is_Black_Dead")) == 0:
Dialogic.set_variable("TempTextRus", "Линда")
Dialogic.set_variable("TempTextEng", "Linda")
elif int(Dialogic.get_variable("Is_Orange_Dead")) == 0:
Dialogic.set_variable("TempTextRus", "Рената")
Dialogic.set_variable("TempTextEng", "Renata")
func Text301853():
if int(Dialogic.get_variable("Is_Green_Dead")) == 0:
Dialogic.set_variable("TempTextRus", "Агата")
Dialogic.set_variable("TempTextEng", "Agatha")
elif int(Dialogic.get_variable("Is_Purple_Dead")) == 0:
Dialogic.set_variable("TempTextRus", "Дана")
Dialogic.set_variable("TempTextEng", "Dana")
elif int(Dialogic.get_variable("Is_Black_Dead")) == 0:
Dialogic.set_variable("TempTextRus", "Линда")
Dialogic.set_variable("TempTextEng", "Linda")
elif int(Dialogic.get_variable("Is_Orange_Dead")) == 0:
Dialogic.set_variable("TempTextRus", "Рената")
Dialogic.set_variable("TempTextEng", "Renata")
func Text301271():
var stringRus = ""
var stringEng = ""
if int(Dialogic.get_variable("Timeline130")) == 0:
stringRus += "Генри, "
stringEng += "Henry, "
if int(Dialogic.get_variable("Timeline123")) == 0 and Dialogic.get_variable("2_Death_Missing") != "Gray":
stringRus += "Роберта, "
stringEng += "Robert, "
if int(Dialogic.get_variable("Timeline125")) == 0 and Dialogic.get_variable("2_Death_Missing") != "Blue_M":
stringRus += "Мартина, "
stringEng += "Martin, "
if int(Dialogic.get_variable("Timeline128")) == 0 and Dialogic.get_variable("1_Death_Knife") != "Purple":
stringRus += "Дану, "
stringEng += "Dana, "
if int(Dialogic.get_variable("Timeline126")) == 0 and Dialogic.get_variable("1_Death_Knife") != "Black":
stringRus += "Линду, "
stringEng += "Linda, "
if int(Dialogic.get_variable("Timeline121_a")) == 0:
stringRus += "Аманду, "
stringEng += "Amanda, "
if int(Dialogic.get_variable("Timeline127")) == 0 and Dialogic.get_variable("1_Death_Knife") != "Green":
stringRus += "Агату, "
stringEng += "Agatha, "
if int(Dialogic.get_variable("Timeline124")) == 0 and Dialogic.get_variable("2_Death_Missing") != "Red":
stringRus += "Александра, "
stringEng += "Alexander, "
if int(Dialogic.get_variable("Timeline122")) == 0 and Dialogic.get_variable("2_Death_Missing") != "White":
stringRus += "Джастина, "
stringEng += "Justin, "
if int(Dialogic.get_variable("Timeline129")) == 0:
stringRus += "Ренату, "
stringEng += "Renata, "
stringRus.trim_suffix(", ")
stringEng.trim_suffix(", ")
Dialogic.set_variable("TempTextRus", stringRus)
Dialogic.set_variable("TempTextEng", stringEng)
func Text302239():
var stringRus = ""
var stringEng = ""
if int(Dialogic.get_variable("Timeline130")) == 0:
stringRus += "Генри, "
stringEng += "Henry, "
if int(Dialogic.get_variable("Timeline123")) == 0 and Dialogic.get_variable("2_Death_Missing") != "Gray":
stringRus += "Роберта, "
stringEng += "Robert, "
if int(Dialogic.get_variable("Timeline125")) == 0 and Dialogic.get_variable("2_Death_Missing") != "Blue_M":
stringRus += "Мартина, "
stringEng += "Martin, "
if int(Dialogic.get_variable("Timeline128")) == 0 and Dialogic.get_variable("1_Death_Knife") != "Purple":
stringRus += "Дану, "
stringEng += "Dana, "
if int(Dialogic.get_variable("Timeline126")) == 0 and Dialogic.get_variable("1_Death_Knife") != "Black":
stringRus += "Линду, "
stringEng += "Linda, "
if int(Dialogic.get_variable("Timeline121")) == 0:
stringRus += "Эмилию, "
stringEng += "Emilia, "
if int(Dialogic.get_variable("Timeline127")) == 0 and Dialogic.get_variable("1_Death_Knife") != "Green":
stringRus += "Агату, "
stringEng += "Agatha, "
if int(Dialogic.get_variable("Timeline124")) == 0 and Dialogic.get_variable("2_Death_Missing") != "Red":
stringRus += "Александра, "
stringEng += "Alexander, "
if int(Dialogic.get_variable("Timeline122")) == 0 and Dialogic.get_variable("2_Death_Missing") != "White":
stringRus += "Джастина, "
stringEng += "Justin, "
if int(Dialogic.get_variable("Timeline129")) == 0:
stringRus += "Ренату, "
stringEng += "Renata, "
stringRus.trim_suffix(", ")
stringEng.trim_suffix(", ")
Dialogic.set_variable("TempTextRus", stringRus)
Dialogic.set_variable("TempTextEng", stringEng)
func Text4851():
if int(Dialogic.get_variable("Is_Gray_Dead")) == 0:
Dialogic.set_variable("TempTextRus", "Роберт")
Dialogic.set_variable("TempTextEng", "Robert")
else :
Dialogic.set_variable("TempTextRus", "Джастин")
Dialogic.set_variable("TempTextEng", "Justin")
func Text5411():
if int(Dialogic.get_variable("Is_Gray_Dead")) == 0:
Dialogic.set_variable("TempTextRus", "Роберт")
Dialogic.set_variable("TempTextEng", "Robert")
else :
Dialogic.set_variable("TempTextRus", "Джастин")
Dialogic.set_variable("TempTextEng", "Justin")
func Choice300712():
Dialogic.set_variable("TempTextRus", "huinya")
var stringRus1 = ""
var stringEng1 = ""
var stringRus2 = ""
var stringEng2 = ""
if int(Dialogic.get_variable("Is_White_Dead")) == 0:
stringRus1 += "Джастином, "
stringEng1 += "Justin, "
if int(Dialogic.get_variable("Is_Red_Dead")) == 0:
stringRus1 += "Александром, "
stringEng1 += "Alexander, "
if int(Dialogic.get_variable("Is_Green_Dead")) == 0:
stringRus1 += "Агатой, "
stringEng1 += "Agatha, "
if int(Dialogic.get_variable("Is_Orange_Dead")) == 0:
stringRus1 += "Ренатой, "
stringEng1 += "Renata, "
if int(Dialogic.get_variable("Is_Blue_F_Dead")) == 0:
stringRus2 += "Эмилией, "
stringEng2 += "Emilia, "
if int(Dialogic.get_variable("Is_Pink_Dead")) == 0:
stringRus2 += "Амандой, "
stringEng2 += "Amanda, "
if int(Dialogic.get_variable("Is_Black_Dead")) == 0:
stringRus2 += "Линдой, "
stringEng2 += "Linda, "
if int(Dialogic.get_variable("Is_Purple_Dead")) == 0:
stringRus2 += "Даной, "
stringEng2 += "Dana, "
stringRus1 = stringRus1.trim_suffix(", ")
stringEng1 = stringEng1.trim_suffix(", ")
stringRus2 = stringRus2.trim_suffix(", ")
stringEng2 = stringEng2.trim_suffix(", ")
Dialogic.set_variable("TempTextRus", stringRus1)
Dialogic.set_variable("TempTextEng", stringEng1)
Dialogic.set_variable("TempTextRus2", stringRus2)
Dialogic.set_variable("TempTextEng2", stringEng2)

View file

@ -0,0 +1,41 @@
extends Node2D
func _ready():
if not get_tree().root.has_node("Root"):
return ;
if Dialogic.get_variable("1_Death_Knife") == "Black":
GallerySingleton.AddImage("Black_Death_1");
elif Dialogic.get_variable("1_Death_Knife") == "Green":
GallerySingleton.AddImage("Green_Death_1");
var dialogicNode = get_parent().get_parent().get_node("Game").get_child(0).get_child(0)
dialogicNode.connect("dialogic_signal", self, "_lights_on_listener")
if Dialogic.get_variable("ItIsDay") == "false":
var sfxPath = "res://resources/audio/sfx/Rain Loop.ogg"
get_tree().root.get_node("Root").SetSFXforBGM(sfxPath)
else :
get_tree().root.get_node("Root").StopSFX();
func _lights_on_listener(string):
match string:
"lights_on":
TurnLightsOn()
func TurnLightsOn():
$TurnOn.visible = true;
$TurnOff.visible = false;
func InitForGallery()->Array:
scale = Vector2(0.75, 0.75)
return ["ui_lights_on", "ui_lights_off"];
func SetSettings(setting):
if setting == tr("ui_lights_on"):
$TurnOn.visible = true;
$TurnOff.visible = false;
else :
$TurnOn.visible = false;
$TurnOff.visible = true;

174
scripts/InGameLoadSave.gd Normal file
View file

@ -0,0 +1,174 @@
extends Control
enum InGameType{
Load = 0,
Save = 1
};
var slotScene = preload("res://resources/customControls/SaveSlot.tscn");
var type:int;
func _ready():
Init()
func Init():
var paginationContainer = $ButtonsContainer / Pagination;
for i in paginationContainer.get_child_count():
var btn:Button = paginationContainer.get_child(i);
btn.connect("pressed", self, "CreateSlots", [i]);
var backButton = $ButtonsContainer / HBoxContainer / BackToMenu;
backButton.text = tr("ui_back_to_game");
var autosave = $ButtonsContainer / HBoxContainer / LoadAutoSave;
autosave.text = tr("ui_load_autosave");
$Overwrite / RichTextLabel.bbcode_text = tr("ui_are_you_sure");
$Overwrite / ButtonYES.text = tr("ui_yes");
$Overwrite / ButtonNO.text = tr("ui_no");
var buttons = [$Overwrite / ButtonYES, $Overwrite / ButtonNO, $ButtonsContainer / HBoxContainer / BackToMenu, $ButtonsContainer / HBoxContainer / LoadAutoSave]
for i in buttons:
i.connect("mouse_entered", self, "_on_button_mouse_entered", [i]);
i.connect("mouse_exited", self, "_on_button_mouse_exited", [i]);
func CreateSlots(pageNumber:int):
var slotsContainer = $LoadGame / VBoxContainer;
for i in slotsContainer.get_children():
slotsContainer.remove_child(i);
var slotIndex = pageNumber * 8;
var slotLocalization = tr("ui_slot")
for i in 2:
var hContainer = HBoxContainer.new();
hContainer.set("custom_constants/separation", 448);
for j in 4:
slotIndex += 1;
var slot = slotScene.instance();
var slotname = str("slot", slotIndex);
slot.ResizeForInGame();
slot.Init(str(slotIndex), str(slotLocalization, " ", slotIndex));
if type == InGameType.Load:
slot.connect("SlotNameClicked", self, "_LoadSlotPressed", [slotname]);
slot.CheckIfDisabled();
else :
slot.connect("SlotNameClicked", self, "_SaveSlotPressed", [slotname]);
slot.Enable();
hContainer.add_child(slot);
slotsContainer.add_child(hContainer);
var paginationContainer = $ButtonsContainer / Pagination;
for i in paginationContainer.get_child_count():
var button = paginationContainer.get_child(i);
if i == pageNumber:
button.disabled = true;
button._on_Button_mouse_entered();
else :
button.disabled = false;
button._on_Button_mouse_exited();
func LoadPressed():
type = InGameType.Load;
$LoadGame / Label.text = tr("ui_ingame_loading");
$Overwrite.visible = false;
$ButtonsContainer / HBoxContainer / LoadAutoSave.visible = true;
$LoadGame.visible = true;
CreateSlots(0);
func SavePressed():
type = InGameType.Save;
$LoadGame / Label.text = tr("ui_ingame_saving");
$Overwrite.visible = false;
$ButtonsContainer / HBoxContainer / LoadAutoSave.visible = false;
$LoadGame.visible = true;
CreateSlots(0);
var overwriteSlotName
func _SaveSlotPressed(slotName):
var isOverWrite = OverWritesSave(slotName)
if not isOverWrite:
SaveSlot(slotName);
else :
overwriteSlotName = slotName;
$LoadGame.visible = false;
$Overwrite.visible = true;
func SaveSlot(slotName):
Dialogic.save(slotName)
get_parent().get_parent().get_parent().BackFromSaveLoad()
var timer = get_tree().create_timer(0.2);
yield (timer, "timeout")
SceneManagerSingleton.TakeScreenShot(slotName)
func _LoadSlotPressed(slotName):
var dialogic = get_tree().root.get_node("Root/Game").get_child(0).get_node("DialogNode")
if dialogic.isFastForwarding:
SettingsSingleton.SetSkipSeen(true);
if dialogic.isAutoRead:
SettingsSingleton.SetAutoRead(true);
var gameNode = get_tree().root.get_node("Root")
gameNode.LoadFromGame(slotName)
func _on_LoadAutoSave_pressed():
var gameNode = get_tree().root.get_node("Root")
gameNode.LoadFromGame("AutosaveCasual")
_on_button_mouse_exited($ButtonsContainer / HBoxContainer / LoadAutoSave);
func _on_BackToMenu_pressed():
$Overwrite.visible = false;
get_parent().get_parent().get_parent().BackFromSaveLoad()
_on_button_mouse_exited($ButtonsContainer / HBoxContainer / BackToMenu);
func OverWritesSave(slotName:String)->bool:
var directory = Directory.new();
var folderName = str(OS.get_user_data_dir(), "/dialogic/", slotName);
return directory.dir_exists(folderName);
func _on_ButtonYES_pressed():
$LoadGame.visible = true;
$Overwrite.visible = false;
SaveSlot(overwriteSlotName)
_on_button_mouse_exited($Overwrite / ButtonYES);
func _on_ButtonNO_pressed():
$LoadGame.visible = true;
$Overwrite.visible = false;
_on_button_mouse_exited($Overwrite / ButtonNO);
func _on_button_mouse_entered(button):
button.get("custom_fonts/font").outline_color = Color(213, 55, 29, 255)
button.set("custom_colors/font_color", Color(0, 0, 0, 255))
func _on_button_mouse_exited(button):
button.get("custom_fonts/font").outline_color = Color(0, 0, 0, 255)
button.set("custom_colors/font_color", Color(213, 55, 29, 255));

View file

@ -0,0 +1,78 @@
extends "res://scripts/Investigations/InvestigationBase.gd"
var descriptions:Array;
var variables = [
"Garage",
"Office",
"Kamin",
"Room",
"Smoking",
"Kitchen",
"Stairs",
"Lighthouse",
"Cliff",
"Parking",
"Pristan",
"Podval",
"Prichal",
"Restaurant",
"Tropa"
];
func _ready():
cluesToFind = 99;
func InitClues():
descriptions = [
"garage",
"office",
"kamin",
"room",
"smoking",
"kitchen",
"stairs",
"lighthouse",
"cliff",
"parking",
"pristan",
"podval",
"prichal",
"restaurant",
"tropa",
"exit"
];
cluesFound = [];
for i in $Clues.get_children().size():
var clue = $Clues.get_child(i) as TextureButton;
clue.connect("button_up", self, "onButtonPressed", [clue, i])
clue.connect("mouse_entered", self, "onButtonHoverOn", [clue]);
clue.connect("mouse_exited", self, "onButtonHoverOff", [clue]);
ShowImages();
func ShowImages():
var dict = ProgressAchievementsSingleton.CreateEpilogMinigameImages();
for i in dict:
var eName = i["name"].to_lower();
var node:TextureButton = get_node(str("Clues/", eName));
node.visible = true;
if i.has("location"):
node.rect_position = i["location"] / 2;
if i["status"] == false:
var index = $Clues.get_children().find(node);
if index != - 1:
descriptions[index] = "closed";
func onButtonPressed(control, index):
if CheckHover():
onButtonHoverOff(control)
var code = descriptions[index];
EndInvestigationLoop(code);

View file

@ -0,0 +1,81 @@
extends Control
signal endOfInvestigation;
var cluesFound = [];
var IsNormalDifficulty;
var cluesToFind = 0;
var isHovering;
var kekDelta = 0.0;
var shaderValue = 0.0;
var isRising;
var defaultCursor = preload("res://resources/cursors/arrow2.webp");
var lendsCursor = preload("res://resources/cursors/magnifier2.webp");
func _ready():
if Dialogic.get_variable("EasyMode") == "0":
cluesToFind = 3;
else :
cluesToFind = 5;
InitClues();
func InitClues():
pass
func EndInvestigationLoop(code):
if cluesFound.size() == cluesToFind:
Dialogic.set_variable("IsLastClue", "1");
elif cluesFound.size() == cluesToFind:
Dialogic.set_variable("IsLastClue", "1");
else :
Dialogic.set_variable("IsLastClue", "0");
Dialogic.set_variable("PreviousTimelineChoice", code);
emit_signal("endOfInvestigation");
func onButtonHoverOn(button):
if CheckHover():
Input.set_custom_mouse_cursor(lendsCursor, Input.CURSOR_ARROW, Vector2(19, 19))
button.material.set_shader_param("mixing", 0.15);
isHovering = true;
func onButtonHoverOff(button):
if CheckHover():
Input.set_custom_mouse_cursor(defaultCursor)
button.material.set_shader_param("mixing", 0.0);
isHovering = false;
func CheckHover()->bool:
return not (get_tree().root.get_node("Root").isMenuVisible or get_tree().root.get_node("Root").isSaveLoadVisible)
func _process(delta):
if IsNormalDifficulty:
return ;
if isHovering:
return ;
kekDelta += delta;
if kekDelta > 0.2:
kekDelta = 0;
if shaderValue <= 0.0:
isRising = true
if shaderValue >= 0.13:
isRising = false;
if isRising:
shaderValue += 0.005;
else :
shaderValue -= 0.005;
for i in $Clues.get_children():
i.material.set_shader_param("mixing", shaderValue);
else :
kekDelta += delta;

View file

@ -0,0 +1,24 @@
extends "res://scripts/Investigations/InvestigationBase.gd"
var descriptions = [
"black.1",
"black.2",
"black.3",
"black.4",
"black.5",
];
func InitClues():
cluesFound = InvestigationSingleton.GetBlackClues();
for i in $Clues.get_children().size():
var clues = $Clues.get_child(i) as TextureButton;
clues.connect("button_up", self, "onButtonPressed", [clues, descriptions[i]])
clues.connect("mouse_entered", self, "onButtonHoverOn", [clues]);
clues.connect("mouse_exited", self, "onButtonHoverOff", [clues]);
func onButtonPressed(control, code):
if CheckHover():
onButtonHoverOff(control)
InvestigationSingleton.AddBlackClues(code);
EndInvestigationLoop(code);

View file

@ -0,0 +1,24 @@
extends "res://scripts/Investigations/InvestigationBase.gd"
var descriptions = [
"green.1",
"green.2",
"green.3",
"green.4",
"green.5",
];
func InitClues():
cluesFound = InvestigationSingleton.GetGreenClues();
for i in $Clues.get_children().size():
var clue = $Clues.get_child(i) as TextureButton;
clue.connect("button_up", self, "onButtonPressed", [clue, descriptions[i]])
clue.connect("mouse_entered", self, "onButtonHoverOn", [clue]);
clue.connect("mouse_exited", self, "onButtonHoverOff", [clue]);
func onButtonPressed(control, code):
if CheckHover():
onButtonHoverOff(control)
InvestigationSingleton.AddGreenClues(code);
EndInvestigationLoop(code);

View file

@ -0,0 +1,25 @@
extends "res://scripts/Investigations/InvestigationBase.gd"
var descriptions = [
"purple.1",
"purple.2",
"purple.3",
"purple.4",
"purple.5",
];
func InitClues():
cluesFound = InvestigationSingleton.GetPurpleClues();
for i in $Clues.get_children().size():
var clue = $Clues.get_child(i) as TextureButton;
clue.connect("button_up", self, "onButtonPressed", [clue, descriptions[i]])
clue.connect("mouse_entered", self, "onButtonHoverOn", [clue]);
clue.connect("mouse_exited", self, "onButtonHoverOff", [clue]);
func onButtonPressed(control, code):
if CheckHover():
onButtonHoverOff(control)
InvestigationSingleton.AddPurpleClues(code);
EndInvestigationLoop(code);

View file

@ -0,0 +1,169 @@
extends "res://scripts/Investigations/InvestigationBase.gd"
var descriptions = [
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"10",
"11",
"12",
"13",
"14",
"15",
"16",
"17",
"18",
"19",
"20",
"21",
"22",
"23",
"24",
"25",
"26",
"27",
];
func _ready():
cluesToFind = 99;
func InitClues():
cluesFound = ProgressAchievementsSingleton.GetMinigameClues();
for i in descriptions.size():
var clue = $Clues.get_child(i) as TextureButton;
clue.connect("button_up", self, "onButtonPressed", [clue, descriptions[i]])
clue.connect("mouse_entered", self, "onButtonHoverOn", [clue]);
clue.connect("mouse_exited", self, "onButtonHoverOff", [clue]);
PrepareNewLogic();
func TimerOut():
EndInvestigationLoop("END");
func onButtonPressed(control, code):
if CheckHover():
onButtonHoverOff(control)
var number = ProgressAchievementsSingleton.AddMinigameClue(code);
# if number != - 1:
# if number == 25:
# Steam.set_achievement("FireMinigame")
# else :
# var res = Steam.user_stats.indicate_achievement_progress("FireMinigame", number, 25)
var res = false;
EndInvestigationLoop(code);
func PrepareNewLogic():
ProgressAchievementsSingleton.SetMinigameVariables();
var window = get_node("Clues/27");
window.disconnect("button_up", self, "onButtonPressed");
window.connect("button_up", self, "customWindow", [window, "27"]);
if ProgressAchievementsSingleton.IsWindowPressed():
var hammer = get_node("Clues/7");
hammer.disconnect("button_up", self, "onButtonPressed");
hammer.connect("button_up", self, "onButtonPressed", [hammer, "yellow_hammer"]);
var sledgehammer = get_node("Clues/21");
sledgehammer.disconnect("button_up", self, "onButtonPressed");
sledgehammer.connect("button_up", self, "onButtonPressed", [sledgehammer, "green_sledgehammer"]);
var wrench = get_node("Clues/11");
wrench.disconnect("button_up", self, "onButtonPressed");
wrench.connect("button_up", self, "onButtonPressed", [wrench, "orange_wrench"]);
if not ProgressAchievementsSingleton.IsCasketPressed():
var casket = get_node("Clues/8");
casket.disconnect("button_up", self, "onButtonPressed");
casket.connect("button_up", self, "customCasket", [casket, "8"]);
else :
var drawer = get_node("Clues/24");
drawer.disconnect("button_up", self, "onButtonPressed");
drawer.connect("button_up", self, "customDrawer", [drawer]);
if ProgressAchievementsSingleton.IsDrawerPressed():
var barrel = get_node("Clues/18")
barrel.disconnect("button_up", self, "onButtonPressed");
barrel.connect("button_up", self, "customBarrel", [barrel]);
if ProgressAchievementsSingleton.IsBarrelPressed() and not ProgressAchievementsSingleton.IsClosedTrapdoorPressed():
get_node("Clues/18").visible = false;
var trapdoor = get_node("Clues/28");
trapdoor.visible = true;
trapdoor.connect("mouse_entered", self, "onButtonHoverOn", [trapdoor]);
trapdoor.connect("mouse_exited", self, "onButtonHoverOff", [trapdoor]);
trapdoor.connect("button_up", self, "customClosedTrapdoor", [trapdoor]);
if ProgressAchievementsSingleton.IsClosedTrapdoorPressed():
get_node("Clues/18").visible = false;
var trapdoor = get_node("Clues/29");
trapdoor.visible = true;
trapdoor.connect("mouse_entered", self, "onButtonHoverOn", [trapdoor]);
trapdoor.connect("mouse_exited", self, "onButtonHoverOff", [trapdoor]);
trapdoor.connect("button_up", self, "onButtonPressed", [trapdoor, "openedTrapdoor"]);
func customWindow(control, code):
if not CheckHover():
return ;
ProgressAchievementsSingleton.WindowPressed();
onButtonPressed(control, code);
func customCasket(control, code):
if not CheckHover():
return ;
ProgressAchievementsSingleton.CasketPressed();
onButtonPressed(control, code);
func customDrawer(control):
if not CheckHover():
return ;
ProgressAchievementsSingleton.DrawerPressed();
onButtonPressed(control, "drawer");
func customBarrel(control):
if not CheckHover():
return ;
ProgressAchievementsSingleton.BarrelPressed();
onButtonPressed(control, "barrel");
func customClosedTrapdoor(control):
if not CheckHover():
return ;
ProgressAchievementsSingleton.ClosedTrapdoorPressed();
onButtonPressed(control, "closedTrapdoor");

768
scripts/KarmaMenu.gd Normal file
View file

@ -0,0 +1,768 @@
extends Control
signal ReturnToGameFromKarma
var maxKarma:float
var minKarma:float
var goodKarma:float
var veryGoodKarma:float
var chosen:bool
var debugCurrentChoice:String
var prevChoice:String
var deathArray = []
func _ready():
CheckForExplanation();
debugCurrentChoice = "None"
func Update():
SetButtonNames()
CheckDeath()
if debugCurrentChoice != "None":
SetIndicator(debugCurrentChoice)
SetProfileText(debugCurrentChoice)
var karmaString = debugCurrentChoice + "_Karma"
$Debug / LabelKarma.text = "Karma= " + Dialogic.get_variable(karmaString)
$Debug / LabelChosen.text = "Chosen= " + Dialogic.get_variable("Chosen_Girl")
var nodepath = "CharacterSprites/" + debugCurrentChoice
if (debugCurrentChoice != prevChoice and prevChoice != "None"):
var previospath = "CharacterSprites/" + prevChoice
get_node(previospath).visible = false
get_node(nodepath).visible = true
elif debugCurrentChoice != prevChoice:
get_node(nodepath).visible = true
func _on_ReturnToGameButton_pressed():
RemoveHover();
CloseExplanation();
emit_signal("ReturnToGameFromKarma");
func RemoveHover():
onButtonHoverOff($ReturnToGameButton)
for i in $CharButtons.get_children():
onButtonHoverOff(i);
func SetLanguage():
pass
func SetIndicator(string):
var charKarma
chosen = false
match string:
"Yellow":
maxKarma = 6
minKarma = - 1
goodKarma = 2
veryGoodKarma = 4
charKarma = float(Dialogic.get_variable("Yellow_Karma"))
"Orange":
maxKarma = 8
minKarma = - 1
goodKarma = 2
veryGoodKarma = 5
charKarma = float(Dialogic.get_variable("Orange_Karma"))
if Dialogic.get_variable("Chosen_Girl") == "Orange":
chosen = true
"Pink":
maxKarma = 8
minKarma = - 1
goodKarma = 2
veryGoodKarma = 4
charKarma = float(Dialogic.get_variable("Pink_Karma"))
if Dialogic.get_variable("Chosen_Girl") == "Pink":
chosen = true
"Green":
maxKarma = 8
minKarma = - 1
goodKarma = 2
veryGoodKarma = 4
charKarma = float(Dialogic.get_variable("Green_Karma"))
if Dialogic.get_variable("Chosen_Girl") == "Green":
chosen = true
"Purple":
maxKarma = 8
minKarma = - 1
goodKarma = 2
veryGoodKarma = 4
charKarma = float(Dialogic.get_variable("Purple_Karma"))
if Dialogic.get_variable("Chosen_Girl") == "Purple":
chosen = true
"Black":
maxKarma = 8
minKarma = - 1
goodKarma = 2
veryGoodKarma = 4
charKarma = float(Dialogic.get_variable("Black_Karma"))
if Dialogic.get_variable("Chosen_Girl") == "Black":
chosen = true
"Blue_F":
maxKarma = 8
minKarma = - 1
goodKarma = 2
veryGoodKarma = 4
charKarma = float(Dialogic.get_variable("Blue_F_Karma"))
if Dialogic.get_variable("Chosen_Girl") == "Blue":
chosen = true
"Red":
maxKarma = 6
minKarma = - 1
goodKarma = 2
veryGoodKarma = 4
charKarma = float(Dialogic.get_variable("Red_Karma"))
"White":
maxKarma = 6
minKarma = - 1
goodKarma = 2
veryGoodKarma = 4
charKarma = float(Dialogic.get_variable("White_Karma"))
"Blue_M":
maxKarma = 6
minKarma = - 1
goodKarma = 2
veryGoodKarma = 4
charKarma = float(Dialogic.get_variable("Blue_M_Karma"))
"Gray":
maxKarma = 6
minKarma = - 1
goodKarma = 2
veryGoodKarma = 4
charKarma = float(Dialogic.get_variable("Gray_Karma"))
SetPosition(charKarma)
if Dialogic.get_variable("EasyMode") == "1":
$Indicator.visible = true
$RamkaForIndicator.visible = true
$ReferencePoints.visible = true
$Background / Background2.visible = true
else :
$Indicator.visible = false
$RamkaForIndicator.visible = false
$ReferencePoints.visible = false
$Background / Background2.visible = false
func SetPosition(currentKarma):
$ReferencePoints / Zero.position.y = 100 + 710 * (maxKarma) / (maxKarma - minKarma)
$ReferencePoints / Good.position.y = 100 + 710 * (maxKarma - goodKarma) / (maxKarma - minKarma)
$ReferencePoints / VeryGood.position.y = 100 + 710 * (maxKarma - veryGoodKarma) / (maxKarma - minKarma)
var isDead = false
if debugCurrentChoice in deathArray:
isDead = true
if not isDead:
if currentKarma >= maxKarma:
$Indicator.position.y = 0
elif currentKarma <= minKarma:
$Indicator.position.y = 710
else :
$Indicator.position.y = 710 * (maxKarma - currentKarma) / (maxKarma - minKarma)
else :
$Indicator.position.y = 0
$ReferencePoints.visible = false
var currentNodePath = "CharacterSprites/" + debugCurrentChoice
var charNode = get_node(currentNodePath)
var characters = ProgressAchievementsSingleton.GetSeenCharacters()
for i in charNode.get_child_count():
charNode.get_child(i).visible = false
if not isDead:
if currentKarma < 0:
$Indicator.modulate = Color(0.05, 0.05, 0.05, 1)
elif (currentKarma < goodKarma and currentKarma >= 0):
$Indicator.modulate = Color(0.6, 0.6, 0.6, 1)
elif (currentKarma < veryGoodKarma and currentKarma >= goodKarma and goodKarma != veryGoodKarma):
$Indicator.modulate = Color(0.7, 0.7, 0.7, 1)
elif (currentKarma < maxKarma and currentKarma >= veryGoodKarma):
$Indicator.modulate = Color(0.9, 0.9, 0.9, 1)
else :
$Indicator.modulate = Color(1, 1, 1, 1)
else :
$Indicator.modulate = Color(0.0, 0.0, 0.0, 1)
if isDead:
$Chosen.visible = false
charNode.get_child(0).visible = true
charNode.get_child(0).material.set_shader_param("whiteInside", false)
elif chosen:
if Dialogic.get_variable("EasyMode") == "1":
$Chosen.visible = true
else :
$Chosen.visible = false
charNode.get_child(4).visible = true
elif not (debugCurrentChoice in characters):
charNode.get_child(0).visible = true
$Chosen.visible = false
else :
$Chosen.visible = false
if currentKarma < 0:
charNode.get_child(1).visible = true
elif (currentKarma < goodKarma and currentKarma >= 0):
charNode.get_child(2).visible = true
elif (currentKarma < veryGoodKarma and currentKarma >= goodKarma and goodKarma != veryGoodKarma):
charNode.get_child(2).visible = true
elif (currentKarma < maxKarma and currentKarma >= veryGoodKarma):
charNode.get_child(2).visible = true
else :
charNode.get_child(3).visible = true
func SetProfileText(string):
var textName = "[b]" + tr("ui_karma_name_label") + "[/b]"
var textHeigth = "[b]" + tr("ui_karma_height_label") + "[/b]"
var textAge = "[b]" + tr("ui_karma_age_label") + "[/b]"
var textStatus = ""
var textDescription = ""
var textCharacteristics = ""
var textAdditional = ""
var characters = ProgressAchievementsSingleton.GetSeenCharacters()
var profileTexts = ProgressAchievementsSingleton.GetProfileText()
if not (debugCurrentChoice in characters):
textName += tr("ui_karma_unknown")
else :
textName += tr("ui_name_" + string.to_lower())
textDescription += tr("ui_karma_" + string.to_lower() + "_description")
var dialogicNode = get_parent().get_parent().get_parent()
match string:
"Yellow":
textAge += tr("ui_karma_unknown")
textHeigth += tr("ui_karma_unknown")
if true:
textCharacteristics += tr("ui_karma_yellow_characteristics_1")
if "text3000.6.2" in profileTexts:
textCharacteristics += tr("ui_karma_yellow_characteristics_2")
if "text502.1.1" in profileTexts:
textCharacteristics += tr("ui_karma_yellow_characteristics_3")
if "text140.2.1" in profileTexts:
textCharacteristics += tr("ui_karma_yellow_characteristics_4")
if Dialogic.get_variable("Profile130.2") == "1":
if Dialogic.get_variable("Timeline108_2") == "1":
textAdditional += tr("ui_karma_yellow_additional_2_2")
else :
textAdditional += tr("ui_karma_yellow_additional_2_1")
if Dialogic.get_variable("Profile130.3") == "1":
textAdditional += tr("ui_karma_yellow_additional_3")
if Dialogic.get_variable("Profile130.4") == "1":
textAdditional += tr("ui_karma_yellow_additional_4")
if Dialogic.get_variable("Profile130.5") == "1":
textAdditional += tr("ui_karma_yellow_additional_5")
"Orange":
textAge += tr("ui_karma_unknown")
textHeigth += tr("ui_karma_unknown")
if "129.3" in profileTexts:
textCharacteristics += tr("ui_karma_orange_characteristics_1")
if "text3000.9.7" in profileTexts:
textCharacteristics += tr("ui_karma_orange_characteristics_2")
if "choice1568.1" in profileTexts:
textCharacteristics += tr("ui_karma_orange_characteristics_3")
if "text3011.2.7" in profileTexts:
textCharacteristics += tr("ui_karma_orange_characteristics_4")
if Dialogic.get_variable("Profile129.2") == "1":
textAdditional += tr("ui_karma_orange_additional_2")
if Dialogic.get_variable("Profile129.3") == "1":
var text = tr("ui_karma_orange_additional_3")
var final_text = DialogicParser.parse_definitions(dialogicNode, text)
textAdditional += final_text
if Dialogic.get_variable("Profile129.4") == "1":
var text = tr("ui_karma_orange_additional_4")
var final_text = DialogicParser.parse_definitions(dialogicNode, text)
textAdditional += final_text
if Dialogic.get_variable("Profile129.5") == "1":
textAdditional += tr("ui_karma_orange_additional_5")
if Dialogic.get_variable("Profile129.6") == "1":
textAdditional += tr("ui_karma_orange_additional_6")
"Pink":
if "text2155.2" in profileTexts:
textName += tr("ui_karma_pink_fullname")
if "text929.1" in profileTexts:
textAge += tr("ui_karma_pink_age")
else :
textAge += tr("ui_karma_unknown")
textHeigth += tr("ui_karma_unknown")
if "text3005.9.1" in profileTexts:
textCharacteristics += tr("ui_karma_pink_characteristics_1")
if true:
textCharacteristics += tr("ui_karma_pink_characteristics_2")
if "text29.4" in profileTexts:
textCharacteristics += tr("ui_karma_pink_characteristics_3")
if "text31.2" in profileTexts:
textCharacteristics += tr("ui_karma_pink_characteristics_4")
if "timeline121_a" in profileTexts:
textCharacteristics += tr("ui_karma_pink_characteristics_5")
if Dialogic.get_variable("Profile121a.2") == "1":
textAdditional += tr("ui_karma_pink_additional_2")
if Dialogic.get_variable("Profile121a.3") == "1":
if Dialogic.get_variable("Killer") != "Pink":
textAdditional += tr("ui_karma_pink_additional_3_1")
else :
textAdditional += tr("ui_karma_pink_additional_3_2")
if Dialogic.get_variable("Profile121a.4") == "1":
textAdditional += tr("ui_karma_pink_additional_4")
if Dialogic.get_variable("Profile121a.5") == "1":
textAdditional += tr("ui_karma_pink_additional_5")
"Green":
textAge += tr("ui_karma_unknown")
textHeigth += tr("ui_karma_unknown")
if "green_after_second_date" in profileTexts:
textCharacteristics += tr("ui_karma_green_characteristics_1")
if "choice47.4" in profileTexts:
textCharacteristics += tr("ui_karma_green_characteristics_2")
if "choice43.1" in profileTexts:
textCharacteristics += tr("ui_karma_green_characteristics_3")
if Dialogic.get_variable("Profile127.2") == "1":
textAdditional += tr("ui_karma_green_additional_2")
if Dialogic.get_variable("Profile127.3") == "1":
textAdditional += tr("ui_karma_green_additional_3")
if Dialogic.get_variable("Profile127.4") == "1":
var text = tr("ui_karma_green_additional_4")
var final_text = DialogicParser.parse_definitions(dialogicNode, text)
textAdditional += final_text
if Dialogic.get_variable("Profile127.5") == "1":
textAdditional += tr("ui_karma_green_additional_5")
if Dialogic.get_variable("Profile127.6") == "1":
textAdditional += tr("ui_karma_green_additional_6")
"Purple":
if "choice37.4" in profileTexts:
textAge += tr("ui_karma_purple_age")
else :
textAge += tr("ui_karma_unknown")
if "128.5" in profileTexts:
textHeigth += tr("ui_karma_purple_heigth") + "\""
else :
textHeigth += tr("ui_karma_unknown")
if "choice35.2" in profileTexts:
textCharacteristics += tr("ui_karma_purple_characteristics_1")
if "choice95.4" in profileTexts:
textCharacteristics += tr("ui_karma_purple_characteristics_2")
if "choice91.2" in profileTexts:
textCharacteristics += tr("ui_karma_purple_characteristics_3")
if "text3005.6.8" in profileTexts:
textCharacteristics += tr("ui_karma_purple_characteristics_4")
if "purple_after_first_date" in profileTexts:
textCharacteristics += tr("ui_karma_purple_characteristics_5")
if Dialogic.get_variable("Profile128.2") == "1":
textAdditional += tr("ui_karma_purple_additional_2")
if Dialogic.get_variable("Profile128.3") == "1":
textAdditional += tr("ui_karma_purple_additional_3")
if Dialogic.get_variable("Profile128.4") == "1":
textAdditional += tr("ui_karma_purple_additional_4")
if Dialogic.get_variable("Profile128.5") == "1":
textAdditional += tr("ui_karma_purple_additional_5")
if Dialogic.get_variable("Profile128.6") == "1":
textAdditional += tr("ui_karma_purple_additional_6")
"Black":
textAge += tr("ui_karma_unknown")
textHeigth += tr("ui_karma_unknown")
if "text53.1" in profileTexts:
textCharacteristics += tr("ui_karma_black_characteristics_1")
if "text52.1" in profileTexts:
textCharacteristics += tr("ui_karma_black_characteristics_2")
if "text76.4" in profileTexts:
textCharacteristics += tr("ui_karma_black_characteristics_3")
if "choice51.4" in profileTexts:
textCharacteristics += tr("ui_karma_black_characteristics_4")
if "choice78.5" in profileTexts:
textCharacteristics += tr("ui_karma_black_characteristics_5")
if "text1116.1" in profileTexts:
textCharacteristics += tr("ui_karma_black_characteristics_6")
if Dialogic.get_variable("Profile126.2") == "1":
textAdditional += tr("ui_karma_black_additional_2")
if Dialogic.get_variable("Profile126.3") == "1":
textAdditional += tr("ui_karma_black_additional_3")
if Dialogic.get_variable("Profile126.4") == "1":
textAdditional += tr("ui_karma_black_additional_4")
if Dialogic.get_variable("Profile126.5") == "1":
textAdditional += tr("ui_karma_black_additional_5")
if Dialogic.get_variable("Profile126.6") == "1":
textAdditional += tr("ui_karma_black_additional_6")
"Blue_F":
textAge += tr("ui_karma_unknown")
if "text646.5.1" in profileTexts:
textHeigth += tr("ui_karma_blue_f_heigth")
else :
textHeigth += tr("ui_karma_unknown")
if "text55.1.1" in profileTexts:
textCharacteristics += tr("ui_karma_blue_f_characteristics_1")
if "text59.4" in profileTexts:
textCharacteristics += tr("ui_karma_blue_f_characteristics_2")
if "timeline121" in profileTexts:
textCharacteristics += tr("ui_karma_blue_f_characteristics_3")
if "text1303.1" in profileTexts:
textCharacteristics += tr("ui_karma_blue_f_characteristics_4")
if "emilia_sex" in profileTexts:
textCharacteristics += tr("ui_karma_blue_f_characteristics_5")
if Dialogic.get_variable("Profile121.2") == "1":
textAdditional += tr("ui_karma_blue_f_additional_2")
if Dialogic.get_variable("Profile121.3") == "1":
if Dialogic.get_variable("Killer") != "Blue":
textAdditional += tr("ui_karma_blue_f_additional_3_1")
else :
textAdditional += tr("ui_karma_blue_f_additional_3_2")
if Dialogic.get_variable("Profile121.4") == "1":
if Dialogic.get_variable("2_Death_Missing") == "White":
textAdditional += tr("ui_karma_blue_f_additional_4_1")
elif Dialogic.get_variable("2_Death_Missing") == "Gray":
textAdditional += tr("ui_karma_blue_f_additional_4_2")
elif Dialogic.get_variable("2_Death_Missing") == "Red":
textAdditional += tr("ui_karma_blue_f_additional_4_3")
elif Dialogic.get_variable("2_Death_Missing") == "Blue_M":
textAdditional += tr("ui_karma_blue_f_additional_4_4")
if Dialogic.get_variable("Profile121.5") == "1":
textAdditional += tr("ui_karma_blue_f_additional_5")
"Red":
textAge += tr("ui_karma_unknown")
textHeigth += tr("ui_karma_unknown")
if "text3015.2.1" in profileTexts:
textCharacteristics += tr("ui_karma_red_characteristics_1")
if "text226.4.4" in profileTexts:
textCharacteristics += tr("ui_karma_red_characteristics_2")
if "text696.1+text3015.1.8" in profileTexts:
textCharacteristics += tr("ui_karma_red_characteristics_3")
if "text175.11" in profileTexts:
textCharacteristics += tr("ui_karma_red_characteristics_4")
if "text3008.7.3" in profileTexts:
textCharacteristics += tr("ui_karma_red_characteristics_5")
if Dialogic.get_variable("Profile124.2") == "1":
textAdditional += tr("ui_karma_red_additional_2")
if Dialogic.get_variable("Profile124.3") == "1":
textAdditional += tr("ui_karma_red_additional_3")
if Dialogic.get_variable("Profile124.4") == "1":
if Dialogic.get_variable("2_Death_Missing") == "Blue_M":
textAdditional += tr("ui_karma_red_additional_4_1")
elif Dialogic.get_variable("2_Death_Missing") == "White":
textAdditional += tr("ui_karma_red_additional_4_2")
elif Dialogic.get_variable("2_Death_Missing") == "Gray":
textAdditional += tr("ui_karma_red_additional_4_3")
if Dialogic.get_variable("Profile124.5") == "1":
textAdditional += tr("ui_karma_red_additional_5")
if Dialogic.get_variable("Profile124.6") == "1":
textAdditional += tr("ui_karma_red_additional_6")
"White":
textAge += tr("ui_karma_unknown")
textHeigth += tr("ui_karma_unknown")
if "text200.5+text3008.5.8" in profileTexts:
textCharacteristics += tr("ui_karma_white_characteristics_1")
if "text1207.1" in profileTexts:
textCharacteristics += tr("ui_karma_white_characteristics_2")
if "text671.1" in profileTexts:
textCharacteristics += tr("ui_karma_white_characteristics_3")
if "text1220.1" in profileTexts:
textCharacteristics += tr("ui_karma_white_characteristics_4")
if Dialogic.get_variable("Profile122.2") == "1":
textAdditional += tr("ui_karma_white_additional_2")
if Dialogic.get_variable("Profile122.3") == "1":
if Dialogic.get_variable("Profile129.2") == "1":
textAdditional += tr("ui_karma_white_additional_3_2")
else :
textAdditional += tr("ui_karma_white_additional_3_1")
if Dialogic.get_variable("Profile122.4") == "1":
if Dialogic.get_variable("2_Death_Missing") == "Blue_M":
textAdditional += tr("ui_karma_white_additional_4_1")
if Dialogic.get_variable("2_Death_Missing") == "Red":
textAdditional += tr("ui_karma_white_additional_4_1")
if Dialogic.get_variable("2_Death_Missing") == "Gray":
textAdditional += tr("ui_karma_white_additional_4_2")
if Dialogic.get_variable("Profile122.5") == "1":
textAdditional += tr("ui_karma_white_additional_5")
if Dialogic.get_variable("Profile122.6") == "1":
textAdditional += tr("ui_karma_white_additional_6")
"Blue_M":
textAge += tr("ui_karma_unknown")
textHeigth += tr("ui_karma_unknown")
if "text206.5.6" in profileTexts:
textCharacteristics += tr("ui_karma_blue_m_characteristics_1")
if "text707.5.1" in profileTexts:
textCharacteristics += tr("ui_karma_blue_m_characteristics_2")
if "text521.1+text521.1.1" in profileTexts:
textCharacteristics += tr("ui_karma_blue_m_characteristics_3")
if "text1240.1" in profileTexts:
textCharacteristics += tr("ui_karma_blue_m_characteristics_4")
if "text708.1" in profileTexts:
textCharacteristics += tr("ui_karma_blue_m_characteristics_5")
if Dialogic.get_variable("Profile125.2") == "1":
textAdditional += tr("ui_karma_blue_m_additional_2")
if Dialogic.get_variable("Profile125.3") == "1":
textAdditional += tr("ui_karma_blue_m_additional_3")
if Dialogic.get_variable("Profile125.4") == "1":
if Dialogic.get_variable("2_Death_Missing") == "Red":
textAdditional += tr("ui_karma_blue_m_additional_4_1")
if Dialogic.get_variable("2_Death_Missing") == "White":
textAdditional += tr("ui_karma_blue_m_additional_4_2")
if Dialogic.get_variable("2_Death_Missing") == "Gray":
textAdditional += tr("ui_karma_blue_m_additional_4_3")
if Dialogic.get_variable("Profile125.5") == "1":
textAdditional += tr("ui_karma_blue_m_additional_5")
if Dialogic.get_variable("Profile125.6") == "1":
textAdditional += tr("ui_karma_blue_m_additional_6")
"Gray":
textAge += tr("ui_karma_unknown")
textHeigth += tr("ui_karma_unknown")
if "text113.2" in profileTexts:
textCharacteristics += tr("ui_karma_gray_characteristics_1")
if "text17.1" in profileTexts:
textCharacteristics += tr("ui_karma_gray_characteristics_2")
if "text693.1" in profileTexts:
textCharacteristics += tr("ui_karma_gray_characteristics_3")
if "text1280.1" in profileTexts:
textCharacteristics += tr("ui_karma_gray_characteristics_4")
if "text211.7" in profileTexts:
textCharacteristics += tr("ui_karma_gray_characteristics_5")
if Dialogic.get_variable("Profile123.2") == "1":
if Dialogic.get_variable("Profile122.2") == "1":
textAdditional += tr("ui_karma_gray_additional_2_1")
else :
textAdditional += tr("ui_karma_gray_additional_2_2")
if Dialogic.get_variable("Profile123.3") == "1":
textAdditional += tr("ui_karma_gray_additional_3")
if Dialogic.get_variable("Profile123.4") == "1":
textAdditional += tr("ui_karma_gray_additional_4")
if Dialogic.get_variable("Profile123.5") == "1":
textAdditional += tr("ui_karma_gray_additional_5")
if Dialogic.get_variable("Profile123.6") == "1":
textAdditional += tr("ui_karma_gray_additional_6")
if textDescription != "":
textDescription = tr("ui_karma_description_label") + textDescription
if textCharacteristics != "":
textCharacteristics = tr("ui_karma_characteristics_label") + textCharacteristics
if textAdditional != "":
textAdditional = tr("ui_karma_additional_label") + textAdditional
if string in deathArray:
textStatus = "\n" + "[b]" + tr("ui_death_status") + "[/b]"
var deathType = deathArray.find(string)
match deathType:
0:
textStatus += tr("ui_death_knife")
1:
textStatus += tr("ui_death_missing")
2:
textStatus += tr("ui_death_electro")
3:
textStatus += tr("ui_death_fire")
4:
textStatus += tr("ui_death_poison")
5:
textStatus += tr("ui_death_stairs")
6:
textStatus += tr("ui_death_missing")
7:
textStatus += tr("ui_death_pistol")
8:
textStatus += tr("ui_death_knife")
9:
textStatus += tr("ui_death_pistol_2")
textStatus += "\n\n"
if debugCurrentChoice in characters:
$Ramka / Profile.bbcode_text = textName + "\n" + textAge + "\n" + textHeigth + "\n\n" + textStatus + textDescription + "\n\n" + textCharacteristics + "\n\n" + textAdditional
else :
$Ramka / Profile.bbcode_text = textName
func _on_Yellow_pressed():
prevChoice = debugCurrentChoice
debugCurrentChoice = "Yellow"
Update()
func _on_Orange_pressed():
prevChoice = debugCurrentChoice
debugCurrentChoice = "Orange"
Update()
func _on_Pink_pressed():
prevChoice = debugCurrentChoice
debugCurrentChoice = "Pink"
Update()
func _on_Green_pressed():
prevChoice = debugCurrentChoice
debugCurrentChoice = "Green"
Update()
func _on_Purple_pressed():
prevChoice = debugCurrentChoice
debugCurrentChoice = "Purple"
Update()
func _on_Black_pressed():
prevChoice = debugCurrentChoice
debugCurrentChoice = "Black"
Update()
func _on_Blue_F_pressed():
prevChoice = debugCurrentChoice
debugCurrentChoice = "Blue_F"
Update()
func _on_Red_pressed():
prevChoice = debugCurrentChoice
debugCurrentChoice = "Red"
Update()
func _on_White_pressed():
prevChoice = debugCurrentChoice
debugCurrentChoice = "White"
Update()
func _on_Blue_M_pressed():
prevChoice = debugCurrentChoice
debugCurrentChoice = "Blue_M"
Update()
func _on_Gray_pressed():
prevChoice = debugCurrentChoice
debugCurrentChoice = "Gray"
Update()
func _on_PlusKarma_pressed():
if debugCurrentChoice != "None":
var karmaString = debugCurrentChoice + "_Karma"
var newKarma = float(Dialogic.get_variable(karmaString)) + 0.5
Dialogic.set_variable(karmaString, newKarma)
Update()
func _on_MinusKarma_pressed():
if debugCurrentChoice != "None":
var karmaString = debugCurrentChoice + "_Karma"
var newKarma = float(Dialogic.get_variable(karmaString)) - 0.5
Dialogic.set_variable(karmaString, newKarma)
Update()
func _on_ChosenButton_pressed():
match debugCurrentChoice:
"Pink":
Dialogic.set_variable("Chosen_Girl", "Pink")
Dialogic.set_variable("Chosen_Karma", "Pink_Karma")
Update()
"Green":
Dialogic.set_variable("Chosen_Girl", "Green")
Dialogic.set_variable("Chosen_Karma", "Green_Karma")
Update()
"Blue_F":
Dialogic.set_variable("Chosen_Girl", "Blue")
Dialogic.set_variable("Chosen_Karma", "Blue_F_Karma")
Update()
"Black":
Dialogic.set_variable("Chosen_Girl", "Black")
Dialogic.set_variable("Chosen_Karma", "Black_Karma")
Update()
"Purple":
Dialogic.set_variable("Chosen_Girl", "Purple")
Dialogic.set_variable("Chosen_Karma", "Purple_Karma")
Update()
"Orange":
Dialogic.set_variable("Chosen_Girl", "Orange")
Dialogic.set_variable("Chosen_Karma", "Orange_Karma")
Update()
_:
Dialogic.set_variable("Chosen_Girl", "Loser")
Dialogic.set_variable("Chosen_Karma", "None")
Update()
func SetButtonNames():
var buttonNames = LanguageLocalization.GetKarmaButtonNames()
var characters = ProgressAchievementsSingleton.GetSeenCharacters()
for i in $CharButtons.get_child_count():
var button = $CharButtons.get_child(i);
if button.name in characters:
button.text = str(" ", tr(buttonNames[i]))
button.get_child(0).visible = true
else :
button.text = " ?????"
button.get_child(0).visible = false
if not button.is_connected("mouse_entered", self, "onButtonHoverOn"):
button.connect("mouse_entered", self, "onButtonHoverOn", [button]);
if not button.is_connected("mouse_exited", self, "onButtonHoverOff"):
button.connect("mouse_exited", self, "onButtonHoverOff", [button]);
$ReturnToGameButton.text = tr("ui_back_to_game")
if not $ReturnToGameButton.is_connected("mouse_entered", self, "onButtonHoverOn"):
$ReturnToGameButton.connect("mouse_entered", self, "onButtonHoverOn", [$ReturnToGameButton]);
if not $ReturnToGameButton.is_connected("mouse_exited", self, "onButtonHoverOff"):
$ReturnToGameButton.connect("mouse_exited", self, "onButtonHoverOff", [$ReturnToGameButton]);
func onButtonHoverOn(button):
(button as Button).get("custom_fonts/font").outline_color = Color(213, 55, 29, 255)
func onButtonHoverOff(button):
(button as Button).get("custom_fonts/font").outline_color = Color(0, 0, 0, 255)
func UpdateProfileText():
pass
func CheckDeath():
deathArray = []
var allDeaths = ["1_Death_Knife",
"2_Death_Missing",
"3_Death_Electricity",
"4_Death_Fire",
"6_Death_Poison",
"7_Death_Stairs",
"Renata",
"9_Death_Pistol",
"5_Wounded_Fire",
"RedWhite"
]
var deathIndex = int(Dialogic.get_variable("DeathIndex"))
if deathIndex >= 8:
if Dialogic.get_variable("Killer") == "Blue":
Dialogic.set_variable("9_Death_Pistol", "Pink")
else :
Dialogic.set_variable("9_Death_Pistol", "Blue_F")
if deathIndex < 1:
pass
elif deathIndex < 7:
for i in deathIndex:
deathArray.push_back(Dialogic.get_variable(allDeaths[i]))
elif deathIndex == 8:
for i in 6:
deathArray.push_back(Dialogic.get_variable(allDeaths[i]))
deathArray.push_back("Orange")
elif deathIndex < 10:
for i in 6:
deathArray.push_back(Dialogic.get_variable(allDeaths[i]))
deathArray.push_back("Orange")
for i in range(7, deathIndex):
deathArray.push_back(Dialogic.get_variable(allDeaths[i]))
else :
for i in 6:
deathArray.push_back(Dialogic.get_variable(allDeaths[i]))
deathArray.push_back("Orange")
for i in range(7, deathIndex):
deathArray.push_back(Dialogic.get_variable(allDeaths[i]))
if not ("Red" in deathArray):
deathArray.push_back("Red")
else :
deathArray.push_back("White")
func CheckForExplanation():
if SettingsSingleton.GetExplanation():
$Explanation / Text.text = tr("ui_karma_explanation");
$Explanation.visible = true;
# Steam.set_achievement("Karma_Explanation");
func CloseExplanation():
if $Explanation.visible:
_on_ExplanationClose_button_up()
func _on_ExplanationClose_button_up():
$Explanation.visible = false;
SettingsSingleton.SetExplanation(false);

View file

@ -0,0 +1,250 @@
extends Node
var languages = [
{"name":"English", "locale":"en"},
{"name":"Русский", "locale":"ru"},
]
func GetLanguages():
return languages;
func SetLanguages(languageLocale):
SettingsSingleton.SetCurrentLanguage(languageLocale);
func GetLanguageIndex():
var locale = SettingsSingleton.GetCurrentLanguage();
for i in languages.size():
if languages[i].locale == locale:
return i;
return 0;
var voiceOverLanguages = [
{"name":"English", "locale":"en"},
{"name":"Русский", "locale":"ru"},
{"name":"None", "locale":"none"},
]
func GetVoiceLanguages():
return voiceOverLanguages;
func GetVoiceLanguageIndex():
var locale = SettingsSingleton.GetVoiceoverLanguage();
for i in voiceOverLanguages.size():
if voiceOverLanguages[i].locale == locale:
return i;
return 1;
var localization = {
"ReturnToGameButton":"ui_back_to_game",
"BackToMenuButton":"ui_back_to_menu",
"ApplyButton":"ui_apply",
"AllSettingsView/VideoButton":"ui_video",
"AllSettingsView/AudioButton":"ui_audio",
"AllSettingsView/TextButton":"ui_text",
"AllSettingsView/LanguageButton":"ui_text_language",
"AllSettingsView/TwitchButton":"ui_twitch",
"VideoSettingsView/WindowStates/WindowedCheck":"ui_windowed",
"VideoSettingsView/WindowStates/BorderlessCheck":"ui_borderless",
"VideoSettingsView/WindowStates/FullscreenCheck":"ui_fullscreen",
"VideoSettingsView/WindowResolutionLabel":"ui_resolution",
"VideoSettingsView/LowProcessor":"ui_low_processor",
"VideoSettingsView/SyncBackground":"ui_sync_background",
"VideoSettingsView/ScalingMessage":"ui_scale_error_message",
"AudioSettingsView/GeneralVolumeSlider":"ui_general_volume",
"AudioSettingsView/MusicVolumeSlider":"ui_music_volume",
"AudioSettingsView/DialogueVolumeSlider":"ui_dialogue_volume",
"AudioSettingsView/EffectsVolumeSlider":"ui_effects_volume",
"TextSettingsView/AutoReadCheck":"ui_autoread",
"TextSettingsView/SkipSeenCheck":"ui_skipseen",
"TextSettingsView/TextSpeedSlider":"ui_text_speed",
"TextSettingsView/ThemeCheck":"ui_text_themecheck",
"TextSettingsView/CustomTheme/Text/TextColor":"ui_text_color",
"TextSettingsView/CustomTheme/Back/Background":"ui_text_background",
"TextSettingsView/CustomTheme/Example/Label":"ui_text_sample",
"LanguageSettingsView/InterfaceAndTextLabel":"ui_lang_interface_text",
"LanguageSettingsView/VoiceLanguageLabel":"ui_lang_voiceover",
"LanguageSettingsView/Voiceover/VBoxContainer/None":"ui_lang_voiceover_none",
"TwitchSettingsView/TwitchCheck":"ui_twitch_enable",
"TwitchSettingsView/ChannelLabel":"ui_twitch_channel",
"TwitchSettingsView/TwitchStatus":"ui_twitch_conn_tool",
"TwitchSettingsView/StatusContainer/CheckConnectionButton":"ui_twitch_check_connection",
"TwitchSettingsView/TimerSlider":"ui_twitch_time",
};
func GetLocalization():
return localization;
var mainMenu = [
"ui_continue",
"ui_new_game",
"ui_options",
"ui_credits",
"ui_gallery",
"ui_exit",
];
func GetMainMenuButtons():
return mainMenu;
var altTimeline17 = [
"ui_name_green",
"ui_name_black",
"ui_name_purple",
"ui_name_blue_f",
"ui_name_pink",
"ui_date_deny"
];
func GetAlternativeTimeline17():
return altTimeline17;
var slotMenu = [
"ui_slot_auto_normal",
"ui_slot_auto_casual",
];
func GetSlotMenuButtons():
return slotMenu;
var mapLocalization = {
"Map/Inside/Places/Gl-Rest/Label":"ui_map_dining_hall",
"Map/Inside/Places/Exit/Label":"ui_map_exit",
"Map/Inside/Places/Garage/Label":"ui_map_garage",
"Map/Inside/Places/Kitchen/Label":"ui_map_kitchen",
"Map/Inside/Places/OfficeH/Label":"ui_map_office",
"Map/Inside/Places/Basement/Label":"ui_map_basement",
"Map/Inside/Places/Room1/Label":"ui_map_room_1",
"Map/Inside/Places/Room2/Label":"ui_map_room_2",
"Map/Inside/Places/Room3/Label":"ui_map_room_3",
"Map/Inside/Places/Room4/Label":"ui_map_room_4",
"Map/Inside/Places/Room5/Label":"ui_map_room_5",
"Map/Inside/Places/Smoking/Label":"ui_map_smoking",
"Map/Inside/Places/Second":"ui_map_second_floor",
"Map/Inside/Places/Third":"ui_map_third_floor",
};
func GetMapLocalization():
return mapLocalization;
var girlNames = {
"Pink_Karma":"ui_name_pink",
"Purple_Karma":"ui_name_purple",
"Green_Karma":"ui_name_green",
"Black_Karma":"ui_name_black",
"Blue_F_Karma":"ui_name_blue_f"
};
func GetGirlNames():
return girlNames;
var boysNames = {
"White_Karma":"ui_name_white",
"Gray_Karma":"ui_name_gray",
"Red_Karma":"ui_name_red",
"Blue_M_Karma":"ui_name_blue_m",
};
func GetBoysNames():
return boysNames;
var karmaMenu = [
"ui_name_yellow",
"ui_name_orange",
"ui_name_pink",
"ui_name_green",
"ui_name_purple",
"ui_name_black",
"ui_name_blue_f",
"ui_name_red",
"ui_name_white",
"ui_name_blue_m",
"ui_name_gray"
];
func GetKarmaButtonNames():
return karmaMenu;
var charNames = {
"Pink":"ui_name_pink",
"Purple":"ui_name_purple",
"Green":"ui_name_green",
"Black":"ui_name_black",
"Blue_F":"ui_name_blue_f",
"White":"ui_name_white",
"Gray":"ui_name_gray",
"Red":"ui_name_red",
"Blue_M":"ui_name_blue_m",
"Yellow":"ui_name_yellow"
}
func GetCharNames():
return charNames;
var dialogicNames = {
"Линда":"ui_name_black",
"Эмилия":"ui_name_blue_f",
"Агата":"ui_name_green",
"Рената":"ui_name_orange",
"Аманда":"ui_name_pink",
"Дана":"ui_name_purple",
"Сестра":"ui_name_sister",
"Дженни":"ui_name_jenny",
"Эльза":"ui_name_elsa",
"Мартин":"ui_name_blue_m",
"Роберт":"ui_name_gray",
"Хью":"ui_name_mc",
"Александр":"ui_name_red",
"Джастин":"ui_name_white",
"Генри":"ui_name_yellow",
"Старик":"ui_name_oldman",
"Следователь":"ui_name_interrogator",
};
func GetDialogicNames():
return dialogicNames;
var gameEndings = {
"Timeline_Alt_1":"ui_game_end_question",
"Timeline_epilogue":"ui_game_end_victory",
"Timeline_29":"ui_game_end_stabbed",
"Timeline_36":"ui_game_end_crashed",
"Timeline_132":"ui_game_end_electrocuted",
"Timeline_139":"ui_game_end_burned",
"Timeline_peremoga":"ui_game_end_burned",
"Timeline_154":"ui_game_end_poisoned",
"Timeline_157_death":"ui_game_end_drowned",
"Timeline_157_happyend":"ui_game_end_survived",
"Timeline_157_happyend_rw":"ui_game_end_survived",
"Timeline_164":"ui_game_end_broken_neck",
"Timeline_167":"ui_game_end_shot_down",
"Timeline_157_pink_1":"ui_game_end_survived",
"Timeline_167w":"ui_game_end_shot_down",
"Timeline_173":"ui_game_end_shot_down",
"Timeline_173w":"ui_game_end_shot_down",
"Timeline_174":"ui_game_end_shot_down",
"Timeline_174w":"ui_game_end_shot_down",
"Timeline_178":"ui_game_end_strangled",
"Timeline_180":"ui_game_end_strangled",
"Timeline_185_1":"ui_game_end_shot_down",
"Timeline_186_1":"ui_game_end_shot_down",
"Timeline_185_2":"ui_game_end_shot_down",
"Timeline_186_2":"ui_game_end_shot_down",
"Timeline_EasterZakviel":"ui_game_end_rock",
"Timeline_172":"ui_game_end_survived"
};
func GetGameEndings():
return gameEndings;

31
scripts/Lens.gd Normal file
View file

@ -0,0 +1,31 @@
extends Node2D
var zoomIncrement = - 0.05;
var zoom = 0.38;
var xOffset;
var yOffset;
var screenWidth;
var screenHeight;
func _ready():
screenWidth = SettingsSingleton.GetCurrectScreenResolutionVector2().x
screenHeight = SettingsSingleton.GetCurrectScreenResolutionVector2().y
func _process(_delta):
xOffset = (1 - zoom) * (self.get_parent().get_global_transform_with_canvas().origin.x) / screenWidth;
yOffset = (1 - zoom) * (screenHeight - self.get_parent().get_global_transform_with_canvas().origin.y) / screenHeight;
var tiling = Vector2(zoom, zoom);
var offset = Vector2(xOffset, yOffset);
self.material.set_shader_param("offset", offset);
self.material.set_shader_param("tiling", tiling);

7
scripts/Lens_move.gd Normal file
View file

@ -0,0 +1,7 @@
extends Node2D
func _process(_delta):
self.position = get_global_mouse_position() / get_parent().get_scale().x;

193
scripts/LoadingScene.gd Normal file
View file

@ -0,0 +1,193 @@
extends Node2D
var MenuScene;
func _ready():
SettingsSingleton.CheckVideoSettings();
SettingsSingleton.CheckAudioSettings();
SettingsSingleton.CheckDLC();
if SettingsSingleton.GetFirstStartup():
FirstStartup();
InitMenu();
return ;
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
SettingsSingleton.CheckCurrentLanguage();
$Text.text = tr("ui_loading");
InitMenu();
func FirstStartup():
var _temp = SceneLoader.connect("on_scene_loaded", self, "LangLoaded")
SceneLoader.load_scene("res://scenes/SelectLanguageScene.tscn");
func LangLoaded(obj):
if obj.path == "res://scenes/SelectLanguageScene.tscn":
visible = false;
get_tree().root.add_child(obj.instance);
SceneLoader.disconnect("on_scene_loaded", self, "LangLoaded");
func InitMenu():
var _temp = SceneLoader.connect("on_scene_loaded", self, "MenuLoaded")
var scenes = [
"res://scenes/MainMenu.tscn",
"res://scenes/SettingsScene.tscn",
]
for i in scenes:
SceneLoader.load_scene(i);
var loadIndex = 0;
func MenuLoaded(obj):
loadIndex += 1;
if obj.path == "res://scenes/MainMenu.tscn":
MenuScene = obj.instance;
if loadIndex == 2:
visible = false;
get_tree().root.add_child(MenuScene);
SceneLoader.disconnect("on_scene_loaded", self, "MenuLoaded");
const commonScenes:Array = [
"res://scenes/BackgroundScenes/Scene2.tscn",
"res://scenes/BackgroundScenes/Scene2_1.tscn",
"res://scenes/BackgroundScenes/Panorama.tscn",
"res://scenes/BackgroundScenes/Garaj.tscn",
"res://scenes/BackgroundScenes/Kamin.tscn",
"res://scenes/BackgroundScenes/Death_stairs_girl.tscn",
"res://scenes/BackgroundScenes/Chernii_ekran.tscn",
"res://scenes/GameEnd/WinScene.tscn",
"res://scenes/GameEnd/LooseScene.tscn",
];
onready var commonScenesThread:Thread;
var commonScenesLoaded:bool = false;
func LoadCommonScenes():
if commonScenesLoaded:
return ;
commonScenesThread = Thread.new();
commonScenesThread.start(self, "PrepareCommonScenes", commonScenes, Thread.PRIORITY_LOW);
func PrepareCommonScenes(scenes:Array):
commonScenesLoaded = true;
for i in scenes:
if commonSceneLoadStop:
return ;
var _n = load(i);
func _exit_tree():
commonScenesThread.wait_to_finish()
func LoadBeginningScenes():
var beginningScenes = [
"res://scenes/BackgroundScenes/Scene0.tscn",
"res://scenes/BackgroundScenes/Scene8.tscn",
"res://scenes/BackgroundScenes/Train_video.tscn",
"res://scenes/BackgroundScenes/Scene7.tscn",
"res://scenes/BackgroundScenes/Scene6.tscn",
"res://scenes/BackgroundScenes/Scene4.tscn",
];
for i in beginningScenes:
SceneLoader.load_scene(i);
func ShowLoader():
$Text.text = tr("ui_loading");
visible = true;
var commonSceneLoadStop:bool = false;
onready var exitLabel = $ExitLabel;
func PrepareExit():
ShowLoader();
exitLabel.visible = true;
SceneLoader.stop_scene_loader();
get_tree().root.get_node("MainMenu").queue_free();
commonSceneLoadStop = true;
var temp;
func BenchmarkScene():
var scenes = [
"res://scenes/Credits.tscn",
];
if false:
SceneLoader.clear_cache();
temp = OS.get_ticks_msec();
for i in scenes:
PrepareBackgroundAsync(i);
else :
for i in scenes:
temp = OS.get_ticks_msec();
var _scene = load(i).instance();
_scene = null;
print(str(i, " ", OS.get_ticks_msec() - temp, " ms"));
func PrepareBackgroundAsync(sceneName:String):
if not SceneLoader.is_connected("on_scene_loaded", self, "async_scene_loaded"):
var _temp = SceneLoader.connect("on_scene_loaded", self, "async_scene_loaded")
SceneLoader.load_scene(sceneName);
func async_scene_loaded(_obj):
print(OS.get_ticks_msec() - temp, " ms");

533
scripts/MainMenu.gd Normal file
View file

@ -0,0 +1,533 @@
extends Node2D
onready var menuButtons = $"MenuButtons";
onready var background = $"Background";
onready var saveButtons = $"SlotMenu/LoadGameSlots"
onready var arrowCursor = preload("res://resources/cursors/arrow2.webp");
var EnableDebug = true;
const labelVersion:String = "v1.5";
var windowSize;
var slotName;
var tempScene;
var haveSavedGame
var isMenuZooming;
func _ready():
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
Input.set_custom_mouse_cursor(arrowCursor)
CheckHaveStates();
haveSavedGame = SettingsSingleton.GetHaveSave();
windowSize = SettingsSingleton.GetCurrectScreenResolutionVector2()
SetClouds();
SetBackground();
SetCamera();
if SettingsSingleton.MainOpenCount == 0:
isMenuZooming = true;
yield ($Camera2D / Tween, "tween_all_completed");
isMenuZooming = false;
SettingsSingleton.MainOpenCount = 1;
if SettingsSingleton.MainOpenCount == 1:
$Background / Rain.material.set_shader_param("isON", true)
SetButtons();
InitSlots();
InitBirds();
get_tree().root.get_node("Loading").LoadCommonScenes();
if not SceneLoader.is_connected("on_scene_loaded", self, "OpenAnotherScene"):
var _temp = SceneLoader.connect("on_scene_loaded", self, "OpenAnotherScene")
func SetButtons():
var uiLocalization = LanguageLocalization.GetMainMenuButtons();
for i in menuButtons.get_child_count():
var temp = (menuButtons.get_child(i) as Button);
temp.text = uiLocalization[i];
changeFontSize(temp);
temp.connect("mouse_entered", self, "onButtonHoverOn", [temp]);
temp.connect("mouse_exited", self, "onButtonHoverOff", [temp]);
if i == 0:
if haveSavedGame:
temp.rect_size = temp.get_font("res://resources/fonts/OneEleven.ttf").get_string_size(temp.text);
temp.rect_position = PositionButton(temp.rect_size, null);
temp.visible = true;
else :
temp.visible = false;
else :
temp.rect_size = temp.get_font("res://resources/fonts/OneEleven.ttf").get_string_size(temp.text);
temp.rect_position = PositionButton(temp.rect_size, menuButtons.get_child(i - 1));
var debugButton = $Debug / Debug
changeFontSize(debugButton)
debugButton.rect_size = debugButton.get_font("font").get_string_size(debugButton.text);
debugButton.rect_position = Vector2(windowSize.x - debugButton.rect_size.x, windowSize.y - debugButton.rect_size.y)
$Debug.visible = EnableDebug;
$MenuButtons.visible = true;
$Logo.visible = true;
$Logo / VersionLabel.text = labelVersion;
CheckDLC();
func onButtonHoverOn(button):
(button as Button).get("custom_fonts/font").outline_color = Color(213, 55, 29, 255)
func onButtonHoverOff(button):
(button as Button).get("custom_fonts/font").outline_color = Color(0, 0, 0, 255)
var positionButtonIndex = 0;
func PositionButton(buttonSize, prevSize):
var topMargin = 0;
if prevSize != null:
topMargin = prevSize.rect_size.y;
var position = Vector2(
windowSize.x * 0.85 - buttonSize.x / 2,
windowSize.y * 0.13 + topMargin * positionButtonIndex * 1.55);
positionButtonIndex += 1;
return position;
func _on_Continue_pressed():
menuButtons.visible = false;
RemoveHover();
$SlotMenu / Blur.material.set_shader_param("blur_amount", 2.0);
$SlotMenu.visible = true;
$SlotMenu / LoadGameSlots.visible = true;
$SlotMenu / BackToMenuFromSlotContainer / BackToMenuFromSlots.visible = true;
$SlotMenu / BackToMenuFromSlotContainer / DifficultyLabel.visible = false
$SlotMenu / NewGameSlots.visible = false;
$SlotMenu / Overwrite.visible = false;
func _on_NewGame_pressed():
menuButtons.visible = false;
RemoveHover();
$SlotMenu / Blur.material.set_shader_param("blur_amount", 2.0);
$SlotMenu.visible = true;
$SlotMenu / NewGameSlots.visible = true;
$SlotMenu / BackToMenuFromSlotContainer / BackToMenuFromSlots.visible = true;
$SlotMenu / BackToMenuFromSlotContainer / DifficultyLabel.visible = true
$SlotMenu / LoadGameSlots.visible = false;
$SlotMenu / Overwrite.visible = false;
var loadingPath = "";
func LoadScene(path):
SceneLoader.load_scene(path);
loadingPath = path;
for i in menuButtons.get_children():
onButtonHoverOff(i);
func _on_Options_pressed():
LoadScene("res://scenes/SettingsScene.tscn")
func _on_Debug_pressed():
LoadScene("res://scenes/DebugScene.tscn");
func _on_Credits_pressed():
LoadScene("res://scenes/Credits.tscn");
func _on_Gallery_pressed():
var temp = load("res://scenes/Gallery.tscn").instance();
get_tree().root.add_child(temp);
for i in menuButtons.get_children():
onButtonHoverOff(i);
CloseMenu();
func OpenAnotherScene(obj):
if obj.path == loadingPath:
get_tree().root.add_child(obj.instance);
CloseMenu();
func CloseMenu():
for i in get_tree().root.get_children():
if i.name == "MainMenu":
get_tree().root.remove_child(i);
break;
SceneLoader.disconnect("on_scene_loaded", self, "OpenAnotherScene");
func _on_Exit_pressed():
get_tree().root.get_node("Loading").PrepareExit();
get_tree().notification(MainLoop.NOTIFICATION_WM_QUIT_REQUEST)
get_tree().call_deferred("quit");
func SetBackground():
var backgroundsSize = Vector2(3840, 2160);
var scaleX = 1 / float(backgroundsSize.x / windowSize.x);
var scaleY = 1 / float(backgroundsSize.y / windowSize.y);
for i in background.get_child_count():
var temp = (background.get_child(i) as Node2D);
temp.scale = Vector2(scaleX, scaleY);
$RainDropEffect.set_polygon(PoolVector2Array([
Vector2(0, 0),
Vector2(0, windowSize.y),
Vector2(windowSize.x, windowSize.y),
Vector2(windowSize.x, 0)
]))
func changeFontSize(button:Button):
var font = button.get_font("font");
var fontSize = round(0.0708 * windowSize.y - 6.3);
font.size = fontSize;
font.outline_size = int(0.00555556 * windowSize.y - 3);
button.add_font_override("font", font);
onready var noDlcLabel:Label = $Logo / NoDlcLabel;
onready var dlcCheck:CheckBox = $DLCContainer / DLCCheck;
func CheckDLC():
dlcCheck.text = tr("ui_use_dlc");
dlcCheck.visible = SettingsSingleton.GetDLC();
dlcCheck.pressed = SettingsSingleton.GetUseDlc();
noDlcLabel.text = tr("ui_give_feedback");
noDlcLabel.visible = not SettingsSingleton.GetDLC();
func _on_DLCCheck_toggled(button_pressed:bool):
SettingsSingleton.SetUseDlc(button_pressed);
SettingsSingleton.SaveSettings();
func _on_DLCCheck_mouse_entered():
if dlcCheck.pressed:
dlcCheck.get("custom_fonts/font").outline_color = Color8(128, 128, 128, 255)
else :
dlcCheck.get("custom_fonts/font").outline_color = Color8(213, 213, 213, 255)
func _on_DLCCheck_mouse_exited():
dlcCheck.get("custom_fonts/font").outline_color = Color8(0, 0, 0, 255)
func InitSlots():
var newNormal = $SlotMenu / NewGameSlots / VBoxContainer / Normal
newNormal.Init("Normal");
newNormal.connect("pressed", self, "onNewSlotPressed", ["AutosaveCasual"]);
var newHard = $SlotMenu / NewGameSlots / VBoxContainer / Hard;
newHard.Init("Hard");
newHard.connect("pressed", self, "onNewSlotPressed", ["AutosaveNormal"]);
var uiLocalization = LanguageLocalization.GetSlotMenuButtons();
var loadAutosaveNormal = $SlotMenu / LoadGameSlots / HBoxContainer / VBoxContainer / AutosaveNormal;
loadAutosaveNormal.connect("SlotNameClicked", self, "onLoadSlotPressed", ["AutosaveNormal"]);
loadAutosaveNormal.Init("AutosaveNormal", tr(uiLocalization[0]));
loadAutosaveNormal.CheckIfDisabled();
var loadAutosaveCasual = $SlotMenu / LoadGameSlots / HBoxContainer / VBoxContainer / AutosaveCasual;
loadAutosaveCasual.connect("SlotNameClicked", self, "onLoadSlotPressed", ["AutosaveCasual"]);
loadAutosaveCasual.Init("AutosaveCasual", tr(uiLocalization[1]));
loadAutosaveCasual.CheckIfDisabled();
CreateSlots(0);
var paginationContainer = $SlotMenu / LoadGameSlots / HBoxContainer / Control / Pagination;
for i in paginationContainer.get_child_count():
var btn:Button = paginationContainer.get_child(i);
btn.connect("pressed", self, "_on_slot_Page_pressed", [i]);
$SlotMenu / Blur.set_polygon(PoolVector2Array([
Vector2(0, 0),
Vector2(0, windowSize.y),
Vector2(windowSize.x, windowSize.y),
Vector2(windowSize.x, 0)
]))
var backbutton = $SlotMenu / BackToMenuFromSlotContainer / BackToMenuFromSlots
var difficultyLabel = $SlotMenu / BackToMenuFromSlotContainer / DifficultyLabel
backbutton.text = tr("ui_back_to_menu");
difficultyLabel.text = tr("ui_difficulty_text");
var buttonHeight = backbutton.get_font("font").get_string_size(backbutton.text).y;
backbutton.rect_global_position = Vector2(30, 1080 - 20 - buttonHeight);
backbutton.connect("mouse_entered", self, "onButtonHoverOn", [backbutton]);
backbutton.connect("mouse_exited", self, "onButtonHoverOff", [backbutton]);
var slotScene = preload("res://resources/customControls/SaveSlot.tscn");
func CreateSlots(pageNumber:int):
var slotIndex = pageNumber * 4;
var slotsContainer = $SlotMenu / LoadGameSlots / HBoxContainer / Control / VBoxContainer;
var slotLocalization = tr("ui_slot")
for i in 2:
var hContainer = HBoxContainer.new();
hContainer.set("custom_constants/separation", 605);
for j in 2:
slotIndex += 1;
var slot = slotScene.instance();
var slotname = str("slot", slotIndex);
slot.connect("SlotNameClicked", self, "onLoadSlotPressed", [slotname]);
slot.Init(str(slotIndex), str(slotLocalization, " ", slotIndex));
slot.CheckIfDisabled();
hContainer.add_child(slot);
slotsContainer.add_child(hContainer);
var paginationContainer = $SlotMenu / LoadGameSlots / HBoxContainer / Control / Pagination
for i in paginationContainer.get_child_count():
var button = paginationContainer.get_child(i);
if i == pageNumber:
button.disabled = true;
button._on_Button_mouse_entered();
else :
button.disabled = false;
button._on_Button_mouse_exited();
func _on_slot_Page_pressed(number):
var slotsContainer = $SlotMenu / LoadGameSlots / HBoxContainer / Control / VBoxContainer;
for i in slotsContainer.get_children():
slotsContainer.remove_child(i);
CreateSlots(number);
func onLoadSlotPressed(slotNameVar):
slotName = slotNameVar;
loadGame();
func loadGame():
Dialogic.load(slotName)
if slotName == "AutosaveNormal":
Dialogic.set_variable("EasyMode", 0)
else :
Dialogic.set_variable("EasyMode", 1)
Dialogic.set_variable("SaveSlotName", "AutosaveCasual")
Dialogic.set_variable("NeedCharacter", 1)
get_tree().root.get_node("Loading").ShowLoader();
SceneLoader.free_scene_cache("Game");
LoadScene("res://scenes/Game.tscn");
func onNewSlotPressed(slotNameVar:String):
slotName = slotNameVar;
get_tree().root.get_node("Loading").LoadBeginningScenes();
newGame()
func newGame():
Dialogic.erase_slot(slotName)
Dialogic.reset_saves(slotName)
Dialogic.set_variable("SaveSlotName", slotName)
Dialogic.set_variable("NeedCharacter", 1)
if slotName == "AutosaveNormal":
Dialogic.set_variable("EasyMode", 0)
else :
Dialogic.set_variable("EasyMode", 1)
$SlotMenu.visible = false;
LoadScene("res://scenes/ChapterSelector.tscn")
BackgroundFade();
func BackgroundFade():
$Darkening.visible = true;
$Darkening.Fade(true);
func CheckHaveStates():
var directory = Directory.new();
var defaultFolder = OS.get_user_data_dir() + "/dialogic";
if not directory.dir_exists(defaultFolder):
directory.make_dir(defaultFolder)
var slotNames = Dialogic.get_slot_names()
if (slotNames.size() > 0):
for i in slotNames:
Dialogic.load(i)
if (Dialogic.get_variable("TimelineSave") != "Timeline_0" and i != "debug"):
SettingsSingleton.SetHaveSave(true)
else :SettingsSingleton.SetHaveSave(false)
var birdLoading:bool = false;
func InitBirds():
var _temp = SceneLoader.connect("on_scene_loaded", self, "BirdsLoaded");
SceneLoader.load_scene("res://resources/customControls/Birds/BirdsWrapper.tscn");
birdLoading = true;
func BirdsLoaded(obj):
if obj.path != "res://resources/customControls/Birds/BirdsWrapper.tscn":
return ;
SceneLoader.disconnect("on_scene_loaded", self, "BirdsLoaded");
birdLoading = false;
var scene = obj.instance;
scene.name = "Birds";
$Background.add_child(scene);
scene.Init();
func _exit_tree():
if birdLoading:
SceneLoader.disconnect("on_scene_loaded", self, "BirdsLoaded");
func _input(ev):
if ev is InputEventKey and ev.scancode == KEY_ESCAPE:
if ($SlotMenu.visible == true):
_on_BackToMenu_pressed();
if isMenuZooming:
$Camera2D / Tween.remove_all();
SetCameraToFinalPos();
$Camera2D / Tween.emit_signal("tween_all_completed");
if ev is InputEventKey and ev.scancode == KEY_SPACE:
if isMenuZooming:
$Camera2D / Tween.remove_all();
SetCameraToFinalPos();
$Camera2D / Tween.emit_signal("tween_all_completed");
if ev is InputEventMouseButton and ev.button_index == BUTTON_LEFT and not ev.pressed:
if isMenuZooming:
$Camera2D / Tween.remove_all();
SetCameraToFinalPos();
$Camera2D / Tween.emit_signal("tween_all_completed");
func SetClouds():
var cloudH = 2160;
var scaleY = windowSize.y * 0.53 / cloudH;
var scaleClouds = Vector2(scaleY, scaleY);
for i in $Clouds.get_children():
i.scale = scaleClouds;
$Clouds / Cloud2.position = Vector2(0, - windowSize.y * 0.05);
$Clouds / Cloud1.position = Vector2( - 1000, 0);
func RemoveHover():
var buttonsToRemoveHover = [];
buttonsToRemoveHover.append_array(menuButtons.get_children())
buttonsToRemoveHover.append_array([$SlotMenu / Overwrite / ButtonYES, $SlotMenu / Overwrite / ButtonNO])
buttonsToRemoveHover.append_array([$SlotMenu / BackToMenuFromSlotContainer / BackToMenuFromSlots])
for i in buttonsToRemoveHover:
onButtonHoverOff(i);
func SetCamera():
$Camera2D.position = Vector2(960, 540);
$Camera2D.zoom = Vector2(1, 1);
if SettingsSingleton.MainOpenCount == 1:
return ;
var finalPos = Vector2(960, 540);
var finalZoom = Vector2(1, 1);
var startPos = Vector2(680, 200);
var startZoom = Vector2(0.35, 0.35);
$Camera2D.position = startPos;
$Camera2D.zoom = startZoom;
$Camera2D / Tween.interpolate_method(self, "ChangePosition", startPos, finalPos, 10, Tween.TRANS_LINEAR, 0);
$Camera2D / Tween.interpolate_method(self, "ChangeZoom", startZoom, finalZoom, 10, Tween.TRANS_LINEAR, 0);
$Camera2D / Tween.start();
func SetCameraToFinalPos():
var finalPos = Vector2(960, 540);
var finalZoom = Vector2(1, 1);
$Camera2D.position = finalPos;
$Camera2D.zoom = finalZoom;
$Background / Rain.zoom = finalZoom
func ChangePosition(newPosition):
$Camera2D.position = newPosition
func ChangeZoom(newZoom):
$Camera2D.zoom = newZoom
$Background / Rain.zoom = newZoom
func _on_ButtonYES_pressed():
newGame()
func _on_ButtonNO_pressed():
RemoveHover()
saveButtons.visible = true
$SlotMenu / LoadGame.visible = false
$SlotMenu / Overwrite.visible = false
func _on_BackToMenu_pressed():
$SlotMenu.visible = false;
$SlotMenu / Blur.material.set_shader_param("blur_amount", 0);
RemoveHover();
menuButtons.visible = true;
func _on_DiscordButton_pressed():
var _e = OS.shell_open("https://discord.gg/J8rcQFAA");
func _on_EmailButton_pressed():
var email = "awedrtyh1@gmail.com";
OS.set_clipboard(email);
var _e = OS.shell_open(str("mailto:", email))

357
scripts/Map.gd Normal file
View file

@ -0,0 +1,357 @@
extends Control
var currentTimeLine;
var currentBackground;
var insideScenes = ["Scene2_1", "Scene2_2", "Scene9", "Garaj", "Podval", "Vtoroi_etaj", "Tretii_etaj", "Panorama"];
var outsideScenes = ["Scene2", "Scene6", "Scene7", "Scene9", "Scene12", "Garaj", "Mayak", "Sarai", "Pristan"];
var positions = [
{"background":"Scene2_1", "place":"Map/Inside/Places/Gl-Rest"},
{"background":"Scene2", "place":"Map/Outside/Places/Front"},
{"background":"Scene2_2", "place":"Map/Inside/Places/Kitchen"},
{"background":"Scene9", "place":"Map/Inside/Places/Smoking"},
{"background":"Scene9", "place":"Map/Outside/Places/Smoking"},
{"background":"Scene12", "place":"Map/Outside/Places/Ravine"},
{"background":"Garaj", "place":"Map/Inside/Places/Garage"},
{"background":"Garaj", "place":"Map/Outside/Places/Garage"},
{"background":"Podval", "place":"Map/Inside/Places/Basement"},
{"background":"Vtoroi_etaj", "place":"Map/Inside/Places/2ndFloor"},
{"background":"Tretii_etaj", "place":"Map/Inside/Places/3rdFloor"},
{"background":"Panorama", "place":"Map/Inside/Places/Gl-Rest"},
{"background":"Mayak", "place":"Map/Outside/Places/LightHouse"},
{"background":"Sarai", "place":"Map/Outside/Places/Sarai"},
{"background":"Pristan", "place":"Map/Outside/Places/Pier"},
{"background":"Scene6", "place":"Map/Outside/Places/Parking"},
{"background":"Scene7", "place":"Map/Outside/Places/Bridge"},
]
var routes = [
{
"fromTimeline":"Timeline_3_1",
"routes":[
{"timeline":"8.1", "place":"Map/Inside/Places/Exit"}
]
},
{
"fromTimeline":"Timeline_5",
"routes":[
{"timeline":"12.1", "place":"Map/Outside/Places/Ravine"},
{"timeline":"12.3", "place":"Map/Outside/Places/Smoking"},
{"timeline":"12.4", "time":">", "place":"Map/Outside/Places/Restaurant"},
{"timeline":"12.sofa", "time":"<", "place":"Map/Outside/Places/Restaurant"},
{"timeline":"walk_garage", "place":"Map/Outside/Places/Garage"},
{"timeline":"walk_sarai", "place":"Map/Outside/Places/Sarai"},
{"timeline":"walk_mayak", "place":"Map/Outside/Places/LightHouse"},
]
},
{
"fromTimeline":"Timeline_6",
"routes":[
{"timeline":"13.1", "place":"Map/Inside/Places/Exit"}
]
},
{
"fromTimeline":"Timeline_Sofa",
"routes":[
{"timeline":"127.4", "place":"Map/Inside/Places/Exit"}
]
},
{
"fromTimeline":"Timeline_5_garage",
"routes":[
{"timeline":"back", "place":"Map/Outside/Places/Front"},
{"timeline":"smoking", "place":"Map/Outside/Places/Smoking"},
]
},
{
"fromTimeline":"Timeline_5_tropinka",
"routes":[
{"timeline":"back", "place":"Map/Outside/Places/Front"},
{"timeline":"walk_pristan", "place":"Map/Outside/Places/Pier"},
]
},
{
"fromTimeline":"Timeline_5_pristan",
"routes":[
{"timeline":"back", "place":"Map/Outside/Places/Sarai"},
]
},
{
"fromTimeline":"Timeline_5_lighthouse",
"routes":[
{"timeline":"back", "place":"Map/Outside/Places/Front"},
]
},
{
"fromTimeline":"Timeline_7_1",
"routes":[
{"timeline":"15.2_t", "time":">", "place":"Map/Outside/Places/Restaurant"},
{"timeline":"15.2", "time":"<", "place":"Map/Outside/Places/Restaurant"},
{"timeline":"15.1", "time":"<", "place":"Map/Outside/Places/Ravine"},
{"timeline":"15.3", "time":"<", "place":"Map/Outside/Places/Smoking"},
]
},
{
"fromTimeline":"Timeline_8_1",
"routes":[
{"timeline":"20.time", "time":">", "place":"Map/Outside/Places/Restaurant"},
{"timeline":"20.1", "time":"<", "place":"Map/Outside/Places/Restaurant"},
]
},
{
"fromTimeline":"Timeline_9",
"routes":[
{"timeline":"21.2", "place":"Map/Outside/Places/Front"},
{"timeline":"21.garage", "place":"Map/Outside/Places/Garage"},
]
},
{
"fromTimeline":"Timeline_10_2",
"routes":[
{"timeline":"25.time", "time":">", "place":"Map/Outside/Places/Front"},
{"timeline":"25.2", "time":"<", "place":"Map/Outside/Places/Front"},
{"timeline":"25.garage", "time":"<", "place":"Map/Outside/Places/Garage"},
]
},
{
"fromTimeline":"Timeline_32_2",
"routes":[
{"timeline":"190.2", "place":"Map/Outside/Places/Smoking"},
{"timeline":"190.3", "place":"Map/Outside/Places/LightHouse"},
{"timeline":"190.5", "place":"Map/Outside/Places/Sarai"},
]
},
{
"fromTimeline":"Timeline_120_basement",
"routes":[
{"timeline":"back", "place":"Map/Inside/Places/Gl-Rest"},
]
},
{
"fromTimeline":"Timeline_120_main",
"routes":[
{"timeline":"120_h", "place":"Map/Inside/Places/Garage"},
{"timeline":"120_r", "place":"Map/Inside/Places/Kitchen"},
{"timeline":"120_basement", "place":"Map/Inside/Places/Basement"},
]
},
{
"fromTimeline":"Timeline_before_129",
"routes":[
{"timeline":"129_back", "place":"Map/Inside/Places/Gl-Rest"},
]
},
{
"fromTimeline":"Timeline_before_130",
"routes":[
{"timeline":"back", "place":"Map/Inside/Places/Gl-Rest"},
{"timeline":"120_w_front", "place":"Map/Outside/Places/Front"},
{"timeline":"120_w_smoking", "place":"Map/Outside/Places/Smoking"},
]
},
{
"fromTimeline":"Timeline_140_main",
"routes":[
{"timeline":"141", "place":"Map/Inside/Places/Exit"},
{"timeline":"142_h", "place":"Map/Inside/Places/Garage"},
{"timeline":"2nd_floor", "place":"Map/Inside/Places/2ndFloor"},
{"timeline":"143", "place":"Map/Inside/Places/Basement"},
{"timeline":"149", "place":"Map/Inside/Places/Kitchen"},
]
},
{
"fromTimeline":"Timeline_before_141",
"routes":[
{"timeline":"141_garage", "place":"Map/Inside/Places/Garage"},
{"timeline":"141_rest", "place":"Map/Outside/Places/Restaurant"},
{"timeline":"141_smoking", "place":"Map/Outside/Places/Smoking"},
{"timeline":"141_lighthouse", "place":"Map/Outside/Places/LightHouse"},
]
},
{
"fromTimeline":"Timeline_before_142_h",
"routes":[
{"timeline":"142_back", "place":"Map/Inside/Places/Gl-Rest"},
{"timeline":"142_3", "place":"Map/Inside/Places/Smoking"},
]
},
{
"fromTimeline":"Timeline_before_143",
"routes":[
{"timeline":"143_back", "place":"Map/Inside/Places/Gl-Rest"},
]
},
{
"fromTimeline":"Timeline_before_149",
"routes":[
{"timeline":"149_back", "place":"Map/Inside/Places/Gl-Rest"},
]
},
{
"fromTimeline":"Timeline_before_2nd_floor",
"routes":[
{"timeline":"2nd_down", "place":"Map/Inside/Places/Gl-Rest"},
{"timeline":"2nd_up", "place":"Map/Inside/Places/3rdFloor"},
{"timeline":"2nd_1", "floorCheck":"Timeline146,Is_Black_Dead", "place":"Map/Inside/Places/Room1"},
{"timeline":"2nd_2", "floorCheck":"Timeline147,Is_Green_Dead", "place":"Map/Inside/Places/Room2"},
{"timeline":"2nd_office", "place":"Map/Inside/Places/OfficeH"},
]
},
{
"fromTimeline":"Timeline_before_3rd_floor",
"routes":[
{"timeline":"3rd_down", "place":"Map/Inside/Places/2ndFloor"},
{"timeline":"3rd_3", "floorCheck":"Timeline145,Is_Blue_M_Dead", "place":"Map/Inside/Places/Room3"},
{"timeline":"3rd_4", "ifzero":"Timeline146_a", "place":"Map/Inside/Places/Room4"},
{"timeline":"3rd_5", "floorCheck":"Timeline148,Is_Purple_Dead", "place":"Map/Inside/Places/Room5"},
]
},
]
func _ready():
Localization();
DisableAllPlaces();
func ProcessMapFromMenuButton():
currentTimeLine = Dialogic.get_variable("TimelineSave");
currentBackground = Dialogic.get_variable("CurrentBackground");
ShowMap();
ShowPlayer();
func ProcessMap()->bool:
currentTimeLine = Dialogic.get_variable("TimelineSave");
currentBackground = Dialogic.get_variable("CurrentBackground");
DisableAllPlaces();
ShowMap();
ShowPlayer();
return FindPlaces();
func DisableAllPlaces():
for i in $Map / Inside / Places.get_children():
if i is TextureButton:
DisablePlace(i);
for i in $Map / Outside / Places.get_children():
if i is TextureButton:
DisablePlace(i);
func EnablePlace(place:TextureButton, timeline:String):
place.disabled = false;
var _temp = place.connect("pressed", self, "placePressed", [timeline]);
_temp = place.connect("mouse_entered", self, "placeMouseOn", [place]);
_temp = place.connect("mouse_exited", self, "placeMouseOff", [place]);
func DisablePlace(place:TextureButton):
place.disabled = true;
if place.is_connected("pressed", self, "placePressed"):
place.disconnect("pressed", self, "placePressed");
if place.is_connected("mouse_entered", self, "placeMouseOn"):
place.disconnect("mouse_entered", self, "placeMouseOn");
if place.is_connected("mouse_exited", self, "placeMouseOff"):
place.disconnect("mouse_exited", self, "placeMouseOff");
func ShowMap():
$Map / SwitchButton.visible = false;
if currentBackground in insideScenes and currentBackground in outsideScenes:
$Map / Outside.visible = true;
$Map / Inside.visible = false;
$Map / SwitchButton.visible = true;
elif currentBackground in insideScenes:
$Map / Inside.visible = true;
$Map / Outside.visible = false;
elif currentBackground in outsideScenes:
$Map / Outside.visible = true;
$Map / Inside.visible = false;
else :
pass
func ShowPlayer():
for i in positions:
if i["background"] == currentBackground:
var temp = get_node(i["place"]);
if temp.get_parent().get_parent().visible:
var pos = temp.rect_global_position + temp.rect_size * temp.rect_scale * 0.5;
$Map / PlayerPosition.rect_global_position = pos + Vector2( - 30, - 60);
break;
func FindPlaces()->bool:
var routeObj = {};
var success = false;
for i in routes:
if i["fromTimeline"] == currentTimeLine:
routeObj = i.duplicate();
break
for i in routeObj["routes"]:
var place = get_node(i["place"]);
var timeline = i["timeline"];
if i.has("time"):
var time = int(Dialogic.get_variable("Time"));
if i["time"] == ">":
if time >= 45:
EnablePlace(place, timeline);
else :
if time < 45:
EnablePlace(place, timeline);
elif i.has("ifzero"):
var value = Dialogic.get_variable(i["ifzero"]);
if value == "0":
EnablePlace(place, timeline);
elif i.has("floorCheck"):
var array = str(i["floorCheck"]).split(",");
var timelineValue = Dialogic.get_variable(array[0]);
var deadValue = Dialogic.get_variable(array[1]);
if timelineValue == "0" and deadValue == "0":
EnablePlace(place, timeline);
else :
EnablePlace(place, timeline);
success = true;
return success;
func placePressed(timeline:String):
get_tree().root.get_node("Root/Game").get_child(0).get_child(0)._on_MapButton_button_down();
yield (get_tree().create_timer(0.1), "timeout");
DisableAllPlaces();
Dialogic.set_variable("PreviousTimelineChoice", timeline);
var game = get_tree().root.get_node("Root");
game.removeAlternative();
func placeMouseOn(place:TextureButton):
place.self_modulate = Color(0.7, 0.7, 0.7, 1);
func placeMouseOff(place:TextureButton):
place.self_modulate = Color(1, 1, 1, 1);
func _on_SwitchButton_pressed():
if $Map / Inside.visible:
$Map / Inside.visible = false;
$Map / Outside.visible = true;
elif $Map / Outside.visible:
$Map / Inside.visible = true;
$Map / Outside.visible = false;
ShowPlayer();
func Localization():
$Map / SwitchButton.text = tr("ui_switch_map");
var mapLoc = LanguageLocalization.GetMapLocalization();
for i in mapLoc:
get_node(i).text = tr(mapLoc[i]);
func _on_CloseButton_button_up():
get_tree().root.get_node("Root/Game").get_child(0).get_child(0)._on_MapButton_button_down();

24
scripts/Rain.gd Normal file
View file

@ -0,0 +1,24 @@
extends Sprite
var zoom = Vector2(1.0, 1.0);
var xOffset;
var yOffset;
var screenWidth;
var screenHeight;
func _ready():
screenWidth = SettingsSingleton.GetCurrectScreenResolutionVector2().x
screenHeight = SettingsSingleton.GetCurrectScreenResolutionVector2().y
func _process(_delta):
xOffset = (1 - zoom.x) * (self.get_global_transform_with_canvas().origin.x) / screenWidth;
yOffset = (1 - zoom.y) * (screenHeight - self.get_global_transform_with_canvas().origin.y) / screenHeight;
var tiling = Vector2(zoom.x, zoom.y);
var offset = Vector2(xOffset, yOffset);
self.material.set_shader_param("offset", offset);
self.material.set_shader_param("tiling", tiling);

View file

@ -0,0 +1,20 @@
extends Node
func _init():
var foldername = str(OS.get_user_data_dir(), "/slotImages");
var dir = Directory.new();
if not dir.dir_exists(foldername):
dir.make_dir(foldername);
func GetScene(sceneName):
var scene = load("res://scenes/BackgroundScenes/" + sceneName + ".tscn");
return scene.instance();
func TakeScreenShot(slotName:String):
var filename = slotName;
if "slot" in slotName:
filename = slotName.replace("slot", "");
var screenShotsPath = str(OS.get_user_data_dir(), "/slotImages/", filename, ".png");
var _temp = get_viewport().get_texture().get_data().save_png(screenShotsPath)

View file

@ -0,0 +1,34 @@
extends Node
var seenPath = OS.get_user_data_dir() + "/globalSeen.txt";
var arraySeenTexts:Array;
func _ready():
DeserializeSeen();
func DeserializeSeen():
var file = File.new();
if not file.file_exists(seenPath):
arraySeenTexts = [];
SerializeSeen();
else :
file.open(seenPath, File.READ);
arraySeenTexts = str2var(file.get_pascal_string());
file.close()
func SerializeSeen():
var file = File.new();
file.open(seenPath, File.WRITE);
file.store_pascal_string(var2str(arraySeenTexts));
file.close()
func AddSeen(text):
if not text in arraySeenTexts and text != "":
arraySeenTexts.push_back(text);
func CheckIfSeen(text:String)->bool:
return text in arraySeenTexts;

View file

@ -0,0 +1,75 @@
extends Node2D
var windowSize;
func _ready():
windowSize = SettingsSingleton.GetCurrectScreenResolutionVector2()
SetBackground();
SetText();
func SetBackground():
$Polygon2D.set_polygon(PoolVector2Array([
Vector2(0, 0),
Vector2(0, 1080),
Vector2(1920, 1080),
Vector2(1920, 0)
]));
func SetText():
for i in $Texts.get_children():
var button = (i as Button);
button.connect("mouse_entered", self, "onButtonHoverOn", [button]);
button.connect("mouse_exited", self, "onButtonHoverOff", [button]);
button.connect("pressed", self, "languageSelected", [button.text]);
$Texts.rect_position = Vector2(1920, 1080) / 2 - $Texts.rect_size / 2;
func onButtonHoverOn(button):
(button as Button).get("custom_fonts/font").outline_color = Color(213, 55, 29, 255)
func onButtonHoverOff(button):
(button as Button).get("custom_fonts/font").outline_color = Color(0, 0, 0, 255)
func languageSelected(langName):
var lang = "";
if langName == "ENGLISH":
lang = "en"
elif langName == "РУССКИЙ":
lang = "ru";
elif langName == "УКРАЇНСЬКА":
lang = "uk";
SettingsSingleton.SetCurrentLanguage(lang);
SettingsSingleton.SetVoiceoverLanguage(lang);
var resolution = str(windowSize.x) + "x" + str(windowSize.y);
resolution = "1920x1080"
SettingsSingleton.SetCurrectScreenResolution(resolution)
SettingsSingleton.SetCurrectWindowState(2);
SettingsSingleton.SaveSettings()
SettingsSingleton.SetFirstStartup(false);
if not SceneLoader.is_connected("on_scene_loaded", self, "MenuLoaded"):
var _temp = SceneLoader.connect("on_scene_loaded", self, "MenuLoaded");
SceneLoader.load_scene("res://scenes/MainMenu.tscn")
func MenuLoaded(obj):
if obj.path != "res://scenes/MainMenu.tscn":
return ;
if obj.instance != null:
get_tree().root.add_child(obj.instance);
for i in get_tree().root.get_children():
if i.name == "SelectLanguageScene":
get_tree().root.remove_child(i);
break;
SceneLoader.disconnect("on_scene_loaded", self, "MenuLoaded");
func _input(event):
if event is InputEventKey and event.scancode == KEY_ESCAPE and event.pressed == false:
get_tree().quit();

263
scripts/Settings.gd Normal file
View file

@ -0,0 +1,263 @@
extends Node
var configManagerInstance;
var config;
var MainOpenCount = 0;
func _ready():
var configManager = load("res://scripts/ConfigManager.gd");
configManagerInstance = configManager.new();
config = configManagerInstance.Init();
func CheckCurrentLanguage():
TranslationServer.set_locale(config.Language);
func CheckVideoSettings():
CheckWindowState();
CheckLowProcessor();
func CheckWindowState():
var state = SettingsSingleton.GetCurrectWindowState();
if state == 0:
if OS.is_window_fullscreen():
OS.set_window_fullscreen(false);
if OS.get_borderless_window():
OS.set_borderless_window(false);
CheckWindowResolution();
elif state == 1:
if OS.is_window_fullscreen():
OS.set_window_fullscreen(false);
OS.set_borderless_window(true);
CheckWindowResolution();
elif state == 2:
OS.set_window_fullscreen(true);
else :
return
func CheckWindowResolution():
var resolution = SettingsSingleton.GetCurrectScreenResolution()
var width = 0;
var height = 0;
if resolution != "-":
var value = resolution.split("x", false, 1);
width = int(value[0]);
height = int(value[1]);
else :
var window = OS.get_real_window_size()
width = window.x;
height = window.y;
OS.set_window_size(Vector2(width, height));
var screen_size = OS.get_screen_size();
var window_size = OS.get_window_size();
OS.set_window_position(screen_size * 0.5 - window_size * 0.5)
func CheckLowProcessor():
var value = SettingsSingleton.GetCurrectLowProcessor();
OS.set_low_processor_usage_mode(value);
func CheckAudioSettings():
var audioSettings = [
{"value":SettingsSingleton.GetGeneralVolumeLevel(), "bus":"Master"},
{"value":SettingsSingleton.GetMusicVolumeLevel(), "bus":"BGM"},
{"value":SettingsSingleton.GetEffectsVolumeLevel(), "bus":"SFX"},
{"value":SettingsSingleton.GetDialogueVolumeLevel(), "bus":"Dialogue"},
]
for i in audioSettings:
CheckAudioVolume(i["value"], i["bus"]);
func CheckAudioVolume(value, bus):
value = float(value);
var busIndex = AudioServer.get_bus_index(bus);
if value <= 0:
AudioServer.set_bus_mute(busIndex, true);
else :
if AudioServer.is_bus_mute(busIndex):
AudioServer.set_bus_mute(busIndex, false);
var dbValue:float = linear2db(value / 100);
AudioServer.set_bus_volume_db(busIndex, dbValue);
var hasDLC:bool = false;
# const ExecutableFilename:String = "OneEleven.exe";
func CheckDLC():
# var filepath = OS.get_executable_path().replace(ExecutableFilename, "OneElevenDLC18+.pck");
# hasDLC = ProjectSettings.load_resource_pack(filepath);
hasDLC = true;
func GetDLC()->bool:
return hasDLC;
func GetUseDlc()->bool:
return hasDLC and config.UseDlc;
func SetUseDlc(value:bool):
config.UseDlc = value;
func GetCurrentLanguage()->String:
return config.Language;
func SetCurrentLanguage(locale):
TranslationServer.set_locale(locale);
config.Language = locale;
func GetVoiceoverLanguage()->String:
return config.VoiceLanguage;
func SetVoiceoverLanguage(locale):
config.VoiceLanguage = locale;
func GetCurrectWindowState():
return config.WindowState;
func SetCurrectWindowState(value):
config.WindowState = value;
func GetCurrectScreenResolution():
return config.ScreenResolution;
func GetCurrectScreenResolutionVector2()->Vector2:
return Vector2(1920, 1080)
func SetCurrectScreenResolution(value):
config.ScreenResolution = value;
func GetCurrectLowProcessor()->bool:
return config.LowProcessor;
func SetCurrectLowProcessor(value):
config.LowProcessor = value;
func GetAsyncBackgroundLoading()->bool:
return config.AsyncBackgroundLoading;
func SetAsyncBackgroundLoading(value:bool):
config.AsyncBackgroundLoading = value;
func GetGeneralVolumeLevel()->int:
return config.GeneralVolume;
func SetGeneralVolumeLevel(value):
config.GeneralVolume = value;
func GetMusicVolumeLevel()->int:
return config.MusicVolume;
func SetMusicVolumeLevel(value):
config.MusicVolume = value;
func GetDialogueVolumeLevel()->int:
return config.DialogueVolume;
func SetDialogueVolumeLevel(value):
config.DialogueVolume = value;
func GetEffectsVolumeLevel()->int:
return config.EffectsVolume;
func SetEffectsVolumeLevel(value):
config.EffectsVolume = value;
func SetAutoRead(value):
config.AutoRead = value;
func GetAutoRead()->bool:
return config.AutoRead;
func SetSkipSeen(value):
config.SkipSeen = value;
func GetSkipSeen()->bool:
return config.SkipSeen;
func SetTextSpeed(value):
config.TextSpeed = value;
func GetTextSpeed()->int:
return config.TextSpeed;
func SetDeafaultTheme(value):
config.DefaultTheme = value
func GetDefaultTheme()->bool:
return config.DefaultTheme
func SetBackgroundColor(color:int):
config.BackgroundColor = color;
func GetBackgroundColor()->int:
return config.BackgroundColor;
func SetTextColor(color:int):
config.TextColor = color;
func GetTextColor()->int:
return config.TextColor;
func SetTwitchEnabled(value):
config.TwitchEnabled = value;
func GetTwitchEnabled()->bool:
return config.TwitchEnabled;
func SetTwitchChannel(value):
config.TwitchChannel = value;
func GetTwitchChannel()->String:
return config.TwitchChannel;
func SetTwitchTimer(value):
config.TwitchTimer = value;
func GetTwitchTimer()->int:
return config.TwitchTimer;
func SaveSettings():
configManagerInstance.SaveConfig();
var timeline = "Timeline_1";
func GetTimeline():
return timeline;
func SetTimeline(value):
timeline = value;
var haveSaves:bool = false;
func GetHaveSave()->bool:
return haveSaves;
func SetHaveSave(value):
haveSaves = bool(value);
var isFirstStartup;
func SetFirstStartup(value):
isFirstStartup = value;
func GetFirstStartup():
return isFirstStartup;
func GetExplanation()->bool:
return config.Explanation;
func SetExplanation(value:bool):
config.Explanation = value;
SaveSettings()

798
scripts/SettingsMenu.gd Normal file
View file

@ -0,0 +1,798 @@
extends Node
var windowSize;
signal BackFromSettings;
signal ReturnToGame;
signal ResolutionChanged;
onready var windowResolutions = get_node("VideoSettingsView/WindowResolutions/VBoxContainer");
onready var allSettingsView = get_node("AllSettingsView");
onready var videoSettingsView = get_node("VideoSettingsView");
onready var audioSettingsView = get_node("AudioSettingsView");
onready var textSettingsView = get_node("TextSettingsView");
onready var languageSettingsView = get_node("LanguageSettingsView");
onready var twitchSettingsView = get_node("TwitchSettingsView");
var windowResolutionsArray = [
"640x360",
"854x480",
"1280x720",
"1366x768",
"1600x900",
"1920x1080",
]
onready var generalVolume = get_node("AudioSettingsView/GeneralVolumeSlider");
onready var musicVolume = get_node("AudioSettingsView/MusicVolumeSlider");
onready var dialogueVolume = get_node("AudioSettingsView/DialogueVolumeSlider");
onready var effectsVolume = get_node("AudioSettingsView/EffectsVolumeSlider");
var type;
func setType(value:int):
type = value;
if value == 0:
$ReturnToGameButton.visible = false;
$VideoSettingsView / ScalingMessage.visible = OS.get_screen_scale() != 1.0;
else :
$AllSettingsView / VideoButton.disabled = true;
$AllSettingsView / LanguageButton.disabled = true;
$BackToMenuButton.rect_global_position = Vector2(461, 545);
func _ready():
windowSize = Vector2(1920, 1080)
SetButtonsHover();
BackToAllView();
CreateLanguages();
LoadLanguage();
LoadSettings();
func SetButtonsHover():
var nodes = GetNodes();
for i in nodes:
var node = get_node(i);
if node is Button:
if not node.is_connected("mouse_entered", self, "onButtonHoverOn"):
node.connect("mouse_entered", self, "onButtonHoverOn", [node])
if not node.is_connected("mouse_exited", self, "onButtonHoverOff"):
node.connect("mouse_exited", self, "onButtonHoverOff", [node])
func onButtonHoverOn(button):
if not button.disabled:
button.get("custom_fonts/font").outline_color = Color(213, 55, 29, 255)
func onButtonHoverOff(button):
button.get("custom_fonts/font").outline_color = Color(0, 0, 0, 255)
func BackToAllView():
allSettingsView.visible = true;
videoSettingsView.visible = false;
audioSettingsView.visible = false;
textSettingsView.visible = false;
languageSettingsView.visible = false;
twitchSettingsView.visible = false;
func CreateLanguages():
var control = load("res://resources/customControls/LanguageSettign.tscn");
var group = load("res://resources/customControls/CheckBoxGroups/LanguageGroup.tres")
var langs = LanguageLocalization.GetLanguages();
var lang = $LanguageSettingsView / InterfaceAndText / VBoxContainer;
for i in langs:
var langControl = control.instance();
langControl.name = i.name;
langControl.text = i.name;
langControl.group = group
langControl.connect("pressed", self, "_on_LanguageOption_item_selected", [i.locale])
lang.add_child(langControl);
var voice_group = load("res://resources/customControls/CheckBoxGroups/LanguageVoiceoverGroup.tres")
var voice_langs = LanguageLocalization.GetVoiceLanguages();
var voice_lang = $LanguageSettingsView / Voiceover / VBoxContainer;
for i in voice_langs:
var langControl = control.instance();
langControl.name = i.name;
langControl.text = i.name;
langControl.group = voice_group;
langControl.connect("pressed", self, "_on_VoiceLanguageOption_item_selected", [i.locale])
voice_lang.add_child(langControl);
func LoadLanguage():
var selectedLangageOptionIndex = LanguageLocalization.GetLanguageIndex();
$LanguageSettingsView / InterfaceAndText / VBoxContainer.get_child(selectedLangageOptionIndex).pressed = true;
var selectedVoiceLangageIndex = LanguageLocalization.GetVoiceLanguageIndex();
$LanguageSettingsView / Voiceover / VBoxContainer.get_child(selectedVoiceLangageIndex).pressed = true;
func LoadSettings():
LoadTranlations();
LoadVideoSettings();
LoadAudioSettings();
LoadTextSettings();
LoadTwitchSettings();
func LoadTranlations():
var settingsLocalization = LanguageLocalization.GetLocalization();
for i in settingsLocalization:
if "AudioSettingsView" in i:
get_node(i).setName(settingsLocalization[i])
elif "TextSettingsView/TextSpeedSlider" in i:
get_node(i).setName(settingsLocalization[i])
elif "TwitchSettingsView/TimerSlider" in i:
get_node(i).setName(settingsLocalization[i])
else :
get_node(i).text = tr(settingsLocalization[i]);
func _on_LanguageOption_item_selected(languageLocale):
LanguageLocalization.SetLanguages(languageLocale);
var voiceContainer = $LanguageSettingsView / Voiceover / VBoxContainer;
if languageLocale == "en":
voiceContainer.get_child(0).pressed = true;
elif languageLocale == "ru":
voiceContainer.get_child(1).pressed = true;
SettingsSingleton.SetVoiceoverLanguage(languageLocale);
LoadTranlations()
LoadLanguage();
LoadVideoSettings();
func _on_VoiceLanguageOption_item_selected(languageLocale):
SettingsSingleton.SetVoiceoverLanguage(languageLocale);
func LoadVideoSettings():
var windowStates = $VideoSettingsView / WindowStates;
for i in windowStates.get_child_count():
if not windowStates.get_child(i).is_connected("pressed", self, "_on_WindowState_item_selected"):
windowStates.get_child(i).connect("pressed", self, "_on_WindowState_item_selected", [i]);
var stateOptionIndex = SettingsSingleton.GetCurrectWindowState();
windowStates.get_child(stateOptionIndex).pressed = true;
ChangeWindowResolutionSettings();
ChangeWindowResolution();
ChangeWindowState();
$VideoSettingsView / LowProcessor.pressed = SettingsSingleton.GetCurrectLowProcessor();
$VideoSettingsView / SyncBackground.pressed = SettingsSingleton.GetAsyncBackgroundLoading();
ChangeLowProcessor();
func ChangeWindowResolutionSettings():
var checkBoxGround = load("res://resources/customControls/CheckBoxGroups/WindowResolutionGroup.tres")
var noFocus = load("res://resources/Themes/EmptyFocusTheme.tres");
var isFullScreen = OS.is_window_fullscreen();
if is_instance_valid(windowResolutions):
for i in windowResolutions.get_children():
windowResolutions.remove_child(i);
var font = load("res://resources/fonts/SettingsFont.tres");
var checked = load("res://resources/graphics/GUI/CheckBox/checked-20.webp");
var unchecked = load("res://resources/graphics/GUI/CheckBox/unchecked-20.webp");
font = font.duplicate(true)
font.size = 35;
var monitorSize = OS.get_screen_size();
var currentWidth = monitorSize.x;
var strSize = str(monitorSize.x) + "x" + str(monitorSize.y);
if windowResolutionsArray.find(strSize) == - 1:
var insertIndex = 0;
for i in windowResolutionsArray:
var width = int(i.split("x", true)[0]);
if currentWidth > width:
insertIndex += 1;
else :break;
windowResolutionsArray.insert(insertIndex, strSize);
for i in windowResolutionsArray.size():
var width = int(windowResolutionsArray[i].split("x", true)[0]);
if currentWidth < width:
continue;
var checkBox = CheckBox.new();
checkBox.text = windowResolutionsArray[i];
checkBox.rect_position = Vector2(0, 25 * i);
checkBox.set_button_group(checkBoxGround)
checkBox.add_font_override("font", font);
checkBox.set("custom_styles/focus", noFocus);
checkBox.set("custom_icons/radio_checked", checked);
checkBox.set("custom_icons/radio_unchecked", unchecked);
checkBox.set("custom_icons/radio_checked_disabled", checked);
checkBox.set("custom_icons/radio_unchecked_disabled", unchecked);
checkBox.connect("pressed", self, "_on_ScreenResolution_item_selected", [i])
checkBox.disabled = isFullScreen;
if is_instance_valid(windowResolutions):
windowResolutions.add_child(checkBox);
strSize = str(OS.get_window_size().x) + "x" + str(OS.get_window_size().y);
var index = windowResolutionsArray.find(strSize)
if index != - 1 and is_instance_valid(windowResolutions):
windowResolutions.get_child(index).pressed = true;
func _on_WindowState_item_selected(index):
SettingsSingleton.SetCurrectWindowState(index);
ChangeWindowState();
ChangeWindowResolutionSettings();
func _on_ScreenResolution_item_selected(index):
var value = windowResolutionsArray[index];
SettingsSingleton.SetCurrectScreenResolution(value);
ChangeWindowResolution();
ChangeWindowResolutionSettings();
emit_signal("ResolutionChanged")
func ChangeWindowState():
var state = SettingsSingleton.GetCurrectWindowState();
if state == 0:
if OS.is_window_fullscreen():
OS.set_window_fullscreen(false);
if OS.get_borderless_window():
OS.set_borderless_window(false);
ChangeWindowResolution();
elif state == 1:
if OS.is_window_fullscreen():
OS.set_window_fullscreen(false);
OS.set_borderless_window(true);
ChangeWindowResolution();
elif state == 2:
OS.set_window_fullscreen(true);
ChangeWindowResolution();
UpdateResolutionButtons();
else :
return
func UpdateResolutionButtons():
var monitorSize = OS.get_real_window_size();
var currentWidth = monitorSize.x;
var strSize = str(monitorSize.x) + "x" + str(monitorSize.y);
if windowResolutionsArray.find(strSize) == - 1:
var insertIndex = 0;
for i in windowResolutionsArray:
var width = int(i.split("x", true)[0]);
if currentWidth > width:
insertIndex += 1;
else :break;
windowResolutionsArray.insert(insertIndex, strSize);
if strSize in windowResolutionsArray:
var index = windowResolutionsArray.find(strSize);
if is_instance_valid(windowResolutions):
windowResolutions.get_child(index).pressed = true;
_on_ScreenResolution_item_selected(index)
else :
var insertIndex = 0;
for i in windowResolutionsArray:
var width = int(i.split("x", true)[0]);
if currentWidth > width:
insertIndex += 1;
else :break;
if is_instance_valid(windowResolutions):
windowResolutions.get_child(insertIndex).pressed = true;
_on_ScreenResolution_item_selected(insertIndex)
func ChangeWindowResolution():
var resolution = SettingsSingleton.GetCurrectScreenResolution()
var width = 0;
var height = 0;
if resolution != "-":
var value = resolution.split("x", false, 1);
width = int(value[0]);
height = int(value[1]);
else :
var window = OS.get_real_window_size()
width = window.x;
height = window.y;
OS.set_window_size(Vector2(width, height));
var screen_size = OS.get_screen_size();
var window_size = OS.get_window_size();
OS.set_window_position(screen_size * 0.5 - window_size * 0.5)
if SettingsSingleton.GetCurrectWindowState() == 0:
if width == screen_size.x and height == screen_size.y:
SettingsSingleton.SetCurrectWindowState(1);
$VideoSettingsView / WindowStates / BorderlessCheck.pressed = true;
OS.set_borderless_window(true);
func _on_LowProcessor_pressed():
SettingsSingleton.SetCurrectLowProcessor($VideoSettingsView / LowProcessor.pressed);
ChangeLowProcessor();
func ChangeLowProcessor():
var value = SettingsSingleton.GetCurrectLowProcessor();
OS.set_low_processor_usage_mode(value);
func _on_SyncBackground_pressed():
SettingsSingleton.SetAsyncBackgroundLoading($VideoSettingsView / SyncBackground.pressed);
func SetVideoSettingsForMenu():
ChangeWindowState();
ChangeWindowResolution();
ChangeLowProcessor();
func SetAudioSettingsForMenu():
ChangeGeneralVolume(int(SettingsSingleton.GetGeneralVolumeLevel()))
ChangeMusicVolume(int(SettingsSingleton.GetMusicVolumeLevel()))
ChangeEffectsVolume(int(SettingsSingleton.GetEffectsVolumeLevel()))
ChangeDialogueVolume(int(SettingsSingleton.GetDialogueVolumeLevel()))
func LoadAudioSettings():
for i in $AudioSettingsView.get_children():
i.resize();
generalVolume.setValue(SettingsSingleton.GetGeneralVolumeLevel())
generalVolume.connect("value_changed", self, "_on_GeneralVolume_value_changed");
musicVolume.setValue(SettingsSingleton.GetMusicVolumeLevel());
musicVolume.connect("value_changed", self, "_on_MusicVolume_value_changed");
dialogueVolume.setValue(SettingsSingleton.GetDialogueVolumeLevel());
dialogueVolume.connect("value_changed", self, "_on_DialogueVolume_value_changed");
effectsVolume.setValue(SettingsSingleton.GetEffectsVolumeLevel());
effectsVolume.connect("value_changed", self, "_on_EffectsVolume_value_changed");
func _on_GeneralVolume_value_changed(value):
SettingsSingleton.SetGeneralVolumeLevel(value);
ChangeGeneralVolume(value);
func ChangeGeneralVolume(value):
value = float(value);
if value <= 0:
AudioServer.set_bus_mute(AudioServer.get_bus_index("Master"), true);
else :
if AudioServer.is_bus_mute(AudioServer.get_bus_index("Master")):
AudioServer.set_bus_mute(AudioServer.get_bus_index("Master"), false);
var dbValue:float = linear2db(value / 100);
AudioServer.set_bus_volume_db(AudioServer.get_bus_index("Master"), dbValue);
func _on_MusicVolume_value_changed(value):
SettingsSingleton.SetMusicVolumeLevel(value);
ChangeMusicVolume(value);
func ChangeMusicVolume(value):
value = float(value);
if value <= 0:
AudioServer.set_bus_mute(AudioServer.get_bus_index("BGM"), true);
else :
if AudioServer.is_bus_mute(AudioServer.get_bus_index("BGM")):
AudioServer.set_bus_mute(AudioServer.get_bus_index("BGM"), false);
var dbValue:float = linear2db(value / 100);
AudioServer.set_bus_volume_db(AudioServer.get_bus_index("BGM"), dbValue);
func _on_DialogueVolume_value_changed(value):
SettingsSingleton.SetDialogueVolumeLevel(value);
ChangeDialogueVolume(value);
func ChangeDialogueVolume(value):
value = float(value);
if value <= 0:
AudioServer.set_bus_mute(AudioServer.get_bus_index("Dialogue"), true);
else :
if AudioServer.is_bus_mute(AudioServer.get_bus_index("Dialogue")):
AudioServer.set_bus_mute(AudioServer.get_bus_index("Dialogue"), false);
var dbValue:float = linear2db(value / 100);
AudioServer.set_bus_volume_db(AudioServer.get_bus_index("Dialogue"), dbValue);
func _on_EffectsVolume_value_changed(value):
SettingsSingleton.SetEffectsVolumeLevel(value);
ChangeEffectsVolume(value);
func ChangeEffectsVolume(value):
value = float(value);
if value <= 0:
AudioServer.set_bus_mute(AudioServer.get_bus_index("SFX"), true);
else :
if AudioServer.is_bus_mute(AudioServer.get_bus_index("SFX")):
AudioServer.set_bus_mute(AudioServer.get_bus_index("SFX"), false);
var dbValue:float = linear2db(value / 100);
AudioServer.set_bus_volume_db(AudioServer.get_bus_index("SFX"), dbValue);
func LoadTextSettings():
$TextSettingsView / AutoReadCheck.pressed = SettingsSingleton.GetAutoRead();
$TextSettingsView / SkipSeenCheck.pressed = SettingsSingleton.GetSkipSeen();
var slider = $TextSettingsView / TextSpeedSlider;
slider.resize();
slider.get_node("TextureProgress").rect_position.x += 50;
slider.get_node("TextureProgress").min_value = 1;
slider.get_node("TextureProgress").max_value = 10;
slider.setValue(SettingsSingleton.GetTextSpeed())
if not slider.is_connected("value_changed", self, "_on_Text_Speed_value_changed"):
slider.connect("value_changed", self, "_on_Text_Speed_value_changed");
$TextSettingsView / ThemeCheck.pressed = SettingsSingleton.GetDefaultTheme()
var pickers = [$TextSettingsView / CustomTheme / Back / BackPicker, $TextSettingsView / CustomTheme / Text / TextPicker];
for i in pickers:
if not i.is_connected("picker_created", self, "ColorPickerCreated"):
i.connect("picker_created", self, "ColorPickerCreated", [i])
var bkColor:Color = Color(SettingsSingleton.GetBackgroundColor());
var txColor:Color = Color(SettingsSingleton.GetTextColor());
$TextSettingsView / CustomTheme / Back / BackPicker.color = bkColor;
$TextSettingsView / CustomTheme / Text / TextPicker.color = txColor;
$TextSettingsView / CustomTheme / Example / TextureRect.modulate = bkColor;
$TextSettingsView / CustomTheme / Example / Label.set("custom_colors/font_color", txColor)
func _on_AutoPlayCheck_pressed():
var switch = false;
if $TextSettingsView / AutoReadCheck.pressed and $TextSettingsView / SkipSeenCheck.pressed:
$TextSettingsView / SkipSeenCheck.pressed = false;
SettingsSingleton.SetSkipSeen(false);
switch = true;
SettingsSingleton.SetAutoRead($TextSettingsView / AutoReadCheck.pressed);
var menuLayer = get_parent();
if menuLayer.name == "MenuLayer":
var backbuttons = menuLayer.get_parent().get_parent().get_node("BackButton");
backbuttons.get_node("AutoReadButton").pressed = $TextSettingsView / AutoReadCheck.pressed;
if switch:
backbuttons.get_node("FastForwardButton").pressed = false;
func _on_SkipSeenCheck_pressed():
var switch = false;
if $TextSettingsView / SkipSeenCheck.pressed and $TextSettingsView / AutoReadCheck.pressed:
$TextSettingsView / AutoReadCheck.pressed = false;
SettingsSingleton.SetAutoRead(false);
switch = true;
SettingsSingleton.SetSkipSeen($TextSettingsView / SkipSeenCheck.pressed);
var menuLayer = get_parent();
if menuLayer.name == "MenuLayer":
var backbuttons = menuLayer.get_parent().get_parent().get_node("BackButton");
backbuttons.get_node("FastForwardButton").pressed = $TextSettingsView / SkipSeenCheck.pressed;
if switch:
backbuttons.get_node("AutoReadButton").pressed = false;
func _on_ThemeCheck_toggled(_button_pressed):
SettingsSingleton.SetDeafaultTheme($TextSettingsView / ThemeCheck.pressed)
var colorBack = Color.black
var colorText = Color.white
if not ($TextSettingsView / ThemeCheck.pressed):
colorText = SettingsSingleton.GetTextColor()
colorBack = SettingsSingleton.GetBackgroundColor()
else :
SettingsSingleton.SetBackgroundColor(colorBack.to_rgba32());
SettingsSingleton.SetTextColor(colorText.to_rgba32());
$TextSettingsView / CustomTheme / Back / BackPicker.color = colorBack;
$TextSettingsView / CustomTheme / Text / TextPicker.color = colorText;
$TextSettingsView / CustomTheme / Example / TextureRect.modulate = colorBack;
var label = $TextSettingsView / CustomTheme / Example / Label;
label.set("custom_colors/font_color", colorText)
if get_tree().root.has_node("Root/Game"):
var game = get_tree().root.get_node("Root/Game");
game.get_child(0).get_node("DialogNode/TextBubble").ThemeColorChanged();
game.get_child(0).get_node("DialogNode").UpdateButtonTheme();
func _on_Text_Speed_value_changed(value):
SettingsSingleton.SetTextSpeed(value);
var game = get_tree().root.get_node("Root/Game");
if game != null:
game.get_child(0).get_node("DialogNode/TextBubble").SetNewTextSpeed(value);
func ColorPickerCreated(picker:ColorPickerButton):
VisualServer.canvas_item_set_z_index(picker.get_picker().get_canvas_item(), 100);
var aa = picker.get_child(0).get_child(0);
for i in aa.get_children():
i.visible = false;
var mainPicker = aa.get_child(0);
mainPicker.visible = true;
mainPicker.rect_size = Vector2(300, 300)
func _on_BackPicker_color_changed(color:Color):
if $TextSettingsView / ThemeCheck.pressed:
$TextSettingsView / ThemeCheck.pressed = false;
$TextSettingsView / CustomTheme / Example / TextureRect.modulate = color;
SettingsSingleton.SetBackgroundColor(color.to_rgba32());
var game = get_tree().root.get_node("Root/Game")
if game != null:
game.get_child(0).get_node("DialogNode/TextBubble").ThemeColorChanged()
game.get_child(0).get_node("DialogNode").UpdateButtonTheme()
func _on_TextPicker_color_changed(color):
if $TextSettingsView / ThemeCheck.pressed:
$TextSettingsView / ThemeCheck.pressed = false;
var label = $TextSettingsView / CustomTheme / Example / Label;
label.set("custom_colors/font_color", color)
SettingsSingleton.SetTextColor(color.to_rgba32());
var game = get_tree().root.get_node("Root/Game");
if game != null:
game.get_child(0).get_node("DialogNode/TextBubble").ThemeColorChanged()
game.get_child(0).get_node("DialogNode").UpdateButtonTheme()
func LoadTwitchSettings():
$TwitchSettingsView / TwitchCheck.pressed = SettingsSingleton.GetTwitchEnabled();
EnableTwitchSettings();
$TwitchSettingsView / ChannelBox.text = SettingsSingleton.GetTwitchChannel();
var slider = $TwitchSettingsView / TimerSlider;
slider.resize();
slider.get_node("TextureProgress").min_value = 10;
slider.get_node("TextureProgress").max_value = 120;
slider.setValue(SettingsSingleton.GetTwitchTimer())
if not slider.is_connected("value_changed", self, "_on_Timer_value_changed"):
slider.connect("value_changed", self, "_on_Timer_value_changed");
func _on_TwitchCheck_pressed():
SettingsSingleton.SetTwitchEnabled($TwitchSettingsView / TwitchCheck.pressed);
EnableTwitchSettings();
func EnableTwitchSettings():
var value = not $TwitchSettingsView / TwitchCheck.pressed;
$TwitchSettingsView / ChannelBox.readonly = value;
$TwitchSettingsView / StatusContainer / CheckConnectionButton.disabled = value;
func _on_ChannelBox_text_changed():
var entryBox = $TwitchSettingsView / ChannelBox;
SettingsSingleton.SetTwitchChannel(entryBox.text.to_lower());
func _on_Timer_value_changed(value):
SettingsSingleton.SetTwitchTimer(value);
func _on_CheckConnectionButton_pressed():
if $TwitchSettingsView / ChannelBox.text == "":
return ;
var twicil = $TwitchSettingsView / TwiCIL;
var timer:Timer = $TwitchSettingsView / TwitchCheckTimer;
if showTwitchTimer == true:
twicil.Disconnect();
if twicil.is_connected("message_recieved", self, "_on_test_message_recieved"):
twicil.disconnect("message_recieved", self, "_on_test_message_recieved")
showTwitchTimer = false;
timer.stop()
$TwitchSettingsView / StatusContainer / TwitchTimer.text = "?"
var rnd = RandomNumberGenerator.new();
rnd.randomize();
var nick = str("justinfan", rnd.randi_range(10000, 99999));
var client_id = ""
var oauth = "oauth:"
if not twicil.IsConnected():
twicil.connect_to_twitch_chat()
yield (twicil, "ConnectedToTwitch");
if twicil.is_connected("DisconnectedFromTwitch", self, "_disconnected_from_twitch"):
twicil.disconnect("DisconnectedFromTwitch", self, "_disconnected_from_twitch")
twicil.connect("DisconnectedFromTwitch", self, "_disconnected_from_twitch")
twicil.connect_to_channel(SettingsSingleton.GetTwitchChannel(), client_id, oauth, nick)
if twicil.is_connected("message_recieved", self, "_on_test_message_recieved"):
twicil.disconnect("message_recieved", self, "_on_test_message_recieved")
twicil.connect("message_recieved", self, "_on_test_message_recieved")
timer.start(SettingsSingleton.GetTwitchTimer());
showTwitchTimer = true;
$TwitchSettingsView / TwitchStatus.visible = true;
$TwitchSettingsView / StatusContainer / TwitchTimer.visible = true;
func _on_test_message_recieved(_user_name:String, _text:String, _emotes):
var twicil = $TwitchSettingsView / TwiCIL;
if twicil.is_connected("DisconnectedFromTwitch", self, "_disconnected_from_twitch"):
twicil.disconnect("DisconnectedFromTwitch", self, "_disconnected_from_twitch")
showTwitchTimer = false;
$TwitchSettingsView / StatusContainer / TwitchTimer.text = tr("ui_ok");
$TwitchSettingsView / TwitchStatus.visible = false;
$TwitchSettingsView / TwitchCheckTimer.stop();
twicil.disconnect("message_recieved", self, "_on_test_message_recieved")
twicil.Disconnect();
func _disconnected_from_twitch():
$TwitchSettingsView / TwitchCheckTimer.stop();
showTwitchTimer = false;
$TwitchSettingsView / StatusContainer / TwitchTimer.text = "error"
$TwitchSettingsView / TwitchStatus.visible = false;
var twicil = $TwitchSettingsView / TwiCIL;
twicil.disconnect("message_recieved", self, "_on_test_message_recieved")
twicil.Disconnect();
func _on_TwitchCheckTimer_timeout():
var twicil = $TwitchSettingsView / TwiCIL;
if twicil.is_connected("DisconnectedFromTwitch", self, "_disconnected_from_twitch"):
twicil.disconnect("DisconnectedFromTwitch", self, "_disconnected_from_twitch")
showTwitchTimer = false;
$TwitchSettingsView / StatusContainer / TwitchTimer.text = tr("ui_no_connection");
$TwitchSettingsView / TwitchStatus.visible = false;
twicil.disconnect("message_recieved", self, "_on_test_message_recieved")
twicil.Disconnect();
var showTwitchTimer = false;
func _process(_delta):
if showTwitchTimer:
$TwitchSettingsView / StatusContainer / TwitchTimer.text = "%d" % $TwitchSettingsView / TwitchCheckTimer.time_left;
func GetNodes():
var nodes = [
"BackToMenuButton",
"ApplyButton",
"ReturnToGameButton",
"AllSettingsView/VideoButton",
"AllSettingsView/AudioButton",
"AllSettingsView/TextButton",
"AllSettingsView/LanguageButton",
"AllSettingsView/TwitchButton",
"VideoSettingsView/WindowStates/WindowedCheck",
"VideoSettingsView/WindowStates/BorderlessCheck",
"VideoSettingsView/WindowStates/FullscreenCheck",
"VideoSettingsView/WindowResolutionLabel",
"VideoSettingsView/LowProcessor",
"VideoSettingsView/SyncBackground",
"AudioSettingsView/GeneralVolumeSlider",
"AudioSettingsView/MusicVolumeSlider",
"AudioSettingsView/DialogueVolumeSlider",
"AudioSettingsView/EffectsVolumeSlider",
"TextSettingsView/AutoReadCheck",
"TextSettingsView/SkipSeenCheck",
"TextSettingsView/ThemeCheck",
"TwitchSettingsView/TwitchCheck",
"TwitchSettingsView/StatusContainer/CheckConnectionButton",
];
return nodes;
func _on_Settings_tree_exited():
pass;
func RemoveHover():
var nodes = GetNodes();
for i in nodes:
var node = get_node(i);
if node is Button:
onButtonHoverOff(node);
func _on_ReturnButton_pressed():
BackToAllView();
func _on_ApplyButton_pressed():
SettingsSingleton.SaveSettings();
func _on_BackToMenuButton_pressed():
RemoveHover()
emit_signal("BackFromSettings");
func _on_ReturnToGameButton_pressed():
RemoveHover()
emit_signal("ReturnToGame");
func _on_VideoButton_pressed():
videoSettingsView.visible = true;
audioSettingsView.visible = false;
textSettingsView.visible = false;
languageSettingsView.visible = false;
twitchSettingsView.visible = false;
func _on_AudioButton_pressed():
videoSettingsView.visible = false;
audioSettingsView.visible = true;
textSettingsView.visible = false;
languageSettingsView.visible = false;
twitchSettingsView.visible = false;
func _on_TextButton_pressed():
videoSettingsView.visible = false;
audioSettingsView.visible = false;
textSettingsView.visible = true;
languageSettingsView.visible = false;
twitchSettingsView.visible = false;
func _on_LanguageButton_pressed():
videoSettingsView.visible = false;
audioSettingsView.visible = false;
textSettingsView.visible = false;
languageSettingsView.visible = true;
twitchSettingsView.visible = false;
func _on_TwitchButton_pressed():
videoSettingsView.visible = false;
audioSettingsView.visible = false;
textSettingsView.visible = false;
languageSettingsView.visible = false;
twitchSettingsView.visible = true;

55
scripts/SettingsScene.gd Normal file
View file

@ -0,0 +1,55 @@
extends Node2D
func _ready():
SetBackground();
$Temp / Settings.setType(0);
var _temp = $Temp / Settings.connect("BackFromSettings", self, "backFromSettings")
_temp = $Temp / Settings.connect("ResolutionChanged", self, "resolutionChanged")
func SetBackground():
var windowSize = SettingsSingleton.GetCurrectScreenResolutionVector2()
$Blur.set_polygon(PoolVector2Array([
Vector2(0, 0),
Vector2(0, windowSize.y),
Vector2(windowSize.x, windowSize.y),
Vector2(windowSize.x, 0)
]))
var backgroundsSize = Vector2(3840, 2160);
var scaleX = 1 / float(backgroundsSize.x / windowSize.x);
var scaleY = 1 / float(backgroundsSize.y / windowSize.y);
$House.scale = Vector2(scaleX, scaleY);
var cloudH = 2160;
var cloudScale = windowSize.y * 0.53 / cloudH;
$Cloud1.scale = Vector2(cloudScale, cloudScale);
$Cloud3.scale = Vector2(cloudScale, cloudScale);
func backFromSettings():
if not SceneLoader.is_connected("on_scene_loaded", self, "MenuLoaded"):
var _temp = SceneLoader.connect("on_scene_loaded", self, "MenuLoaded");
SceneLoader.load_scene("res://scenes/MainMenu.tscn")
func MenuLoaded(obj):
if obj.path != "res://scenes/MainMenu.tscn":
return
if obj.instance != null:
get_tree().root.add_child(obj.instance);
for i in get_tree().root.get_children():
if i.name == "SettingsScene":
get_tree().root.remove_child(i);
break;
SceneLoader.disconnect("on_scene_loaded", self, "MenuLoaded");
func resolutionChanged():
SetBackground();
func _input(ev):
if ev is InputEventKey and ev.scancode == KEY_ESCAPE:
backFromSettings();

View file

@ -0,0 +1,242 @@
extends Node
var galleryPath = OS.get_user_data_dir() + "/gallery.json";
var galleryObject = {}
func _ready():
Init();
func Init():
var fileObj = File.new();
if not (fileObj.file_exists(galleryPath)):
CreateGallery();
else :
fileObj.open(galleryPath, File.READ);
var content = fileObj.get_as_text();
Deserialize(content);
fileObj.close();
func CreateGallery():
galleryObject = {
"musics":["Menu", ],
"backgrounds":[],
"images":[]
}
SaveToFile();
func Deserialize(fileContent):
galleryObject = str2var(fileContent);
func SaveToFile():
var fileObj = File.new()
fileObj.open(galleryPath, File.WRITE)
var content = var2str(galleryObject);
fileObj.store_string(content)
fileObj.close()
func AddMusic(content):
content = str(content);
if content == "99":
return ;
var key = "";
for i in GetMusicSettings():
if str(content, ".ogg") in i.path:
key = i.name
break;
if not key in galleryObject["musics"]:
galleryObject["musics"].push_back(key);
SaveToFile();
CheckForGreatCollector();
func AddBackground(content):
if not content in galleryObject["backgrounds"]:
galleryObject["backgrounds"].push_back(content);
SaveToFile();
CheckForGreatCollector();
func AddImage(content):
if not content in galleryObject["images"]:
galleryObject["images"].push_back(content);
SaveToFile();
CheckForGreatCollector();
func HaveMusic(content)->bool:
return content in galleryObject["musics"];
func HaveBackground(content)->bool:
return content in galleryObject["backgrounds"];
func HaveImage(content)->bool:
return content in galleryObject["images"];
func GetMusicSettings():
var music = [
{"name":"Menu", "path":"res://resources/audio/bgm/1.ogg"},
{"name":"First", "path":"res://resources/audio/bgm/2.ogg"},
{"name":"Restaurant", "path":"res://resources/audio/bgm/3.ogg"},
{"name":"Dating", "path":"res://resources/audio/bgm/4.ogg"},
{"name":"Funny Scene", "path":"res://resources/audio/bgm/5.ogg"},
{"name":"Murderer Theme", "path":"res://resources/audio/bgm/6.ogg"},
{"name":"Romantic Scene", "path":"res://resources/audio/bgm/8.ogg"},
{"name":"Intimate Scene", "path":"res://resources/audio/bgm/9.ogg"},
{"name":"Worried Theme", "path":"res://resources/audio/bgm/10.ogg"},
{"name":"Ending", "path":"res://resources/audio/FuckGallery/12.ogg"},
{"name":"You Died", "path":"res://resources/audio/bgm/13.ogg"},
{"name":"Do Not Worry", "path":"res://resources/audio/FuckGallery/14.ogg"},
{"name":"Think", "path":"res://resources/audio/bgm/15.ogg"},
{"name":"Strange Girl", "path":"res://resources/audio/bgm/16.ogg"},
{"name":"Silent Ambient", "path":"res://resources/audio/FuckGallery/17.ogg"},
{"name":"Dark Ambient", "path":"res://resources/audio/FuckGallery/18.ogg"},
{"name":"Sadness", "path":"res://resources/audio/FuckGallery/19.ogg"},
{"name":"Searching", "path":"res://resources/audio/FuckGallery/20.ogg"},
{"name":"Agatha Theme", "path":"res://resources/audio/FuckGallery/21.ogg"},
{"name":"Dana Theme", "path":"res://resources/audio/FuckGallery/22.ogg"},
{"name":"Linda Theme", "path":"res://resources/audio/FuckGallery/23.ogg"},
{"name":"Hugh Theme", "path":"res://resources/audio/bgm/24.ogg"},
{"name":"Train One", "path":"res://resources/audio/bgm/25.ogg"},
{"name":"Fight Scene", "path":"res://resources/audio/FuckGallery/26.ogg"},
{"name":"Fight Track", "path":"res://resources/audio/bgm/27.ogg"},
{"name":"BigCity", "path":"res://resources/audio/bgm/BigCity.ogg"},
{"name":"Triptych", "path":"res://resources/audio/bgm/29.ogg"},
]
var easterEgg = HaveMusic("Survive");
if easterEgg:
music.insert(25, {"name":"Survive", "path":"res://resources/audio/bgm/Survive.ogg"});
music.insert(26, {"name":"Survive (Eng)", "path":"res://resources/audio/bgm/Survive (Eng).ogg"});
return music;
func GetBackgroundsSettings():
var bg = [
{"name":"Scene_alt1", "path":"res://resources/graphics/Gallery/Backgrounds/Scene_alt1.webp"},
{"name":"Scene2", "path":"res://resources/graphics/Gallery/Backgrounds/Scene2.webp"},
{"name":"Scene2_1", "path":"res://resources/graphics/Gallery/Backgrounds/Scene2_1.webp"},
{"name":"Scene2_2", "path":"res://resources/graphics/Gallery/Backgrounds/Scene2_2.webp"},
{"name":"Scene4", "path":"res://resources/graphics/Gallery/Backgrounds/Scene4.webp"},
{"name":"Scene6", "path":"res://resources/graphics/Gallery/Backgrounds/Scene6.webp"},
{"name":"Scene7", "path":"res://resources/graphics/Gallery/Backgrounds/Scene7.webp"},
{"name":"Scene8", "path":"res://resources/graphics/Gallery/Backgrounds/Scene8.webp"},
{"name":"Scene9", "path":"res://resources/graphics/Gallery/Backgrounds/Scene9.webp"},
{"name":"Scene12", "path":"res://resources/graphics/Gallery/Backgrounds/Scene12.webp"},
{"name":"Kamin", "path":"res://resources/graphics/Gallery/Backgrounds/Kamin.webp"},
{"name":"Podval", "path":"res://resources/graphics/Gallery/Backgrounds/Podval.webp"},
{"name":"Garaj", "path":"res://resources/graphics/Gallery/Backgrounds/Garaj.webp"},
{"name":"Vtoroi_etaj", "path":"res://resources/graphics/Gallery/Backgrounds/Vtoroi_etaj.webp"},
{"name":"Tretii_etaj", "path":"res://resources/graphics/Gallery/Backgrounds/Tretii_etaj.webp"},
{"name":"DomikVnutri", "path":"res://resources/graphics/Gallery/Backgrounds/DomikVnutri.webp"},
{"name":"Pristan", "path":"res://resources/graphics/Gallery/Backgrounds/Pristan.webp"},
{"name":"Room_Agatha", "path":"res://resources/graphics/Gallery/Backgrounds/Room_Agatha.webp"},
{"name":"Room_Dana", "path":"res://resources/graphics/Gallery/Backgrounds/Room_Dana.webp"},
{"name":"Room_Emiliya", "path":"res://resources/graphics/Gallery/Backgrounds/Room_Emiliya.webp"},
{"name":"Room_Linda", "path":"res://resources/graphics/Gallery/Backgrounds/Room_Linda.webp"},
{"name":"Blood_floor", "path":"res://resources/graphics/Gallery/Backgrounds/Blood_floor.webp"},
{"name":"Mayak", "path":"res://resources/graphics/Gallery/Backgrounds/Mayak.webp"},
{"name":"Mayak_Back", "path":"res://resources/graphics/Gallery/Backgrounds/Mayak_Back.webp"},
{"name":"Panorama", "path":"res://resources/graphics/Gallery/Backgrounds/Panorama.webp"},
{"name":"PoliceStation", "path":"res://resources/graphics/Gallery/Backgrounds/PoliceStation.webp"},
{"name":"Room_Martin", "path":"res://resources/graphics/Gallery/Backgrounds/Room_Martin.webp"},
{"name":"Sarai", "path":"res://resources/graphics/Gallery/Backgrounds/Sarai.webp"},
{"name":"Stol", "path":"res://resources/graphics/Gallery/Backgrounds/Stol.webp"},
{"name":"Train_video", "path":"res://resources/graphics/Gallery/Backgrounds/Train_video.webp"},
{"name":"ChapterSelector", "path":"res://resources/graphics/Gallery/Backgrounds/ChapterSelector.webp"},
{"name":"Hospital", "path":"", "multiB":["Hospital_Pink", "Hospital_Blue", "Hospital_Green", "Hospital_Purple", "Hospital_Orange", "Hospital_Black", "Hospital_Loser"]},
]
return bg;
func GetImagesSettings():
var im = [
{"name":"Black_Death_1", "path":"res://resources/graphics/Gallery/Images/Black_Death_1.webp"},
{"name":"Death_fall", "path":"res://resources/graphics/Gallery/Images/Death_fall.webp"},
{"name":"Death_knife", "path":"res://resources/graphics/Gallery/Images/Death_knife.webp"},
{"name":"Green_Death_1", "path":"res://resources/graphics/Gallery/Images/Green_Death_1.webp"},
{"name":"Purple_Death_1", "path":"res://resources/graphics/Gallery/Images/Purple_Death_1.webp"},
{"name":"Roman_black", "path":"res://resources/graphics/Gallery/Images/Roman_black.webp"},
{"name":"Roman_blue", "path":"res://resources/graphics/Gallery/Images/Roman_blue.webp"},
{"name":"Roman_green", "path":"res://resources/graphics/Gallery/Images/Roman_green.webp"},
{"name":"Roman_pink", "path":"res://resources/graphics/Gallery/Images/Roman_pink.webp"},
{"name":"Roman_violet", "path":"res://resources/graphics/Gallery/Images/Roman_violet.webp"},
{"name":"Roman_Orange", "path":"res://resources/graphics/Gallery/Images/Roman_Orange.webp"},
{"name":"Emiliya_sex", "path":"res://resources/graphics/Gallery/Images/Emiliya_sex.webp"},
{"name":"Agatha_sex", "path":"res://resources/graphics/Gallery/Images/Agatha_sex.webp"},
{"name":"Amanda_sex", "path":"res://resources/graphics/Gallery/Images/Amanda_sex.webp"},
{"name":"Amanda_Suicide", "path":"res://resources/graphics/Gallery/Images/Amanda_Suicide.webp"},
{"name":"Linda_sex", "path":"res://resources/graphics/Gallery/Images/Linda_sex.webp"},
{"name":"Dana_sex", "path":"res://resources/graphics/Gallery/Images/Dana_sex.webp"},
{"name":"Renata_sex", "path":"res://resources/graphics/Gallery/Images/Renata_sex.webp"},
{"name":"Emiliya_Go_Away", "path":"res://resources/graphics/Gallery/Images/Emiliya_Go_Away.webp"},
{"name":"Final_Amanda", "path":"res://resources/graphics/Gallery/Images/Final_Amanda.webp"},
{"name":"Final_Emiliya", "path":"res://resources/graphics/Gallery/Images/Final_Emiliya.webp"},
{"name":"Death_shot_epilogue", "path":"res://resources/graphics/Gallery/Images/Death_shot_epilogue.webp"},
{"name":"Death_shot_girl", "path":"", "multi":["Death_shot_girl_blue", "Death_shot_girl_pink"]},
{"name":"Pistol", "path":"res://resources/graphics/Gallery/Images/Pistol.webp"},
{"name":"Vzriv2", "path":"", "multi":["Vzriv2_Gray", "Vzriv2_White", "Vzriv2_Red", "Vzriv2_Blue_M", ]},
{"name":"Death_Stairs", "path":"res://resources/graphics/Gallery/Images/Death_Stairs.webp"},
{"name":"Death_Poison", "path":"", "multi":["Death_Poison_Green", "Death_Poison_Black", "Death_Poison_Hugh", "Death_Poison_Purple"]},
{"name":"Death_Boy_Electricity", "path":"res://resources/graphics/Gallery/Images/Death_Boy_Electricity.webp"},
{"name":"WoundedDead", "path":"", "multi":["WoundedDead_Red", "WoundedDead_White", "WoundedDead_Blue", "WoundedDead_Gray"]},
{"name":"Car", "path":"res://resources/graphics/Gallery/Images/Car.webp"},
{"name":"Death_Car", "path":"res://resources/graphics/Gallery/Images/Death_Car.webp"},
{"name":"Amanda_before_sex", "path":"res://resources/graphics/Gallery/Images/Amanda_before_sex.webp"},
{"name":"Death_shot", "path":"res://resources/graphics/Gallery/Images/Death_shot.webp"},
{"name":"Kofta", "path":"res://resources/graphics/Gallery/Images/Kofta.webp"},
{"name":"Death_Electro", "path":"res://resources/graphics/Gallery/Images/Death_Electro.webp"},
]
return im;
func GetDlcsSettings()->Array:
var dlcs = [
{"name":"AgathaDLC", "path":"res://resources/graphics/Gallery/DLC/AgathaDLC.webp"},
{"name":"AmandaDLC", "path":"res://resources/graphics/Gallery/DLC/AmandaDLC.webp"},
{"name":"DanaDLC", "path":"res://resources/graphics/Gallery/DLC/DanaDLC.webp"},
{"name":"EmiliyaDLC", "path":"res://resources/graphics/Gallery/DLC/EmiliyaDLC.webp"},
{"name":"LindaDLC", "path":"res://resources/graphics/Gallery/DLC/LindaDLC.webp"},
{"name":"RenataDLC", "path":"res://resources/graphics/Gallery/DLC/RenataDLC.webp"},
]
return dlcs;
var musicGC = [];
var backgroundsGC = [];
var imagesGC = [];
func CheckForGreatCollector():
if musicGC.size() == 0:
var temp = GetMusicSettings();
for i in temp:
musicGC.push_back(i["name"]);
temp = GetBackgroundsSettings();
for i in temp:
backgroundsGC.push_back(i["name"]);
temp = GetImagesSettings();
for i in temp:
imagesGC.push_back(i["name"]);
for i in musicGC:
if not HaveMusic(i):
return ;
for i in backgroundsGC:
if not HaveBackground(i):
return ;
for i in imagesGC:
if not HaveImage(i):
return ;
# Steam.set_achievement("Great_Collector");

View file

@ -0,0 +1,31 @@
extends Node
var blackClues = [];
var greenClues = [];
var purpleClues = [];
func GetBlackClues():
return blackClues;
func AddBlackClues(code):
if not code in blackClues:
blackClues.push_back(code);
func GetGreenClues():
return greenClues;
func AddGreenClues(code):
if not code in greenClues:
greenClues.push_back(code);
func GetPurpleClues():
return purpleClues;
func AddPurpleClues(code):
if not code in purpleClues:
purpleClues.push_back(code);
func ClearCluesArray():
blackClues.clear();
greenClues.clear();
purpleClues.clear();

View file

@ -0,0 +1,343 @@
extends Node
var achievePath = OS.get_user_data_dir() + "/achievements.json";
var achieveObject = {}
func _ready():
Init();
MakeSureArraysExist();
func Init():
var fileObj = File.new();
if not (fileObj.file_exists(achievePath)):
CreateAchieve();
else :
fileObj.open(achievePath, File.READ);
var content = fileObj.get_as_text();
Deserialize(content);
fileObj.close();
func MakeSureArraysExist():
var keys = ["cats", "minigame", "seenCharacters", "profileTexts", "deathAchievements", "sexAchievements", "killerAchievement", "yellowDeathAchievement", "numberDeathAchievement", ]
var shouldUpdate = false;
for i in keys:
if not achieveObject.has(i):
achieveObject[i] = [];
shouldUpdate = true;
if shouldUpdate:
SaveToFile();
func CreateAchieve():
achieveObject = {
"cats":[],
"minigame":[],
"seenCharacters":[],
"profileTexts":[],
"deathAchievements":[],
"sexAchievements":[],
"killerAchievement":[],
"yellowDeathAchievement":[],
"numberDeathAchievement":[],
}
SaveToFile();
func Deserialize(fileContent):
achieveObject = str2var(fileContent);
func SaveToFile():
var fileObj = File.new()
fileObj.open(achievePath, File.WRITE)
var content = var2str(achieveObject);
fileObj.store_string(content);
fileObj.close();
func AddCat(catNumber:int)->int:
if not catNumber in achieveObject["cats"]:
achieveObject["cats"].push_back(catNumber);
SaveToFile();
return achieveObject["cats"].size();
return - 1;
func GetMinigameClues():
return achieveObject["minigame"];
func AddMinigameClue(clue:String)->int:
if not clue in achieveObject["minigame"]:
achieveObject["minigame"].push_back(clue);
SaveToFile();
return achieveObject["minigame"].size();
return - 1;
func SetMinigameVariables():
isWindowPressed = Dialogic.get_variable("WindowPressed") == "1";
isCasketPressed = Dialogic.get_variable("CasketPressed") == "1";
isDrawerPressed = Dialogic.get_variable("DrawerPressed") == "1";
isBarrelPressed = Dialogic.get_variable("BarrelPressed") == "1";
isClosedTrapdoorPressed = Dialogic.get_variable("ClosedTrapdoorPressed") == "1";
var isWindowPressed:bool = false;
func WindowPressed():
isWindowPressed = true;
Dialogic.set_variable("WindowPressed", "1");
func IsWindowPressed()->bool:
return isWindowPressed;
var isCasketPressed:bool = false;
func CasketPressed():
isCasketPressed = true;
Dialogic.set_variable("CasketPressed", "1");
func IsCasketPressed()->bool:
return isCasketPressed;
var isDrawerPressed:bool = false;
func DrawerPressed():
isDrawerPressed = true;
Dialogic.set_variable("DrawerPressed", "1");
func IsDrawerPressed()->bool:
return isDrawerPressed;
var isBarrelPressed:bool = false;
func BarrelPressed():
isBarrelPressed = true;
Dialogic.set_variable("BarrelPressed", "1");
func IsBarrelPressed()->bool:
return isBarrelPressed;
var isClosedTrapdoorPressed:bool = false;
func ClosedTrapdoorPressed():
isClosedTrapdoorPressed = true;
Dialogic.set_variable("ClosedTrapdoorPressed", "1");
func IsClosedTrapdoorPressed()->bool:
return isClosedTrapdoorPressed;
func AddSeenCharacter(character:String):
if not character in achieveObject["seenCharacters"]:
achieveObject["seenCharacters"].push_back(character);
SaveToFile();
return
return
func AddProfileText(stringText:String):
if not stringText in achieveObject["profileTexts"]:
achieveObject["profileTexts"].push_back(stringText);
SaveToFile();
return
return
func GetSeenCharacters():
return achieveObject["seenCharacters"]
func IsInSeenCharacters(name:String)->bool:
return name in achieveObject["seenCharacters"];
func GetProfileText():
return achieveObject["profileTexts"]
var allDeathAch = [
"Fall",
"Knife",
"Electrocute",
"Explosion",
"Poison",
"Stairs",
"Pillow",
"Drowned",
"Shot_boy",
"Shot_girl",
]
func AddDeathAchievement(achName):
# Steam.set_achievement(achName);
if not achName in achieveObject["deathAchievements"]:
achieveObject["deathAchievements"].push_back(achName);
SaveToFile();
for i in allDeathAch:
if not i in achieveObject["deathAchievements"]:
return ;
# Steam.set_achievement("Immortal");
var allSexAch = [
"Orange_S",
"Green_S",
"Pink_S",
"Blue_S",
"Black_S",
"Purple_S",
]
func AddSexAchievement(achName):
# Steam.set_achievement(achName);
if not achName in achieveObject["sexAchievements"]:
achieveObject["sexAchievements"].push_back(achName);
SaveToFile();
for i in allSexAch:
if not i in achieveObject["sexAchievements"]:
return ;
# Steam.set_achievement("Don_Juan");
func AddKillersAchievement(killer):
if not killer in achieveObject["killerAchievement"]:
achieveObject["killerAchievement"].push_back(killer);
SaveToFile();
var killers = ["Blue", "Pink"];
for i in killers:
if not i in achieveObject["killerAchievement"]:
return ;
# Steam.set_achievement("Two_killer");
func AddYellowDeathAchievement(achName):
if not achName in achieveObject["yellowDeathAchievement"]:
achieveObject["yellowDeathAchievement"].push_back(achName);
SaveToFile();
var deaths = ["Electricity", "Fire"];
for i in deaths:
if not i in achieveObject["yellowDeathAchievement"]:
return ;
# Steam.set_achievement("Boss_death");
func AddNumberDeathAchievement(death, boy):
var achName = str(death, boy);
if not achName in achieveObject["numberDeathAchievement"]:
achieveObject["numberDeathAchievement"].push_back(achName);
SaveToFile();
var deaths = CreateNumberDeathCheck();
for i in deaths:
if not i in achieveObject["numberDeathAchievement"]:
return ;
# Steam.set_achievement("Definitely_not_me");
var numberDeathCheck = [];
func CreateNumberDeathCheck()->Array:
if numberDeathCheck.size() != 0:
return numberDeathCheck;
var numberDeath = ["3_Death_Electricity", "4_Death_Fire"];
var deathBoys = ["Red", "Yellow", "White", "Blue_M", "Gray"];
for i in numberDeath:
for j in deathBoys:
numberDeathCheck.push_back(str(i, j));
return numberDeathCheck;
var slotLocation = [
Vector2(1478, 620),
Vector2(2004, 700),
Vector2(2504, 712),
Vector2(1920, 961),
Vector2(2440, 1008),
Vector2(1256, 1248),
Vector2(1876, 1308),
Vector2(2454, 1322),
Vector2(1036, 1704),
Vector2(1676, 1672),
Vector2(2328, 1728),
]
var variables = [
{"variable":"Garage", "slot":10},
{"variable":"Office", "slot":11},
{"variable":"Kamin", "slot":8},
{"variable":"Room", "slot":3},
{"variable":"Smoking", "slot":2},
{"variable":"Kitchen", "slot":1},
{"variable":"Stairs", "slot":5},
{"variable":"Lighthouse", "slot":7},
{"variable":"Cliff", "slot":4},
{"variable":"Parking", "slot":9},
{"variable":"Pristan", "slot":4},
{"variable":"Podval", "slot":6},
{"variable":"Prichal", "slot":3},
{"variable":"Restaurant", "slot":8},
{"variable":"Tropa", "slot":9},
];
var cachedEpilog:Array = [];
func CreateEpilogMinigameImages()->Array:
if cachedEpilog.size() != 0:
return cachedEpilog;
var available = {};
for i in range(1, 12):
available[i] = 0;
for i in variables:
if Dialogic.get_variable(i["variable"]) == "1":
cachedEpilog.push_back({"name":i["variable"], "status":true, "slot":i["slot"]});
available[i["slot"]] += 1;
for i in available:
if available[i] == 1:
continue;
if available[i] == 2:
var firstAvailableSlot = FirstAvailableSlot(available);
available[firstAvailableSlot] = 1;
available[i] = 1;
for j in cachedEpilog:
if j["slot"] == i:
j["slot"] = firstAvailableSlot;
j["location"] = slotLocation[firstAvailableSlot - 1];
break
for i in available:
if available[i] == 1:
continue;
if available[i] == 0:
for j in variables:
if j["slot"] == i:
cachedEpilog.push_back({"name":j["variable"], "status":false, "slot":j["slot"]});
break
return cachedEpilog;
func FirstAvailableSlot(dict:Dictionary)->int:
for i in dict:
var value = dict[i];
if value == 0:
return i;
return 1;

View file

@ -0,0 +1,125 @@
extends Node
var thread
var scene_queue = {}
var file = File.new()
var cache = {}
var awaiters = []
signal on_progress
signal on_scene_loaded
var running;
func _ready():
running = true;
thread = Thread.new()
thread.start(self, "_thread_runner", null)
func _thread_runner(o):
while running:
OS.delay_msec(5)
if scene_queue.size() > 0:
for i in scene_queue:
var err = scene_queue[i].loader.poll()
call_deferred("emit_signal", "on_progress", scene_queue[i].path, scene_queue[i].loader.get_stage_count(), scene_queue[i].loader.get_stage())
if err == ERR_FILE_EOF:
scene_queue[i].loader = scene_queue[i].loader.get_resource()
scene_queue[i].instance = scene_queue[i].loader.instance()
cache[scene_queue[i].path] = scene_queue[i]
call_deferred("emit_signal", "on_scene_loaded", scene_queue[i])
scene_queue.erase(scene_queue[i].path)
elif err != OK:
print("Failed to load: " + scene_queue[i].path)
scene_queue.erase(scene_queue[i].path)
for awaiter in awaiters:
if cache.has(awaiter.path):
if awaiter.path == cache[awaiter.path].path:
awaiter.loader = cache[awaiter.path].loader
awaiter.instance = cache[awaiter.path].instance.duplicate()
call_deferred("emit_signal", "on_scene_loaded", awaiter)
awaiters.remove(awaiters.find(awaiter))
func load_scene(path, props = null):
if not file.file_exists(path):
print("File does not exist: " + path)
return
if cache.has(path):
call_deferred("emit_signal", "on_scene_loaded", {path = path, loader = cache[path].loader, instance = cache[path].loader.instance(), props = props})
return
if not scene_queue.has(path):
scene_queue[path] = {path = path, loader = ResourceLoader.load_interactive(path), instance = null, props = props}
else :
awaiters.push_back({path = path, loader = null, instance = null, props = props})
func is_loading_scene(path):
return scene_queue.has(path)
func clear_cache():
for item in cache:
item.instance.queue_free()
cache = {}
func pop_cache():
if cache.size() > 5:
var lastKey = cache.keys()[0];
cache[lastKey].instance.queue_free()
cache.erase(lastKey);
func getSceneByPath(scenePath:String)->Node:
for i in cache.keys():
var item = cache[i];
if item.path == scenePath:
return item.instance;
return null;
func free_scene_cache(sceneName:String):
sceneName = sceneName + ".tscn";
for i in cache.keys():
if sceneName in i:
cache[i].instance.queue_free()
cache.erase(i);
func get_cache_size()->int:
return cache.size();
func stop_scene_loader():
running = false;
if thread != null:
thread.wait_to_finish();

88
scripts/TweenBGM.gd Normal file
View file

@ -0,0 +1,88 @@
extends Tween
const fadeMusicTime = 0.8;
const lowVolume = - 80;
const defaultVolume:float = 0.0;
var bgmStream:AudioStreamPlayer;
var darkChild:Sprite;
func _ready():
bgmStream = self.get_child(0);
bgmStream.bus = "BGM";
loopEnable = false;
func PlayBGM(bgmPath):
PrepareLoopVersion(bgmPath);
bgmStream.volume_db = lowVolume;
bgmStream.stream = load(bgmPath);
var _temp = self.interpolate_property(bgmStream, "volume_db", lowVolume, defaultVolume, fadeMusicTime, Tween.TRANS_EXPO, 0)
if bgmPath == "res://resources/audio/bgm/25.ogg":
bgmStream.play(1.5);
else :
bgmStream.play(0.0);
_temp = self.start();
func StopBGM():
var _temp = self.interpolate_property(bgmStream, "volume_db", defaultVolume, lowVolume, fadeMusicTime, Tween.TRANS_LINEAR, 0)
_temp = self.start();
loopEnable = false
yield (self, "tween_all_completed");
if bgmStream.stream != null:
bgmStream.stream.resource_path = ""
bgmStream.stream = null;
func ChangeBGM(bgmPath2):
if bgmStream.stream != null and bgmStream.stream.resource_path == bgmPath2:
return ;
var bgmPath3 = bgmPath2.trim_suffix(".ogg") + "_loop.ogg"
if bgmStream.stream.resource_path == bgmPath2 or bgmStream.stream.resource_path == bgmPath3:
return ;
StopBGM();
yield (self, "tween_all_completed")
PlayBGM(bgmPath2);
func SetNextTriptych(bgmPath):
loopEnable = true;
bgmStream.stream.set_loop_mode(0);
loopVersionPath = bgmPath;
var dict = {
"res://resources/audio/bgm/14.ogg":"res://resources/audio/bgm/14_loop.ogg",
"res://resources/audio/bgm/17.ogg":"res://resources/audio/bgm/17_loop.ogg",
"res://resources/audio/bgm/18.ogg":"res://resources/audio/bgm/18_loop.ogg",
"res://resources/audio/bgm/19.ogg":"res://resources/audio/bgm/19_loop.ogg",
"res://resources/audio/bgm/20.ogg":"res://resources/audio/bgm/20_loop.ogg",
"res://resources/audio/bgm/21.ogg":"res://resources/audio/bgm/21_loop.ogg",
"res://resources/audio/bgm/22.ogg":"res://resources/audio/bgm/22_loop.ogg",
"res://resources/audio/bgm/23.ogg":"res://resources/audio/bgm/23_loop.ogg",
"res://resources/audio/bgm/26.ogg":"res://resources/audio/bgm/26_loop.ogg",
}
var loopEnable;
var loopVersionPath;
func PrepareLoopVersion(bgmPath):
if dict.has(bgmPath):
loopVersionPath = dict[bgmPath];
loopEnable = true;
else :
loopVersionPath = "";
loopEnable = false;
func _on_BGMStreamPlayer_finished():
if loopEnable:
bgmStream.stream = load(loopVersionPath);
bgmStream.play(0.0);
loopEnable = false;

Some files were not shown because too many files have changed in this diff Show more