diff --git a/assets/dialogs/search.json b/assets/dialogs/search.json new file mode 100644 index 0000000..115ea1b --- /dev/null +++ b/assets/dialogs/search.json @@ -0,0 +1,8 @@ +[ + "Alors, où te cache tu ???", + "Je vais te trouver !", + "Ou te cache tu ?", + "Mais t'es où enfin !", + "Comment cet idiot fait pour aussi bien se cacher ?", + "Montre toi..." +] \ No newline at end of file diff --git a/src/plugins/dialog.py b/src/plugins/dialog.py index 35aba36..c08b0d4 100644 --- a/src/plugins/dialog.py +++ b/src/plugins/dialog.py @@ -21,7 +21,7 @@ import pyttsx3 engine = pyttsx3.init() -def spawn_dialog(world: World, name: str, height: float = 900): +def spawn_dialog(world: World, name: str, index: int = -1, height: float = 100): """ Fait apparaitre un dialogue dans le monde. """ @@ -29,7 +29,7 @@ def spawn_dialog(world: World, name: str, height: float = 900): texts: list[str] = json.load( open(f"assets/dialogs/{name}.json", "r", encoding="utf-8") ) - text = random.choice(texts) + text = random.choice(texts) if index == -1 else texts[index] # engine.say(text) engine.save_to_file(text, "voice.mp3") engine.runAndWait() diff --git a/src/scenes/story/directory_search.py b/src/scenes/story/directory_search.py index 1fb58b8..8d74fd6 100644 --- a/src/scenes/story/directory_search.py +++ b/src/scenes/story/directory_search.py @@ -177,9 +177,13 @@ def __game_loop(world: World): La boucle principale de la scène """ yield wait(5.0) + dialog_index = 0 for i in range(10): if i % 2 == 1: __block_directory(world) + if i in (0, 1, 2, 4, 6, 8): + dialog.spawn_dialog(world, "search", dialog_index) + dialog_index += 1 __spawn_search_alerts(world, int(i / 1.5) + 1) yield wait(5.0 - (i * 0.4)) __spawn_search_directory(world) diff --git a/voice.mp3 b/voice.mp3 new file mode 100644 index 0000000..adf7633 Binary files /dev/null and b/voice.mp3 differ