summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--NewerProject.yaml3
-rw-r--r--bossWrenchThrow.yaml10
-rw-r--r--bugfixes.yaml6
-rw-r--r--src/bossBalboaWrench.cpp96
-rw-r--r--src/bossFuzzyBear.cpp2
-rw-r--r--src/bossWrenchThrow.cpp88
-rw-r--r--src/fakeStarCoin.cpp4
-rwxr-xr-xsrc/growup.s19
8 files changed, 158 insertions, 70 deletions
diff --git a/NewerProject.yaml b/NewerProject.yaml
index 7566896..0e90902 100644
--- a/NewerProject.yaml
+++ b/NewerProject.yaml
@@ -32,8 +32,9 @@ modules:
# - processed/classic_controller.yaml
- processed/bossMegaGoomba.yaml
- processed/bossFuzzyBear.yaml
- - processed/bossThwompaDomp.yaml
+# - processed/bossThwompaDomp.yaml
- processed/bossRamboo.yaml
- processed/bossBalboaWrench.yaml
+ - processed/bossWrenchThrow.yaml
- processed/effectVideo.yaml
- processed/fakeStarCoin.yaml
diff --git a/bossWrenchThrow.yaml b/bossWrenchThrow.yaml
new file mode 100644
index 0000000..69580ac
--- /dev/null
+++ b/bossWrenchThrow.yaml
@@ -0,0 +1,10 @@
+---
+# Replaces GAKE_NOKO
+
+source_files: [../src/bossWrenchThrow.cpp]
+hooks:
+ - name: WrenchThrowBuild
+ type: add_func_pointer
+ src_addr_pal: 0x80AEA9F8
+ target_func: 'daWrench::build(void)'
+
diff --git a/bugfixes.yaml b/bugfixes.yaml
index 5279f07..d1d7fd1 100644
--- a/bugfixes.yaml
+++ b/bugfixes.yaml
@@ -74,3 +74,9 @@ hooks:
# src_addr_pal: 0x80081E34
# target_func: 'HeapChangeAttempt'
+ - name: EN_BIGPILEFix
+ type: patch
+ addr_pal: 0x8001F93C
+ data: '48000014'
+
+
diff --git a/src/bossBalboaWrench.cpp b/src/bossBalboaWrench.cpp
index 703123d..acdbb44 100644
--- a/src/bossBalboaWrench.cpp
+++ b/src/bossBalboaWrench.cpp
@@ -30,6 +30,7 @@ class daBalboa_c : public dEn_c {
m3d::anmChr_c anmThrow_5;
int timer;
+ int damage;
float Baseline;
float dying;
Vec PopUp [4];
@@ -44,6 +45,7 @@ class daBalboa_c : public dEn_c {
void playerCollision(ActivePhysics *apThis, ActivePhysics *apOther);
void collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, ActivePhysics *apOther);
bool collisionCat2_IceBall_15_YoshiIce(ActivePhysics *apThis, ActivePhysics *apOther);
+ void collisionCatD_GroundPound(ActivePhysics *apThis, ActivePhysics *apOther);
void collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysics *apOther);
void collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics *apOther);
@@ -72,6 +74,7 @@ extern "C" dStageActor_c *CreateActor(u16 classID, int settings, Vec pos, char r
extern "C" u8 dSprite_c__getXDirectionOfFurthestPlayerRelativeToVEC3(daBalboa_c *, Vec pos);
extern "C" dStageActor_c *GetSpecificPlayerActor(int number);
extern "C" void *PlaySound(daBalboa_c *, int soundID);
+extern "C" char usedForDeterminingStatePress_or_playerCollision(dEn_c* t, ActivePhysics *apThis, ActivePhysics *apOther, int unk1);
CREATE_STATE(daBalboa_c, Grow);
@@ -86,26 +89,65 @@ CREATE_STATE(daBalboa_c, Outro);
void daBalboa_c::playerCollision(ActivePhysics *apThis, ActivePhysics *apOther) {
- this->_vf220(apOther->owner);
- OSReport("I hit Mario.");
+
+ char ret = usedForDeterminingStatePress_or_playerCollision(this, apThis, apOther, 0);
+
+ if(ret == 1) { // regular jump
+
+ apOther->someFlagByte |= 2;
+ OSReport("ret == 1; regular jump;\n");
+
+ } else if(ret == 3) { // spinning
+
+ apOther->someFlagByte |= 2;
+ OSReport("ret == 3; spinning collision;\n");
+
+ } else if(ret == 0) {
+
+ OSReport("calling dEn_c::playerCollsiion(apThis, apOther);\n");
+ this->dEn_c::playerCollision(apThis, apOther);
+ this->_vf220(apOther->owner);
+
+ } else if(ret == 2) {
+ OSReport("Y U USIN' MINIMARIO?\n");
+ this->dEn_c::playerCollision(apThis, apOther);
+ this->_vf220(apOther->owner);
+
+ } else {
+ OSReport("usedForDeter...() returned %d\n", ret);
+ }
+
+ //FIXME hack to make multiple playerCollisions work
+ this->isDead = 0;
+ this->flags_4FC |= (1<<(31-7));
+ if(apOther->owner->_38D > 3) {
+ OSReport("!!!ATTENTION!!!\napOther->owner->_38D > 3\n");
+ }else{
+ this->counter_504[apOther->owner->_38D] = 0;
+ }
}
+
void daBalboa_c::collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, ActivePhysics *apOther) {
- OSReport("Hit Fireball");
- CreateEffect(378, &apOther->owner->pos, &(S16Vec){0,0,0}, &(Vec){0.5, 0.5, 0.5});
- this->pos.x += 6.0;
}
+
bool daBalboa_c::collisionCat2_IceBall_15_YoshiIce(ActivePhysics *apThis, ActivePhysics *apOther) { OSReport("Hit Iceball"); return false; }
-void daBalboa_c::collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysics *apOther) {
- OSReport("Hit Rolling Object");
+
+void daBalboa_c::collisionCatD_GroundPound(ActivePhysics *apThis, ActivePhysics *apOther) {
+ this->damage -= 1;
+
+ apOther->someFlagByte |= 2;
- if (apOther->owner->name == 412) { // Check if it's a glow block
- CreateEffect(378, &apOther->owner->pos);
- CreateEffect(380, &apOther->owner->pos);
+ // Create a huge hit effect and play a nice sound
+ // goto a get hurt state where he does his dance and then retreats underground
+
+ // Prevent him from getting hurt during his dancing
+
+ if (this->damage == 0) { doStateChange(&StateID_Outro); }
- apOther->owner->Delete();
- doStateChange(&StateID_Outro);
- }
}
+
+
+void daBalboa_c::collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysics *apOther) { }
void daBalboa_c::collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics *apOther) { OSReport("Hit Hammer"); }
@@ -217,6 +259,7 @@ int daBalboa_c::onCreate() {
this->direction = 0; // Heading left.
this->pos.z = -800.0;
this->pos.y -= 8.0;
+ this->damage = 3;
this->PopUp[0] = (Vec){this->pos.x, this->pos.y - 72.0, this->pos.z};
this->PopUp[1] = (Vec){this->pos.x - 224.0, this->pos.y - 72.0, this->pos.z};
@@ -240,13 +283,6 @@ int daBalboa_c::onDelete() {
int daBalboa_c::onExecute() {
acState.execute();
updateModelMatrices();
-
- if (this->aPhysics.result1 == 1) {
- char PlayerID = NearestPlayer(this);
- dStageActor_c *Player = GetSpecificPlayerActor(PlayerID);
-
- this->_vf220(Player);
- }
return true;
}
@@ -490,8 +526,12 @@ void daBalboa_c::beginState_ThrowHoming() {
u32 settings;
+ char dir;
- settings = (this->direction) | (this->upsideDown << 1);
+ if (this->direction) { dir = 0; }
+ else { dir = 1; }
+
+ settings = (dir) | (this->upsideDown << 1);
settings = settings | 0x10;
CreateActor(544, settings, this->pos, 0, 0);
@@ -518,6 +558,7 @@ void daBalboa_c::endState_ThrowHoming() { }
void daBalboa_c::beginState_ThrowWrench() {
+ this->throwCount = 0;
this->timer = 0;
}
@@ -525,7 +566,7 @@ void daBalboa_c::executeState_ThrowWrench() {
- if (this->timer == 60) {
+ if (this->timer > 60) {
if (this->throwCount & 1) {
nw4r::g3d::ResAnmChr anmChr = this->resFile.GetResAnmChr("throw_4_left_hand");
@@ -544,25 +585,28 @@ void daBalboa_c::executeState_ThrowWrench() {
u32 settings;
u8 up = this->upsideDown;
u8 throwc = this->throwCount;
- u8 dir = this->direction;
+ u8 dir;
+ if (this->direction) { dir = 0; }
+ else { dir = 1; }
+
settings = (dir) | (up << 1);
settings = settings | (throwc & 1 << 8);
CreateActor(544, settings, this->pos, 0, 0);
- this->timer = 0;
this->throwCount += 1;
+ this->timer = 0;
}
- if (this->throwCount == 5) {
+ if (this->throwCount > 4) {
doStateChange(&StateID_BackDown); }
this->timer += 1;
this->bodyModel._vf1C();
}
-void daBalboa_c::endState_ThrowWrench() { this->throwCount = 0; }
+void daBalboa_c::endState_ThrowWrench() { }
diff --git a/src/bossFuzzyBear.cpp b/src/bossFuzzyBear.cpp
index 463d063..7bb7e8b 100644
--- a/src/bossFuzzyBear.cpp
+++ b/src/bossFuzzyBear.cpp
@@ -45,6 +45,7 @@ class daFuzzyBear_c : public dEn_c {
// void yoshiCollision(ActivePhysics *apThis, ActivePhysics *apOther);
void collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, ActivePhysics *apOther);
bool collisionCat2_IceBall_15_YoshiIce(ActivePhysics *apThis, ActivePhysics *apOther);
+ void collisionCatD_GroundPound(ActivePhysics *apThis, ActivePhysics *apOther);
void collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysics *apOther);
void collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics *apOther);
void collisionCat14_YoshiFire(ActivePhysics *apThis, ActivePhysics *apOther);
@@ -109,6 +110,7 @@ void daFuzzyBear_c::collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, Ac
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::collisionCatD_GroundPound(ActivePhysics *apThis, ActivePhysics *apOther) { OSReport("Groundpound\n"); }
void daFuzzyBear_c::collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysics *apOther) {
OSReport("Hit Rolling Object");
diff --git a/src/bossWrenchThrow.cpp b/src/bossWrenchThrow.cpp
index e99797b..beea815 100644
--- a/src/bossWrenchThrow.cpp
+++ b/src/bossWrenchThrow.cpp
@@ -6,11 +6,6 @@
#include <sfx.h>
-extern "C" void *PlaySound(dEn_c *, int soundID);
-extern "C" void *UpdateObjectPosBasedOnSpeedValues_real(daWrench *);
-extern "C" dStageActor_c *GetSpecificPlayerActor(int number);
-
-
class daWrench : public dEn_c {
int onCreate();
int onExecute();
@@ -52,6 +47,14 @@ CREATE_STATE(daWrench, Straight);
+extern "C" void *PlaySound(dEn_c *, int soundID);
+extern "C" void *UpdateObjectPosBasedOnSpeedValues_real(daWrench *);
+extern "C" dStageActor_c *GetSpecificPlayerActor(int number);
+extern "C" void *HandleXSpeed(daWrench *);
+extern "C" void *HandleYSpeed(daWrench *);
+
+
+
void daWrench::playerCollision(ActivePhysics *apThis, ActivePhysics *apOther) {
this->_vf220(apOther->owner);
@@ -99,17 +102,18 @@ int daWrench::onCreate() {
allocator.unlink();
- this->homing = this->settings & 0xF;
- this->direction = (this->settings >> 4) & 0xF;
+ this->direction = this->settings & 0xF;
+ this->homing = (this->settings >> 4) & 0xF;
this->front = (this->settings >> 8) & 0xF;
ActivePhysics::Info HitMeBaby;
if (this->homing == 0) {
- HitMeBaby.yDistToCenter = 21.0;
- HitMeBaby.xDistToEdge = 27.0;
- HitMeBaby.yDistToEdge = 21.0;
+ HitMeBaby.xDistToCenter = 0.0;
+ HitMeBaby.yDistToCenter = 0.0;
+ HitMeBaby.xDistToEdge = 6.0;
+ HitMeBaby.yDistToEdge = 6.0;
this->scale.x = 1.5;
this->scale.y = 1.5;
@@ -117,16 +121,16 @@ int daWrench::onCreate() {
}
else {
- HitMeBaby.yDistToCenter = 42.0;
- HitMeBaby.xDistToEdge = 54.0;
- HitMeBaby.yDistToEdge = 42.0;
+ HitMeBaby.xDistToCenter = 0.0;
+ HitMeBaby.yDistToCenter = 0.0;
+ HitMeBaby.xDistToEdge = 12.0;
+ HitMeBaby.yDistToEdge = 12.0;
this->scale.x = 3.0;
this->scale.y = 3.0;
this->scale.z = 3.0;
}
- HitMeBaby.xDistToCenter = 0.0;
HitMeBaby.category1 = 0x3;
HitMeBaby.category2 = 0x0;
HitMeBaby.bitfield1 = 0x47;
@@ -168,6 +172,7 @@ void daWrench::updateModelMatrices() {
int daWrench::onExecute() {
+ acState.execute();
updateModelMatrices();
return true;
@@ -175,7 +180,7 @@ int daWrench::onExecute() {
-void daRamboo_c::beginState_HandThrow() {
+void daWrench::beginState_HandThrow() {
if (this->direction == 0) { // Ground Facing Left
this->pos.x += 32.0;
@@ -198,13 +203,13 @@ void daRamboo_c::beginState_HandThrow() {
this->rot.z = 0xC000;
}
- if (this->front == 1) { this->pos.z = -804.0; }
+ if (this->front == 1) { this->pos.z = -1804.0; }
this->lifespan = 0;
}
-void daRamboo_c::executeState_HandThrow() {
+void daWrench::executeState_HandThrow() {
- if (this->lifespan == 60) {
+ if (this->lifespan > 30) {
if (this->homing == 0) {
doStateChange(&StateID_Straight); }
@@ -216,11 +221,11 @@ void daRamboo_c::executeState_HandThrow() {
this->lifespan += 1;
}
-void daRamboo_c::endState_HandThrow() { }
+void daWrench::endState_HandThrow() { }
-void daRamboo_c::beginState_Homing() {
+void daWrench::beginState_Homing() {
this->lifespan = 360;
Vec tempPos = this->pos;
@@ -246,28 +251,28 @@ void daRamboo_c::beginState_Homing() {
else {
this->ymod = 0.0; }
- if (this->direction == 0) { this->speed.x = -7.0; }
- else { this->speed.x = 7.0; }
-
+ if (this->direction & 1) { this->speed.x = -1.5; }
+ else { this->speed.x = 1.5; }
+ this->speed.y = 0;
}
-void daRamboo_c::executeState_Homing() {
+void daWrench::executeState_Homing() {
if (this->direction && 1) { // directions 1 and 3 spin clockwise, fly rightwards
- this->rot.z += 0x400; }
+ this->rot.z -= 0x1000; }
else { // directions 0 and 2 spin anti-clockwise, fly leftwards
- this->rot.z -= 0x400; }
+ this->rot.z += 0x1000; }
- UpdateObjectPosBasedOnSpeedValues_real(this);
+ this->pos.y += this->ymod * this->lifespan / 360;
- this->pos.y += this->ymod;
+ UpdateObjectPosBasedOnSpeedValues_real(this);
if (this->lifespan < 1) {
PlaySound(this, SE_OBJ_HAMMER_HIT_BOTH);
- CreateEffect(&this->homingWrench->pos, &(S16Vec){0,0,0}, &(Vec){1.5, 1.5, 1.5}, 242);
+ CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){1.5, 1.5, 1.5}, 242);
this->Delete();
}
@@ -276,11 +281,11 @@ void daRamboo_c::executeState_Homing() {
this->lifespan -= 1;
}
-void daRamboo_c::endState_Homing() { }
+void daWrench::endState_Homing() { }
-void daRamboo_c::beginState_Straight() {
+void daWrench::beginState_Straight() {
char PlayerID = NearestPlayer(this);
dStageActor_c *Player = GetSpecificPlayerActor(PlayerID);
@@ -290,26 +295,27 @@ void daRamboo_c::beginState_Straight() {
Vec tempPos = this->pos;
- if (this->direction == 0) {
- this->speed.x = -6.0;
- this->speed.y = -6.0 * slope;
+ if (this->direction & 1) {
+ this->speed.x = -2.0;
+ this->speed.y = 2.0 * slope;
}
else {
- this->speed.x = 6.0;
- this->speed.y = 6.0 * slope;
+ this->speed.x = 2.0;
+ this->speed.y = 2.0 * slope;
}
}
-void daRamboo_c::executeState_Straight() {
+void daWrench::executeState_Straight() {
this->lifespan = 360;
if (this->direction && 1) { // directions 1 and 3 spin clockwise, fly rightwards
- this->rot.z += 0x400; }
+ this->rot.z -= 0x1000; }
else { // directions 0 and 2 spin anti-clockwise, fly leftwards
- this->rot.z -= 0x400; }
+ this->rot.z += 0x1000; }
+
UpdateObjectPosBasedOnSpeedValues_real(this);
PlaySound(this, SE_EMY_CHOROPU_M_SPANNER);
@@ -320,13 +326,13 @@ void daRamboo_c::executeState_Straight() {
PlaySound(this, SE_OBJ_HAMMER_HIT_BOTH);
- CreateEffect(&this->homingWrench->pos, &(S16Vec){0,0,0}, &(Vec){0.75, 0.75, 0.75}, 242);
+ CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){0.75, 0.75, 0.75}, 242);
this->Delete();
}
this->lifespan -= 1;
}
-void daRamboo_c::endState_Straight() { }
+void daWrench::endState_Straight() { }
diff --git a/src/fakeStarCoin.cpp b/src/fakeStarCoin.cpp
index a845e45..8248b1c 100644
--- a/src/fakeStarCoin.cpp
+++ b/src/fakeStarCoin.cpp
@@ -51,7 +51,7 @@ void daFakeStarCoin::collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, A
CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 336);
CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){3.0, 3.0, 3.0}, 342);
- PlaySound(this, SE_EMY_FIRE_SNAKE_BIGGER);
+ PlaySound(this, SE_OBJ_EMY_FIRE_DISAPP);
this->Delete();
}
@@ -85,7 +85,7 @@ void daFakeStarCoin::collisionCat14_YoshiFire(ActivePhysics *apThis, ActivePhysi
CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 336);
CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){3.0, 3.0, 3.0}, 342);
- PlaySound(this, SE_EMY_FIRE_SNAKE_BIGGER);
+ PlaySound(this, SE_OBJ_EMY_FIRE_DISAPP);
this->Delete();
}
diff --git a/src/growup.s b/src/growup.s
index 0576ebe..d7923ac 100755
--- a/src/growup.s
+++ b/src/growup.s
@@ -147,6 +147,12 @@ ModelNoChanges:
.global ModifyGlobalSizes
ModifyGlobalSizes:
+ # Go back if it's 60
+ lhz r10, 8(r3)
+ cmpwi r10, 60
+ beq ModelNoChanges
+
+
# Go back if SizerOn is 0 (off)
lis r10, SizerOn@h
ori r10, r10, SizerOn@l
@@ -235,6 +241,10 @@ ModifySpeedUpdatesB:
cmpwi r10, 0x12
blt SpeedUpdatesNoChangesB
+ # Go back if it's 60
+ cmpwi r10, 60
+ beq SpeedUpdatesNoChangesB
+
# Go back if SizerOn is 0 (off)
lis r10, SizerOn@h
ori r10, r10, SizerOn@l
@@ -318,6 +328,10 @@ ModifySpeedUpdatesA:
cmpwi r10, 0x12
blt SpeedUpdatesNoChangesA
+ # Go back if it's 60
+ cmpwi r10, 60
+ beq SpeedUpdatesNoChangesA
+
# Go back if SizerOn is 0 (off)
lis r10, SizerOn@h
ori r10, r10, SizerOn@l
@@ -458,6 +472,11 @@ CollisionNoChanges:
.global ModifyCollision
ModifyCollision:
+ # Go back if it's 60
+ lhz r10, 8(r4)
+ cmpwi r10, 60
+ beq CollisionNoChanges
+
# Go back if SizerOn is 0 (off)
lis r10, SizerOn@h
ori r10, r10, SizerOn@l