summaryrefslogtreecommitdiff
path: root/src/bossWrenchThrow.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/bossWrenchThrow.cpp40
1 files changed, 12 insertions, 28 deletions
diff --git a/src/bossWrenchThrow.cpp b/src/bossWrenchThrow.cpp
index 1abc226..af5e272 100644
--- a/src/bossWrenchThrow.cpp
+++ b/src/bossWrenchThrow.cpp
@@ -1,10 +1,8 @@
#include <common.h>
#include <game.h>
#include <g3dhax.h>
-#include "player.h"
-#include "effects.h"
#include <sfx.h>
-
+#include "boss.h"
class daWrench : public dEn_c {
int onCreate();
@@ -46,24 +44,10 @@ CREATE_STATE(daWrench, Straight);
CREATE_STATE(daWrench, Kaboom);
-extern "C" void *PlaySound(dEn_c *, int soundID);
-extern "C" void *PlaySoundAsync(dEn_c *, int soundID);
extern "C" void *PlayWrenchSound(dEn_c *);
-extern "C" dStageActor_c *GetSpecificPlayerActor(int number);
-extern "C" u32 GenerateRandomNumber(int max);
-
-
-void daWrench::playerCollision(ActivePhysics *apThis, ActivePhysics *apOther) {
- this->dEn_c::playerCollision(apThis, apOther);
- this->_vf220(apOther->owner);
- this->isDead = 0;
- this->flags_4FC |= (1<<(31-7));
- if(apOther->owner->which_player < 4) {
- this->counter_504[apOther->owner->which_player] = 0;
- }
-}
+void daWrench::playerCollision(ActivePhysics *apThis, ActivePhysics *apOther) { DamagePlayer(this, apThis, apOther); }
void daWrench::collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, ActivePhysics *apOther) { }
bool daWrench::collisionCat2_IceBall_15_YoshiIce(ActivePhysics *apThis, ActivePhysics *apOther) {
@@ -71,7 +55,7 @@ bool daWrench::collisionCat2_IceBall_15_YoshiIce(ActivePhysics *apThis, ActivePh
}
void daWrench::collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysics *apOther) {}
void daWrench::collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics *apOther) {
- CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){0.5, 0.5, 0.5}, 48);
+ SpawnEffect("Wm_ob_cmnboxgrain", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){0.5, 0.5, 0.5});
PlaySoundAsync(this, SE_BOSS_JR_FLOOR_BREAK);
this->Delete(1);
@@ -80,7 +64,7 @@ void daWrench::collisionCat14_YoshiFire(ActivePhysics *apThis, ActivePhysics *ap
void daWrench::collisionCat7_WMWaggleWater(ActivePhysics *apThis, ActivePhysics *apOther) {
this->_vf220(apOther->owner);
- CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){0.5, 0.5, 0.5}, 48);
+ SpawnEffect("Wm_ob_cmnboxgrain", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){0.5, 0.5, 0.5});
PlaySoundAsync(this, SE_BOSS_JR_FLOOR_BREAK);
this->Delete(1);
@@ -239,8 +223,8 @@ void daWrench::executeState_Kaboom() {
// hit the ground
PlaySoundAsync(this, SE_BOSS_JR_BOMB_BURST);
- CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){0.75, 0.75, 0.75}, 9);
- CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){1.25, 1.25, 1.25}, 167);
+ SpawnEffect("Wm_en_burst_s", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){0.75, 0.75, 0.75});
+ SpawnEffect("Wm_mr_wirehit", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){1.25, 1.25, 1.25});
this->Delete(1);
}
if (collMgr.bitfield_for_checks & (0x15 << direction)) {
@@ -248,12 +232,12 @@ void daWrench::executeState_Kaboom() {
PlaySoundAsync(this, SE_BOSS_JR_BOMB_BURST);
if (this->direction == 0) { // directions 1 spins clockwise, fly rightwards
- CreateEffect(&this->pos, &(S16Vec){0,0x4000,0}, &(Vec){0.75, 0.75, 0.75}, 9);
- CreateEffect(&this->pos, &(S16Vec){0,0x4000,0}, &(Vec){1.25, 1.25, 1.25}, 167);
+ SpawnEffect("Wm_en_burst_s", 0, &this->pos, &(S16Vec){0,0x4000,0}, &(Vec){0.75, 0.75, 0.75});
+ SpawnEffect("Wm_mr_wirehit", 0, &this->pos, &(S16Vec){0,0x4000,0}, &(Vec){1.25, 1.25, 1.25});
}
else { // directions 0 spins anti-clockwise, fly leftwards
- CreateEffect(&this->pos, &(S16Vec){0,0xE000,0}, &(Vec){0.75, 0.75, 0.75}, 9);
- CreateEffect(&this->pos, &(S16Vec){0,0xE000,0}, &(Vec){1.25, 1.25, 1.25}, 167);
+ SpawnEffect("Wm_en_burst_s", 0, &this->pos, &(S16Vec){0,0xE000,0}, &(Vec){0.75, 0.75, 0.75});
+ SpawnEffect("Wm_mr_wirehit", 0, &this->pos, &(S16Vec){0,0xE000,0}, &(Vec){1.25, 1.25, 1.25});
}
this->Delete(1);
@@ -298,14 +282,14 @@ void daWrench::executeState_Straight() {
// hit the ground
PlaySoundAsync(this, SE_BOSS_JR_FLOOR_BREAK);
- CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){0.75, 0.75, 0.75}, 9);
+ SpawnEffect("Wm_en_burst_s", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){0.75, 0.75, 0.75});
this->Delete(1);
}
if (collMgr.bitfield_for_checks & (0x15 << direction)) {
// hit the wall
PlaySoundAsync(this, SE_BOSS_JR_FLOOR_BREAK);
- CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){0.75, 0.75, 0.75}, 9);
+ SpawnEffect("Wm_en_burst_s", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){0.75, 0.75, 0.75});
this->Delete(1);
}