summaryrefslogtreecommitdiff
path: root/src/challengeStar.cpp
diff options
context:
space:
mode:
authorColin Noga <Tempus@chronometry.ca>2012-03-22 18:43:21 -0500
committerColin Noga <Tempus@chronometry.ca>2012-03-22 18:43:21 -0500
commit0ae957fcb9d1cb69602bf937c5111a184c3fbc79 (patch)
treeecac5435b445fd3ce7fa8f45b90920a85eb9ae95 /src/challengeStar.cpp
parentc6becbea298ed12b34f8ad6365e1db0a2870e3e7 (diff)
downloadkamek-0ae957fcb9d1cb69602bf937c5111a184c3fbc79.tar.gz
kamek-0ae957fcb9d1cb69602bf937c5111a184c3fbc79.zip
simple updates to challenge collectible and the clown car
Diffstat (limited to 'src/challengeStar.cpp')
-rw-r--r--src/challengeStar.cpp17
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;
}