summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorColin Noga <Tempus@chronometry.ca>2012-03-24 16:45:49 -0500
committerColin Noga <Tempus@chronometry.ca>2012-03-24 16:45:49 -0500
commit3764377091ad23145fbd92c769b78ce2f296900f (patch)
tree6b0dddcb86086c80dfdcffa962ca2ccc00d51d3c /src
parent393be37f168ba7bca4d471993aaf0899a4afc16b (diff)
downloadkamek-3764377091ad23145fbd92c769b78ce2f296900f.tar.gz
kamek-3764377091ad23145fbd92c769b78ce2f296900f.zip
Changes to loads of shit, mostly bowser related
Diffstat (limited to 'src')
-rw-r--r--src/bossCaptainBowser.cpp147
-rw-r--r--src/bossKoopaThrow.cpp9
-rw-r--r--src/bossPlayerClown.cpp27
-rwxr-xr-xsrc/meteor.cpp51
-rwxr-xr-xsrc/spritetex.S112
5 files changed, 209 insertions, 137 deletions
diff --git a/src/bossCaptainBowser.cpp b/src/bossCaptainBowser.cpp
index bb73087..a9c36b4 100644
--- a/src/bossCaptainBowser.cpp
+++ b/src/bossCaptainBowser.cpp
@@ -7,28 +7,37 @@
-const char* effects_name_list [] = {
- "Wm_jr_electricline", // cool
- "Wm_jr_fireattack", // cool
- "Wm_jr_firehit", // cool
- "Wm_jr_fireplace", // cool
- "Wm_jr_fireplace_ind", // cool
- "Wm_jr_shot",
- "Wm_jr_sweat",
- "Wm_ko_fireattack", // cool
- "Wm_ko_firehit", // cool
- "Wm_ko_firehitdie01", // cool
- "Wm_ko_firehitdie02", // cool
- "Wm_ko_firehitdie03", // cool
- "Wm_ko_magmapocha",
- "Wm_ko_magmapochabig",
- "Wm_ko_shout", // cool
- "Wm_ko_shout02", // cool
- "Wm_seacloudout", // cool
+// const char* effects_name_list [] = {
+// "Wm_jr_electricline", // cool
+// "Wm_jr_fireattack", // cool
+// "Wm_jr_firehit", // cool
+// "Wm_jr_fireplace", // cool
+// "Wm_jr_fireplace_ind", // cool
+// "Wm_jr_shot",
+// "Wm_jr_sweat",
+// "Wm_ko_fireattack", // cool
+// "Wm_ko_firehit", // cool
+// "Wm_ko_firehitdie01", // cool
+// "Wm_ko_firehitdie02", // cool
+// "Wm_ko_firehitdie03", // cool
+// "Wm_ko_magmapocha",
+// "Wm_ko_magmapochabig",
+// "Wm_ko_shout", // cool
+// "Wm_ko_shout02", // cool
+// "Wm_seacloudout", // cool
+// };
+
+
+const char* CBarcNameList [] = {
+ "KoopaShip",
+ "koopa",
+ "choropoo",
+ "koopa_clown_bomb",
+ "dossun",
+ NULL
};
-
class daCaptainBowser : public daBoss {
public:
int onCreate();
@@ -50,13 +59,19 @@ public:
ActivePhysics Roar;
mEf::es2 effect;
+ mEf::es2 shipDmgA;
+ mEf::es2 shipDmgB;
+ mEf::es2 shipDmgC;
+ mEf::es2 shipDmgD;
+ mEf::es2 shipDmgE;
+
char isAngry;
char isInvulnerable;
float scaleIncreaser;
- // int isInvulnerableCountdown;
- // int isTurningCountdown;
- // char charging;
- // int flashing;
+ int homingBillCountdown;
+ int homingBillSlot;
+ int maxDamage;
+ int playerCount;
static daCaptainBowser *build();
@@ -85,18 +100,18 @@ daCaptainBowser *daCaptainBowser::build() {
return new(buffer) daCaptainBowser;
}
-void ShipPhysicsCallback(daCaptainBowser *self, dStageActor_c *other) {
+void ShipPhysicsCallback(daCaptainBowser *self, dEn_c *other) {
if (other->name == 657) {
OSReport("CANNON COLLISION");
if (self->isInvulnerable) {
return;
}
- self->damage += 1;
+ self->damage -= 1;
- if (self->damage == 10) { self->doStateChange(&daCaptainBowser::StateID_Roar); }
- else if (self->damage > 20) { self->doStateChange(&daCaptainBowser::StateID_Outro); }
- else { self->doStateChange(&daCaptainBowser::StateID_Damage); }
+ other->doStateChange(&dEn_c::StateID_DieFumi);
+ if (self->damage == self->maxDamage/2) { self->doStateChange(&daCaptainBowser::StateID_Roar); }
+ else if (self->damage < 0) { self->doStateChange(&daCaptainBowser::StateID_Outro); }
}
}
@@ -104,6 +119,8 @@ void ShipPhysicsCallback(daCaptainBowser *self, dStageActor_c *other) {
// Externs and States
///////////////////////
+ extern "C" u32 GetActivePlayerCount();
+
CREATE_STATE(daCaptainBowser, Wait);
CREATE_STATE(daCaptainBowser, Throw);
CREATE_STATE(daCaptainBowser, Fire);
@@ -126,11 +143,15 @@ void ShipPhysicsCallback(daCaptainBowser *self, dStageActor_c *other) {
if (this->isInvulnerable) {
return;
}
- this->damage += 1;
+ this->damage -= 1;
+
+ spawnHitEffectAtPosition((Vec2){apOther->owner->pos.x, apOther->owner->pos.y});
+
+ ((dEn_c*)(apOther->owner))->doStateChange(&dEn_c::StateID_DieFumi);
- if (this->damage == 10) { doStateChange(&StateID_Roar); }
- else if (this->damage > 20) { doStateChange(&StateID_Outro); }
- else { doStateChange(&StateID_Damage); }
+ if (this->damage == this->maxDamage/2) { doStateChange(&StateID_Roar); }
+ else if (this->damage < 0) { doStateChange(&StateID_Outro); }
+ else { doStateChange(&StateID_Damage); }
}
}
@@ -178,8 +199,15 @@ int daCaptainBowser::onCreate() {
allocator.unlink();
// Prep the goods
+ this->playerCount = GetActivePlayerCount();
+ this->maxDamage = (10* this->playerCount) +10;
+
+
this->scale = (Vec){0.57, 0.57, 0.57};
-
+ this->homingBillCountdown = 270;
+ this->homingBillSlot = 0;
+
+ this->damage = this->maxDamage;
// Ship Physics!
// Normal rects are { left, top, right, bottom }
@@ -253,6 +281,43 @@ int daCaptainBowser::onExecute() {
bodyModel._vf1C();
shipModel._vf1C();
+
+ this->homingBillCountdown--;
+
+ if (this->homingBillCountdown == 0) {
+
+ Vec tempPos;
+
+ switch (this->homingBillSlot) {
+ case 0:
+ this->homingBillSlot++;
+ tempPos.x = this->pos.x - 26.0;
+ tempPos.y = this->pos.y + 40.0;
+ tempPos.z = this->pos.z + 2000.0;
+ break;
+
+ case 1:
+ this->homingBillSlot++;
+ tempPos.x = this->pos.x + 22.0;
+ tempPos.y = this->pos.y + 40.0;
+ tempPos.z = this->pos.z + 2000.0;
+ break;
+
+ case 2:
+ this->homingBillSlot = 0;
+ tempPos.x = this->pos.x + 70.0;
+ tempPos.y = this->pos.y + 40.0;
+ tempPos.z = this->pos.z + 2000.0;
+ break;
+ }
+
+ SpawnEffect("Wm_en_killervanish", 0, &tempPos, &(S16Vec){0,0,0}, &(Vec){0.1, 0.1, 0.1});
+ PlaySoundAsync(this, SE_EMY_SR_KILLER_SHOT);
+ CreateActor(EN_SEARCH_KILLER, 0, tempPos, 0, 0);
+
+ this->homingBillCountdown = (isAngry) ? 90: 180;
+ }
+
if(this->shipAnm.isAnimationDone()) {
this->shipAnm.setCurrentFrame(0.0);
}
@@ -407,10 +472,10 @@ int daCaptainBowser::onDraw() {
this->timer = 0;
this->scaleIncreaser = 0.5;
- this->Roar.info.xDistToEdge = 70.0 * scaleIncreaser;
- this->Roar.info.yDistToEdge = 70.0 * scaleIncreaser;
+ // this->Roar.info.xDistToEdge = 70.0 * scaleIncreaser;
+ // this->Roar.info.yDistToEdge = 70.0 * scaleIncreaser;
- this->Roar.addToList();
+ // this->Roar.addToList();
}
void daCaptainBowser::executeState_Roar() {
@@ -422,13 +487,13 @@ int daCaptainBowser::onDraw() {
scaleIncreaser += 0.014285;
effect.spawn("Wm_ko_shout", 0, &(Vec){pos.x-186.0+(scaleIncreaser*16.0), pos.y+138.0+(scaleIncreaser*16.0), pos.z}, &(S16Vec){0,0,0x7000}, &(Vec){scaleIncreaser, scaleIncreaser, scaleIncreaser});
- this->Roar.info.xDistToEdge = 70.0 * scaleIncreaser;
- this->Roar.info.yDistToEdge = 70.0 * scaleIncreaser;
+ // this->Roar.info.xDistToEdge = 70.0 * scaleIncreaser;
+ // this->Roar.info.yDistToEdge = 70.0 * scaleIncreaser;
}
- if (this->chrAnimation.getCurrentFrame() == 197.0) { // This is where the smackdown ends
- this->Roar.removeFromList();
- }
+ // if (this->chrAnimation.getCurrentFrame() == 197.0) { // This is where the smackdown ends
+ // this->Roar.removeFromList();
+ // }
if (this->chrAnimation.isAnimationDone()) {
doStateChange(&StateID_Wait);
diff --git a/src/bossKoopaThrow.cpp b/src/bossKoopaThrow.cpp
index 821a848..a8e1b0a 100644
--- a/src/bossKoopaThrow.cpp
+++ b/src/bossKoopaThrow.cpp
@@ -29,6 +29,15 @@ static const TypeInfo types[6] = {
};
+const char* KPTarcNameList [] = {
+ "choropoo",
+ "koopa_clown_bomb",
+ "dossun",
+ "KoopaShip",
+ NULL
+};
+
+
class daKoopaThrow : public dEn_c {
int onCreate();
int onExecute();
diff --git a/src/bossPlayerClown.cpp b/src/bossPlayerClown.cpp
index 522314e..6a7e2fc 100644
--- a/src/bossPlayerClown.cpp
+++ b/src/bossPlayerClown.cpp
@@ -21,6 +21,16 @@ extern "C" int PClownCarDraw(dEn_c *clown);
extern "C" void PClownCarMove(dEn_c *clown);
+
+
+const char* PCCarcNameList [] = {
+ "koopaJr_clown_ply",
+ NULL
+};
+
+
+
+
int CConDraw(dEn_c *clown) {
// setup cannon model
clown->matrix.translation(clown->pos.x, clown->pos.y + 8.0, clown->pos.z-100.0);
@@ -196,6 +206,22 @@ int daClownShot::onCreate() {
this->aPhysics.initWithStruct(this, &GreatBalls);
this->aPhysics.addToList();
+
+ // These fucking rects do something for the tile rect
+ spriteSomeRectX = 8.0f;
+ spriteSomeRectY = 8.0f;
+ _320 = 0.0f;
+ _324 = 0.0f;
+
+ // These structs tell stupid collider what to collide with - these are from koopa troopa
+ static const u8 one[16] = {0,0,0,1, 0,0,0xC0,0, 0,0,0x40,0, 0,0,0,0};
+ static const u8 two[12] = {0,0,0,0, 0,0,0,0, 0,0,0xC0,0};
+ static const u8 three[16] = {0,0,0,1, 0,0,0x60,0, 0,0,0x90,0, 0,0,0x60,0};
+
+ collMgr.Init(this, one, two, three);
+ collMgr.execute();
+
+
this->speed.y = 4.0;
this->y_speed_inc = -0.1875;
@@ -221,6 +247,7 @@ int daClownShot::onExecute() {
HandleXSpeed();
HandleYSpeed();
doSpriteMovement();
+ collMgr.execute();
effect.spawn("Wm_en_killersmoke", 0, &(Vec){pos.x, pos.y, pos.z}, &(S16Vec){0,0,0}, &(Vec){0.7, 0.7, 0.7});
diff --git a/src/meteor.cpp b/src/meteor.cpp
index 7d3a9bd..5eea95f 100755
--- a/src/meteor.cpp
+++ b/src/meteor.cpp
@@ -1,8 +1,12 @@
#include <common.h>
#include <game.h>
#include <g3dhax.h>
+#include <sfx.h>
+#include "boss.h"
-class dMeteor : public dStageActor_c {
+extern "C" void *PlaySound(dStageActor_c *, int soundID);
+
+class dMeteor : public dEn_c {
int onCreate();
int onDelete();
int onExecute();
@@ -13,14 +17,18 @@ class dMeteor : public dStageActor_c {
mHeapAllocator_c allocator;
m3d::mdl_c bodyModel;
nw4r::g3d::ResFile resFile;
+ mEf::es2 effect;
int timer;
int spinSpeed;
char spinDir;
+ char isElectric;
Physics MakeItRound;
void updateModelMatrices();
+ void playerCollision(ActivePhysics *apThis, ActivePhysics *apOther);
+ void collisionCat7_WMWaggleWater(ActivePhysics *apThis, ActivePhysics *apOther);
};
dMeteor *dMeteor::build() {
@@ -28,11 +36,24 @@ dMeteor *dMeteor::build() {
return new(buffer) dMeteor;
}
+const char* MEarcNameList [] = {
+ "kazan_rock",
+ NULL
+};
// extern "C" dStageActor_c *GetSpecificPlayerActor(int num);
// extern "C" void *modifyPlayerPropertiesWithRollingObject(dStageActor_c *Player, float _52C);
+void dMeteor::playerCollision(ActivePhysics *apThis, ActivePhysics *apOther) {
+ DamagePlayer(this, apThis, apOther);
+}
+
+void dMeteor::collisionCat7_WMWaggleWater(ActivePhysics *apThis, ActivePhysics *apOther) {
+ DamagePlayer(this, apThis, apOther);
+}
+
+
int dMeteor::onCreate() {
// Setup Model
@@ -55,8 +76,29 @@ int dMeteor::onCreate() {
// Other settings
this->spinDir = this->settings & 0x1;
this->spinSpeed = ((this->settings >> 16) & 0xFF) * 20;
-
+ this->isElectric = (this->settings >> 4) & 0x1;
+
+
// Setup Physics
+ if (isElectric) {
+ ActivePhysics::Info elec;
+ elec.xDistToCenter = 0.0;
+ elec.yDistToCenter = 0.0;
+
+ elec.xDistToEdge = 13.0 * sca;
+ elec.yDistToEdge = 13.0 * sca;
+
+ elec.category1 = 0x3;
+ elec.category2 = 0x0;
+ elec.bitfield1 = 0x4F;
+ elec.bitfield2 = 0x200;
+ elec.unkShort1C = 0;
+ elec.callback = &dEn_c::collisionCallback;
+
+ this->aPhysics.initWithStruct(this, &elec);
+ this->aPhysics.addToList();
+ }
+
MakeItRound.baseSetup(this, 0, 0, 0, 1, 0);
MakeItRound.x = 0.0;
@@ -87,6 +129,11 @@ int dMeteor::onExecute() {
MakeItRound.update();
updateModelMatrices();
+ if (isElectric) {
+ effect.spawn("Wm_en_birikyu_biri", 0, &(Vec){pos.x, pos.y, pos.z+500.0}, &rot, &(Vec){scale.x*0.8, scale.y*0.8, scale.z*0.8});
+ PlaySound(this, SE_EMY_BIRIKYU_SPARK);
+ }
+
// for (i=0; i<4; i++) {
// dStageActor_c *player = GetSpecificPlayerActor(i);
// modifyPlayerPropertiesWithRollingObject(player, );
diff --git a/src/spritetex.S b/src/spritetex.S
index 452d3d2..18a09e1 100755
--- a/src/spritetex.S
+++ b/src/spritetex.S
@@ -524,111 +524,35 @@ TEX_PokeySnowman:
slwi r10, r10, 2 # size *= 4 (size of float)
lfsx f0, r11, r10 # get it from the array
- blr
-
-
-SnowmanPokey:
-
- lfs f0, 0x54(r31)
- blr
-
-
-
-
-.global TEX_PokeySnowmanPosF
-TEX_PokeySnowmanPosF:
-
- lwz r10, 4(r31)
- andi. r10, r10, 0xF
-
- lis r11, SnowmanTable@h
- ori r11, r11, SnowmanTable@l
- slwi r10, r10, 2 # size *= 4 (size of float)
- lfsx f2, r11, r10 # get it from the array
-
- fmuls f0, f0, f2
- stfs f0, 0xB0(r30)
- blr
-
-.global TEX_PokeySnowmanPosE
-TEX_PokeySnowmanPosE:
-
- lwz r10, 4(r31)
- andi. r10, r10, 0xF
-
- lis r11, SnowmanTable@h
- ori r11, r11, SnowmanTable@l
- slwi r10, r10, 2 # size *= 4 (size of float)
- lfsx f2, r11, r10 # get it from the array
+ # We should probably change ActivePhysics and maybe some other rects here
+ addi r10, r30, 0x148
- fmuls f31, f31, f2
- stfs f31, 0xB0(r29)
- blr
+ lfs f10, 0(r10)
+ fmuls f10, f0, f10
+ stfs f10, 0(r10)
-.global TEX_PokeySnowmanPosD
-TEX_PokeySnowmanPosD:
+ lfs f10, 4(r10)
+ fmuls f10, f0, f10
+ stfs f10, 4(r10)
- lwz r10, 4(r31)
- andi. r10, r10, 0xF
+ lfs f10, 8(r10)
+ fmuls f10, f0, f10
+ stfs f10, 8(r10)
- lis r11, SnowmanTable@h
- ori r11, r11, SnowmanTable@l
- slwi r10, r10, 2 # size *= 4 (size of float)
- lfsx f2, r11, r10 # get it from the array
+ lfs f10, 0xC(r10)
+ fmuls f10, f0, f10
+ stfs f10, 0xC(r10)
- fmuls f1, f1, f2
- stfs f1, 0xB0(r30)
blr
+
+SnowmanPokey:
-.global TEX_PokeySnowmanPosC
-TEX_PokeySnowmanPosC:
-
- lwz r10, 4(r31)
- andi. r10, r10, 0xF
-
- lis r11, SnowmanTable@h
- ori r11, r11, SnowmanTable@l
- slwi r10, r10, 2 # size *= 4 (size of float)
- lfsx f2, r11, r10 # get it from the array
-
- fmuls f0, f0, f2
- stfs f0, 0xB0(r31)
- blr
-
-
-.global TEX_PokeySnowmanPosB
-TEX_PokeySnowmanPosB:
-
- lwz r10, 4(r31)
- andi. r10, r10, 0xF
-
- lis r11, SnowmanTable@h
- ori r11, r11, SnowmanTable@l
- slwi r10, r10, 2 # size *= 4 (size of float)
- lfsx f0, r11, r10 # get it from the array
-
- fmuls f1, f1, f0
- stfs f1, 0x18(r1)
+ lfs f0, 0x54(r31)
blr
-.global TEX_PokeySnowmanPosA
-TEX_PokeySnowmanPosA:
-
- lwz r10, 4(r31)
- andi. r10, r10, 0xF
-
- lis r11, SnowmanTable@h
- ori r11, r11, SnowmanTable@l
- slwi r10, r10, 2 # size *= 4 (size of float)
- lfsx f0, r11, r10 # get it from the array
-
- fmuls f3, f3, f0
- stfs f3, 0x168(r31)
- blr
-
.global TEX_PokeySnowmanPos
TEX_PokeySnowmanPos:
@@ -1277,7 +1201,7 @@ ConvertFloat:
SnowmanTable:
- .float 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 5.5, 6.0, 6.5
+ .float 1.0, 1.333, 1.666, 2.0, 2.333, 2.666, 3.0, 3.333, 3.666, 4.0, 4.333, 4.666
AddAmount:
.float 32.0