Skip to content

Commit

Permalink
implementing more dialogue
Browse files Browse the repository at this point in the history
  • Loading branch information
IronShears committed Jan 28, 2024
1 parent 7dc72b5 commit 14cd7d3
Show file tree
Hide file tree
Showing 8 changed files with 519 additions and 100 deletions.
40 changes: 24 additions & 16 deletions Commandprompt.gd
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ func _play_dialog():
$AutoCloseTimer.wait_time = closetime


func _input(event):
if dialogue != null:
if event is InputEventMouseButton and event.is_pressed():
if textBox.get_visible_characters() < textBox.get_total_character_count():
textBox.set_visible_characters(textBox.get_total_character_count())
$AutoCloseTimer.start()
#func _input(event):
# if dialogue != null:
# if event is InputEventMouseButton and event.is_pressed():
# if textBox.get_visible_characters() < textBox.get_total_character_count():
# textBox.set_visible_characters(textBox.get_total_character_count())
# $AutoCloseTimer.start()
#

func skip_input():
if page < endpoint:
Expand All @@ -63,6 +63,8 @@ func set_up():
text = dialogue[page]["text"]
text = text.replace("{insertText}",pastDialogue[-1]["text"])
text = text.replace("{name}", playerName)
text = text.replace("{nameReaction}", UniversalFunctions.dialogueJson[UniversalFunctions.nameReaction])
text = text.replace("{emptyFilled}", UniversalFunctions.dialogueJson[UniversalFunctions.emptyFilled])
text = text.replace("{missingDialogue}", currentTree)
print(currentTree)
if dialogue[page]["color"] == "Teal":
Expand All @@ -71,8 +73,9 @@ func set_up():
if optionsVisible == true:
if UniversalFunctions.dialogueJson.has(dialogue[page]["options"]):
options = UniversalFunctions.dialogueJson[dialogue[page]["options"]]
options = options.replace("{variableOption}", UniversalFunctions.VariableOption)
else:
if UniversalFunctions.disgust < 60:
if UniversalFunctions.disgust < 20:
if UniversalFunctions.loneliness <60:
if UniversalFunctions.dialogueJson.has("fine"+dialogue[page]["options"]):
options = UniversalFunctions.dialogueJson["fine"+dialogue[page]["options"]]
Expand All @@ -90,13 +93,18 @@ func set_up():
options = UniversalFunctions.dialogueJson["optionsError"]
var counter = options.size()
for i in options:
var optText = ">"+i["text"]
optText = optText.replace("{missingOptions}",dialogue[page]["options"])
optText = optText.replace("{name}",UniversalFunctions.firstName)
get_tree().get_root().get_node_or_null("/root/world/Commandprompt/Options/Option"+str(counter)).visible = true
get_tree().get_root().get_node_or_null("/root/world/Commandprompt/Options/Option"+str(counter)).text = optText

counter-=1
var AlreadyUsed = false
for x in UniversalFunctions.TalkAbout:
if i["name"] == x:
AlreadyUsed = true
if AlreadyUsed == false:
var optText = ">"+i["text"]
optText = optText.replace("{missingOptions}",dialogue[page]["options"])
optText = optText.replace("{name}",UniversalFunctions.firstName)
get_tree().get_root().get_node_or_null("/root/world/Commandprompt/Options/Option"+str(counter)).visible = true
get_tree().get_root().get_node_or_null("/root/world/Commandprompt/Options/Option"+str(counter)).text = optText

counter-=1
color = dialogue[page]["color"]
time = dialogue[page]["tickSpeed"]
closetime = dialogue[page]["closeSpeed"]
Expand Down Expand Up @@ -159,7 +167,7 @@ func _on_Voice_finished():

func set_mood():
cursor.play("default")
if UniversalFunctions.disgust < 60:
if UniversalFunctions.disgust < 20:
if UniversalFunctions.loneliness <60:
mood = "fine"
elif UniversalFunctions.loneliness >= 60:
Expand Down
1 change: 1 addition & 0 deletions Commandprompt.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ margin_bottom = 14.0
theme = ExtResource( 1 )
custom_fonts/normal_font = ExtResource( 11 )
bbcode_enabled = true
text = "But you’ve pretty much solved that problem by now, haha."
fit_content_height = true
scroll_active = false
__meta__ = {
Expand Down
269 changes: 234 additions & 35 deletions Resources/Text/Text.json

Large diffs are not rendered by default.

271 changes: 235 additions & 36 deletions Resources/Text/Text.json.bak

Large diffs are not rendered by default.

14 changes: 9 additions & 5 deletions UniversalFunctions.gd
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@ var dialoguePlaying

var swearWords = ["fuck", "shit", "bitch", "cunt", ]
var loneliness = 44
var disgust = 44
var disgust = 15
var locked = false
var topics = []
var firstName
var lastName
var VariableOption = "AdaSurprise"
var emptyFilled = "stillEmpty"
var nameReaction = "nameNormal"
var TalkAbout = []

func reset():
dialogueBox = get_tree().get_root().get_node_or_null("/root/world/Commandprompt")
Expand All @@ -37,7 +41,7 @@ func play_dialogue_JSON(dialogue : String):
dialogueBox.dialogue = dialogueJson["dialogueError"]
dialogueBox.currentTree = dialogue
var dialoguechecker = dialogue.replace("Converge", "")
if disgust < 60:
if disgust < 20:
if loneliness <60:
if dialogueJson.has("fine"+dialoguechecker):
dialogueBox.dialogue = dialogueJson["fine"+dialoguechecker]
Expand All @@ -46,7 +50,7 @@ func play_dialogue_JSON(dialogue : String):
if dialogueJson.has("sad"+dialoguechecker):
dialogueBox.dialogue = dialogueJson["sad"+dialoguechecker]
dialogueBox.currentTree = "angry"+dialoguechecker
elif disgust >=60:
elif disgust >=20:
if dialogueJson.has("angry"+dialoguechecker):
dialogueBox.dialogue = dialogueJson["angry"+dialoguechecker]
dialogueBox.currentTree = "angry"+dialoguechecker
Expand All @@ -55,7 +59,7 @@ func play_dialogue_JSON(dialogue : String):
dialoguechecker = dialoguechecker.replace("Good", "")
dialoguechecker = dialoguechecker.replace("Bad", "")
dialoguechecker = dialoguechecker.replace("Bad", "")
if disgust < 60:
if disgust < 20:
if loneliness <60:
if dialogueJson.has("fine"+dialoguechecker):
dialogueBox.dialogue = dialogueJson["fine"+dialoguechecker]
Expand All @@ -64,7 +68,7 @@ func play_dialogue_JSON(dialogue : String):
if dialogueJson.has("sad"+dialoguechecker):
dialogueBox.dialogue = dialogueJson["sad"+dialoguechecker]
dialogueBox.currentTree = "sad"+dialoguechecker
elif disgust >=60:
elif disgust >=20:
if dialogueJson.has("angry"+dialoguechecker):
dialogueBox.dialogue = dialogueJson["angry"+dialoguechecker]
dialogueBox.currentTree = "angry"+dialoguechecker
Expand Down
11 changes: 9 additions & 2 deletions login.gd
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func _on_Blinker_timeout():
$loading/loading.play("default")
$SubmitName.visible = false
yield($loading/loading,"animation_finished")
check_obscene(UniversalFunctions.firstName+" "+UniversalFunctions.lastName)
check_obscene(UniversalFunctions.firstName+UniversalFunctions.lastName)
if obscene == false:
UniversalFunctions.change_scenes_reload("res://main.tscn")
else:
Expand Down Expand Up @@ -70,6 +70,7 @@ func _on_SubmitName_pressed():
print(setName.replace(" ","."))
if setName.length() <= 0:
return
check_funny(setName)
check_obscene(setName)
if $"Keyboard/1/Label".text == "a":
$Keyboard._on_case_pressed()
Expand Down Expand Up @@ -103,8 +104,14 @@ func _on_SubmitName_pressed():
var text = $Name.text


func check_funny(setName):
for i in ["ass", "balls","fuck", "shit", "penis", "cock", "dick", "cunt","pussy", "vagina","bitch","arse","crap","minger","minging","hell","piss","slut","whore","wank"]:
var funnyChecker = setName.to_lower()
if i in funnyChecker:
UniversalFunctions.nameReaction = "nameFunny"

func check_obscene(setName):
for i in ["rapist", "pedophile","nigger", "nigga", "nigguh", "niggar", "niggur", "faggot", "fagot","fag", "wetback", "wet back", "beaner", "kike", "raghead", "rag head", "towelhead", "towel head", "chink", "racist", "sexist","homophobe","transphobe"]:
for i in ["rapist", "pedophile","nigger", "nigga", "nigguh", "niggar", "niggur", "faggot", "fagot","fag", "wetback", "wet back", "beaner", "kike", "raghead", "rag head", "towelhead", "towel head", "dyke","chink", "racist", "sexist","homophobe","transphobe", "white power"]:
var slurChecker = setName.to_lower()
if i in slurChecker:
var doubleCheck = false
Expand Down
11 changes: 7 additions & 4 deletions main.gd
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func _on_Commandprompt_option_pressed(optionName:String):
UniversalFunctions.play_dialogue_JSON("sadGreetingGood")
return
if split != null:
if UniversalFunctions.disgust < 60:
if UniversalFunctions.disgust < 20:
if UniversalFunctions.loneliness < 60:
UniversalFunctions.play_dialogue_JSON("fine"+split)
elif UniversalFunctions.loneliness >= 60 and UniversalFunctions.loneliness <= 90:
Expand All @@ -59,7 +59,7 @@ func _on_Commandprompt_option_pressed(optionName:String):
UniversalFunctions.play_dialogue_JSON("angry"+split)
split = null
return
if UniversalFunctions.disgust < 60:
if UniversalFunctions.disgust < 20:
if UniversalFunctions.loneliness < 60:
UniversalFunctions.play_dialogue_JSON("fineRepeat")
elif UniversalFunctions.loneliness >= 60 and UniversalFunctions.loneliness <= 90:
Expand All @@ -71,7 +71,7 @@ func _on_Commandprompt_option_pressed(optionName:String):
UniversalFunctions.play_dialogue_JSON($Commandprompt.pastDialogue[-1]["name"])
else:
UniversalFunctions.play_dialogue_JSON($Commandprompt.pastDialogue[-1]["mood"]+$Commandprompt.pastDialogue[-1]["name"])
elif optionName == "GreetingGood" or optionName == "GreetingBad" or optionName == "GreetingUgly":
elif optionName == "GreetingGoodConverge" or optionName == "GreetingBadConverge" or optionName == "GreetingUglyConverge":
intro = ""
$NervousTimer.wait_time = 3
UniversalFunctions.play_dialogue_JSON(optionName)
Expand All @@ -87,6 +87,9 @@ func _on_Commandprompt_option_pressed(optionName:String):
elif optionName == "reactionToGenerationUgly":
split = null
UniversalFunctions.topics.append("Simulation")
elif optionName == "SpendTime" or optionName == "WhatWereYouLike" or optionName == "ElfTalk":
UniversalFunctions.TalkAbout.append(optionName)
UniversalFunctions.play_dialogue_JSON(optionName)
else:
UniversalFunctions.play_dialogue_JSON(optionName)

Expand Down Expand Up @@ -132,7 +135,7 @@ func _on_NervousTimer_timeout():
if UniversalFunctions.loneliness <= 90:
UniversalFunctions.loneliness += 1
if UniversalFunctions.loneliness % 2 == 0:
if UniversalFunctions.disgust < 60:
if UniversalFunctions.disgust < 20:
UniversalFunctions.play_dialogue_JSON("lonely"+intro+str(UniversalFunctions.loneliness/2))
else:
$NervousTimer.start()
Expand Down
2 changes: 0 additions & 2 deletions main.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -2695,7 +2695,6 @@ show_behind_parent = true
material = SubResource( 6 )
position = Vector2( 3, 7 )
frames = SubResource( 336 )
frame = 14
playing = true
centered = false

Expand All @@ -2705,7 +2704,6 @@ light_mask = 2
material = SubResource( 6 )
position = Vector2( 3, 7 )
frames = SubResource( 457 )
frame = 14
playing = true
centered = false

Expand Down

0 comments on commit 14cd7d3

Please sign in to comment.