mirror of https://github.com/n64decomp/mk64.git
Add bomb effect and fix bug
This commit is contained in:
parent
d08668f98a
commit
cd031179c3
|
|
@ -334,31 +334,31 @@ enum PLACE { FIRST_PLACE, SECOND_PLACE, THIRD_PLACE, FOURTH_PLACE };
|
|||
*/
|
||||
/*
|
||||
*/
|
||||
#define HIT_BANANA_SOUND_EFFECT 0x1 // hits a banana
|
||||
#define HIT_RED_BLUE_MOLE_SOUND_EFFECT 0x2 // hit by a red shell, blue shell, or hit a mole
|
||||
#define HIT_GREEN_SHELL_SOUND_EFFECT 0x4 // hit by a green shell
|
||||
#define DRIVING_SPINOUT_SOUND_EFFECT 0x80 // spinning out from erratic driving
|
||||
#define THWOMP_STOMP_SOUND_EFFECT 0x100 // hitting an object (actually, stomped by thwomp)*
|
||||
#define BOOST_SOUND_EFFECT 0x200 // being boosted by trigger a mushroom
|
||||
#define BOO_SOUND_EFFECT 0x800 // being a boo
|
||||
#define UNUSED_SOUND_EFFECT_0x1000 0x1000
|
||||
#define STAR_SOUND_EFFECT 0x2000 // Starting a star
|
||||
#define LIGHTNING_STRIKE_SOUND_EFFECT 0x4000 // hitting a rotating object (actually struck by lightning)
|
||||
#define BOOST_RAMP_WOOD_SOUND_EFFECT 0x8000 // being boosted by a ramp
|
||||
#define UNUSED_SOUND_EFFECT_0x20000 0x20000 //*
|
||||
#define DRAG_ITEM_SOUND_EFFECT 0x40000 //* holding a banana (or a banana bunch or a fake item block)// confirmed but ongoing, so not really a sound effect
|
||||
#define HIT_PADDLE_BOAT_SOUND_EFFECT 0x80000 //* hit paddle boat
|
||||
#define UNUSED_SOUND_EFFECT_0x10000 0x100000 //*
|
||||
#define SPINOUT_SOUND_EFFECT 0x200000 // hit crab or spiny spinout or losing versus race
|
||||
#define HIT_FAKE_ITEM_SOUND_EFFECT 0x400000 // actually hitting a fake item / bomb
|
||||
#define HIT_BANANA_SOUND_EFFECT 0x1 // hits a banana
|
||||
#define HIT_RED_BLUE_MOLE_SOUND_EFFECT 0x2 // hit by a red shell, blue shell, or hit a mole
|
||||
#define HIT_GREEN_SHELL_SOUND_EFFECT 0x4 // hit by a green shell
|
||||
#define DRIVING_SPINOUT_SOUND_EFFECT 0x80 // spinning out from erratic driving
|
||||
#define THWOMP_STOMP_SOUND_EFFECT 0x100 // hitting an object (actually, stomped by thwomp)*
|
||||
#define BOOST_SOUND_EFFECT 0x200 // being boosted by trigger a mushroom
|
||||
#define BOO_SOUND_EFFECT 0x800 // being a boo
|
||||
#define UNUSED_SOUND_EFFECT_0x1000 0x1000 // Unused
|
||||
#define STAR_SOUND_EFFECT 0x2000 // Starting a star
|
||||
#define LIGHTNING_STRIKE_SOUND_EFFECT 0x4000 // hitting a rotating object (actually struck by lightning)
|
||||
#define BOOST_RAMP_WOOD_SOUND_EFFECT 0x8000 // being boosted by a ramp
|
||||
#define UNUSED_SOUND_EFFECT_0x20000 0x20000 //* Unused
|
||||
#define DRAG_ITEM_SOUND_EFFECT 0x40000 //* holding a banana (or a banana bunch or a fake item block)// confirmed but ongoing, so not really a sound effect
|
||||
#define HIT_PADDLE_BOAT_SOUND_EFFECT 0x80000 //* hit paddle boat
|
||||
#define UNUSED_SOUND_EFFECT_0x10000 0x100000 //* Unused
|
||||
#define SPINOUT_SOUND_EFFECT 0x200000 // hit crab or spiny spinout or losing versus race
|
||||
#define HIT_FAKE_ITEM_SOUND_EFFECT 0x400000 // actually hitting a fake item / bomb
|
||||
#define BOOST_RAMP_ASPHALT_SOUND_EFFECT 0x800000 // being boosted by a boost pad // confirmed but not every time
|
||||
#define HIT_BY_STAR_SOUND_EFFECT 0x1000000 // being hit by a star
|
||||
#define START_BOOST_SOUND_EFFECT 0x2000000 //* Start boost sound effect
|
||||
#define LOSE_BATTLE_SOUND_EFFECT 0x4000000 //* When losing battle mode
|
||||
#define UNKNOWN_SOUND_EFFECT_0x08000000 0x08000000 //* Related to battle mode. Becoming a bomb?
|
||||
#define START_SPINOUT_SOUND_EFFECT 0x10000000 //* Spinning out by holding gas at start of race
|
||||
#define HIT_BY_STAR_SOUND_EFFECT 0x1000000 // being hit by a star
|
||||
#define START_BOOST_SOUND_EFFECT 0x2000000 //* Start boost sound effect
|
||||
#define LOSE_BATTLE_SOUND_EFFECT 0x4000000 //* When losing battle mode
|
||||
#define BECOME_BOMB_SOUND_EFFECT 0x8000000 //* When becoming a bomb in battle mode
|
||||
#define START_SPINOUT_SOUND_EFFECT 0x10000000 //* Spinning out by holding gas at start of race
|
||||
|
||||
#define ALL_SOUND_EFFECTS (0xFFFFFFFF )
|
||||
#define ALL_SOUND_EFFECTS (0xFFFFFFFF)
|
||||
#define RACING_SPINOUT_SOUND_EFFECTS (SPINOUT_SOUND_EFFECT | DRIVING_SPINOUT_SOUND_EFFECT | HIT_BANANA_SOUND_EFFECT) // 0x200081
|
||||
#define RAMP_BOOST_SOUND_EFFECTS (BOOST_RAMP_ASPHALT_SOUND_EFFECT | BOOST_RAMP_WOOD_SOUND_EFFECT) // 0x00808000
|
||||
#define ANY_BOOST_SOUND_EFFECTS (RAMP_BOOST_SOUND_EFFECTS | BOOST_SOUND_EFFECT) // 0x00808200
|
||||
|
|
|
|||
|
|
@ -1185,7 +1185,7 @@ s32 func_80089B50(s32 objectIndex) {
|
|||
(player->type & PLAYER_EXISTS) && !(player->type & PLAYER_INVISIBLE_OR_BOMB) &&
|
||||
(has_collided_horizontally_with_player(objectIndex, player) != 0)) {
|
||||
if (!(player->effects & STAR_EFFECT)) {
|
||||
player->soundEffects |= REVERSE_SOUND_EFFECT;
|
||||
player->soundEffects |= HIT_FAKE_ITEM_SOUND_EFFECT;
|
||||
if (is_obj_flag_status_active(objectIndex, 0x04000000) != 0) {
|
||||
func_80072180();
|
||||
}
|
||||
|
|
@ -1212,7 +1212,7 @@ s32 func_80089CBC(s32 objectIndex, f32 arg1) {
|
|||
if ((player->type & PLAYER_EXISTS) && !(player->type & PLAYER_INVISIBLE_OR_BOMB) &&
|
||||
(has_collided_with_player_and_within_height(objectIndex, player, arg1) != 0)) {
|
||||
if (!(player->effects & STAR_EFFECT)) {
|
||||
player->soundEffects |= REVERSE_SOUND_EFFECT;
|
||||
player->soundEffects |= HIT_FAKE_ITEM_SOUND_EFFECT;
|
||||
if (is_obj_flag_status_active(objectIndex, 0x04000000) != 0) {
|
||||
func_80072180();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1523,7 +1523,7 @@ void func_8008FC64(Player* player, s8 arg1) {
|
|||
if (player->alpha < 5) {
|
||||
player->alpha = ALPHA_MIN;
|
||||
player->soundEffects &= ~LOSE_BATTLE_SOUND_EFFECT;
|
||||
player->soundEffects |= UNKNOWN_SOUND_EFFECT_0x08000000;
|
||||
player->soundEffects |= BECOME_BOMB_SOUND_EFFECT;
|
||||
player->type |= PLAYER_UNKNOWN_0x40;
|
||||
|
||||
func_8008FDA8(player, arg1);
|
||||
|
|
@ -1535,7 +1535,7 @@ void func_8008FCDC(Player* player, s8 playerIndex) {
|
|||
player->alpha += 2;
|
||||
if (player->alpha >= 0xF0) {
|
||||
player->alpha = ALPHA_MAX;
|
||||
player->soundEffects &= ~UNKNOWN_SOUND_EFFECT_0x08000000;
|
||||
player->soundEffects &= ~BECOME_BOMB_SOUND_EFFECT;
|
||||
}
|
||||
|
||||
func_80056A40(playerIndex, (u32) player->alpha);
|
||||
|
|
|
|||
|
|
@ -2001,7 +2001,7 @@ void apply_effect(Player* player, s8 playerIndex, s8 arg2) {
|
|||
if (player->soundEffects & LOSE_BATTLE_SOUND_EFFECT) {
|
||||
func_8008FC64(player, playerIndex);
|
||||
}
|
||||
if (player->soundEffects & UNKNOWN_SOUND_EFFECT_0x08000000) {
|
||||
if (player->soundEffects & BECOME_BOMB_SOUND_EFFECT) {
|
||||
func_8008FCDC(player, playerIndex);
|
||||
}
|
||||
}
|
||||
|
|
@ -3337,6 +3337,7 @@ void player_accelerate_alternative(Player* player) {
|
|||
player->unk_08C = (player->currentSpeed * player->currentSpeed) / 25.0f;
|
||||
}
|
||||
player->unk_044 |= 0x20;
|
||||
// Hacky way to check for START_SPINOUT_SOUND_EFFECT
|
||||
if ((player->soundEffects * 8) < 0) {
|
||||
func_8008F104(player, player_index);
|
||||
player->soundEffects &= ~START_SPINOUT_SOUND_EFFECT;
|
||||
|
|
@ -3361,6 +3362,7 @@ void player_decelerate_alternative(Player* player, f32 speed) {
|
|||
player->unk_08C = (player->currentSpeed * player->currentSpeed) / 25.0f;
|
||||
}
|
||||
player->unk_044 &= 0xFFDF;
|
||||
// Hacky way to check for START_SPINOUT_SOUND_EFFECT
|
||||
if ((player->soundEffects * 8) < 0) {
|
||||
func_8008F104(player, player_index);
|
||||
player->soundEffects &= ~START_SPINOUT_SOUND_EFFECT;
|
||||
|
|
|
|||
|
|
@ -1502,7 +1502,7 @@ void render_kart(Player* player, s8 playerId, s8 arg2, s8 flipOffset) {
|
|||
AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_WRAP | ZMODE_XLU | CVG_X_ALPHA | FORCE_BL |
|
||||
GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA));
|
||||
}
|
||||
} else if (((player->unk_0CA & 4) == 4) || (player->soundEffects & UNKNOWN_SOUND_EFFECT_0x08000000) ||
|
||||
} else if (((player->unk_0CA & 4) == 4) || (player->soundEffects & BECOME_BOMB_SOUND_EFFECT) ||
|
||||
(player->soundEffects & LOSE_BATTLE_SOUND_EFFECT)) {
|
||||
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxKart[playerId + (arg2 * 8)]),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
|
|
|||
Loading…
Reference in New Issue