summaryrefslogtreecommitdiff
path: root/src/palaceDude.cpp
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2012-09-15 23:39:54 +0200
committerTreeki <treeki@gmail.com>2012-09-15 23:39:54 +0200
commitcb5dcc681f1f41322d3b649902e90133d277c857 (patch)
tree2255a7aa424af66b023b9698dd41e1506442e3cf /src/palaceDude.cpp
parentd03b7871950f89623f1f90facde2f5df89e9e136 (diff)
downloadkamek-cb5dcc681f1f41322d3b649902e90133d277c857.tar.gz
kamek-cb5dcc681f1f41322d3b649902e90133d277c857.zip
added unfinished PalaceDude
Diffstat (limited to '')
-rw-r--r--src/palaceDude.cpp50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/palaceDude.cpp b/src/palaceDude.cpp
new file mode 100644
index 0000000..eff3299
--- /dev/null
+++ b/src/palaceDude.cpp
@@ -0,0 +1,50 @@
+#include <game.h>
+#include <stage.h>
+#include "msgbox.h"
+
+class dPalaceDude_c : public dStageActor_c {
+ public:
+ static dPalaceDude_c *build();
+
+ bool hasBeenActivated;
+ bool hasExitedStage;
+ int onExecute();
+};
+
+/*****************************************************************************/
+// Glue Code
+dPalaceDude_c *dPalaceDude_c::build() {
+ void *buffer = AllocFromGameHeap1(sizeof(dPalaceDude_c));
+ dPalaceDude_c *c = new(buffer) dPalaceDude_c;
+ return c;
+}
+
+
+int dPalaceDude_c::onExecute() {
+ if (dFlagMgr_c::instance->flags & spriteFlagMask) {
+ if (hasBeenActivated)
+ return true;
+ //OSReport("Activating Palace Dude\n");
+ hasBeenActivated = true;
+
+ dMsgBoxManager_c::instance->showMessage(settings & 0xFFFFFFF);
+
+ SaveBlock *save = GetSaveFile()->GetBlock(-1);
+ save->switch_on |= (1 << (settings >> 28));
+ }
+
+ if (hasBeenActivated) {
+ if (hasExitedStage)
+ return true;
+ //OSReport("Palace Dude is activated, %d\n", dMsgBoxManager_c::instance->visible);
+ if (!dMsgBoxManager_c::instance->visible) {
+ ExitStage(WORLD_MAP, 0, BEAT_LEVEL, MARIO_WIPE);
+ hasExitedStage = true;
+ }
+ }
+
+ return true;
+
+}
+
+