768 lines
28 KiB
GDScript
768 lines
28 KiB
GDScript
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);
|