diff --git a/src/files/setup/setupame.c b/src/files/setup/setupame.c index ca913a808..ddcea35ac 100644 --- a/src/files/setup/setupame.c +++ b/src/files/setup/setupame.c @@ -1563,7 +1563,7 @@ u8 func0414_programmer[] = { label(0x2c) set_reaction_speed(100) set_shotlist(AILIST_PROGRAMMER) - set_chr_chrflag(CHR_PROGRAMMER, CHRCFLAG_00000080) + set_chr_chrflag(CHR_PROGRAMMER, CHRCFLAG_CANFACEWALL) if_chr_dead(CHR_SELF, /*goto*/ 0x06) if_chr_death_animation_finished(CHR_SELF, /*goto*/ 0x06) if_chr_knockedout(CHR_SELF, /*goto*/ 0x06) diff --git a/src/files/setup/setupark.c b/src/files/setup/setupark.c index 83b0651fd..9b074c7ed 100644 --- a/src/files/setup/setupark.c +++ b/src/files/setup/setupark.c @@ -612,7 +612,7 @@ u8 func0401_drcaroll_following[] = { set_chr_maxdamage(CHR_SELF, 100) label(0x20) dprint 'b','4',' ','s','h','i','e','l','d',' ','c','h','e','c','k','\n',0, - try_unset_chr_flag_bank3_02000000(CHR_SELF, /*goto*/ 0x00) + if_chr_shield_damaged(CHR_SELF, /*goto*/ 0x00) goto_next(0x02) label(0x00) @@ -2448,7 +2448,7 @@ u8 func100d_intro[] = { unset_chr_chrflag(CHR_INTRO_GUARD, CHRCFLAG_UNPLAYABLE) set_chr_chrflag(CHR_INTRO_GUARD, CHRCFLAG_INVINCIBLE) set_chr_hiddenflag(CHR_INTRO_GUARD, CHRHFLAG_00020000) - set_chr_chrflag(CHR_INTRO_GUARD, CHRCFLAG_00010000) + set_chr_chrflag(CHR_INTRO_GUARD, CHRCFLAG_PERIMDISABLEDTMP) chr_do_animation(ANIM_013A, -2, -1, CHRANIMFLAG_MOVEWHENINVIS | CHRANIMFLAG_PAUSEATEND, 0, CHR_INTRO_GUARD, 2) stop_cutscene_track diff --git a/src/files/setup/setupazt.c b/src/files/setup/setupazt.c index 1b14589f8..e829cd76f 100644 --- a/src/files/setup/setupazt.c +++ b/src/files/setup/setupazt.c @@ -1826,7 +1826,7 @@ u8 func041f_trent_shooting[] = { beginloop(0x06) chr_toggle_p1p2(CHR_SELF) set_target_chr(CHR_P1P2) - try_unset_chr_flag_bank3_02000000(CHR_SELF, /*goto*/ 0x31) + if_chr_shield_damaged(CHR_SELF, /*goto*/ 0x31) if_target_in_sight(/*goto*/ 0x08) endloop(0x06) diff --git a/src/files/setup/setupdepo.c b/src/files/setup/setupdepo.c index f85486f6d..b39a2eaa7 100644 --- a/src/files/setup/setupdepo.c +++ b/src/files/setup/setupdepo.c @@ -1808,7 +1808,7 @@ u8 func040d_intro[] = { unset_chr_chrflag(CHR_INTRO_VICTIM, CHRCFLAG_UNPLAYABLE) set_chr_hiddenflag(CHR_INTRO_VICTIM, CHRHFLAG_00020000) set_chr_chrflag(CHR_INTRO_VICTIM, CHRCFLAG_INVINCIBLE) - set_chr_chrflag(CHR_INTRO_VICTIM, CHRCFLAG_00010000) + set_chr_chrflag(CHR_INTRO_VICTIM, CHRCFLAG_PERIMDISABLEDTMP) chr_do_animation(ANIM_0167, -2, -1, CHRANIMFLAG_MOVEWHENINVIS | CHRANIMFLAG_PAUSEATEND, 0, CHR_INTRO_VICTIM, 2) stop_cutscene_track diff --git a/src/files/setup/setupear.c b/src/files/setup/setupear.c index 4a03cec3c..c812c5ec6 100644 --- a/src/files/setup/setupear.c +++ b/src/files/setup/setupear.c @@ -2248,12 +2248,12 @@ u8 func0416_intro[] = { set_chr_chrflag(CHR_ANTI, CHRCFLAG_HIDDEN) set_chr_chrflag(CHR_BOND, CHRCFLAG_UNPLAYABLE) - set_chr_chrflag(CHR_BOND, CHRCFLAG_00010000) + set_chr_chrflag(CHR_BOND, CHRCFLAG_PERIMDISABLEDTMP) set_chr_hiddenflag(CHR_BOND, CHRHFLAG_00020000) chr_do_animation(ANIM_00F6, -1, -1, CHRANIMFLAG_MOVEWHENINVIS | CHRANIMFLAG_PAUSEATEND, 0, CHR_BOND, 4) set_chr_chrflag(CHR_INTRO_GUARD, CHRCFLAG_UNPLAYABLE) - set_chr_chrflag(CHR_INTRO_GUARD, CHRCFLAG_00010000) + set_chr_chrflag(CHR_INTRO_GUARD, CHRCFLAG_PERIMDISABLEDTMP) unset_chr_chrflag(CHR_INTRO_GUARD, CHRCFLAG_HIDDEN) set_chr_hiddenflag(CHR_INTRO_GUARD, CHRHFLAG_00020000) chr_do_animation(ANIM_00F7, -1, -1, CHRANIMFLAG_MOVEWHENINVIS | CHRANIMFLAG_PAUSEATEND, 0, CHR_INTRO_GUARD, 4) @@ -2342,7 +2342,7 @@ u8 func0416_intro[] = { set_door_open(0x24) set_door_open(0x40) unset_chr_chrflag(CHR_BOND, CHRCFLAG_UNPLAYABLE) - unset_chr_chrflag(CHR_BOND, CHRCFLAG_00010000) + unset_chr_chrflag(CHR_BOND, CHRCFLAG_PERIMDISABLEDTMP) set_chr_hiddenflag(CHR_BOND, CHRHFLAG_00020000) chr_do_animation(ANIM_00F6, -2, -1, CHRANIMFLAG_MOVEWHENINVIS | CHRANIMFLAG_PAUSEATEND, 0, CHR_BOND, 2) diff --git a/src/files/setup/setuplip.c b/src/files/setup/setuplip.c index d1080b544..b4c7f7350 100644 --- a/src/files/setup/setuplip.c +++ b/src/files/setup/setuplip.c @@ -2978,7 +2978,7 @@ u8 func041f_labtech_lights[] = { endloop(0x0d) label(0x06) - set_self_chrflag(CHRCFLAG_00000080) + set_self_chrflag(CHRCFLAG_CANFACEWALL) restart_timer try_face_entity(ATTACKFLAG_AIMATPAD, PAD_LIP_0428, /*goto*/ LABEL_6E) @@ -3042,7 +3042,7 @@ u8 func0421_init_labtech_doors[] = { }; u8 func0420_labtech_doors[] = { - set_self_chrflag(CHRCFLAG_00000080) + set_self_chrflag(CHRCFLAG_CANFACEWALL) set_shotlist(AILIST_LABTECH_DOORS) if_chr_dead(CHR_SELF, /*goto*/ 0x06) if_chr_death_animation_finished(CHR_SELF, /*goto*/ 0x06) @@ -4188,7 +4188,7 @@ u8 func1002_intro[] = { stop_ambient_track enter_firstperson yield - set_chr_chrflag(CHR_INTRO_DEAD_GUARD, CHRCFLAG_00010000) + set_chr_chrflag(CHR_INTRO_DEAD_GUARD, CHRCFLAG_PERIMDISABLEDTMP) chr_do_animation(ANIM_01C9, 2, 3, CHRANIMFLAG_MOVEWHENINVIS | CHRANIMFLAG_PAUSEATEND, 0, CHR_INTRO_DEAD_GUARD, 2) set_ailist(CHR_INTRO_DEAD_GUARD, GAILIST_IDLE) yield diff --git a/src/files/setup/setuppete.c b/src/files/setup/setuppete.c index 7a3aaf614..595459851 100644 --- a/src/files/setup/setuppete.c +++ b/src/files/setup/setuppete.c @@ -2017,7 +2017,7 @@ u8 func041a_robot[] = { play_sound(MP3_ROBOT_STOP_WHERE_YOU_ARE, -1) set_self_flag_bankx(CHRFLAG0_00002000, BANK_0) label(0x05) - try_unset_chr_flag_bank3_02000000(CHR_SELF, /*goto*/ 0x03) + if_chr_shield_damaged(CHR_SELF, /*goto*/ 0x03) goto_next(0x05) label(0x03) diff --git a/src/files/setup/setuprit.c b/src/files/setup/setuprit.c index d809f98d3..c301d1896 100644 --- a/src/files/setup/setuprit.c +++ b/src/files/setup/setuprit.c @@ -2923,7 +2923,7 @@ u8 func0420_trent_attacking[] = { beginloop(0x04) chr_toggle_p1p2(CHR_SELF) set_target_chr(CHR_P1P2) - try_unset_chr_flag_bank3_02000000(CHR_SELF, /*goto*/ 0x2d) + if_chr_shield_damaged(CHR_SELF, /*goto*/ 0x2d) set_target_chr(CHR_PRESIDENT) if_target_in_sight(/*goto*/ 0x06) if_stage_flag_eq(STAGEFLAG_ONE_BLONDE_DEAD, TRUE, /*goto*/ 0x2d) diff --git a/src/files/setup/setupsho.c b/src/files/setup/setupsho.c index ccbb630f6..ecb864901 100644 --- a/src/files/setup/setupsho.c +++ b/src/files/setup/setupsho.c @@ -2424,11 +2424,11 @@ u8 func0412_init_king_miniskedar_clone[] = { }; u8 func100f_spikes_vulnerability[] = { - set_object_flag2(OBJ_SPIKE_ML, 0x00200002) - set_object_flag2(OBJ_SPIKE_MR, 0x00200002) - set_object_flag2(OBJ_SPIKE_BL, 0x00200002) - set_object_flag2(OBJ_SPIKE_BR, 0x00200002) - set_object_flag2(OBJ_SPIKE_T, 0x00200002) + set_object_flag2(OBJ_SPIKE_ML, OBJFLAG2_00000002 | OBJFLAG2_00200000) + set_object_flag2(OBJ_SPIKE_MR, OBJFLAG2_00000002 | OBJFLAG2_00200000) + set_object_flag2(OBJ_SPIKE_BL, OBJFLAG2_00000002 | OBJFLAG2_00200000) + set_object_flag2(OBJ_SPIKE_BR, OBJFLAG2_00000002 | OBJFLAG2_00200000) + set_object_flag2(OBJ_SPIKE_T, OBJFLAG2_00000002 | OBJFLAG2_00200000) beginloop(0x91) if_stage_flag_eq(STAGEFLAG_IN_INTRO, FALSE, /*goto*/ 0x86) @@ -2441,11 +2441,11 @@ u8 func100f_spikes_vulnerability[] = { set_object_flag(OBJ_SPIKE_BL, OBJFLAG_INVINCIBLE) set_object_flag(OBJ_SPIKE_BR, OBJFLAG_INVINCIBLE) set_object_flag(OBJ_SPIKE_T, OBJFLAG_INVINCIBLE) - set_object_flag3(OBJ_SPIKE_ML, 0x00101000) - set_object_flag3(OBJ_SPIKE_MR, 0x00101000) - set_object_flag3(OBJ_SPIKE_BL, 0x00101000) - set_object_flag3(OBJ_SPIKE_BR, 0x00101000) - set_object_flag3(OBJ_SPIKE_T, 0x00101000) + set_object_flag3(OBJ_SPIKE_ML, OBJFLAG3_SHOWSHIELD | OBJFLAG3_HOVERBEDSHIELD) + set_object_flag3(OBJ_SPIKE_MR, OBJFLAG3_SHOWSHIELD | OBJFLAG3_HOVERBEDSHIELD) + set_object_flag3(OBJ_SPIKE_BL, OBJFLAG3_SHOWSHIELD | OBJFLAG3_HOVERBEDSHIELD) + set_object_flag3(OBJ_SPIKE_BR, OBJFLAG3_SHOWSHIELD | OBJFLAG3_HOVERBEDSHIELD) + set_object_flag3(OBJ_SPIKE_T, OBJFLAG3_SHOWSHIELD | OBJFLAG3_HOVERBEDSHIELD) beginloop(0x04) if_stage_flag_eq(STAGEFLAG_SPIKES_VULNERABLE, TRUE, /*goto*/ 0x2d) @@ -2456,17 +2456,17 @@ u8 func100f_spikes_vulnerability[] = { unset_object_flag(OBJ_SPIKE_MR, OBJFLAG_INVINCIBLE) unset_object_flag(OBJ_SPIKE_BL, OBJFLAG_INVINCIBLE) unset_object_flag(OBJ_SPIKE_BR, OBJFLAG_INVINCIBLE) - unset_object_flag3(OBJ_SPIKE_ML, 0x00101000) - unset_object_flag3(OBJ_SPIKE_MR, 0x00101000) - unset_object_flag3(OBJ_SPIKE_BL, 0x00101000) - unset_object_flag3(OBJ_SPIKE_BR, 0x00101000) + unset_object_flag3(OBJ_SPIKE_ML, OBJFLAG3_SHOWSHIELD | OBJFLAG3_HOVERBEDSHIELD) + unset_object_flag3(OBJ_SPIKE_MR, OBJFLAG3_SHOWSHIELD | OBJFLAG3_HOVERBEDSHIELD) + unset_object_flag3(OBJ_SPIKE_BL, OBJFLAG3_SHOWSHIELD | OBJFLAG3_HOVERBEDSHIELD) + unset_object_flag3(OBJ_SPIKE_BR, OBJFLAG3_SHOWSHIELD | OBJFLAG3_HOVERBEDSHIELD) if_stage_flag_eq(STAGEFLAG_SPIKE1_DESTROYED, FALSE, /*goto*/ 0x08) if_stage_flag_eq(STAGEFLAG_SPIKE2_DESTROYED, FALSE, /*goto*/ 0x08) if_stage_flag_eq(STAGEFLAG_SPIKE3_DESTROYED, FALSE, /*goto*/ 0x08) if_stage_flag_eq(STAGEFLAG_SPIKE4_DESTROYED, FALSE, /*goto*/ 0x08) unset_object_flag(OBJ_SPIKE_T, OBJFLAG_INVINCIBLE) - unset_object_flag3(OBJ_SPIKE_T, 0x00101000) + unset_object_flag3(OBJ_SPIKE_T, OBJFLAG3_SHOWSHIELD | OBJFLAG3_HOVERBEDSHIELD) beginloop(0x08) if_stage_flag_eq(STAGEFLAG_SPIKES_VULNERABLE, FALSE, /*goto*/ 0x2d) diff --git a/src/game/bondbike.c b/src/game/bondbike.c index b157a31e6..1cc5c4565 100644 --- a/src/game/bondbike.c +++ b/src/game/bondbike.c @@ -129,8 +129,8 @@ void bbikeTryDismountAngle(f32 relativeangle, f32 distance) pos.y = g_Vars.currentplayer->hoverbike->pos.y; pos.z = g_Vars.currentplayer->hoverbike->pos.z + cosf(angle) * distance; - propSetCollisionsEnabled(g_Vars.currentplayer->hoverbike, false); - propSetCollisionsEnabled(g_Vars.currentplayer->prop, false); + propSetPerimEnabled(g_Vars.currentplayer->hoverbike, false); + propSetPerimEnabled(g_Vars.currentplayer->prop, false); func0f065e74(&g_Vars.currentplayer->prop->pos, g_Vars.currentplayer->prop->rooms, &pos, rooms); bmove0f0cb79c(g_Vars.currentplayer, &pos, rooms); @@ -140,7 +140,7 @@ void bbikeTryDismountAngle(f32 relativeangle, f32 distance) ymax - g_Vars.currentplayer->prop->pos.y, ymin - g_Vars.currentplayer->prop->pos.y); - propSetCollisionsEnabled(g_Vars.currentplayer->hoverbike, true); + propSetPerimEnabled(g_Vars.currentplayer->hoverbike, true); if (result == CDRESULT_NOCOLLISION) { result = cdTestVolume(&pos, width, rooms, CDTYPE_ALL, true, @@ -160,7 +160,7 @@ void bbikeTryDismountAngle(f32 relativeangle, f32 distance) g_Vars.currentplayer->moveinitspeed.z = bike->speed[1]; } - propSetCollisionsEnabled(g_Vars.currentplayer->prop, true); + propSetPerimEnabled(g_Vars.currentplayer->prop, true); } } @@ -1067,8 +1067,8 @@ s32 bbikeCalculateNewPosition(struct coord *vel, f32 angledelta) dstpos.z = g_Vars.currentplayer->hoverbike->pos.z; if (vel->x || vel->y || vel->z) { - propSetCollisionsEnabled(g_Vars.currentplayer->prop, false); - propSetCollisionsEnabled(g_Vars.currentplayer->hoverbike, false); + propSetPerimEnabled(g_Vars.currentplayer->prop, false); + propSetPerimEnabled(g_Vars.currentplayer->hoverbike, false); dstpos.x += vel->x; dstpos.z += vel->z; @@ -1112,8 +1112,8 @@ s32 bbikeCalculateNewPosition(struct coord *vel, f32 angledelta) ymin - g_Vars.currentplayer->hoverbike->pos.y); } - propSetCollisionsEnabled(g_Vars.currentplayer->prop, true); - propSetCollisionsEnabled(g_Vars.currentplayer->hoverbike, true); + propSetPerimEnabled(g_Vars.currentplayer->prop, true); + propSetPerimEnabled(g_Vars.currentplayer->hoverbike, true); } if (angledelta) { diff --git a/src/game/bondeyespy.c b/src/game/bondeyespy.c index fea4b8e28..6c714ded3 100644 --- a/src/game/bondeyespy.c +++ b/src/game/bondeyespy.c @@ -96,12 +96,12 @@ s32 eyespyTryMoveUpwards(f32 yvel) func0f065e74(&prop->pos, prop->rooms, &dstpos, dstrooms); func0f021fa8(prop->chr, &dstpos, dstrooms); - propSetCollisionsEnabled(prop, false); + propSetPerimEnabled(prop, false); f0 -= 0.1f; result = cdTestVolume(&dstpos, 26, dstrooms, types, 1, 15, f0); - propSetCollisionsEnabled(prop, true); + propSetPerimEnabled(prop, true); if (result == CDRESULT_NOCOLLISION) { prop->pos.y = dstpos.y; @@ -136,7 +136,7 @@ s32 eyespyCalculateNewPosition(struct coord *vel) eyespyFindGround(&floorroom); if (vel->x || vel->y || vel->z) { - propSetCollisionsEnabled(eyespyprop, false); + propSetPerimEnabled(eyespyprop, false); dstpos.x = vel->x + eyespyprop->pos.x; dstpos.y = vel->y + eyespyprop->pos.y; @@ -197,7 +197,7 @@ s32 eyespyCalculateNewPosition(struct coord *vel) } } - propSetCollisionsEnabled(eyespyprop, true); + propSetPerimEnabled(eyespyprop, true); if (result == CDRESULT_NOCOLLISION) { // Apply the destination @@ -644,7 +644,7 @@ bool eyespyTryLaunch(void) chr->prevpos.y = g_Vars.currentplayer->eyespy->prop->pos.y = g_Vars.currentplayer->eyespy->oldground + g_Vars.currentplayer->eyespy->height; chr->prevpos.z = g_Vars.currentplayer->eyespy->prop->pos.z = playerpos.f[2]; - propSetCollisionsEnabled(g_Vars.currentplayer->eyespy->prop, false); + propSetPerimEnabled(g_Vars.currentplayer->eyespy->prop, false); // "Not enough room to launch " sprintf(text, "%s%s", langGet(L_MISC_218), bgunGetName(WEAPON_EYESPY)); diff --git a/src/game/bondgrab.c b/src/game/bondgrab.c index 4b9f5ef83..2743a91cb 100644 --- a/src/game/bondgrab.c +++ b/src/game/bondgrab.c @@ -807,7 +807,7 @@ bool bgrabTryMoveUpwards(f32 y) propPlayerGetBbox(g_Vars.currentplayer->prop, &width, &ymax, &ymin); func0f065e74(&g_Vars.currentplayer->prop->pos, g_Vars.currentplayer->prop->rooms, &newpos, rooms); bmove0f0cb79c(g_Vars.currentplayer, &newpos, rooms); - propSetCollisionsEnabled(g_Vars.currentplayer->prop, false); + propSetPerimEnabled(g_Vars.currentplayer->prop, false); ymin -= 0.1f; @@ -815,7 +815,7 @@ bool bgrabTryMoveUpwards(f32 y) ymax - g_Vars.currentplayer->prop->pos.y, ymin - g_Vars.currentplayer->prop->pos.y); - propSetCollisionsEnabled(g_Vars.currentplayer->prop, true); + propSetPerimEnabled(g_Vars.currentplayer->prop, true); if (result == CDRESULT_NOCOLLISION) { g_Vars.currentplayer->prop->pos.y = newpos.y; @@ -878,11 +878,11 @@ glabel var7f1ad9c4 /* f0cd1f4: 8de400bc */ lw $a0,0xbc($t7) /* f0cd1f8: 8e180284 */ lw $t8,0x284($s0) /* f0cd1fc: 00002825 */ or $a1,$zero,$zero -/* f0cd200: 0fc1905e */ jal propSetCollisionsEnabled +/* f0cd200: 0fc1905e */ jal propSetPerimEnabled /* f0cd204: 8f0400bc */ lw $a0,0xbc($t8) /* f0cd208: 8e190284 */ lw $t9,0x284($s0) /* f0cd20c: 00002825 */ or $a1,$zero,$zero -/* f0cd210: 0fc1905e */ jal propSetCollisionsEnabled +/* f0cd210: 0fc1905e */ jal propSetPerimEnabled /* f0cd214: 8f241b5c */ lw $a0,0x1b5c($t9) /* f0cd218: 8e080284 */ lw $t0,0x284($s0) /* f0cd21c: 8fa300f0 */ lw $v1,0xf0($sp) @@ -986,7 +986,7 @@ glabel var7f1ad9c4 /* f0cd39c: 8e0c0284 */ lw $t4,0x284($s0) .L0f0cd3a0: /* f0cd3a0: 24050001 */ addiu $a1,$zero,0x1 -/* f0cd3a4: 0fc1905e */ jal propSetCollisionsEnabled +/* f0cd3a4: 0fc1905e */ jal propSetPerimEnabled /* f0cd3a8: 8d841b5c */ lw $a0,0x1b5c($t4) /* f0cd3ac: 8fad00ec */ lw $t5,0xec($sp) /* f0cd3b0: 24010001 */ addiu $at,$zero,0x1 @@ -1281,7 +1281,7 @@ glabel var7f1ad9c4 .L0f0cd7ec: /* f0cd7ec: c7b600b8 */ lwc1 $f22,0xb8($sp) /* f0cd7f0: 24050001 */ addiu $a1,$zero,0x1 -/* f0cd7f4: 0fc1905e */ jal propSetCollisionsEnabled +/* f0cd7f4: 0fc1905e */ jal propSetPerimEnabled /* f0cd7f8: 8d6400bc */ lw $a0,0xbc($t3) /* f0cd7fc: 3c017f1b */ lui $at,%hi(var7f1ad9c4) /* f0cd800: c422d9c4 */ lwc1 $f2,%lo(var7f1ad9c4)($at) @@ -1436,11 +1436,11 @@ glabel var7f1ad9c4 /* f0cd1f4: 8de400bc */ lw $a0,0xbc($t7) /* f0cd1f8: 8e180284 */ lw $t8,0x284($s0) /* f0cd1fc: 00002825 */ or $a1,$zero,$zero -/* f0cd200: 0fc1905e */ jal propSetCollisionsEnabled +/* f0cd200: 0fc1905e */ jal propSetPerimEnabled /* f0cd204: 8f0400bc */ lw $a0,0xbc($t8) /* f0cd208: 8e190284 */ lw $t9,0x284($s0) /* f0cd20c: 00002825 */ or $a1,$zero,$zero -/* f0cd210: 0fc1905e */ jal propSetCollisionsEnabled +/* f0cd210: 0fc1905e */ jal propSetPerimEnabled /* f0cd214: 8f241b5c */ lw $a0,0x1b5c($t9) /* f0cd218: 8e080284 */ lw $t0,0x284($s0) /* f0cd21c: 8fa300f0 */ lw $v1,0xf0($sp) @@ -1544,7 +1544,7 @@ glabel var7f1ad9c4 /* f0cd39c: 8e0c0284 */ lw $t4,0x284($s0) .L0f0cd3a0: /* f0cd3a0: 24050001 */ addiu $a1,$zero,0x1 -/* f0cd3a4: 0fc1905e */ jal propSetCollisionsEnabled +/* f0cd3a4: 0fc1905e */ jal propSetPerimEnabled /* f0cd3a8: 8d841b5c */ lw $a0,0x1b5c($t4) /* f0cd3ac: 8fad00ec */ lw $t5,0xec($sp) /* f0cd3b0: 24010001 */ addiu $at,$zero,0x1 @@ -1839,7 +1839,7 @@ glabel var7f1ad9c4 .L0f0cd7ec: /* f0cd7ec: c7b600b8 */ lwc1 $f22,0xb8($sp) /* f0cd7f0: 24050001 */ addiu $a1,$zero,0x1 -/* f0cd7f4: 0fc1905e */ jal propSetCollisionsEnabled +/* f0cd7f4: 0fc1905e */ jal propSetPerimEnabled /* f0cd7f8: 8d6400bc */ lw $a0,0xbc($t3) /* f0cd7fc: 3c017f1b */ lui $at,%hi(var7f1ad9c4) /* f0cd800: c422d9c4 */ lwc1 $f2,%lo(var7f1ad9c4)($at) @@ -1993,11 +1993,11 @@ glabel var7f1ad9c4 /* f0caa20: 8de400bc */ lw $a0,0xbc($t7) /* f0caa24: 8e180284 */ lw $t8,0x284($s0) /* f0caa28: 00002825 */ or $a1,$zero,$zero -/* f0caa2c: 0fc18cfb */ jal propSetCollisionsEnabled +/* f0caa2c: 0fc18cfb */ jal propSetPerimEnabled /* f0caa30: 8f0400bc */ lw $a0,0xbc($t8) /* f0caa34: 8e190284 */ lw $t9,0x284($s0) /* f0caa38: 00002825 */ or $a1,$zero,$zero -/* f0caa3c: 0fc18cfb */ jal propSetCollisionsEnabled +/* f0caa3c: 0fc18cfb */ jal propSetPerimEnabled /* f0caa40: 8f241b5c */ lw $a0,0x1b5c($t9) /* f0caa44: 8e080284 */ lw $t0,0x284($s0) /* f0caa48: 8fa300e8 */ lw $v1,0xe8($sp) @@ -2121,7 +2121,7 @@ glabel var7f1ad9c4 /* f0cac0c: 8e180284 */ lw $t8,0x284($s0) .NB0f0cac10: /* f0cac10: 24050001 */ addiu $a1,$zero,0x1 -/* f0cac14: 0fc18cfb */ jal propSetCollisionsEnabled +/* f0cac14: 0fc18cfb */ jal propSetPerimEnabled /* f0cac18: 8f041b5c */ lw $a0,0x1b5c($t8) /* f0cac1c: 8fb900e4 */ lw $t9,0xe4($sp) /* f0cac20: 24010001 */ addiu $at,$zero,0x1 @@ -2417,7 +2417,7 @@ glabel var7f1ad9c4 /* f0cb060: 8e0f0284 */ lw $t7,0x284($s0) .NB0f0cb064: /* f0cb064: 24050001 */ addiu $a1,$zero,0x1 -/* f0cb068: 0fc18cfb */ jal propSetCollisionsEnabled +/* f0cb068: 0fc18cfb */ jal propSetPerimEnabled /* f0cb06c: 8de400bc */ lw $a0,0xbc($t7) /* f0cb070: 3c017f1a */ lui $at,0x7f1a /* f0cb074: c4227d04 */ lwc1 $f2,0x7d04($at) @@ -4228,8 +4228,8 @@ void bgrabTick(void) struct prop *grabbedprop = g_Vars.currentplayer->grabbedprop; - propSetCollisionsEnabled(g_Vars.currentplayer->prop, false); - propSetCollisionsEnabled(grabbedprop, false); + propSetPerimEnabled(g_Vars.currentplayer->prop, false); + propSetPerimEnabled(grabbedprop, false); if (g_Vars.currentplayer->vv_ground <= -30000 || ydiff < -100 || ydiff > 100 @@ -4239,8 +4239,8 @@ void bgrabTick(void) bmoveSetMode(MOVEMODE_WALK); } - propSetCollisionsEnabled(g_Vars.currentplayer->prop, true); - propSetCollisionsEnabled(grabbedprop, true); + propSetPerimEnabled(g_Vars.currentplayer->prop, true); + propSetPerimEnabled(grabbedprop, true); } } } diff --git a/src/game/bondwalk.c b/src/game/bondwalk.c index 0bed6869d..aa8ddd9e5 100644 --- a/src/game/bondwalk.c +++ b/src/game/bondwalk.c @@ -102,9 +102,9 @@ void bwalkInit(void) delta.y = 0; delta.z = g_Vars.currentplayer->walkinitpos.z - g_Vars.currentplayer->prop->pos.z; - propSetCollisionsEnabled(g_Vars.currentplayer->hoverbike, false); + propSetPerimEnabled(g_Vars.currentplayer->hoverbike, false); bwalkCalculateNewPositionWithPush(&delta, 0, true, 0, CDTYPE_ALL); - propSetCollisionsEnabled(g_Vars.currentplayer->hoverbike, true); + propSetPerimEnabled(g_Vars.currentplayer->hoverbike, true); } else if (prevmode != MOVEMODE_GRAB && prevmode != MOVEMODE_WALK) { g_Vars.currentplayer->moveinitspeed.x = 0; g_Vars.currentplayer->moveinitspeed.y = 0; @@ -281,7 +281,7 @@ glabel var7f1a7ad0 /* f0c160c: c5240010 */ lwc1 $f4,0x10($t1) /* f0c1610: 46049181 */ sub.s $f6,$f18,$f4 /* f0c1614: e7a6004c */ swc1 $f6,0x4c($sp) -/* f0c1618: 0fc18cfb */ jal propSetCollisionsEnabled +/* f0c1618: 0fc18cfb */ jal propSetPerimEnabled /* f0c161c: 8c441a6c */ lw $a0,0x1a6c($v0) /* f0c1620: 4405a000 */ mfc1 $a1,$f20 /* f0c1624: 4407a000 */ mfc1 $a3,$f20 @@ -292,7 +292,7 @@ glabel var7f1a7ad0 /* f0c1638: 24060001 */ addiu $a2,$zero,0x1 /* f0c163c: 8e0b0284 */ lw $t3,0x284($s0) /* f0c1640: 24050001 */ addiu $a1,$zero,0x1 -/* f0c1644: 0fc18cfb */ jal propSetCollisionsEnabled +/* f0c1644: 0fc18cfb */ jal propSetPerimEnabled /* f0c1648: 8d641a6c */ lw $a0,0x1a6c($t3) /* f0c164c: 1000000b */ beqz $zero,.NB0f0c167c /* f0c1650: 8fbf003c */ lw $ra,0x3c($sp) @@ -404,7 +404,7 @@ s32 bwalkTryMoveUpwards(f32 amount) propPlayerGetBbox(g_Vars.currentplayer->prop, &width, &ymax, &ymin); func0f065e74(&g_Vars.currentplayer->prop->pos, g_Vars.currentplayer->prop->rooms, &newpos, rooms); bmove0f0cb79c(g_Vars.currentplayer, &newpos, rooms); - propSetCollisionsEnabled(g_Vars.currentplayer->prop, false); + propSetPerimEnabled(g_Vars.currentplayer->prop, false); ymin -= 0.1f; @@ -412,7 +412,7 @@ s32 bwalkTryMoveUpwards(f32 amount) ymax - g_Vars.currentplayer->prop->pos.y, ymin - g_Vars.currentplayer->prop->pos.y); - propSetCollisionsEnabled(g_Vars.currentplayer->prop, true); + propSetPerimEnabled(g_Vars.currentplayer->prop, true); if (result == CDRESULT_NOCOLLISION) { g_Vars.currentplayer->prop->pos.y = newpos.y; @@ -454,10 +454,10 @@ bool bwalkCalculateNewPosition(struct coord *vel, f32 rotateamount, bool apply, if (vel->x || vel->y || vel->z) { if (g_Vars.currentplayer->tank) { - propSetCollisionsEnabled(g_Vars.currentplayer->tank, false); + propSetPerimEnabled(g_Vars.currentplayer->tank, false); } - propSetCollisionsEnabled(g_Vars.currentplayer->prop, false); + propSetPerimEnabled(g_Vars.currentplayer->prop, false); dstpos.x += vel->x; dstpos.y += vel->y; @@ -501,10 +501,10 @@ bool bwalkCalculateNewPosition(struct coord *vel, f32 rotateamount, bool apply, ymin - g_Vars.currentplayer->prop->pos.y); } - propSetCollisionsEnabled(g_Vars.currentplayer->prop, true); + propSetPerimEnabled(g_Vars.currentplayer->prop, true); if (g_Vars.currentplayer->tank) { - propSetCollisionsEnabled(g_Vars.currentplayer->tank, true); + propSetPerimEnabled(g_Vars.currentplayer->tank, true); } } @@ -594,14 +594,14 @@ glabel var7f1a7ad8nb /* f0c1a88: 00002825 */ or $a1,$zero,$zero /* f0c1a8c: 50800006 */ beqzl $a0,.NB0f0c1aa8 /* f0c1a90: 8c4400bc */ lw $a0,0xbc($v0) -/* f0c1a94: 0fc18cfb */ jal propSetCollisionsEnabled +/* f0c1a94: 0fc18cfb */ jal propSetPerimEnabled /* f0c1a98: afa700b8 */ sw $a3,0xb8($sp) /* f0c1a9c: 8fa700b8 */ lw $a3,0xb8($sp) /* f0c1aa0: 8e020284 */ lw $v0,0x284($s0) /* f0c1aa4: 8c4400bc */ lw $a0,0xbc($v0) .NB0f0c1aa8: /* f0c1aa8: afa700b8 */ sw $a3,0xb8($sp) -/* f0c1aac: 0fc18cfb */ jal propSetCollisionsEnabled +/* f0c1aac: 0fc18cfb */ jal propSetPerimEnabled /* f0c1ab0: 00002825 */ or $a1,$zero,$zero /* f0c1ab4: 8fa700b8 */ lw $a3,0xb8($sp) /* f0c1ab8: c7a600a4 */ lwc1 $f6,0xa4($sp) @@ -764,7 +764,7 @@ glabel var7f1a7ad8nb /* f0c1d0c: 8e0a0284 */ lw $t2,0x284($s0) /* f0c1d10: 24050001 */ addiu $a1,$zero,0x1 /* f0c1d14: 8d4400bc */ lw $a0,0xbc($t2) -/* f0c1d18: 0fc18cfb */ jal propSetCollisionsEnabled +/* f0c1d18: 0fc18cfb */ jal propSetPerimEnabled /* f0c1d1c: afa300b4 */ sw $v1,0xb4($sp) /* f0c1d20: 8e0b0284 */ lw $t3,0x284($s0) /* f0c1d24: 44808000 */ mtc1 $zero,$f16 @@ -773,7 +773,7 @@ glabel var7f1a7ad8nb /* f0c1d30: 24050001 */ addiu $a1,$zero,0x1 /* f0c1d34: 50800006 */ beqzl $a0,.NB0f0c1d50 /* f0c1d38: 24010001 */ addiu $at,$zero,0x1 -/* f0c1d3c: 0fc18cfb */ jal propSetCollisionsEnabled +/* f0c1d3c: 0fc18cfb */ jal propSetPerimEnabled /* f0c1d40: afa300b4 */ sw $v1,0xb4($sp) /* f0c1d44: 44808000 */ mtc1 $zero,$f16 /* f0c1d48: 8fa300b4 */ lw $v1,0xb4($sp) diff --git a/src/game/chr/chr.c b/src/game/chr/chr.c index 81dea7a5a..580aa801e 100644 --- a/src/game/chr/chr.c +++ b/src/game/chr/chr.c @@ -15286,7 +15286,7 @@ bool chrUpdateGeometry(struct prop *prop, u8 **start, u8 **end) if (chr->actiontype != ACT_DEAD && chr->actiontype != ACT_DRUGGEDKO && - (chr->chrflags & (CHRCFLAG_00010000 | CHRCFLAG_HIDDEN)) == 0 && + (chr->chrflags & (CHRCFLAG_PERIMDISABLEDTMP | CHRCFLAG_HIDDEN)) == 0 && (chr->hidden & CHRHFLAG_PERIMDISABLED) == 0) { chr->geo.header.type = TILETYPE_03; diff --git a/src/game/chr/chraction.c b/src/game/chr/chraction.c index 72d8082cb..ba93f3205 100644 --- a/src/game/chr/chraction.c +++ b/src/game/chr/chraction.c @@ -1748,7 +1748,7 @@ void chrStand(struct chrdata *chr) chr->act_stand.entityid = 0; chr->act_stand.reaim = 0; chr->act_stand.turning = TURNSTATE_OFF; - chr->act_stand.checkfacingwall = 0; + chr->act_stand.checkfacingwall = false; chr->act_stand.wallcount = random() % 120 + 180; chr->sleep = 0; chr->act_stand.playwalkanim = false; @@ -4586,7 +4586,7 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct gse #endif } - chr->chrflags |= CHRCFLAG_02000000; + chr->chrflags |= CHRCFLAG_SHIELDDAMAGED; if (prop2 && node && chr->model) { func0f034080(chr, node, prop2, model, side, arg11); @@ -6904,7 +6904,7 @@ bool chrCanSeeEntity(struct chrdata *chr, struct coord *chrpos, s16 *chrrooms, b targetprop = chrGetTargetProp(chr); if (targetprop->type != PROPTYPE_PLAYER || g_Vars.bondvisible) { - propSetCollisionsEnabled(targetprop, false); + propSetPerimEnabled(targetprop, false); if (allowextraheight && (chr->chrflags & CHRCFLAG_LOSEXTRAHEIGHT)) { struct coord frompos; @@ -6927,7 +6927,7 @@ bool chrCanSeeEntity(struct chrdata *chr, struct coord *chrpos, s16 *chrrooms, b } } - propSetCollisionsEnabled(targetprop, true); + propSetPerimEnabled(targetprop, true); } } else if (attackflags & ATTACKFLAG_AIMATCHR) { targetchr = chrFindById(chr, entityid); @@ -7063,9 +7063,9 @@ bool chrCanSeeProp(struct chrdata *chr, struct prop *prop) { bool result; - propSetCollisionsEnabled(prop, false); + propSetPerimEnabled(prop, false); result = chrCanSeePos(chr, &prop->pos, prop->rooms); - propSetCollisionsEnabled(prop, true); + propSetPerimEnabled(prop, true); return result; } @@ -7989,10 +7989,10 @@ bool chrGoToCoverProp(struct chrdata *chr) chrheight = chrymax - chrymin; if (propheight > chrheight * 0.4f && propheight < chrheight * 0.9f) { - propSetCollisionsEnabled(prop, false); + propSetPerimEnabled(prop, false); if (cd0002dc18(&chrprop->pos, chrprop->rooms, &prop->pos, CDTYPE_DOORS | CDTYPE_BG)) { - propSetCollisionsEnabled(prop, true); + propSetPerimEnabled(prop, true); dstpos.x = prop->pos.x - (targetprop->pos.x - prop->pos.x) / targetdist * (propwidth * 1.25f + chrwidth); dstpos.z = prop->pos.z - (targetprop->pos.z - prop->pos.z) / targetdist * (propwidth * 1.25f + chrwidth); @@ -8020,7 +8020,7 @@ bool chrGoToCoverProp(struct chrdata *chr) } } - propSetCollisionsEnabled(prop, true); + propSetPerimEnabled(prop, true); } } } @@ -9047,7 +9047,7 @@ glabel var7f1a8f08 // return; // } // -// if (chr->chrflags & CHRCFLAG_00000080) { +// if (chr->chrflags & CHRCFLAG_CANFACEWALL) { // chr->act_stand.checkfacingwall = false; // return; // } @@ -11308,23 +11308,23 @@ void chrStopFiring(struct chrdata *chr) } } -void func0f03f988(struct chrdata *chr, s32 hand, bool arg2) +void chrSetHandFiring(struct chrdata *chr, s32 hand, bool firing) { - if (arg2) { + if (firing) { if (hand == HAND_LEFT) { - chr->hidden |= CHRHFLAG_00000004; + chr->hidden |= CHRHFLAG_FIRINGLEFT; } else { - chr->hidden |= CHRHFLAG_00000008; + chr->hidden |= CHRHFLAG_FIRINGRIGHT; } } else { if (hand == HAND_LEFT) { - chr->hidden &= ~CHRHFLAG_00000004; + chr->hidden &= ~CHRHFLAG_FIRINGLEFT; } else { - chr->hidden &= ~CHRHFLAG_00000008; + chr->hidden &= ~CHRHFLAG_FIRINGRIGHT; } } - if (!arg2) { + if (!firing) { chrSetFiring(chr, hand, false); } } @@ -12265,7 +12265,7 @@ glabel var7f1a9184 /* f040ad4: 0c0011d8 */ jal guNormalize /* f040ad8: e7b201e8 */ swc1 $f18,0x1e8($sp) /* f040adc: 8fa4025c */ lw $a0,0x25c($sp) -/* f040ae0: 0fc19102 */ jal propSetCollisionsEnabled +/* f040ae0: 0fc19102 */ jal propSetPerimEnabled /* f040ae4: 24050001 */ li $a1,0x1 /* f040ae8: 1000002f */ b .PF0f040ba8 /* f040aec: 8fab0278 */ lw $t3,0x278($sp) @@ -13377,7 +13377,7 @@ glabel var7f1a9184 /* f041b04: 8fa4025c */ lw $a0,0x25c($sp) /* f041b08: 51600004 */ beqzl $t3,.PF0f041b1c /* f041b0c: 8fa80268 */ lw $t0,0x268($sp) -/* f041b10: 0fc19102 */ jal propSetCollisionsEnabled +/* f041b10: 0fc19102 */ jal propSetPerimEnabled /* f041b14: 00002825 */ move $a1,$zero /* f041b18: 8fa80268 */ lw $t0,0x268($sp) .PF0f041b1c: @@ -13863,7 +13863,7 @@ glabel var7f1a9184 /* f040950: 0c0011e4 */ jal guNormalize /* f040954: e7b201e8 */ swc1 $f18,0x1e8($sp) /* f040958: 8fa4025c */ lw $a0,0x25c($sp) -/* f04095c: 0fc1905e */ jal propSetCollisionsEnabled +/* f04095c: 0fc1905e */ jal propSetPerimEnabled /* f040960: 24050001 */ addiu $a1,$zero,0x1 /* f040964: 1000002f */ b .L0f040a24 /* f040968: 8fab0278 */ lw $t3,0x278($sp) @@ -14967,7 +14967,7 @@ glabel var7f1a9184 /* f041960: 8fa4025c */ lw $a0,0x25c($sp) /* f041964: 51c00004 */ beqzl $t6,.L0f041978 /* f041968: 8fa80268 */ lw $t0,0x268($sp) -/* f04196c: 0fc1905e */ jal propSetCollisionsEnabled +/* f04196c: 0fc1905e */ jal propSetPerimEnabled /* f041970: 00002825 */ or $a1,$zero,$zero /* f041974: 8fa80268 */ lw $t0,0x268($sp) .L0f041978: @@ -15453,7 +15453,7 @@ glabel var7f1a9184 /* f040130: 0c0012a8 */ jal guNormalize /* f040134: e7b201e8 */ swc1 $f18,0x1e8($sp) /* f040138: 8fa4025c */ lw $a0,0x25c($sp) -/* f04013c: 0fc18cfb */ jal propSetCollisionsEnabled +/* f04013c: 0fc18cfb */ jal propSetPerimEnabled /* f040140: 24050001 */ addiu $a1,$zero,0x1 /* f040144: 1000002f */ beqz $zero,.NB0f040204 /* f040148: 8fab0278 */ lw $t3,0x278($sp) @@ -16551,7 +16551,7 @@ glabel var7f1a9184 /* f041128: 8fa4025c */ lw $a0,0x25c($sp) /* f04112c: 51800004 */ beqzl $t4,.NB0f041140 /* f041130: 8fa80268 */ lw $t0,0x268($sp) -/* f041134: 0fc18cfb */ jal propSetCollisionsEnabled +/* f041134: 0fc18cfb */ jal propSetPerimEnabled /* f041138: 00002825 */ or $a1,$zero,$zero /* f04113c: 8fa80268 */ lw $t0,0x268($sp) .NB0f041140: @@ -17062,7 +17062,7 @@ void chrTickFire(struct chrdata *chr) if (chr->act_attack.everytick[i] == 0) { if (modelGetAnimNum(model) == ANIM_SNIPING_ONGROUND || (curframe >= chr->act_attack.animcfg->unk18 && curframe < chr->act_attack.animcfg->unk1c)) { - func0f03f988(chr, i, true); + chrSetHandFiring(chr, i, true); chr->act_attack.lastfire60 = g_Vars.lvframe60; @@ -17083,7 +17083,7 @@ void chrTickFire(struct chrdata *chr) modelSetAnimSpeed(model, 0.5f, 0); } } else { - func0f03f988(chr, i, false); + chrSetHandFiring(chr, i, false); if (chr->actiontype == ACT_ATTACKROLL) { modelSetAnimSpeed(model, chrGetRangedSpeed(chr, 0.5f, 0.8f), 0); @@ -17100,12 +17100,12 @@ void chrTickFire(struct chrdata *chr) chr->act_attack.numshots++; chr->act_attack.lastfire60 = g_Vars.lvframe60; - func0f03f988(chr, i, true); + chrSetHandFiring(chr, i, true); } else { - func0f03f988(chr, i, false); + chrSetHandFiring(chr, i, false); } } else { - func0f03f988(chr, i, false); + chrSetHandFiring(chr, i, false); } } } @@ -17132,13 +17132,13 @@ void chrTickAttackAmount(struct chrdata *chr) if (chr->act_attack.dooneburst) { if (chr->act_attack.numshots++ < chr->act_attack.maxshots) { - func0f03f988(chr, HAND_RIGHT, true); + chrSetHandFiring(chr, HAND_RIGHT, true); } else { chrAttackAmountUpdateAnimation(chr); - func0f03f988(chr, HAND_RIGHT, false); + chrSetHandFiring(chr, HAND_RIGHT, false); } } else { - func0f03f988(chr, HAND_RIGHT, false); + chrSetHandFiring(chr, HAND_RIGHT, false); } } @@ -18345,7 +18345,7 @@ void chrTickAttackWalk(struct chrdata *chr) for (i = 0; i < 2; i++) { if (chr->act_attackwalk.firegun[i]) { if (!chr->act_attackwalk.everytick[i]) { - func0f03f988(chr, i, true); + chrSetHandFiring(chr, i, true); } else if (chr->act_attackwalk.frame60count > chr->act_attackwalk.nextshot60 && (i == chr->act_attackwalk.nextgun || chr->act_attackwalk.everytick[chr->act_attackwalk.nextgun] == 0)) { chr->act_attackwalk.nextshot60 = chr->act_attackwalk.frame60count; @@ -18366,17 +18366,17 @@ void chrTickAttackWalk(struct chrdata *chr) chr->act_attackwalk.nextgun = 1 - chr->act_attackwalk.nextgun; - func0f03f988(chr, i, true); + chrSetHandFiring(chr, i, true); } else { - func0f03f988(chr, i, false); + chrSetHandFiring(chr, i, false); } } else { - func0f03f988(chr, i, false); + chrSetHandFiring(chr, i, false); } } } else { - func0f03f988(chr, HAND_LEFT, false); - func0f03f988(chr, HAND_RIGHT, false); + chrSetHandFiring(chr, HAND_LEFT, false); + chrSetHandFiring(chr, HAND_RIGHT, false); } } @@ -22764,11 +22764,11 @@ bool chrStartSkJump(struct chrdata *chr, u8 arg1, u8 arg2, s32 arg3, u8 arg4) propChrGetBbox(prop, &width, &ymax, &ymin); chrSetPerimEnabled(chr, false); - propSetCollisionsEnabled(target, false); + propSetPerimEnabled(target, false); iVar2 = cd0002d6ac(&prop->pos, prop->rooms, &target->pos, 51, 1, ymax - prop->pos.y, ymin - prop->pos.y); chrSetPerimEnabled(chr, true); - propSetCollisionsEnabled(target, true); + propSetPerimEnabled(target, true); if (iVar2) { diffs[0] = target->pos.x - chr->prop->pos.x; @@ -26324,7 +26324,7 @@ bool func0f04b658(struct chrdata *chr) if (chr->proppreset1 >= 0) { chrSetPerimEnabled(chr, false); - propSetCollisionsEnabled(target, false); + propSetPerimEnabled(target, false); if (!cd0002dc18(&prop->pos, prop->rooms, &target->pos, 0x33)) { struct prop *thing = cdGetObstacle(); @@ -26336,7 +26336,7 @@ bool func0f04b658(struct chrdata *chr) } chrSetPerimEnabled(chr, true); - propSetCollisionsEnabled(target, true); + propSetPerimEnabled(target, true); } return result; @@ -26362,7 +26362,7 @@ bool chrMoveToPos(struct chrdata *chr, struct coord *pos, s16 *rooms, f32 angle, pos2.z = pos->z; roomsCopy(rooms, rooms2); - propSetCollisionsEnabled(chr->prop, false); + propSetPerimEnabled(chr->prop, false); #if VERSION >= VERSION_NTSC_1_0 if (chrAdjustPosForSpawn(chr->chrwidth, &pos2, rooms2, angle, (chr->hidden & CHRHFLAG_00100000) != 0, allowonscreen, (chr->hidden & CHRHFLAG_00000200) != 0)) @@ -26407,7 +26407,7 @@ bool chrMoveToPos(struct chrdata *chr, struct coord *pos, s16 *rooms, f32 angle, result = true; } - propSetCollisionsEnabled(chr->prop, true); + propSetPerimEnabled(chr->prop, true); return result; } @@ -28571,8 +28571,8 @@ void chrToggleModelPart(struct chrdata *chr, s32 partnum) */ void chrAvoid(struct chrdata *chr) { - // The first 4 items here are animation numbers, - // an the second 4 are their corresponding end frames. + // The first 4 items here are animation numbers + // and the second 4 are their corresponding end frames. s32 anims[] = { ANIM_0064, ANIM_0065, ANIM_0066, ANIM_0067, 48, 58, 35, 35 @@ -28593,8 +28593,8 @@ void chrAvoid(struct chrdata *chr) s16 dstrooms[8]; struct coord dstpos; - // @bug: This shouldn't be here, and there is no corresponding setting of - // the flag again if the chr is not ready for orders. + // @bug: This shouldn't be here, and the perim is not enabled again + // if the chr is not ready for orders. chrSetPerimEnabled(chr, false); if (chrIsReadyForOrders(chr)) { diff --git a/src/game/chr/chrai.c b/src/game/chr/chrai.c index afee8d388..1f0f93c40 100644 --- a/src/game/chr/chrai.c +++ b/src/game/chr/chrai.c @@ -370,7 +370,7 @@ bool (*g_CommandPointers[])(void) = { /*0x0165*/ aiIfChrInjured, /*0x0166*/ aiIfAction, /*0x0167*/ aiHovercopterFireRocket, - /*0x0168*/ ai0168, + /*0x0168*/ aiIfShieldDamaged, /*0x0169*/ aiIfNaturalAnim, /*0x016a*/ aiIfY, /*0x016b*/ ai016b, diff --git a/src/game/chr/chraicommands.c b/src/game/chr/chraicommands.c index 2b96507fd..44fa07cd6 100644 --- a/src/game/chr/chraicommands.c +++ b/src/game/chr/chraicommands.c @@ -2830,13 +2830,13 @@ bool aiIfInjured(void) /** * @cmd 0168 */ -bool ai0168(void) +bool aiIfShieldDamaged(void) { u8 *cmd = g_Vars.ailist + g_Vars.aioffset; struct chrdata *chr = chrFindById(g_Vars.chrdata, cmd[2]); - if (chr && (chr->chrflags & CHRCFLAG_02000000)) { - chr->chrflags &= ~CHRCFLAG_02000000; + if (chr && (chr->chrflags & CHRCFLAG_SHIELDDAMAGED)) { + chr->chrflags &= ~CHRCFLAG_SHIELDDAMAGED; g_Vars.aioffset = chraiGoToLabel(g_Vars.ailist, g_Vars.aioffset, cmd[3]); } else { g_Vars.aioffset = g_Vars.aioffset + 4; @@ -12543,7 +12543,7 @@ bool aiChrKill(void) chr->act_dead.invistimer60 = 0; chr->act_dead.notifychrindex = 0; chr->sleep = 0; - chr->chrflags |= CHRCFLAG_KEEPCORPSEKO | CHRCFLAG_00010000; + chr->chrflags |= CHRCFLAG_KEEPCORPSEKO | CHRCFLAG_PERIMDISABLEDTMP; } g_Vars.aioffset += 3; diff --git a/src/game/data/ailists.c b/src/game/data/ailists.c index cd2bbdf9a..e58008cce 100644 --- a/src/game/data/ailists.c +++ b/src/game/data/ailists.c @@ -2666,7 +2666,7 @@ u8 func0007_alerted[] = { }; u8 func000a_do_idle_animation[] = { - set_chr_chrflag(CHR_SELF, CHRCFLAG_00000080) + set_chr_chrflag(CHR_SELF, CHRCFLAG_CANFACEWALL) if_chr_has_hiddenflag(CHR_SELF, CHRHFLAG_TRIGGER_BUDDY_WARP, /*goto*/ 0x13) if_chr_idle_action_eq(IDLEACTION_SITTING_TYPING, /*goto*/ 0x16) if_chr_idle_action_eq(IDLEACTION_SITTING_DORMANT, /*goto*/ 0x16) @@ -5132,7 +5132,7 @@ u8 func0015_aibuddy_stealth[] = { label(0x16) remove_references_to_chr set_self_chrflag(CHRCFLAG_INVINCIBLE) - set_self_chrflag((CHRCFLAG_HIDDEN | CHRCFLAG_00010000 | CHRCFLAG_00040000)) + set_self_chrflag((CHRCFLAG_HIDDEN | CHRCFLAG_PERIMDISABLEDTMP | CHRCFLAG_00040000)) // Wait 3 seconds restart_timer @@ -5180,14 +5180,14 @@ u8 func0015_aibuddy_stealth[] = { // This will execute every second after the initial 7ish seconds and while // cutscene is not running. The chr is being moved back to the player // repeatedly. - set_chr_hiddenflag(CHR_SELF, 0x00100200) + set_chr_hiddenflag(CHR_SELF, CHRHFLAG_00000200 | CHRHFLAG_00100000) chr_move_to_pad(CHR_SELF, CHR_BOND, 88, /*goto*/ 0x17) goto_first(0x19) label(0x17) - unset_self_chrflag(0x00050400) + unset_self_chrflag(CHRCFLAG_HIDDEN | CHRCFLAG_PERIMDISABLEDTMP | CHRCFLAG_00040000) unset_self_chrflag(CHRCFLAG_INVINCIBLE) - unset_chr_hiddenflag(CHR_SELF, 0x00100200) + unset_chr_hiddenflag(CHR_SELF, CHRHFLAG_00000200 | CHRHFLAG_00100000) set_chr_cloaked(CHR_SELF, FALSE, TRUE) set_returnlist(CHR_SELF, GAILIST_COOP_BUDDY) set_shotlist(GAILIST_COOP_BUDDY) diff --git a/src/game/game_0b69d0.c b/src/game/game_0b69d0.c index b729be51f..2ca63bc57 100644 --- a/src/game/game_0b69d0.c +++ b/src/game/game_0b69d0.c @@ -1590,7 +1590,7 @@ bool currentPlayerAssumeChrForAnti(struct chrdata *hostchr, bool force) hostprop = hostchr->prop; - hostchr->chrflags |= CHRCFLAG_00010000; + hostchr->chrflags |= CHRCFLAG_PERIMDISABLEDTMP; playerchr->hidden |= CHRHFLAG_00100000; playerchr->chrwidth = hostchr->chrwidth; @@ -1693,7 +1693,7 @@ bool currentPlayerAssumeChrForAnti(struct chrdata *hostchr, bool force) return true; } - hostchr->chrflags &= ~CHRCFLAG_00010000; + hostchr->chrflags &= ~CHRCFLAG_PERIMDISABLEDTMP; return false; } diff --git a/src/game/game_190260.c b/src/game/game_190260.c index defcb8f0f..9b9393d34 100644 --- a/src/game/game_190260.c +++ b/src/game/game_190260.c @@ -10648,7 +10648,7 @@ glabel var7f1b8fc8 /* f1985e4: 02802025 */ move $a0,$s4 .PF0f1985e8: /* f1985e8: 02602825 */ move $a1,$s3 -/* f1985ec: 0fc0fec3 */ jal func0f03f988 +/* f1985ec: 0fc0fec3 */ jal chrSetHandFiring /* f1985f0: 02a03025 */ move $a2,$s5 /* f1985f4: 8fae004c */ lw $t6,0x4c($sp) /* f1985f8: 26730001 */ addiu $s3,$s3,0x1 @@ -13643,7 +13643,7 @@ glabel var7f1b8fc8 /* f1974e8: 02802025 */ or $a0,$s4,$zero .L0f1974ec: /* f1974ec: 02602825 */ or $a1,$s3,$zero -/* f1974f0: 0fc0fe62 */ jal func0f03f988 +/* f1974f0: 0fc0fe62 */ jal chrSetHandFiring /* f1974f4: 02a03025 */ or $a2,$s5,$zero /* f1974f8: 8fa9004c */ lw $t1,0x4c($sp) /* f1974fc: 26730001 */ addiu $s3,$s3,0x1 diff --git a/src/game/prop.c b/src/game/prop.c index ec2a32536..23e1bf5ba 100644 --- a/src/game/prop.c +++ b/src/game/prop.c @@ -5197,7 +5197,7 @@ void propsTickPadEffects(void) } } -void propSetCollisionsEnabled(struct prop *prop, s32 enable) +void propSetPerimEnabled(struct prop *prop, s32 enable) { if (prop->type == PROPTYPE_CHR) { chrSetPerimEnabled(prop->chr, enable); @@ -5709,7 +5709,7 @@ bool propIsOfCdType(struct prop *prop, u32 types) struct chrdata *chr = prop->chr; if (chr->actiontype == ACT_DEAD - || (chr->chrflags & (CHRCFLAG_HIDDEN | CHRCFLAG_00010000)) + || (chr->chrflags & (CHRCFLAG_HIDDEN | CHRCFLAG_PERIMDISABLEDTMP)) || (chr->hidden & CHRHFLAG_PERIMDISABLED)) { result = false; } diff --git a/src/game/propobj.c b/src/game/propobj.c index 638200f6b..76eec3cf1 100644 --- a/src/game/propobj.c +++ b/src/game/propobj.c @@ -19365,7 +19365,7 @@ glabel var7f1aa31c /* f0722cc: c488000c */ lwc1 $f8,0xc($a0) /* f0722d0: e7a80454 */ swc1 $f8,0x454($sp) /* f0722d4: c48a0010 */ lwc1 $f10,0x10($a0) -/* f0722d8: 0fc1905e */ jal propSetCollisionsEnabled +/* f0722d8: 0fc1905e */ jal propSetPerimEnabled /* f0722dc: e7aa0458 */ swc1 $f10,0x458($sp) /* f0722e0: 8fa3048c */ lw $v1,0x48c($sp) /* f0722e4: 44801000 */ mtc1 $zero,$f2 @@ -19514,7 +19514,7 @@ glabel var7f1aa31c /* f0724fc: afa20484 */ sw $v0,0x484($sp) .L0f072500: /* f072500: 8fa400e8 */ lw $a0,0xe8($sp) -/* f072504: 0fc1905e */ jal propSetCollisionsEnabled +/* f072504: 0fc1905e */ jal propSetPerimEnabled /* f072508: 24050001 */ addiu $a1,$zero,0x1 /* f07250c: 8faa0484 */ lw $t2,0x484($sp) /* f072510: 24010001 */ addiu $at,$zero,0x1 @@ -22061,7 +22061,7 @@ glabel var7f1aa3d0 /* f0737a0: 8e460088 */ lw $a2,0x88($s2) /* f0737a4: 10c00003 */ beqz $a2,.L0f0737b4 /* f0737a8: 00c02025 */ or $a0,$a2,$zero -/* f0737ac: 0fc1905e */ jal propSetCollisionsEnabled +/* f0737ac: 0fc1905e */ jal propSetPerimEnabled /* f0737b0: 00002825 */ or $a1,$zero,$zero .L0f0737b4: /* f0737b4: 8fa40188 */ lw $a0,0x188($sp) @@ -22073,7 +22073,7 @@ glabel var7f1aa3d0 /* f0737cc: 8e460088 */ lw $a2,0x88($s2) /* f0737d0: 10c00003 */ beqz $a2,.L0f0737e0 /* f0737d4: 00c02025 */ or $a0,$a2,$zero -/* f0737d8: 0fc1905e */ jal propSetCollisionsEnabled +/* f0737d8: 0fc1905e */ jal propSetPerimEnabled /* f0737dc: 24050001 */ addiu $a1,$zero,0x1 .L0f0737e0: /* f0737e0: 8fa90184 */ lw $t1,0x184($sp) @@ -22518,7 +22518,7 @@ glabel var7f1aa3d0 /* f0737a0: 8e460088 */ lw $a2,0x88($s2) /* f0737a4: 10c00003 */ beqz $a2,.L0f0737b4 /* f0737a8: 00c02025 */ or $a0,$a2,$zero -/* f0737ac: 0fc1905e */ jal propSetCollisionsEnabled +/* f0737ac: 0fc1905e */ jal propSetPerimEnabled /* f0737b0: 00002825 */ or $a1,$zero,$zero .L0f0737b4: /* f0737b4: 8fa40188 */ lw $a0,0x188($sp) @@ -22530,7 +22530,7 @@ glabel var7f1aa3d0 /* f0737cc: 8e460088 */ lw $a2,0x88($s2) /* f0737d0: 10c00003 */ beqz $a2,.L0f0737e0 /* f0737d4: 00c02025 */ or $a0,$a2,$zero -/* f0737d8: 0fc1905e */ jal propSetCollisionsEnabled +/* f0737d8: 0fc1905e */ jal propSetPerimEnabled /* f0737dc: 24050001 */ addiu $a1,$zero,0x1 .L0f0737e0: /* f0737e0: 8fa90184 */ lw $t1,0x184($sp) @@ -22762,7 +22762,7 @@ glabel func0f073ae8 /* f073b14: 12000004 */ beqz $s0,.L0f073b28 /* f073b18: 8c910014 */ lw $s1,0x14($a0) /* f073b1c: 02002025 */ or $a0,$s0,$zero -/* f073b20: 0fc1905e */ jal propSetCollisionsEnabled +/* f073b20: 0fc1905e */ jal propSetPerimEnabled /* f073b24: 00002825 */ or $a1,$zero,$zero .L0f073b28: /* f073b28: 266500c4 */ addiu $a1,$s3,0xc4 @@ -22775,7 +22775,7 @@ glabel func0f073ae8 /* f073b44: 8e700088 */ lw $s0,0x88($s3) /* f073b48: 12000003 */ beqz $s0,.L0f073b58 /* f073b4c: 02002025 */ or $a0,$s0,$zero -/* f073b50: 0fc1905e */ jal propSetCollisionsEnabled +/* f073b50: 0fc1905e */ jal propSetPerimEnabled /* f073b54: 24050001 */ addiu $a1,$zero,0x1 .L0f073b58: /* f073b58: 8fae005c */ lw $t6,0x5c($sp) @@ -22868,7 +22868,7 @@ glabel func0f073ae8 /* f073b14: 12000004 */ beqz $s0,.L0f073b28 /* f073b18: 8c910014 */ lw $s1,0x14($a0) /* f073b1c: 02002025 */ or $a0,$s0,$zero -/* f073b20: 0fc1905e */ jal propSetCollisionsEnabled +/* f073b20: 0fc1905e */ jal propSetPerimEnabled /* f073b24: 00002825 */ or $a1,$zero,$zero .L0f073b28: /* f073b28: 266500c4 */ addiu $a1,$s3,0xc4 @@ -22881,7 +22881,7 @@ glabel func0f073ae8 /* f073b44: 8e700088 */ lw $s0,0x88($s3) /* f073b48: 12000003 */ beqz $s0,.L0f073b58 /* f073b4c: 02002025 */ or $a0,$s0,$zero -/* f073b50: 0fc1905e */ jal propSetCollisionsEnabled +/* f073b50: 0fc1905e */ jal propSetPerimEnabled /* f073b54: 24050001 */ addiu $a1,$zero,0x1 .L0f073b58: /* f073b58: 8fae005c */ lw $t6,0x5c($sp) @@ -23323,7 +23323,7 @@ glabel var7f1ab6dcpf .PF0f074334: /* f074334: 50800004 */ beqzl $a0,.PF0f074348 /* f074338: 86240006 */ lh $a0,0x6($s1) -/* f07433c: 0fc19102 */ jal propSetCollisionsEnabled +/* f07433c: 0fc19102 */ jal propSetPerimEnabled /* f074340: 00002825 */ move $a1,$zero /* f074344: 86240006 */ lh $a0,0x6($s1) .PF0f074348: @@ -23970,7 +23970,7 @@ glabel var7f1ab6dcpf .PF0f074ccc: /* f074ccc: 50800004 */ beqzl $a0,.PF0f074ce0 /* f074cd0: c6080004 */ lwc1 $f8,0x4($s0) -/* f074cd4: 0fc19102 */ jal propSetCollisionsEnabled +/* f074cd4: 0fc19102 */ jal propSetPerimEnabled /* f074cd8: 24050001 */ li $a1,0x1 /* f074cdc: c6080004 */ lwc1 $f8,0x4($s0) .PF0f074ce0: @@ -24600,7 +24600,7 @@ glabel var7f1ab6dcpf /* f075640: 8e040088 */ lw $a0,0x88($s0) /* f075644: 50800004 */ beqzl $a0,.PF0f075658 /* f075648: 8e0c0000 */ lw $t4,0x0($s0) -/* f07564c: 0fc19102 */ jal propSetCollisionsEnabled +/* f07564c: 0fc19102 */ jal propSetPerimEnabled /* f075650: 00002825 */ move $a1,$zero /* f075654: 8e0c0000 */ lw $t4,0x0($s0) .PF0f075658: @@ -24624,7 +24624,7 @@ glabel var7f1ab6dcpf /* f075694: 8e040088 */ lw $a0,0x88($s0) /* f075698: 50800004 */ beqzl $a0,.PF0f0756ac /* f07569c: 240e0001 */ li $t6,0x1 -/* f0756a0: 0fc19102 */ jal propSetCollisionsEnabled +/* f0756a0: 0fc19102 */ jal propSetPerimEnabled /* f0756a4: 24050001 */ li $a1,0x1 /* f0756a8: 240e0001 */ li $t6,0x1 .PF0f0756ac: @@ -26864,7 +26864,7 @@ glabel var7f1aa438 .L0f0740bc: /* f0740bc: 50800004 */ beqzl $a0,.L0f0740d0 /* f0740c0: 86240006 */ lh $a0,0x6($s1) -/* f0740c4: 0fc1905e */ jal propSetCollisionsEnabled +/* f0740c4: 0fc1905e */ jal propSetPerimEnabled /* f0740c8: 00002825 */ or $a1,$zero,$zero /* f0740cc: 86240006 */ lh $a0,0x6($s1) .L0f0740d0: @@ -27508,7 +27508,7 @@ glabel var7f1aa438 .L0f074a48: /* f074a48: 50800004 */ beqzl $a0,.L0f074a5c /* f074a4c: c6060004 */ lwc1 $f6,0x4($s0) -/* f074a50: 0fc1905e */ jal propSetCollisionsEnabled +/* f074a50: 0fc1905e */ jal propSetPerimEnabled /* f074a54: 24050001 */ addiu $a1,$zero,0x1 /* f074a58: c6060004 */ lwc1 $f6,0x4($s0) .L0f074a5c: @@ -28138,7 +28138,7 @@ glabel var7f1aa438 /* f0753bc: 8e040088 */ lw $a0,0x88($s0) /* f0753c0: 50800004 */ beqzl $a0,.L0f0753d4 /* f0753c4: 8e0c0000 */ lw $t4,0x0($s0) -/* f0753c8: 0fc1905e */ jal propSetCollisionsEnabled +/* f0753c8: 0fc1905e */ jal propSetPerimEnabled /* f0753cc: 00002825 */ or $a1,$zero,$zero /* f0753d0: 8e0c0000 */ lw $t4,0x0($s0) .L0f0753d4: @@ -28162,7 +28162,7 @@ glabel var7f1aa438 /* f075410: 8e040088 */ lw $a0,0x88($s0) /* f075414: 50800004 */ beqzl $a0,.L0f075428 /* f075418: 240e0001 */ addiu $t6,$zero,0x1 -/* f07541c: 0fc1905e */ jal propSetCollisionsEnabled +/* f07541c: 0fc1905e */ jal propSetPerimEnabled /* f075420: 24050001 */ addiu $a1,$zero,0x1 /* f075424: 240e0001 */ addiu $t6,$zero,0x1 .L0f075428: @@ -30396,7 +30396,7 @@ glabel var7f1aa438 .NB0f072e50: /* f072e50: 50800004 */ beqzl $a0,.NB0f072e64 /* f072e54: 86240006 */ lh $a0,0x6($s1) -/* f072e58: 0fc18cfb */ jal propSetCollisionsEnabled +/* f072e58: 0fc18cfb */ jal propSetPerimEnabled /* f072e5c: 00002825 */ or $a1,$zero,$zero /* f072e60: 86240006 */ lh $a0,0x6($s1) .NB0f072e64: @@ -31033,7 +31033,7 @@ glabel var7f1aa438 .NB0f0737c4: /* f0737c4: 50800004 */ beqzl $a0,.NB0f0737d8 /* f0737c8: c6060004 */ lwc1 $f6,0x4($s0) -/* f0737cc: 0fc18cfb */ jal propSetCollisionsEnabled +/* f0737cc: 0fc18cfb */ jal propSetPerimEnabled /* f0737d0: 24050001 */ addiu $a1,$zero,0x1 /* f0737d4: c6060004 */ lwc1 $f6,0x4($s0) .NB0f0737d8: @@ -31663,7 +31663,7 @@ glabel var7f1aa438 /* f074138: 8e040088 */ lw $a0,0x88($s0) /* f07413c: 50800004 */ beqzl $a0,.NB0f074150 /* f074140: 8e0b0000 */ lw $t3,0x0($s0) -/* f074144: 0fc18cfb */ jal propSetCollisionsEnabled +/* f074144: 0fc18cfb */ jal propSetPerimEnabled /* f074148: 00002825 */ or $a1,$zero,$zero /* f07414c: 8e0b0000 */ lw $t3,0x0($s0) .NB0f074150: @@ -31687,7 +31687,7 @@ glabel var7f1aa438 /* f07418c: 8e040088 */ lw $a0,0x88($s0) /* f074190: 50800004 */ beqzl $a0,.NB0f0741a4 /* f074194: 240d0001 */ addiu $t5,$zero,0x1 -/* f074198: 0fc18cfb */ jal propSetCollisionsEnabled +/* f074198: 0fc18cfb */ jal propSetPerimEnabled /* f07419c: 24050001 */ addiu $a1,$zero,0x1 /* f0741a0: 240d0001 */ addiu $t5,$zero,0x1 .NB0f0741a4: @@ -36254,10 +36254,10 @@ glabel var7f1aa580 /* f0796c8: afa30044 */ sw $v1,0x44($sp) /* f0796cc: afa800ac */ sw $t0,0xac($sp) /* f0796d0: e7a00048 */ swc1 $f0,0x48($sp) -/* f0796d4: 0fc1905e */ jal propSetCollisionsEnabled +/* f0796d4: 0fc1905e */ jal propSetPerimEnabled /* f0796d8: e7b200a4 */ swc1 $f18,0xa4($sp) /* f0796dc: 8fa4006c */ lw $a0,0x6c($sp) -/* f0796e0: 0fc1905e */ jal propSetCollisionsEnabled +/* f0796e0: 0fc1905e */ jal propSetPerimEnabled /* f0796e4: 00002825 */ or $a1,$zero,$zero /* f0796e8: 8fa800ac */ lw $t0,0xac($sp) /* f0796ec: c7a00048 */ lwc1 $f0,0x48($sp) @@ -36329,10 +36329,10 @@ glabel var7f1aa580 .L0f0797e8: /* f0797e8: 24050001 */ addiu $a1,$zero,0x1 /* f0797ec: afa800ac */ sw $t0,0xac($sp) -/* f0797f0: 0fc1905e */ jal propSetCollisionsEnabled +/* f0797f0: 0fc1905e */ jal propSetPerimEnabled /* f0797f4: e7b200a4 */ swc1 $f18,0xa4($sp) /* f0797f8: 8fa4006c */ lw $a0,0x6c($sp) -/* f0797fc: 0fc1905e */ jal propSetCollisionsEnabled +/* f0797fc: 0fc1905e */ jal propSetPerimEnabled /* f079800: 24050001 */ addiu $a1,$zero,0x1 /* f079804: 3c09800a */ lui $t1,%hi(g_Vars) /* f079808: 25299fc0 */ addiu $t1,$t1,%lo(g_Vars) @@ -37476,10 +37476,10 @@ glabel var7f1aa580 /* f0796c8: afa30044 */ sw $v1,0x44($sp) /* f0796cc: afa800ac */ sw $t0,0xac($sp) /* f0796d0: e7a00048 */ swc1 $f0,0x48($sp) -/* f0796d4: 0fc1905e */ jal propSetCollisionsEnabled +/* f0796d4: 0fc1905e */ jal propSetPerimEnabled /* f0796d8: e7b200a4 */ swc1 $f18,0xa4($sp) /* f0796dc: 8fa4006c */ lw $a0,0x6c($sp) -/* f0796e0: 0fc1905e */ jal propSetCollisionsEnabled +/* f0796e0: 0fc1905e */ jal propSetPerimEnabled /* f0796e4: 00002825 */ or $a1,$zero,$zero /* f0796e8: 8fa800ac */ lw $t0,0xac($sp) /* f0796ec: c7a00048 */ lwc1 $f0,0x48($sp) @@ -37551,10 +37551,10 @@ glabel var7f1aa580 .L0f0797e8: /* f0797e8: 24050001 */ addiu $a1,$zero,0x1 /* f0797ec: afa800ac */ sw $t0,0xac($sp) -/* f0797f0: 0fc1905e */ jal propSetCollisionsEnabled +/* f0797f0: 0fc1905e */ jal propSetPerimEnabled /* f0797f4: e7b200a4 */ swc1 $f18,0xa4($sp) /* f0797f8: 8fa4006c */ lw $a0,0x6c($sp) -/* f0797fc: 0fc1905e */ jal propSetCollisionsEnabled +/* f0797fc: 0fc1905e */ jal propSetPerimEnabled /* f079800: 24050001 */ addiu $a1,$zero,0x1 /* f079804: 3c09800a */ lui $t1,%hi(g_Vars) /* f079808: 25299fc0 */ addiu $t1,$t1,%lo(g_Vars) @@ -38089,7 +38089,7 @@ glabel var7f1aa5a8 /* f07a0b0: 8fa40198 */ lw $a0,0x198($sp) .L0f07a0b4: /* f07a0b4: 00002825 */ or $a1,$zero,$zero -/* f07a0b8: 0fc1905e */ jal propSetCollisionsEnabled +/* f07a0b8: 0fc1905e */ jal propSetPerimEnabled /* f07a0bc: afa70120 */ sw $a3,0x120($sp) /* f07a0c0: 8fa20198 */ lw $v0,0x198($sp) /* f07a0c4: 8fa70120 */ lw $a3,0x120($sp) @@ -38607,7 +38607,7 @@ glabel var7f1aa5a8 .L0f07a84c: /* f07a84c: 8fa40198 */ lw $a0,0x198($sp) .L0f07a850: -/* f07a850: 0fc1905e */ jal propSetCollisionsEnabled +/* f07a850: 0fc1905e */ jal propSetPerimEnabled /* f07a854: 24050001 */ addiu $a1,$zero,0x1 /* f07a858: 8fae018c */ lw $t6,0x18c($sp) /* f07a85c: 8fab0188 */ lw $t3,0x188($sp) @@ -39051,7 +39051,7 @@ glabel var7f1aa5a8 /* f07a0b0: 8fa40198 */ lw $a0,0x198($sp) .L0f07a0b4: /* f07a0b4: 00002825 */ or $a1,$zero,$zero -/* f07a0b8: 0fc1905e */ jal propSetCollisionsEnabled +/* f07a0b8: 0fc1905e */ jal propSetPerimEnabled /* f07a0bc: afa70120 */ sw $a3,0x120($sp) /* f07a0c0: 8fa20198 */ lw $v0,0x198($sp) /* f07a0c4: 8fa70120 */ lw $a3,0x120($sp) @@ -39569,7 +39569,7 @@ glabel var7f1aa5a8 .L0f07a84c: /* f07a84c: 8fa40198 */ lw $a0,0x198($sp) .L0f07a850: -/* f07a850: 0fc1905e */ jal propSetCollisionsEnabled +/* f07a850: 0fc1905e */ jal propSetPerimEnabled /* f07a854: 24050001 */ addiu $a1,$zero,0x1 /* f07a858: 8fae018c */ lw $t6,0x18c($sp) /* f07a85c: 8fab0188 */ lw $t3,0x188($sp) @@ -40013,7 +40013,7 @@ glabel var7f1aa5a8 /* f07a0b0: 8fa40198 */ lw $a0,0x198($sp) .L0f07a0b4: /* f07a0b4: 00002825 */ or $a1,$zero,$zero -/* f07a0b8: 0fc1905e */ jal propSetCollisionsEnabled +/* f07a0b8: 0fc1905e */ jal propSetPerimEnabled /* f07a0bc: afa70120 */ sw $a3,0x120($sp) /* f07a0c0: 8fa20198 */ lw $v0,0x198($sp) /* f07a0c4: 8fa70120 */ lw $a3,0x120($sp) @@ -40531,7 +40531,7 @@ glabel var7f1aa5a8 .L0f07a84c: /* f07a84c: 8fa40198 */ lw $a0,0x198($sp) .L0f07a850: -/* f07a850: 0fc1905e */ jal propSetCollisionsEnabled +/* f07a850: 0fc1905e */ jal propSetPerimEnabled /* f07a854: 24050001 */ addiu $a1,$zero,0x1 /* f07a858: 8fae018c */ lw $t6,0x18c($sp) /* f07a85c: 8fab0188 */ lw $t3,0x188($sp) @@ -57590,7 +57590,7 @@ glabel var7f1aa978 /* f083bb0: 0c0056f9 */ jal mtx00015be4 /* f083bb4: 27a600f0 */ addiu $a2,$sp,0xf0 /* f083bb8: 02002025 */ or $a0,$s0,$zero -/* f083bbc: 0fc1905e */ jal propSetCollisionsEnabled +/* f083bbc: 0fc1905e */ jal propSetPerimEnabled /* f083bc0: 00002825 */ or $a1,$zero,$zero /* f083bc4: c7a40120 */ lwc1 $f4,0x120($sp) /* f083bc8: c7a80124 */ lwc1 $f8,0x124($sp) @@ -57634,7 +57634,7 @@ glabel var7f1aa978 /* f083c5c: e7a80128 */ swc1 $f8,0x128($sp) /* f083c60: 02002025 */ or $a0,$s0,$zero .L0f083c64: -/* f083c64: 0fc1905e */ jal propSetCollisionsEnabled +/* f083c64: 0fc1905e */ jal propSetPerimEnabled /* f083c68: 24050001 */ addiu $a1,$zero,0x1 /* f083c6c: 8fae0048 */ lw $t6,0x48($sp) /* f083c70: 8fb80140 */ lw $t8,0x140($sp) @@ -58563,7 +58563,7 @@ glabel var7f1aa978 /* f083bb0: 0c0056f9 */ jal mtx00015be4 /* f083bb4: 27a600f0 */ addiu $a2,$sp,0xf0 /* f083bb8: 02002025 */ or $a0,$s0,$zero -/* f083bbc: 0fc1905e */ jal propSetCollisionsEnabled +/* f083bbc: 0fc1905e */ jal propSetPerimEnabled /* f083bc0: 00002825 */ or $a1,$zero,$zero /* f083bc4: c7a40120 */ lwc1 $f4,0x120($sp) /* f083bc8: c7a80124 */ lwc1 $f8,0x124($sp) @@ -58607,7 +58607,7 @@ glabel var7f1aa978 /* f083c5c: e7a80128 */ swc1 $f8,0x128($sp) /* f083c60: 02002025 */ or $a0,$s0,$zero .L0f083c64: -/* f083c64: 0fc1905e */ jal propSetCollisionsEnabled +/* f083c64: 0fc1905e */ jal propSetPerimEnabled /* f083c68: 24050001 */ addiu $a1,$zero,0x1 /* f083c6c: 8fae0048 */ lw $t6,0x48($sp) /* f083c70: 8fb80140 */ lw $t8,0x140($sp) @@ -71576,12 +71576,12 @@ void doorsCalcFrac(struct doorobj *door) if ((door->doorflags & DOORFLAG_UNBLOCKABLEOPEN) == 0) #endif { - propSetCollisionsEnabled(loopprop, false); + propSetPerimEnabled(loopprop, false); cdresult = cd0002e4c4(loopdoor->base.geo2, loopprop->rooms, CDTYPE_OBJS | CDTYPE_PLAYERS | CDTYPE_CHRS | CDTYPE_PATHBLOCKER | CDTYPE_OBJSNOTSAFEORHELI); - propSetCollisionsEnabled(loopprop, true); + propSetPerimEnabled(loopprop, true); if (cdresult == CDRESULT_COLLISION) { struct prop *blockerprop = cdGetObstacle(); @@ -73146,7 +73146,7 @@ glabel var7f1ab214 /* f091840: c4720008 */ lwc1 $f18,0x8($v1) /* f091844: 46003402 */ mul.s $f16,$f6,$f0 /* f091848: 46128100 */ add.s $f4,$f16,$f18 -/* f09184c: 0fc1905e */ jal propSetCollisionsEnabled +/* f09184c: 0fc1905e */ jal propSetPerimEnabled /* f091850: e7a401f8 */ swc1 $f4,0x1f8($sp) /* f091854: 8fa50200 */ lw $a1,0x200($sp) /* f091858: 24090010 */ addiu $t1,$zero,0x10 @@ -73170,7 +73170,7 @@ glabel var7f1ab214 /* f0918a0: afa201d8 */ sw $v0,0x1d8($sp) .L0f0918a4: /* f0918a4: 8fa40200 */ lw $a0,0x200($sp) -/* f0918a8: 0fc1905e */ jal propSetCollisionsEnabled +/* f0918a8: 0fc1905e */ jal propSetPerimEnabled /* f0918ac: 24050001 */ addiu $a1,$zero,0x1 /* f0918b0: 8fab0208 */ lw $t3,0x208($sp) /* f0918b4: 8fac0214 */ lw $t4,0x214($sp) @@ -73875,7 +73875,7 @@ glabel var7f1ab214 /* f091840: c4720008 */ lwc1 $f18,0x8($v1) /* f091844: 46003402 */ mul.s $f16,$f6,$f0 /* f091848: 46128100 */ add.s $f4,$f16,$f18 -/* f09184c: 0fc1905e */ jal propSetCollisionsEnabled +/* f09184c: 0fc1905e */ jal propSetPerimEnabled /* f091850: e7a401f8 */ swc1 $f4,0x1f8($sp) /* f091854: 8fa50200 */ lw $a1,0x200($sp) /* f091858: 24090010 */ addiu $t1,$zero,0x10 @@ -73899,7 +73899,7 @@ glabel var7f1ab214 /* f0918a0: afa201d8 */ sw $v0,0x1d8($sp) .L0f0918a4: /* f0918a4: 8fa40200 */ lw $a0,0x200($sp) -/* f0918a8: 0fc1905e */ jal propSetCollisionsEnabled +/* f0918a8: 0fc1905e */ jal propSetPerimEnabled /* f0918ac: 24050001 */ addiu $a1,$zero,0x1 /* f0918b0: 8fab0208 */ lw $t3,0x208($sp) /* f0918b4: 8fac0214 */ lw $t4,0x214($sp) @@ -74604,7 +74604,7 @@ glabel var7f1ab214 /* f091840: c4720008 */ lwc1 $f18,0x8($v1) /* f091844: 46003402 */ mul.s $f16,$f6,$f0 /* f091848: 46128100 */ add.s $f4,$f16,$f18 -/* f09184c: 0fc1905e */ jal propSetCollisionsEnabled +/* f09184c: 0fc1905e */ jal propSetPerimEnabled /* f091850: e7a401f8 */ swc1 $f4,0x1f8($sp) /* f091854: 8fa50200 */ lw $a1,0x200($sp) /* f091858: 24090010 */ addiu $t1,$zero,0x10 @@ -74628,7 +74628,7 @@ glabel var7f1ab214 /* f0918a0: afa201d8 */ sw $v0,0x1d8($sp) .L0f0918a4: /* f0918a4: 8fa40200 */ lw $a0,0x200($sp) -/* f0918a8: 0fc1905e */ jal propSetCollisionsEnabled +/* f0918a8: 0fc1905e */ jal propSetPerimEnabled /* f0918ac: 24050001 */ addiu $a1,$zero,0x1 /* f0918b0: 8fab0208 */ lw $t3,0x208($sp) /* f0918b4: 8fac0214 */ lw $t4,0x214($sp) diff --git a/src/include/commands.h b/src/include/commands.h index 103bcc4a0..1ffe6dc24 100644 --- a/src/include/commands.h +++ b/src/include/commands.h @@ -3201,8 +3201,11 @@ mkshort(0x0167), \ side, -// If flag is set, unsets it and goes to label -#define try_unset_chr_flag_bank3_02000000(chr, label) \ +/** + * Checks if the chr's shield has been damaged since the last time it was + * checked. + */ +#define if_chr_shield_damaged(chr, label) \ mkshort(0x0168), \ chr, \ label, diff --git a/src/include/constants.h b/src/include/constants.h index 45c683458..590e1d2a0 100644 --- a/src/include/constants.h +++ b/src/include/constants.h @@ -438,8 +438,8 @@ // chr->hidden #define CHRHFLAG_00000001 0x00000001 // Set when chr drops weapon #define CHRHFLAG_IS_HEARING_TARGET 0x00000002 // Not used in scripts -#define CHRHFLAG_00000004 0x00000004 // Related to firing - hand 1 -#define CHRHFLAG_00000008 0x00000008 // Related to firing - hand 0 +#define CHRHFLAG_FIRINGLEFT 0x00000004 +#define CHRHFLAG_FIRINGRIGHT 0x00000008 #define CHRHFLAG_BLOCKINGDOOR 0x00000010 #define CHRHFLAG_REAPED 0x00000020 #define CHRHFLAG_TIMER_RUNNING 0x00000040 @@ -488,7 +488,7 @@ #define CHRCFLAG_INVINCIBLE 0x00000010 #define CHRCFLAG_LOSEXTRAHEIGHT 0x00000020 // Chicago, Infiltration, AF1, Ruins, WAR #define CHRCFLAG_00000040 0x00000040 // Used quite a lot -#define CHRCFLAG_00000080 0x00000080 // Defection programmer, Rescue lab techs, globals when doing idle animation +#define CHRCFLAG_CANFACEWALL 0x00000080 // Defection programmer, Rescue lab techs, globals when doing idle animation #define CHRCFLAG_JUST_INJURED 0x00000100 #define CHRCFLAG_00000200 0x00000200 // Set on clones #define CHRCFLAG_HIDDEN 0x00000400 @@ -497,7 +497,7 @@ #define CHRCFLAG_NOSHADOW 0x00002000 #define CHRCFLAG_HAS_SPECIAL_DEATH_ANIMATION 0x00004000 #define CHRCFLAG_DIEWITHFORCE 0x00008000 // When killed with a weak weapon, fling the chr as if it was a strong weapon -#define CHRCFLAG_00010000 0x00010000 // Related to dead people in intro cutscenes +#define CHRCFLAG_PERIMDISABLEDTMP 0x00010000 // Collisions disabled temporarily #define CHRCFLAG_FORCEAUTOAIM 0x00020000 // Allow auto aim even if chr is unarmed #define CHRCFLAG_00040000 0x00040000 // Used a lot #define CHRCFLAG_RUNFASTER 0x00080000 @@ -506,7 +506,7 @@ #define CHRCFLAG_00400000 0x00400000 // Not used in scripts #define CHRCFLAG_UNPLAYABLE 0x00800000 #define CHRCFLAG_PUSHABLE 0x01000000 // Typically set on allies during init -#define CHRCFLAG_02000000 0x02000000 // can be unset by cmd0168 +#define CHRCFLAG_SHIELDDAMAGED 0x02000000 #define CHRCFLAG_KEEPCORPSEKO 0x04000000 #define CHRCFLAG_CONSIDER_DODGE 0x08000000 #define CHRCFLAG_10000000 0x10000000 // Not used in scripts diff --git a/src/include/game/chr/chraction.h b/src/include/game/chr/chraction.h index 63caeaa04..fae402ff9 100644 --- a/src/include/game/chr/chraction.h +++ b/src/include/game/chr/chraction.h @@ -277,7 +277,7 @@ void func0f03e5b0(struct chrdata *chr, f32 arg1); void chrResetAimEndProperties(struct chrdata *chr); void chrSetFiring(struct chrdata *chr, s32 hand, bool firing); void chrStopFiring(struct chrdata *chr); -void func0f03f988(struct chrdata *chr, s32 hand, bool arg2); +void chrSetHandFiring(struct chrdata *chr, s32 hand, bool arg2); void func0f0429d8(struct chrdata *chr, f32 arg1, f32 arg2); void propUnsetDangerous(struct prop *prop); void propSetDangerous(struct prop *prop); diff --git a/src/include/game/chr/chraicommands.h b/src/include/game/chr/chraicommands.h index 10bf29c11..f08d0d60a 100644 --- a/src/include/game/chr/chraicommands.h +++ b/src/include/game/chr/chraicommands.h @@ -338,7 +338,7 @@ /*0x0165*/ bool aiIfChrInjured(void); /*0x0166*/ bool aiIfAction(void); /*0x0167*/ bool aiHovercopterFireRocket(void); -/*0x0168*/ bool ai0168(void); +/*0x0168*/ bool aiIfShieldDamaged(void); /*0x0169*/ bool aiIfNaturalAnim(void); /*0x016a*/ bool aiIfY(void); /*0x016b*/ bool ai016b(void); diff --git a/src/include/game/prop.h b/src/include/game/prop.h index 607adfd9b..24eabaa2d 100644 --- a/src/include/game/prop.h +++ b/src/include/game/prop.h @@ -35,7 +35,7 @@ void propPause(struct prop *prop); void propUnpause(struct prop *prop); void propsTick(u32 islastplayer); void propsTickPadEffects(void); -void propSetCollisionsEnabled(struct prop *prop, bool enable); +void propSetPerimEnabled(struct prop *prop, bool enable); void func0f0641f4(void); f32 func0f06438c(struct prop *prop, struct coord *arg1, f32 *arg2, f32 *arg3, f32 *arg4, s32 arg5, bool cangangsta, s32 arg7); void farsightChooseTarget(void);