summaryrefslogtreecommitdiff
path: root/src/koopatlas
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2013-01-28 02:46:50 +0100
committerTreeki <treeki@gmail.com>2013-01-28 02:46:50 +0100
commit876f0b3e500c3b60c6d69b3d3abbfe3b29837201 (patch)
tree6f917fd5ca452ee091675b77558a934dabae5c7b /src/koopatlas
parentf6ff7ca41f6e9b496a03e05e2ae053481add2a9f (diff)
downloadkamek-876f0b3e500c3b60c6d69b3d3abbfe3b29837201.tar.gz
kamek-876f0b3e500c3b60c6d69b3d3abbfe3b29837201.zip
implement the Konami Code into Newer
Diffstat (limited to '')
-rw-r--r--src/koopatlas/starcoin.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/koopatlas/starcoin.cpp b/src/koopatlas/starcoin.cpp
index 24176f5..a0def97 100644
--- a/src/koopatlas/starcoin.cpp
+++ b/src/koopatlas/starcoin.cpp
@@ -365,10 +365,21 @@ void dWMStarCoin_c::beginState_Hidden() { }
void dWMStarCoin_c::executeState_Hidden() { }
void dWMStarCoin_c::endState_Hidden() { }
+static const int secretCode[] = {
+ WPAD_UP,WPAD_UP,WPAD_DOWN,WPAD_DOWN,
+ WPAD_LEFT,WPAD_RIGHT,WPAD_LEFT,WPAD_RIGHT,
+ WPAD_ONE,WPAD_TWO,0
+};
+static const int secretCodeButtons = WPAD_UP|WPAD_DOWN|WPAD_LEFT|WPAD_RIGHT|WPAD_ONE|WPAD_TWO;
+static int secretCodeIndex = 0;
+extern bool enableDebugMode;
+
void dWMStarCoin_c::beginState_ShowWait() {
visible = true;
loadInfo();
layout.enableNonLoopAnim(SHOW_ALL);
+
+ secretCodeIndex = 0;
}
void dWMStarCoin_c::executeState_ShowWait() {
if (!layout.isAnimOn(SHOW_ALL))
@@ -395,6 +406,22 @@ void dWMStarCoin_c::beginState_Wait() { }
void dWMStarCoin_c::executeState_Wait() {
int nowPressed = Remocon_GetPressed(GetActiveRemocon());
+ if (nowPressed & secretCodeButtons) {
+ int nextKey = secretCode[secretCodeIndex];
+ if (nowPressed & nextKey) {
+ secretCodeIndex++;
+ if (secretCode[secretCodeIndex] == 0) {
+ secretCodeIndex = 0;
+ MapSoundPlayer(SoundRelatedClass, SE_VOC_MA_THANK_YOU, 1);
+ enableDebugMode = !enableDebugMode;
+ OSReport("Debug mode toggled!\n");
+ }
+ return;
+ } else {
+ secretCodeIndex = 0;
+ }
+ }
+
if (nowPressed & WPAD_ONE) {
MapSoundPlayer(SoundRelatedClass, SE_SYS_DIALOGUE_OUT_AUTO, 1);
willExit = true;