Decompile aiIfDoorState

This commit is contained in:
Ryan Dwyer
2019-10-18 22:43:55 +10:00
parent f5a538b0c5
commit 8b0f8cc5c3
20 changed files with 153 additions and 188 deletions
+1 -1
View File
@@ -1633,7 +1633,7 @@ u8 func0409_tech_conversation[] = {
consider_coop_for_p1p2_chr(CHR_SELF)
set_target_chr(CHR_P1P2)
if_chr_activated_object(TARGET_CHR, 0x11, /*goto*/ 0x00)
if_door_state(0x11, DOORSTATE_OPEN, /*goto*/ 0x00)
if_door_state(0x11, DOORSTATEBIT_OPEN, /*goto*/ 0x00)
if_alertness(99, OPERATOR_GREATER_THAN, /*goto*/ 0x33)
dprint 'T','E','C','H',' ','1',' ','L','O','O','P','\n',0,
set_chr_flag_bank3(CHR_TECH1, CHRFLAG3_INVINCIBLE_TO_GUNFIRE)
+2 -2
View File
@@ -2879,7 +2879,7 @@ u8 func1017_laser5[] = {
open_door(0x13)
beginloop(0x05)
if_door_state(0x13, (DOORSTATE_CLOSED | DOORSTATE_CLOSING), /*goto*/ 0x31)
if_door_state(0x13, (DOORSTATEBIT_CLOSED | DOORSTATEBIT_CLOSING), /*goto*/ 0x31)
endloop(0x05)
label(0x31)
@@ -3540,7 +3540,7 @@ u8 func1018_safe_switch[] = {
label(0x31)
beginloop(0x08)
if_door_state(OBJ_SAFEDOOR, DOORSTATE_CLOSING, /*goto*/ 0x31)
if_door_state(OBJ_SAFEDOOR, DOORSTATEBIT_CLOSING, /*goto*/ 0x31)
reloop(0x08)
label(0x31)
+20 -20
View File
@@ -1530,16 +1530,16 @@ u8 func1017_check_lasers_closed[] = {
beginloop(0x04)
if_stage_flag_eq(STAGEFLAG_ALL_LASERS_DISABLED, TRUE, /*goto*/ 0x08)
if_stage_flag_eq(STAGEFLAG_MEETING_HOLOGRAPHED, TRUE, /*goto*/ 0x08)
if_door_state(OBJ_LASER_1A, (DOORSTATE_OPEN | DOORSTATE_CLOSING | DOORSTATE_OPENING), /*goto*/ 0x2c)
if_door_state(OBJ_LASER_1A, (DOORSTATEBIT_OPEN | DOORSTATEBIT_CLOSING | DOORSTATEBIT_OPENING), /*goto*/ 0x2c)
unset_stage_flag(STAGEFLAG_LASERSET1_DISABLED)
label(0x2c)
if_door_state(OBJ_LASER_2A, (DOORSTATE_OPEN | DOORSTATE_CLOSING | DOORSTATE_OPENING), /*goto*/ 0x2c)
if_door_state(OBJ_LASER_2A, (DOORSTATEBIT_OPEN | DOORSTATEBIT_CLOSING | DOORSTATEBIT_OPENING), /*goto*/ 0x2c)
unset_stage_flag(STAGEFLAG_LASERSET2_DISABLED)
label(0x2c)
if_door_state(OBJ_LASER_3A, (DOORSTATE_OPEN | DOORSTATE_CLOSING | DOORSTATE_OPENING), /*goto*/ 0x2c)
if_door_state(OBJ_LASER_3A, (DOORSTATEBIT_OPEN | DOORSTATEBIT_CLOSING | DOORSTATEBIT_OPENING), /*goto*/ 0x2c)
unset_stage_flag(STAGEFLAG_LASERSET3_DISABLED)
label(0x2c)
if_door_state(OBJ_LASER_4A, (DOORSTATE_OPEN | DOORSTATE_CLOSING | DOORSTATE_OPENING), /*goto*/ 0x2c)
if_door_state(OBJ_LASER_4A, (DOORSTATEBIT_OPEN | DOORSTATEBIT_CLOSING | DOORSTATEBIT_OPENING), /*goto*/ 0x2c)
unset_stage_flag(STAGEFLAG_LASERSET4_DISABLED)
label(0x2c)
endloop(0x04)
@@ -2845,28 +2845,28 @@ u8 func1023_hide_nbomb_crate[] = {
u8 unregistered_function[] = {
beginloop(0x04)
if_stage_flag_eq(STAGEFLAG_LASERSET1_DISABLED, FALSE, /*goto*/ 0x2c)
if_door_state(OBJ_LASER_1A, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x2c)
if_door_state(OBJ_LASER_1A, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x2c)
open_door(OBJ_LASER_1A)
open_door(OBJ_LASER_1B)
open_door(OBJ_LASER_1C)
open_door(OBJ_LASER_1D)
label(0x2c)
if_stage_flag_eq(STAGEFLAG_LASERSET2_DISABLED, FALSE, /*goto*/ 0x2c)
if_door_state(OBJ_LASER_2A, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x2c)
if_door_state(OBJ_LASER_2A, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x2c)
open_door(OBJ_LASER_2A)
open_door(OBJ_LASER_2B)
open_door(OBJ_LASER_2C)
open_door(OBJ_LASER_2D)
label(0x2c)
if_stage_flag_eq(STAGEFLAG_LASERSET3_DISABLED, FALSE, /*goto*/ 0x2c)
if_door_state(OBJ_LASER_3A, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x2c)
if_door_state(OBJ_LASER_3A, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x2c)
open_door(OBJ_LASER_3A)
open_door(OBJ_LASER_3B)
open_door(OBJ_LASER_3C)
open_door(OBJ_LASER_3D)
label(0x2c)
if_stage_flag_eq(STAGEFLAG_LASERSET4_DISABLED, FALSE, /*goto*/ 0x2c)
if_door_state(OBJ_LASER_4A, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x2c)
if_door_state(OBJ_LASER_4A, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x2c)
open_door(OBJ_LASER_4A)
open_door(OBJ_LASER_4B)
open_door(OBJ_LASER_4C)
@@ -2892,10 +2892,10 @@ u8 func1026_unlock_doors[] = {
// Wait until some door is not closed (so... opening, I guess?)
beginloop(0x04)
if_door_state(0x43, (DOORSTATE_OPEN | DOORSTATE_CLOSING | DOORSTATE_OPENING), /*goto*/ 0x2c)
if_door_state(0x44, (DOORSTATE_OPEN | DOORSTATE_CLOSING | DOORSTATE_OPENING), /*goto*/ 0x2c)
if_door_state(0x45, (DOORSTATE_OPEN | DOORSTATE_CLOSING | DOORSTATE_OPENING), /*goto*/ 0x2c)
if_door_state(0x46, (DOORSTATE_OPEN | DOORSTATE_CLOSING | DOORSTATE_OPENING), /*goto*/ 0x2c)
if_door_state(0x43, (DOORSTATEBIT_OPEN | DOORSTATEBIT_CLOSING | DOORSTATEBIT_OPENING), /*goto*/ 0x2c)
if_door_state(0x44, (DOORSTATEBIT_OPEN | DOORSTATEBIT_CLOSING | DOORSTATEBIT_OPENING), /*goto*/ 0x2c)
if_door_state(0x45, (DOORSTATEBIT_OPEN | DOORSTATEBIT_CLOSING | DOORSTATEBIT_OPENING), /*goto*/ 0x2c)
if_door_state(0x46, (DOORSTATEBIT_OPEN | DOORSTATEBIT_CLOSING | DOORSTATEBIT_OPENING), /*goto*/ 0x2c)
endloop(0x04)
// Unlock those doors
@@ -2907,10 +2907,10 @@ u8 func1026_unlock_doors[] = {
// New set of doors - wait until not closed
beginloop(0x08)
if_door_state(0x34, (DOORSTATE_OPEN | DOORSTATE_CLOSING | DOORSTATE_OPENING), /*goto*/ 0x2c)
if_door_state(0x35, (DOORSTATE_OPEN | DOORSTATE_CLOSING | DOORSTATE_OPENING), /*goto*/ 0x2c)
if_door_state(0x36, (DOORSTATE_OPEN | DOORSTATE_CLOSING | DOORSTATE_OPENING), /*goto*/ 0x2c)
if_door_state(0x37, (DOORSTATE_OPEN | DOORSTATE_CLOSING | DOORSTATE_OPENING), /*goto*/ 0x2c)
if_door_state(0x34, (DOORSTATEBIT_OPEN | DOORSTATEBIT_CLOSING | DOORSTATEBIT_OPENING), /*goto*/ 0x2c)
if_door_state(0x35, (DOORSTATEBIT_OPEN | DOORSTATEBIT_CLOSING | DOORSTATEBIT_OPENING), /*goto*/ 0x2c)
if_door_state(0x36, (DOORSTATEBIT_OPEN | DOORSTATEBIT_CLOSING | DOORSTATEBIT_OPENING), /*goto*/ 0x2c)
if_door_state(0x37, (DOORSTATEBIT_OPEN | DOORSTATEBIT_CLOSING | DOORSTATEBIT_OPENING), /*goto*/ 0x2c)
endloop(0x08)
// Unlock them
@@ -2922,8 +2922,8 @@ u8 func1026_unlock_doors[] = {
// Third set of doors
beginloop(0x09)
if_door_state(0x3f, (DOORSTATE_OPEN | DOORSTATE_CLOSING | DOORSTATE_OPENING), /*goto*/ 0x2c)
if_door_state(0x40, (DOORSTATE_OPEN | DOORSTATE_CLOSING | DOORSTATE_OPENING), /*goto*/ 0x2c)
if_door_state(0x3f, (DOORSTATEBIT_OPEN | DOORSTATEBIT_CLOSING | DOORSTATEBIT_OPENING), /*goto*/ 0x2c)
if_door_state(0x40, (DOORSTATEBIT_OPEN | DOORSTATEBIT_CLOSING | DOORSTATEBIT_OPENING), /*goto*/ 0x2c)
endloop(0x09)
label(0x2c)
@@ -3027,7 +3027,7 @@ u8 func1029_set_secret_weapon_props[] = {
u8 func102a_8174[] = {
// Wait until some door opening
beginloop(0x08)
if_door_state(0x3f, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x2c)
if_door_state(0x3f, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x2c)
endloop(0x08)
label(0x2c)
@@ -3045,7 +3045,7 @@ u8 func102a_8174[] = {
u8 func102b_81bc[] = {
// Wait until some door opening
beginloop(0x08)
if_door_state(0x3f, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x2c)
if_door_state(0x3f, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x2c)
endloop(0x08)
label(0x2c)
+21 -21
View File
@@ -862,9 +862,9 @@ u8 func1002_devicetraining_camspy[] = {
beginloop(0x82)
if_stage_flag_eq(STAGEFLAG_DEVICE_ABORTING, TRUE, /*goto*/ 0x90)
if_door_state(0x31, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x85)
if_door_state(0x8a, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x85)
if_door_state(0x89, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x85)
if_door_state(0x31, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x85)
if_door_state(0x8a, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x85)
if_door_state(0x89, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x85)
if_training_pc_holographed(/*goto*/ 0x09)
endloop(0x82)
@@ -1110,9 +1110,9 @@ u8 func1004_devicetraining_doordecoder[] = {
beginloop(0x82)
if_stage_flag_eq(STAGEFLAG_DEVICE_ABORTING, TRUE, /*goto*/ 0x90)
if_door_state(0x31, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x85)
if_door_state(0x8a, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x85)
if_door_state(0x89, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x85)
if_door_state(0x31, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x85)
if_door_state(0x8a, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x85)
if_door_state(0x89, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x85)
if_chr_activated_object(CHR_JOANNA, 0x35, /*goto*/ 0x09)
endloop(0x82)
@@ -1493,9 +1493,9 @@ u8 func1006_devicetraining_disguise[] = {
beginloop(0x82)
if_stage_flag_eq(STAGEFLAG_DEVICE_ABORTING, TRUE, /*goto*/ 0x90)
if_door_state(0x31, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x85)
if_door_state(0x8a, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x85)
if_door_state(0x89, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x85)
if_door_state(0x31, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x85)
if_door_state(0x8a, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x85)
if_door_state(0x89, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x85)
if_stage_flag_eq(STAGEFLAG_DISGUISE_COMPLETE, TRUE, /*goto*/ 0x09)
if_stage_flag_eq(STAGEFLAG_DISGUISE_FAILED, TRUE, /*goto*/ 0x0a)
endloop(0x82)
@@ -1652,9 +1652,9 @@ u8 func1007_devicetrainign_ir[] = {
unset_object_flag_bank0(0x37, OBJECTFLAG0_02000000)
label(0x30)
if_stage_flag_eq(STAGEFLAG_DEVICE_ABORTING, TRUE, /*goto*/ 0x90)
if_door_state(0x31, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x85)
if_door_state(0x8a, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x85)
if_door_state(0x89, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x85)
if_door_state(0x31, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x85)
if_door_state(0x8a, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x85)
if_door_state(0x89, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x85)
if_chr_activated_object(CHR_JOANNA, 0x37, /*goto*/ 0x09)
endloop(0x82)
@@ -1777,9 +1777,9 @@ u8 func1008_devicetraining_rtracker[] = {
beginloop(0x82)
if_stage_flag_eq(STAGEFLAG_DEVICE_ABORTING, TRUE, /*goto*/ 0x90)
if_door_state(0x31, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x85)
if_door_state(0x8a, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x85)
if_door_state(0x89, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x85)
if_door_state(0x31, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x85)
if_door_state(0x8a, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x85)
if_door_state(0x89, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x85)
if_chr_has_object(CHR_JOANNA, 0x36, /*goto*/ 0x09)
endloop(0x82)
@@ -1908,9 +1908,9 @@ u8 func1009_devicetraining_cloak[] = {
beginloop(0x82)
if_stage_flag_eq(STAGEFLAG_DEVICE_ABORTING, TRUE, /*goto*/ 0x90)
if_door_state(0x31, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x85)
if_door_state(0x8a, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x85)
if_door_state(0x89, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x85)
if_door_state(0x31, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x85)
if_door_state(0x8a, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x85)
if_door_state(0x89, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x85)
if_stage_flag_eq(STAGEFLAG_CLOAK_COMPLETE, TRUE, /*goto*/ 0x09)
if_stage_flag_eq(STAGEFLAG_CLOAK_FAILED, TRUE, /*goto*/ 0x0a)
endloop(0x82)
@@ -2778,7 +2778,7 @@ u8 func100e_training_unlockables[] = {
reloop(0x04) \
\
label(0x06) \
if_door_state(door, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x2f) \
if_door_state(door, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x2f) \
open_door(door) \
set_object_flag_bank0(door, OBJECTFLAG0_40000000) \
restart_timer \
@@ -2830,7 +2830,7 @@ u8 func1012_cloak_doorproxy[] = {
endloop(0x04)
label(0x06)
if_door_state(0x40, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x2f)
if_door_state(0x40, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x2f)
open_door(0x40)
set_object_flag_bank0(0x40, OBJECTFLAG0_40000000)
restart_timer
@@ -2858,7 +2858,7 @@ u8 func101b_ir_door[] = {
endloop(0x04)
label(0x06)
if_door_state(0x37, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x2f)
if_door_state(0x37, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x2f)
open_door(0x37)
set_object_flag_bank0(0x37, OBJECTFLAG0_40000000)
restart_timer
+2 -2
View File
@@ -2608,7 +2608,7 @@ u8 func100f_check_for_end_level[] = {
reloop(0x04)
label(0x2f)
if_door_state(0x26, (DOORSTATE_OPEN | DOORSTATE_CLOSING | DOORSTATE_OPENING), /*goto*/ 0x06)
if_door_state(0x26, (DOORSTATEBIT_OPEN | DOORSTATEBIT_CLOSING | DOORSTATEBIT_OPENING), /*goto*/ 0x06)
reloop(0x04)
label(0x06)
@@ -3128,7 +3128,7 @@ u8 func101f_check_bot_destroyed[] = {
// 0x32 is a laser
beginloop(0x08)
if_door_state(0x32, DOORSTATE_CLOSED, /*goto*/ 0x2f)
if_door_state(0x32, DOORSTATEBIT_CLOSED, /*goto*/ 0x2f)
endloop(0x08)
label(0x2f)
+2 -2
View File
@@ -2291,8 +2291,8 @@ u8 func100e_check_objectives_complete[] = {
// mess with Carrington.
beginloop(0x04)
consider_coop_for_p1p2_chr(CHR_SELF)
if_door_state(0x09, DOORSTATE_OPEN, /*goto*/ 0x2d)
if_door_state(0x08, DOORSTATE_OPEN, /*goto*/ 0x2d)
if_door_state(0x09, DOORSTATEBIT_OPEN, /*goto*/ 0x2d)
if_door_state(0x08, DOORSTATEBIT_OPEN, /*goto*/ 0x2d)
endloop(0x04)
label(0x2d)
+6 -6
View File
@@ -1675,7 +1675,7 @@ u8 func100e_setup_firingrange[] = {
beginloop(0x0a)
consider_coop_for_p1p2_chr(CHR_SELF)
if_chr_in_room(CHR_P1P2, 0x00, 0x0007, /*goto*/ 0x08)
if_door_state(0x23, (DOORSTATE_OPEN | DOORSTATE_CLOSING | DOORSTATE_OPENING), /*goto*/ 0x2f)
if_door_state(0x23, (DOORSTATEBIT_OPEN | DOORSTATEBIT_CLOSING | DOORSTATEBIT_OPENING), /*goto*/ 0x2f)
endloop(0x0a)
// Wait for player to enter room, or 10 seconds
@@ -1729,8 +1729,8 @@ u8 func041a_hostage_holo[] = {
// Alive - wait until holo room door opened
beginloop(0x04)
consider_coop_for_p1p2_chr(CHR_SELF)
if_door_state(0x43, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x2e)
if_door_state(0x44, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x2e)
if_door_state(0x43, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x2e)
if_door_state(0x44, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x2e)
endloop(0x04)
label(0x2e)
@@ -2458,7 +2458,7 @@ u8 func0433_inforoom_hostage[] = {
u8 func1012_info_room[] = {
beginloop(0x04)
if_door_state(0x19, DOORSTATE_OPEN, /*goto*/ 0x2e)
if_door_state(0x19, DOORSTATEBIT_OPEN, /*goto*/ 0x2e)
endloop(0x04)
// One hostage is randomly given chrflag0_00000004, which allows that
@@ -3680,8 +3680,8 @@ u8 func1025_lift_door_sounds[] = {
u8 func100e_setup_firingrange_doors[] = {
// Wait until firing range doors opened
beginloop(0xe4)
if_door_state(0x23, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x2e)
if_door_state(0x23, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x2e)
if_door_state(0x23, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x2e)
if_door_state(0x23, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x2e)
endloop(0xe4)
// Unset some flags on them
+4 -4
View File
@@ -1300,8 +1300,8 @@ u8 func1008_hangar_lifts[] = {
consider_coop_for_p1p2_chr(CHR_SELF)
if_chr_death_animation_finished(CHR_JOANNA, /*goto*/ 0x2c)
if_chr_in_room(CHR_JOANNA, 0x00, 0x0018, /*goto*/ 0x2c)
if_door_state(0x39, (DOORSTATE_CLOSED | DOORSTATE_CLOSING), /*goto*/ 0x2d)
if_door_state(0x3a, (DOORSTATE_CLOSED | DOORSTATE_CLOSING), /*goto*/ 0x2d)
if_door_state(0x39, (DOORSTATEBIT_CLOSED | DOORSTATEBIT_CLOSING), /*goto*/ 0x2d)
if_door_state(0x3a, (DOORSTATEBIT_CLOSED | DOORSTATEBIT_CLOSING), /*goto*/ 0x2d)
endloop(0x67)
// Door closing automatically - reopen it
@@ -1579,7 +1579,7 @@ u8 func0408_knifeable_skedar[] = {
u8 func1009_keep_door_open_in_intro[] = {
beginloop(0xc2)
if_stage_flag_eq(STAGEFLAG_INTRO_FINISHED, TRUE, /*goto*/ 0x06)
if_door_state(0x17, (DOORSTATE_CLOSED | DOORSTATE_CLOSING), /*goto*/ 0x2c)
if_door_state(0x17, (DOORSTATEBIT_CLOSED | DOORSTATEBIT_CLOSING), /*goto*/ 0x2c)
reloop(0xc2)
// Door closed
@@ -1593,7 +1593,7 @@ u8 func1009_keep_door_open_in_intro[] = {
yield
beginloop(0x04)
if_door_state(0x17, DOORSTATE_CLOSING, /*goto*/ 0x06)
if_door_state(0x17, DOORSTATEBIT_CLOSING, /*goto*/ 0x06)
endloop(0x04)
label(0x06)
+6 -6
View File
@@ -1620,7 +1620,7 @@ u8 func100a_random_doors[] = {
// 25% chance //1
label(0x08)
if_door_state(0x07, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x09)
if_door_state(0x07, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x09)
open_door(0x07)
open_door(0x08)
reloop(0x03)
@@ -1632,7 +1632,7 @@ u8 func100a_random_doors[] = {
// 25% chance //2
label(0x0a)
if_door_state(0x09, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x0b)
if_door_state(0x09, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x0b)
open_door(0x09)
open_door(0x0a)
reloop(0x03)
@@ -1644,7 +1644,7 @@ u8 func100a_random_doors[] = {
// 25% chance //3
label(0x0c)
if_door_state(0x0b, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x0d)
if_door_state(0x0b, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x0d)
open_door(0x0b)
open_door(0x0c)
reloop(0x03)
@@ -1656,7 +1656,7 @@ u8 func100a_random_doors[] = {
// 25% chance //4
label(0x0e)
if_door_state(0x0d, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x0f)
if_door_state(0x0d, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x0f)
open_door(0x0d)
open_door(0x0e)
reloop(0x03)
@@ -1827,7 +1827,7 @@ u8 func0418_doorman[] = {
goto_next(0x06)
label(0x2d)
if_door_state(0x4a, (DOORSTATE_CLOSED | DOORSTATE_CLOSING), /*goto*/ 0x2d)
if_door_state(0x4a, (DOORSTATEBIT_CLOSED | DOORSTATEBIT_CLOSING), /*goto*/ 0x2d)
reloop(0x0f)
label(0x2d)
@@ -2122,7 +2122,7 @@ u8 func100d_check_entered_lab[] = {
u8 func100e_elvis_timer[] = {
beginloop(0x04)
if_door_state(0x13, (DOORSTATE_OPEN | DOORSTATE_CLOSING | DOORSTATE_OPENING), /*goto*/ 0x06)
if_door_state(0x13, (DOORSTATEBIT_OPEN | DOORSTATEBIT_CLOSING | DOORSTATEBIT_OPENING), /*goto*/ 0x06)
endloop(0x04)
label(0x06)
+5 -5
View File
@@ -965,7 +965,7 @@ u8 func140e_check_interceptors_destroyed[] = {
u8 func100c_maingate_switch[] = {
beginloop(0x04)
consider_coop_for_p1p2_chr(CHR_SELF)
if_door_state(OBJ_MAINGATE1, DOORSTATE_CLOSING, /*goto*/ 0x2e)
if_door_state(OBJ_MAINGATE1, DOORSTATEBIT_CLOSING, /*goto*/ 0x2e)
goto_next(0x06)
label(0x2e)
@@ -978,7 +978,7 @@ u8 func100c_maingate_switch[] = {
assign_sound(0x043f, CHANNEL_7)
play_sound_from_entity(CHANNEL_7, OBJ_MAINGATE_SWITCH, 0x012c, 0x0190, 0x00)
set_object_image(OBJ_MAINGATE_SWITCH, 0x00, 0x13)
if_door_state(OBJ_MAINGATE1, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x2e)
if_door_state(OBJ_MAINGATE1, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x2e)
message(CHR_P1P2, 0x2c2b) // "Main gate has been opened."
open_door(OBJ_MAINGATE1)
open_door(OBJ_MAINGATE2)
@@ -1243,8 +1243,8 @@ u8 func1007_check_hangar_accessed[] = {
u8 func1008_check_end_level[] = {
beginloop(0x04)
if_door_state(0x11, (DOORSTATE_OPEN | DOORSTATE_CLOSING | DOORSTATE_OPENING), /*goto*/ 0x09)
if_door_state(0x12, (DOORSTATE_OPEN | DOORSTATE_CLOSING | DOORSTATE_OPENING), /*goto*/ 0x09)
if_door_state(0x11, (DOORSTATEBIT_OPEN | DOORSTATEBIT_CLOSING | DOORSTATEBIT_OPENING), /*goto*/ 0x09)
if_door_state(0x12, (DOORSTATEBIT_OPEN | DOORSTATEBIT_CLOSING | DOORSTATEBIT_OPENING), /*goto*/ 0x09)
endloop(0x04)
beginloop(0x09)
@@ -2340,7 +2340,7 @@ u8 func1013_bunker_lasers[] = {
beginloop(0x04)
if_stage_flag_eq(STAGEFLAG_EXPLOSIVES_PLACED, TRUE, /*goto*/ 0x09)
if_stage_flag_eq(STAGEFLAG_ANY_LASER_DESTROYED, TRUE, /*goto*/ 0x09)
if_door_state(0x1e, (DOORSTATE_CLOSED | DOORSTATE_CLOSING), /*goto*/ 0x06)
if_door_state(0x1e, (DOORSTATEBIT_CLOSED | DOORSTATEBIT_CLOSING), /*goto*/ 0x06)
endloop(0x04)
label(0x06)
+14 -14
View File
@@ -1421,7 +1421,7 @@ u8 func0403_elvis_give_farsight[] = {
u8 func1003_powernode1[] = {
beginloop(0x04)
if_object_in_good_condition(OBJ_POWERNODE1, /*goto*/ 0x2e)
if_door_state(0x03, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x2e)
if_door_state(0x03, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x2e)
open_door(0x03)
endloop(0x04)
@@ -1441,7 +1441,7 @@ u8 func1003_powernode1[] = {
u8 func1004_powernode2[] = {
beginloop(0x04)
if_object_in_good_condition(OBJ_POWERNODE2, /*goto*/ 0x2e)
if_door_state(0x04, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x2e)
if_door_state(0x04, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x2e)
open_door(0x04)
endloop(0x04)
@@ -1461,7 +1461,7 @@ u8 func1004_powernode2[] = {
u8 func1005_powernode3[] = {
beginloop(0x04)
if_object_in_good_condition(OBJ_POWERNODE3, /*goto*/ 0x2e)
if_door_state(0x05, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x2e)
if_door_state(0x05, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x2e)
open_door(0x05)
endloop(0x04)
@@ -2285,7 +2285,7 @@ u8 func1008_msg_theresdrcaroll[] = {
if_chr_dying(CHR_DRCAROLL, /*goto*/ 0x0d)
if_chr_unloaded(CHR_DRCAROLL, /*goto*/ 0x0d)
if_door_state(0xae, (DOORSTATE_OPEN | DOORSTATE_CLOSING | DOORSTATE_OPENING), /*goto*/ 0x2e)
if_door_state(0xae, (DOORSTATEBIT_OPEN | DOORSTATEBIT_CLOSING | DOORSTATEBIT_OPENING), /*goto*/ 0x2e)
reloop(0x04)
label(0x2e)
@@ -3723,7 +3723,7 @@ u8 func0408_check_pa_earlydoorcylinders_destroyed[] = {
set_function(CHR_SELF, GFUNC_IDLE)
beginloop(0x08)
if_door_state(0x09, (DOORSTATE_CLOSED | DOORSTATE_CLOSING), /*goto*/ 0x06)
if_door_state(0x09, (DOORSTATEBIT_CLOSED | DOORSTATEBIT_CLOSING), /*goto*/ 0x06)
endloop(0x08)
label(0x06)
@@ -3804,7 +3804,7 @@ u8 func1018_pa_door1[] = {
set_lights_state(0x00a1, 0x03, 0xff, 0x0a, 0x78)
beginloop(0x08)
if_door_state(0x0b, (DOORSTATE_CLOSED | DOORSTATE_CLOSING), /*goto*/ 0x06)
if_door_state(0x0b, (DOORSTATEBIT_CLOSED | DOORSTATEBIT_CLOSING), /*goto*/ 0x06)
reloop(0x08)
label(0x06)
@@ -3835,7 +3835,7 @@ u8 func0409_check_pa_latedoorcylinders_destroyed[] = {
set_function(CHR_SELF, GFUNC_IDLE)
beginloop(0x08)
if_door_state(0x0d, (DOORSTATE_CLOSED | DOORSTATE_CLOSING), /*goto*/ 0x06)
if_door_state(0x0d, (DOORSTATEBIT_CLOSED | DOORSTATEBIT_CLOSING), /*goto*/ 0x06)
endloop(0x08)
label(0x06)
@@ -3970,7 +3970,7 @@ u8 func040a_check_pa_canisters_destroyed[] = {
set_lights_state(0x00bc, 0x03, 0xff, 0x0a, 0x78)
beginloop(0x08)
if_door_state(0x0f, (DOORSTATE_CLOSED | DOORSTATE_CLOSING), /*goto*/ 0x06)
if_door_state(0x0f, (DOORSTATEBIT_CLOSED | DOORSTATEBIT_CLOSING), /*goto*/ 0x06)
endloop(0x08)
label(0x06)
@@ -3991,7 +3991,7 @@ u8 func040a_check_pa_canisters_destroyed[] = {
u8 func101f_pa_circleroom_spawner[] = {
beginloop(0x04)
consider_coop_for_p1p2_chr(CHR_SELF)
if_door_state(0x09, (DOORSTATE_OPEN | DOORSTATE_CLOSING | DOORSTATE_OPENING), /*goto*/ 0x2e)
if_door_state(0x09, (DOORSTATEBIT_OPEN | DOORSTATEBIT_CLOSING | DOORSTATEBIT_OPENING), /*goto*/ 0x2e)
if_chr_in_room(CHR_P1P2, 0x00, 0x008b, /*goto*/ 0x2e)
endloop(0x04)
@@ -3999,7 +3999,7 @@ u8 func101f_pa_circleroom_spawner[] = {
restart_timer
beginloop(0x0d)
if_door_state(0x09, (DOORSTATE_OPEN | DOORSTATE_CLOSING | DOORSTATE_OPENING), /*goto*/ 0x1f)
if_door_state(0x09, (DOORSTATEBIT_OPEN | DOORSTATEBIT_CLOSING | DOORSTATEBIT_OPENING), /*goto*/ 0x1f)
if_timer_gt(300, /*goto*/ 0x1f)
endloop(0x0d)
@@ -4379,21 +4379,21 @@ u8 func042e_elvis_run_to_exit[] = {
u8 func1027_powernode_illumination[] = {
beginloop(0x04)
if_door_state(0x03, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x2e)
if_door_state(0x03, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x2e)
unset_object_flag_bank0(OBJ_POWERNODE1, OBJECTFLAG0_ILLUMINATED)
goto_next(0x06)
label(0x2e)
set_object_flag_bank0(OBJ_POWERNODE1, OBJECTFLAG0_ILLUMINATED)
label(0x06)
if_door_state(0x04, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x2e)
if_door_state(0x04, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x2e)
unset_object_flag_bank0(OBJ_POWERNODE2, OBJECTFLAG0_ILLUMINATED)
goto_next(0x06)
label(0x2e)
set_object_flag_bank0(OBJ_POWERNODE2, OBJECTFLAG0_ILLUMINATED)
label(0x06)
if_door_state(0x05, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x2e)
if_door_state(0x05, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x2e)
unset_object_flag_bank0(OBJ_POWERNODE3, OBJECTFLAG0_ILLUMINATED)
goto_next(0x06)
label(0x2e)
@@ -4414,7 +4414,7 @@ u8 func1028_enable_last_3_guards[] = {
reloop(0x04)
label(0x2e)
if_door_state(0xab, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x2e)
if_door_state(0xab, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x2e)
endloop(0x04)
label(0x2e)
+2 -2
View File
@@ -2872,7 +2872,7 @@ u8 func1017_drain_guards[] = {
u8 func1018_keep_door_open[] = {
beginloop(0x10)
if_door_state(0x1a, (DOORSTATE_CLOSED | DOORSTATE_CLOSING), /*goto*/ 0x03)
if_door_state(0x1a, (DOORSTATEBIT_CLOSED | DOORSTATEBIT_CLOSING), /*goto*/ 0x03)
reloop(0x10)
label(0x03)
@@ -3053,7 +3053,7 @@ u8 func101e_check_sealer_guards_dead[] = {
u8 func1020_elevator_doors[] = {
beginloop(0x10)
if_stage_flag_eq(STAGEFLAG_ELEVATOR_SEALED, TRUE, /*goto*/ 0x03)
if_door_state(0x10, (DOORSTATE_CLOSED | DOORSTATE_CLOSING), /*goto*/ 0x04)
if_door_state(0x10, (DOORSTATEBIT_CLOSED | DOORSTATEBIT_CLOSING), /*goto*/ 0x04)
reloop(0x10)
label(0x04)
+3 -3
View File
@@ -1746,7 +1746,7 @@ u8 func0413_taker[] = {
// Wait for condition
beginloop(0x04)
if_door_state(0x0c, (DOORSTATE_OPEN | DOORSTATE_CLOSING | DOORSTATE_OPENING), /*goto*/ 0x0a)
if_door_state(0x0c, (DOORSTATEBIT_OPEN | DOORSTATEBIT_CLOSING | DOORSTATEBIT_OPENING), /*goto*/ 0x0a)
if_stage_flag_eq(STAGEFLAG_PRESIDENT_STARTED_RUNNING, FALSE, /*goto*/ 0x2d)
if_timer_gt(7200, /*goto*/ 0x0a)
if_alertness(99, OPERATOR_GREATER_THAN, /*goto*/ 0x0a)
@@ -3660,7 +3660,7 @@ u8 func101a_equipment_switch[] = {
set_object_image(OBJ_EQUIPMENT_SWITCH, 0x00, 0x12)
beginloop(0x09)
if_door_state(0x1c, DOORSTATE_CLOSING, /*goto*/ 0x2d)
if_door_state(0x1c, DOORSTATEBIT_CLOSING, /*goto*/ 0x2d)
reloop(0x09)
label(0x2d)
@@ -3679,7 +3679,7 @@ u8 func101b_hoverbike_switch[] = {
beginloop(0x09)
consider_coop_for_p1p2_chr(CHR_SELF)
if_door_state(0x20, DOORSTATE_CLOSING, /*goto*/ 0x2d)
if_door_state(0x20, DOORSTATEBIT_CLOSING, /*goto*/ 0x2d)
if_chr_activated_object(CHR_P1P2, OBJ_HOVERBIKE_SWITCH, /*goto*/ 0x0a)
reloop(0x09)
+10 -10
View File
@@ -2095,13 +2095,13 @@ u8 func100d_check_terminals_destroyed[] = {
beginloop(0x04)
if_stage_flag_eq(STAGEFLAG_INNER_DOOR_OPENING, TRUE, /*goto*/ 0x06)
if_object_in_good_condition(OBJ_TERMINAL1, /*goto*/ 0x06)
if_door_state(0x2c, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x06)
if_door_state(0x2c, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x06)
goto_next(0x08)
label(0x06)
if_stage_flag_eq(STAGEFLAG_OUTER_DOOR_OPENING, TRUE, /*goto*/ 0x06)
if_object_in_good_condition(OBJ_TERMINAL2, /*goto*/ 0x06)
if_door_state(0x2e, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x06)
if_door_state(0x2e, (DOORSTATEBIT_OPEN | DOORSTATEBIT_OPENING), /*goto*/ 0x06)
goto_first(0x08)
label(0x06)
@@ -2236,7 +2236,7 @@ u8 func1012_hoverbike_auto_doors[] = {
// Pad/door 1
label(0x08)
if_door_state(0x0a, (DOORSTATE_CLOSED | DOORSTATE_CLOSING), /*goto*/ 0x06)
if_door_state(0x0a, (DOORSTATEBIT_CLOSED | DOORSTATEBIT_CLOSING), /*goto*/ 0x06)
reloop(0x04)
label(0x06)
@@ -2246,7 +2246,7 @@ u8 func1012_hoverbike_auto_doors[] = {
// Pad/door 2
label(0x09)
if_door_state(0x0b, (DOORSTATE_CLOSED | DOORSTATE_CLOSING), /*goto*/ 0x06)
if_door_state(0x0b, (DOORSTATEBIT_CLOSED | DOORSTATEBIT_CLOSING), /*goto*/ 0x06)
reloop(0x04)
label(0x06)
@@ -2256,7 +2256,7 @@ u8 func1012_hoverbike_auto_doors[] = {
// Pad/door 3
label(0x0a)
if_door_state(0x08, (DOORSTATE_CLOSED | DOORSTATE_CLOSING), /*goto*/ 0x06)
if_door_state(0x08, (DOORSTATEBIT_CLOSED | DOORSTATEBIT_CLOSING), /*goto*/ 0x06)
reloop(0x04)
label(0x06)
@@ -2268,7 +2268,7 @@ u8 func1012_hoverbike_auto_doors[] = {
// Pad/door 4
label(0x0c)
if_door_state(0x0c, (DOORSTATE_CLOSED | DOORSTATE_CLOSING), /*goto*/ 0x06)
if_door_state(0x0c, (DOORSTATEBIT_CLOSED | DOORSTATEBIT_CLOSING), /*goto*/ 0x06)
reloop(0x04)
label(0x06)
@@ -2278,7 +2278,7 @@ u8 func1012_hoverbike_auto_doors[] = {
// Pad/door 5
label(0x0d)
if_door_state(0x05, (DOORSTATE_CLOSED | DOORSTATE_CLOSING), /*goto*/ 0x06)
if_door_state(0x05, (DOORSTATEBIT_CLOSED | DOORSTATEBIT_CLOSING), /*goto*/ 0x06)
reloop(0x04)
label(0x06)
@@ -3535,14 +3535,14 @@ u8 func102e_keep_hangar_doors_open[] = {
beginloop(0x04)
if_stage_flag_eq(STAGEFLAG_HANGAR_TERMINAL_DESTROYED, TRUE, /*goto*/ 0x0f)
if_door_state(0x2c, DOORSTATE_CLOSING, /*goto*/ 0x08)
if_door_state(0x2e, DOORSTATE_CLOSING, /*goto*/ 0x09)
if_door_state(0x2c, DOORSTATEBIT_CLOSING, /*goto*/ 0x08)
if_door_state(0x2e, DOORSTATEBIT_CLOSING, /*goto*/ 0x09)
reloop(0x04)
// Door 1 closing
label(0x08)
if_stage_flag_eq(STAGEFLAG_INNER_DOOR_OPENING, TRUE, /*goto*/ 0x32)
if_door_state(0x2c, (DOORSTATE_CLOSED | DOORSTATE_CLOSING), /*goto*/ 0x09)
if_door_state(0x2c, (DOORSTATEBIT_CLOSED | DOORSTATEBIT_CLOSING), /*goto*/ 0x09)
reloop(0x04)
label(0x32)
+1 -1
View File
@@ -1725,7 +1725,7 @@ u8 func1008_check_bomb_unplantable[] = {
beginloop(0xb1)
if_stage_flag_eq(STAGEFLAG_BOMB_PLANTED, TRUE, /*goto*/ 0x0d)
if_door_state(0x2e, DOORSTATE_CLOSED, /*goto*/ 0xb2)
if_door_state(0x2e, DOORSTATEBIT_CLOSED, /*goto*/ 0xb2)
reloop(0xb1)
// Door is closed
+32 -83
View File
@@ -3999,7 +3999,7 @@ bool aiOpenDoor(void)
if (door && door->pos && door->pos->unk00 == 2) {
if (!func0f066310(door->pos, 0)) {
func0f08e488(door, DOORSTATE_CLOSED);
func0f08e488(door, DOORSTATE_OPEN);
}
}
@@ -4017,7 +4017,7 @@ bool aiCloseDoor(void)
struct defaultobj *door = objFindByTagId(cmd[2]);
if (door && door->pos && door->pos->unk00 == 2) {
func0f08e488(door, DOORSTATE_OPEN);
func0f08e488(door, DOORSTATE_CLOSED);
}
g_Vars.aioffset += 3;
@@ -4028,87 +4028,36 @@ bool aiCloseDoor(void)
/**
* @cmd 006e
*/
GLOBAL_ASM(
glabel ai006e
/* f0522a4: 3c08800a */ lui $t0,0x800a
/* f0522a8: 25089fc0 */ addiu $t0,$t0,-24640
/* f0522ac: 8d0e0434 */ lw $t6,0x434($t0)
/* f0522b0: 8d0f0438 */ lw $t7,0x438($t0)
/* f0522b4: 27bdffe0 */ addiu $sp,$sp,-32
/* f0522b8: afbf0014 */ sw $ra,0x14($sp)
/* f0522bc: 01cf3821 */ addu $a3,$t6,$t7
/* f0522c0: 90e40002 */ lbu $a0,0x2($a3)
/* f0522c4: 0fc2556c */ jal objFindByTagId
/* f0522c8: afa7001c */ sw $a3,0x1c($sp)
/* f0522cc: 3c08800a */ lui $t0,0x800a
/* f0522d0: 25089fc0 */ addiu $t0,$t0,-24640
/* f0522d4: 8fa7001c */ lw $a3,0x1c($sp)
/* f0522d8: 10400027 */ beqz $v0,.L0f052378
/* f0522dc: 00002025 */ or $a0,$zero,$zero
/* f0522e0: 8c580014 */ lw $t8,0x14($v0)
/* f0522e4: 13000024 */ beqz $t8,.L0f052378
/* f0522e8: 00000000 */ sll $zero,$zero,0x0
/* f0522ec: 90590003 */ lbu $t9,0x3($v0)
/* f0522f0: 24050001 */ addiu $a1,$zero,0x1
/* f0522f4: 14b90020 */ bne $a1,$t9,.L0f052378
/* f0522f8: 00000000 */ sll $zero,$zero,0x0
/* f0522fc: 80430084 */ lb $v1,0x84($v0)
/* f052300: 1460000f */ bnez $v1,.L0f052340
/* f052304: 00000000 */ sll $zero,$zero,0x0
/* f052308: 44802000 */ mtc1 $zero,$f4
/* f05230c: c446007c */ lwc1 $f6,0x7c($v0)
/* f052310: 4604303e */ c.le.s $f6,$f4
/* f052314: 00000000 */ sll $zero,$zero,0x0
/* f052318: 45020006 */ bc1fl .L0f052334
/* f05231c: 90e40003 */ lbu $a0,0x3($a3)
/* f052320: 90e40003 */ lbu $a0,0x3($a3)
/* f052324: 30890001 */ andi $t1,$a0,0x1
/* f052328: 10000013 */ beqz $zero,.L0f052378
/* f05232c: 0009202b */ sltu $a0,$zero,$t1
/* f052330: 90e40003 */ lbu $a0,0x3($a3)
.L0f052334:
/* f052334: 308b0002 */ andi $t3,$a0,0x2
/* f052338: 1000000f */ beqz $zero,.L0f052378
/* f05233c: 000b202b */ sltu $a0,$zero,$t3
.L0f052340:
/* f052340: 10a30003 */ beq $a1,$v1,.L0f052350
/* f052344: 24010003 */ addiu $at,$zero,0x3
/* f052348: 54610006 */ bnel $v1,$at,.L0f052364
/* f05234c: 24010002 */ addiu $at,$zero,0x2
.L0f052350:
/* f052350: 90e40003 */ lbu $a0,0x3($a3)
/* f052354: 308d0008 */ andi $t5,$a0,0x8
/* f052358: 10000007 */ beqz $zero,.L0f052378
/* f05235c: 000d202b */ sltu $a0,$zero,$t5
/* f052360: 24010002 */ addiu $at,$zero,0x2
.L0f052364:
/* f052364: 14610004 */ bne $v1,$at,.L0f052378
/* f052368: 00000000 */ sll $zero,$zero,0x0
/* f05236c: 90e40003 */ lbu $a0,0x3($a3)
/* f052370: 308f0004 */ andi $t7,$a0,0x4
/* f052374: 000f202b */ sltu $a0,$zero,$t7
.L0f052378:
/* f052378: 5080000a */ beqzl $a0,.L0f0523a4
/* f05237c: 8d190438 */ lw $t9,0x438($t0)
/* f052380: 8d040434 */ lw $a0,0x434($t0)
/* f052384: 8d050438 */ lw $a1,0x438($t0)
/* f052388: 0fc13583 */ jal chraiGoToLabel
/* f05238c: 90e60004 */ lbu $a2,0x4($a3)
/* f052390: 3c08800a */ lui $t0,0x800a
/* f052394: 25089fc0 */ addiu $t0,$t0,-24640
/* f052398: 10000004 */ beqz $zero,.L0f0523ac
/* f05239c: ad020438 */ sw $v0,0x438($t0)
/* f0523a0: 8d190438 */ lw $t9,0x438($t0)
.L0f0523a4:
/* f0523a4: 27290005 */ addiu $t1,$t9,0x5
/* f0523a8: ad090438 */ sw $t1,0x438($t0)
.L0f0523ac:
/* f0523ac: 8fbf0014 */ lw $ra,0x14($sp)
/* f0523b0: 27bd0020 */ addiu $sp,$sp,0x20
/* f0523b4: 00001025 */ or $v0,$zero,$zero
/* f0523b8: 03e00008 */ jr $ra
/* f0523bc: 00000000 */ sll $zero,$zero,0x0
);
bool aiIfDoorState(void)
{
u8 *cmd = g_Vars.ailist + g_Vars.aioffset;
struct defaultobj *obj = objFindByTagId(cmd[2]);
bool pass = false;
if (obj && obj->pos && obj->type == OBJTYPE_DOOR) {
struct doorobj *door = (struct doorobj *) obj;
if (door->state == 0) {
if (door->speed <= 0) {
pass = (cmd[3] & DOORSTATEBIT_CLOSED) != 0;
} else {
pass = (cmd[3] & DOORSTATEBIT_OPEN) != 0;
}
} else if (door->state == 1 || door->state == 3) {
pass = (cmd[3] & DOORSTATEBIT_OPENING) != 0;
} else if (door->state == 2) {
pass = (cmd[3] & DOORSTATEBIT_CLOSING) != 0;
}
}
if (pass) {
g_Vars.aioffset = chraiGoToLabel(g_Vars.ailist, g_Vars.aioffset, cmd[4]);
} else {
g_Vars.aioffset += 5;
}
return false;
}
/**
* @cmd 006f
+7 -4
View File
@@ -252,10 +252,13 @@
#define DIFFBIT_PA 0x04
#define DIFFBIT_PD 0x08
#define DOORSTATE_CLOSED 1
#define DOORSTATE_OPEN 2
#define DOORSTATE_CLOSING 4
#define DOORSTATE_OPENING 8
#define DOORSTATE_OPEN 1
#define DOORSTATE_CLOSED 2
#define DOORSTATEBIT_CLOSED 1
#define DOORSTATEBIT_OPEN 2
#define DOORSTATEBIT_CLOSING 4
#define DOORSTATEBIT_OPENING 8
#define EEPROMFLAG_CI_TOUR_DONE 0x24
#define EEPROMFLAG_CI_HOLO7_DONE 0x29
+1 -1
View File
@@ -112,7 +112,7 @@
/*0x006b*/ bool ai006b(void);
/*0x006c*/ bool aiOpenDoor(void);
/*0x006d*/ bool aiCloseDoor(void);
/*0x006e*/ bool ai006e(void);
/*0x006e*/ bool aiIfDoorState(void);
/*0x006f*/ bool aiIfObjectIsDoor(void);
/*0x0070*/ bool ai0070(void);
/*0x0071*/ bool ai0071(void);
+13
View File
@@ -270,6 +270,19 @@ struct defaultobj {
/*0x62*/ u16 aireturnlist;
};
struct doorobj {
struct defaultobj base;
/*0x64*/ u32 unk64;
/*0x68*/ u32 unk68;
/*0x6c*/ u32 unk6c;
/*0x70*/ u32 unk70;
/*0x74*/ u32 unk74;
/*0x78*/ u32 unk78;
/*0x7c*/ float speed;
/*0x80*/ u32 unk80;
/*0x84*/ s8 state;
};
struct tag {
// These three words are possibly the same values as defined in the setup
// file, but this just a guess.
+1 -1
View File
@@ -14063,7 +14063,7 @@ bool (*command_pointers[])(void) = {
/*0x006b*/ ai006b,
/*0x006c*/ aiOpenDoor,
/*0x006d*/ aiCloseDoor,
/*0x006e*/ ai006e,
/*0x006e*/ aiIfDoorState,
/*0x006f*/ aiIfObjectIsDoor,
/*0x0070*/ ai0070,
/*0x0071*/ ai0071,