summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/bossPlayerClown.cpp27
-rw-r--r--src/bossRamboo.cpp2
-rw-r--r--src/challengeStar.cpp25
-rw-r--r--src/effectvideo.cpp29
-rw-r--r--src/fakeStarCoin.cpp12
-rw-r--r--src/levelspecial.cpp2
-rw-r--r--src/shyguy.cpp6
-rwxr-xr-xsrc/spritespawner.cpp2
-rw-r--r--src/topman.cpp2
9 files changed, 78 insertions, 29 deletions
diff --git a/src/bossPlayerClown.cpp b/src/bossPlayerClown.cpp
index afa8c3e..e828336 100644
--- a/src/bossPlayerClown.cpp
+++ b/src/bossPlayerClown.cpp
@@ -8,32 +8,44 @@
#define CLOWN_MODEL(clown) ((m3d::mdl_c*)( ((u32)(clown)) + 0xFD0 ))
-dEn_c *newClownCtor(dEn_c *clown);
-void newClownDtor(dEn_c *clown, u32 willDelete);
+extern "C" void *PClownCarExecute(dEn_c *clown);
+extern "C" void *PClownCarAfterCreate(dEn_c *clown, u32);
+extern "C" void *PClownCarDraw(dEn_c *clown);
+extern "C" void *PClownCarMove(dEn_c *clown);
void CConDraw(dEn_c *clown) {
// setup matrices
- CLOWN_MODEL(clown)->scheduleForDrawing();
+ OSReport("Drawing");
+ // CLOWN_MODEL(clown)->scheduleForDrawing();
+ PClownCarDraw(clown);
// run normal clown function
}
void CConExecute(dEn_c *clown) {
+ OSReport("Executing");
+
+ PClownCarExecute(clown);
// run normal execute
}
void CCafterCreate(dEn_c *clown) {
- clown->scale.x = clown->scale.x * 1.25;
- clown->scale.y = clown->scale.y * 1.25;
- clown->scale.z = clown->scale.z * 1.25;
+ OSReport("Creating");
+
+ clown->scale.x *= 1.25;
+ clown->scale.y *= 1.25;
+ clown->scale.z *= 1.25;
// setup the model
- // dEn_c::afterCreate(1);
+ PClownCarAfterCreate(clown, 1);
}
void CConExecuteMove(dEn_c *clown) {
+ OSReport("Moving");
+
// run normal move
+ PClownCarMove(clown);
// check for wiimote button presses
@@ -45,6 +57,7 @@ extern "C" m3d::mdl_c *__ct__Q23m3d5mdl_cFv(m3d::mdl_c *mdl);
extern "C" dEn_c *__ct__20daJrClownForPlayer_cFv(dEn_c *clown);
dEn_c *newClownCtor(dEn_c *clown) {
+ OSReport("ctor");
__ct__20daJrClownForPlayer_cFv(clown);
__ct__Q23m3d5mdl_cFv(CLOWN_MODEL(clown));
return clown;
diff --git a/src/bossRamboo.cpp b/src/bossRamboo.cpp
index 0c36f04..c12b709 100644
--- a/src/bossRamboo.cpp
+++ b/src/bossRamboo.cpp
@@ -92,7 +92,7 @@ void daRamboo_c::collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysic
doStateChange(&StateID_Flee);
//FIXME changed to dStageActor_c::Delete(u8) from fBase_c::Delete(void)
- apOther->owner->Delete(apOther->owner->_390);
+ apOther->owner->Delete(1);
}
}
void daRamboo_c::collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics *apOther) { }
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();
diff --git a/src/effectvideo.cpp b/src/effectvideo.cpp
index 98e2dcd..f8561ea 100644
--- a/src/effectvideo.cpp
+++ b/src/effectvideo.cpp
@@ -93,6 +93,35 @@ int EffectVideo::onExecute() {
SpawnEffect("Wm_en_kuribobigsplit", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){this->scale, this->scale, this->scale});
break;
+
+ case 514:
+ SpawnEffect("Wm_ob_fireworks_y", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){this->scale, this->scale, this->scale});
+ break;
+
+ case 517:
+ SpawnEffect("Wm_ob_fireworks_b", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){this->scale, this->scale, this->scale});
+ break;
+
+ case 520:
+ SpawnEffect("Wm_ob_fireworks_g", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){this->scale, this->scale, this->scale});
+ break;
+
+ case 523:
+ SpawnEffect("Wm_ob_fireworks_p", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){this->scale, this->scale, this->scale});
+ break;
+
+ case 526:
+ SpawnEffect("Wm_ob_fireworks_k", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){this->scale, this->scale, this->scale});
+ break;
+
+ case 533:
+ SpawnEffect("Wm_ob_fireworks_1up", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){this->scale, this->scale, this->scale});
+ break;
+
+ case 540:
+ SpawnEffect("Wm_ob_fireworks_star", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){this->scale, this->scale, this->scale});
+ break;
+
default:
break;
}
diff --git a/src/fakeStarCoin.cpp b/src/fakeStarCoin.cpp
index 9dcbad3..b69e039 100644
--- a/src/fakeStarCoin.cpp
+++ b/src/fakeStarCoin.cpp
@@ -44,7 +44,7 @@ void daFakeStarCoin::playerCollision(ActivePhysics *apThis, ActivePhysics *apOth
SpawnEffect("Wm_en_obakedoor", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0});
//FIXME changed to dStageActor_c::Delete(u8) from fBase_c::Delete(void)
- this->Delete(this->_390);
+ this->Delete(1);
}
void daFakeStarCoin::collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, ActivePhysics *apOther) {
@@ -54,7 +54,7 @@ void daFakeStarCoin::collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, A
PlaySound(this, SE_OBJ_EMY_FIRE_DISAPP);
//FIXME changed to dStageActor_c::Delete(u8) from fBase_c::Delete(void)
- this->Delete(this->_390);
+ this->Delete(1);
}
bool daFakeStarCoin::collisionCat2_IceBall_15_YoshiIce(ActivePhysics *apThis, ActivePhysics *apOther) {
SpawnEffect("Wm_ob_cmnicekira", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){1.5, 1.5, 1.5});
@@ -64,7 +64,7 @@ bool daFakeStarCoin::collisionCat2_IceBall_15_YoshiIce(ActivePhysics *apThis, Ac
PlaySound(this, SE_OBJ_PNGN_ICE_BREAK);
//FIXME changed to dStageActor_c::Delete(u8) from fBase_c::Delete(void)
- this->Delete(this->_390);
+ this->Delete(1);
return false;
}
void daFakeStarCoin::collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysics *apOther) {
@@ -74,7 +74,7 @@ void daFakeStarCoin::collisionCat9_RollingObject(ActivePhysics *apThis, ActivePh
PlaySound(this, SE_BOSS_JR_FLOOR_BREAK);
//FIXME changed to dStageActor_c::Delete(u8) from fBase_c::Delete(void)
- this->Delete(this->_390);
+ this->Delete(1);
}
void daFakeStarCoin::collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics *apOther) {
SpawnEffect("Wm_ob_cmnboxgrain", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0});
@@ -83,7 +83,7 @@ void daFakeStarCoin::collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics
PlaySound(this, SE_BOSS_JR_FLOOR_BREAK);
//FIXME changed to dStageActor_c::Delete(u8) from fBase_c::Delete(void)
- this->Delete(this->_390);
+ this->Delete(1);
}
void daFakeStarCoin::collisionCat14_YoshiFire(ActivePhysics *apThis, ActivePhysics *apOther) {
SpawnEffect("Wm_en_explosion", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0});
@@ -92,7 +92,7 @@ void daFakeStarCoin::collisionCat14_YoshiFire(ActivePhysics *apThis, ActivePhysi
PlaySound(this, SE_OBJ_EMY_FIRE_DISAPP);
//FIXME changed to dStageActor_c::Delete(u8) from fBase_c::Delete(void)
- this->Delete(this->_390);
+ this->Delete(1);
}
diff --git a/src/levelspecial.cpp b/src/levelspecial.cpp
index f57e14a..dc503e0 100644
--- a/src/levelspecial.cpp
+++ b/src/levelspecial.cpp
@@ -42,6 +42,7 @@ extern float GlobalSpriteSpeed;
extern float GlobalRiderSize;
extern char SizerOn;
extern char ZOrderOn;
+extern int GlobalStarsCollected;
float GlobalSizeFloatModifications [] = {1, 0.25, 0.5, 0.75, 1.25, 1.5, 1.75, 2, 2.5, 3, 4, 5, 6, 7, 8, 10 };
@@ -75,6 +76,7 @@ bool ResetAfterLevel(void) {
AlwaysDrawFlag = 0x9421FFF0;
AlwaysDrawBranch = 0x7C0802A6;
ZOrderOn = 0;
+ GlobalStarsCollected = 0;
return true;
}
diff --git a/src/shyguy.cpp b/src/shyguy.cpp
index acee2f6..5679e49 100644
--- a/src/shyguy.cpp
+++ b/src/shyguy.cpp
@@ -1121,7 +1121,7 @@ void daShyGuy::updateModelMatrices() {
// if (this->spikeA != 0) {
// PlaySound(spikeA, SE_OBJ_ROCK_S_CRASH);
// CreateEffect(&(Vec){this->spikeA->pos.x, this->spikeA->pos.y, 5500.0}, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 9);
- // this->spikeA->Delete(this->spikeA->_390);
+ // this->spikeA->Delete(this->spikeA->deleteForever);
// }
// this->spikeA = spawned;
// spikeTurn = 1;
@@ -1130,7 +1130,7 @@ void daShyGuy::updateModelMatrices() {
// if (this->spikeB != 0) {
// PlaySound(spikeB, SE_OBJ_ROCK_S_CRASH);
// CreateEffect(&(Vec){this->spikeB->pos.x, this->spikeB->pos.y, 5500.0}, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 9);
- // this->spikeB->Delete(this->spikeB->_390);
+ // this->spikeB->Delete(this->spikeB->deleteForever);
// }
// this->spikeB = spawned;
// spikeTurn = 0;
@@ -1434,7 +1434,7 @@ void daShyGuy::updateModelMatrices() {
if (this->timer > 450) {
this->kill();
- this->Delete(1);
+ this->Delete(this->deleteForever);
}
// dEn_c::dieFall_Execute();
diff --git a/src/spritespawner.cpp b/src/spritespawner.cpp
index ebfe7a9..56ac383 100755
--- a/src/spritespawner.cpp
+++ b/src/spritespawner.cpp
@@ -93,7 +93,7 @@ void SpriteSpawner_Update(SpriteSpawner *self) {
self->y = spawned->pos.y;
self->z = spawned->pos.z;
//FIXME changed to add dStageActor_c's Delete(u8) instead of fBase_c's Delete(void)
- spawned->Delete(spawned->_390);
+ spawned->Delete(1);
}
self->createdActor = 0;
}
diff --git a/src/topman.cpp b/src/topman.cpp
index fccbb0f..42527e2 100644
--- a/src/topman.cpp
+++ b/src/topman.cpp
@@ -508,7 +508,7 @@ void daTopman::updateModelMatrices() {
PlaySound(this, SE_EMY_MECHAKOOPA_DAMAGE);
if(this->chrAnimation.isAnimationDone()) {
this->kill();
- this->Delete(1);
+ this->Delete(this->deleteForever);
}
}
void daTopman::endState_Die() { }