Mario Kart 64
Loading...
Searching...
No Matches
update.inc.c
Go to the documentation of this file.
1#include <actors.h>
2#include <main.h>
3
9void update_actor_fake_item_box(struct FakeItemBox *fake_item_box) {
10 u32 temp_v1 = fake_item_box->playerId;
12 struct Controller *temp_v1_3;
13
14 UNUSED s32 pad[7];
19 UNUSED s32 pad2[3];
20
21 switch(fake_item_box->state) {
22 case 0:
23 fake_item_box->boundingBoxSize = fake_item_box->sizeScaling * 5.5f;
24 fake_item_box->rot[0] -= 0xB6;
25 fake_item_box->rot[1] += 0x16C;
26 fake_item_box->rot[2] -= 0xB6;
27
28 temp_f14 = temp_v0_4->pos[0] - fake_item_box->pos[0];
29 temp_f16 = temp_v0_4->pos[1] - fake_item_box->pos[1];
30 temp_f18 = temp_v0_4->pos[2] - fake_item_box->pos[2];
31
36 fake_item_box->pos[0] = temp_v0_4->pos[0] - temp_f14;
37 fake_item_box->pos[1] = (temp_v0_4->pos[1] - temp_f16) - 1.0f;
38 fake_item_box->pos[2] = temp_v0_4->pos[2] - temp_f18;
39 func_802ADDC8(&fake_item_box->unk30, fake_item_box->boundingBoxSize, fake_item_box->pos[0], fake_item_box->pos[1], fake_item_box->pos[2]);
42 if ((temp_v0_4->type & 0x4000) != 0) {
43
44 if ((temp_v1_3->buttonDepressed & Z_TRIG) != 0) {
45 temp_v1_3->buttonDepressed &= 0xDFFF;
47 temp_v0_4->soundEffects &= 0xFFFBFFFF;
48 func_800C9060((u8)(temp_v0_4 - gPlayerOne), SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x12));
49 }
50 }
51 break;
52 case 1:
53 if (fake_item_box->sizeScaling < 1.0f) {
54 fake_item_box->sizeScaling += 0.05f;
55 } else if (fake_item_box->sizeScaling >= 1.0f) {
56 fake_item_box->sizeScaling = 1.0f;
57 }
58
59 fake_item_box->boundingBoxSize = fake_item_box->sizeScaling * 5.5f;
60 if (fake_item_box->targetY <= fake_item_box->pos[1]) {
61 fake_item_box->pos[1] = fake_item_box->targetY;
62 } else {
63 fake_item_box->pos[1] += 0.2f;
64 }
65 if ((fake_item_box->flags & 0x1000) != 0) {
66 if ((fake_item_box->someTimer <= 0) || (fake_item_box->someTimer >= 0x12D)) {
67 fake_item_box->flags &= 0xEFFF;
68 fake_item_box->someTimer = 0;
69 } else {
70 fake_item_box->someTimer--;
71 }
72 }
73 fake_item_box->rot[0] -= 0xB6;
74 fake_item_box->rot[1] += 0x16C;
75 fake_item_box->rot[2] -= 0xB6;
76 break;
77
78 case 2:
79 if ((fake_item_box->someTimer >= 0x14) || (fake_item_box->someTimer < 0)) {
81 } else {
82 fake_item_box->someTimer++;
83 fake_item_box->rot[0] += 0x444;
84 fake_item_box->rot[1] -= 0x2D8;
85 fake_item_box->rot[2] += 0x16C;
86 }
87 break;
88 default:
90 break;
91 }
92}
void destroy_actor(struct Actor *actor)
Definition actors.c:1291
void func_802A1064(struct FakeItemBox *fake_item_box)
Definition actors.c:2292
void func_802B4E30(struct Actor *arg0)
Definition actors_extended.c:962
s16 gCourseMaxZ
Definition code_800029B0.c:92
u16 func_802ADDC8(Collision *collision, f32 boundingBoxSize, f32 posX, f32 posY, f32 posZ)
Definition collision.c:1349
void func_800C9060(u8 playerId, u32 soundBits)
Definition external.c:2894
void update_actor_fake_item_box(struct FakeItemBox *fake_item_box)
Updates the fake item box actor.
Definition update.inc.c:9
#define UNUSED
Definition macros.h:24
Player * gPlayerOne
Definition main.c:74
Player gPlayers[NUM_PLAYERS]
Definition main.c:73
struct Controller gControllers[NUM_PLAYERS]
Definition main.c:63
float sqrtf(float)
#define Z_TRIG
Definition os.h:398
#define SOUND_ARG_LOAD(sound_bank, byte2, byte3, sound_id)
Definition sounds.h:14
Definition actor_types.h:120
Definition common_structs.h:71
u16 buttonDepressed
Definition common_structs.h:76
Definition actor_types.h:346
Definition common_structs.h:269
signed int s32
Definition ultratypes.h:15
unsigned int u32
Definition ultratypes.h:16
float f32
Definition ultratypes.h:33
unsigned char u8
Definition ultratypes.h:12