From a00b6092f5bdfe0389cf6c4639a767cd5f170116 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Mon, 23 Sep 2019 18:15:49 +1000 Subject: [PATCH] Rename var_a to morale --- src/globals.c | 6 +++--- src/include/commands.h | 8 ++++---- src/setup/setupcave.c | 22 +++++++++++----------- src/setup/setupdepo.c | 20 ++++++++++---------- src/setup/setupdish.c | 24 ++++++++++++------------ src/setup/setupeld.c | 6 +++--- src/setup/setupimp.c | 14 +++++++------- src/setup/setuplee.c | 20 ++++++++++---------- src/setup/setuplip.c | 12 ++++++------ src/setup/setuplue.c | 6 +++--- src/setup/setupoat.c | 12 ++++++------ src/setup/setuprit.c | 6 +++--- src/setup/setupsho.c | 22 +++++++++++----------- src/setup/setupstat.c | 24 ++++++++++++------------ src/setup/setuptra.c | 24 ++++++++++++------------ src/setup/setupwax.c | 2 +- 16 files changed, 114 insertions(+), 114 deletions(-) diff --git a/src/globals.c b/src/globals.c index 084990873..67842d3c5 100644 --- a/src/globals.c +++ b/src/globals.c @@ -33597,7 +33597,7 @@ u8 func000f_hand_combat[] = { goto_first(0x0c) label(0x13) - add_var_a(1) + add_morale(1) if_chr_is_dead_maybe(CHR_SELF, /*goto*/ 0x17) goto_next(0x05) @@ -34392,7 +34392,7 @@ u8 func0014_coop_buddy[] = { dprint 'B','A','C','K',' ','T','O',' ','B','U','D','D','Y','\n',0, unset_self_flag_bank3(CHRFLAG3_00040000) set_self_flag_bankx(CHRFLAG1_00100000, BANK_1) - set_var_a(0) + set_morale(0) set_onshot_function(GFUNC_COOP_BUDDY) set_target_chr(CHR_JOANNA) if_chr_dying(CHR_SELF, /*goto*/ 0x13) @@ -34866,7 +34866,7 @@ u8 func0026_init_psychosis[] = { }; u8 func0027_psychosised[] = { - set_var_a(0) + set_morale(0) set_onshot_function(GFUNC_PSYCHOSISED) set_target_chr(FOLLOW_CHR) if_chr_dying(CHR_SELF, /*goto*/ 0x13) diff --git a/src/include/commands.h b/src/include/commands.h index 1cba697ae..3b02b0816 100644 --- a/src/include/commands.h +++ b/src/include/commands.h @@ -540,19 +540,19 @@ chr, \ label, -#define set_var_a(value) \ +#define set_morale(value) \ mkshort(0x0084), \ value, -#define add_var_a(value) \ +#define add_morale(value) \ mkshort(0x0085), \ value, -#define subtract_var_a(value) \ +#define subtract_morale(value) \ mkshort(0x0087), \ value, -#define if_var_a_lt(value, label) \ +#define if_morale_lt(value, label) \ mkshort(0x0088), \ value, \ label, diff --git a/src/setup/setupcave.c b/src/setup/setupcave.c index 5747ca84d..dd597a693 100644 --- a/src/setup/setupcave.c +++ b/src/setup/setupcave.c @@ -1484,7 +1484,7 @@ u8 func040c_init_secretary[] = { }; /** - * The secretary uses var_a to track things. + * The secretary uses morale to track things. * * 0 = Not done anything * 1 = Not used @@ -1494,7 +1494,7 @@ u8 func040c_init_secretary[] = { */ u8 func0408_secretary[] = { set_onshot_function(FUNC_SECRETARY) - set_var_a(0) + set_morale(0) if_chr_dying(CHR_SELF, /*goto*/ 0x02) if_chr_death_animation_finished(CHR_SELF, /*goto*/ 0x02) if_chr_unloaded(CHR_SELF, /*goto*/ 0x02) @@ -1572,7 +1572,7 @@ u8 func0408_secretary[] = { // Seen Jo while disguised label(0x07) - if_var_a_lt(2, /*goto*/ 0x32) + if_morale_lt(2, /*goto*/ 0x32) goto_next(0x02) // @@ -1582,7 +1582,7 @@ u8 func0408_secretary[] = { speak(TARGET_CHR, 0x0e1d, 0x8161, CHANNEL_4, COLOR_06_WHITE) // "Good afternoon." animation(ANIM_TALKING_0231, 0, 193, 0x1810, CHR_SELF, 2) restart_timer - set_var_a(2) + set_morale(2) beginloop(0x08) if_shot_near_chr(0x00, /*goto*/ LABEL_BECOME_ALERT2) @@ -1602,7 +1602,7 @@ u8 func0408_secretary[] = { if_chr_weapon_equipped(TARGET_CHR, WEAPON_UNARMED, /*goto*/ 0x0c) if_chr_weapon_equipped(TARGET_CHR, WEAPON_HORIZONSCANNER, /*goto*/ 0x0c) if_chr_weapon_equipped(TARGET_CHR, WEAPON_SUITCASE, /*goto*/ 0x0c) - if_var_a_lt(3, /*goto*/ 0x32) + if_morale_lt(3, /*goto*/ 0x32) goto_next(0x02) // @@ -1612,7 +1612,7 @@ u8 func0408_secretary[] = { speak(TARGET_CHR, 0x0e1f, 0x1273, CHANNEL_4, COLOR_06_WHITE) // "You'll have to check that weapon in here." restart_timer animation(ANIM_TALKING_0232, 0, 193, 0x1810, CHR_SELF, 2) - set_var_a(3) + set_morale(3) beginloop(0x09) if_shot_near_chr(0x00, /*goto*/ LABEL_BECOME_ALERT2) @@ -1630,14 +1630,14 @@ u8 func0408_secretary[] = { if_chr_weapon_equipped(TARGET_CHR, WEAPON_UNARMED, /*goto*/ 0x31) if_chr_weapon_equipped(TARGET_CHR, WEAPON_HORIZONSCANNER, /*goto*/ 0x31) if_chr_weapon_equipped(TARGET_CHR, WEAPON_SUITCASE, /*goto*/ 0x31) - if_var_a_lt(4, /*goto*/ 0x32) + if_morale_lt(4, /*goto*/ 0x32) goto_next(0x02) label(0x32) speak(TARGET_CHR, 0x0e21, 0x1274, CHANNEL_4, COLOR_06_WHITE) // "Weapons are not allowed in the base." restart_timer animation(ANIM_TALKING_0233, 0, 193, 0x1810, CHR_SELF, 2) - set_var_a(4) + set_morale(4) beginloop(0x0a) if_shot_near_chr(0x00, /*goto*/ LABEL_BECOME_ALERT2) @@ -2049,7 +2049,7 @@ u8 func0409_office1[] = { #define LABEL_RUN_TO_FOYER 0x4f set_self_flag_bank3(CHRFLAG3_00040000) - set_var_a(0) + set_morale(0) set_onshot_function(FUNC_OFFICE1) if_chr_dying(CHR_SELF, /*goto*/ 0x02) if_chr_death_animation_finished(CHR_SELF, /*goto*/ 0x02) @@ -2186,7 +2186,7 @@ u8 func040e_init_office2[] = { u8 func040a_office2[] = { set_self_flag_bank3(CHRFLAG3_00040000) - set_var_a(0) + set_morale(0) set_onshot_function(FUNC_OFFICE2) if_chr_dying(CHR_SELF, /*goto*/ 0x02) if_chr_death_animation_finished(CHR_SELF, /*goto*/ 0x02) @@ -2673,7 +2673,7 @@ u8 unregistered_function3[] = { }; u8 func0414_officeworker[] = { - set_var_a(0) + set_morale(0) if_chr_dying(CHR_SELF, /*goto*/ 0x02) if_chr_death_animation_finished(CHR_SELF, /*goto*/ 0x02) if_chr_unloaded(CHR_SELF, /*goto*/ 0x02) diff --git a/src/setup/setupdepo.c b/src/setup/setupdepo.c index d98584ff3..53da84fc4 100644 --- a/src/setup/setupdepo.c +++ b/src/setup/setupdepo.c @@ -2242,7 +2242,7 @@ u8 func101a_init_laser_switch_guards[] = { }; u8 func0412_cloak_guard[] = { - set_var_a(0) + set_morale(0) set_onshot_function(FUNC_CLOAK_GUARD) set_chr_cloaked(CHR_SELF, TRUE, FALSE) if_chr_dying(CHR_SELF, /*goto*/ 0x06) @@ -2281,7 +2281,7 @@ u8 func0412_cloak_guard[] = { // Attacking label(0x06) - if_var_a_lt(3, /*goto*/ 0x2c) + if_morale_lt(3, /*goto*/ 0x2c) goto_next(0x06) label(0x2c) @@ -2290,7 +2290,7 @@ u8 func0412_cloak_guard[] = { if_in_disarm_range(/*goto*/ 0x2c) goto_next(0x0d) label(0x0e) - add_var_a(1) + add_morale(1) label(0x2c) restart_timer set_chr_cloaked(CHR_SELF, FALSE, TRUE) @@ -2305,7 +2305,7 @@ u8 func0412_cloak_guard[] = { endloop(0x0b) label(0x0c) - set_var_a(0) + set_morale(0) set_chr_cloaked(CHR_SELF, TRUE, TRUE) label(0x0d) goto_first(0x03) @@ -2974,14 +2974,14 @@ u8 func1027_cloak1_check_one_remaining[] = { u8 func1028_cloak2_check_one_remaining[] = { // Count number of dead cloak guards in second room beginloop(0x04) - set_var_a(0) + set_morale(0) if_chr_dying(CHR_CLOAK_2A, /*goto*/ 0x2c) if_chr_death_animation_finished(CHR_CLOAK_2A, /*goto*/ 0x2c) if_chr_unloaded(CHR_CLOAK_2A, /*goto*/ 0x2c) goto_next(0x06) label(0x2c) - add_var_a(1) + add_morale(1) label(0x06) if_chr_dying(CHR_CLOAK_2B, /*goto*/ 0x2c) if_chr_death_animation_finished(CHR_CLOAK_2B, /*goto*/ 0x2c) @@ -2989,7 +2989,7 @@ u8 func1028_cloak2_check_one_remaining[] = { goto_next(0x06) label(0x2c) - add_var_a(1) + add_morale(1) label(0x06) if_chr_dying(CHR_CLOAK_2C, /*goto*/ 0x2c) if_chr_death_animation_finished(CHR_CLOAK_2C, /*goto*/ 0x2c) @@ -2997,7 +2997,7 @@ u8 func1028_cloak2_check_one_remaining[] = { goto_next(0x06) label(0x2c) - add_var_a(1) + add_morale(1) label(0x06) if_chr_dying(CHR_CLOAK_2D, /*goto*/ 0x2c) if_chr_death_animation_finished(CHR_CLOAK_2D, /*goto*/ 0x2c) @@ -3005,9 +3005,9 @@ u8 func1028_cloak2_check_one_remaining[] = { goto_next(0x06) label(0x2c) - add_var_a(1) + add_morale(1) label(0x06) - if_var_a_lt(3, /*goto*/ 0x2c) + if_morale_lt(3, /*goto*/ 0x2c) set_stage_flag(STAGEFLAG_CLOAK2_ONE_REMAINING) set_function(CHR_SELF, GFUNC_IDLE) label(0x2c) diff --git a/src/setup/setupdish.c b/src/setup/setupdish.c index 4ca738e14..e63f30587 100644 --- a/src/setup/setupdish.c +++ b/src/setup/setupdish.c @@ -614,7 +614,7 @@ u8 func041e_colleague[] = { endloop(0x57) label(0x06) - if_var_a_lt(6, /*goto*/ 0x06) + if_morale_lt(6, /*goto*/ 0x06) goto_next(0x7e) label(0x06) @@ -713,7 +713,7 @@ u8 func041e_colleague[] = { u8 func041f_colleague1[] = { set_self_flag_bank3(CHRFLAG3_INVINCIBLE_TO_GUNFIRE) set_self_flag_bank3(CHRFLAG3_UNEXPLODABLE) - set_var_a(0) + set_morale(0) set_function(CHR_SELF, FUNC_COLLEAGUE) endfunction }; @@ -721,7 +721,7 @@ u8 func041f_colleague1[] = { u8 func0420_colleague2[] = { set_self_flag_bank3(CHRFLAG3_INVINCIBLE_TO_GUNFIRE) set_self_flag_bank3(CHRFLAG3_UNEXPLODABLE) - set_var_a(1) + set_morale(1) set_function(CHR_SELF, FUNC_COLLEAGUE) endfunction }; @@ -729,7 +729,7 @@ u8 func0420_colleague2[] = { u8 func0421_colleague3[] = { set_self_flag_bank3(CHRFLAG3_INVINCIBLE_TO_GUNFIRE) set_self_flag_bank3(CHRFLAG3_UNEXPLODABLE) - set_var_a(2) + set_morale(2) set_function(CHR_SELF, FUNC_COLLEAGUE) endfunction }; @@ -737,7 +737,7 @@ u8 func0421_colleague3[] = { u8 func0422_colleague4[] = { set_self_flag_bank3(CHRFLAG3_INVINCIBLE_TO_GUNFIRE) set_self_flag_bank3(CHRFLAG3_UNEXPLODABLE) - set_var_a(3) + set_morale(3) set_function(CHR_SELF, FUNC_COLLEAGUE) endfunction }; @@ -745,7 +745,7 @@ u8 func0422_colleague4[] = { u8 func0423_colleague5[] = { set_self_flag_bank3(CHRFLAG3_INVINCIBLE_TO_GUNFIRE) set_self_flag_bank3(CHRFLAG3_UNEXPLODABLE) - set_var_a(4) + set_morale(4) set_function(CHR_SELF, FUNC_COLLEAGUE) endfunction }; @@ -753,7 +753,7 @@ u8 func0423_colleague5[] = { u8 func0424_colleague6[] = { set_self_flag_bank3(CHRFLAG3_INVINCIBLE_TO_GUNFIRE) set_self_flag_bank3(CHRFLAG3_UNEXPLODABLE) - set_var_a(5) + set_morale(5) set_function(CHR_SELF, FUNC_COLLEAGUE) endfunction }; @@ -761,7 +761,7 @@ u8 func0424_colleague6[] = { u8 func0425_colleague7[] = { set_self_flag_bank3(CHRFLAG3_INVINCIBLE_TO_GUNFIRE) set_self_flag_bank3(CHRFLAG3_UNEXPLODABLE) - set_var_a(6) + set_morale(6) set_function(CHR_SELF, FUNC_COLLEAGUE) endfunction }; @@ -769,7 +769,7 @@ u8 func0425_colleague7[] = { u8 func0426_colleague8[] = { set_self_flag_bank3(CHRFLAG3_INVINCIBLE_TO_GUNFIRE) set_self_flag_bank3(CHRFLAG3_UNEXPLODABLE) - set_var_a(7) + set_morale(7) set_function(CHR_SELF, FUNC_COLLEAGUE) endfunction }; @@ -777,7 +777,7 @@ u8 func0426_colleague8[] = { u8 func0427_colleague9[] = { set_self_flag_bank3(CHRFLAG3_INVINCIBLE_TO_GUNFIRE) set_self_flag_bank3(CHRFLAG3_UNEXPLODABLE) - set_var_a(8) + set_morale(8) set_function(CHR_SELF, FUNC_COLLEAGUE) endfunction }; @@ -785,7 +785,7 @@ u8 func0427_colleague9[] = { u8 func0428_colleague10[] = { set_self_flag_bank3(CHRFLAG3_INVINCIBLE_TO_GUNFIRE) set_self_flag_bank3(CHRFLAG3_UNEXPLODABLE) - set_var_a(9) + set_morale(9) set_function(CHR_SELF, FUNC_COLLEAGUE) endfunction }; @@ -2877,7 +2877,7 @@ u8 func042b_init_carrington[] = { set_self_flag_bank3(CHRFLAG3_INVINCIBLE_TO_GUNFIRE) set_self_flag_bank3(CHRFLAG3_UNEXPLODABLE) yield - set_var_a(0) + set_morale(0) if_eeprom_flag_is_unset(EEPROMFLAG_CI_TOUR_STARTED, /*goto*/ 0x06) set_eeprom_flag(EEPROMFLAG_CI_TOUR_DONE) dprint 'E','E','P','R','O','M',' ','S','E','T',0, diff --git a/src/setup/setupeld.c b/src/setup/setupeld.c index f7e9e4f84..1542e2c89 100644 --- a/src/setup/setupeld.c +++ b/src/setup/setupeld.c @@ -2984,13 +2984,13 @@ u8 func101f_check_one_basement_guard_remaining[] = { if_chr_unloaded(chr, /*goto*/ 0x2d) \ goto_next(0x06) \ label(0x2d) \ - add_var_a(1) \ + add_morale(1) \ label(0x06) beginloop(0x04) - set_var_a(0) + set_morale(0) inc_var_if_chr_dead(CHR_BASEMENT1) inc_var_if_chr_dead(CHR_BASEMENT2) @@ -3002,7 +3002,7 @@ u8 func101f_check_one_basement_guard_remaining[] = { inc_var_if_chr_dead(CHR_BASEMENT8) inc_var_if_chr_dead(CHR_BASEMENT9) - if_var_a_lt(8, /*goto*/ 0x2d) + if_morale_lt(8, /*goto*/ 0x2d) set_stage_flag(STAGEFLAG_ONE_BASEMENT_GUARD_REMAINING) set_function(CHR_SELF, GFUNC_IDLE) label(0x2d) diff --git a/src/setup/setupimp.c b/src/setup/setupimp.c index f66a1d7bc..cf5c11655 100644 --- a/src/setup/setupimp.c +++ b/src/setup/setupimp.c @@ -1574,7 +1574,7 @@ u8 func100c_check_carrington_dead[] = { }; u8 func0415_init_hostage_fr1[] = { - set_var_a(5) + set_morale(5) set_chr_health(CHR_SELF, 1) set_accuracy(0) set_function(CHR_SELF, FUNC_FIRINGRANGE_HOSTAGE) @@ -1582,7 +1582,7 @@ u8 func0415_init_hostage_fr1[] = { }; u8 func0416_init_hostage_fr2[] = { - set_var_a(7) + set_morale(7) set_chr_health(CHR_SELF, 1) set_accuracy(0) set_function(CHR_SELF, FUNC_FIRINGRANGE_HOSTAGE) @@ -1706,7 +1706,7 @@ u8 func0419_init_firingrange_taker[] = { }; u8 func041b_init_hostage_holo[] = { - set_var_a(3) + set_morale(3) set_chr_health(CHR_SELF, 1) set_function(CHR_SELF, FUNC_HOSTAGE_HOLO) endfunction @@ -2179,14 +2179,14 @@ u8 func1011_check_info_takers_dead[] = { }; u8 func042c_init_hostage_device_f[] = { - set_var_a(1) + set_morale(1) set_chr_health(CHR_SELF, 1) set_function(CHR_SELF, FUNC_DEVICEROOM_HOSTAGE) endfunction }; u8 func042d_init_hostage_device_m[] = { - set_var_a(6) + set_morale(6) set_chr_health(CHR_SELF, 1) set_function(CHR_SELF, FUNC_DEVICEROOM_HOSTAGE) endfunction @@ -2379,7 +2379,7 @@ u8 func0432_taker_attack[] = { }; u8 func0434_init_hostage_info_m[] = { - set_var_a(2) + set_morale(2) set_armor(10) set_chr_health(CHR_SELF, 1) set_function(CHR_SELF, FUNC_INFOROOM_HOSTAGE) @@ -2387,7 +2387,7 @@ u8 func0434_init_hostage_info_m[] = { }; u8 func0435_init_hostage_info_f[] = { - set_var_a(8) + set_morale(8) set_armor(10) set_chr_health(CHR_SELF, 1) set_function(CHR_SELF, FUNC_INFOROOM_HOSTAGE) diff --git a/src/setup/setuplee.c b/src/setup/setuplee.c index 1ffab93cd..dc3b510e6 100644 --- a/src/setup/setuplee.c +++ b/src/setup/setuplee.c @@ -997,7 +997,7 @@ u8 func040a_elvis_go_to_hangar_lift[] = { label(0x03) set_target_chr(CHR_JOANNA) restart_timer - if_var_a_lt(50, /*goto*/ 0x06) + if_morale_lt(50, /*goto*/ 0x06) goto_next(0xc3) label(0x06) @@ -1015,7 +1015,7 @@ u8 func040a_elvis_go_to_hangar_lift[] = { label(0x06) speak(CHR_JOANNA, 0x2616, 0x12e4, CHANNEL_6, COLOR_04_ORANGE) // "Time to head upwards. I'll take this lift; you tak..." animation(ANIM_TALKING_0231, 0, -1, 0x1010, CHR_SELF, 2) - set_var_a(50) + set_morale(50) beginloop(0x0c) if_timer_gt(180, /*goto*/ 0xc3) @@ -1051,11 +1051,11 @@ u8 func041b_elvis_at_bridge[] = { // Alive label(0x06) label(0x06) - if_var_a_lt(100, /*goto*/ 0x06) + if_morale_lt(100, /*goto*/ 0x06) goto_next(0x2c) label(0x06) - set_var_a(100) + set_morale(100) label(0x2c) beginloop(0x65) @@ -1650,7 +1650,7 @@ u8 func0412_hangarspawner[] = { set_self_flag_bank3(CHRFLAG3_00000002) set_self_flag_bank3(CHRFLAG3_HIDDEN) set_self_flag_bank3(CHRFLAG3_00040000) - set_var_a(0) + set_morale(0) beginloop(0xc2) if_stage_flag_eq(STAGEFLAG_HANGAR_ALARM_ACTIVATED, TRUE, /*goto*/ 0x04) @@ -1686,7 +1686,7 @@ u8 func0412_hangarspawner[] = { try_spawn_clone2(CHR_SELF, FUNC_INIT_HANGARCLONE, 0x00000000, /*goto*/ 0x2c) set_function(CHR_SELF, FUNC_HANGARCLONE) label(0x2c) - add_var_a(1) + add_morale(1) yield endloop(0x04) @@ -2133,7 +2133,7 @@ u8 func0415_bridgespawner[] = { set_self_flag_bank3(CHRFLAG3_HIDDEN) set_chr_cloaked(CHR_SELF, TRUE, FALSE) set_self_flag_bank3(CHRFLAG3_00040000) - set_var_a(0) + set_morale(0) beginloop(0xc2) if_stage_flag_eq(STAGEFLAG_TRIGGER_BRIDGE_SPAWNING, TRUE, /*goto*/ 0x04) @@ -2141,7 +2141,7 @@ u8 func0415_bridgespawner[] = { beginloop(0x04) if_stage_flag_eq(STAGEFLAG_BRIDGE_DOORS_UNLOCKED, TRUE, /*goto*/ 0x06) - if_var_a_lt(2, /*goto*/ 0x2c) + if_morale_lt(2, /*goto*/ 0x2c) // Doors are unlocked (have been spawning for over a minute) label(0x06) @@ -2154,7 +2154,7 @@ u8 func0415_bridgespawner[] = { label(0x06) goto_next(0x08) - // var_a is 0 or 1 + // morale is 0 or 1 label(0x2c) if_never_been_onscreen(/*goto*/ 0x4d) if_chr_death_animation_finished(CHR_CLONE, /*goto*/ 0x2c) @@ -2200,7 +2200,7 @@ u8 func0415_bridgespawner[] = { set_function(CHR_SELF, FUNC_INIT_BRIDGESPAWNER_REVEAL) label(0x2c) - add_var_a(1) + add_morale(1) yield goto_first(0x04) diff --git a/src/setup/setuplip.c b/src/setup/setuplip.c index 621ec7377..e6dc29279 100644 --- a/src/setup/setuplip.c +++ b/src/setup/setuplip.c @@ -4449,14 +4449,14 @@ u8 func1031_toggle_doorman[] = { u8 func1032_count_last_room_guards[] = { beginloop(0x04) - set_var_a(0) + set_morale(0) if_chr_dying(0x23, /*goto*/ 0x2d) if_chr_death_animation_finished(0x23, /*goto*/ 0x2d) if_chr_unloaded(0x23, /*goto*/ 0x2d) goto_next(0x06) label(0x2d) - add_var_a(1) + add_morale(1) label(0x06) if_chr_dying(0x24, /*goto*/ 0x2d) if_chr_death_animation_finished(0x24, /*goto*/ 0x2d) @@ -4464,7 +4464,7 @@ u8 func1032_count_last_room_guards[] = { goto_next(0x06) label(0x2d) - add_var_a(1) + add_morale(1) label(0x06) if_chr_dying(0x25, /*goto*/ 0x2d) if_chr_death_animation_finished(0x25, /*goto*/ 0x2d) @@ -4472,7 +4472,7 @@ u8 func1032_count_last_room_guards[] = { goto_next(0x06) label(0x2d) - add_var_a(1) + add_morale(1) label(0x06) if_chr_dying(0x26, /*goto*/ 0x2d) if_chr_death_animation_finished(0x26, /*goto*/ 0x2d) @@ -4480,9 +4480,9 @@ u8 func1032_count_last_room_guards[] = { goto_next(0x06) label(0x2d) - add_var_a(1) + add_morale(1) label(0x06) - if_var_a_lt(3, /*goto*/ 0x2d) + if_morale_lt(3, /*goto*/ 0x2d) set_stage_flag(STAGEFLAG_ONE_KEYCARD_GUARD_REMAINING) set_function(CHR_SELF, GFUNC_IDLE) diff --git a/src/setup/setuplue.c b/src/setup/setuplue.c index 4e5d31303..b2b6263ed 100644 --- a/src/setup/setuplue.c +++ b/src/setup/setuplue.c @@ -2697,18 +2697,18 @@ u8 func1019_spawn_guards_at_antenna[] = { // Spawn 3 guards label(0x2e) label(0x06) - set_var_a(3) + set_morale(3) beginloop(0x56) dprint 'T','R','Y',' ','C','R','E','A','T','E','\n',0, - if_var_a_lt(1, /*goto*/ 0x06) + if_morale_lt(1, /*goto*/ 0x06) try_spawn_chr(BODY_A51TROOPER, HEAD_RANDOM, 0x00a0, FUNC_SPAWNED_GUARD, 0x00000200, /*goto*/ 0x57) reloop(0x56) label(0x57) yield dprint 'C','R','E','A','T','E','\n',0, - subtract_var_a(1) + subtract_morale(1) restart_timer beginloop(0x09) diff --git a/src/setup/setupoat.c b/src/setup/setupoat.c index 5e6cea620..418be6bb3 100644 --- a/src/setup/setupoat.c +++ b/src/setup/setupoat.c @@ -56,14 +56,14 @@ u8 func0404_spawn_enemies[] = { set_chr_alliance(CHR_SELF, ALLIANCE_ENEMY) restart_timer dprint 'B','4','C','H','E','C','K','\n',0, - set_var_a(12) + set_morale(12) label(0x04) - if_var_a_lt(1, /*goto*/ 0x01) + if_morale_lt(1, /*goto*/ 0x01) try_spawn_clone(BODY_DDSHOCK, HEAD_DDSHOCK, 0x06, FUNC0401_INIT_ENEMY, 0x00000010, /*goto*/ 0xa2) goto_next(0x01) label(0xa2) yield - subtract_var_a(1) + subtract_morale(1) goto_first(0x04) label(0x01) @@ -96,14 +96,14 @@ u8 func0405_spawn_maians[] = { stop_chr restart_timer dprint 'B','4','C','H','E','K','\n',0, - set_var_a(12) + set_morale(12) label(0x04) - if_var_a_lt(1, /*goto*/ 0x01) + if_morale_lt(1, /*goto*/ 0x01) try_spawn_clone(BODY_ELVIS1, HEAD_ELVIS, 0x07, FUNC0402_INIT_MAIAN, 0x00000010, /*goto*/ 0xa2) goto_next(0x01) label(0xa2) yield - subtract_var_a(1) + subtract_morale(1) goto_first(0x04) label(0x01) diff --git a/src/setup/setuprit.c b/src/setup/setuprit.c index 5cf4ea8f1..7bf5c2404 100644 --- a/src/setup/setuprit.c +++ b/src/setup/setuprit.c @@ -3181,20 +3181,20 @@ u8 func0407_steward[] = { if_chr_distance_to_pad_lt(CHR_SELF, 50, 0x00c1, /*goto*/ 0x60) label(0x79) walk_to_pad(0x00c1) - set_var_a(1) + set_morale(1) set_target_pad(0x00c2) goto_next(0x87) label(0x60) if_chr_distance_to_pad_lt(CHR_SELF, 50, 0x00c3, /*goto*/ 0x77) walk_to_pad(0x00c3) - set_var_a(2) + set_morale(2) set_target_pad(0x00c4) goto_next(0x87) label(0x77) if_chr_distance_to_pad_lt(CHR_SELF, 50, 0x00c1, /*goto*/ 0x78) - set_var_a(3) + set_morale(3) set_target_pad(0x00c6) walk_to_pad(0x00c5) goto_next(0x87) diff --git a/src/setup/setupsho.c b/src/setup/setupsho.c index 7b7b39db9..6be8c57b6 100644 --- a/src/setup/setupsho.c +++ b/src/setup/setupsho.c @@ -915,7 +915,7 @@ u8 func0404_miniskedar_spawner[] = { set_self_flag_bank3(CHRFLAG3_00000002) set_self_flag_bank3(CHRFLAG3_HIDDEN) set_self_flag_bank3(CHRFLAG3_00040000) - set_var_a(0) + set_morale(0) // Wait until player near trigger pad beginloop(0x04) @@ -924,7 +924,7 @@ u8 func0404_miniskedar_spawner[] = { endloop(0x04) label(0x4f) - if_var_a_lt(3, /*goto*/ 0x06) + if_morale_lt(3, /*goto*/ 0x06) goto_next(0x2e) label(0x06) @@ -936,7 +936,7 @@ u8 func0404_miniskedar_spawner[] = { reloop(0x04) label(0x2d) - add_var_a(1) + add_morale(1) label(0x2e) yield endloop(0x04) @@ -1926,7 +1926,7 @@ u8 func040c_king_waiting[] = { label(0x2d) set_self_flag_bank3(CHRFLAG3_INVINCIBLE_TO_GUNFIRE) set_chr_flag_bank2(CHR_SELF, CHRFLAG2_10000000) - set_var_a(0) + set_morale(0) beginloop(0x08) consider_coop_for_p1p2_chr(CHR_SELF) @@ -1949,7 +1949,7 @@ u8 func040c_king_waiting[] = { }; /** - * var_a tracks how many rockets have been fired in a row. + * morale tracks how many rockets have been fired in a row. */ u8 func040d_king_combat[] = { #define LABEL_MAINLOOP 0x03 @@ -1982,7 +1982,7 @@ u8 func040d_king_combat[] = { // No clones exist call_rng if_rand_gt(200, /*goto*/ 0x79) - if_var_a_lt(2, /*goto*/ 0x06) + if_morale_lt(2, /*goto*/ 0x06) goto_next(0x2d) label(0x06) @@ -2049,7 +2049,7 @@ u8 func040d_king_combat[] = { endloop(0x7b) label(0x2d) - add_var_a(1) + add_morale(1) goto_first(LABEL_MAINLOOP) // @@ -2057,7 +2057,7 @@ u8 func040d_king_combat[] = { // label(LABEL_SPAWN_SKEDAR) say_quip(CHR_JOANNA, 0x01, 0xff, 0x03, 0xff, BANK_0, 0x00, 0x00) - set_var_a(0) + set_morale(0) restart_timer animation(0x0350, 0, -1, 0x1010, CHR_SELF, 2) @@ -2076,7 +2076,7 @@ u8 func040d_king_combat[] = { // label(LABEL_SPAWN_MINISKEDAR) say_quip(CHR_JOANNA, 0x01, 0xff, 0x03, 0xff, BANK_0, 0x00, 0x00) - set_var_a(0) + set_morale(0) restart_timer animation(0x0350, 0, -1, 0x1010, CHR_SELF, 2) @@ -2095,7 +2095,7 @@ u8 func040d_king_combat[] = { // label(LABEL_CLOAK) say_quip(CHR_JOANNA, 0x01, 0xff, 0x03, 0xff, BANK_0, 0x00, 0x00) - set_var_a(0) + set_morale(0) restart_timer animation(0x0350, 0, -1, 0x1010, CHR_SELF, 2) set_chr_cloaked(CHR_SELF, TRUE, TRUE) @@ -2201,7 +2201,7 @@ u8 func040d_king_combat[] = { // Unreachable - nothing jumps here label(0x77) say_quip(CHR_JOANNA, 0x01, 0xff, 0x03, 0xff, BANK_0, 0x00, 0x00) - set_var_a(0) + set_morale(0) restart_timer animation(0x0350, 0, -1, 0x1010, CHR_SELF, 2) diff --git a/src/setup/setupstat.c b/src/setup/setupstat.c index 22643c178..ebae5bd1c 100644 --- a/src/setup/setupstat.c +++ b/src/setup/setupstat.c @@ -423,11 +423,11 @@ u8 func1003_spawn_maians[] = { label(0x04) yield label(0x06) - set_var_a(50) + set_morale(50) // Loop until a Maian is able to be spawned or counter depleted beginloop(0x8d) - if_var_a_lt(1, /*goto*/ 0x06) + if_morale_lt(1, /*goto*/ 0x06) try_spawn_chr(BODY_ELVIS1, HEAD_MAIAN_S, 0x0053, FUNC_INIT_MAIAN, 0x00000000, /*goto*/ 0x8e) try_spawn_chr(BODY_ELVIS1, HEAD_MAIAN_S, 0x0050, FUNC_INIT_MAIAN, 0x00000000, /*goto*/ 0x8e) try_spawn_chr(BODY_ELVIS1, HEAD_MAIAN_S, 0x004d, FUNC_INIT_MAIAN, 0x00000000, /*goto*/ 0x8e) @@ -440,7 +440,7 @@ u8 func1003_spawn_maians[] = { label(0x8e) dprint 'C','R','E','A','T','E','D',' ','1','\n',0, yield - subtract_var_a(1) + subtract_morale(1) yield yield yield @@ -587,12 +587,12 @@ u8 func1004_spawn_king1_skedar[] = { label(0x04) yield label(0x06) - set_var_a(65) + set_morale(65) // Loop until a Skedar is able to be spawned or counter depleted beginloop(0x8d) if_stage_flag_eq(STAGEFLAG_KING1_DEAD, TRUE, /*goto*/ 0x0e) - if_var_a_lt(1, /*goto*/ 0x06) + if_morale_lt(1, /*goto*/ 0x06) try_spawn_chr(BODY_SKEDAR, HEAD_RANDOM, 0x0079, FUNC_KING1_SKEDAR, 0x00000200, /*goto*/ 0x8e) try_spawn_chr(BODY_SKEDAR, HEAD_RANDOM, 0x007d, FUNC_KING1_SKEDAR, 0x00000200, /*goto*/ 0x8e) try_spawn_chr(BODY_SKEDAR, HEAD_RANDOM, 0x0083, FUNC_KING1_SKEDAR, 0x00000200, /*goto*/ 0x8e) @@ -603,7 +603,7 @@ u8 func1004_spawn_king1_skedar[] = { label(0x8e) dprint 'C','R','E','A','T','E','D',' ','1','\n',0, yield - subtract_var_a(1) + subtract_morale(1) yield yield yield @@ -676,11 +676,11 @@ u8 func1008_spawn_king2_skedar[] = { // Loop until a Skedar is able to be spawned or counter depleted label(0x06) - set_var_a(50) + set_morale(50) beginloop(0x8d) if_stage_flag_eq(STAGEFLAG_KING2_DEAD, TRUE, /*goto*/ 0x0e) - if_var_a_lt(1, /*goto*/ 0x06) + if_morale_lt(1, /*goto*/ 0x06) try_spawn_chr(BODY_SKEDAR, HEAD_RANDOM, 0x008e, FUNC_KING2_SKEDAR, 0x00000210, /*goto*/ 0x8e) try_spawn_chr(BODY_SKEDAR, HEAD_RANDOM, 0x0090, FUNC_KING2_SKEDAR, 0x00000210, /*goto*/ 0x8e) try_spawn_chr(BODY_SKEDAR, HEAD_RANDOM, 0x008f, FUNC_KING2_SKEDAR, 0x00000210, /*goto*/ 0x8e) @@ -705,7 +705,7 @@ u8 func1008_spawn_king2_skedar[] = { yield yield yield - subtract_var_a(1) + subtract_morale(1) cmd0145_rebuild_groups cmd0146_rebuild_groups if_num_chrs_in_group_gt(3, GROUP_KING2_SKEDAR, /*goto*/ 0x2d) @@ -762,11 +762,11 @@ u8 func100c_spawn_king3_skedar[] = { // Loop until a Skedar is able to be spawned or counter depleted label(0x06) - set_var_a(50) + set_morale(50) beginloop(0x8d) if_stage_flag_eq(STAGEFLAG_KING3_DEAD, TRUE, /*goto*/ 0x0e) - if_var_a_lt(1, /*goto*/ 0x06) + if_morale_lt(1, /*goto*/ 0x06) try_spawn_chr(BODY_SKEDAR, HEAD_RANDOM, 0x0095, FUNC_KING3_SKEDAR, 0x00000200, /*goto*/ 0x8e) try_spawn_chr(BODY_SKEDAR, HEAD_RANDOM, 0x0096, FUNC_KING3_SKEDAR, 0x00000200, /*goto*/ 0x8e) try_spawn_chr(BODY_SKEDAR, HEAD_RANDOM, 0x012e, FUNC_KING3_SKEDAR, 0x00000200, /*goto*/ 0x8e) @@ -776,7 +776,7 @@ u8 func100c_spawn_king3_skedar[] = { // Successful spawn label(0x8e) yield - subtract_var_a(1) + subtract_morale(1) cmd0145_rebuild_groups cmd0146_rebuild_groups if_num_chrs_in_group_gt(5, 0x04, /*goto*/ 0x2d) diff --git a/src/setup/setuptra.c b/src/setup/setuptra.c index 58866dd90..c44f9fc0a 100644 --- a/src/setup/setuptra.c +++ b/src/setup/setuptra.c @@ -1505,12 +1505,12 @@ u8 func1008_spawngroup1[] = { endloop(0x04) label(0x06) - set_var_a(15) + set_morale(15) beginloop(0x5f) // Keep doing this until explosives finished, or 15 guards spawned if_stage_flag_eq(STAGEFLAG_JON_FINISHED_EXPLOSIVES, TRUE, /*goto*/ 0x06) - if_var_a_lt(1, /*goto*/ 0x06) + if_morale_lt(1, /*goto*/ 0x06) try_spawn_chr(BODY_AREA51GUARD, HEAD_RANDOM, 0x00c7, FUNC_SPAWNGROUP1_GUARD, 0x00000200, /*goto*/ 0x60) reloop(0x5f) @@ -1518,7 +1518,7 @@ u8 func1008_spawngroup1[] = { label(0x60) yield if_stage_flag_eq(STAGEFLAG_JON_FINISHED_EXPLOSIVES, TRUE, /*goto*/ 0x06) - subtract_var_a(1) + subtract_morale(1) if_num_chrs_in_group_gt(3, SPAWNGROUP1, /*goto*/ 0x32) reloop(0x5f) @@ -1577,10 +1577,10 @@ u8 func1013_spawngroup2[] = { endloop(0x04) label(0x06) - set_var_a(12) + set_morale(12) beginloop(0x5f) - if_var_a_lt(1, /*goto*/ 0x06) + if_morale_lt(1, /*goto*/ 0x06) call_rng if_rand_gt(128, /*goto*/ 0x32) try_spawn_chr(BODY_AREA51GUARD, HEAD_RANDOM, 0x0144, FUNC_SPAWNGROUP2_GUARD, 0x00000200, /*goto*/ 0x60) @@ -1593,7 +1593,7 @@ u8 func1013_spawngroup2[] = { label(0x60) yield if_stage_flag_eq(STAGEFLAG_WALL_EXPLODED, TRUE, /*goto*/ 0x06) - subtract_var_a(1) + subtract_morale(1) cmd0145_rebuild_groups cmd0146_rebuild_groups label(0x08) @@ -1666,10 +1666,10 @@ u8 func1014_spawngroup3[] = { endloop(0x04) label(0x06) - set_var_a(4) + set_morale(4) beginloop(0x5f) - if_var_a_lt(1, /*goto*/ 0x06) + if_morale_lt(1, /*goto*/ 0x06) call_rng if_rand_gt(128, /*goto*/ 0x32) @@ -1686,7 +1686,7 @@ u8 func1014_spawngroup3[] = { label(0x60) yield if_stage_flag_eq(STAGEFLAG_ELVIS_REVIVED, TRUE, /*goto*/ 0x06) - subtract_var_a(1) + subtract_morale(1) cmd0145_rebuild_groups cmd0146_rebuild_groups @@ -1754,7 +1754,7 @@ u8 func1015_spawngroup4[] = { label(0x06) label(0x06) - set_var_a(12) + set_morale(12) beginloop(0x5f) call_rng @@ -1774,13 +1774,13 @@ u8 func1015_spawngroup4[] = { label(0x60) yield if_stage_flag_eq(STAGEFLAG_BOTH_HANGAR_DOORS_OPEN, TRUE, /*goto*/ 0x06) - subtract_var_a(1) + subtract_morale(1) cmd0145_rebuild_groups cmd0146_rebuild_groups label(0x08) yield - if_var_a_lt(1, /*goto*/ 0x06) + if_morale_lt(1, /*goto*/ 0x06) if_num_chrs_in_group_gt(6, SPAWNGROUP4, /*goto*/ 0x32) call_rng if_rand_gt(2, /*goto*/ 0x32) diff --git a/src/setup/setupwax.c b/src/setup/setupwax.c index 5cdf229b3..97c431755 100644 --- a/src/setup/setupwax.c +++ b/src/setup/setupwax.c @@ -1554,7 +1554,7 @@ u8 func0414_init_chief[] = { set_armor(40) set_recovery_speed(0) set_shield(0) - set_var_a(0) + set_morale(0) set_self_flag_bank3(CHRFLAG3_HIDDEN) set_function(CHR_SELF, GFUNC_IDLE) endfunction