diff options
author | Colin Noga <Tempus@chronometry.ca> | 2012-03-24 16:45:49 -0500 |
---|---|---|
committer | Colin Noga <Tempus@chronometry.ca> | 2012-03-24 16:45:49 -0500 |
commit | 3764377091ad23145fbd92c769b78ce2f296900f (patch) | |
tree | 6b0dddcb86086c80dfdcffa962ca2ccc00d51d3c /src/meteor.cpp | |
parent | 393be37f168ba7bca4d471993aaf0899a4afc16b (diff) | |
download | kamek-3764377091ad23145fbd92c769b78ce2f296900f.tar.gz kamek-3764377091ad23145fbd92c769b78ce2f296900f.zip |
Changes to loads of shit, mostly bowser related
Diffstat (limited to '')
-rwxr-xr-x | src/meteor.cpp | 51 |
1 files changed, 49 insertions, 2 deletions
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, ); |