Initial Android commit
This commit is contained in:
commit
1e2b80c13d
8521 changed files with 231475 additions and 0 deletions
78
scripts/Investigations/Epilog_minigame.gd
Normal file
78
scripts/Investigations/Epilog_minigame.gd
Normal 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);
|
81
scripts/Investigations/InvestigationBase.gd
Normal file
81
scripts/Investigations/InvestigationBase.gd
Normal 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;
|
24
scripts/Investigations/InvestigationBlack.gd
Normal file
24
scripts/Investigations/InvestigationBlack.gd
Normal 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);
|
24
scripts/Investigations/InvestigationGreen.gd
Normal file
24
scripts/Investigations/InvestigationGreen.gd
Normal 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);
|
25
scripts/Investigations/InvestigationPurple.gd
Normal file
25
scripts/Investigations/InvestigationPurple.gd
Normal 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);
|
169
scripts/Investigations/Minigame.gd
Normal file
169
scripts/Investigations/Minigame.gd
Normal 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");
|
Loading…
Add table
Add a link
Reference in a new issue