mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-29 15:33:01 +00:00
Synchronized clam
This commit is contained in:
parent
79a2d95f00
commit
5b7e1c28d8
1 changed files with 15 additions and 2 deletions
|
@ -13,6 +13,9 @@ struct ObjectHitbox sClamShellHitbox = {
|
|||
};
|
||||
|
||||
void clam_act_0(void) {
|
||||
struct Object* player = nearest_player_to_object(o);
|
||||
int distanceToPlayer = dist_between_objects(o, player);
|
||||
|
||||
if (cur_obj_init_anim_check_frame(0, 25)) {
|
||||
cur_obj_play_sound_2(SOUND_GENERAL_CLAM_SHELL3);
|
||||
spawn_mist_from_global();
|
||||
|
@ -20,9 +23,11 @@ void clam_act_0(void) {
|
|||
|
||||
o->oClamUnkF4 = 10;
|
||||
o->oTimer = 0;
|
||||
} else if (o->oTimer > 150 && o->oDistanceToMario < 500.0f) {
|
||||
if (network_owns_object(o)) { network_send_object(o); }
|
||||
} else if (o->oTimer > 150 && player == gMarioStates[0].marioObj && distanceToPlayer < 500.0f) {
|
||||
cur_obj_play_sound_2(SOUND_GENERAL_CLAM_SHELL2);
|
||||
o->oAction = 1;
|
||||
if (network_owns_object(o)) { network_send_object(o); }
|
||||
} else if (o->oClamUnkF4 != 0) {
|
||||
o->oClamUnkF4 -= 1;
|
||||
cur_obj_shake_y(3.0f);
|
||||
|
@ -34,8 +39,10 @@ void clam_act_1(void) {
|
|||
s16 val04;
|
||||
s16 val02;
|
||||
|
||||
if (o->oTimer > 150) {
|
||||
struct Object* player = nearest_player_to_object(o);
|
||||
if (o->oTimer > 150 && player == gMarioStates[0].marioObj) {
|
||||
o->oAction = 0;
|
||||
if (network_owns_object(o)) { network_send_object(o); }
|
||||
} else if (obj_is_rendering_enabled() && cur_obj_init_anim_check_frame(1, 8)) {
|
||||
for (val06 = -0x2000; val06 < 0x2000; val06 += 0x555) {
|
||||
val04 = (s16)(100.0f * sins(val06));
|
||||
|
@ -49,6 +56,12 @@ void clam_act_1(void) {
|
|||
}
|
||||
|
||||
void bhv_clam_loop(void) {
|
||||
if (o->oSyncID == 0) {
|
||||
network_init_object(o, SYNC_DISTANCE_ONLY_EVENTS);
|
||||
network_init_object_field(o, &o->oAction);
|
||||
network_init_object_field(o, &o->oTimer);
|
||||
network_init_object_field(o, &o->oClamUnkF4);
|
||||
}
|
||||
o->header.gfx.scale[1] = 1.5f;
|
||||
|
||||
switch (o->oAction) {
|
||||
|
|
Loading…
Reference in a new issue