Skip to content

Commit

Permalink
Really, the last few bits before #Science4All
Browse files Browse the repository at this point in the history
  • Loading branch information
Morpheu5 committed Sep 29, 2023
1 parent 7b81a0b commit f926d37
Show file tree
Hide file tree
Showing 18 changed files with 105 additions and 17 deletions.
4 changes: 2 additions & 2 deletions assets/main.dialogue
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ set cash = 0.0
Sei stato derubato mentre andavi in banca! La polizia è arrivata troppo tardi per fermare il ladro e hai perso {{stolen_cash}} soldi! [ID:t8873a801e3]
- Chiama l'assicurazione (recuperi {{potential_loss}} soldi, il premio salirà) [ID:t47f1d93a36]
do emit("log_request", { "dialogue_title": "street_robbery", "event_type": "player", "event": "make_insurance_claim", "loss": potential_loss })
do handle_insurance_claim(cash)
do handle_insurance_claim()
=> insurance_claim_end
- Torna a casa (perdi {{stolen_cash}} soldi) [ID:tdad83184fe]
do emit("log_request", { "dialogue_title": "street_robbery", "event_type": "player", "event": "go_home", "loss": stolen_cash })
Expand All @@ -232,7 +232,7 @@ set cash = 0.0
Sei stato rapinato in negozio! La polizia è arrivata troppo tardi per fermare il ladro e hai perso {{stolen_cash}} soldi! [ID:t29909e55c2]
- Chiama l'assicurazione (recuperi {{potential_loss}} soldi, il premio salirà) [ID:tc20800c867]
do emit("log_request", { "dialogue_title": "shop_robbery", "event_type": "player", "event": "make_insurance_claim", "loss": potential_loss })
do handle_insurance_claim(cash)
do handle_insurance_claim()
=> insurance_claim_end
- Chiudi e torna a casa (perdi {{stolen_cash}} soldi) [ID:t8a8611b98d]
do emit("log_request", { "dialogue_title": "shop_robbery", "event_type": "player", "event": "go_home", "loss": stolen_cash })
Expand Down
Binary file added assets/sfx/talk.ogg
Binary file not shown.
19 changes: 19 additions & 0 deletions assets/sfx/talk.ogg.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[remap]

importer="oggvorbisstr"
type="AudioStreamOggVorbis"
uid="uid://cdlqaqx42ju4e"
path="res://.godot/imported/talk.ogg-0273f00632dc4c02bc550217cb930f04.oggvorbisstr"

[deps]

source_file="res://assets/sfx/talk.ogg"
dest_files=["res://.godot/imported/talk.ogg-0273f00632dc4c02bc550217cb930f04.oggvorbisstr"]

[params]

loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4
Binary file added assets/sfx/thief.ogg
Binary file not shown.
19 changes: 19 additions & 0 deletions assets/sfx/thief.ogg.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[remap]

importer="oggvorbisstr"
type="AudioStreamOggVorbis"
uid="uid://dy0rvx4m7b6i8"
path="res://.godot/imported/thief.ogg-6dc9e7ae83ba76fe4dea00754f32e4b9.oggvorbisstr"

[deps]

source_file="res://assets/sfx/thief.ogg"
dest_files=["res://.godot/imported/thief.ogg-6dc9e7ae83ba76fe4dea00754f32e4b9.oggvorbisstr"]

[params]

loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4
1 change: 1 addition & 0 deletions classes/globals.gd
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
extends Node2D

var participant_id: String = ""
var participant_id_string: String = ""

var customer_names = ["Leonardo","Alessandro","Tommaso","Francesco","Lorenzo","Edoardo","Mattia","Riccardo","Gabriele","Andrea","Diego","Matteo","Nicolo","Giuseppe","Antonio","Federico","Pietro","Samuele","Giovanni","Filippo","Enea","Davide","Christian","Gioele","Giulio","Michele","Marco","Gabriel","Elia","Luca","Salvatore","Vincenzo","Emanuele","Thomas","Alessio","Giacomo","Nathan","Liam","Simone","Samuel","Jacopo","Noah","Daniele","Giorgio","Ettore","Luigi","Daniel","Manuel","Nicola","Damiano","Sofia","Aurora","Giulia","Ginevra","Beatrice","Alice","Vittoria","Emma","Ludovica","Matilde","Giorgia","Camilla","Chiara","Anna","Bianca","Nicole","Gaia","Martina","Greta","Azzurra","Sara","Arianna","Noemi","Rebecca","Mia","Isabel","Adele","Chloe","Elena","Francesca","Gioia","Ambra","Viola","Carlotta","Cecilia","Diana","Alessia","Elisa","Emily","Marta","Maria","Margherita","Anita","Giada","Eleonora","Nina","Miriam","Asia","Amelia","Diletta"]

Expand Down
3 changes: 2 additions & 1 deletion game_scenes/GameOver.gd
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ func _ready():
else:
%TitleLabel.text = tr("Game Over!")
%InfoText.text = gameOverText % Globals.bank_money

%PIDLabel.text = Globals.participant_id_string

func _on_survey_button_pressed():
var locale = TranslationServer.get_locale()
Expand All @@ -30,7 +32,6 @@ func _on_survey_button_pressed():
u = "https://qualtricsxmfv525fqw4.qualtrics.com/jfe/form/SV_6im4rtDltNhqjFY?PID=%s" % Globals.participant_id
else:
u = "https://qualtricsxmfv525fqw4.qualtrics.com/jfe/form/SV_9Ahy56rr3zyUVdc?PID=%s" % Globals.participant_id
print(u)
OS.shell_open(u)

func _on_back_to_title_button_pressed():
Expand Down
12 changes: 12 additions & 0 deletions game_scenes/GameOver.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,18 @@ theme_override_constants/separation = 20
layout_mode = 2
text = "Fai un breve sondaggio"

[node name="Label" type="Label" parent="CanvasLayer/CenterContainer/VBoxContainer"]
layout_mode = 2
text = "Per il sondaggio, ti servirà questo numero"
horizontal_alignment = 1

[node name="PIDLabel" type="Label" parent="CanvasLayer/CenterContainer/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
auto_translate = false
localize_numeral_system = false
horizontal_alignment = 1

[node name="HSeparator3" type="HSeparator" parent="CanvasLayer/CenterContainer/VBoxContainer"]
visibility_layer = 0
layout_mode = 2
Expand Down
2 changes: 1 addition & 1 deletion game_scenes/Intro.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 0
theme_override_font_sizes/font_size = 48
text = "Certo, certo, ho ancora 7 giorni, non si preoccupi…"
text = "Certo, certo, ho ancora 5 giorni, non si preoccupi…"
autowrap_mode = 2
visible_characters = 0
visible_ratio = 0.0
Expand Down
2 changes: 1 addition & 1 deletion game_scenes/Privacy.gd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ extends Node2D
@onready var richtext = $Canvas/MarginContainer/RichTextLabel

func _ready():
richtext.text = tr(richtext.text) % [Globals.participant_id]
richtext.text = tr(richtext.text) % [Globals.participant_id_string]

func _on_back_button_pressed():
queue_free()
11 changes: 11 additions & 0 deletions game_scenes/balloon/balloon.gd
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ extends CanvasLayer
@onready var responses_menu: VBoxContainer = $Balloon/Margin/VBox/Responses
@onready var response_template: RichTextLabel = %ResponseTemplate

@onready var talk_sound = $TalkPlayer

## The dialogue resource
var resource: DialogueResource

Expand Down Expand Up @@ -218,3 +220,12 @@ func _on_balloon_gui_input(event: InputEvent) -> void:

func _on_margin_resized() -> void:
handle_resize()


func _on_dialogue_label_spoke(letter: String, letter_index: int, speed: float) -> void:
if not letter in [" ", "."] and character_label.visible:
var actual_speed: int = 4 if speed >= 1 else 2
if letter_index % actual_speed == 0:
talk_sound.play()
var pitch = randf_range(1, 1.8)
talk_sound.pitch_scale = randf_range(pitch - 0.2, pitch + 0.2)
8 changes: 7 additions & 1 deletion game_scenes/balloon/balloon.tscn
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[gd_scene load_steps=5 format=3 uid="uid://8lyp1gprpln4"]
[gd_scene load_steps=6 format=3 uid="uid://8lyp1gprpln4"]

[ext_resource type="Script" path="res://game_scenes/balloon/balloon.gd" id="1_bf5nr"]
[ext_resource type="PackedScene" uid="uid://ckvgyvclnwggo" path="res://addons/dialogue_manager/dialogue_label.tscn" id="2_h1no1"]
[ext_resource type="AudioStream" uid="uid://cdlqaqx42ju4e" path="res://assets/sfx/talk.ogg" id="3_tpida"]

[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_5d24i"]
content_margin_left = 40.0
Expand Down Expand Up @@ -70,5 +71,10 @@ shortcut_keys_enabled = false
meta_underlined = false
hint_underlined = false

[node name="TalkPlayer" type="AudioStreamPlayer" parent="."]
stream = ExtResource("3_tpida")
volume_db = -18.0

[connection signal="gui_input" from="Balloon" to="." method="_on_balloon_gui_input"]
[connection signal="resized" from="Balloon/Margin" to="." method="_on_margin_resized"]
[connection signal="spoke" from="Balloon/Margin/VBox/DialogueLabel" to="." method="_on_dialogue_label_spoke"]
9 changes: 5 additions & 4 deletions game_scenes/shop.gd
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func radio_on():

func run():
print("Day: ", day)
if day < 7:
if day < 5:
await initialize_day()
else:
await lights_out()
Expand Down Expand Up @@ -274,7 +274,7 @@ func new_customer():

customer_has_explained_conspiracy = false
select_payment_method(customer)
amount = snapped(randf_range(0.05, 100.0), 0.01)
amount = snapped(randf_range(0.98, 150.0), 0.01)
amount_str = ("%.2f" % amount).replace(".", ",")
amountLabel.text = tr("Totale: %s") % amount_str
electronic_offered = false
Expand Down Expand Up @@ -310,13 +310,14 @@ func shop_robbery():
radio_off(true)
for i in customers.size():
customer_walks_away(true)
# TODO Add robbery stinger
$ThiefStinger.play()
stolen_cash = cash
potential_loss = max(0, stolen_cash - insurance_excess)
var t = randi_range(1, 3)
customerPicture.texture = load("res://assets/faces/Thief%02d.png" % t)
customerNameLabel.text = tr("Al ladro!")
amountLabel.text = tr("Un ladro selvaggio appare.")
customerDescription.text = ""
amountLabel.text = tr("Appare un ladro selvaggio!")
await show_info_panel()
start_dialogue(main_dialog, "shop_robbery")
customers = []
Expand Down
7 changes: 6 additions & 1 deletion game_scenes/shop.tscn
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[gd_scene load_steps=4 format=3 uid="uid://bq8cdsnxpscqs"]
[gd_scene load_steps=5 format=3 uid="uid://bq8cdsnxpscqs"]

[ext_resource type="Script" path="res://game_scenes/shop.gd" id="1_edlot"]
[ext_resource type="PackedScene" uid="uid://cpwmax3kf4sya" path="res://game_scenes/shop_ui.tscn" id="2_epm6x"]
[ext_resource type="AudioStream" uid="uid://b5fy1xk4j1wrw" path="res://assets/music/Kenobit_Bit_Beat_Beach.ogg" id="3_iik3r"]
[ext_resource type="AudioStream" uid="uid://dy0rvx4m7b6i8" path="res://assets/sfx/thief.ogg" id="4_q6uxa"]

[node name="Shop" type="Node2D"]
script = ExtResource("1_edlot")
Expand All @@ -27,6 +28,10 @@ centered = false
stream = ExtResource("3_iik3r")
volume_db = -40.0

[node name="ThiefStinger" type="AudioStreamPlayer" parent="."]
stream = ExtResource("4_q6uxa")
volume_db = -12.0

[connection signal="bank_changed" from="." to="HUD" method="_on_shop_bank_changed"]
[connection signal="cash_changed" from="." to="HUD" method="_on_shop_cash_changed"]
[connection signal="cash_fee_loss_changed" from="." to="HUD" method="_on_shop_cash_fee_loss_changed"]
Expand Down
3 changes: 2 additions & 1 deletion game_scenes/title.gd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ var privacy_scene = preload("res://game_scenes/Privacy.tscn")
func _ready():
var date = Time.get_datetime_dict_from_system()
Globals.participant_id = "%02d%02d%02d%02d%02d%02d" % [date.year-2000, date.month, date.day, date.hour, date.minute, date.second ]
%ParticipantID.text = "%02d %02d %02d %02d %02d %02d" % [date.year-2000, date.month, date.day, date.hour, date.minute, date.second ]
Globals.participant_id_string = "%02d %02d %02d %02d %02d %02d" % [date.year-2000, date.month, date.day, date.hour, date.minute, date.second ]
%ParticipantID.text = Globals.participant_id_string
pass

func _on_start_button_pressed():
Expand Down
Binary file modified translations/en.mo
Binary file not shown.
10 changes: 7 additions & 3 deletions translations/en.po
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ msgid "La chiamo per ricordarle di saldare la fattura di 10.000 soldi."
msgstr "I'm calling to remind you of your invoice for 10.000 moneys."

#: game_scenes/Intro.tscn
msgid "Certo, certo, ho ancora 7 giorni, non si preoccupi…"
msgstr "Sure, sure, I still have 7 days, don't worry…"
msgid "Certo, certo, ho ancora 5 giorni, non si preoccupi…"
msgstr "Sure, sure, I still have 5 days, don't worry…"

#: game_scenes/Intro.tscn
msgid "Continua »"
Expand Down Expand Up @@ -909,7 +909,7 @@ msgid "Al ladro!"
msgstr "Thief!"

#: game_scenes/shop.gd
msgid "Un ladro selvaggio appare."
msgid "Appare un ladro selvaggio!"
msgstr "A wild thief appears."

#: game_scenes/Privacy.tscn
Expand Down Expand Up @@ -969,6 +969,10 @@ msgstr "Game Over!"
msgid "Fai un breve sondaggio"
msgstr "Take a brief survey"

#: game_scenes/GameOver.tscn
msgid "Per il sondaggio, ti servirà questo numero"
msgstr "You'll need this number for the survey"

#: game_scenes/GameOver.tscn
msgid "Torna all'inizio"
msgstr "Back to the menu"
Expand Down
12 changes: 10 additions & 2 deletions translations/template.pot
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ msgid "La chiamo per ricordarle di saldare la fattura di 10.000 soldi."
msgstr ""

#: game_scenes/Intro.tscn
msgid "Certo, certo, ho ancora 7 giorni, non si preoccupi…"
msgid "Certo, certo, ho ancora 5 giorni, non si preoccupi…"
msgstr ""

#: game_scenes/Intro.tscn
Expand Down Expand Up @@ -440,6 +440,10 @@ msgctxt "ta2bd7bbd9e"
msgid ""
msgstr ""

#: game_scenes/shop.gd
msgid ""
msgstr ""

#: assets/main.dialogue
msgctxt "tc2b37b1d9d"
msgid "POS (commissione: {{100 * get_fee("card", amount)}}%)"
Expand Down Expand Up @@ -677,7 +681,7 @@ msgid "Al ladro!"
msgstr ""

#: game_scenes/shop.gd
msgid "Un ladro selvaggio appare."
msgid "Appare un ladro selvaggio!"
msgstr ""

#: game_scenes/Privacy.tscn
Expand Down Expand Up @@ -717,6 +721,10 @@ msgstr ""
msgid "Fai un breve sondaggio"
msgstr ""

#: game_scenes/GameOver.tscn
msgid "Per il sondaggio, ti servirà questo numero"
msgstr ""

#: game_scenes/GameOver.tscn
msgid "Torna all'inizio"
msgstr ""

0 comments on commit f926d37

Please sign in to comment.