summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Noga <Tempus@Spectrum-Song.local>2011-09-21 10:03:30 -0500
committerColin Noga <Tempus@Spectrum-Song.local>2011-09-21 10:03:30 -0500
commitdd75729e326b0f7114353649baa275cd06afae2f (patch)
treecd621c4a04e5987b10fac4f1b21887818ba22883
parentaa4a620735ccc26bb56388487fae5318e33076c1 (diff)
downloadkamek-dd75729e326b0f7114353649baa275cd06afae2f.tar.gz
kamek-dd75729e326b0f7114353649baa275cd06afae2f.zip
More stuff for mrsun
-rwxr-xr-xsrc/mrsun.cpp58
1 files changed, 48 insertions, 10 deletions
diff --git a/src/mrsun.cpp b/src/mrsun.cpp
index 5cd2d9c..7d8628a 100755
--- a/src/mrsun.cpp
+++ b/src/mrsun.cpp
@@ -37,6 +37,19 @@ class daMrSun_c : public dEn_c {
void updateModelMatrices();
+ void playerCollision(ActivePhysics *apThis, ActivePhysics *apOther);
+ void yoshiCollision(ActivePhysics *apThis, ActivePhysics *apOther);
+ void collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, ActivePhysics *apOther);
+ void collisionCat2_IceBall_15_YoshiIce(ActivePhysics *apThis, ActivePhysics *apOther);
+ void collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics *apOther);
+ void collisionCat14_YoshiFire(ActivePhysics *apThis, ActivePhysics *apOther);
+ void collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysics *apOther);
+
+ void dieFumi_Begin();
+ void dieFumi_Execute();
+ void dieFumi_End();
+
+
USING_STATES(daMrSun_c);
DECLARE_STATE(Follow);
DECLARE_STATE(Swoop);
@@ -44,6 +57,7 @@ class daMrSun_c : public dEn_c {
DECLARE_STATE(Spit);
DECLARE_STATE(Spin);
DECLARE_STATE(Wait);
+// DECLARE_STATE(dieFumi);
};
daMrSun_c *daMrSun_c::build() {
@@ -68,11 +82,29 @@ CREATE_STATE(daMrSun_c, Spiral);
CREATE_STATE(daMrSun_c, Spit);
CREATE_STATE(daMrSun_c, Spin);
CREATE_STATE(daMrSun_c, Wait);
+//CREATE_STATE(daMrSun_c, dieFumi);
#define ACTIVATE 1
#define DEACTIVATE 0
+void daMrSun_c::playerCollision(ActivePhysics *apThis, ActivePhysics *apOther) { OSReport("Hit Player"); }
+void daMrSun_c::yoshiCollision(ActivePhysics *apThis, ActivePhysics *apOther) { OSReport("Hit Yoshi"); }
+
+void daMrSun_c::collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, ActivePhysics *apOther) { OSReport("Hit Fireball"); }
+void daMrSun_c::collisionCat2_IceBall_15_YoshiIce(ActivePhysics *apThis, ActivePhysics *apOther) { OSReport("Hit Iceball"); }
+void daMrSun_c::collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysics *apOther) { OSReport("Hit Rolling Object"); doStateChange(&StateID_Wait); }
+void daMrSun_c::collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics *apOther) {
+ OSReport("Hit Hammer");
+ doStateChange(&StateID_Wait);
+}
+void daMrSun_c::collisionCat14_YoshiFire(ActivePhysics *apThis, ActivePhysics *apOther) { OSReport("Hit Yoshi Fire"); }
+
+
+void daMrSun_c::dieFumi_Begin() { this->dieFall_Begin(); }
+void daMrSun_c::dieFumi_Execute() { this->dieFall_Execute(); }
+void daMrSun_c::dieFumi_End() { this->dieFall_End(); }
+
@@ -94,14 +126,14 @@ int daMrSun_c::onCreate() {
}
else { // It's a moon
- hasGlow = true;
+ hasGlow = false;
nw4r::g3d::ResFile rf(getResource("bilikyu", "g3d/moon.brres"));
bodyModel.setup(rf.GetResMdl("Moon"), &allocator, 0x224, 1, 0);
SetupTextures_Map(&bodyModel, 0);
- glowModel.setup(rf.GetResMdl("MoonGlow"), &allocator, 0x224, 1, 0);
- SetupTextures_Map(&glowModel, 0);
+// glowModel.setup(rf.GetResMdl("MoonGlow"), &allocator, 0x224, 1, 0);
+// SetupTextures_Map(&glowModel, 0);
}
allocator.unlink();
@@ -119,7 +151,14 @@ int daMrSun_c::onCreate() {
HitMeBaby.category1 = 0x3;
HitMeBaby.category2 = 0x0;
HitMeBaby.bitfield1 = 0x4F;
- HitMeBaby.bitfield2 = 0x8820C;
+
+ if (this->settings == 0) { // It's a sun
+ HitMeBaby.bitfield2 = 0x3E020C; // Can be hit by iceballs of all kinds, shells and rollies, pipe cannons, and star power
+ }
+ else { // It's a moon
+ HitMeBaby.bitfield2 = 0x3E0200; // Can be hit by fireballs of all kinds, shells and rollies, pipe cannons, and star power
+ }
+
HitMeBaby.unkShort1C = 0;
HitMeBaby.callback = &dEn_c::collisionCallback;
@@ -217,17 +256,19 @@ void daMrSun_c::executeState_Follow() {
if (this->settings == 0) { speedDelta = 0.1; } // It's a sun
else { speedDelta = 0.15; } // It's a moon
+ OSReport("Speed: %f", this->speed.x);
+
if (this->direction == 0) {
this->speed.x = this->speed.x + speedDelta;
if (this->speed.x < 0) { this->speed.x = this->speed.x + (speedDelta / 2); }
- if (this->speed.x < 50.0) { this->speed.x = this->speed.x + (speedDelta); }
+ if (this->speed.x < 6.0) { this->speed.x = this->speed.x + (speedDelta); }
}
else {
this->speed.x = this->speed.x - speedDelta;
if (this->speed.x > 0) { this->speed.x = this->speed.x - (speedDelta / 2); }
- if (this->speed.x < 50.0) { this->speed.x = this->speed.x - (speedDelta); }
+ if (this->speed.x > 6.0) { this->speed.x = this->speed.x - (speedDelta); }
}
HandleXSpeed(this);
@@ -236,10 +277,7 @@ void daMrSun_c::executeState_Follow() {
float yDiff;
yDiff = (this->Baseline - this->pos.y) / 8;
this->speed.y = yDiff;
-
-
- OSReport("YSpeed = %f", this->speed.y);
-
+
HandleYSpeed(this);
UpdateObjectPosBasedOnSpeedValues_real(this);