summaryrefslogtreecommitdiff
path: root/src/levelspecial.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/levelspecial.cpp')
-rw-r--r--src/levelspecial.cpp148
1 files changed, 144 insertions, 4 deletions
diff --git a/src/levelspecial.cpp b/src/levelspecial.cpp
index 5fd900d..7ad69ff 100644
--- a/src/levelspecial.cpp
+++ b/src/levelspecial.cpp
@@ -23,7 +23,7 @@ struct EventTable_t {
u64 events;
// ...
};
-
+
extern EventTable_t *EventTable;
extern u16 TimeStopFlag;
@@ -41,6 +41,7 @@ extern float GlobalSpriteSize;
extern float GlobalSpriteSpeed;
extern float GlobalRiderSize;
extern char SizerOn;
+extern char ZOrderOn;
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 };
@@ -48,7 +49,7 @@ float GlobalRiderFloatModifications [] = {1, 0.6, 0.7, 0.9, 1, 1, 1, 1.1, 1.25,
-extern "C" void GetSpecificPlayerActor(int number);
+extern "C" dAc_Py_c *GetSpecificPlayerActor(int number);
void LevelSpecial_Update(LevelSpecial *self);
bool ResetAfterLevel();
@@ -73,6 +74,7 @@ bool ResetAfterLevel(void) {
SizerOn = 0;
AlwaysDrawFlag = 0x9421FFF0;
AlwaysDrawBranch = 0x7C0802A6;
+ ZOrderOn = 0;
return true;
}
@@ -146,10 +148,74 @@ void LevelSpecial_Update(LevelSpecial *self) {
break;
case 4: // Mario Size
+ dAc_Py_c *Mario;
if (self->effect == 0) //Super Size
+ {
MarioSize = 4.0;
+
+ for(int n=0; n<4; n++) {
+ OSReport("Changing Physics for Player %d\n", n);
+ Mario = GetSpecificPlayerActor(n);
+ OSReport("Player Actor at %08x\n", Mario);
+// Mario->aPhysics.info.xDistToCenter = Mario->aPhysics.info.xDistToCenter * 4.0;
+// Mario->aPhysics.info.xDistToEdge = Mario->aPhysics.info.xDistToEdge * 4.0;
+// Mario->aPhysics.info.yDistToCenter = Mario->aPhysics.info.yDistToCenter * 4.0;
+// Mario->aPhysics.info.yDistToEdge = Mario->aPhysics.info.yDistToEdge * 4.0;
+//
+ Mario->bPhysics.info.xDistToCenter = Mario->bPhysics.info.xDistToCenter * 4.0;
+ Mario->bPhysics.info.xDistToEdge = Mario->bPhysics.info.xDistToEdge * 4.0;
+ Mario->bPhysics.info.yDistToCenter = Mario->bPhysics.info.yDistToCenter * 4.0;
+ Mario->bPhysics.info.yDistToEdge = Mario->bPhysics.info.yDistToEdge * 4.0;
+//
+// Mario->cPhysics.info.xDistToCenter = Mario->cPhysics.info.xDistToCenter * 4.0;
+// Mario->cPhysics.info.xDistToEdge = Mario->cPhysics.info.xDistToEdge * 4.0;
+// Mario->cPhysics.info.yDistToCenter = Mario->cPhysics.info.yDistToCenter * 4.0;
+// Mario->cPhysics.info.yDistToEdge = Mario->cPhysics.info.yDistToEdge * 4.0;
+//
+// Mario->dPhysics.info.xDistToCenter = Mario->dPhysics.info.xDistToCenter * 4.0;
+// Mario->dPhysics.info.xDistToEdge = Mario->dPhysics.info.xDistToEdge * 4.0;
+// Mario->dPhysics.info.yDistToCenter = Mario->dPhysics.info.yDistToCenter * 4.0;
+// Mario->dPhysics.info.yDistToEdge = Mario->dPhysics.info.yDistToEdge * 4.0;
+//
+// Mario->ePhysics.info.xDistToCenter = Mario->ePhysics.info.xDistToCenter * 4.0;
+// Mario->ePhysics.info.xDistToEdge = Mario->ePhysics.info.xDistToEdge * 4.0;
+// Mario->ePhysics.info.yDistToCenter = Mario->ePhysics.info.yDistToCenter * 4.0;
+// Mario->ePhysics.info.yDistToEdge = Mario->ePhysics.info.yDistToEdge * 4.0;
+ }
+ }
+
else //Half-Pint
+ {
MarioSize = 0.25;
+
+ for(int n=0; n<4; n++) {
+ Mario = GetSpecificPlayerActor(n);
+ Mario->aPhysics.info.xDistToCenter = Mario->aPhysics.info.xDistToCenter * 0.25;
+ Mario->aPhysics.info.xDistToEdge = Mario->aPhysics.info.xDistToEdge * 0.25;
+ Mario->aPhysics.info.yDistToCenter = Mario->aPhysics.info.yDistToCenter * 0.25;
+ Mario->aPhysics.info.yDistToEdge = Mario->aPhysics.info.yDistToEdge * 0.25;
+
+ Mario->bPhysics.info.xDistToCenter = Mario->bPhysics.info.xDistToCenter * 0.25;
+ Mario->bPhysics.info.xDistToEdge = Mario->bPhysics.info.xDistToEdge * 0.25;
+ Mario->bPhysics.info.yDistToCenter = Mario->bPhysics.info.yDistToCenter * 0.25;
+ Mario->bPhysics.info.yDistToEdge = Mario->bPhysics.info.yDistToEdge * 0.25;
+
+ Mario->cPhysics.info.xDistToCenter = Mario->cPhysics.info.xDistToCenter * 0.25;
+ Mario->cPhysics.info.xDistToEdge = Mario->cPhysics.info.xDistToEdge * 0.25;
+ Mario->cPhysics.info.yDistToCenter = Mario->cPhysics.info.yDistToCenter * 0.25;
+ Mario->cPhysics.info.yDistToEdge = Mario->cPhysics.info.yDistToEdge * 0.25;
+
+ Mario->dPhysics.info.xDistToCenter = Mario->dPhysics.info.xDistToCenter * 0.25;
+ Mario->dPhysics.info.xDistToEdge = Mario->dPhysics.info.xDistToEdge * 0.25;
+ Mario->dPhysics.info.yDistToCenter = Mario->dPhysics.info.yDistToCenter * 0.25;
+ Mario->dPhysics.info.yDistToEdge = Mario->dPhysics.info.yDistToEdge * 0.25;
+
+ Mario->ePhysics.info.xDistToCenter = Mario->ePhysics.info.xDistToCenter * 0.25;
+ Mario->ePhysics.info.xDistToEdge = Mario->ePhysics.info.xDistToEdge * 0.25;
+ Mario->ePhysics.info.yDistToCenter = Mario->ePhysics.info.yDistToCenter * 0.25;
+ Mario->ePhysics.info.yDistToEdge = Mario->ePhysics.info.yDistToEdge * 0.25;
+ }
+ }
break;
@@ -178,7 +244,10 @@ void LevelSpecial_Update(LevelSpecial *self) {
}
break;
-
+ case 7: // Z Order Hack
+ ZOrderOn = 1;
+ break;
+
default:
break;
}
@@ -207,7 +276,74 @@ void LevelSpecial_Update(LevelSpecial *self) {
break;
case 4: // Mario Size
- MarioSize = 1.0;
+ dAc_Py_c *Mario;
+// if (self->effect == 0) //Super Size
+// {
+// MarioSize = 4.0;
+//
+// for(int n=0; n<4; n++) {
+// OSReport("Changing Physics for Player %d\n", n);
+// Mario = GetSpecificPlayerActor(n);
+// OSReport("Player Actor at %08x\n", Mario);
+// Mario->aPhysics.info.xDistToCenter = Mario->aPhysics.info.xDistToCenter / 4.0;
+// Mario->aPhysics.info.xDistToEdge = Mario->aPhysics.info.xDistToEdge / 4.0;
+// Mario->aPhysics.info.yDistToCenter = Mario->aPhysics.info.yDistToCenter / 4.0;
+// Mario->aPhysics.info.yDistToEdge = Mario->aPhysics.info.yDistToEdge / 4.0;
+//
+// Mario->bPhysics.info.xDistToCenter = Mario->bPhysics.info.xDistToCenter / 4.0;
+// Mario->bPhysics.info.xDistToEdge = Mario->bPhysics.info.xDistToEdge / 4.0;
+// Mario->bPhysics.info.yDistToCenter = Mario->bPhysics.info.yDistToCenter / 4.0;
+// Mario->bPhysics.info.yDistToEdge = Mario->bPhysics.info.yDistToEdge / 4.0;
+//
+// Mario->cPhysics.info.xDistToCenter = Mario->cPhysics.info.xDistToCenter / 4.0;
+// Mario->cPhysics.info.xDistToEdge = Mario->cPhysics.info.xDistToEdge / 4.0;
+// Mario->cPhysics.info.yDistToCenter = Mario->cPhysics.info.yDistToCenter / 4.0;
+// Mario->cPhysics.info.yDistToEdge = Mario->cPhysics.info.yDistToEdge / 4.0;
+//
+// Mario->dPhysics.info.xDistToCenter = Mario->dPhysics.info.xDistToCenter / 4.0;
+// Mario->dPhysics.info.xDistToEdge = Mario->dPhysics.info.xDistToEdge / 4.0;
+// Mario->dPhysics.info.yDistToCenter = Mario->dPhysics.info.yDistToCenter / 4.0;
+// Mario->dPhysics.info.yDistToEdge = Mario->dPhysics.info.yDistToEdge / 4.0;
+//
+// Mario->ePhysics.info.xDistToCenter = Mario->ePhysics.info.xDistToCenter / 4.0;
+// Mario->ePhysics.info.xDistToEdge = Mario->ePhysics.info.xDistToEdge / 4.0;
+// Mario->ePhysics.info.yDistToCenter = Mario->ePhysics.info.yDistToCenter / 4.0;
+// Mario->ePhysics.info.yDistToEdge = Mario->ePhysics.info.yDistToEdge / 4.0;
+// }
+// }
+//
+// else //Half-Pint
+// {
+// MarioSize = 0.25;
+//
+// for(int n=0; n<4; n++) {
+// Mario = GetSpecificPlayerActor(n);
+// Mario->aPhysics.info.xDistToCenter = Mario->aPhysics.info.xDistToCenter / 0.25;
+// Mario->aPhysics.info.xDistToEdge = Mario->aPhysics.info.xDistToEdge / 0.25;
+// Mario->aPhysics.info.yDistToCenter = Mario->aPhysics.info.yDistToCenter / 0.25;
+// Mario->aPhysics.info.yDistToEdge = Mario->aPhysics.info.yDistToEdge / 0.25;
+//
+// Mario->bPhysics.info.xDistToCenter = Mario->bPhysics.info.xDistToCenter / 0.25;
+// Mario->bPhysics.info.xDistToEdge = Mario->bPhysics.info.xDistToEdge / 0.25;
+// Mario->bPhysics.info.yDistToCenter = Mario->bPhysics.info.yDistToCenter / 0.25;
+// Mario->bPhysics.info.yDistToEdge = Mario->bPhysics.info.yDistToEdge / 0.25;
+//
+// Mario->cPhysics.info.xDistToCenter = Mario->cPhysics.info.xDistToCenter / 0.25;
+// Mario->cPhysics.info.xDistToEdge = Mario->cPhysics.info.xDistToEdge / 0.25;
+// Mario->cPhysics.info.yDistToCenter = Mario->cPhysics.info.yDistToCenter / 0.25;
+// Mario->cPhysics.info.yDistToEdge = Mario->cPhysics.info.yDistToEdge / 0.25;
+//
+// Mario->dPhysics.info.xDistToCenter = Mario->dPhysics.info.xDistToCenter / 0.25;
+// Mario->dPhysics.info.xDistToEdge = Mario->dPhysics.info.xDistToEdge / 0.25;
+// Mario->dPhysics.info.yDistToCenter = Mario->dPhysics.info.yDistToCenter / 0.25;
+// Mario->dPhysics.info.yDistToEdge = Mario->dPhysics.info.yDistToEdge / 0.25;
+//
+// Mario->ePhysics.info.xDistToCenter = Mario->ePhysics.info.xDistToCenter / 0.25;
+// Mario->ePhysics.info.xDistToEdge = Mario->ePhysics.info.xDistToEdge / 0.25;
+// Mario->ePhysics.info.yDistToCenter = Mario->ePhysics.info.yDistToCenter / 0.25;
+// Mario->ePhysics.info.yDistToEdge = Mario->ePhysics.info.yDistToEdge / 0.25;
+// }
+// }
break;
case 5: // Global Enemy Size
@@ -228,6 +364,10 @@ void LevelSpecial_Update(LevelSpecial *self) {
AlwaysDrawBranch = 0x7C0802A6;
break;
+ case 7: // Z Order Hack
+ ZOrderOn = 0;
+ break;
+
default:
break;
}