diff options
Diffstat (limited to '')
-rw-r--r-- | src/challengeStar.cpp | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/challengeStar.cpp b/src/challengeStar.cpp index fc710d4..97c4364 100644 --- a/src/challengeStar.cpp +++ b/src/challengeStar.cpp @@ -5,6 +5,8 @@ extern "C" void *PlaySound(dEn_c *, int soundID); +extern "C" void *PlaySoundAsync(dStageActor_c *, int soundID); + extern "C" bool SpawnEffect(const char*, int, Vec*, S16Vec*, Vec*); extern int GlobalStarsCollected; @@ -39,16 +41,18 @@ class dChallengeStar : public dEn_c { void dChallengeStar::playerCollision(ActivePhysics *apThis, ActivePhysics *apOther) { - PlaySound(this, SE_OBJ_BROOM_KEY_SHOW); + PlaySoundAsync(this, SE_OBJ_BROOM_KEY_SHOW); SpawnEffect("Wm_ob_greencoinkira_a", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){0.8, 0.8, 0.8}); GlobalStarsCollected++; if (GlobalStarsCollected == 50) { GlobalStarsCollected = 0; - EventTable->events = EventTable->events | this->eventFlag; + EventTable->events |= this->eventFlag; + OSReport("50 collected, triggered Event!\n"); } - this->Delete(this->_390); + OSReport("%d Stars Collected\n", GlobalStarsCollected); + this->Delete(1); } void dChallengeStar::yoshiCollision(ActivePhysics *apThis, ActivePhysics *apOther) { this->playerCollision(apThis, apOther); } @@ -63,7 +67,6 @@ dChallengeStar *dChallengeStar::build() { int dChallengeStar::onCreate() { - OSReport("Creating a star collectable\n"); allocator.link(-1, GameHeaps[0], 0, 0x20); nw4r::g3d::ResFile rf(getResource("I_star", "g3d/I_star.brres")); @@ -74,9 +77,9 @@ int dChallengeStar::onCreate() { ActivePhysics::Info HitMeBaby; HitMeBaby.xDistToCenter = 0.0; - HitMeBaby.yDistToCenter = -3.0; - HitMeBaby.xDistToEdge = 4.0; - HitMeBaby.yDistToEdge = 4.0; + HitMeBaby.yDistToCenter = -4.0; + HitMeBaby.xDistToEdge = 6.0; + HitMeBaby.yDistToEdge = 6.0; HitMeBaby.category1 = 0x5; HitMeBaby.category2 = 0x0; HitMeBaby.bitfield1 = 0x4F; @@ -90,10 +93,12 @@ int dChallengeStar::onCreate() { char eventNum = (this->settings >> 24) & 0xFF; this->eventFlag = (u64)1 << (eventNum - 1); - this->scale.x = 0.5; - this->scale.y = 0.5; - this->scale.z = 0.5; + this->scale.x = 0.70; + this->scale.y = 0.70; + this->scale.z = 0.70; + this->pos.x = 8.0; + this->pos.y -= 14.0; this->pos.z = 3300.0; this->onExecute(); |