Made celebration star appear above correct player

Celebration sparkles appear around all players
This commit is contained in:
MysterD 2020-09-19 17:28:11 -07:00
parent c013f9d16a
commit bbdc3180cd
4 changed files with 22 additions and 8 deletions

View file

@ -1,10 +1,10 @@
// celebration_star.c.inc
void bhv_celebration_star_init(void) {
o->oHomeX = gMarioObject->header.gfx.pos[0];
o->oPosY = gMarioObject->header.gfx.pos[1] + 30.0f;
o->oHomeZ = gMarioObject->header.gfx.pos[2];
o->oMoveAngleYaw = gMarioObject->header.gfx.angle[1] + 0x8000;
o->oHomeX = o->parentObj->header.gfx.pos[0];
o->oPosY = o->parentObj->header.gfx.pos[1] + 30.0f;
o->oHomeZ = o->parentObj->header.gfx.pos[2];
o->oMoveAngleYaw = o->parentObj->header.gfx.angle[1] + 0x8000;
o->oCelebStarDiameterOfRotation = 100;
#if BUGFIX_STAR_BOWSER_KEY
if (gCurrLevelNum == LEVEL_BOWSER_1 || gCurrLevelNum == LEVEL_BOWSER_2) {
@ -58,7 +58,7 @@ void celeb_star_act_face_camera(void) {
#endif
o->oFaceAngleYaw += 0x1000;
} else {
o->oFaceAngleYaw = gMarioObject->header.gfx.angle[1];
o->oFaceAngleYaw = o->parentObj->header.gfx.angle[1];
}
if (o->oTimer == 59)

View file

@ -859,7 +859,12 @@ u32 interact_star_or_key(struct MarioState *m, UNUSED u32 interactType, struct O
starGrabAction = ACT_FALL_AFTER_STAR_GRAB;
}
spawn_object(o, MODEL_NONE, bhvStarKeyCollectionPuffSpawner);
for (int i = 0; i < MAX_PLAYERS; i++) {
struct MarioState* marioState = &gMarioStates[i];
if (!is_player_active(marioState)) { continue; }
if (marioState->marioObj == NULL) { continue; }
spawn_object(marioState->marioObj, MODEL_NONE, bhvStarKeyCollectionPuffSpawner);
}
o->oInteractStatus = INT_STATUS_INTERACTED;
m->interactObj = o;

View file

@ -28,6 +28,7 @@
#include "seq_ids.h"
#include "sound_init.h"
#include "thread6.h"
#include "obj_behaviors.h"
#include "../../include/libc/stdlib.h"
#include "pc/pc_main.h"
#include "pc/network/network.h"
@ -647,7 +648,15 @@ void general_star_dance_handler(struct MarioState *m, s32 isInWater) {
if (m->actionState == 0) {
switch (++m->actionTimer) {
case 1:
spawn_object(m->marioObj, MODEL_STAR, bhvCelebrationStar);
for (int i = 0; i < MAX_PLAYERS; i++) {
struct MarioState* marioState = &gMarioStates[i];
if (!is_player_active(marioState)) { continue; }
if (marioState->marioObj == NULL) { continue; }
struct Object* celebStar = spawn_object(marioState->marioObj, MODEL_STAR, bhvCelebrationStar);
if (m != marioState && celebStar != NULL) {
celebStar->header.gfx.node.flags |= GRAPH_RENDER_INVISIBLE;
}
}
disable_background_sound();
if (m->actionArg & 1) {
play_course_clear();

View file

@ -5,7 +5,7 @@
#ifdef DEBUG
static u8 warpToLevel = LEVEL_CCM;
static u8 warpToLevel = LEVEL_BOB;
#define SCANCODE_0 0x0B
#define SCANCODE_3 0x04