summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGarrett Cox <garrettjcox@gmail.com>2025-01-20 23:37:34 -0600
committerGarrett Cox <garrettjcox@gmail.com>2025-01-20 23:37:34 -0600
commit7b6d7ac9cd8cb3bce8dc06bf64b7a8a78e9eed1c (patch)
tree824b98f86fa4422db667ef216aaccf8147b23dc1
parent45104b9bf976393af13258b32c344d4f740ea186 (diff)
Add swamp & ocean spider house hints
-rw-r--r--mm/2s2h/Rando/ActorBehavior/ActorBehavior.cpp1
-rw-r--r--mm/2s2h/Rando/ActorBehavior/ActorBehavior.h1
-rw-r--r--mm/2s2h/Rando/ActorBehavior/EnSsh.cpp60
3 files changed, 62 insertions, 0 deletions
diff --git a/mm/2s2h/Rando/ActorBehavior/ActorBehavior.cpp b/mm/2s2h/Rando/ActorBehavior/ActorBehavior.cpp
index fb0affb58..158c23bfb 100644
--- a/mm/2s2h/Rando/ActorBehavior/ActorBehavior.cpp
+++ b/mm/2s2h/Rando/ActorBehavior/ActorBehavior.cpp
@@ -79,6 +79,7 @@ void Rando::ActorBehavior::OnFileLoad() {
Rando::ActorBehavior::InitEnSellnutsBehavior();
Rando::ActorBehavior::InitEnSiBehavior();
Rando::ActorBehavior::InitEnSob1Behavior();
+ Rando::ActorBehavior::InitEnSshBehavior();
Rando::ActorBehavior::InitEnStoneheishiBehavior();
Rando::ActorBehavior::InitEnSyatekiManBehavior();
Rando::ActorBehavior::InitEnTalkBehavior();
diff --git a/mm/2s2h/Rando/ActorBehavior/ActorBehavior.h b/mm/2s2h/Rando/ActorBehavior/ActorBehavior.h
index 408a7ae1c..80f334a22 100644
--- a/mm/2s2h/Rando/ActorBehavior/ActorBehavior.h
+++ b/mm/2s2h/Rando/ActorBehavior/ActorBehavior.h
@@ -57,6 +57,7 @@ void InitEnRzBehavior();
void InitEnSellnutsBehavior();
void InitEnSiBehavior();
void InitEnSob1Behavior();
+void InitEnSshBehavior();
void InitEnStoneheishiBehavior();
void InitEnSyatekiManBehavior();
void InitEnTalkBehavior();
diff --git a/mm/2s2h/Rando/ActorBehavior/EnSsh.cpp b/mm/2s2h/Rando/ActorBehavior/EnSsh.cpp
new file mode 100644
index 000000000..7468aa90a
--- /dev/null
+++ b/mm/2s2h/Rando/ActorBehavior/EnSsh.cpp
@@ -0,0 +1,60 @@
+#include "ActorBehavior.h"
+#include <libultraship/libultraship.h>
+#include "2s2h/GameInteractor/GameInteractor.h"
+#include "2s2h/ShipUtils.h"
+
+extern "C" {
+#include "variables.h"
+#include "functions.h"
+}
+
+void ApplySwampSpiderHouseHint(u16* textId, bool* loadFromMessageTable) {
+ CustomMessage::Entry entry = {
+ .msg = "Make me...normal again...I'll give you %g{{article}}{{item}}%w...Please...help me...\xE0",
+ };
+
+ auto& randoStaticItem =
+ Rando::StaticData::Items[RANDO_SAVE_CHECKS[RC_SWAMP_SPIDER_HOUSE_MASK_OF_TRUTH].randoItemId];
+
+ if (!Ship_IsCStringEmpty(randoStaticItem.article)) {
+ CustomMessage::Replace(&entry.msg, "{{article}}", std::string(randoStaticItem.article) + " ");
+ } else {
+ CustomMessage::Replace(&entry.msg, "{{article}}", "");
+ }
+
+ CustomMessage::Replace(&entry.msg, "{{item}}", randoStaticItem.name);
+
+ CustomMessage::LoadCustomMessageIntoFont(entry);
+ *loadFromMessageTable = false;
+}
+
+void ApplyOceanSpiderHouseHint(u16* textId, bool* loadFromMessageTable) {
+ CustomMessage::Entry entry = {
+ .msg = "Huh? How'd I get up here... Why do I have %g{{article}}{{item}}%w in my pocket...?\xE0",
+ };
+
+ auto& randoStaticItem = Rando::StaticData::Items[RANDO_SAVE_CHECKS[RC_OCEAN_SPIDER_HOUSE_WALLET].randoItemId];
+
+ if (!Ship_IsCStringEmpty(randoStaticItem.article)) {
+ CustomMessage::Replace(&entry.msg, "{{article}}", std::string(randoStaticItem.article) + " ");
+ } else {
+ CustomMessage::Replace(&entry.msg, "{{article}}", "");
+ }
+
+ CustomMessage::Replace(&entry.msg, "{{item}}", randoStaticItem.name);
+
+ CustomMessage::LoadCustomMessageIntoFont(entry);
+ *loadFromMessageTable = false;
+}
+
+void Rando::ActorBehavior::InitEnSshBehavior() {
+ // "Recruiting Soldiers..." Posters around Clock Town
+ COND_ID_HOOK(OnOpenText, 0x915, IS_RANDO, ApplySwampSpiderHouseHint);
+ COND_ID_HOOK(OnOpenText, 0x1130, IS_RANDO, ApplyOceanSpiderHouseHint);
+ COND_ID_HOOK(OnOpenText, 0x1131, IS_RANDO, ApplyOceanSpiderHouseHint);
+
+ COND_ID_HOOK(ShouldActorInit, ACTOR_EN_SSH, IS_RANDO, [](Actor* actor, bool* should) {
+ // Skip first dialog
+ SET_WEEKEVENTREG(WEEKEVENTREG_TALKED_SWAMP_SPIDER_HOUSE_MAN);
+ });
+}