From 4ba1d51bcf694d43bb7bbe7c364d0f833c8215a0 Mon Sep 17 00:00:00 2001 From: Marisa the Magician Date: Sun, 27 Aug 2023 13:52:44 +0200 Subject: [PATCH] Completely rewrite dialogue message system. --- language.version | 4 +- swwmdialogue.txt | 818 ++++++++++++ zmapinfo.txt | 2 +- zscript/compat/swwm_compat.zsc | 1 - zscript/dlc1/swwm_notashotgun.zsc | 2 +- zscript/handler/swwm_handler.zsc | 2 +- zscript/handler/swwm_handler_cheats.zsc | 2 +- zscript/handler/swwm_handler_process.zsc | 4 +- zscript/handler/swwm_handler_vanillaboss.zsc | 4 +- zscript/handler/swwm_handler_worldload.zsc | 62 +- zscript/handler/swwm_handler_worldthings.zsc | 2 +- zscript/handler/swwm_statichandler.zsc | 2 +- zscript/hud/swwm_dialogue.zsc | 1207 +++--------------- zscript/hud/swwm_hud_messages.zsc | 28 +- zscript/hud/swwm_hudextra.zsc | 10 +- zscript/weapons/swwm_deepdarkimpact.zsc | 2 +- zscript/weapons/swwm_thiccboolet.zsc | 2 +- 17 files changed, 1046 insertions(+), 1108 deletions(-) create mode 100644 swwmdialogue.txt diff --git a/language.version b/language.version index e674b4a63..0c76623e4 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r944 \cu(Sat 26 Aug 18:41:52 CEST 2023)\c-"; -SWWM_SHORTVER="\cw1.3pre r944 \cu(2023-08-26 18:41:52)\c-"; +SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r945 \cu(Sun 27 Aug 13:52:44 CEST 2023)\c-"; +SWWM_SHORTVER="\cw1.3pre r945 \cu(2023-08-27 13:52:44)\c-"; diff --git a/swwmdialogue.txt b/swwmdialogue.txt new file mode 100644 index 000000000..16ec1547b --- /dev/null +++ b/swwmdialogue.txt @@ -0,0 +1,818 @@ +# Doom 1 +DLG PHOBOS + SEQ SAYA + NAME SAYAPHOBOS + CNT 4 + DELAY 40 + ENDSEQ +ENDDLG +DLG DEIMOS + SEQ SAYA + NAME SAYADEIMOS + CNT 4 + DELAY 40 + ENDSEQ +ENDDLG +DLG DIS + SEQ SAYA + NAME SAYADIS + CNT 4 + DELAY 40 + ENDSEQ +ENDDLG +DLG THY + SEQ SAYA + NAME SAYATHY + CNT 4 + DELAY 40 + ENDSEQ +ENDDLG +DLG SIGIL + SEQ CYTHO + NAME CYTHOSIGIL + CNT 4 + DELAY 40 + ENDSEQ +ENDDLG +# Doom 2 +DLG DIMPLE + SEQ SAYA + NAME SAYADIMPLE + CNT 5 + DELAY 40 + ENDSEQ +ENDDLG +DLG CIRCLE + SEQ SAYA + NAME SAYACIRCLE + CNT 5 + DELAY 40 + ENDSEQ +ENDDLG +DLG GOTCHA + SEQ SAYA + NAME SAYAGOTCHA + CNT 5 + DELAY 40 + ENDSEQ +ENDDLG +DLG GOTCHAEND + SEQ SAYA + NAME SAYAGOTCHAEND + CNT 5 + DELAY 40 + ENDSEQ +ENDDLG +DLG IOS + SEQ SAYA + NAME SAYAIOS + CNT 5 + DELAY 40 + ENDSEQ +ENDDLG +DLG RAMPANCY + SEQ SAYA + NAME SAYARAMPANCY + CNT 4 + DELAY 250 + ENDSEQ +ENDDLG +DLG NERVE + SEQ CYTHO + NAME CYTHONERVE + CNT 5 + DELAY 40 + ENDSEQ +ENDDLG +# Eviternity +DLG DMN + SEQ SAYA + NAME SAYADMN + CNT 8 + DELAY 40 + ENDSEQ +ENDDLG +DLG CRE + SEQ SAYA + NAME SAYACRE + CNT 4 + DELAY 50 + ENDSEQ +ENDDLG +DLG CRY + SEQ SAYA + NAME SAYACRY + CNT 5 + DELAY 30 + ENDSEQ +ENDDLG +DLG CON + SEQ SAYA + NAME SAYACON + CNT 5 + DELAY 50 + ENDSEQ +ENDDLG +DLG SLA + SEQ SAYA + NAME SAYASLA + CNT 1 + DELAY 120 + ENDSEQ +ENDDLG +DLG EVIA + SEQ SAYA + NAME SAYAEVIA + CNT 4 + DELAY 40 + ENDSEQ +ENDDLG +DLG EVIB + SEQ SAYA + NAME SAYAEVIB + CNT 2 + DELAY 20 + ENDSEQ +ENDDLG +# Heretic +DLG MAW + SEQ SAYA + NAME SAYAMAW + CNT 5 + DELAY 40 + ENDSEQ +ENDDLG +DLG PORTALS + SEQ SAYA + NAME SAYAPORTALS + CNT 5 + DELAY 40 + ENDSEQ +ENDDLG +DLG DSPARIL + SEQ SAYA + NAME SAYADSPARIL + CNT 5 + DELAY 40 + ENDSEQ +ENDDLG +DLG HEADS + SEQ SAYA + NAME SAYAHEADS + CNT 6 + DELAY 40 + ENDSEQ +ENDDLG +DLG BULLS + SEQ SAYA + NAME SAYABULLS + CNT 5 + DELAY 40 + ENDSEQ +ENDDLG +# Hexen +DLG GREET + SEQ SAYA + NAME SAYAGREETA + CNT 3 + DELAY 150 + ENDSEQ + SEQ KIRIN + NAME SAYAGREETB + CNT 1 + DELAY 20 + ENDSEQ + SEQ SAYA + NAME SAYAGREETC + CNT 3 + DELAY 20 + ENDSEQ + SEQ KIRIN + NAME SAYAGREETD + CNT 1 + DELAY 30 + ENDSEQ + SEQ SAYA + NAME SAYAGREETE + CNT 1 + DELAY 20 + ENDSEQ + SEQ KIRIN + NAME SAYAGREETF + CNT 1 + DELAY 30 + ENDSEQ +ENDDLG +DLG BLOOD + SEQ SAYA + NAME SAYABLOODA + CNT 2 + DELAY 220 + ENDSEQ + SEQ IBUKI + NAME SAYABLOODB + CNT 1 + DELAY 20 + ENDSEQ + SEQ SAYA + NAME SAYABLOODC + CNT 1 + DELAY 30 + ENDSEQ +ENDDLG +DLG HYPO + SEQ SAYA + NAME SAYAHYPO + CNT 4 + DELAY 40 + ENDSEQ +ENDDLG +DLG WORSHIP + SEQ KIRIN + NAME KIRINWORSHIPA + CNT 1 + DELAY 150 + ENDSEQ + SEQ SAYA + NAME KIRINWORSHIPB + CNT 1 + DELAY 40 + ENDDELAY 50 + ENDSEQ + SEQ KIRIN + NAME KIRINWORSHIPC + CNT 1 + DELAY 20 + ENDSEQ + SEQ SAYA + NAME KIRINWORSHIPD + CNT 1 + DELAY 40 + ENDSEQ + SEQ KIRIN + NAME KIRINWORSHIPE + CNT 1 + DELAY 20 + ENDDELAY 30 + ENDSEQ + SEQ SAYA + NAME KIRINWORSHIPF + CNT 1 + DELAY 20 + ENDSEQ + SEQ KIRIN + NAME KIRINWORSHIPG + CNT 1 + DELAY 40 + ENDSEQ +ENDDLG +DLG GAME + SEQ SAYA + NAME SAYAGAMEA + CNT 2 + DELAY 200 + ENDSEQ + SEQ IBUKI + NAME SAYAGAMEB + CNT 1 + DELAY 30 + ENDSEQ + SEQ SAYA + NAME SAYAGAMEC + CNT 1 + DELAY 20 + ENDSEQ +ENDDLG +DLG MASTERS + SEQ SAYA + NAME SAYAMASTERSA + CNT 2 + DELAY 150 + ENDDELAY 60 + ENDSEQ + SEQ IBUKI + NAME SAYAMASTERSB + CNT 1 + DELAY 20 + ENDSEQ + SEQ SAYA + NAME SAYAMASTERSC + CNT 1 + DELAY 20 + ENDSEQ + SEQ IBUKI + NAME SAYAMASTERSD + CNT 1 + DELAY 20 + ENDSEQ + SEQ KIRIN + NAME SAYAMASTERSE + CNT 1 + DELAY 40 + ENDSEQ + SEQ SAYA + NAME SAYAMASTERSF + CNT 1 + DELAY 20 + ENDSEQ +ENDDLG +DLG FIGHTER + SEQ SAYA + NAME SAYAFIGHTER + CNT 2 + DELAY 40 + ENDSEQ +ENDDLG +DLG CLERIC + SEQ SAYA + NAME SAYACLERICA + CNT 2 + DELAY 40 + ENDSEQ + SEQ KIRIN + NAME SAYACLERICB + CNT 1 + DELAY 20 + ENDSEQ + SEQ SAYA + NAME SAYACLERICC + CNT 2 + DELAY 20 + ENDSEQ +ENDDLG +DLG MAGE + SEQ SAYA + NAME SAYAMAGE + CNT 4 + DELAY 40 + ENDSEQ +ENDDLG +DLG KORAX + SEQ SAYA + NAME SAYAKORAXA + CNT 1 + DELAY 40 + ENDSEQ + SEQ KIRIN + NAME SAYAKORAXB + CNT 1 + DELAY 20 + ENDSEQ + SEQ IBUKI + NAME SAYAKORAXC + CNT 1 + DELAY 20 + ENDSEQ + SEQ SAYA + NAME SAYAKORAXD + CNT 1 + DELAY 20 + ENDSEQ + SEQ KIRIN + NAME SAYAKORAXE + CNT 1 + DELAY 20 + ENDSEQ +ENDDLG +DLG BLIGHT + SEQ SAYA + NAME SAYABLIGHTA + CNT 1 + DELAY 40 + ENDSEQ + SEQ Kirin + NAME SAYABLIGHTB + CNT 1 + DELAY 5 + ENDDELAY 15 + ENDSEQ + SEQ SAYA + NAME SAYABLIGHTC + CNT 2 + DELAY 20 + ENDSEQ +ENDDLG +DLG CONSTABLE + SEQ SAYA + NAME SAYACONSTABLEA + CNT 2 + DELAY 40 + ENDSEQ + SEQ IBUKI + NAME SAYACONSTABLEB + CNT 1 + DELAY 30 + ENDSEQ + SEQ SAYA + NAME SAYACONSTABLEC + CNT 1 + DELAY 20 + ENDSEQ + SEQ IBUKI + NAME SAYACONSTABLED + CNT 1 + DELAY 20 + ENDSEQ +ENDDLG +DLG NAVE + SEQ SAYA + NAME SAYANAVEA + CNT 2 + DELAY 40 + ENDSEQ + SEQ IBUKI + NAME SAYANAVEB + CNT 1 + DELAY 20 + ENDSEQ + SEQ KIRIN + NAME SAYANAVEC + CNT 1 + DELAY 5 + ENDDELAY 30 + ENDSEQ + SEQ SAYA + NAME SAYANAVED + CNT 1 + DELAY 20 + ENDSEQ + SEQ IBUKI + NAME SAYANAVEE + CNT 1 + DELAY 30 + ENDSEQ + SEQ SAYA + NAME SAYANAVEF + CNT 1 + DELAY 40 + ENDSEQ +ENDDLG +DLG DEATHKINGS + SEQ SAYA + NAME SAYADEATHKINGS + CNT 1 + DELAY 40 + ENDSEQ +ENDDLG +# Hexen puzzles +DLG PUZZLE1 + SEQ KIRIN + NAME KIRINPUZZLEA + CNT 2 + DELAY 90 + ENDSEQ +ENDDLG +DLG PUZZLE2 + SEQ KIRIN + NAME KIRINPUZZLEB + CNT 1 + DELAY 80 + ENDSEQ +ENDDLG +DLG PUZZLE3 + SEQ KIRIN + NAME KIRINPUZZLEC + CNT 2 + DELAY 70 + ENDSEQ +ENDDLG +DLG PUZZLE4 + SEQ KIRIN + NAME KIRINPUZZLED + CNT 2 + DELAY 70 + ENDSEQ +ENDDLG +DLG PUZZLE5 + SEQ KIRIN + NAME KIRINPUZZLEE + CNT 2 + DELAY 60 + ENDSEQ +ENDDLG +DLG PUZZLE6 + SEQ KIRIN + NAME KIRINPUZZLEF + CNT 3 + DELAY 60 + ENDSEQ + SEQ SAYA + NAME KIRINPUZZLEG + CNT 1 + DELAY 20 + ENDSEQ + SEQ KIRIN + NAME KIRINPUZZLEH + CNT 1 + DELAY 30 + ENDSEQ + SEQ SAYA + NAME KIRINPUZZLEI + CNT 2 + DELAY 20 + ENDSEQ +ENDDLG +DLG PUZZLE7 + SEQ KIRIN + NAME KIRINPUZZLEJ + CNT 2 + DELAY 80 + ENDSEQ +ENDDLG +DLG PUZZLE8 + SEQ KIRIN + NAME KIRINPUZZLEK + CNT 1 + DELAY 60 + ENDSEQ + SEQ IBUKI + NAME KIRINPUZZLEL + CNT 1 + DELAY 20 + ENDSEQ + SEQ KIRIN + NAME KIRINPUZZLEM + CNT 1 + DELAY 60 + ENDSEQ + SEQ SAYA + NAME KIRINPUZZLEN + CNT 1 + DELAY 30 + ENDSEQ + SEQ IBUKI + NAME KIRINPUZZLEO + CNT 1 + DELAY 20 + ENDSEQ + SEQ SAYA + NAME KIRINPUZZLEP + CNT 1 + DELAY 30 + ENDSEQ + SEQ IBUKI + NAME KIRINPUZZLEQ + CNT 1 + DELAY 20 + ENDSEQ +ENDDLG +DLG PUZZLE9 + SEQ KIRIN + NAME KIRINPUZZLER + CNT 3 + DELAY 60 + ENDSEQ + SEQ SAYA + NAME KIRINPUZZLES + CNT 1 + DELAY 20 + ENDSEQ + SEQ KIRIN + NAME KIRINPUZZLET + CNT 1 + DELAY 30 + ENDSEQ + SEQ SAYA + NAME KIRINPUZZLEU + CNT 1 + DELAY 20 + ENDSEQ +ENDDLG +# miscellaneous +DLG CHEATS + SEQ ZNV + NAME ZNVTXT + CNT 5 + DELAY 80 + ENDDELAY 90 + PAUSEDELAY 40 + ZNVSPECIAL + ENDSEQ +ENDDLG +DLG WASTE1 + SEQ SAYA + NAME SAYAWASTEA + CNT 1 + DELAY 5 + STARTDELAY 10 + ENDDELAY 25 + ENDSEQ +ENDDLG +DLG WASTE2 + SEQ SAYA + NAME SAYAWASTEB + CNT 1 + DELAY 10 + STARTDELAY 20 + ENDDELAY 30 + ENDSEQ +ENDDLG +DLG WASTE3 + SEQ SAYA + NAME SAYAWASTEC + CNT 1 + DELAY 30 + STARTDELAY 15 + ENDDELAY 25 + ENDSEQ +ENDDLG +DLG WASTE4 + SEQ SAYA + NAME SAYAWASTED + CNT 2 + DELAY 40 + STARTDELAY 10 + ENDDELAY 20 + ENDSEQ +ENDDLG +DLG WASTE5 + SEQ SAYA + NAME SAYAWASTEE + CNT 1 + DELAY 20 + STARTDELAY 10 + ENDDELAY 30 + ENDSEQ +ENDDLG +DLG WASTE6 + SEQ SAYA + NAME SAYAWASTEF + CNT 1 + DELAY 50 + STARTDELAY 20 + ENDDELAY 30 + ENDSEQ +ENDDLG +DLG LEVER1 + SEQ SAYA + NAME SAYALEVERA + CNT 1 + DELAY 5 + STARTDELAY 20 + ENDDELAY 50 + ENDSEQ +ENDDLG +DLG LEVER2 + SEQ SAYA + NAME SAYALEVERB + CNT 1 + DELAY 10 + STARTDELAY 30 + ENDDELAY 40 + ENDSEQ +ENDDLG +DLG LEVER3 + SEQ SAYA + NAME SAYALEVERC + CNT 1 + DELAY 30 + STARTDELAY 10 + ENDDELAY 25 + ENDSEQ +ENDDLG +DLG LEVER4 + SEQ SAYA + NAME SAYALEVERD + CNT 1 + DELAY 40 + STARTDELAY 10 + ENDDELAY 20 + ENDSEQ +ENDDLG +DLG LEVER5 + SEQ SAYA + NAME SAYALEVERE + CNT 1 + DELAY 20 + STARTDELAY 10 + ENDDELAY 30 + ENDSEQ +ENDDLG +DLG LEVER6 + SEQ SAYA + NAME SAYALEVERF + CNT 1 + DELAY 50 + STARTDELAY 20 + ENDDELAY 30 + ENDSEQ +ENDDLG +DLG LEVER7 + SEQ SAYA + NAME SAYALEVERG + CNT 2 + DELAY 50 + STARTDELAY 30 + ENDDELAY 50 + ENDSEQ +ENDDLG +DLG FOOL + SEQ SAYA + NAME SAYAFOOL + CNT 5 + DELAY 120 + ENDSEQ +ENDDLG +DLG CC + SEQ CYTHO + NAME CYTHOCCA + CNT 4 + DELAY 120 + ENDSEQ + SEQ SAYA + NAME CYTHOCCB + CNT 1 + DELAY 30 + ENDSEQ + SEQ CYTHO + NAME CYTHOCCC + CNT 1 + DELAY 45 + ENDSEQ +ENDDLG +DLG LILITH + SEQ SAYA + NAME SAYALILITHA + CNT 2 + DELAY 1050 # give it about 15 seconds for it to happen + ENDSEQ + SEQ CYTHO + NAME SAYALILITHB + CNT 1 + DELAY 30 + ENDSEQ + SEQ SAYA + NAME SAYALILITHC + CNT 1 + DELAY 20 + ENDSEQ + SEQ CYTHO + NAME SAYALILITHD + CNT 1 + DELAY 40 + ENDSEQ + SEQ SAYA + NAME SAYALILITHE + CNT 1 + DELAY 50 + ENDSEQ +ENDDLG +DLG ROMERO + SEQ SAYA + NAME SAYAROMEROA + CNT 1 + DELAY 50 + ENDSEQ + SEQ CYTHO + NAME SAYAROMEROB + CNT 1 + DELAY 40 + ENDSEQ + SEQ SAYA + NAME SAYAROMEROC + CNT 1 + DELAY 30 + ENDSEQ + SEQ CYTHO + NAME SAYAROMEROD + CNT 2 + DELAY 50 + ENDSEQ + SEQ SAYA + NAME SAYAROMEROE + CNT 1 + DELAY 70 + ENDSEQ +ENDDLG +DLG CRANK1 + SEQ SAYA + NAME SAYACRANKA + CNT 1 + DELAY 30 + ENDSEQ +ENDDLG +DLG CRANK2 + SEQ SAYA + NAME SAYACRANKB + CNT 2 + DELAY 20 + ENDSEQ +ENDDLG +DLG CRANK3 + SEQ SAYA + NAME SAYACRANKC + CNT 1 + DELAY 80 + STARTDELAY 50 + ENDSEQ +ENDDLG +DLG CRANK4 + SEQ SAYA + NAME SAYACRANKD + CNT 1 + DELAY 40 + STARTDELAY 40 + ENDDELAY 80 + CHARDELAY 5 + ENDSEQ +ENDDLG diff --git a/zmapinfo.txt b/zmapinfo.txt index 3c98371a7..03a1865fd 100644 --- a/zmapinfo.txt +++ b/zmapinfo.txt @@ -226,7 +226,7 @@ DoomEdNums // ... and the chancebox 4206920 = Chancebox // these are also pp stuff - 4206930 = SWWMDialogueTrigger + 4206930 = SWWMDialogueTriggerGOTCHAEND 4206990 = SWWMGuard 4206991 = SWWMHans 4206992 = SWWMSS diff --git a/zscript/compat/swwm_compat.zsc b/zscript/compat/swwm_compat.zsc index 18af2caa7..c9f7d8668 100644 --- a/zscript/compat/swwm_compat.zsc +++ b/zscript/compat/swwm_compat.zsc @@ -161,7 +161,6 @@ Class SWWMLevelCompatibility : LevelPostProcessor SetThingArgument(nt,0,tiddy); nt = AddThing(4206930,(0,0,0)); SetThingID(nt,tiddy); - SetThingArgument(nt,0,SWWMDLG_GOTCHAEND); break; // EQUINOX: various boss brain setups that could be cheesed with the Ynykron or silver bullet // Equinox MAP04 diff --git a/zscript/dlc1/swwm_notashotgun.zsc b/zscript/dlc1/swwm_notashotgun.zsc index eac8c449c..6f8aa327f 100644 --- a/zscript/dlc1/swwm_notashotgun.zsc +++ b/zscript/dlc1/swwm_notashotgun.zsc @@ -269,7 +269,7 @@ Class Quadravol : SWWMWeapon else return; invoker.wastecycle = 0; if (( s.quadegg > 0) && (player == players[consoleplayer]) ) - EventHandler.SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_LEVER1+(s.quadegg-1)); + EventHandler.SendInterfaceEvent(consoleplayer,"swwmsetdialogue.LEVER"..1+(s.quadegg-1)); } action void A_LoadOverlay() diff --git a/zscript/handler/swwm_handler.zsc b/zscript/handler/swwm_handler.zsc index 06e959e0a..5a5f03fc6 100644 --- a/zscript/handler/swwm_handler.zsc +++ b/zscript/handler/swwm_handler.zsc @@ -267,7 +267,7 @@ Class SWWMHandler : EventHandler if ( m && (m.GetClassName() == 'CorruptionCardsSelector') ) incardmenu = true; else if ( incardmenu ) { - if ( !swwm_ccmessage ) SWWMDialogues.StartSeq(SWWMDLG_CC); + if ( !swwm_ccmessage ) SWWMDialogues.StartSeq("CC"); CVar.GetCVar('swwm_ccmessage').SetBool(true); cardmessaged = true; SendNetworkEvent("swwmccstart"); diff --git a/zscript/handler/swwm_handler_cheats.zsc b/zscript/handler/swwm_handler_cheats.zsc index 705636b28..9aac7f669 100644 --- a/zscript/handler/swwm_handler_cheats.zsc +++ b/zscript/handler/swwm_handler_cheats.zsc @@ -409,7 +409,7 @@ extend Class SWWMHandler let s = SWWMStats.Find(players[consoleplayer]); if ( (i > 5) && !swwm_nomapmsg && (!s || !s.oldcheat) ) { - if ( !swwm_oldcheats ) SWWMDialogues.StartSeq(SWWMDLG_CHEATS); + if ( !swwm_oldcheats ) SWWMDialogues.StartSeq("CHEATS"); CVar.GetCVar('swwm_oldcheats').SetBool(true); SendNetworkEvent("swwmsetoldcheat",consoleplayer); } diff --git a/zscript/handler/swwm_handler_process.zsc b/zscript/handler/swwm_handler_process.zsc index 06b417077..ac155d6a6 100644 --- a/zscript/handler/swwm_handler_process.zsc +++ b/zscript/handler/swwm_handler_process.zsc @@ -42,8 +42,8 @@ extend Class SWWMHandler override void InterfaceProcess( ConsoleEvent e ) { if ( e.IsManual ) return; - if ( e.Name ~== "swwmsetdialogue" ) - SWWMDialogues.StartSeq(e.Args[0]); + if ( e.Name.Left(16) ~== "swwmsetdialogue." ) + SWWMDialogues.StartSeq(e.Name.Mid(16)); else if ( e.Name.Left(11) ~== "swwmkeyget." ) { let bar = SWWMStatusBar(StatusBar); diff --git a/zscript/handler/swwm_handler_vanillaboss.zsc b/zscript/handler/swwm_handler_vanillaboss.zsc index 1a2cf98c5..9dd4b1d1d 100644 --- a/zscript/handler/swwm_handler_vanillaboss.zsc +++ b/zscript/handler/swwm_handler_vanillaboss.zsc @@ -49,7 +49,7 @@ Class ROM3R0Message : Inventory if ( Owner.InStateSequence(Owner.CurState,Owner.SeeState) ) { Console.PrintfEx(PRINT_CHAT,StringTable.Localize("$BOSSLINE_ROM3R0")); - EventHandler.SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_ROMERO); + EventHandler.SendInterfaceEvent(consoleplayer,"swwmsetdialogue.ROMERO"); DepleteOrDestroy(); return; } @@ -459,7 +459,7 @@ extend Class SWWMHandler bosstag = "$BT_ARCHANGELUS"; e.Thing.GiveInventory('BossMarker',1); e.Thing.GiveInventory('EndgameBossMarker',1); - SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_EVIB); + SendInterfaceEvent(consoleplayer,"swwmsetdialogue.EVIB"); } } if ( ccloaded && (e.Thing.GetClassName() == "CCards_Boss_Romero") ) diff --git a/zscript/handler/swwm_handler_worldload.zsc b/zscript/handler/swwm_handler_worldload.zsc index c57cbb81e..be0debd4a 100644 --- a/zscript/handler/swwm_handler_worldload.zsc +++ b/zscript/handler/swwm_handler_worldload.zsc @@ -152,19 +152,19 @@ extend Class SWWMHandler switch ( whichboss ) { case MAP_DE1M8: - SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_PHOBOS); + SendInterfaceEvent(consoleplayer,"swwmsetdialogue.PHOBOS"); break; case MAP_DE2M8: - SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_DEIMOS); + SendInterfaceEvent(consoleplayer,"swwmsetdialogue.DEIMOS"); break; case MAP_DE3M8: - SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_DIS); + SendInterfaceEvent(consoleplayer,"swwmsetdialogue.DIS"); break; case MAP_DE4M8: - SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_THY); + SendInterfaceEvent(consoleplayer,"swwmsetdialogue.THY"); break; case MAP_DMAP07: - SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_DIMPLE); + SendInterfaceEvent(consoleplayer,"swwmsetdialogue.DIMPLE"); break; case MAP_DMAP30: bool rampancy = false; @@ -174,46 +174,46 @@ extend Class SWWMHandler rampancy = true; break; } - if ( rampancy ) SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_RAMPANCY); - else SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_IOS); + if ( rampancy ) SendInterfaceEvent(consoleplayer,"swwmsetdialogue.RAMPANCY"); + else SendInterfaceEvent(consoleplayer,"swwmsetdialogue.IOS"); break; case MAP_DLVL08: - SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_NERVE); + SendInterfaceEvent(consoleplayer,"swwmsetdialogue.NERVE"); break; case MAP_EVMAP30: - SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_EVIA); + SendInterfaceEvent(consoleplayer,"swwmsetdialogue.EVIA"); break; case MAP_HE1M8_HE4M8: - if ( level.mapname ~== "E1M8" ) SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_MAW); - else SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_HEADS); + if ( level.mapname ~== "E1M8" ) SendInterfaceEvent(consoleplayer,"swwmsetdialogue.MAW"); + else SendInterfaceEvent(consoleplayer,"swwmsetdialogue.HEADS"); break; case MAP_HE2M8_HE5M8: - if ( level.mapname ~== "E2M8" ) SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_PORTALS); - else SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_BULLS); + if ( level.mapname ~== "E2M8" ) SendInterfaceEvent(consoleplayer,"swwmsetdialogue.PORTALS"); + else SendInterfaceEvent(consoleplayer,"swwmsetdialogue.BULLS"); break; case MAP_HE3M8: - SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_DSPARIL); + SendInterfaceEvent(consoleplayer,"swwmsetdialogue.DSPARIL"); break; case MAP_HMAP38: - SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_CLERIC); + SendInterfaceEvent(consoleplayer,"swwmsetdialogue.CLERIC"); break; case MAP_HMAP36: - SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_FIGHTER); + SendInterfaceEvent(consoleplayer,"swwmsetdialogue.FIGHTER"); break; case MAP_HMAP37: - SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_MAGE); + SendInterfaceEvent(consoleplayer,"swwmsetdialogue.MAGE"); break; case MAP_HMAP12: - SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_HYPO); + SendInterfaceEvent(consoleplayer,"swwmsetdialogue.HYPO"); break; case MAP_HMAP40: - SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_KORAX); + SendInterfaceEvent(consoleplayer,"swwmsetdialogue.KORAX"); break; case MAP_HMAP23_HMAP27_HMAP48_HMAP55: - if ( level.mapname ~== "MAP48" ) SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_CONSTABLE); + if ( level.mapname ~== "MAP48" ) SendInterfaceEvent(consoleplayer,"swwmsetdialogue.CONSTABLE"); break; case MAP_HMAP60: - SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_DEATHKINGS); + SendInterfaceEvent(consoleplayer,"swwmsetdialogue.DEATHKINGS"); break; case MAP_NONE: String csum = level.GetChecksum(); @@ -221,39 +221,39 @@ extend Class SWWMHandler if ( (csum ~== "3D72FD17F36D2D43FD9A21E6E57EE357") || (csum ~== "09B30C9DA9D73D3D5A709502FBB947AA") || (csum ~== "6EAD80DA1F30B4B3546FA294EEF9F87C") ) - SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_SIGIL); + SendInterfaceEvent(consoleplayer,"swwmsetdialogue.SIGIL"); // Doom 2 MAP11 else if ( (csum ~== "73D9E03CEE7BF1A97EFD2EAD86688EF8") || (csum ~== "F4F2A769609988837458772AAE99008C") || (csum ~== "DF6A001A6C42DB5CCA599EE5883B294A") ) - SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_CIRCLE); + SendInterfaceEvent(consoleplayer,"swwmsetdialogue.CIRCLE"); // Doom 2 MAP20 else if ( (csum ~== "8898F5EC9CBDCD98019A1BC1BF892A8A") || (csum ~== "CC53CFFCB30E873669AA2F09DA0D3566") ) - SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_GOTCHA); + SendInterfaceEvent(consoleplayer,"swwmsetdialogue.GOTCHA"); // Eviternity // MAP05 else if ( csum ~== "33B8501B10CE5E2555C03725F765A914" ) - SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_DMN); + SendInterfaceEvent(consoleplayer,"swwmsetdialogue.DMN"); // MAP10 else if ( csum ~== "9E83602D325677B8D7C3BC44BEF9B03F" ) - SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_CRE); + SendInterfaceEvent(consoleplayer,"swwmsetdialogue.CRE"); // MAP15 else if ( csum ~== "CA40E6DDAB6B5C924CDC36B1F851421E" ) - SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_CRY); + SendInterfaceEvent(consoleplayer,"swwmsetdialogue.CRY"); // MAP20 else if ( csum ~== "F34B3FD4D13AC763469A8E0D7379B9D0" ) - SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_CON); + SendInterfaceEvent(consoleplayer,"swwmsetdialogue.CON"); // MAP25 else if ( csum ~== "196BC735473C593F924A59B238574C35" ) - SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_SLA); + SendInterfaceEvent(consoleplayer,"swwmsetdialogue.SLA"); // Deathkings // Blight else if ( csum ~== "E3EFB0156A20ADF2DF00915A0EA85DF5" ) - SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_BLIGHT); + SendInterfaceEvent(consoleplayer,"swwmsetdialogue.BLIGHT"); // Nave else if ( csum ~== "E2B5D1400279335811C1C1C0B437D9C8" ) - SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_NAVE); + SendInterfaceEvent(consoleplayer,"swwmsetdialogue.NAVE"); break; } } diff --git a/zscript/handler/swwm_handler_worldthings.zsc b/zscript/handler/swwm_handler_worldthings.zsc index 64a6c569c..5bcbdd6ac 100644 --- a/zscript/handler/swwm_handler_worldthings.zsc +++ b/zscript/handler/swwm_handler_worldthings.zsc @@ -359,7 +359,7 @@ extend Class SWWMHandler } else if ( ccloaded && (e.Thing.GetClassName() == "CCards_Token_Glitched") ) { - if ( !gdat.cclilithonce ) SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_LILITH); + if ( !gdat.cclilithonce ) SendInterfaceEvent(consoleplayer,"swwmsetdialogue.LILITH"); gdat.cclilithonce = true; } if ( SWWMUtility.IdentifyingDog(e.Thing) || SWWMUtility.IdentifyingCaco(e.Thing) diff --git a/zscript/handler/swwm_statichandler.zsc b/zscript/handler/swwm_statichandler.zsc index 07fd5029c..665fe2032 100644 --- a/zscript/handler/swwm_statichandler.zsc +++ b/zscript/handler/swwm_statichandler.zsc @@ -223,7 +223,7 @@ Class SWWMStaticHandler : StaticEventHandler if ( gamestate != GS_LEVEL ) return; if ( SystemTime.Format("%d%m",SystemTime.Now()) == "0104" ) { - if ( !aprilfools ) SWWMDialogues.StartSeq(SWWMDLG_FOOL); + if ( !aprilfools ) SWWMDialogues.StartSeq("FOOL"); aprilfools = true; } else aprilfools = false; diff --git a/zscript/hud/swwm_dialogue.zsc b/zscript/hud/swwm_dialogue.zsc index 92fe2d045..80f66d142 100644 --- a/zscript/hud/swwm_dialogue.zsc +++ b/zscript/hud/swwm_dialogue.zsc @@ -1,1061 +1,176 @@ // dialogue sequences -enum SWWMDialogue -{ - SWWMDLG_None = 0, // dummy - SWWMDLG_PHOBOS, - SWWMDLG_DEIMOS, - SWWMDLG_DIS, - SWWMDLG_THY, - SWWMDLG_SIGIL, - SWWMDLG_DIMPLE, - SWWMDLG_CIRCLE, - SWWMDLG_GOTCHA, - SWWMDLG_GOTCHAEND, - SWWMDLG_IOS, - SWWMDLG_RAMPANCY, - SWWMDLG_NERVE, - SWWMDLG_DMN, - SWWMDLG_CRE, - SWWMDLG_CRY, - SWWMDLG_CON, - SWWMDLG_SLA, - SWWMDLG_EVIA, - SWWMDLG_EVIB, - SWWMDLG_MAW, - SWWMDLG_PORTALS, - SWWMDLG_DSPARIL, - SWWMDLG_HEADS, - SWWMDLG_BULLS, - SWWMDLG_GREET, - SWWMDLG_BLOOD, - SWWMDLG_HYPO, - SWWMDLG_WORSHIP, - SWWMDLG_GAME, - SWWMDLG_MASTERS, - SWWMDLG_FIGHTER, - SWWMDLG_CLERIC, - SWWMDLG_MAGE, - SWWMDLG_KORAX, - SWWMDLG_BLIGHT, - SWWMDLG_CONSTABLE, - SWWMDLG_NAVE, - SWWMDLG_DEATHKINGS, - SWWMDLG_PUZZLE1, - SWWMDLG_PUZZLE2, - SWWMDLG_PUZZLE3, - SWWMDLG_PUZZLE4, - SWWMDLG_PUZZLE5, - SWWMDLG_PUZZLE6, - SWWMDLG_PUZZLE7, - SWWMDLG_PUZZLE8, - SWWMDLG_PUZZLE9, - SWWMDLG_CHEATS, - SWWMDLG_WASTE1, - SWWMDLG_WASTE2, - SWWMDLG_WASTE3, - SWWMDLG_WASTE4, - SWWMDLG_WASTE5, - SWWMDLG_WASTE6, - SWWMDLG_LEVER1, - SWWMDLG_LEVER2, - SWWMDLG_LEVER3, - SWWMDLG_LEVER4, - SWWMDLG_LEVER5, - SWWMDLG_LEVER6, - SWWMDLG_LEVER7, - SWWMDLG_FOOL, - SWWMDLG_CC, - SWWMDLG_LILITH, - SWWMDLG_ROMERO, - SWWMDLG_CRANK1, - SWWMDLG_CRANK2, - SWWMDLG_CRANK3, - SWWMDLG_CRANK4, - NUM_SWWMDLG -}; -// this immense string of spaghetti code should be proof enough of the fact I did not think things through when writing the message system Class SWWMDialogues abstract { - // try to work around "too many registers" by splitting the pasta into chunks - private static ui void StartSeq_SubA( int dlg ) + // where the magic happens + static ui void StartSeq( String dlg ) { - SWWMDirectMessage msg, msg2; - switch ( dlg ) + if ( dlg == "" ) { - case SWWMDLG_PHOBOS: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYAPHOBOS"; - msg.seqcnt = 4; - msg.delay = 40; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_DEIMOS: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYADEIMOS"; - msg.seqcnt = 4; - msg.delay = 40; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_DIS: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYADIS"; - msg.seqcnt = 4; - msg.delay = 40; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_THY: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYATHY"; - msg.seqcnt = 4; - msg.delay = 40; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_SIGIL: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_CYTHOSNAME"),StringTable.Localize("$SWWM_CYTHONAME"),"Cytho"); - msg.seqname = "CYTHOSIGIL"; - msg.seqcnt = 4; - msg.delay = 40; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_DIMPLE: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYADIMPLE"; - msg.seqcnt = 5; - msg.delay = 40; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_CIRCLE: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYACIRCLE"; - msg.seqcnt = 5; - msg.delay = 40; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_GOTCHA: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYAGOTCHA"; - msg.seqcnt = 5; - msg.delay = 40; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_GOTCHAEND: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYAGOTCHAEND"; - msg.seqcnt = 5; - msg.delay = 40; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_IOS: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYAIOS"; - msg.seqcnt = 5; - msg.delay = 40; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_RAMPANCY: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYARAMPANCY"; - msg.seqcnt = 4; - msg.delay = 250; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_NERVE: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_CYTHOSNAME"),StringTable.Localize("$SWWM_CYTHONAME"),"Cytho"); - msg.seqname = "CYTHONERVE"; - msg.seqcnt = 5; - msg.delay = 40; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_DMN: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYADMN"; - msg.seqcnt = 8; - msg.delay = 40; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_CRE: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYACRE"; - msg.seqcnt = 4; - msg.delay = 50; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_CRY: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYACRY"; - msg.seqcnt = 5; - msg.delay = 30; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_CON: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYACON"; - msg.seqcnt = 5; - msg.delay = 50; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_SLA: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYASLA"; - msg.seqcnt = 1; - msg.delay = 120; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_EVIA: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYAEVIA"; - msg.seqcnt = 4; - msg.delay = 40; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_EVIB: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYAEVIB"; - msg.seqcnt = 2; - msg.delay = 20; - StatusBar.AttachMessage(msg,-1232); - break; + if ( developer >= 2 ) Console.Printf("StartSeq: bogus call with empty dialogue name, check your code."); + return; } - } - private static ui void StartSeq_SubB( int dlg ) - { - SWWMDirectMessage msg, msg2; - switch ( dlg ) + // load the lump for parsing + Array lines; + Array lnums; + int cur = -1; + for ( int lmp = Wads.FindLumpFullName("swwmdialogue",0,true); lmp != -1; lmp = Wads.FindLumpFullName("swwmdialogue",lmp+1,true) ) { - case SWWMDLG_MAW: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYAMAW"; - msg.seqcnt = 5; - msg.delay = 40; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_PORTALS: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYAPORTALS"; - msg.seqcnt = 5; - msg.delay = 40; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_DSPARIL: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYADSPARIL"; - msg.seqcnt = 5; - msg.delay = 40; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_HEADS: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYAHEADS"; - msg.seqcnt = 6; - msg.delay = 40; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_BULLS: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYABULLS"; - msg.seqcnt = 5; - msg.delay = 40; - StatusBar.AttachMessage(msg,-1232); - break; + String dat = Wads.ReadLump(lmp); + lines.Clear(); + dat.Split(lines,"\n",0); + lnums.Clear(); + // for the error output + for ( int i=0; i= 2 ) Console.Printf("ProcessDlg: sequence '%s' not found",dlg); + return; } - } - private static ui void StartSeq_SubD( int dlg ) - { - SWWMDirectMessage msg, msg2; - switch ( dlg ) + // start parsing from here + cur++; + bool gotseq = false; + bool inseq = false; + String schr, sname; + int scnt, sdelay, sstartdelay, senddelay, schardelay, spausedelay; + bool sindirect, sznvspecial; + SWWMDirectMessage msg, lastmsg; + while ( cur < lines.Size() ) { - case SWWMDLG_FIGHTER: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYAFIGHTER"; - msg.seqcnt = 2; - msg.delay = 40; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_CLERIC: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYACLERICA"; - msg.seqcnt = 2; - msg.delay = 40; - StatusBar.AttachMessage(msg,-1232); - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_KIRINSNAME"),StringTable.Localize("$SWWM_KIRINNAME"),"Kirin"); - msg2.seqname = "SAYACLERICB"; - msg2.seqcnt = 1; - msg2.delay = 20; - msg.nextmsg = msg2; - msg.nextdirect = true; - msg = msg2; - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg2.seqname = "SAYACLERICC"; - msg2.seqcnt = 2; - msg2.delay = 20; - msg.nextmsg = msg2; - msg.nextdirect = true; - break; - case SWWMDLG_MAGE: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYAMAGE"; - msg.seqcnt = 4; - msg.delay = 40; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_KORAX: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYAKORAXA"; - msg.seqcnt = 1; - msg.delay = 40; - StatusBar.AttachMessage(msg,-1232); - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_KIRINSNAME"),StringTable.Localize("$SWWM_KIRINNAME"),"Kirin"); - msg2.seqname = "SAYAKORAXB"; - msg2.seqcnt = 1; - msg2.delay = 20; - msg.nextmsg = msg2; - msg.nextdirect = true; - msg = msg2; - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_IBUKISNAME"),StringTable.Localize("$SWWM_IBUKINAME"),"Ibuki"); - msg2.seqname = "SAYAKORAXC"; - msg2.seqcnt = 1; - msg2.delay = 20; - msg.nextmsg = msg2; - msg.nextdirect = true; - msg = msg2; - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg2.seqname = "SAYAKORAXD"; - msg2.seqcnt = 1; - msg2.delay = 20; - msg.nextmsg = msg2; - msg.nextdirect = true; - msg = msg2; - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_KIRINSNAME"),StringTable.Localize("$SWWM_KIRINNAME"),"Kirin"); - msg2.seqname = "SAYAKORAXE"; - msg2.seqcnt = 1; - msg2.delay = 20; - msg.nextmsg = msg2; - msg.nextdirect = true; - break; + // dialogue ends here + if ( lines[cur].Left(6) == "ENDDLG" ) + { + if ( inseq ) ThrowAbortException("dialogue '%s', line %d, premature end of sequence.",dlg,lnums[cur]); + if ( !gotseq ) ThrowAbortException("dialogue '%s', line %d, dialogue is empty.",dlg,lnums[cur]); + return; + } + if ( inseq ) + { + // fetch params until we find ENDSEQ + if ( lines[cur].Left(6) == "ENDSEQ" ) + { + // put out the sequence + if ( sname == "" ) ThrowAbortException("dialogue '%s', line %d, sequence has no name.",dlg,lnums[cur]); + msg.seqname = sname; + if ( scnt <= 0 ) ThrowAbortException("dialogue '%s', line %d, sequence has invalid count.",dlg,lnums[cur]); + msg.seqcnt = scnt; + if ( sdelay > 0 ) msg.delay = sdelay; + if ( sstartdelay > 0 ) msg.startdelay = sstartdelay; + if ( senddelay > 0 ) msg.enddelay = senddelay; + if ( schardelay > 0 ) msg.chardelay = schardelay; + if ( spausedelay > 0 ) msg.pausedelay = spausedelay; + msg.znvspecial = sznvspecial; + if ( !gotseq ) + { + // first message? attach to hud here + StatusBar.AttachMessage(msg,-1232); + } + else + { + // additional message? append to last + if ( !lastmsg ) ThrowAbortException("dialogue '%s', line %d, lastmsg is null, this should not happen.",dlg,lnums[cur]); + lastmsg.nextmsg = msg; + lastmsg.nextdirect = !sindirect; + } + gotseq = true; + inseq = false; + } + else if ( lines[cur].Left(5) == "NAME " ) + { + if ( sname != "" ) ThrowAbortException("dialogue '%s', line %d, duplicate 'NAME' parameter.",dlg,lnums[cur]); + sname = lines[cur].Mid(5); + } + else if ( lines[cur].Left(4) == "CNT " ) + { + if ( scnt > 0 ) ThrowAbortException("dialogue '%s', line %d, duplicate 'CNT' parameter.",dlg,lnums[cur]); + scnt = lines[cur].Mid(4).ToInt(); + } + else if ( lines[cur].Left(6) == "DELAY " ) + { + if ( sdelay > 0 ) ThrowAbortException("dialogue '%s', line %d, duplicate 'DELAY' parameter.",dlg,lnums[cur]); + sdelay = lines[cur].Mid(6).ToInt(); + } + else if ( lines[cur].Left(11) == "STARTDELAY " ) + { + if ( sstartdelay > 0 ) ThrowAbortException("dialogue '%s', line %d, duplicate 'STARTDELAY' parameter.",dlg,lnums[cur]); + sstartdelay = lines[cur].Mid(11).ToInt(); + } + else if ( lines[cur].Left(9) == "ENDDELAY " ) + { + if ( senddelay > 0 ) ThrowAbortException("dialogue '%s', line %d, duplicate 'ENDDELAY' parameter.",dlg,lnums[cur]); + senddelay = lines[cur].Mid(9).ToInt(); + } + else if ( lines[cur].Left(10) == "CHARDELAY " ) + { + if ( schardelay > 0 ) ThrowAbortException("dialogue '%s', line %d, duplicate 'CHARDELAY' parameter.",dlg,lnums[cur]); + schardelay = lines[cur].Mid(10).ToInt(); + } + else if ( lines[cur].Left(11) == "PAUSEDELAY " ) + { + if ( spausedelay > 0 ) ThrowAbortException("dialogue '%s', line %d, duplicate 'PAUSEDELAY' parameter.",dlg,lnums[cur]); + spausedelay = lines[cur].Mid(11).ToInt(); + } + else if ( lines[cur].Left(8) == "INDIRECT" ) + { + if ( sindirect ) ThrowAbortException("dialogue '%s', line %d, duplicate 'INDIRECT' parameter.",dlg,lnums[cur]); + sindirect = true; + } + else if ( lines[cur].Left(10) == "ZNVSPECIAL" ) + { + if ( sznvspecial ) ThrowAbortException("dialogue '%s', line %d, duplicate 'ZNVSPECIAL' parameter.",dlg,lnums[cur]); + sznvspecial = true; + } + else ThrowAbortException("dialogue '%s', line %d, parameter not recognized",dlg,lnums[cur]); + cur++; + continue; + } + if ( lines[cur].Left(4) == "SEQ " ) + { + // begin dialogue + inseq = true; + schr = lines[cur].Mid(4); + if ( schr == "" ) ThrowAbortException("dialogue '%s', line %d, sequence has no character.",dlg,lnums[cur]); + lastmsg = msg; + msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_"..schr.."SNAME"),StringTable.Localize("$SWWM_"..schr.."NAME"),schr); + // wipe params + sname = ""; + scnt = 0; + sdelay = 0; + sstartdelay = 0; + senddelay = 0; + schardelay = 0; + spausedelay = 0; + sindirect = false; + sznvspecial = false; + cur++; + continue; + } + ThrowAbortException("dialogue '%s', line %d, expected 'SEQ' directive",dlg,lnums[cur]); + return; } - } - private static ui void StartSeq_SubE( int dlg ) - { - SWWMDirectMessage msg, msg2; - switch ( dlg ) - { - case SWWMDLG_BLIGHT: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYABLIGHTA"; - msg.seqcnt = 1; - msg.delay = 40; - StatusBar.AttachMessage(msg,-1232); - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_KIRINSNAME"),StringTable.Localize("$SWWM_KIRINNAME"),"Kirin"); - msg2.seqname = "SAYABLIGHTB"; - msg2.seqcnt = 1; - msg2.delay = 5; - msg2.enddelay = 15; - msg.nextmsg = msg2; - msg.nextdirect = true; - msg = msg2; - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg2.seqname = "SAYABLIGHTC"; - msg2.seqcnt = 2; - msg2.delay = 20; - msg.nextmsg = msg2; - msg.nextdirect = true; - break; - case SWWMDLG_CONSTABLE: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYACONSTABLEA"; - msg.seqcnt = 2; - msg.delay = 40; - StatusBar.AttachMessage(msg,-1232); - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_IBUKISNAME"),StringTable.Localize("$SWWM_IBUKINAME"),"Ibuki"); - msg2.seqname = "SAYACONSTABLEB"; - msg2.seqcnt = 1; - msg2.delay = 30; - msg.nextmsg = msg2; - msg.nextdirect = true; - msg = msg2; - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg2.seqname = "SAYACONSTABLEC"; - msg2.seqcnt = 1; - msg2.delay = 20; - msg.nextmsg = msg2; - msg.nextdirect = true; - msg = msg2; - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_IBUKISNAME"),StringTable.Localize("$SWWM_IBUKINAME"),"Ibuki"); - msg2.seqname = "SAYACONSTABLED"; - msg2.seqcnt = 1; - msg2.delay = 20; - msg.nextmsg = msg2; - msg.nextdirect = true; - break; - case SWWMDLG_NAVE: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYANAVEA"; - msg.seqcnt = 2; - msg.delay = 40; - StatusBar.AttachMessage(msg,-1232); - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_IBUKISNAME"),StringTable.Localize("$SWWM_IBUKINAME"),"Ibuki"); - msg2.seqname = "SAYANAVEB"; - msg2.seqcnt = 1; - msg2.delay = 20; - msg.nextmsg = msg2; - msg.nextdirect = true; - msg = msg2; - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_KIRINSNAME"),StringTable.Localize("$SWWM_KIRINNAME"),"Kirin"); - msg2.seqname = "SAYANAVEC"; - msg2.seqcnt = 1; - msg2.delay = 5; - msg2.enddelay = 30; - msg.nextmsg = msg2; - msg.nextdirect = true; - msg = msg2; - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg2.seqname = "SAYANAVED"; - msg2.seqcnt = 1; - msg2.delay = 20; - msg.nextmsg = msg2; - msg.nextdirect = true; - msg = msg2; - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_IBUKISNAME"),StringTable.Localize("$SWWM_IBUKINAME"),"Ibuki"); - msg2.seqname = "SAYANAVEE"; - msg2.seqcnt = 1; - msg2.delay = 30; - msg.nextmsg = msg2; - msg.nextdirect = true; - msg = msg2; - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg2.seqname = "SAYANAVEF"; - msg2.seqcnt = 1; - msg2.delay = 40; - msg.nextmsg = msg2; - msg.nextdirect = true; - break; - case SWWMDLG_DEATHKINGS: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYADEATHKINGS"; - msg.seqcnt = 1; - msg.delay = 40; - StatusBar.AttachMessage(msg,-1232); - break; - } - } - private static ui void StartSeq_SubF( int dlg ) - { - SWWMDirectMessage msg, msg2; - switch ( dlg ) - { - case SWWMDLG_PUZZLE1: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_KIRINSNAME"),StringTable.Localize("$SWWM_KIRINNAME"),"Kirin"); - msg.seqname = "KIRINPUZZLEA"; - msg.seqcnt = 2; - msg.delay = 90; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_PUZZLE2: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_KIRINSNAME"),StringTable.Localize("$SWWM_KIRINNAME"),"Kirin"); - msg.seqname = "KIRINPUZZLEB"; - msg.seqcnt = 1; - msg.delay = 80; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_PUZZLE3: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_KIRINSNAME"),StringTable.Localize("$SWWM_KIRINNAME"),"Kirin"); - msg.seqname = "KIRINPUZZLEC"; - msg.seqcnt = 2; - msg.delay = 70; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_PUZZLE4: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_KIRINSNAME"),StringTable.Localize("$SWWM_KIRINNAME"),"Kirin"); - msg.seqname = "KIRINPUZZLED"; - msg.seqcnt = 2; - msg.delay = 70; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_PUZZLE5: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_KIRINSNAME"),StringTable.Localize("$SWWM_KIRINNAME"),"Kirin"); - msg.seqname = "KIRINPUZZLEE"; - msg.seqcnt = 2; - msg.delay = 60; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_PUZZLE6: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_KIRINSNAME"),StringTable.Localize("$SWWM_KIRINNAME"),"Kirin"); - msg.seqname = "KIRINPUZZLEF"; - msg.seqcnt = 3; - msg.delay = 60; - StatusBar.AttachMessage(msg,-1232); - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg2.seqname = "KIRINPUZZLEG"; - msg2.seqcnt = 1; - msg.delay = 20; - msg.nextmsg = msg2; - msg.nextdirect = true; - msg = msg2; - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_KIRINSNAME"),StringTable.Localize("$SWWM_KIRINNAME"),"Kirin"); - msg2.seqname = "KIRINPUZZLEH"; - msg2.seqcnt = 1; - msg.delay = 30; - msg.nextmsg = msg2; - msg.nextdirect = true; - msg = msg2; - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg2.seqname = "KIRINPUZZLEI"; - msg2.seqcnt = 2; - msg.delay = 20; - msg.nextmsg = msg2; - msg.nextdirect = true; - break; - case SWWMDLG_PUZZLE7: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_KIRINSNAME"),StringTable.Localize("$SWWM_KIRINNAME"),"Kirin"); - msg.seqname = "KIRINPUZZLEJ"; - msg.seqcnt = 2; - msg.delay = 80; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_PUZZLE8: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_KIRINSNAME"),StringTable.Localize("$SWWM_KIRINNAME"),"Kirin"); - msg.seqname = "KIRINPUZZLEK"; - msg.seqcnt = 1; - msg.delay = 60; - StatusBar.AttachMessage(msg,-1232); - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_IBUKISNAME"),StringTable.Localize("$SWWM_IBUKINAME"),"Ibuki"); - msg2.seqname = "KIRINPUZZLEL"; - msg2.seqcnt = 1; - msg2.delay = 20; - msg.nextmsg = msg2; - msg.nextdirect = true; - msg = msg2; - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_KIRINSNAME"),StringTable.Localize("$SWWM_KIRINNAME"),"Kirin"); - msg2.seqname = "KIRINPUZZLEM"; - msg2.seqcnt = 1; - msg2.delay = 10; - msg.nextmsg = msg2; - msg.nextdirect = true; - msg = msg2; - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg2.seqname = "KIRINPUZZLEN"; - msg2.seqcnt = 1; - msg2.delay = 30; - msg.nextmsg = msg2; - msg.nextdirect = true; - msg = msg2; - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_IBUKISNAME"),StringTable.Localize("$SWWM_IBUKINAME"),"Ibuki"); - msg2.seqname = "KIRINPUZZLEO"; - msg2.seqcnt = 1; - msg2.delay = 20; - msg.nextmsg = msg2; - msg.nextdirect = true; - msg = msg2; - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg2.seqname = "KIRINPUZZLEP"; - msg2.seqcnt = 1; - msg2.delay = 30; - msg.nextmsg = msg2; - msg.nextdirect = true; - msg = msg2; - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_IBUKISNAME"),StringTable.Localize("$SWWM_IBUKINAME"),"Ibuki"); - msg2.seqname = "KIRINPUZZLEQ"; - msg2.seqcnt = 1; - msg2.delay = 20; - msg.nextmsg = msg2; - msg.nextdirect = true; - break; - case SWWMDLG_PUZZLE9: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_KIRINSNAME"),StringTable.Localize("$SWWM_KIRINNAME"),"Kirin"); - msg.seqname = "KIRINPUZZLER"; - msg.seqcnt = 3; - msg.delay = 60; - StatusBar.AttachMessage(msg,-1232); - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg2.seqname = "KIRINPUZZLES"; - msg2.seqcnt = 1; - msg2.delay = 20; - msg.nextmsg = msg2; - msg.nextdirect = true; - msg = msg2; - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_KIRINSNAME"),StringTable.Localize("$SWWM_KIRINNAME"),"Kirin"); - msg2.seqname = "KIRINPUZZLET"; - msg2.seqcnt = 1; - msg2.delay = 30; - msg.nextmsg = msg2; - msg.nextdirect = true; - msg = msg2; - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg2.seqname = "KIRINPUZZLEU"; - msg2.seqcnt = 1; - msg2.delay = 20; - msg.nextmsg = msg2; - msg.nextdirect = true; - break; - } - } - private static ui void StartSeq_SubG( int dlg ) - { - SWWMDirectMessage msg, msg2; - switch ( dlg ) - { - case SWWMDLG_CHEATS: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_ZNVSNAME"),StringTable.Localize("$SWWM_ZNVNAME"),"Znv"); - msg.seqname = "ZNVTXT"; - msg.seqcnt = 5; - msg.znvspecial = true; - msg.delay = 80; - msg.enddelay = 90; - msg.pausedelay = 40; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_WASTE1: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYAWASTEA"; - msg.seqcnt = 1; - msg.delay = 5; - msg.startdelay = 10; - msg.enddelay = 25; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_WASTE2: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYAWASTEB"; - msg.seqcnt = 1; - msg.delay = 10; - msg.startdelay = 20; - msg.enddelay = 30; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_WASTE3: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYAWASTEC"; - msg.seqcnt = 1; - msg.delay = 30; - msg.startdelay = 15; - msg.enddelay = 25; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_WASTE4: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYAWASTED"; - msg.seqcnt = 2; - msg.delay = 40; - msg.startdelay = 10; - msg.enddelay = 20; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_WASTE5: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYAWASTEE"; - msg.seqcnt = 1; - msg.delay = 20; - msg.startdelay = 10; - msg.enddelay = 30; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_WASTE6: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYAWASTEF"; - msg.seqcnt = 1; - msg.delay = 50; - msg.startdelay = 20; - msg.enddelay = 30; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_LEVER1: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYALEVERA"; - msg.seqcnt = 1; - msg.delay = 5; - msg.startdelay = 20; - msg.enddelay = 50; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_LEVER2: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYALEVERB"; - msg.seqcnt = 1; - msg.delay = 10; - msg.startdelay = 30; - msg.enddelay = 40; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_LEVER3: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYALEVERC"; - msg.seqcnt = 1; - msg.delay = 30; - msg.startdelay = 10; - msg.enddelay = 25; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_LEVER4: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYALEVERD"; - msg.seqcnt = 1; - msg.delay = 40; - msg.startdelay = 10; - msg.enddelay = 20; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_LEVER5: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYALEVERE"; - msg.seqcnt = 1; - msg.delay = 20; - msg.startdelay = 10; - msg.enddelay = 30; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_LEVER6: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYALEVERF"; - msg.seqcnt = 1; - msg.delay = 50; - msg.startdelay = 20; - msg.enddelay = 30; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_LEVER7: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYALEVERG"; - msg.seqcnt = 2; - msg.delay = 50; - msg.startdelay = 30; - msg.enddelay = 50; - StatusBar.AttachMessage(msg,-1232); - break; - } - } - private static ui void StartSeq_SubH( int dlg ) - { - SWWMDirectMessage msg, msg2; - switch ( dlg ) - { - case SWWMDLG_FOOL: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYAFOOL"; - msg.seqcnt = 5; - msg.delay = 120; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_CC: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_CYTHOSNAME"),StringTable.Localize("$SWWM_CYTHONAME"),"Cytho"); - msg.seqname = "CYTHOCCA"; - msg.seqcnt = 4; - msg.delay = 120; - StatusBar.AttachMessage(msg,-1232); - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg2.seqname = "CYTHOCCB"; - msg2.seqcnt = 1; - msg2.delay = 30; - msg.nextmsg = msg2; - msg.nextdirect = true; - msg = msg2; - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_CYTHOSNAME"),StringTable.Localize("$SWWM_CYTHONAME"),"Cytho"); - msg2.seqname = "CYTHOCCC"; - msg2.seqcnt = 1; - msg2.delay = 45; - msg.nextmsg = msg2; - msg.nextdirect = true; - break; - case SWWMDLG_LILITH: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYALILITHA"; - msg.seqcnt = 2; - msg.delay = 1050; // give it about 15 seconds for it to happen - StatusBar.AttachMessage(msg,-1232); - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_CYTHOSNAME"),StringTable.Localize("$SWWM_CYTHONAME"),"Cytho"); - msg2.seqname = "SAYALILITHB"; - msg2.seqcnt = 1; - msg2.delay = 30; - msg.nextmsg = msg2; - msg.nextdirect = true; - msg = msg2; - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg2.seqname = "SAYALILITHC"; - msg2.seqcnt = 1; - msg2.delay = 20; - msg.nextmsg = msg2; - msg.nextdirect = true; - msg = msg2; - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_CYTHOSNAME"),StringTable.Localize("$SWWM_CYTHONAME"),"Cytho"); - msg2.seqname = "SAYALILITHD"; - msg2.seqcnt = 1; - msg2.delay = 40; - msg.nextmsg = msg2; - msg.nextdirect = true; - msg = msg2; - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg2.seqname = "SAYALILITHE"; - msg2.seqcnt = 1; - msg2.delay = 50; - msg.nextmsg = msg2; - msg.nextdirect = true; - break; - case SWWMDLG_ROMERO: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYAROMEROA"; - msg.seqcnt = 1; - msg.delay = 50; - StatusBar.AttachMessage(msg,-1232); - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_CYTHOSNAME"),StringTable.Localize("$SWWM_CYTHONAME"),"Cytho"); - msg2.seqname = "SAYAROMEROB"; - msg2.seqcnt = 1; - msg2.delay = 40; - msg.nextmsg = msg2; - msg.nextdirect = true; - msg = msg2; - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg2.seqname = "SAYAROMEROC"; - msg2.seqcnt = 1; - msg2.delay = 30; - msg.nextmsg = msg2; - msg.nextdirect = true; - msg = msg2; - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_CYTHOSNAME"),StringTable.Localize("$SWWM_CYTHONAME"),"Cytho"); - msg2.seqname = "SAYAROMEROD"; - msg2.seqcnt = 2; - msg2.delay = 50; - msg.nextmsg = msg2; - msg.nextdirect = true; - msg = msg2; - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg2.seqname = "SAYAROMEROE"; - msg2.seqcnt = 1; - msg2.delay = 70; - msg.nextmsg = msg2; - msg.nextdirect = true; - break; - case SWWMDLG_CRANK1: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYACRANKA"; - msg.seqcnt = 1; - msg.delay = 30; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_CRANK2: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYACRANKB"; - msg.seqcnt = 2; - msg.delay = 20; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_CRANK3: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYACRANKC"; - msg.seqcnt = 1; - msg.delay = 80; - msg.startdelay = 50; - StatusBar.AttachMessage(msg,-1232); - break; - case SWWMDLG_CRANK4: - msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYACRANKD"; - msg.seqcnt = 1; - msg.delay = 40; - msg.startdelay = 40; - msg.enddelay = 80; - msg.chardelay = 5; - StatusBar.AttachMessage(msg,-1232); - break; - } - } - - static ui void StartSeq( int dlg ) - { - if ( swwm_nomapmsg ) return; - if ( dlg < SWWMDLG_MAW ) StartSeq_SubA(dlg); - else if ( dlg < SWWMDLG_GREET ) StartSeq_SubB(dlg); - else if ( dlg < SWWMDLG_FIGHTER ) StartSeq_SubC(dlg); - else if ( dlg < SWWMDLG_BLIGHT ) StartSeq_SubD(dlg); - else if ( dlg < SWWMDLG_PUZZLE1 ) StartSeq_SubE(dlg); - else if ( dlg < SWWMDLG_CHEATS ) StartSeq_SubF(dlg); - else if ( dlg < SWWMDLG_FOOL ) StartSeq_SubG(dlg); - else StartSeq_SubH(dlg); + ThrowAbortException("dialogue '%s', cursor past end of file.",dlg); } } diff --git a/zscript/hud/swwm_hud_messages.zsc b/zscript/hud/swwm_hud_messages.zsc index a2873af65..ee344fbd3 100644 --- a/zscript/hud/swwm_hud_messages.zsc +++ b/zscript/hud/swwm_hud_messages.zsc @@ -35,13 +35,13 @@ extend Class SWWMStatusBar { EventHandler.SendNetworkEvent("swwmkoraxline",0,consoleplayer); koraxline = true; - SWWMDialogues.StartSeq(SWWMDLG_GREET); + SWWMDialogues.StartSeq("GREET"); } else if ( msg == StringTable.Localize("$TXT_ACS_MAP13_11_MYSER") ) { EventHandler.SendNetworkEvent("swwmkoraxline",1,consoleplayer); koraxline = true; - SWWMDialogues.StartSeq(SWWMDLG_BLOOD); + SWWMDialogues.StartSeq("BLOOD"); } else if ( msg == StringTable.Localize("$TXT_ACS_MAP22_27_YOUHA") ) koraxline = true; @@ -49,7 +49,7 @@ extend Class SWWMStatusBar { EventHandler.SendNetworkEvent("swwmkoraxline",2,consoleplayer); koraxline = true; - SWWMDialogues.StartSeq(SWWMDLG_GAME); + SWWMDialogues.StartSeq("GAME"); } else if ( msg == StringTable.Localize("$TXT_ACS_MAP27_8_WORSH") ) koraxline = true; @@ -57,7 +57,7 @@ extend Class SWWMStatusBar { EventHandler.SendNetworkEvent("swwmkoraxline",3,consoleplayer); koraxline = true; - SWWMDialogues.StartSeq(SWWMDLG_WORSHIP); + SWWMDialogues.StartSeq("WORSHIP"); } else if ( msg == StringTable.Localize("$TXT_ACS_MAP35_12_AREYO") ) koraxline = true; @@ -65,7 +65,7 @@ extend Class SWWMStatusBar { EventHandler.SendNetworkEvent("swwmkoraxline",4,consoleplayer); koraxline = true; - SWWMDialogues.StartSeq(SWWMDLG_MASTERS); + SWWMDialogues.StartSeq("MASTERS"); } if ( koraxline ) { @@ -145,31 +145,31 @@ extend Class SWWMStatusBar switch ( puzzlecnt ) { case 1: - SWWMDialogues.StartSeq(SWWMDLG_PUZZLE1); + SWWMDialogues.StartSeq("PUZZLE1"); break; case 2: - SWWMDialogues.StartSeq(SWWMDLG_PUZZLE2); + SWWMDialogues.StartSeq("PUZZLE2"); break; case 3: - SWWMDialogues.StartSeq(SWWMDLG_PUZZLE3); + SWWMDialogues.StartSeq("PUZZLE3"); break; case 5: - SWWMDialogues.StartSeq(SWWMDLG_PUZZLE4); + SWWMDialogues.StartSeq("PUZZLE4"); break; case 8: - SWWMDialogues.StartSeq(SWWMDLG_PUZZLE5); + SWWMDialogues.StartSeq("PUZZLE5"); break; case 11: - SWWMDialogues.StartSeq(SWWMDLG_PUZZLE6); + SWWMDialogues.StartSeq("PUZZLE6"); break; case 20: - SWWMDialogues.StartSeq(SWWMDLG_PUZZLE7); + SWWMDialogues.StartSeq("PUZZLE7"); break; case 30: - SWWMDialogues.StartSeq(SWWMDLG_PUZZLE8); + SWWMDialogues.StartSeq("PUZZLE8"); break; case 31: - SWWMDialogues.StartSeq(SWWMDLG_PUZZLE9); + SWWMDialogues.StartSeq("PUZZLE9"); break; } } diff --git a/zscript/hud/swwm_hudextra.zsc b/zscript/hud/swwm_hudextra.zsc index d21bbf087..25487de1b 100644 --- a/zscript/hud/swwm_hudextra.zsc +++ b/zscript/hud/swwm_hudextra.zsc @@ -575,17 +575,23 @@ Class SWWMDirectMessage : HUDMessageBase // used to manually trigger dialogues // the AMBUSH flag means the dialogue only shows for the activator -Class SWWMDialogueTrigger : SWWMNonInteractiveActor +Class SWWMDialogueTrigger : SWWMNonInteractiveActor abstract { override void Activate( Actor activator ) { + // this is a huge gross hack that only exists because you can't get arg0str out of actors + // (primarily, because you can convert names to ints, but not viceversa) + String dlg = GetClassName(); + dlg.StripLeft("SWWMDialogueTrigger"); if ( !bAMBUSH || (activator && (activator.player == players[consoleplayer])) ) - EventHandler.SendInterfaceEvent(consoleplayer,"swwmsetdialogue",args[0]); + EventHandler.SendInterfaceEvent(consoleplayer,"swwmsetdialogue."..dlg); Destroy(); } override void Tick() {} } +Class SWWMDialogueTriggerGOTCHAEND : SWWMDialogueTrigger {} + // I'm just doing this as an experiment, don't mind me Class DSMapTitle : HUDMessageBase diff --git a/zscript/weapons/swwm_deepdarkimpact.zsc b/zscript/weapons/swwm_deepdarkimpact.zsc index fdf2f529b..f1726667b 100644 --- a/zscript/weapons/swwm_deepdarkimpact.zsc +++ b/zscript/weapons/swwm_deepdarkimpact.zsc @@ -316,7 +316,7 @@ Class DeepImpact : SWWMWeapon else return; invoker.wastecycle = 0; if ( player == players[consoleplayer] ) - EventHandler.SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_CRANK1+(s.deepegg-1)); + EventHandler.SendInterfaceEvent(consoleplayer,"swwmsetdialogue.CRANK"..1+(s.deepegg-1)); } override void MarkPrecacheSounds() diff --git a/zscript/weapons/swwm_thiccboolet.zsc b/zscript/weapons/swwm_thiccboolet.zsc index 3fadb252f..3e3dcda55 100644 --- a/zscript/weapons/swwm_thiccboolet.zsc +++ b/zscript/weapons/swwm_thiccboolet.zsc @@ -572,7 +572,7 @@ Class SilverBullet : SWWMWeapon else return; invoker.wastecycle = 0; if ( (s.silveregg > 2) && (s.silveregg%2) && (player == players[consoleplayer]) ) - EventHandler.SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_WASTE1+(((s.silveregg-1)/2)-1)); + EventHandler.SendInterfaceEvent(consoleplayer,"swwmsetdialogue.WASTE"..1+(((s.silveregg-1)/2)-1)); } action void A_DropMag() {