diff --git a/ld/gamefiles.inc b/ld/gamefiles.inc index 020a59bbf..11f74c8b0 100644 --- a/ld/gamefiles.inc +++ b/ld/gamefiles.inc @@ -27,7 +27,6 @@ build/ROMID/game/game_0109d0.o (section); \ build/ROMID/game/game_010b20.o (section); \ build/ROMID/game/game_011110.o (section); \ - build/ROMID/game/data/data_0083d0.o (section); \ build/ROMID/game/game_012450.o (section); \ build/ROMID/game/game_0125a0.o (section); \ build/ROMID/game/game_012d50.o (section); \ @@ -65,6 +64,7 @@ build/ROMID/game/sparkstick.o (section); \ build/ROMID/game/chr/chr.o (section); \ build/ROMID/game/game_02cde0.o (section); \ + build/ROMID/game/data/data_0083d0.o (section); \ build/ROMID/game/chr/chraction.o (section); \ build/ROMID/game/chr/chrai.o (section); \ build/ROMID/game/chr/chraicommands.o (section); \ diff --git a/src/files/setup/setupame.c b/src/files/setup/setupame.c index 158dafb5f..7f2239904 100644 --- a/src/files/setup/setupame.c +++ b/src/files/setup/setupame.c @@ -1224,9 +1224,9 @@ u8 func040f_cass[] = { // Wait for player to enter room beginloop(0x59) set_target_chr(CHR_BOND) - if_chr_sees_player(/*goto*/ 0x5a) + if_can_see_target(/*goto*/ 0x5a) set_target_chr(CHR_COOP) - if_chr_sees_player(/*goto*/ 0x5a) + if_can_see_target(/*goto*/ 0x5a) set_target_chr(CHR_BOND) if_stage_flag_eq(STAGEFLAG_SECETARY_SAW_JO_OR_COOP, TRUE, /*goto*/ 0xbe) endloop(0x59) @@ -1285,7 +1285,7 @@ u8 func040f_cass[] = { label(0x65) restart_timer - if_chr_sees_player(/*goto*/ 0x2c) + if_can_see_target(/*goto*/ 0x2c) if_chr_in_room(CHR_TARGET, 0x00, 0x005b, /*goto*/ 0x2c) if_chr_in_room(CHR_TARGET, 0x00, 0x005c, /*goto*/ 0x2c) if_chr_in_room(CHR_TARGET, 0x00, 0x005d, /*goto*/ 0x2c) @@ -1306,7 +1306,7 @@ u8 func040f_cass[] = { endloop(0x66) label(0x67) - if_chr_sees_player(/*goto*/ 0x2c) + if_can_see_target(/*goto*/ 0x2c) if_chr_in_room(CHR_TARGET, 0x00, 0x005b, /*goto*/ 0x2c) if_chr_in_room(CHR_TARGET, 0x00, 0x005c, /*goto*/ 0x2c) if_chr_in_room(CHR_TARGET, 0x00, 0x005d, /*goto*/ 0x2c) @@ -1356,7 +1356,7 @@ u8 func040f_cass[] = { endloop(0xb8) label(0x63) - if_chr_sees_player(/*goto*/ 0x2c) + if_can_see_target(/*goto*/ 0x2c) if_chr_in_room(CHR_TARGET, 0x00, 0x005b, /*goto*/ 0x2c) if_chr_in_room(CHR_TARGET, 0x00, 0x005c, /*goto*/ 0x2c) if_chr_in_room(CHR_TARGET, 0x00, 0x005d, /*goto*/ 0x2c) @@ -1447,9 +1447,9 @@ u8 func0411_secretary[] = { beginloop(0x72) set_target_chr(CHR_BOND) - if_chr_sees_player(/*goto*/ 0x73) + if_can_see_target(/*goto*/ 0x73) set_target_chr(CHR_COOP) - if_chr_sees_player(/*goto*/ 0x74) + if_can_see_target(/*goto*/ 0x74) set_target_chr(CHR_BOND) endloop(0x72) @@ -1723,7 +1723,7 @@ u8 func0414_programmer[] = { if_stage_flag_eq(STAGEFLAG_PROGRAMMER_INJURED, TRUE, /*goto*/ LABEL_JO_SPEAK) label(0xa2) - if_chr_sees_player(/*goto*/ 0x06) + if_can_see_target(/*goto*/ 0x06) goto_next(0x2c) // Can see Jo, and not injured or near Laptop Gun room @@ -1745,7 +1745,7 @@ u8 func0414_programmer[] = { beginloop(0x97) if_timer_lt(240, /*goto*/ 0x06) - if_chr_sees_player(/*goto*/ 0x2c) + if_can_see_target(/*goto*/ 0x2c) goto_next(0x06) label(0x2c) if_distance_to_target_lt(300, /*goto*/ LABEL_JO_SPEAK) @@ -1762,7 +1762,7 @@ u8 func0414_programmer[] = { beginloop(0x0d) if_timer_gt(300, /*goto*/ 0xb5) if_distance_to_target_gt(300, /*goto*/ 0x2c) - if_chr_sees_player(/*goto*/ 0x06) + if_can_see_target(/*goto*/ 0x06) goto_next(0x2c) label(0x06) if_player_looking_at_something_maybe(0x28, 0x01, 0x00, /*goto*/ LABEL_JO_SPEAK) @@ -1778,7 +1778,7 @@ u8 func0414_programmer[] = { beginloop(0xa6) if_detected_chr(CHR_PRESET, /*goto*/ 0xa7) if_timer_lt(120, /*goto*/ 0x06) - if_chr_sees_player(/*goto*/ LABEL_JO_SPEAK) + if_can_see_target(/*goto*/ LABEL_JO_SPEAK) goto_next(0x06) if_distance_to_target_lt(300, /*goto*/ LABEL_JO_SPEAK) label(0x06) @@ -3814,7 +3814,7 @@ u8 func042f_surrendering_guard[] = { label(0x06) chr_toggle_p1p2(CHR_SELF) set_target_chr(CHR_P1P2) - if_chr_sees_player(/*goto*/ 0x58) + if_can_see_target(/*goto*/ 0x58) endloop(0x55) label(0x58) diff --git a/src/files/setup/setupark.c b/src/files/setup/setupark.c index c73aab11d..186463f97 100644 --- a/src/files/setup/setupark.c +++ b/src/files/setup/setupark.c @@ -590,7 +590,7 @@ u8 func0401_drcaroll_following[] = { if_chr_y(CHR_TARGET, -1910, OPERATOR_LESS_THAN, /*goto*/ 0x20) label(0x20) dprint 't','a','r','g','e','t','\n',0, - if_chr_sees_player(/*goto*/ 0x00) + if_can_see_target(/*goto*/ 0x00) goto_next(0x04) label(0x00) @@ -949,7 +949,7 @@ u8 func0406_general_combat[] = { goto_next(0x20) label(0x00) - if_chr_sees_player(/*goto*/ 0x15) + if_can_see_target(/*goto*/ 0x15) label(0x20) if_near_miss(/*goto*/ 0x18) if_stage_flag_eq(STAGEFLAG_FOYER_LIGHTS_RESTORED, TRUE, /*goto*/ 0x00) @@ -1036,7 +1036,7 @@ u8 func0406_general_combat[] = { endloop(0x1c) label(0x1e) - if_chr_sees_player(/*goto*/ 0x19) + if_can_see_target(/*goto*/ 0x19) goto_first(0x14) label(0x19) @@ -1048,7 +1048,7 @@ u8 func0406_general_combat[] = { beginloop(0x1b) chr_toggle_p1p2(CHR_SELF) set_target_chr(CHR_P1P2) - if_chr_sees_player(/*goto*/ 0x19) + if_can_see_target(/*goto*/ 0x19) if_timer_gt(300, /*goto*/ 0x00) endloop(0x1b) @@ -1121,10 +1121,10 @@ u8 func0408_hovercopter[] = { label(0x00) set_target_chr(CHR_BOND) - if_chr_sees_player(/*goto*/ 0x43) + if_can_see_target(/*goto*/ 0x43) if_chr_death_animation_finished(CHR_COOP, /*goto*/ 0x20) set_target_chr(CHR_COOP) - if_chr_sees_player(/*goto*/ 0x43) + if_can_see_target(/*goto*/ 0x43) set_target_chr(CHR_BOND) label(0x20) endloop(0x22) @@ -1146,7 +1146,7 @@ u8 func0408_hovercopter[] = { label(0x00) dprint 'M','I','D','3','\n',0, set_target_chr(CHR_BOND) - if_chr_sees_player(/*goto*/ 0x48) + if_can_see_target(/*goto*/ 0x48) dprint 'N','O','T','V','I','S','\n',0, if_chr_death_animation_finished(CHR_COOP, /*goto*/ 0x20) set_target_chr(CHR_COOP) @@ -1155,7 +1155,7 @@ u8 func0408_hovercopter[] = { // which doesn't appear to have any side effects except that the // hovercopter will say the low line ("surrender or die") on the mid // level if Velvet is the first player it sees. - if_chr_sees_player(/*goto*/ 0x43) + if_can_see_target(/*goto*/ 0x43) set_target_chr(CHR_BOND) label(0x20) endloop(0x24) @@ -1170,10 +1170,10 @@ u8 func0408_hovercopter[] = { if_chr_y(CHR_TARGET, -1850, OPERATOR_LESS_THAN, /*goto*/ 0x52) if_chr_y(CHR_TARGET, -1200, OPERATOR_LESS_THAN, /*goto*/ 0x53) set_target_chr(CHR_BOND) - if_chr_sees_player(/*goto*/ 0x4d) + if_can_see_target(/*goto*/ 0x4d) if_chr_death_animation_finished(CHR_COOP, /*goto*/ 0x20) set_target_chr(CHR_COOP) - if_chr_sees_player(/*goto*/ 0x4d) + if_can_see_target(/*goto*/ 0x4d) label(0x20) set_target_chr(CHR_BOND) label(0x00) @@ -1186,7 +1186,7 @@ u8 func0408_hovercopter[] = { yield goto_next(0x00) label(0x00) - if_chr_sees_player(/*goto*/ 0x20) + if_can_see_target(/*goto*/ 0x20) move_object_to_pad(OBJ_HOVERCOPTER, 0x0199) label(0x20) goto_first(0x25) @@ -1194,7 +1194,7 @@ u8 func0408_hovercopter[] = { // Change to low label(0x52) dprint 'C','H','A','N','G','E',' ','T','O',' ','L','O','W','\n',0, - if_chr_sees_player(/*goto*/ 0x20) + if_can_see_target(/*goto*/ 0x20) move_object_to_pad(OBJ_HOVERCOPTER, 0x0190) label(0x20) goto_first(0x21) @@ -1202,7 +1202,7 @@ u8 func0408_hovercopter[] = { // Change to mid label(0x53) dprint 'C','H','A','N','G','E',' ','T','O',' ','M','I','D','\n',0, - if_chr_sees_player(/*goto*/ 0x20) + if_can_see_target(/*goto*/ 0x20) move_object_to_pad(OBJ_HOVERCOPTER, 0x0195) label(0x20) goto_first(0x23) @@ -1214,12 +1214,12 @@ u8 func0408_hovercopter[] = { label(0x44) yield - if_chr_sees_player(/*goto*/ 0x47) + if_can_see_target(/*goto*/ 0x47) restart_timer beginloop(0x45) if_timer_gt(480, /*goto*/ 0x46) - if_chr_sees_player(/*goto*/ 0x47) + if_can_see_target(/*goto*/ 0x47) endloop(0x45) label(0x46) @@ -1241,12 +1241,12 @@ u8 func0408_hovercopter[] = { label(0x49) yield - if_chr_sees_player(/*goto*/ 0x4c) + if_can_see_target(/*goto*/ 0x4c) restart_timer beginloop(0x4a) if_timer_gt(180, /*goto*/ 0x4b) - if_chr_sees_player(/*goto*/ 0x4c) + if_can_see_target(/*goto*/ 0x4c) endloop(0x4a) label(0x4b) @@ -1284,12 +1284,12 @@ u8 func0408_hovercopter[] = { restart_timer label(0x4e) yield - if_chr_sees_player(/*goto*/ 0x51) + if_can_see_target(/*goto*/ 0x51) restart_timer beginloop(0x4f) if_timer_gt(480, /*goto*/ 0x50) - if_chr_sees_player(/*goto*/ 0x51) + if_can_see_target(/*goto*/ 0x51) endloop(0x4f) label(0x50) @@ -1779,7 +1779,7 @@ u8 func0409_tech_conversation[] = { chr_toggle_p1p2(CHR_SELF) set_target_chr(CHR_P1P2) if_alertness(99, OPERATOR_GREATER_THAN, /*goto*/ 0x33) - if_chr_sees_player(/*goto*/ 0x20) + if_can_see_target(/*goto*/ 0x20) endloop(0x26) label(0x20) @@ -1860,7 +1860,7 @@ u8 func040a_tech2[] = { beginloop(0x21) chr_toggle_p1p2(CHR_SELF) set_target_chr(CHR_P1P2) - if_chr_sees_player(/*goto*/ 0x00) + if_can_see_target(/*goto*/ 0x00) reloop(0x21) label(0x00) @@ -2635,7 +2635,7 @@ u8 func0413_defend_pad[] = { beginloop(0x1f) chr_toggle_p1p2(CHR_SELF) set_target_chr(CHR_P1P2) - if_chr_sees_player(/*goto*/ 0x21) + if_can_see_target(/*goto*/ 0x21) if_enemy_distance_lt_and_los(2540, /*goto*/ 0x21) if_distance_from_target_to_pad_lt(200, PAD_PRESET, /*goto*/ 0x22) endloop(0x1f) @@ -2648,7 +2648,7 @@ u8 func0413_defend_pad[] = { beginloop(0x23) if_chr_stopped(/*goto*/ 0x00) - if_chr_sees_player(/*goto*/ 0x00) + if_can_see_target(/*goto*/ 0x00) if_enemy_distance_lt_and_los(2540, /*goto*/ 0x00) endloop(0x23) diff --git a/src/files/setup/setupate.c b/src/files/setup/setupate.c index c1aefd319..cce4c5607 100644 --- a/src/files/setup/setupate.c +++ b/src/files/setup/setupate.c @@ -415,7 +415,7 @@ u8 func0402_guard_combat[] = { // Guard has been shot, or finished jump beginloop(0x03) if_distance_to_target_lt(250, /*goto*/ 0x0e) - if_chr_sees_player(/*goto*/ 0x06) + if_can_see_target(/*goto*/ 0x06) reloop(0x03) // 2 seconds have passed without seeing guard, or guard has been shot @@ -497,7 +497,7 @@ u8 func0404_trent_combat[] = { // Wait until player in sight or in close range beginloop(0x03) if_distance_to_target_lt(250, /*goto*/ 0x0e) - if_chr_sees_player(/*goto*/ 0x06) + if_can_see_target(/*goto*/ 0x06) reloop(0x03) // Attack diff --git a/src/files/setup/setupazt.c b/src/files/setup/setupazt.c index a50fcad11..fe14d2778 100644 --- a/src/files/setup/setupazt.c +++ b/src/files/setup/setupazt.c @@ -1159,10 +1159,10 @@ u8 func0404_elvis[] = { if_objective_complete(2, /*goto*/ 0x31) if_objective_complete(3, /*goto*/ 0x31) if_objective_complete(4, /*goto*/ 0x31) - if_chr_sees_player(/*goto*/ 0xa5) + if_can_see_target(/*goto*/ 0xa5) set_target_chr(CHR_COOP) set_chrpreset(CHR_COOP) - if_chr_sees_player(/*goto*/ 0xa5) + if_can_see_target(/*goto*/ 0xa5) label(0x31) if_enemy_distance_lt_and_los(2540, /*goto*/ 0x0a) if_timer_gt(600, /*goto*/ 0x0b) @@ -1217,7 +1217,7 @@ u8 func0404_elvis[] = { // Running towards player for 3 seconds - check if can still see player label(0x08) - if_chr_sees_player(/*goto*/ 0x31) + if_can_see_target(/*goto*/ 0x31) goto_first(0x04) label(0x31) @@ -1365,7 +1365,7 @@ u8 func0414_spawner[] = { beginloop(0x06) chr_toggle_p1p2(CHR_SELF) set_target_chr(CHR_P1P2) - if_chr_sees_player(/*goto*/ 0x0a) + if_can_see_target(/*goto*/ 0x0a) // Room 0x0029 is the skedar shuttle area if_chr_in_room(CHR_P1P2, 0x00, 0x0029, /*goto*/ 0x0a) reloop(0x06) @@ -1375,7 +1375,7 @@ u8 func0414_spawner[] = { label(0x31) if_never_been_onscreen(/*goto*/ 0x52) dprint 'N','E','V','E','R',' ','V','I','S','F','A','I','L','\n',0, - if_chr_sees_player(/*goto*/ 0x0a) + if_can_see_target(/*goto*/ 0x0a) endloop(0x06) label(0x0a) @@ -1483,7 +1483,7 @@ u8 func041c_president_waiting[] = { goto_first(0x06) label(0x31) - if_chr_sees_player(/*goto*/ 0x31) + if_can_see_target(/*goto*/ 0x31) endloop(0x06) label(0x31) @@ -1554,7 +1554,7 @@ u8 func041d_president_running[] = { if_chr_in_room(CHR_SELF, 0x00, 0x0014, /*goto*/ 0xa5) if_chr_in_room(CHR_SELF, 0x00, 0x0014, /*goto*/ 0xa5) dprint 't','a','r','g','e','t','\n',0, - if_chr_sees_player(/*goto*/ 0x08) + if_can_see_target(/*goto*/ 0x08) goto_next(0xa0) label(0x08) @@ -1715,7 +1715,7 @@ u8 func041e_trent_waiting[] = { beginloop(0x06) chr_toggle_p1p2(CHR_SELF) set_target_chr(CHR_P1P2) - if_chr_sees_player(/*goto*/ 0x08) + if_can_see_target(/*goto*/ 0x08) endloop(0x06) label(0x08) @@ -1797,7 +1797,7 @@ u8 func0420_trent_running[] = { label(0x31) chr_toggle_p1p2(CHR_SELF) set_target_chr(CHR_P1P2) - if_chr_sees_player(/*goto*/ 0x31) + if_can_see_target(/*goto*/ 0x31) goto_next(0x08) label(0x31) diff --git a/src/files/setup/setupcave.c b/src/files/setup/setupcave.c index 07b56b0df..1f72d0d00 100644 --- a/src/files/setup/setupcave.c +++ b/src/files/setup/setupcave.c @@ -1590,7 +1590,7 @@ u8 func0408_secretary[] = { if_saw_injury(0x00, /*goto*/ LABEL_BECOME_ALERT2) if_alertness(99, OPERATOR_GREATER_THAN, /*goto*/ LABEL_BECOME_ALERT2) if_timer_gt(60, /*goto*/ 0x02) - if_chr_sees_player(/*goto*/ 0x31) + if_can_see_target(/*goto*/ 0x31) goto_first(LABEL_MAIN_LOOP) label(0x31) @@ -1620,7 +1620,7 @@ u8 func0408_secretary[] = { if_saw_injury(0x00, /*goto*/ LABEL_BECOME_ALERT2) if_alertness(99, OPERATOR_GREATER_THAN, /*goto*/ LABEL_BECOME_ALERT2) if_timer_gt(400, /*goto*/ 0x02) - if_chr_sees_player(/*goto*/ 0x31) + if_can_see_target(/*goto*/ 0x31) goto_first(LABEL_MAIN_LOOP) label(0x31) @@ -1645,7 +1645,7 @@ u8 func0408_secretary[] = { if_saw_injury(0x00, /*goto*/ LABEL_BECOME_ALERT2) if_alertness(99, OPERATOR_GREATER_THAN, /*goto*/ LABEL_BECOME_ALERT2) if_timer_gt(400, /*goto*/ 0x0c) - if_chr_sees_player(/*goto*/ 0x31) + if_can_see_target(/*goto*/ 0x31) goto_first(LABEL_MAIN_LOOP) label(0x31) @@ -2217,7 +2217,7 @@ u8 func040a_office2[] = { beginloop(0x09) chr_toggle_p1p2(CHR_SELF) set_target_chr(CHR_P1P2) - if_chr_sees_player(/*goto*/ 0x02) + if_can_see_target(/*goto*/ 0x02) if_saw_injury(0x00, /*goto*/ 0x02) if_stage_flag_eq(STAGEFLAG_OFFICE1_DEAD, TRUE, /*goto*/ 0x72) endloop(0x09) @@ -2458,7 +2458,7 @@ u8 func040f_nsa[] = { goto_first(0x00) label(0x31) - if_chr_sees_player(/*goto*/ 0x04) + if_can_see_target(/*goto*/ 0x04) if_chr_distance_to_pad_lt(CHR_SELF, 70, PAD_PRESET, /*goto*/ 0x02) endloop(0x06) @@ -2471,7 +2471,7 @@ u8 func040f_nsa[] = { dprint 'W','A','I','T',' ','F','O','R',' ','C','H','R','\n',0, set_target_chr(CHR_P1P2) if_stage_flag_eq(STAGEFLAG_SECURITY_SHUT_DOWN, TRUE, /*goto*/ 0x0b) - if_chr_sees_player(/*goto*/ 0x31) + if_can_see_target(/*goto*/ 0x31) endloop(0x00) // Seen player @@ -3159,7 +3159,7 @@ u8 func042a_foyer_spawner[] = { rebuild_squadrons dprint 'O','B','J','E','C','T','I','V','E',' ','D','O','N','E','\n',0, if_never_been_onscreen(/*goto*/ 0x6a) - if_chr_sees_player(/*goto*/ 0x04) + if_can_see_target(/*goto*/ 0x04) reloop(0x00) label(0x04) diff --git a/src/files/setup/setupdam.c b/src/files/setup/setupdam.c index b144135e4..5daf4bf74 100644 --- a/src/files/setup/setupdam.c +++ b/src/files/setup/setupdam.c @@ -1367,7 +1367,7 @@ u8 func040b_labtech1[] = { beginloop(0x00) chr_toggle_p1p2(CHR_SELF) set_target_chr(CHR_P1P2) - if_chr_sees_player(/*goto*/ 0x0f) + if_can_see_target(/*goto*/ 0x0f) if_alertness(99, OPERATOR_GREATER_THAN, /*goto*/ 0x0f) if_chr_stopped(/*goto*/ 0x04) goto_next(0x07) @@ -1442,7 +1442,7 @@ u8 func040c_labtech2[] = { beginloop(0x00) chr_toggle_p1p2(CHR_SELF) set_target_chr(CHR_P1P2) - if_chr_sees_player(/*goto*/ 0x0f) + if_can_see_target(/*goto*/ 0x0f) if_alertness(99, OPERATOR_GREATER_THAN, /*goto*/ 0x0f) if_chr_stopped(/*goto*/ 0x04) goto_next(0x07) @@ -1521,7 +1521,7 @@ u8 func040d_labtech3[] = { beginloop(0x00) chr_toggle_p1p2(CHR_SELF) set_target_chr(CHR_P1P2) - if_chr_sees_player(/*goto*/ 0x0f) + if_can_see_target(/*goto*/ 0x0f) if_alertness(99, OPERATOR_GREATER_THAN, /*goto*/ 0x10) if_chr_stopped(/*goto*/ 0x04) goto_next(0x07) @@ -1622,7 +1622,7 @@ u8 func0411_labtech_alerted[] = { label(0x13) restart_timer - if_chr_sees_player(/*goto*/ 0x07) + if_can_see_target(/*goto*/ 0x07) goto_next(0x00) label(0x07) @@ -1636,7 +1636,7 @@ u8 func0411_labtech_alerted[] = { chr_toggle_p1p2(CHR_SELF) set_target_chr(CHR_P1P2) if_timer_gt(1200, /*goto*/ 0x0d) - if_chr_sees_player(/*goto*/ 0x07) + if_can_see_target(/*goto*/ 0x07) goto_next(0x00) label(0x07) @@ -2693,7 +2693,7 @@ u8 func0418_elvis_at_moonpool[] = { beginloop(0x00) chr_toggle_p1p2(CHR_SELF) set_target_chr(CHR_P1P2) - if_chr_sees_player(/*goto*/ 0x07) + if_can_see_target(/*goto*/ 0x07) endloop(0x00) label(0x07) diff --git a/src/files/setup/setupdepo.c b/src/files/setup/setupdepo.c index aaa8c0131..aed5276e9 100644 --- a/src/files/setup/setupdepo.c +++ b/src/files/setup/setupdepo.c @@ -1091,7 +1091,7 @@ u8 func0401_init_swat1[] = { beginloop(0x08) chr_toggle_p1p2(CHR_SELF) set_target_chr(CHR_P1P2) - if_chr_sees_player(/*goto*/ 0x2c) + if_can_see_target(/*goto*/ 0x2c) if_enemy_distance_lt_and_los(2540, /*goto*/ 0x2c) if_chr_in_room(CHR_SELF, 0x00, 0x0050, /*goto*/ 0x06) endloop(0x08) @@ -1115,7 +1115,7 @@ u8 func0402_init_swat2[] = { beginloop(0x08) chr_toggle_p1p2(CHR_SELF) set_target_chr(CHR_P1P2) - if_chr_sees_player(/*goto*/ 0x2c) + if_can_see_target(/*goto*/ 0x2c) if_enemy_distance_lt_and_los(2540, /*goto*/ 0x2c) if_chr_in_room(CHR_SELF, 0x00, 0x0050, /*goto*/ 0x06) if_chr_stopped(/*goto*/ 0x06) diff --git a/src/files/setup/setupdish.c b/src/files/setup/setupdish.c index ec65b4990..e558ba22d 100644 --- a/src/files/setup/setupdish.c +++ b/src/files/setup/setupdish.c @@ -533,7 +533,7 @@ u8 func041d_init_collegue_when_sighted[] = { restart_timer beginloop(0x04) - if_chr_sees_player(/*goto*/ 0x2f) + if_can_see_target(/*goto*/ 0x2f) endloop(0x04) label(0x2f) @@ -2928,7 +2928,7 @@ u8 func042c_carrington_tour[] = { beginloop(0x04) dprint 'F','A','C','E',' ','P','A','D',0, if_timer_gt(1200, /*goto*/ 0x2f) - if_chr_sees_player(/*goto*/ 0x2f) + if_can_see_target(/*goto*/ 0x2f) if_chr_idle(/*goto*/ 0x06) label(0x7f) call_rng @@ -2939,11 +2939,11 @@ u8 func042c_carrington_tour[] = { endloop(0x04) label(0x2f) - if_chr_sees_player(/*goto*/ 0x06) + if_can_see_target(/*goto*/ 0x06) try_jog_to_target(/*goto*/ 0x08) beginloop(0x08) - if_chr_sees_player(/*goto*/ 0x06) + if_can_see_target(/*goto*/ 0x06) endloop(0x08) label(0x06) @@ -2981,7 +2981,7 @@ u8 func042c_carrington_tour[] = { beginloop(0x5c) if_timer_lt(60, /*goto*/ 0x06) - if_chr_sees_player(/*goto*/ 0x2f) + if_can_see_target(/*goto*/ 0x2f) label(0x06) endloop(0x5c) @@ -3010,7 +3010,7 @@ u8 func042c_carrington_tour[] = { stop_chr beginloop(0x63) - if_chr_sees_player(/*goto*/ 0x2f) + if_can_see_target(/*goto*/ 0x2f) endloop(0x63) label(0x2f) @@ -3067,7 +3067,7 @@ u8 func042c_carrington_tour[] = { stop_chr beginloop(0x6a) - if_chr_sees_player(/*goto*/ 0x2f) + if_can_see_target(/*goto*/ 0x2f) endloop(0x6a) label(0x2f) @@ -3103,7 +3103,7 @@ u8 func042c_carrington_tour[] = { stop_chr beginloop(0x6e) - if_chr_sees_player(/*goto*/ 0x2f) + if_can_see_target(/*goto*/ 0x2f) endloop(0x6e) label(0x2f) @@ -3155,7 +3155,7 @@ u8 func042c_carrington_tour[] = { stop_chr beginloop(0x74) - if_chr_sees_player(/*goto*/ 0x2f) + if_can_see_target(/*goto*/ 0x2f) endloop(0x74) label(0x2f) @@ -4869,7 +4869,7 @@ u8 func0409_holo5_guard2[] = { try_face_entity(ENTITYTYPE_TARGET, 0, /*goto*/ 0x0a) beginloop(0x0a) - if_chr_sees_player(/*goto*/ 0x06) + if_can_see_target(/*goto*/ 0x06) goto_first(0x04) label(0x06) diff --git a/src/files/setup/setupeld.c b/src/files/setup/setupeld.c index 6d216c7ee..248ad9121 100644 --- a/src/files/setup/setupeld.c +++ b/src/files/setup/setupeld.c @@ -2218,7 +2218,7 @@ u8 func0405_hacker[] = { chr_toggle_p1p2(CHR_SELF) set_target_chr(CHR_P1P2) if_stage_flag_eq(STAGEFLAG_HACKERS_SUCCEEDED, TRUE, /*goto*/ 0x2d) - if_chr_sees_player(/*goto*/ 0x09) + if_can_see_target(/*goto*/ 0x09) endloop(0x04) // Hackers succeeded @@ -2228,7 +2228,7 @@ u8 func0405_hacker[] = { beginloop(0x08) chr_toggle_p1p2(CHR_SELF) set_target_chr(CHR_P1P2) - if_chr_sees_player(/*goto*/ 0x09) + if_can_see_target(/*goto*/ 0x09) if_chr_stopped(/*goto*/ 0x06) endloop(0x08) diff --git a/src/files/setup/setupimp.c b/src/files/setup/setupimp.c index 94f9175b3..594aeffd6 100644 --- a/src/files/setup/setupimp.c +++ b/src/files/setup/setupimp.c @@ -595,7 +595,7 @@ u8 func1400_setup_counterop[] = { \ beginloop(0x04) \ if_never_been_onscreen(/*goto*/ 0x4f) \ - if_chr_sees_player(/*goto*/ 0x0a) \ + if_can_see_target(/*goto*/ 0x0a) \ reloop(0x04) \ \ label(0x0a) \ @@ -1750,9 +1750,9 @@ u8 func041a_hostage_holo[] = { // Wait until player in sight, or 2 seconds beginloop(0x0a) set_target_chr(CHR_BOND) - if_chr_sees_player(/*goto*/ 0x08) + if_can_see_target(/*goto*/ 0x08) set_target_chr(CHR_COOP) - if_chr_sees_player(/*goto*/ 0x08) + if_can_see_target(/*goto*/ 0x08) if_timer_gt(120, /*goto*/ 0x08) endloop(0x0a) @@ -1887,9 +1887,9 @@ u8 func041f_holoclone[] = { \ beginloop(0xba) \ set_target_chr(CHR_BOND) \ - if_chr_sees_player(/*goto*/ 0xbb) \ + if_can_see_target(/*goto*/ 0xbb) \ set_target_chr(CHR_COOP) \ - if_chr_sees_player(/*goto*/ 0xbb) \ + if_can_see_target(/*goto*/ 0xbb) \ if_timer_gt(60, /*goto*/ 0xbb) \ endloop(0xba) \ \ @@ -1978,7 +1978,7 @@ u8 func0425_hostage_thank_and_run[] = { label(0x03) set_target_chr(CHR_COOP) - if_chr_sees_player(/*goto*/ 0x2e) + if_can_see_target(/*goto*/ 0x2e) set_chrpreset(CHR_BOND) goto_next(0x08) @@ -2021,11 +2021,11 @@ u8 func0425_hostage_thank_and_run[] = { beginloop(0x10) set_target_chr(CHR_BOND) - if_chr_sees_player(/*goto*/ 0x2e) + if_can_see_target(/*goto*/ 0x2e) set_target_chr(CHR_ANTI) - if_chr_sees_player(/*goto*/ 0x2e) + if_can_see_target(/*goto*/ 0x2e) set_target_chr(CHR_COOP) - if_chr_sees_player(/*goto*/ 0x2e) + if_can_see_target(/*goto*/ 0x2e) if_distance_to_target_gt(500, /*goto*/ 0x08) label(0x2e) endloop(0x10) @@ -2070,7 +2070,7 @@ u8 func0427_drop_devastator[] = { label(0x03) set_target_chr(CHR_COOP) - if_chr_sees_player(/*goto*/ 0x2e) + if_can_see_target(/*goto*/ 0x2e) set_chrpreset(CHR_BOND) goto_next(0x08) @@ -2109,7 +2109,7 @@ u8 func0427_drop_devastator[] = { set_target_chr(CHR_PRESET) beginloop(0x10) - if_chr_sees_player(/*goto*/ 0x2e) + if_can_see_target(/*goto*/ 0x2e) if_distance_to_target_gt(500, /*goto*/ 0x08) label(0x2e) endloop(0x10) @@ -2210,9 +2210,9 @@ u8 func042b_deviceroom_hostage[] = { label(0x12) set_target_chr(CHR_BOND) - if_chr_sees_player(/*goto*/ 0x2e) + if_can_see_target(/*goto*/ 0x2e) set_target_chr(CHR_COOP) - if_chr_sees_player(/*goto*/ 0x2e) + if_can_see_target(/*goto*/ 0x2e) stop_chr goto_next(0x10) @@ -2983,7 +2983,7 @@ u8 func1015_firingrange_pc[] = { label(0x2e) \ dprint 'O','B','J','E','C','T','I','V','E',' ','D','O','N','E','\n',0, \ if_never_been_onscreen(/*goto*/ 0x4f) \ - if_chr_sees_player(/*goto*/ 0x0a) \ + if_can_see_target(/*goto*/ 0x0a) \ reloop(0x04) \ \ label(0x0a) \ @@ -3127,7 +3127,7 @@ u8 func0410_spawner6[] = { label(0x2e) dprint 'O','B','J','E','C','T','I','V','E',' ','D','O','N','E','\n',0, if_never_been_onscreen(/*goto*/ 0x4f) - if_chr_sees_player(/*goto*/ 0x0a) + if_can_see_target(/*goto*/ 0x0a) reloop(0x04) label(0x0a) diff --git a/src/files/setup/setuplee.c b/src/files/setup/setuplee.c index 98750f710..f98356716 100644 --- a/src/files/setup/setuplee.c +++ b/src/files/setup/setuplee.c @@ -683,11 +683,11 @@ u8 func040d_elvis_wait_for_hangar_entry[] = { beginloop(0x65) set_target_chr(CHR_BOND) - if_chr_sees_player(/*goto*/ 0x2c) + if_can_see_target(/*goto*/ 0x2c) set_target_chr(CHR_COOP) - if_chr_sees_player(/*goto*/ 0x2c) + if_can_see_target(/*goto*/ 0x2c) set_target_chr(CHR_ANTI) - if_chr_sees_player(/*goto*/ 0x2c) + if_can_see_target(/*goto*/ 0x2c) goto_next(0x06) label(0x2c) @@ -723,13 +723,13 @@ u8 func040e_elvis_give_ar34[] = { chr_toggle_p1p2(CHR_SELF) set_target_chr(CHR_P1P2) set_chrpreset(CHR_P1P2) - if_chr_sees_player(/*goto*/ 0x2c) + if_can_see_target(/*goto*/ 0x2c) endloop(0x04) label(0x2c) beginloop(0x08) - if_chr_sees_player(/*goto*/ 0x2c) + if_can_see_target(/*goto*/ 0x2c) endloop(0x08) // Run towards player @@ -744,7 +744,7 @@ u8 func040e_elvis_give_ar34[] = { reloop(0x09) label(0x06) - if_chr_sees_player(/*goto*/ 0x06) + if_can_see_target(/*goto*/ 0x06) endloop(0x09) label(0x2c) @@ -1677,7 +1677,7 @@ u8 func0412_hangarspawner[] = { // Still killing label(0x2c) if_never_been_onscreen(/*goto*/ 0x4d) - if_chr_sees_player(/*goto*/ 0x08) + if_can_see_target(/*goto*/ 0x08) reloop(0x04) // Seen player, or kills done @@ -2170,7 +2170,7 @@ u8 func0415_bridgespawner[] = { if_chr_dead(CHR_CLONE, /*goto*/ 0x2c) if_chr_knockedout(CHR_CLONE, /*goto*/ 0x2c) label(0x2c) - if_chr_sees_player(/*goto*/ 0x08) + if_can_see_target(/*goto*/ 0x08) endloop(0x04) // Been spawning for 61 seconds, or Skedar can see player @@ -3061,7 +3061,7 @@ u8 func0421_bridge_skedar[] = { goto_first(0xcd) label(0xcf) - if_chr_sees_player(/*goto*/ 0xce) + if_can_see_target(/*goto*/ 0xce) goto_first(0xc6) label(0xce) @@ -3073,7 +3073,7 @@ u8 func0421_bridge_skedar[] = { beginloop(0xd1) chr_toggle_p1p2(CHR_SELF) set_target_chr(CHR_P1P2) - if_chr_sees_player(/*goto*/ 0xce) + if_can_see_target(/*goto*/ 0xce) if_timer_gt(300, /*goto*/ 0x06) endloop(0xd1) @@ -3266,11 +3266,11 @@ u8 func0423_shy_skedar[] = { label(0x2d) stop_chr set_target_chr(CHR_BOND) - if_chr_sees_player(/*goto*/ 0x2c) + if_can_see_target(/*goto*/ 0x2c) set_target_chr(CHR_COOP) - if_chr_sees_player(/*goto*/ 0x2c) + if_can_see_target(/*goto*/ 0x2c) set_target_chr(CHR_ANTI) - if_chr_sees_player(/*goto*/ 0x2c) + if_can_see_target(/*goto*/ 0x2c) label(0x2c) stop_chr diff --git a/src/files/setup/setuplip.c b/src/files/setup/setuplip.c index 2a0f5bda2..2137a2118 100644 --- a/src/files/setup/setuplip.c +++ b/src/files/setup/setuplip.c @@ -2300,7 +2300,7 @@ u8 func0413_mechanic[] = { beginloop(0x04) chr_toggle_p1p2(CHR_SELF) set_target_chr(CHR_P1P2) - if_chr_sees_player(/*goto*/ 0x0a) + if_can_see_target(/*goto*/ 0x0a) if_chr_activated_object(CHR_P1P2, 0x14, /*goto*/ 0x2d) if_chr_activated_object(CHR_P1P2, 0x15, /*goto*/ 0x2d) endloop(0x04) @@ -2321,7 +2321,7 @@ u8 func0413_mechanic[] = { beginloop(0x0a) chr_toggle_p1p2(CHR_SELF) set_target_chr(CHR_P1P2) - if_chr_sees_player(/*goto*/ 0x06) + if_can_see_target(/*goto*/ 0x06) endloop(0x0a) label(0x06) @@ -2393,7 +2393,7 @@ u8 func0415_warehouse_spawner[] = { beginloop(0x04) chr_toggle_p1p2(CHR_SELF) set_target_chr(CHR_P1P2) - if_chr_sees_player(/*goto*/ 0x08) + if_can_see_target(/*goto*/ 0x08) if_chr_in_room(CHR_TARGET, 0x00, 0x00f8, /*goto*/ 0x08) if_chr_in_room(CHR_TARGET, 0x00, 0x00f7, /*goto*/ 0x08) if_chr_in_room(CHR_TARGET, 0x00, 0x00f6, /*goto*/ 0x08) @@ -2406,7 +2406,7 @@ u8 func0415_warehouse_spawner[] = { label(0x2d) if_never_been_onscreen(/*goto*/ 0x4e) dprint 'N','E','V','E','R',' ','V','I','S','F','A','I','L','\n',0, - if_chr_sees_player(/*goto*/ 0x08) + if_can_see_target(/*goto*/ 0x08) reloop(0x04) label(0x08) @@ -2845,7 +2845,7 @@ u8 func0420_labtech_doors[] = { if_chr_weapon_equipped(CHR_TARGET, WEAPON_UNARMED, /*goto*/ 0x2e) if_self_flag_bankx_eq(CHRFLAG0_08000000, TRUE, BANK_0, /*goto*/ 0x06) label(0x2e) - if_chr_sees_player(/*goto*/ 0x03) + if_can_see_target(/*goto*/ 0x03) label(0x06) if_alertness(99, OPERATOR_GREATER_THAN, /*goto*/ 0x03) if_saw_injury(0x00, /*goto*/ 0x03) @@ -4312,7 +4312,7 @@ u8 func0416_become_unaware[] = { if_chr_death_animation_finished(CHR_SELF, /*goto*/ 0x0f) if_chr_dead(CHR_SELF, /*goto*/ 0x0f) if_chr_knockedout(CHR_SELF, /*goto*/ 0x0f) - if_chr_sees_player(/*goto*/ 0x2d) + if_can_see_target(/*goto*/ 0x2d) set_alertness(0) return diff --git a/src/files/setup/setuplue.c b/src/files/setup/setuplue.c index 18fdbd169..3383cb7b6 100644 --- a/src/files/setup/setuplue.c +++ b/src/files/setup/setuplue.c @@ -1712,7 +1712,7 @@ u8 func040a_top_interceptor[] = { beginloop(0x04) chr_toggle_p1p2(CHR_SELF) set_target_chr(CHR_P1P2) - if_chr_sees_player(/*goto*/ 0x59) + if_can_see_target(/*goto*/ 0x59) endloop(0x04) label(0x58) @@ -1724,7 +1724,7 @@ u8 func040a_top_interceptor[] = { chr_toggle_p1p2(CHR_SELF) set_target_chr(CHR_P1P2) label(0x06) - if_chr_sees_player(/*goto*/ 0x59) + if_can_see_target(/*goto*/ 0x59) reloop(0x0a) // Unreachable @@ -1738,12 +1738,12 @@ u8 func040a_top_interceptor[] = { label(0x5b) yield - if_chr_sees_player(/*goto*/ 0x5c) + if_can_see_target(/*goto*/ 0x5c) restart_timer beginloop(0x5d) if_timer_gt(480, /*goto*/ 0x5e) - if_chr_sees_player(/*goto*/ 0x5c) + if_can_see_target(/*goto*/ 0x5c) endloop(0x5d) label(0x5e) @@ -2663,7 +2663,7 @@ u8 func0419_clone_spawner[] = { label(0x2e) dprint 'O','B','J','E','C','T','I','V','E',' ','D','O','N','E','\n',0, if_never_been_onscreen(/*goto*/ 0x4f) - if_chr_sees_player(/*goto*/ 0x09) + if_can_see_target(/*goto*/ 0x09) reloop(0x04) label(0x09) diff --git a/src/files/setup/setuppam.c b/src/files/setup/setuppam.c index d52f8cb3f..c98689c36 100644 --- a/src/files/setup/setuppam.c +++ b/src/files/setup/setuppam.c @@ -3079,9 +3079,9 @@ u8 func0419_teleport_coop_to_a_pa_drcaroll[] = { u8 func041c_teleport_activation_responder[] = { beginloop(0x04) set_target_chr(CHR_BOND) - if_chr_sees_player(/*goto*/ 0x2e) + if_can_see_target(/*goto*/ 0x2e) set_target_chr(CHR_COOP) - if_chr_sees_player(/*goto*/ 0x2e) + if_can_see_target(/*goto*/ 0x2e) unset_self_chrflag(CHRCFLAG_HIDDEN) set_ailist(CHR_SELF, AILIST_INIT_SNIPER) label(0x2e) @@ -3126,7 +3126,7 @@ u8 func041b_sniper_wait_for_detection[] = { beginloop(0x04) chr_toggle_p1p2(CHR_SELF) set_target_chr(CHR_P1P2) - if_chr_sees_player(/*goto*/ 0x2e) + if_can_see_target(/*goto*/ 0x2e) if_enemy_distance_lt_and_los(1000, /*goto*/ 0x2e) if_saw_death(0x00, /*goto*/ 0x2e) reloop(0x04) @@ -3170,7 +3170,7 @@ u8 func041d_sniper[] = { beginloop(0x63) chr_toggle_p1p2(CHR_SELF) - if_chr_sees_player(/*goto*/ 0x2e) + if_can_see_target(/*goto*/ 0x2e) dprint 'N','O',' ','P','L','A','Y','E','R',' ','T','A','R','G','E','T','\n',0, if_enemy_distance_lt_and_los(1000, /*goto*/ 0x2f) dprint 'N','O',' ','O','P','P','\n',0, @@ -3213,7 +3213,7 @@ u8 func041d_sniper[] = { if_player_looking_at_something_maybe(0x14, 0x01, 0x00, /*goto*/ 0x0d) dprint '3','\n',0, label(0x06) - if_chr_sees_player(/*goto*/ 0x2e) + if_can_see_target(/*goto*/ 0x2e) dprint '4','\n',0, goto_next(0x0d) @@ -3272,7 +3272,7 @@ u8 func040c_blonde[] = { beginloop(0x08) if_saw_injury(0x00, /*goto*/ 0x06) if_saw_death(0x00, /*goto*/ 0x06) - if_chr_sees_player(/*goto*/ 0x06) + if_can_see_target(/*goto*/ 0x06) endloop(0x08) label(0x06) @@ -3436,7 +3436,7 @@ u8 func040f_miniskedar[] = { beginloop(0x03) if_enemy_distance_lt_and_los(2540, /*goto*/ 0x2e) label(0x2e) - if_chr_sees_player(/*goto*/ 0x2e) + if_can_see_target(/*goto*/ 0x2e) goto_next(0x1e) label(0x2e) @@ -3451,7 +3451,7 @@ u8 func040f_miniskedar[] = { try_run_to_target(/*goto*/ 0x0a) beginloop(0x0a) - if_chr_sees_player(/*goto*/ 0x2e) + if_can_see_target(/*goto*/ 0x2e) goto_next(0x06) label(0x2e) @@ -4525,7 +4525,7 @@ u8 func040f_miniskedar_unalerted[] = { beginloop(0x04) chr_toggle_p1p2(CHR_SELF) set_target_chr(CHR_P1P2) - if_chr_sees_player(/*goto*/ 0x2e) + if_can_see_target(/*goto*/ 0x2e) endloop(0x04) label(0x2e) diff --git a/src/files/setup/setuprit.c b/src/files/setup/setuprit.c index 8b03337dd..685b8b472 100644 --- a/src/files/setup/setuprit.c +++ b/src/files/setup/setuprit.c @@ -1231,7 +1231,7 @@ u8 func0405_president_in_room[] = { if_chr_in_room(CHR_TARGET, 0x00, 0x0055, /*goto*/ 0x2d) if_chr_in_room(CHR_TARGET, 0x00, 0x0056, /*goto*/ 0x2d) if_chr_in_room(CHR_TARGET, 0x00, 0x0057, /*goto*/ 0x2d) - if_chr_sees_player(/*goto*/ 0x2d) + if_can_see_target(/*goto*/ 0x2d) goto_next(0x86) label(0x2d) @@ -1254,7 +1254,7 @@ u8 func0405_president_in_room[] = { if_chr_in_room(CHR_TARGET, 0x00, 0x0055, /*goto*/ 0x2d) if_chr_in_room(CHR_TARGET, 0x00, 0x0056, /*goto*/ 0x2d) if_chr_in_room(CHR_TARGET, 0x00, 0x0057, /*goto*/ 0x2d) - if_chr_sees_player(/*goto*/ 0x2d) + if_can_see_target(/*goto*/ 0x2d) goto_next(0x86) label(0x2d) @@ -1274,7 +1274,7 @@ u8 func0405_president_in_room[] = { if_chr_in_room(CHR_TARGET, 0x00, 0x0055, /*goto*/ 0x2d) if_chr_in_room(CHR_TARGET, 0x00, 0x0056, /*goto*/ 0x2d) if_chr_in_room(CHR_TARGET, 0x00, 0x0057, /*goto*/ 0x2d) - if_chr_sees_player(/*goto*/ 0x2d) + if_can_see_target(/*goto*/ 0x2d) goto_next(0x86) label(0x2d) @@ -1347,7 +1347,7 @@ u8 func0405_president_in_room[] = { if_chr_in_room(CHR_TARGET, 0x00, 0x0055, /*goto*/ 0x2d) if_chr_in_room(CHR_TARGET, 0x00, 0x0056, /*goto*/ 0x2d) if_chr_in_room(CHR_TARGET, 0x00, 0x0057, /*goto*/ 0x2d) - if_chr_sees_player(/*goto*/ 0x2d) + if_can_see_target(/*goto*/ 0x2d) goto_next(0x86) label(0x2d) @@ -1365,7 +1365,7 @@ u8 func0405_president_in_room[] = { if_chr_in_room(CHR_TARGET, 0x00, 0x0055, /*goto*/ 0x2d) if_chr_in_room(CHR_TARGET, 0x00, 0x0056, /*goto*/ 0x2d) if_chr_in_room(CHR_TARGET, 0x00, 0x0057, /*goto*/ 0x2d) - if_chr_sees_player(/*goto*/ 0x2d) + if_can_see_target(/*goto*/ 0x2d) goto_next(0x86) label(0x2d) @@ -1500,7 +1500,7 @@ u8 func0404_president_running[] = { if_chr_in_room(CHR_TARGET, 0x00, 0x0031, /*goto*/ 0x11) if_chr_in_room(CHR_TARGET, 0x00, 0x0032, /*goto*/ 0x11) dprint 't','a','r','g','e','t','\n',0, - if_chr_sees_player(/*goto*/ 0x06) + if_can_see_target(/*goto*/ 0x06) goto_next(0x58) label(0x06) @@ -1689,7 +1689,7 @@ u8 func100c_cockpit_stripes[] = { beginloop(0x04) chr_toggle_p1p2(CHR_SELF) set_target_chr(CHR_P1P2) - if_chr_sees_player(/*goto*/ 0x06) + if_can_see_target(/*goto*/ 0x06) if_enemy_distance_lt_and_los(2540, /*goto*/ 0x06) reloop(0x04) @@ -2450,7 +2450,7 @@ u8 func0415_cloner1[] = { if_chr_in_room(CHR_P1P2, 0x00, 0x0018, /*goto*/ 0x2d) if_chr_in_room(CHR_P1P2, 0x00, 0x0019, /*goto*/ 0x2d) if_never_been_onscreen(/*goto*/ 0x4f) - if_chr_sees_player(/*goto*/ 0x08) + if_can_see_target(/*goto*/ 0x08) label(0x2d) reloop(0x04) @@ -2546,7 +2546,7 @@ u8 func0418_cloner2[] = { if_chr_in_room(CHR_P1P2, 0x00, 0x0018, /*goto*/ 0x2d) if_chr_in_room(CHR_P1P2, 0x00, 0x0019, /*goto*/ 0x2d) if_never_been_onscreen(/*goto*/ 0x4f) - if_chr_sees_player(/*goto*/ 0x08) + if_can_see_target(/*goto*/ 0x08) label(0x2d) reloop(0x04) @@ -2645,7 +2645,7 @@ u8 func041b_cloner3[] = { if_chr_in_room(CHR_P1P2, 0x00, 0x0018, /*goto*/ 0x2d) if_chr_in_room(CHR_P1P2, 0x00, 0x0019, /*goto*/ 0x2d) if_never_been_onscreen(/*goto*/ 0x4f) - if_chr_sees_player(/*goto*/ 0x08) + if_can_see_target(/*goto*/ 0x08) label(0x2d) reloop(0x04) @@ -2821,7 +2821,7 @@ u8 func041e_blonde[] = { goto_first(0x6f) label(0x71) - if_chr_sees_player(/*goto*/ 0x70) + if_can_see_target(/*goto*/ 0x70) goto_first(0x68) label(0x70) @@ -2831,7 +2831,7 @@ u8 func041e_blonde[] = { restart_timer beginloop(0x73) - if_chr_sees_player(/*goto*/ 0x70) + if_can_see_target(/*goto*/ 0x70) if_timer_gt(300, /*goto*/ 0x06) endloop(0x73) @@ -2876,7 +2876,7 @@ u8 func0421_trent_waiting[] = { beginloop(0x04) chr_toggle_p1p2(CHR_SELF) set_target_chr(CHR_P1P2) - if_chr_sees_player(/*goto*/ 0x06) + if_can_see_target(/*goto*/ 0x06) endloop(0x04) label(0x06) @@ -2958,9 +2958,9 @@ u8 func0422_trent_running[] = { label(0x06) set_target_chr(CHR_BOND) - if_chr_sees_player(/*goto*/ 0x06) + if_can_see_target(/*goto*/ 0x06) set_target_chr(CHR_COOP) - if_chr_sees_player(/*goto*/ 0x06) + if_can_see_target(/*goto*/ 0x06) set_self_chrflag(CHRCFLAG_HIDDEN) remove_chr(CHR_SELF) set_ailist(CHR_SELF, GAILIST_IDLE) @@ -3795,9 +3795,9 @@ u8 func042c_remove_if_offscreen[] = { label(0x04) yield set_target_chr(CHR_BOND) - if_chr_sees_player(/*goto*/ 0x06) + if_can_see_target(/*goto*/ 0x06) set_target_chr(CHR_COOP) - if_chr_sees_player(/*goto*/ 0x06) + if_can_see_target(/*goto*/ 0x06) label(0x08) chr_drop_weapon(CHR_SELF) remove_chr(CHR_SELF) diff --git a/src/files/setup/setupsev.c b/src/files/setup/setupsev.c index df0d554d4..0586be878 100644 --- a/src/files/setup/setupsev.c +++ b/src/files/setup/setupsev.c @@ -1198,7 +1198,7 @@ u8 func0410_clone_spawner[] = { beginloop(0x04) if_never_been_onscreen(/*goto*/ 0x4d) - if_chr_sees_player(/*goto*/ 0x08) // <-- pointless + if_can_see_target(/*goto*/ 0x08) // <-- pointless reloop(0x04) label(0x08) @@ -1266,7 +1266,7 @@ u8 func0410_clone_spawner2[] = { beginloop(0x04) if_never_been_onscreen(/*goto*/ 0x4d) - if_chr_sees_player(/*goto*/ 0x08) // <-- pointless + if_can_see_target(/*goto*/ 0x08) // <-- pointless reloop(0x04) label(0x08) diff --git a/src/files/setup/setupsho.c b/src/files/setup/setupsho.c index 779213c48..8cebd4a10 100644 --- a/src/files/setup/setupsho.c +++ b/src/files/setup/setupsho.c @@ -536,9 +536,9 @@ u8 func0402_unarmed_skedar[] = { if_enemy_distance_lt_and_los(2540, /*goto*/ 0x2d) label(0x2e) set_target_chr(CHR_BOND) - if_chr_sees_player(/*goto*/ 0x2d) + if_can_see_target(/*goto*/ 0x2d) set_target_chr(CHR_COOP) - if_chr_sees_player(/*goto*/ 0x2d) + if_can_see_target(/*goto*/ 0x2d) if_self_flag_bankx_eq(CHRFLAG0_00000004, FALSE, BANK_0, /*goto*/ 0x2e) if_just_injured(CHR_SELF, /*goto*/ 0x2d) @@ -704,9 +704,9 @@ u8 func0405_puzzleroom_miniskedar_waiting[] = { label(0x2e) set_target_chr(CHR_BOND) - if_chr_sees_player(/*goto*/ 0x2d) + if_can_see_target(/*goto*/ 0x2d) set_target_chr(CHR_COOP) - if_chr_sees_player(/*goto*/ 0x2d) + if_can_see_target(/*goto*/ 0x2d) if_just_injured(CHR_SELF, /*goto*/ 0x2d) endloop(0x03) @@ -756,7 +756,7 @@ u8 func0404_miniskedar[] = { if_enemy_distance_lt_and_los(2540, /*goto*/ 0x2d) label(0x2e) - if_chr_sees_player(/*goto*/ 0x2d) + if_can_see_target(/*goto*/ 0x2d) if_just_injured(CHR_SELF, /*goto*/ 0x2d) // Healthy @@ -786,7 +786,7 @@ u8 func0404_miniskedar[] = { if_self_flag_bankx_eq(CHRFLAG0_AIVSAI, FALSE, BANK_0, /*goto*/ 0x2e) if_enemy_distance_lt_and_los(2540, /*goto*/ 0x2d) label(0x2e) - if_chr_sees_player(/*goto*/ 0x2d) + if_can_see_target(/*goto*/ 0x2d) goto_next(0x06) label(0x2d) @@ -1723,7 +1723,7 @@ u8 func0409_reaper_slayer_skedar[] = { goto_first(0x5f) label(0x60) - if_chr_sees_player(/*goto*/ 0x2d) + if_can_see_target(/*goto*/ 0x2d) goto_first(0x5e) label(0x58) @@ -1776,7 +1776,7 @@ u8 func0409_reaper_slayer_skedar[] = { goto_first(0x6a) label(0x6c) - if_chr_sees_player(/*goto*/ 0x6b) + if_can_see_target(/*goto*/ 0x6b) goto_first(0x5e) label(0x6b) @@ -1788,7 +1788,7 @@ u8 func0409_reaper_slayer_skedar[] = { beginloop(0x6e) chr_toggle_p1p2(CHR_SELF) set_target_chr(CHR_P1P2) - if_chr_sees_player(/*goto*/ 0x6b) + if_can_see_target(/*goto*/ 0x6b) if_timer_gt(300, /*goto*/ 0x06) endloop(0x6e) diff --git a/src/files/setup/setuptra.c b/src/files/setup/setuptra.c index 1e4723b1f..2bd577231 100644 --- a/src/files/setup/setuptra.c +++ b/src/files/setup/setuptra.c @@ -818,7 +818,7 @@ u8 func0402_jonathan_waiting_for_meetup[] = { beginloop(0x04) chr_toggle_p1p2(CHR_SELF) set_target_chr(CHR_P1P2) - if_chr_sees_player(/*goto*/ 0x06) + if_can_see_target(/*goto*/ 0x06) endloop(0x04) label(0x06) @@ -910,7 +910,7 @@ u8 func0404_jonathan_following_and_mine[] = { beginloop(0x5b) label(0x32) - if_chr_sees_player(/*goto*/ 0x06) + if_can_see_target(/*goto*/ 0x06) goto_next(0x5c) label(0x06) @@ -1993,7 +1993,7 @@ u8 func040b_elvis_follow[] = { beginloop(0x5b) if_chr_distance_to_pad_lt(CHR_SELF, 3510, 0x001e, /*goto*/ 0x08) - if_chr_sees_player(/*goto*/ 0x06) + if_can_see_target(/*goto*/ 0x06) goto_next(0x5c) label(0x06) @@ -3204,7 +3204,7 @@ u8 func0416_spawn_during_follow[] = { set_self_chrflag(CHRCFLAG_INVINCIBLE_TO_GUNFIRE) beginloop(0x04) - if_chr_sees_player(/*goto*/ 0x32) + if_can_see_target(/*goto*/ 0x32) if_stage_flag_eq(STAGEFLAG_MET_JON, TRUE, /*goto*/ 0x06) label(0x32) reloop(0x04) @@ -3337,9 +3337,9 @@ u8 unregistered_function1[] = { */ u8 func040f_warp_jon_to_catwalk[] = { set_target_chr(CHR_BOND) - if_chr_sees_player(/*goto*/ 0x06) + if_can_see_target(/*goto*/ 0x06) set_target_chr(CHR_COOP) - if_chr_sees_player(/*goto*/ 0x06) + if_can_see_target(/*goto*/ 0x06) stop_chr yield chr_move_to_pad(CHR_JONATHAN, 0x0152, 0x00, /*goto*/ 0x32) diff --git a/src/files/setup/setupwax.c b/src/files/setup/setupwax.c index 678bda440..be96b1cdc 100644 --- a/src/files/setup/setupwax.c +++ b/src/files/setup/setupwax.c @@ -1309,7 +1309,7 @@ u8 func0411_cass_in_office[] = { beginloop(0x54) chr_toggle_p1p2(CHR_SELF) set_target_chr(CHR_P1P2) - if_chr_sees_player(/*goto*/ 0x55) + if_can_see_target(/*goto*/ 0x55) endloop(0x54) // Player has entered @@ -1401,7 +1401,7 @@ u8 func0413_cass_running[] = { jog_to_pad(0x0000) beginloop(0x08) - if_chr_sees_player(/*goto*/ 0x2c) + if_can_see_target(/*goto*/ 0x2c) if_chr_stopped(/*goto*/ 0x0d) goto_next(0x06) label(0x2c) @@ -1423,7 +1423,7 @@ u8 func0413_cass_running[] = { beginloop(0x09) chr_toggle_p1p2(CHR_SELF) set_target_chr(CHR_P1P2) - if_chr_sees_player(/*goto*/ 0x2c) + if_can_see_target(/*goto*/ 0x2c) endloop(0x09) // Consider saying something diff --git a/src/game/chr/chraction.c b/src/game/chr/chraction.c index 37762f05e..e831c4dcd 100644 --- a/src/game/chr/chraction.c +++ b/src/game/chr/chraction.c @@ -87,6 +87,17 @@ const char var7f1a8cb4[] = "chrdisttopad : %x -> %d : Dist=%f"; const char var7f1a8cd8[] = "chraction.c"; const char var7f1a8ce4[] = "chraction.c"; +u32 var80068260 = 0x00000000; +u32 var80068264 = 0x00000000; +u32 var80068268 = 0x807b8079; +u32 var8006826c = 0x807c0000; +u32 var80068270 = 0x0000006b; +u32 var80068274 = 0x0000001b; +u32 var80068278 = 0x00000016; +u32 var8006827c = 0x0000006b; +u32 var80068280 = 0x0000001b; +u32 var80068284 = 0x00000016; + GLOBAL_ASM( glabel func0f02dff0 /* f02dff0: 00043400 */ sll $a2,$a0,0x10 @@ -12157,103 +12168,123 @@ glabel func0f0391ec /* f039228: 00000000 */ sll $zero,$zero,0x0 ); -GLOBAL_ASM( -glabel func0f03922c -/* f03922c: 27bdff90 */ addiu $sp,$sp,-112 -/* f039230: 3c0f8007 */ lui $t7,%hi(var80068288) -/* f039234: afbf002c */ sw $ra,0x2c($sp) -/* f039238: afb00028 */ sw $s0,0x28($sp) -/* f03923c: afa50074 */ sw $a1,0x74($sp) -/* f039240: afa60078 */ sw $a2,0x78($sp) -/* f039244: afa0006c */ sw $zero,0x6c($sp) -/* f039248: 25ef8288 */ addiu $t7,$t7,%lo(var80068288) -/* f03924c: 8de10000 */ lw $at,0x0($t7) -/* f039250: 8de80004 */ lw $t0,0x4($t7) -/* f039254: 27ae0058 */ addiu $t6,$sp,0x58 -/* f039258: adc10000 */ sw $at,0x0($t6) -/* f03925c: adc80004 */ sw $t0,0x4($t6) -/* f039260: 8de8000c */ lw $t0,0xc($t7) -/* f039264: 8de10008 */ lw $at,0x8($t7) -/* f039268: 00808025 */ or $s0,$a0,$zero -/* f03926c: adc8000c */ sw $t0,0xc($t6) -/* f039270: adc10008 */ sw $at,0x8($t6) -/* f039274: 0fc64a53 */ jal func0f19294c -/* f039278: 8fa50074 */ lw $a1,0x74($sp) -/* f03927c: 54400031 */ bnezl $v0,.L0f039344 -/* f039280: 8fa20078 */ lw $v0,0x78($sp) -/* f039284: 8e02001c */ lw $v0,0x1c($s0) -/* f039288: 3c0141a0 */ lui $at,0x41a0 -/* f03928c: 44818000 */ mtc1 $at,$f16 -/* f039290: c4440008 */ lwc1 $f4,0x8($v0) -/* f039294: 02002025 */ or $a0,$s0,$zero -/* f039298: 00002825 */ or $a1,$zero,$zero -/* f03929c: e7a40048 */ swc1 $f4,0x48($sp) -/* f0392a0: c6080028 */ lwc1 $f8,0x28($s0) -/* f0392a4: c60600b8 */ lwc1 $f6,0xb8($s0) -/* f0392a8: 46083280 */ add.s $f10,$f6,$f8 -/* f0392ac: 46105481 */ sub.s $f18,$f10,$f16 -/* f0392b0: e7b2004c */ swc1 $f18,0x4c($sp) -/* f0392b4: c4440010 */ lwc1 $f4,0x10($v0) -/* f0392b8: afa20054 */ sw $v0,0x54($sp) -/* f0392bc: 0fc079ef */ jal chrSetOrUnsetHiddenFlag00000100 -/* f0392c0: e7a40050 */ swc1 $f4,0x50($sp) -/* f0392c4: 8fa40074 */ lw $a0,0x74($sp) -/* f0392c8: 0fc079ef */ jal chrSetOrUnsetHiddenFlag00000100 -/* f0392cc: 00002825 */ or $a1,$zero,$zero -/* f0392d0: 8fa20054 */ lw $v0,0x54($sp) -/* f0392d4: 27a60048 */ addiu $a2,$sp,0x48 -/* f0392d8: 27a70038 */ addiu $a3,$sp,0x38 -/* f0392dc: 24440008 */ addiu $a0,$v0,0x8 -/* f0392e0: 0fc1979d */ jal func0f065e74 -/* f0392e4: 24450028 */ addiu $a1,$v0,0x28 -/* f0392e8: 8fa90074 */ lw $t1,0x74($sp) -/* f0392ec: 27aa0058 */ addiu $t2,$sp,0x58 -/* f0392f0: 240b0133 */ addiu $t3,$zero,0x133 -/* f0392f4: 8d22001c */ lw $v0,0x1c($t1) -/* f0392f8: 240c0008 */ addiu $t4,$zero,0x8 -/* f0392fc: afac0018 */ sw $t4,0x18($sp) -/* f039300: afab0014 */ sw $t3,0x14($sp) -/* f039304: afaa0010 */ sw $t2,0x10($sp) -/* f039308: 27a40048 */ addiu $a0,$sp,0x48 -/* f03930c: 27a50038 */ addiu $a1,$sp,0x38 -/* f039310: 24460008 */ addiu $a2,$v0,0x8 -/* f039314: 0c00b73f */ jal func0002dcfc -/* f039318: 24470028 */ addiu $a3,$v0,0x28 -/* f03931c: 10400003 */ beqz $v0,.L0f03932c -/* f039320: 02002025 */ or $a0,$s0,$zero -/* f039324: 240d0001 */ addiu $t5,$zero,0x1 -/* f039328: afad006c */ sw $t5,0x6c($sp) -.L0f03932c: -/* f03932c: 0fc079ef */ jal chrSetOrUnsetHiddenFlag00000100 -/* f039330: 24050001 */ addiu $a1,$zero,0x1 -/* f039334: 8fa40074 */ lw $a0,0x74($sp) -/* f039338: 0fc079ef */ jal chrSetOrUnsetHiddenFlag00000100 -/* f03933c: 24050001 */ addiu $a1,$zero,0x1 -/* f039340: 8fa20078 */ lw $v0,0x78($sp) -.L0f039344: -/* f039344: 87b90058 */ lh $t9,0x58($sp) -/* f039348: 50400003 */ beqzl $v0,.L0f039358 -/* f03934c: 8fbf002c */ lw $ra,0x2c($sp) -/* f039350: a4590000 */ sh $t9,0x0($v0) -/* f039354: 8fbf002c */ lw $ra,0x2c($sp) -.L0f039358: -/* f039358: 8fa2006c */ lw $v0,0x6c($sp) -/* f03935c: 8fb00028 */ lw $s0,0x28($sp) -/* f039360: 03e00008 */ jr $ra -/* f039364: 27bd0070 */ addiu $sp,$sp,0x70 -); - -u32 func0f039368(struct chrdata *chr) +bool chrCanSeeChr(struct chrdata *chr, struct chrdata *target, s16 *room) { - u32 result; - struct prop *prop = chrGetTargetProp(chr); - result = func0f03922c(chr, prop->chr, 0); + bool cansee = false; + u32 stack; + s16 sp88[] = {-1, 0, 0, 0, 0, 0, 0, 0}; - if (result) { + if (func0f19294c(chr, target) == 0) { + struct prop *prop = chr->prop; + struct coord pos; + s16 rooms[8]; + + pos.x = prop->pos.x; + pos.y = chr->ground + chr->chrheight - 20; + pos.z = prop->pos.z; + + chrSetOrUnsetHiddenFlag00000100(chr, false); + chrSetOrUnsetHiddenFlag00000100(target, false); + + func0f065e74(&prop->pos, prop->rooms, &pos, rooms); + + if (func0002dcfc(&pos, rooms, &target->prop->pos, target->prop->rooms, sp88, 307, 8)) { + cansee = true; + } + + chrSetOrUnsetHiddenFlag00000100(chr, true); + chrSetOrUnsetHiddenFlag00000100(target, true); + } + + if (room) { + *room = sp88[0]; + } + + return cansee; +} + +u32 var80068298 = 0x01000000; +u32 var8006829c = 0x0000027c; +u32 var800682a0 = 0x00000005; +u32 var800682a4 = 0x00140000; +u32 var800682a8 = 0x42700000; +u32 var800682ac = 0x0000027d; +u32 var800682b0 = 0x00000005; +u32 var800682b4 = 0x00140000; +u32 var800682b8 = 0x41f80000; +u32 var800682bc = 0x0000027e; +u32 var800682c0 = 0x00000005; +u32 var800682c4 = 0x00140000; +u32 var800682c8 = 0x42400000; +u32 var800682cc = 0x0000027f; +u32 var800682d0 = 0x00000005; +u32 var800682d4 = 0x00140000; +u32 var800682d8 = 0x428a0000; +u32 var800682dc = 0x00000212; +u32 var800682e0 = 0x00000005; +u32 var800682e4 = 0x00140000; +u32 var800682e8 = 0x42800000; +u32 var800682ec = 0x00000213; +u32 var800682f0 = 0x00000005; +u32 var800682f4 = 0x00140000; +u32 var800682f8 = 0x42500000; +u32 var800682fc = 0x00000214; +u32 var80068300 = 0x00000005; +u32 var80068304 = 0x00140000; +u32 var80068308 = 0x424c0000; +u32 var8006830c = 0x0000020e; +u32 var80068310 = 0x00000005; +u32 var80068314 = 0x00140000; +u32 var80068318 = 0x42540000; +u32 var8006831c = 0x0000020f; +u32 var80068320 = 0x00000005; +u32 var80068324 = 0x00140000; +u32 var80068328 = 0x42b20000; +u32 var8006832c = 0x00000210; +u32 var80068330 = 0x00000005; +u32 var80068334 = 0x00140000; +u32 var80068338 = 0x428e0000; +u32 var8006833c = 0x00000215; +u32 var80068340 = 0x00000005; +u32 var80068344 = 0x00140000; +u32 var80068348 = 0x42780000; +u32 var8006834c = 0x00000211; +u32 var80068350 = 0x00000005; +u32 var80068354 = 0x00140000; +u32 var80068358 = 0x42900000; +u32 var8006835c = 0x0000034c; +u32 var80068360 = 0x0000000f; +u32 var80068364 = 0x00190000; +u32 var80068368 = 0x42c80000; +u32 var8006836c = 0x0000034d; +u32 var80068370 = 0x0000000f; +u32 var80068374 = 0x00190000; +u32 var80068378 = 0xbf800000; +u32 var8006837c = 0x00000395; +u32 var80068380 = 0x0000000f; +u32 var80068384 = 0x00190000; +u32 var80068388 = 0xbf800000; +u32 var8006838c = 0x00000346; +u32 var80068390 = 0x0000000f; +u32 var80068394 = 0x00190000; +u32 var80068398 = 0xbf800000; +u32 var8006839c = 0x00000347; +u32 var800683a0 = 0x0000000f; +u32 var800683a4 = 0x00190000; +u32 var800683a8 = 0xbf800000; +u32 var800683ac = 0x0000034f; + +bool chrCanSeeTarget(struct chrdata *chr) +{ + bool cansee; + struct prop *prop = chrGetTargetProp(chr); + cansee = chrCanSeeChr(chr, prop->chr, NULL); + + if (cansee) { chrRecordLastVisibleTargetTime(chr); } - return result; + return cansee; } GLOBAL_ASM( @@ -12496,7 +12527,7 @@ bool chrCheckTargetInSight(struct chrdata *chr) } if (result) { - result = func0f039368(chr); + result = chrCanSeeTarget(chr); } if (result) { @@ -16584,7 +16615,7 @@ glabel var7f1a8fc8 /* f03eb44: afaf0160 */ sw $t7,0x160($sp) .L0f03eb48: /* f03eb48: e7a00024 */ swc1 $f0,0x24($sp) -/* f03eb4c: 0fc0e4da */ jal func0f039368 +/* f03eb4c: 0fc0e4da */ jal chrCanSeeTarget /* f03eb50: e7b00188 */ swc1 $f16,0x188($sp) /* f03eb54: c7a00024 */ lwc1 $f0,0x24($sp) /* f03eb58: c7b00188 */ lwc1 $f16,0x188($sp) @@ -28054,7 +28085,7 @@ glabel var7f1a93e0 /* f049fe8: 24010003 */ addiu $at,$zero,0x3 /* f049fec: 5481000c */ bnel $a0,$at,.L0f04a020 /* f049ff0: 24010006 */ addiu $at,$zero,0x6 -/* f049ff4: 0fc0e4da */ jal func0f039368 +/* f049ff4: 0fc0e4da */ jal chrCanSeeTarget /* f049ff8: 8fa40058 */ lw $a0,0x58($sp) /* f049ffc: 14400003 */ bnez $v0,.L0f04a00c /* f04a000: 8fa40058 */ lw $a0,0x58($sp) diff --git a/src/game/chr/chrai.c b/src/game/chr/chrai.c index 24a916406..a2fd29e28 100644 --- a/src/game/chr/chrai.c +++ b/src/game/chr/chrai.c @@ -81,7 +81,7 @@ bool (*g_CommandPointers[])(void) = { /*0x003c*/ aiIfHearsTarget, /*0x003d*/ aiIfSawInjury, /*0x003e*/ aiIfSawDeath, - /*0x003f*/ aiIfSeesPlayer, + /*0x003f*/ aiIfCanSeeTarget, /*0x0040*/ aiIfTargetNearlyInSight, /*0x0041*/ aiIfNearlyInTargetsSight, /*0x0042*/ aiIfInLoadedRoom, diff --git a/src/game/chr/chraicommands.c b/src/game/chr/chraicommands.c index 97e43c88c..a96b59b4a 100644 --- a/src/game/chr/chraicommands.c +++ b/src/game/chr/chraicommands.c @@ -1342,9 +1342,9 @@ bool aiIfSawDeath(void) /** * @cmd 003f */ -bool aiIfSeesPlayer(void) +bool aiIfCanSeeTarget(void) { - if ((g_Vars.chrdata && func0f039368(g_Vars.chrdata)) || + if ((g_Vars.chrdata && chrCanSeeTarget(g_Vars.chrdata)) || (g_Vars.hovercar && func0f07ae18(g_Vars.hovercar, 0x40) && chopperCheckTargetVisible(g_Vars.hovercar))) { u8 *cmd = g_Vars.ailist + g_Vars.aioffset; g_Vars.aioffset = chraiGoToLabel(g_Vars.ailist, g_Vars.aioffset, cmd[2]); diff --git a/src/game/data/ailists.c b/src/game/data/ailists.c index 0ab1134be..d66d4af0c 100644 --- a/src/game/data/ailists.c +++ b/src/game/data/ailists.c @@ -183,7 +183,7 @@ u8 func0006_unalerted[] = { if_num_times_shot_gt(0, /*goto*/ LABEL_SEE_DETECT) dprint 'B','4','N','O','H','E','A','R','\n',0, if_self_flag_bankx_eq(CHRFLAG0_NOHEAR, FALSE, BANK_0, /*goto*/ 0x16) - if_chr_sees_player(/*goto*/ 0x16) + if_can_see_target(/*goto*/ 0x16) goto_next(0x13) label(0x16) @@ -339,7 +339,7 @@ u8 func0006_unalerted[] = { label(0xe6) if_distance_to_target_gt(450, /*goto*/ 0x15) label(0xe8) - if_chr_sees_player(/*goto*/ 0xe9) + if_can_see_target(/*goto*/ 0xe9) goto_next(LABEL_DISGUISE_UNCOVERED) label(0xe9) @@ -2610,7 +2610,7 @@ u8 func0007_alerted[] = { if_chr_death_animation_finished(CHR_SELF, /*goto*/ 0x16) if_chr_dead(CHR_SELF, /*goto*/ 0x16) if_chr_knockedout(CHR_SELF, /*goto*/ 0x16) - if_chr_sees_player(/*goto*/ 0x13) + if_can_see_target(/*goto*/ 0x13) set_alertness(0) set_self_flag_bankx(CHRFLAG1_10000000, BANK_1) set_returnlist(CHR_SELF, GAILIST_UNALERTED) @@ -3518,7 +3518,7 @@ u8 func000e_see_then_attack[] = { beginloop(0x0c) chr_toggle_p1p2(CHR_SELF) set_target_chr(CHR_P1P2) - if_chr_sees_player(/*goto*/ 0x16) + if_can_see_target(/*goto*/ 0x16) endloop(0x0c) label(0x16) @@ -4238,7 +4238,7 @@ u8 func001b_observe_camspy[] = { // Camspy still alive dprint 'E','2','\n',0, - if_chr_sees_player(/*goto*/ 0x16) + if_can_see_target(/*goto*/ 0x16) dprint 'E','3','\n',0, goto_next(0x13) @@ -4494,7 +4494,7 @@ u8 func001f_related_to_spawning[] = { if_near_miss(/*goto*/ 0x1e) if_num_times_shot_gt(0, /*goto*/ 0x1e) if_self_flag_bankx_eq(CHRFLAG0_NOHEAR, FALSE, BANK_0, /*goto*/ 0x16) - if_chr_sees_player(/*goto*/ 0x16) + if_can_see_target(/*goto*/ 0x16) goto_next(0x13) label(0x16) @@ -4779,7 +4779,7 @@ u8 func0014_coop_buddy[] = { set_chr_hiddenflag(CHR_SELF, CHRHFLAG_DISGUISED) label(0x07) set_target_chr(CHR_BOND) - if_chr_sees_player(/*goto*/ 0xdd) + if_can_see_target(/*goto*/ 0xdd) if_chr_has_hiddenflag(CHR_SELF, CHRHFLAG_PASSIVE, /*goto*/ 0xdc) label(0xdd) if_enemy_distance_lt_and_los(2540, /*goto*/ 0x03) @@ -4896,7 +4896,7 @@ u8 func0022_comment_on_player_dead[] = { // Wait until player in sight. Which won't happen if the current chr is // stopped and player is dying... beginloop(0x0c) - if_chr_sees_player(/*goto*/ 0x16) + if_can_see_target(/*goto*/ 0x16) endloop(0x0c) // Wait half a second diff --git a/src/game/data/data_0083d0.c b/src/game/data/data_0083d0.c index 5c3e04ed6..b824ae098 100644 --- a/src/game/data/data_0083d0.c +++ b/src/game/data/data_0083d0.c @@ -2358,87 +2358,3 @@ u32 var80068250 = 0x00000000; u32 var80068254 = 0x00000000; u32 var80068258 = 0x00000000; u32 var8006825c = 0x00000000; -u32 var80068260 = 0x00000000; -u32 var80068264 = 0x00000000; -u32 var80068268 = 0x807b8079; -u32 var8006826c = 0x807c0000; -u32 var80068270 = 0x0000006b; -u32 var80068274 = 0x0000001b; -u32 var80068278 = 0x00000016; -u32 var8006827c = 0x0000006b; -u32 var80068280 = 0x0000001b; -u32 var80068284 = 0x00000016; -u32 var80068288 = 0xffff0000; -u32 var8006828c = 0x00000000; -u32 var80068290 = 0x00000000; -u32 var80068294 = 0x00000000; -u32 var80068298 = 0x01000000; -u32 var8006829c = 0x0000027c; -u32 var800682a0 = 0x00000005; -u32 var800682a4 = 0x00140000; -u32 var800682a8 = 0x42700000; -u32 var800682ac = 0x0000027d; -u32 var800682b0 = 0x00000005; -u32 var800682b4 = 0x00140000; -u32 var800682b8 = 0x41f80000; -u32 var800682bc = 0x0000027e; -u32 var800682c0 = 0x00000005; -u32 var800682c4 = 0x00140000; -u32 var800682c8 = 0x42400000; -u32 var800682cc = 0x0000027f; -u32 var800682d0 = 0x00000005; -u32 var800682d4 = 0x00140000; -u32 var800682d8 = 0x428a0000; -u32 var800682dc = 0x00000212; -u32 var800682e0 = 0x00000005; -u32 var800682e4 = 0x00140000; -u32 var800682e8 = 0x42800000; -u32 var800682ec = 0x00000213; -u32 var800682f0 = 0x00000005; -u32 var800682f4 = 0x00140000; -u32 var800682f8 = 0x42500000; -u32 var800682fc = 0x00000214; -u32 var80068300 = 0x00000005; -u32 var80068304 = 0x00140000; -u32 var80068308 = 0x424c0000; -u32 var8006830c = 0x0000020e; -u32 var80068310 = 0x00000005; -u32 var80068314 = 0x00140000; -u32 var80068318 = 0x42540000; -u32 var8006831c = 0x0000020f; -u32 var80068320 = 0x00000005; -u32 var80068324 = 0x00140000; -u32 var80068328 = 0x42b20000; -u32 var8006832c = 0x00000210; -u32 var80068330 = 0x00000005; -u32 var80068334 = 0x00140000; -u32 var80068338 = 0x428e0000; -u32 var8006833c = 0x00000215; -u32 var80068340 = 0x00000005; -u32 var80068344 = 0x00140000; -u32 var80068348 = 0x42780000; -u32 var8006834c = 0x00000211; -u32 var80068350 = 0x00000005; -u32 var80068354 = 0x00140000; -u32 var80068358 = 0x42900000; -u32 var8006835c = 0x0000034c; -u32 var80068360 = 0x0000000f; -u32 var80068364 = 0x00190000; -u32 var80068368 = 0x42c80000; -u32 var8006836c = 0x0000034d; -u32 var80068370 = 0x0000000f; -u32 var80068374 = 0x00190000; -u32 var80068378 = 0xbf800000; -u32 var8006837c = 0x00000395; -u32 var80068380 = 0x0000000f; -u32 var80068384 = 0x00190000; -u32 var80068388 = 0xbf800000; -u32 var8006838c = 0x00000346; -u32 var80068390 = 0x0000000f; -u32 var80068394 = 0x00190000; -u32 var80068398 = 0xbf800000; -u32 var8006839c = 0x00000347; -u32 var800683a0 = 0x0000000f; -u32 var800683a4 = 0x00190000; -u32 var800683a8 = 0xbf800000; -u32 var800683ac = 0x0000034f; diff --git a/src/game/game_190260.c b/src/game/game_190260.c index 4c6b6634a..538001cba 100644 --- a/src/game/game_190260.c +++ b/src/game/game_190260.c @@ -3145,7 +3145,7 @@ glabel func0f192e90 /* f192f78: 000d7080 */ sll $t6,$t5,0x2 /* f192f7c: 026e6021 */ addu $t4,$s3,$t6 /* f192f80: e580013c */ swc1 $f0,0x13c($t4) -/* f192f84: 0fc0e48b */ jal func0f03922c +/* f192f84: 0fc0e48b */ jal chrCanSeeChr /* f192f88: 27a6006a */ addiu $a2,$sp,0x6a /* f192f8c: 8e6f012c */ lw $t7,0x12c($s3) /* f192f90: 026fc021 */ addu $t8,$s3,$t7 diff --git a/src/include/commands.h b/src/include/commands.h index 68798c3c6..f31eb0be4 100644 --- a/src/include/commands.h +++ b/src/include/commands.h @@ -585,9 +585,9 @@ label, /** - * Checks if the chr can see the player. + * Checks if the current chr can see their target. */ -#define if_chr_sees_player(label) \ +#define if_can_see_target(label) \ mkshort(0x003f), \ label, diff --git a/src/include/game/chr/chraction.h b/src/include/game/chr/chraction.h index 91ebc9145..b05adce1b 100644 --- a/src/include/game/chr/chraction.h +++ b/src/include/game/chr/chraction.h @@ -85,7 +85,7 @@ u32 func0f038868(void); void func0f038b9c(struct chrdata *chr, struct path *path); u32 func0f038f40(void); u32 func0f0391ec(struct chrdata *chr, struct coord *pos, s16 *room, u32 arg3); -u32 func0f03922c(struct chrdata *chr, void *arg1, s32 arg2); +bool chrCanSeeChr(struct chrdata *chr, struct chrdata *target, s16 *room); u32 func0f0393b4(struct chrdata *chr, struct coord *pos, s16 *room); bool func0f039474(struct chrdata *chr, struct coord *pos, s16 *room); bool func0f039558(struct chrdata *chr, struct prop *prop); @@ -226,7 +226,7 @@ void chrSetField66To0(struct chrdata *chr); s32 func0f037560(s32 arg0, s32 arg1, s32 arg2); struct path *pathFindById(u32 path_id); void chrRecordLastVisibleTargetTime(struct chrdata *chr); -bool func0f039368(struct chrdata *chr); +bool chrCanSeeTarget(struct chrdata *chr); void chrRecordLastSeeTargetTime(struct chrdata *chr); void chrRecordLastHearTargetTime(struct chrdata *chr); bool chrIsDead(struct chrdata *chr); diff --git a/src/include/game/chr/chraicommands.h b/src/include/game/chr/chraicommands.h index c35f20e4c..8143d683d 100644 --- a/src/include/game/chr/chraicommands.h +++ b/src/include/game/chr/chraicommands.h @@ -66,7 +66,7 @@ /*0x003c*/ bool aiIfHearsTarget(void); /*0x003d*/ bool aiIfSawInjury(void); /*0x003e*/ bool aiIfSawDeath(void); -/*0x003f*/ bool aiIfSeesPlayer(void); +/*0x003f*/ bool aiIfCanSeeTarget(void); /*0x0040*/ bool aiIfTargetNearlyInSight(void); /*0x0041*/ bool aiIfNearlyInTargetsSight(void); /*0x0042*/ bool aiIfInLoadedRoom(void); diff --git a/src/include/game/game_190260.h b/src/include/game/game_190260.h index ec611e994..9cac4c726 100644 --- a/src/include/game/game_190260.h +++ b/src/include/game/game_190260.h @@ -19,7 +19,7 @@ u32 func0f191fa4(void); u32 func0f1921f8(void); u32 func0f192628(void); u32 func0f19277c(void); -u32 func0f19294c(void); +bool func0f19294c(struct chrdata *chr, struct chrdata *chr2); u32 func0f192a48(void); u32 func0f192a74(void); u32 func0f192d64(void); diff --git a/src/include/lib/lib_233c0.h b/src/include/lib/lib_233c0.h index 623c0a603..a6fade077 100644 --- a/src/include/lib/lib_233c0.h +++ b/src/include/lib/lib_233c0.h @@ -112,7 +112,7 @@ bool func0002db98(struct coord *viewpos, s16 *rooms, struct coord *targetpos, s3 u32 func0002dc18(struct coord *coord, s16 *room, struct coord *coord2, s32 arg3); bool hasLineOfSight(struct coord *coord, s16 *room, struct coord *coord2, s16 *room2, s32 arg4, s32 arg5); u32 func0002dcd0(void); -u32 func0002dcfc(void); +bool func0002dcfc(struct coord *pos, s16 *rooms, struct coord *pos2, s16 *rooms2, s16 *rooms3, u32 arg5, u32 arg6); u32 func0002dd90(void); u32 func0002de10(void); u32 func0002de34(void);