Merge pull request #653 from jherediagu/fix/oak-intro-name-confirmation

This commit is contained in:
bryanthaboi
2026-08-02 13:11:51 -04:00
committed by GitHub
2 changed files with 20 additions and 3 deletions
+16
View File
@@ -56,6 +56,8 @@ local FALLBACKS = {
_OakSpeechText3 = Strings.source("{PLAYER}!\fYour very own\nPOKéMON legend is\vabout to unfold!\fA world of dreams\nand adventures\vwith POKéMON\vawaits! Let's go!"), _OakSpeechText3 = Strings.source("{PLAYER}!\fYour very own\nPOKéMON legend is\vabout to unfold!\fA world of dreams\nand adventures\vwith POKéMON\vawaits! Let's go!"),
_IntroducePlayerText = Strings.source("First, what is\nyour name?"), _IntroducePlayerText = Strings.source("First, what is\nyour name?"),
_IntroduceRivalText = Strings.source("This is my grand-\nson. He's been\vyour rival since\vyou were a baby.\f...Erm, what is\nhis name again?"), _IntroduceRivalText = Strings.source("This is my grand-\nson. He's been\vyour rival since\vyou were a baby.\f...Erm, what is\nhis name again?"),
_YourNameIsText = Strings.source("Right! So your\nname is {PLAYER}!"),
_HisNameIsText = Strings.source("That's right! I\nremember now! His\vname is {RIVAL}!"),
} }
local function textOr(game, key) local function textOr(game, key)
@@ -162,6 +164,14 @@ function OakSpeech.defaultSteps(speech)
presetsWho = "player", presetsWho = "player",
presetsFallback = { "RED", "ASH", "JACK" }, presetsFallback = { "RED", "ASH", "JACK" },
}, },
{
-- oak_speech.asm prints YourNameIsText right after the naming screen
-- returns ("Right! So your name is RED!"); the port went straight on
-- to the rival and dropped it, in every language.
id = "confirm_player_name",
kind = "say",
textKey = "_YourNameIsText",
},
{ {
id = "ask_rival_name", id = "ask_rival_name",
kind = "say", kind = "say",
@@ -176,6 +186,12 @@ function OakSpeech.defaultSteps(speech)
presetsWho = "rival", presetsWho = "rival",
presetsFallback = { "BLUE", "GARY", "JOHN" }, presetsFallback = { "BLUE", "GARY", "JOHN" },
}, },
{
-- HisNameIsText, the rival's counterpart to the confirmation above
id = "confirm_rival_name",
kind = "say",
textKey = "_HisNameIsText",
},
{ {
id = "legend", id = "legend",
kind = "say", kind = "say",
+4 -3
View File
@@ -779,8 +779,9 @@ check(oak.demoSpecies == "NIDORINO" and oak.nameLen == 7,
-- ------- intro.oak_speech.build -- ------- intro.oak_speech.build
local vanillaSteps = OakSpeech.defaultSteps(oak) local vanillaSteps = OakSpeech.defaultSteps(oak)
check(#vanillaSteps == 9, "vanilla speech has nine steps") check(#vanillaSteps == 11, "vanilla speech has eleven steps")
check(vanillaSteps[1].id == "oak_welcome" and vanillaSteps[9].id == "shrink", check(vanillaSteps[1].id == "oak_welcome"
and vanillaSteps[#vanillaSteps].id == "shrink",
"vanilla speech anchors start and end") "vanilla speech anchors start and end")
hooks:wrap("intro.oak_speech.build", function(nextFn, steps, speech) hooks:wrap("intro.oak_speech.build", function(nextFn, steps, speech)
@@ -799,7 +800,7 @@ hooks:removeOwner("fixture")
hooks:wrap("intro.oak_speech.build", function() return 42 end, 0, "bad") hooks:wrap("intro.oak_speech.build", function() return 42 end, 0, "bad")
built = oak:buildSteps() built = oak:buildSteps()
check(#built == 9 and built[1].id == "oak_welcome", check(#built == #vanillaSteps and built[1].id == "oak_welcome",
"a non-table intro.oak_speech.build result degrades to vanilla") "a non-table intro.oak_speech.build result degrades to vanilla")
check(logged("intro.oak_speech.build returned"), check(logged("intro.oak_speech.build returned"),
"the intro build degrade is logged") "the intro build degrade is logged")