summaryrefslogtreecommitdiff
path: root/src/bonusRoom.cpp
diff options
context:
space:
mode:
authorColin Noga <Tempus@chronometry.ca>2012-07-16 15:18:58 -0500
committerColin Noga <Tempus@chronometry.ca>2012-07-16 15:18:58 -0500
commit5ad897fb987c7e80ac948cf080122a0081a255de (patch)
treede31190d6498860abc90dd56e374f66dcfe9f03e /src/bonusRoom.cpp
parent85ffcf8e57ab7a90318b8e24f62257b5393f7330 (diff)
downloadkamek-5ad897fb987c7e80ac948cf080122a0081a255de.tar.gz
kamek-5ad897fb987c7e80ac948cf080122a0081a255de.zip
Samurai Shy is in beta, added Song Block as a sprite, a few minor boss fixes.
Diffstat (limited to '')
-rw-r--r--src/bonusRoom.cpp31
1 files changed, 29 insertions, 2 deletions
diff --git a/src/bonusRoom.cpp b/src/bonusRoom.cpp
index 8242d43..2b0144d 100644
--- a/src/bonusRoom.cpp
+++ b/src/bonusRoom.cpp
@@ -432,6 +432,8 @@ public:
int isGlowing;
int glowTimer;
int isDead;
+ int standAlone;
+ int item;
void calledWhenUpMoveExecutes();
void calledWhenDownMoveExecutes();
@@ -917,7 +919,9 @@ dSongBlock *dSongBlock::build() {
int dSongBlock::onCreate() {
// Settings
- this->note = this->settings;
+ this->note = this->settings & 0xF;
+ this->standAlone = (this->settings >> 4) & 0xF;
+ this->item = (this->settings >> 16) & 0xFF;
// Model creation
allocator.link(-1, GameHeaps[0], 0, 0x20);
@@ -1067,7 +1071,30 @@ void dSongBlock::blockWasHit(bool isDown) {
SpawnEffect("Wm_en_vshit_ring", 0, &(Vec){pos.x, pos.y+8.0, pos.z-100.0}, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0});
SpawnEffect("Wm_ob_keyget02_lighit", 0, &(Vec){pos.x, pos.y+8.0, pos.z-100.0}, &(S16Vec){0,0,0}, &(Vec){0.5, 0.5, 0.5});
- dSingAlong::instance->RegisterNote(this->note);
+ if (item > 0) {
+ create(EN_ITEM, item, &(Vec){pos.x, pos.y, pos.z}, &rot, 0);
+ }
+
+ if (standAlone) {
+
+ int play;
+ // C, C#, D, D#, E, F, F#, G, G#, A, A#, B
+
+ if (note == 0) { play = 12; }
+ else if (note == 1) { play = 12; }
+ else if (note == 2) { play = 14; }
+ else if (note == 3) { play = 16; }
+ else if (note == 4) { play = 17; }
+ else if (note == 5) { play = 19; }
+ else if (note == 6) { play = 21; }
+ else if (note == 7) { play = 23; }
+ else if (note == 8) { play = 0; }
+
+ PlaySoundAsync(this, Notes[play]);
+ }
+ else {
+ dSingAlong::instance->RegisterNote(this->note);
+ }
physics.setup(this, &physicsInfo, 3, currentLayerID);
physics.addToList();