diff --git a/pets-gd/dialogue/debug.gd b/pets-gd/dialogue/debug.gd new file mode 100644 index 00000000..7bcc6e11 --- /dev/null +++ b/pets-gd/dialogue/debug.gd @@ -0,0 +1,58 @@ +extends DialogueScript + +func _start() -> void: + print("Opening debug menu!") + + var choice + choice = await dbox().say_as_with_choices( + "[CASCADE]", [ + "Hey...?", + ], [ + "Battle", + "Item", + "Page 2", + "Nah", + ] + ) + + match choice: + 0: + World.singleton().start_battle("A_NONNY_MOUSE") + 1: + choice = await dbox().say_as_with_choices( + "[CASCADE]", [ + "What do you need?", + ], [ + "Rusty x1", + "Rusty x5", + ] + ) + + match choice: + 0: + DialogueScriptBase.debug_item("trusty_rusty_pistol", 1) + 1: + DialogueScriptBase.debug_item("trusty_rusty_pistol", 5) + + await dbox().say_as("[CASCADE]", [ + "Here you go!" + ]) + 2: + choice = await dbox().say_as_with_choices( + "[CASCADE]", [ + "Okay, how about these?", + ], [ + "Pauses", + "Nah", + ]) + + match choice: + 0: + await dbox().say_as("Isaac", [ +"""Flint...​​​​​​​​​​ +Where did you last see Hinawa?""" + ]) + await dbox().say_as("[CASCADE]", [ +"""This next part will print v​e​r​r​r​r​r​y +s​​​l​​​o​​​o​​​o​​​o​​​o​​​w​​​l​​​y.""" + ]) diff --git a/pets-gd/i18n/translations.csv b/pets-gd/i18n/translations.csv index 9500ef51..9bfb456b 100644 --- a/pets-gd/i18n/translations.csv +++ b/pets-gd/i18n/translations.csv @@ -125,6 +125,7 @@ SKILL_SHIELD_COMBINE_PARTS,{part1} {hits_str} , DG_SPK_UNKNOWN,??? DG_SPK_RODRICK,"Rodrick Sign Co." +DG_SPK_CASCADE,Agent Cascade DG_SPK_MOM,Mom DG_SPK_DAD,Dad DG_SPK_JUNIPER,Juniper diff --git a/pets-gd/quests/intro1.gd b/pets-gd/quests/intro1.gd index 70dcad2e..a348f183 100644 --- a/pets-gd/quests/intro1.gd +++ b/pets-gd/quests/intro1.gd @@ -68,4 +68,3 @@ func on_outdoors_tp(target): await dbox().say_as("[CLAY]", [ "DG_INTRO1_MR_T" ]); await dbox().say_as("[MR_TULIVAE]", [ "DG_INTRO1_HITHERE" ]); await dbox().say_as("[NARRATOR]", [ "DG_INTRO1_HE_SEEMS_NICE" ]); - diff --git a/pets-gd/scenes/rooms/cv-outdoors.tscn b/pets-gd/scenes/rooms/cv-outdoors.tscn index dc98f5e6..46d02be7 100644 --- a/pets-gd/scenes/rooms/cv-outdoors.tscn +++ b/pets-gd/scenes/rooms/cv-outdoors.tscn @@ -217,7 +217,7 @@ position = Vector2(0, 8) scale = Vector2(1.02, 0.5) [node name="LYEMBO" parent="." index="10" instance=ExtResource("13_2on2m")] -position = Vector2(-128, -320) +position = Vector2(-264, -536) [node name="InteractionZone" parent="LYEMBO" index="4" instance=ExtResource("4_vwc65")] interaction_script = ExtResource("15_ndq3e") diff --git a/pets-gd/scenes/world.tscn b/pets-gd/scenes/world.tscn index e5e122e5..b73d2e92 100644 --- a/pets-gd/scenes/world.tscn +++ b/pets-gd/scenes/world.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=17 format=3 uid="uid://p2uymvf88jt7"] +[gd_scene load_steps=18 format=3 uid="uid://p2uymvf88jt7"] [ext_resource type="PackedScene" uid="uid://kgl5788x405y" path="res://scenes/battle.tscn" id="1_37bcu"] [ext_resource type="PackedScene" uid="uid://c8hhg8v5ls70u" path="res://scenes/world_menu.tscn" id="2_6orff"] @@ -9,6 +9,7 @@ [ext_resource type="Shader" path="res://themes/encounter.gdshader" id="3_a3d4r"] [ext_resource type="PackedScene" uid="uid://clpj4pxq1ulin" path="res://scenes/inventory.tscn" id="3_jwkdy"] [ext_resource type="Script" path="res://scenes/BattleIntroRect.gd" id="4_jple0"] +[ext_resource type="Script" path="res://dialogue/debug.gd" id="10_egidj"] [ext_resource type="PackedScene" uid="uid://c7x12nyqelw1f" path="res://scenes/rooms/cv-outdoors.tscn" id="10_kug7e"] [ext_resource type="Script" path="res://quests/intro1.gd" id="13_w40m0"] @@ -134,6 +135,7 @@ visible = false [node name="DialogBox" parent="UILayer" instance=ExtResource("2_lgtmm")] [node name="WorldMenu" parent="UILayer" instance=ExtResource("2_6orff")] +debug_menu_script = ExtResource("10_egidj") [node name="BeaconFade" type="ColorRect" parent="UILayer"] unique_name_in_owner = true diff --git a/pets-lib/dg/.gitignore b/pets-lib/dg/.gitignore deleted file mode 100644 index e9ef38b7..00000000 --- a/pets-lib/dg/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# ignore compiled dialogue -*.dgc diff --git a/pets-lib/dg/src/debug-menu.dg b/pets-lib/dg/src/debug-menu.dg deleted file mode 100644 index a22133b8..00000000 --- a/pets-lib/dg/src/debug-menu.dg +++ /dev/null @@ -1,81 +0,0 @@ -% Debug Menu -### - -Link NAME Agent Cascade -VOX Mira - -### ---- -NAME Agent Cascade - -What's up? Hard at work debugging? - -> Battle -$ debug_battle() - -> Item -@ Debug Menu >> Item - -> Pg. 2 -@ Debug Menu >> Page2 - -> Nah... - ---- -% Debug Menu >> Page2 -NAME Agent Cascade - -Alright then. How about these? - -> Pauses -@ Debug Menu >> Pauses - -> Test3 - ---- -% Debug Menu >> Item -NAME Agent Cascade - -What do you need? - -> Rusty -$ debug_item("trusty_rusty_pistol", 1) - -> 5 Rusties -$ debug_item("trusty_rusty_pistol", 5) - ---- -% Debug Menu >> After Item -NAME Agent Cascade - -Here you go! - ---- -% Debug Menu >> Skill -NAME Agent Cascade - -Skill Name: {SKILL_NAME1}\n -Skill Desc: {SKILL_DESC1} - ---- - -Skill Name: {SKILL_NAME2}\n -Skill Desc: {SKILL_DESC2} - ---- -% Debug Menu >> Pauses -NAME Isaac -VOX _ - -Flint...​​​​​​​​​​\n -Where did you last see Hinawa? - ---- -NAME Agent Cascade -VOX Mira - -This next part will print v​e​r​r​r​r​r​y -s​​​l​​​o​​​o​​​o​​​o​​​o​​​w​​​l​​​y. - ---- - diff --git a/pets-lib/src/dialogue/dbox/placeholders.rs b/pets-lib/src/dialogue/dbox/placeholders.rs index 6f6023f9..bbc4a5a2 100644 --- a/pets-lib/src/dialogue/dbox/placeholders.rs +++ b/pets-lib/src/dialogue/dbox/placeholders.rs @@ -23,6 +23,7 @@ const PLACEHOLDERS: &[(&'static str, fn() -> String)] = &[ ("[NARRATOR]", || "".to_owned()), ("[???]", || "DG_SPK_UNKNOWN".to_owned()), // character names + ("[CASCADE]", || "DG_SPK_CASCADE".to_owned()), ("[RODRICK]", || "DG_SPK_RODRICK".to_owned()), ("[ETHAN]", || pchar_display_name(&PChar::ETHAN)), ("[LYEMBO]", || pchar_display_name(&PChar::LYEMBO)), diff --git a/pets-lib/src/functions.rs b/pets-lib/src/functions.rs index c200e4e3..667722a8 100644 --- a/pets-lib/src/functions.rs +++ b/pets-lib/src/functions.rs @@ -53,11 +53,6 @@ impl DialogueScriptBase { bed.callv("set_texture".into(), varray![texture]); } - #[func] - fn debug_battle() { - World::start_battle(&EnemyID::A_NONNY_MOUSE); - } - #[func] fn debug_item(item_id: String, quantity: u32) { Inventory::get().borrow_mut().give_item(item_id, quantity); diff --git a/pets-lib/src/world/menu.rs b/pets-lib/src/world/menu.rs index 023305d6..0a914763 100644 --- a/pets-lib/src/world/menu.rs +++ b/pets-lib/src/world/menu.rs @@ -4,10 +4,12 @@ //! use godot::classes::{ - AnimationPlayer, Control, IPanel, InputEvent, Panel, RichTextLabel, + AnimationPlayer, Control, GDScript, IPanel, InputEvent, Panel, + RichTextLabel, }; use godot::prelude::*; +use crate::functions::DialogueScriptBase; use crate::prelude::*; use super::inv_node::InventoryNode; @@ -20,6 +22,9 @@ pub struct WorldMenu { #[init(node = "Choices/ChoiceAgent")] choices: OnReady>, + + #[export] + debug_menu_script: Option>, } #[godot_api] @@ -83,8 +88,15 @@ impl WorldMenu { match choice.get_name().to_string().as_str() { "Inventory" => self.open_inventory(), "DebugQuit" => godot_tree().quit(), - // "DebugMenu" => start_ix("Debug Menu"), - "DebugMenu" => todo!("agent cascade's debug menu"), + "DebugMenu" => { + DialogueScriptBase::new( + self.debug_menu_script + .as_ref() + .expect("no debug script exported") + .clone(), + ) + .call("_start".into(), &[]); + } _ => unreachable!(), } diff --git a/pets-lib/src/world/mod.rs b/pets-lib/src/world/mod.rs index 8a647e47..11fa6e47 100644 --- a/pets-lib/src/world/mod.rs +++ b/pets-lib/src/world/mod.rs @@ -6,7 +6,9 @@ use crate::consts::battle::*; use crate::prelude::*; use enemy_node::WalkingEnemy; -use godot::classes::{AnimationPlayer, AudioServer, AudioStream, CanvasLayer}; +use godot::classes::{ + AnimationPlayer, AudioServer, AudioStream, CanvasLayer, GDScript, +}; use godot::global::randf_range; use godot::prelude::*;