diff --git a/src/globals.c b/src/globals.c index 263dad2b6..f9eb702f1 100644 --- a/src/globals.c +++ b/src/globals.c @@ -1326,15 +1326,15 @@ u8 func0007_alerted[] = { if_chr_distance_gt(2500, /*goto*/ 0x14) // Distance between 1000 and 2500 - if_angle_to_target_chr_lt(10, /*goto*/ 0x13) - cmd004f(246, /*goto*/ 0x13) + if_jo_ccw_direction_lt(10, /*goto*/ 0x13) + if_jo_ccw_direction_gt(246, /*goto*/ 0x13) restart_timer stop_chr try_face_entity(0x0200, 0x0000, /*goto*/ 0xec) beginloop(0xec) - if_angle_to_target_chr_lt(10, /*goto*/ 0x13) - cmd004f(246, /*goto*/ 0x13) + if_jo_ccw_direction_lt(10, /*goto*/ 0x13) + if_jo_ccw_direction_gt(246, /*goto*/ 0x13) if_timer_gt(60, /*goto*/ 0x13) endloop(0xec) @@ -3873,8 +3873,8 @@ u8 func000f_hand_combat[] = { label(LABEL_FACE_TARGET) restart_timer dprint 'F','A','C','E',' ','T','A','R','G','E','T','\n',0, - if_angle_to_target_chr_lt(10, /*goto*/ LABEL_PUNCH) - cmd004f(246, /*goto*/ LABEL_PUNCH) + if_jo_ccw_direction_lt(10, /*goto*/ LABEL_PUNCH) + if_jo_ccw_direction_gt(246, /*goto*/ LABEL_PUNCH) stop_chr try_face_entity(0x0200, 0x0001, /*goto*/ 0x04) @@ -3884,8 +3884,8 @@ u8 func000f_hand_combat[] = { if_chr_unloaded(TARGET_CHR, /*goto*/ 0xfa) label(0x13) if_chr_distance_gt(400, /*goto*/ 0x0b) - if_angle_to_target_chr_lt(15, /*goto*/ LABEL_PUNCH) - cmd004f(240, /*goto*/ LABEL_PUNCH) + if_jo_ccw_direction_lt(15, /*goto*/ LABEL_PUNCH) + if_jo_ccw_direction_gt(240, /*goto*/ LABEL_PUNCH) if_timer_gt(60, /*goto*/ LABEL_PUNCH) endloop(0x04) @@ -3972,8 +3972,8 @@ u8 func0010_civilian_say_comment[] = { beginloop(0x04) if_shot_near_chr(0x01, /*goto*/ 0x83) if_saw_death(0x01, /*goto*/ 0x83) - if_angle_to_target_chr_lt(10, /*goto*/ 0x13) - cmd004f(246, /*goto*/ 0x13) + if_jo_ccw_direction_lt(10, /*goto*/ 0x13) + if_jo_ccw_direction_gt(246, /*goto*/ 0x13) if_timer_gt(60, /*goto*/ 0x13) endloop(0x04) diff --git a/src/include/commands.h b/src/include/commands.h index 9d4abb728..d92b22743 100644 --- a/src/include/commands.h +++ b/src/include/commands.h @@ -287,7 +287,11 @@ mkshort(0x004c), \ label, -#define if_angle_to_target_chr_lt(value, label) \ +// Checks if Jo is within a certain angle of the chr's direction. +// Value is a percentage of the circle, where 256 is a full circle. +// Only ever called with value = decimal 10, which is about 14 degrees. +// With value 10, returns true if Jo is roughly within 12-11 o'clock. +#define if_jo_ccw_direction_lt(value, label) \ mkshort(0x004d), \ value, \ label, @@ -302,19 +306,29 @@ bool2, \ label, -// If given value * some global / 256 is less than some value derived from the current chr -// Used by skedar before they do hand combat or pounce -#define cmd004f(value, label) \ +// Checks if Jo is outside of a certain angle of the chr's direction. +// Value is a percentage of the circle, where 256 is a full circle. +// Called with values = -10 and -11, which is about -14 degrees. +// With value -10, returns true if Jo is roughly within 12-1 o'clock. +#define if_jo_ccw_direction_gt(value, label) \ mkshort(0x004f), \ value, \ label, -// The value is multiplied by a variable at 0x7f1a9364 -#define if_distance_to_target_chr_lt(value, label) \ +// Similar to 004d and 004f, but checks if Jo is within the angle of player's +// 12 o'clock (ie. either side). +#define if_jo_front_direction_lt(value, label) \ mkshort(0x0050), \ value, \ label, +// Similar to 004d and 004f, but checks if Jo is not in front of the current chr +// by the given angle. +#define if_jo_front_direction_gt(value, label) \ + mkshort(0x0051), \ + value, \ + label, + #define if_chr_distance_lt(distance, label) \ mkshort(0x0052), \ mkshort(distance / 10), \ diff --git a/src/setup/setupame.c b/src/setup/setupame.c index b81728597..b826cdb51 100644 --- a/src/setup/setupame.c +++ b/src/setup/setupame.c @@ -1274,7 +1274,7 @@ u8 func040f_cass[] = { try_face_entity(0x0200, 0x0000, /*goto*/ 0x64) beginloop(0x64) - if_angle_to_target_chr_lt(10, /*goto*/ 0x65) + if_jo_ccw_direction_lt(10, /*goto*/ 0x65) if_timer_gt(90, /*goto*/ 0x65) endloop(0x64) @@ -1507,7 +1507,7 @@ u8 func0411_secretary[] = { try_face_entity(0x0200, 0x0000, /*goto*/ 0x7f) beginloop(0x7f) - if_angle_to_target_chr_lt(10, /*goto*/ 0x81) + if_jo_ccw_direction_lt(10, /*goto*/ 0x81) if_timer_gt(120, /*goto*/ 0x81) endloop(0x7f) @@ -1698,7 +1698,7 @@ u8 func0414_programmer[] = { try_face_entity(0x0200, 0x0000, /*goto*/ 0x9a) beginloop(0x9a) - if_angle_to_target_chr_lt(10, /*goto*/ 0x06) + if_jo_ccw_direction_lt(10, /*goto*/ 0x06) if_timer_gt(60, /*goto*/ 0x06) endloop(0x9a) @@ -1798,7 +1798,7 @@ u8 func0414_programmer[] = { beginloop(0x9b) if_stage_flag_eq(STAGEFLAG_TALKED_TO_PROGRAMMER, TRUE, /*goto*/ 0x06) - if_angle_to_target_chr_lt(10, /*goto*/ 0x06) + if_jo_ccw_direction_lt(10, /*goto*/ 0x06) if_timer_gt(60, /*goto*/ 0x06) endloop(0x9b) diff --git a/src/setup/setupcave.c b/src/setup/setupcave.c index 50eebd797..5747ca84d 100644 --- a/src/setup/setupcave.c +++ b/src/setup/setupcave.c @@ -1230,7 +1230,7 @@ u8 func0407_stewardess[] = { try_face_entity(0x0200, 0x0000, /*goto*/ 0x05) beginloop(0x05) - if_angle_to_target_chr_lt(10, /*goto*/ 0x02) + if_jo_ccw_direction_lt(10, /*goto*/ 0x02) if_timer_gt(60, /*goto*/ 0x02) endloop(0x05) @@ -1527,7 +1527,7 @@ u8 func0408_secretary[] = { try_face_entity(0x0200, 0x0000, /*goto*/ 0x05) beginloop(0x05) - if_angle_to_target_chr_lt(10, /*goto*/ 0x02) + if_jo_ccw_direction_lt(10, /*goto*/ 0x02) if_timer_gt(60, /*goto*/ 0x02) endloop(0x05) @@ -2123,7 +2123,7 @@ u8 func0409_office1[] = { reloop(0x0b) label(0x31) - if_angle_to_target_chr_lt(10, /*goto*/ 0x02) + if_jo_ccw_direction_lt(10, /*goto*/ 0x02) if_timer_gt(60, /*goto*/ 0x02) endloop(0x0b) @@ -2146,7 +2146,7 @@ u8 func0409_office1[] = { try_face_entity(0x0200, 0x0000, /*goto*/ 0x05) beginloop(0x05) - if_angle_to_target_chr_lt(10, /*goto*/ 0x02) + if_jo_ccw_direction_lt(10, /*goto*/ 0x02) if_timer_gt(60, /*goto*/ 0x02) endloop(0x05) @@ -2241,7 +2241,7 @@ u8 func040a_office2[] = { reloop(0x05) label(0x31) - if_angle_to_target_chr_lt(10, /*goto*/ 0x02) + if_jo_ccw_direction_lt(10, /*goto*/ 0x02) if_timer_gt(60, /*goto*/ 0x02) endloop(0x05) @@ -2506,8 +2506,8 @@ u8 func040f_nsa[] = { try_face_entity(0x0200, 0x0000, /*goto*/ 0x09) beginloop(0x09) - if_angle_to_target_chr_lt(10, /*goto*/ 0x02) - cmd004f(245, /*goto*/ 0x02) + if_jo_ccw_direction_lt(10, /*goto*/ 0x02) + if_jo_ccw_direction_gt(245, /*goto*/ 0x02) if_timer_gt(60, /*goto*/ 0x02) endloop(0x09) @@ -2744,7 +2744,7 @@ u8 func0414_officeworker[] = { try_face_entity(0x0200, 0x0000, /*goto*/ 0x78) beginloop(0x78) - if_angle_to_target_chr_lt(10, /*goto*/ 0x02) + if_jo_ccw_direction_lt(10, /*goto*/ 0x02) if_timer_gt(40, /*goto*/ 0x02) endloop(0x78) @@ -3415,7 +3415,7 @@ u8 func0419_ba8c[] = { try_face_entity(0x0200, 0x0000, /*goto*/ 0x08) label(0x08) yield - if_angle_to_target_chr_lt(10, /*goto*/ 0x02) + if_jo_ccw_direction_lt(10, /*goto*/ 0x02) if_timer_gt(40, /*goto*/ 0x02) goto_first(0x08) diff --git a/src/setup/setupdam.c b/src/setup/setupdam.c index 524f8e202..5bc2dcbb5 100644 --- a/src/setup/setupdam.c +++ b/src/setup/setupdam.c @@ -1571,7 +1571,7 @@ u8 func0411_labtech_alerted[] = { try_face_entity(0x0200, 0x0000, /*goto*/ 0x0c) beginloop(0x0c) - if_angle_to_target_chr_lt(10, /*goto*/ 0x04) + if_jo_ccw_direction_lt(10, /*goto*/ 0x04) if_timer_gt(60, /*goto*/ 0x04) endloop(0x0c) diff --git a/src/setup/setupdepo.c b/src/setup/setupdepo.c index 19823a7ed..d98584ff3 100644 --- a/src/setup/setupdepo.c +++ b/src/setup/setupdepo.c @@ -2333,7 +2333,7 @@ u8 func0413_cloak1_guard[] = { consider_coop_for_p1p2_chr(CHR_SELF) set_target_chr(CHR_P1P2) if_chr_distance_lt(400, /*goto*/ 0x06) - if_distance_to_target_chr_lt(30, /*goto*/ 0x06) + if_jo_front_direction_lt(30, /*goto*/ 0x06) if_chr_in_view(/*goto*/ 0x06) if_difficulty_lt(DIFF_SA, /*goto*/ 0x2c) if_timer_gt(180, /*goto*/ 0x06) diff --git a/src/setup/setupdish.c b/src/setup/setupdish.c index a3d5bfc40..53feb60a2 100644 --- a/src/setup/setupdish.c +++ b/src/setup/setupdish.c @@ -594,7 +594,7 @@ u8 func041e_colleague[] = { try_face_entity(0x0200, 0x0000, /*goto*/ 0x09) beginloop(0x09) - if_angle_to_target_chr_lt(10, /*goto*/ 0x06) + if_jo_ccw_direction_lt(10, /*goto*/ 0x06) if_timer_gt(60, /*goto*/ 0x06) endloop(0x09) @@ -2468,7 +2468,7 @@ u8 func0429_grimshaw_disguise[] = { beginloop(0x09) if_stage_flag_eq(STAGEFLAG_DEVICE_ABORTING, TRUE, /*goto*/ 0x0d) - if_angle_to_target_chr_lt(10, /*goto*/ 0x06) + if_jo_ccw_direction_lt(10, /*goto*/ 0x06) if_timer_gt(60, /*goto*/ 0x06) endloop(0x09) @@ -2659,7 +2659,7 @@ u8 func042a_carrington_cloak[] = { try_face_entity(0x0200, 0x0000, /*goto*/ 0x09) beginloop(0x09) - if_angle_to_target_chr_lt(10, /*goto*/ 0x06) + if_jo_ccw_direction_lt(10, /*goto*/ 0x06) if_timer_gt(60, /*goto*/ 0x06) endloop(0x09) @@ -5169,8 +5169,8 @@ u8 func0416_holo_guard_unarmed_alert2[] = { label(0x06) restart_timer - if_angle_to_target_chr_lt(10, /*goto*/ 0x06) - cmd004f(246, /*goto*/ 0x06) + if_jo_ccw_direction_lt(10, /*goto*/ 0x06) + if_jo_ccw_direction_gt(246, /*goto*/ 0x06) stop_chr try_face_entity(0x0200, 0x0000, /*goto*/ 0x09) @@ -5178,8 +5178,8 @@ u8 func0416_holo_guard_unarmed_alert2[] = { if_chr_dying(TARGET_CHR, /*goto*/ 0x57) if_chr_unloaded(TARGET_CHR, /*goto*/ 0x57) if_chr_distance_gt(400, /*goto*/ 0x10) - if_angle_to_target_chr_lt(10, /*goto*/ 0x06) - cmd004f(246, /*goto*/ 0x06) + if_jo_ccw_direction_lt(10, /*goto*/ 0x06) + if_jo_ccw_direction_gt(246, /*goto*/ 0x06) if_timer_gt(120, /*goto*/ 0x06) endloop(0x09) diff --git a/src/setup/setupear.c b/src/setup/setupear.c index 9bec61978..b57e2ed0a 100644 --- a/src/setup/setupear.c +++ b/src/setup/setupear.c @@ -1016,7 +1016,7 @@ u8 func0404_scientist[] = { endloop(0x09) label(0x2f) - if_angle_to_target_chr_lt(10, /*goto*/ 0x06) + if_jo_ccw_direction_lt(10, /*goto*/ 0x06) if_timer_gt(60, /*goto*/ 0x06) goto_first(0x09) @@ -1048,7 +1048,7 @@ u8 func0404_scientist[] = { animation(ANIM_SURRENDER_002E, 0, -1, 0x1010, CHR_SELF, 2) beginloop(0x0b) - if_angle_to_target_chr_lt(10, /*goto*/ 0x06) + if_jo_ccw_direction_lt(10, /*goto*/ 0x06) if_timer_gt(90, /*goto*/ 0x06) endloop(0x0b) @@ -1200,7 +1200,7 @@ u8 func0406_nasty_scientist[] = { reloop(0x09) label(0x2f) - if_angle_to_target_chr_lt(10, /*goto*/ 0x06) + if_jo_ccw_direction_lt(10, /*goto*/ 0x06) if_timer_gt(60, /*goto*/ 0x06) endloop(0x09) diff --git a/src/setup/setuplee.c b/src/setup/setuplee.c index 0b3a2202f..1ffab93cd 100644 --- a/src/setup/setuplee.c +++ b/src/setup/setuplee.c @@ -2327,8 +2327,8 @@ u8 func041a_bridgeclone[] = { label(0x2e) restart_timer dprint 'F','A','C','E',' ','T','A','R','G','E','T','\n',0, - if_angle_to_target_chr_lt(10, /*goto*/ 0x06) - cmd004f(246, /*goto*/ 0x06) + if_jo_ccw_direction_lt(10, /*goto*/ 0x06) + if_jo_ccw_direction_gt(246, /*goto*/ 0x06) stop_chr try_face_entity(0x0200, 0x0001, /*goto*/ 0x0b) @@ -2337,8 +2337,8 @@ u8 func041a_bridgeclone[] = { if_chr_death_animation_finished(TARGET_CHR, /*goto*/ 0x10) if_chr_dying(TARGET_CHR, /*goto*/ 0x10) if_chr_unloaded(TARGET_CHR, /*goto*/ 0x10) - if_angle_to_target_chr_lt(10, /*goto*/ 0x06) - cmd004f(246, /*goto*/ 0x06) + if_jo_ccw_direction_lt(10, /*goto*/ 0x06) + if_jo_ccw_direction_gt(246, /*goto*/ 0x06) if_timer_gt(15, /*goto*/ 0x06) endloop(0x0b) diff --git a/src/setup/setuplip.c b/src/setup/setuplip.c index 7eb04839f..621ec7377 100644 --- a/src/setup/setuplip.c +++ b/src/setup/setuplip.c @@ -1357,7 +1357,7 @@ u8 func0410_labtech_showers_sa_pa[] = { try_face_entity(0x0200, 0x0000, /*goto*/ 0x09) beginloop(0x09) - if_angle_to_target_chr_lt(10, /*goto*/ 0x06) + if_jo_ccw_direction_lt(10, /*goto*/ 0x06) if_timer_gt(60, /*goto*/ 0x06) endloop(0x09) @@ -1728,7 +1728,7 @@ u8 func0418_doorman[] = { try_face_entity(0x0200, 0x0000, /*goto*/ 0x09) beginloop(0x09) - if_angle_to_target_chr_lt(10, /*goto*/ 0x06) + if_jo_ccw_direction_lt(10, /*goto*/ 0x06) if_timer_gt(60, /*goto*/ 0x06) endloop(0x09) @@ -1961,7 +1961,7 @@ u8 func041a_labtech_harrysmate[] = { try_face_entity(0x0200, 0x0000, /*goto*/ 0x09) beginloop(0x09) - if_angle_to_target_chr_lt(10, /*goto*/ 0x06) + if_jo_ccw_direction_lt(10, /*goto*/ 0x06) if_timer_gt(60, /*goto*/ 0x06) endloop(0x09) @@ -2331,7 +2331,7 @@ u8 func0413_mechanic[] = { try_face_entity(0x0200, 0x0000, /*goto*/ 0x09) beginloop(0x09) - if_angle_to_target_chr_lt(10, /*goto*/ 0x06) + if_jo_ccw_direction_lt(10, /*goto*/ 0x06) if_timer_gt(60, /*goto*/ 0x06) endloop(0x09) @@ -2635,7 +2635,7 @@ u8 func041f_labtech_lights[] = { try_face_entity(0x0200, 0x0000, /*goto*/ 0x09) beginloop(0x09) - if_angle_to_target_chr_lt(10, /*goto*/ 0x06) + if_jo_ccw_direction_lt(10, /*goto*/ 0x06) if_timer_gt(60, /*goto*/ 0x06) endloop(0x09) @@ -2854,7 +2854,7 @@ u8 func0420_labtech_doors[] = { beginloop(0x09) if_shot_near_chr(0x00, /*goto*/ 0x89) if_saw_death(0x00, /*goto*/ 0x89) - if_angle_to_target_chr_lt(10, /*goto*/ 0x06) + if_jo_ccw_direction_lt(10, /*goto*/ 0x06) if_timer_gt(60, /*goto*/ 0x06) endloop(0x09) @@ -3087,7 +3087,7 @@ u8 func0422_labtech_records[] = { try_face_entity(0x0200, 0x0000, /*goto*/ 0x09) label(0x09) yield - if_angle_to_target_chr_lt(10, /*goto*/ 0x06) + if_jo_ccw_direction_lt(10, /*goto*/ 0x06) if_timer_gt(60, /*goto*/ 0x06) goto_first(0x09) diff --git a/src/setup/setuplue.c b/src/setup/setuplue.c index 5889ed2ae..4e5d31303 100644 --- a/src/setup/setuplue.c +++ b/src/setup/setuplue.c @@ -1632,7 +1632,7 @@ u8 func0416_mechanic[] = { try_face_entity(0x0200, 0x0000, /*goto*/ 0x0a) beginloop(0x0a) - if_angle_to_target_chr_lt(10, /*goto*/ 0x06) + if_jo_ccw_direction_lt(10, /*goto*/ 0x06) if_timer_gt(30, /*goto*/ 0x06) endloop(0x0a) diff --git a/src/setup/setuppam.c b/src/setup/setuppam.c index f4d123265..3420111b8 100644 --- a/src/setup/setuppam.c +++ b/src/setup/setuppam.c @@ -3126,7 +3126,7 @@ u8 func041b_sniper_wait_for_detection[] = { label(0x2e) if_chr_distance_lt(400, /*goto*/ 0x06) - if_distance_to_target_chr_lt(30, /*goto*/ 0x06) + if_jo_front_direction_lt(30, /*goto*/ 0x06) if_chr_in_view(/*goto*/ 0x06) if_saw_death(0x00, /*goto*/ 0x06) if_alertness(100, OPERATOR_GREATER_THAN, /*goto*/ 0x06) @@ -3467,8 +3467,8 @@ u8 func040f_miniskedar[] = { reloop(0x0b) label(0x2e) - if_angle_to_target_chr_lt(10, /*goto*/ 0x06) - cmd004f(246, /*goto*/ 0x06) + if_jo_ccw_direction_lt(10, /*goto*/ 0x06) + if_jo_ccw_direction_gt(246, /*goto*/ 0x06) endloop(0x0b) label(0x06) diff --git a/src/setup/setuppete.c b/src/setup/setuppete.c index 39afb4bfd..50046f1ec 100644 --- a/src/setup/setuppete.c +++ b/src/setup/setuppete.c @@ -1440,7 +1440,7 @@ u8 func0412_cia[] = { try_face_entity(0x0200, 0x0000, /*goto*/ 0x09) beginloop(0x09) - if_angle_to_target_chr_lt(10, /*goto*/ 0x04) + if_jo_ccw_direction_lt(10, /*goto*/ 0x04) if_timer_gt(40, /*goto*/ 0x04) endloop(0x09) @@ -1589,7 +1589,7 @@ u8 func0413_bugspotter[] = { try_face_entity(0x0200, 0x0000, /*goto*/ 0x04) beginloop(0x09) - if_angle_to_target_chr_lt(10, /*goto*/ 0x04) + if_jo_ccw_direction_lt(10, /*goto*/ 0x04) if_timer_gt(40, /*goto*/ 0x04) endloop(0x09) @@ -1871,7 +1871,7 @@ u8 func041d_fbi[] = { try_face_entity(0x0200, 0x0000, /*goto*/ 0x0d) beginloop(0x0d) - if_angle_to_target_chr_lt(10, /*goto*/ 0x04) + if_jo_ccw_direction_lt(10, /*goto*/ 0x04) if_timer_gt(40, /*goto*/ 0x04) endloop(0x0d) diff --git a/src/setup/setuprit.c b/src/setup/setuprit.c index 4a8f96b5d..5cf4ea8f1 100644 --- a/src/setup/setuprit.c +++ b/src/setup/setuprit.c @@ -1209,7 +1209,7 @@ u8 func0405_president_in_room[] = { reloop(0x09) label(0x2d) - if_angle_to_target_chr_lt(10, /*goto*/ 0x06) + if_jo_ccw_direction_lt(10, /*goto*/ 0x06) if_timer_gt(60, /*goto*/ 0x06) endloop(0x09) @@ -1240,7 +1240,7 @@ u8 func0405_president_in_room[] = { try_face_entity(0x0200, 0x0000, /*goto*/ 0x78) // In this loop the president will continue to turn to face the player - // because it lacks an if_angle_to_target_chr_lt check. + // because it lacks an if_jo_ccw_direction_lt check. beginloop(0x78) if_chr_in_room(TARGET_CHR, 0x00, 0x0055, /*goto*/ 0x2d) if_chr_in_room(TARGET_CHR, 0x00, 0x0056, /*goto*/ 0x2d) @@ -3233,7 +3233,7 @@ u8 func0407_steward[] = { try_face_entity(0x0200, 0x0000, /*goto*/ 0x09) beginloop(0x09) - if_angle_to_target_chr_lt(10, /*goto*/ 0x06) + if_jo_ccw_direction_lt(10, /*goto*/ 0x06) if_timer_gt(60, /*goto*/ 0x06) endloop(0x09) @@ -3289,7 +3289,7 @@ u8 func0407_stewardess[] = { try_face_entity(0x0200, 0x0000, /*goto*/ 0x09) beginloop(0x09) - if_angle_to_target_chr_lt(10, /*goto*/ 0x06) + if_jo_ccw_direction_lt(10, /*goto*/ 0x06) if_timer_gt(60, /*goto*/ 0x06) endloop(0x09) diff --git a/src/setup/setupsho.c b/src/setup/setupsho.c index e2d5a9914..7b7b39db9 100644 --- a/src/setup/setupsho.c +++ b/src/setup/setupsho.c @@ -610,8 +610,8 @@ u8 func0402_unarmed_skedar[] = { label(0x2f) restart_timer dprint 'F','A','C','E',' ','T','A','R','G','E','T','\n',0, - if_angle_to_target_chr_lt(10, /*goto*/ 0x06) - cmd004f(246, /*goto*/ 0x06) + if_jo_ccw_direction_lt(10, /*goto*/ 0x06) + if_jo_ccw_direction_gt(246, /*goto*/ 0x06) stop_chr set_action(ACTION_FACING_TARGET, TRUE) try_face_entity(0x0200, 0x0001, /*goto*/ 0x0c) @@ -623,8 +623,8 @@ u8 func0402_unarmed_skedar[] = { if_chr_death_animation_finished(TARGET_CHR, /*goto*/ 0x10) if_chr_dying(TARGET_CHR, /*goto*/ 0x10) if_chr_unloaded(TARGET_CHR, /*goto*/ 0x10) - if_angle_to_target_chr_lt(10, /*goto*/ 0x06) - cmd004f(246, /*goto*/ 0x06) + if_jo_ccw_direction_lt(10, /*goto*/ 0x06) + if_jo_ccw_direction_gt(246, /*goto*/ 0x06) if_timer_gt(60, /*goto*/ 0x06) endloop(0x0c) @@ -809,8 +809,8 @@ u8 func0404_miniskedar[] = { endloop(0x0c) label(0x2d) - if_angle_to_target_chr_lt(10, /*goto*/ 0x06) - cmd004f(246, /*goto*/ 0x06) + if_jo_ccw_direction_lt(10, /*goto*/ 0x06) + if_jo_ccw_direction_gt(246, /*goto*/ 0x06) goto_first(0x0c) label(0x06) @@ -2148,15 +2148,15 @@ u8 func040d_king_combat[] = { set_chr_cloaked(CHR_SELF, FALSE, TRUE) restart_timer dprint 'F','A','C','E',' ','T','A','R','G','E','T','\n',0, - if_angle_to_target_chr_lt(10, /*goto*/ 0x06) - cmd004f(246, /*goto*/ 0x06) + if_jo_ccw_direction_lt(10, /*goto*/ 0x06) + if_jo_ccw_direction_gt(246, /*goto*/ 0x06) stop_chr try_face_entity(0x0200, 0x0000, /*goto*/ 0x09) beginloop(0x09) if_chr_death_animation_finished(CHR_P1P2, /*goto*/ 0x0b) - if_angle_to_target_chr_lt(10, /*goto*/ 0x06) - cmd004f(246, /*goto*/ 0x06) + if_jo_ccw_direction_lt(10, /*goto*/ 0x06) + if_jo_ccw_direction_gt(246, /*goto*/ 0x06) if_timer_gt(60, /*goto*/ 0x06) endloop(0x09) diff --git a/src/setup/setuptra.c b/src/setup/setuptra.c index 1c2959d61..58866dd90 100644 --- a/src/setup/setuptra.c +++ b/src/setup/setuptra.c @@ -1339,7 +1339,7 @@ u8 func0413_jonathan_hangar[] = { try_face_entity(0x0200, 0x0000, /*goto*/ 0x46) beginloop(0x46) - if_angle_to_target_chr_lt(10, /*goto*/ 0x06) + if_jo_ccw_direction_lt(10, /*goto*/ 0x06) if_timer_gt(60, /*goto*/ 0x06) endloop(0x46) diff --git a/src/setup/setupwax.c b/src/setup/setupwax.c index 46a678fa5..5cdf229b3 100644 --- a/src/setup/setupwax.c +++ b/src/setup/setupwax.c @@ -1315,8 +1315,8 @@ u8 func0411_cass_in_office[] = { try_face_entity(0x0200, 0x0000, /*goto*/ 0x56) beginloop(0x56) - if_angle_to_target_chr_lt(10, /*goto*/ 0x57) - cmd004f(246, /*goto*/ 0x57) + if_jo_ccw_direction_lt(10, /*goto*/ 0x57) + if_jo_ccw_direction_gt(246, /*goto*/ 0x57) endloop(0x56) // Draw weapon