summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xinclude/stage.h59
-rw-r--r--kamek_pal.x5
-rw-r--r--soundPlayer.yaml1
-rw-r--r--src/bossFuzzyBear.cpp156
-rw-r--r--src/bossRamboo.cpp1
-rw-r--r--src/soundPlayer.S13
6 files changed, 191 insertions, 44 deletions
diff --git a/include/stage.h b/include/stage.h
index c89c7dc..39d1349 100755
--- a/include/stage.h
+++ b/include/stage.h
@@ -57,7 +57,66 @@ enum StageGroup {
Peach = 10,
Invalid = 11
};
+
+
+//enum SceneTypes {
+// BOOT = 0,
+// AUTO_SELECT = 1,
+// SELECT = 2,
+// WORLD_MAP = 3, *
+// WORLD_9_DEMO = 4,
+// STAGE = 5,
+// RESTART_CRSIN = 6, *
+// CRSIN = 7,
+// MOVIE = 8, *
+// GAMEOVER = 9,
+// GAME_SETUP = 10, *
+// MULTI_PLAY_COURSE_SELECT = 11
+//}
+
+
+enum SceneParameters {
+ SOMETHING_TODO_WITH_MOVIE = 1,
+ SOMETHING_TODO_WITH_MOVIE2 = 2,
+ SOMETHING_TODO_WITH_MOVIE3 = 3
+};
+
+enum PowerupStoreTypes {
+ BEAT_LEVEL = 0, // Keeps powerups
+ EXIT_LEVEL = 1, // Loses powerups, resets to previous state
+ LOSE_LEVEL = 2 // Loses everything
+};
+
+
+enum Wipes {
+ FADE_OUT = 0,
+ CIRCLE_WIPE = 1,
+ BOWSER_WIPE = 2,
+ GOO_WIPE_DOWN = 3,
+ MARIO_WIPE = 4,
+ CIRCLE_WIPE_SLOW = 5,
+ GLITCH_GASM = 6
+};
+
+
+void ExitStage(int scene, int sceneParams, int powerupStoreType, int wipe);
+
#endif
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/kamek_pal.x b/kamek_pal.x
index d804d25..4633975 100644
--- a/kamek_pal.x
+++ b/kamek_pal.x
@@ -43,9 +43,10 @@ SECTIONS {
AnotherSoundRelatedFunction = 0x80198040;
YetAnotherSoundPlayer = 0x80199100;
CheckIfPlayingSound = 0x80196740;
- StopSoundBasic = 0x801955E0;
RelatedToPlayingSoundsAlongsideAnims = 0x80105350;
+ ExitStage__Fiiii = 0x80102370;
+
applyRotationX__4mMtxFPs = 0x8016EDF0;
applyRotationZ__4mMtxFPs = 0x8016F030;
@@ -1142,6 +1143,8 @@ SECTIONS {
SoundClassRelated = 0x8042a03c;
BufferToCheckIfPlaying = 0x8042a768;
+ StopSoundBasic = 0x801955E0;
+ StopSoundRelated = 0x80196050;
GetHermiteCurveValue = 0x8017d660;
GetHermiteCurveValue__FfP10HermiteKeyUi = 0x8017d660;
diff --git a/soundPlayer.yaml b/soundPlayer.yaml
index da07649..29bb94f 100644
--- a/soundPlayer.yaml
+++ b/soundPlayer.yaml
@@ -1,5 +1,4 @@
---
-# Replaces EN_WALLINSECT
source_files: [../src/soundPlayer.S]
hooks:
diff --git a/src/bossFuzzyBear.cpp b/src/bossFuzzyBear.cpp
index 8d106ca..7ad7dcd 100644
--- a/src/bossFuzzyBear.cpp
+++ b/src/bossFuzzyBear.cpp
@@ -2,9 +2,11 @@
#include <game.h>
#include <g3dhax.h>
#include <sfx.h>
+#include <stage.h>
#include "effects.h"
#include "player.h"
+
class daFuzzyBear_c : public dEn_c {
int onCreate();
int onDelete();
@@ -13,6 +15,8 @@ class daFuzzyBear_c : public dEn_c {
mHeapAllocator_c allocator;
m3d::mdl_c bodyModel;
+ nw4r::g3d::ResFile resFile;
+ m3d::anmChr_c animationChr;
int timer;
char BigBossFuzzyBear;
@@ -31,9 +35,10 @@ class daFuzzyBear_c : public dEn_c {
char roly;
char isInvulnerable;
- void dieBigFall_Execute();
static daFuzzyBear_c *build();
+ void bindAnimChr_and_setUpdateRate(const char* name, int unk, float unk2, float rate);
+ void setupBodyModel();
void updateModelMatrices();
void playerCollision(ActivePhysics *apThis, ActivePhysics *apOther);
@@ -51,6 +56,7 @@ class daFuzzyBear_c : public dEn_c {
DECLARE_STATE(Spray);
DECLARE_STATE(RolyPoly);
DECLARE_STATE(Wait);
+ DECLARE_STATE(Outro);
};
daFuzzyBear_c *daFuzzyBear_c::build() {
@@ -64,7 +70,7 @@ extern "C" void *HandleYSpeed(daFuzzyBear_c *);
extern "C" void *UpdateObjectPosBasedOnSpeedValues_real(daFuzzyBear_c *);
extern "C" void *doSpriteMovement(dEn_c *);
extern "C" void *PlaySound(daFuzzyBear_c *, int soundID);
-extern "C" void *StopSound(int soundID);
+extern "C" void *StopSound(int soundID, int thing=0);
extern "C" u32 GenerateRandomNumber(int max);
extern "C" dStageActor_c *CreateActor(u16 classID, int settings, Vec pos, char rot, char layer);
@@ -78,6 +84,7 @@ CREATE_STATE(daFuzzyBear_c, Needles);
CREATE_STATE(daFuzzyBear_c, Spray);
CREATE_STATE(daFuzzyBear_c, RolyPoly);
CREATE_STATE(daFuzzyBear_c, Wait);
+CREATE_STATE(daFuzzyBear_c, Outro);
#define ACTIVATE 1
@@ -99,7 +106,7 @@ void daFuzzyBear_c::collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, Ac
CreateEffect(&apOther->owner->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 102);
this->damage++;
- if (this->damage > 14) { doStateChange(&StateID_DieBigFall); }
+ if (this->damage > 14) { doStateChange(&StateID_Outro); }
}
bool daFuzzyBear_c::collisionCat2_IceBall_15_YoshiIce(ActivePhysics *apThis, ActivePhysics *apOther) { OSReport("Hit Iceball"); return false; }
void daFuzzyBear_c::collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysics *apOther) {
@@ -137,7 +144,7 @@ void daFuzzyBear_c::collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhy
PlaySound(this, SE_EMY_BLOW_PAKKUN_DOWN);
CreateEffect(&blah->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 161);
- if (this->damage > 14) { doStateChange(&StateID_DieBigFall); }
+ if (this->damage > 14) { doStateChange(&StateID_Outro); }
else { doStateChange(&StateID_RolyPoly); }
}
void daFuzzyBear_c::collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics *apOther) {
@@ -151,59 +158,43 @@ void daFuzzyBear_c::collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics *
CreateEffect(&apOther->owner->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 162);
- if (this->damage > 14) { doStateChange(&StateID_DieBigFall); }
+ if (this->damage > 14) { doStateChange(&StateID_Outro); }
else { doStateChange(&StateID_RolyPoly); }
}
void daFuzzyBear_c::collisionCat14_YoshiFire(ActivePhysics *apThis, ActivePhysics *apOther) { OSReport("Hit Yoshi Fire"); }
-void daFuzzyBear_c::dieBigFall_Execute() {
-
- if (this->dying == 1) { return; }
- this->rot.x = 0; // X is vertical axis
- this->rot.y = 0; // Y is horizontal axis
- this->rot.z = 0; // Z is ... an axis >.>
- if (this->scale.x > 0.1) {
+void daFuzzyBear_c::bindAnimChr_and_setUpdateRate(const char* name, int unk, float unk2, float rate) {
+ nw4r::g3d::ResAnmChr anmChr = this->resFile.GetResAnmChr(name);
+ this->animationChr.bind(&this->bodyModel, anmChr, unk);
+ this->bodyModel.bindAnim(&this->animationChr, unk2);
+ this->animationChr.setUpdateRate(rate);
+}
- PlaySound(this, SE_BOSS_CMN_DAMAGE_LAST);
- this->scale.x -= 0.015;
- this->scale.y -= 0.015;
- this->scale.z -= 0.015;
+void daFuzzyBear_c::setupBodyModel() {
+ allocator.link(-1, GameHeaps[0], 0, 0x20);
- if (this->timer == 30) {
- CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0}, 756);
- CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0}, 801);
- CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0}, 957);
- this->timer = 0;
- }
- }
- else {
- this->scale.x = 0.0;
- this->scale.y = 0.0;
- this->scale.z = 0.0;
-
- CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0}, 588);
- this->dying = 1;
- }
+ this->resFile.data = getResource("chorobon", "g3d/chorobon.brres");
+ nw4r::g3d::ResMdl mdl = this->resFile.GetResMdl("chorobon");
+ bodyModel.setup(mdl, &allocator, 0x224, 1, 0);
+ SetupTextures_Enemy(&bodyModel, 0);
- this->timer += 1;
+ bool ret;
+ nw4r::g3d::ResAnmChr anmChr = this->resFile.GetResAnmChr("run");
+ ret = this->animationChr.setup(mdl, anmChr, &this->allocator, 0);
+ allocator.unlink();
}
int daFuzzyBear_c::onCreate() {
OSReport("Creating the Fuzzy Bear Model");
- allocator.link(-1, GameHeaps[0], 0, 0x20);
+ setupBodyModel();
- nw4r::g3d::ResFile rf(getResource("chorobon", "g3d/chorobon.brres"));
- bodyModel.setup(rf.GetResMdl("chorobon"), &allocator, 0x224, 1, 0);
- SetupTextures_Enemy(&bodyModel, 0);
-
- allocator.unlink();
this->BigBossFuzzyBear = this->settings >> 28;
@@ -257,6 +248,9 @@ int daFuzzyBear_c::onCreate() {
this->roly = 0;
this->damage = 0;
this->isInvulnerable = 0;
+
+
+ bindAnimChr_and_setUpdateRate("run", 1, 0.0, 1.0);
OSReport("Setting Fuzzy Bear's State");
doStateChange(&StateID_Grow);
@@ -275,6 +269,9 @@ int daFuzzyBear_c::onExecute() {
acState.execute();
updateModelMatrices();
+ if(this->animationChr.isAnimationDone())
+ this->animationChr.setCurrentFrame(0.0);
+
if (this->aPhysics.result1 == 1) {
char PlayerID = NearestPlayer(this);
dStageActor_c *Player = GetSpecificPlayerActor(PlayerID);
@@ -288,6 +285,7 @@ int daFuzzyBear_c::onExecute() {
int daFuzzyBear_c::onDraw() {
bodyModel.scheduleForDrawing();
+ bodyModel._vf1C();
return true;
}
@@ -308,7 +306,6 @@ void daFuzzyBear_c::updateModelMatrices() {
void daFuzzyBear_c::beginState_Grow() {
OSReport("Growing when Kameck Tells me to.");
this->timer = 0;
-// PlaySound(this, SE_BOSS_ROY_MAGIC_MAKE_FAST);
}
void daFuzzyBear_c::executeState_Grow() {
@@ -316,8 +313,11 @@ void daFuzzyBear_c::executeState_Grow() {
this->timer = this->timer + 1;
float scaleSpeed, yPosScaling;
+
+ if (this->timer == 60) { PlaySound(this, SE_BOSS_IGGY_WANWAN_TO_L); }
if ((this->timer > 60) && (this->timer < 140)) {
+
if (BigBossFuzzyBear == 1) {
scaleSpeed = 0.025;
yPosScaling = 25; }
@@ -339,7 +339,8 @@ void daFuzzyBear_c::executeState_Grow() {
}
void daFuzzyBear_c::endState_Grow() {
this->Baseline = this->pos.y;
-// StopSound(SE_BOSS_ROY_MAGIC_MAKE_FAST);
+
+ PlaySound(this, STRM_BGM_TORIDE_BOSS);
OSReport("OK. All grown up now.");
}
@@ -711,4 +712,79 @@ void daFuzzyBear_c::endState_Wait() { }
+void daFuzzyBear_c::beginState_Outro() {
+
+ this->timer = 0;
+
+}
+void daFuzzyBear_c::executeState_Outro() {
+
+ if (this->dying == 1) {
+ if (this->timer > 180) {
+ ExitStage(WORLD_MAP, 0, BEAT_LEVEL, MARIO_WIPE);
+ }
+
+ if (this->timer == 60) {
+
+ if (GetSpecificPlayerActor(0) != 0) {
+ PlaySound(this, SE_VOC_MA_CLEAR_BOSS);
+ // Send PlBase into DemoGoal State here, kthxbai
+ }
+
+ if (GetSpecificPlayerActor(1) != 0) {
+ PlaySound(this, SE_VOC_LU_CLEAR_BOSS);
+ // Send PlBase into DemoGoal State here, kthxbai
+ }
+
+ if (GetSpecificPlayerActor(2) != 0) {
+ PlaySound(this, SE_VOC_KO_CLEAR_BOSS);
+ // Send PlBase into DemoGoal State here, kthxbai
+ }
+
+ if (GetSpecificPlayerActor(3) != 0) {
+ PlaySound(this, SE_VOC_KO2_CLEAR_BOSS);
+ // Send PlBase into DemoGoal State here, kthxbai
+ }
+ }
+
+ this->timer += 1;
+ return;
+ }
+
+ if (this->scale.x > 0.1) {
+
+ PlaySound(this, SE_BOSS_CMN_DAMAGE_LAST);
+
+ // Adjust this to equal the scale of your boss / 80.
+ this->scale.x -= 0.015;
+ this->scale.y -= 0.015;
+ this->scale.z -= 0.015;
+
+ if (this->timer == 30) {
+ CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0}, 756);
+ CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0}, 801);
+ CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0}, 957);
+ this->timer = 0;
+ }
+ }
+ else {
+ this->scale.x = 0.0;
+ this->scale.y = 0.0;
+ this->scale.z = 0.0;
+
+ CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0}, 588);
+ this->dying = 1;
+ this->timer = 0;
+
+ PlaySound(this, STRM_BGM_SHIRO_BOSS_CLEAR);
+ }
+
+ this->timer += 1;
+
+}
+void daFuzzyBear_c::endState_Outro() { }
+
+
+
+
diff --git a/src/bossRamboo.cpp b/src/bossRamboo.cpp
index c1b9244..11c0249 100644
--- a/src/bossRamboo.cpp
+++ b/src/bossRamboo.cpp
@@ -272,6 +272,7 @@ void daRamboo_c::executeState_Grow() {
float scaleSpeed, yPosScaling;
if ((this->timer > 60) && (this->timer < 140)) {
+ PlaySound(this, SE_BOSS_IGGY_WANWAN_L_TO_M);
scaleSpeed = 0.175;
// yPosScaling = 0;
diff --git a/src/soundPlayer.S b/src/soundPlayer.S
index 04f29f8..645af31 100644
--- a/src/soundPlayer.S
+++ b/src/soundPlayer.S
@@ -20,8 +20,9 @@
.extern YetAnotherSoundPlayer
.extern CheckIfPlayingSound
.extern StopSoundBasic
-.extern BufferToCheckIfPlaying
+.extern StopSoundRelated
.extern SoundClassRelated
+.extern BufferToCheckIfPlaying
.align 4
@@ -85,7 +86,15 @@ GoAwaySoundGuy:
.global StopSound
StopSound:
+ stwu r1, -0x10(r1)
+ mtlr r0
+ stw r0, 0x14(r1)
+
mr r4, r3
lwz r3, -0x5218(r13)
- b StopSoundBasic
+ bl StopSoundBasic
+ lwz r0, 0x14(r1)
+ mflr r0
+
+ blr