diff options
Diffstat (limited to 'src/challengeStar.cpp')
-rw-r--r-- | src/challengeStar.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/challengeStar.cpp b/src/challengeStar.cpp index 1f9c91a..dda35cc 100644 --- a/src/challengeStar.cpp +++ b/src/challengeStar.cpp @@ -8,6 +8,7 @@ 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 "C" dStageActor_c* GetSpecificPlayerActor(int number); extern int GlobalStarsCollected; @@ -47,11 +48,10 @@ void dChallengeStar::playerCollision(ActivePhysics *apThis, ActivePhysics *apOth 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; + GlobalStarsCollected--; + if (GlobalStarsCollected == 0) { EventTable->events |= this->eventFlag; - OSReport("50 collected, triggered Event!\n"); + OSReport("All stars spawned collected, triggered Event!\n"); } OSReport("%d Stars Collected\n", GlobalStarsCollected); @@ -73,9 +73,14 @@ dChallengeStar *dChallengeStar::build() { int dChallengeStar::onCreate() { + char die = this->settings & 0xF; + if (GetSpecificPlayerActor(die) == 0) { this->Delete(1); } + + GlobalStarsCollected++; + allocator.link(-1, GameHeaps[0], 0, 0x20); - nw4r::g3d::ResFile rf(getResource("I_star", "g3d/I_star.brres")); + nw4r::g3d::ResFile rf(getResource("I_star", "g3d/silver_star.brres")); bodyModel.setup(rf.GetResMdl("I_star"), &allocator, 0x224, 1, 0); SetupTextures_Map(&bodyModel, 0); @@ -134,7 +139,7 @@ void dChallengeStar::updateModelMatrices() { int dChallengeStar::onExecute() { updateModelMatrices(); - effect.spawn("Wm_ob_keyget02_kira", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}); + effect.spawn("Wm_ob_keyget02_kira", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){0.8, 0.8, 0.8}); this->rot.y += 0x200; return true; } |