sm64pc/src/game/behaviors/collide_particles.inc.c

85 lines
2.7 KiB
C
Raw Normal View History

2019-08-25 04:46:40 +00:00
// collide_particles.c.inc
s16 D_8032F2CC[] = { 0xD000, 0, 0x3000, 0, 0xDE67, 0x2199,
0x2199, 0x2199, 0xDE67, 0xDE67, 0x2199, 0xDE67 };
s16 D_8032F2E4[] = { 0xE000, 0, 0, 0, 0x2000, 0, 0xE99A,
0x1666, 0x1666, 0x1666, 0xE99A, 0xE99A, 0x1666, 0xE99A };
void bhv_punch_tiny_triangle_loop(void) {
s16 sp1E;
if (o->oTimer == 0) {
sp1E = o->oMoveAngleYaw;
2019-10-05 19:08:05 +00:00
o->oCollisionParticleUnkF4 = 1.28f;
2020-03-02 03:42:52 +00:00
cur_obj_set_pos_relative(gMarioObject, 0.0f, 60.0f, 100.0f);
o->oMoveAngleYaw = sp1E;
2019-08-25 04:46:40 +00:00
}
2020-03-02 03:42:52 +00:00
cur_obj_move_using_fvel_and_gravity();
2019-08-25 04:46:40 +00:00
o->oAnimState = 5;
2020-03-02 03:42:52 +00:00
cur_obj_scale(o->oCollisionParticleUnkF4);
2019-10-05 19:08:05 +00:00
o->oCollisionParticleUnkF4 -= 0.2f;
2019-08-25 04:46:40 +00:00
if (gDebugInfo[4][0] + 6 < o->oTimer)
2020-03-02 03:42:52 +00:00
obj_mark_for_deletion(o);
2019-08-25 04:46:40 +00:00
}
void bhv_punch_tiny_triangle_init(void) {
s32 i;
UNUSED s32 unused;
struct Object *triangle;
for (i = 0; i < 6; i++) {
triangle = spawn_object(o, MODEL_DIRT_ANIMATION, bhvPunchTinyTriangle);
triangle->oMoveAngleYaw = gMarioObject->oMoveAngleYaw + D_8032F2CC[2 * i] + 0x8000;
triangle->oVelY = sins(D_8032F2CC[2 * i + 1]) * 25.0f;
triangle->oForwardVel = coss(D_8032F2CC[2 * i + 1]) * 25.0f;
}
}
void bhv_wall_tiny_star_particle_loop(void) {
s16 sp1E;
if (o->oTimer == 0) {
sp1E = o->oMoveAngleYaw;
2019-10-05 19:08:05 +00:00
o->oCollisionParticleUnkF4 = 0.28f;
2020-03-02 03:42:52 +00:00
cur_obj_set_pos_relative(gMarioObject, 0.0f, 30.0f, 110.0f);
2019-08-25 04:46:40 +00:00
o->oMoveAngleYaw = sp1E;
}
2020-03-02 03:42:52 +00:00
cur_obj_move_using_fvel_and_gravity();
2019-08-25 04:46:40 +00:00
o->oAnimState = 4;
2020-03-02 03:42:52 +00:00
cur_obj_scale(o->oCollisionParticleUnkF4);
2019-10-05 19:08:05 +00:00
o->oCollisionParticleUnkF4 -= 0.015f;
2019-08-25 04:46:40 +00:00
}
void bhv_tiny_star_particles_init(void) {
s32 i;
UNUSED s32 unused;
struct Object *particle;
for (i = 0; i < 7; i++) {
particle = spawn_object(o, MODEL_CARTOON_STAR, bhvWallTinyStarParticle);
particle->oMoveAngleYaw = gMarioObject->oMoveAngleYaw + D_8032F2E4[2 * i] + 0x8000;
particle->oVelY = sins(D_8032F2E4[2 * i + 1]) * 25.0f;
particle->oForwardVel = coss(D_8032F2E4[2 * i + 1]) * 25.0f;
}
}
void bhv_pound_tiny_star_particle_loop(void) {
if (o->oTimer == 0) {
2019-10-05 19:08:05 +00:00
o->oCollisionParticleUnkF4 = 0.28f;
2019-08-25 04:46:40 +00:00
o->oForwardVel = 25.0f;
o->oPosY -= 20.0f;
o->oVelY = 14.0f;
}
2020-03-02 03:42:52 +00:00
cur_obj_move_using_fvel_and_gravity();
2019-08-25 04:46:40 +00:00
o->oAnimState = 4;
2020-03-02 03:42:52 +00:00
cur_obj_scale(o->oCollisionParticleUnkF4);
2019-10-05 19:08:05 +00:00
o->oCollisionParticleUnkF4 -= 0.015f;
2019-08-25 04:46:40 +00:00
}
void bhv_pound_tiny_star_particle_init(void) {
s32 sp24;
s32 sp20 = 8;
struct Object *particle;
for (sp24 = 0; sp24 < sp20; sp24++) {
particle = spawn_object(o, MODEL_CARTOON_STAR, bhvPoundTinyStarParticle);
particle->oMoveAngleYaw = (sp24 * 65536) / sp20;
}
}