From 3bbad9cae54f88bed1efe888102bd8bdb52707b7 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sun, 29 Dec 2019 18:13:33 +1000 Subject: [PATCH] Rename health/armour related commands --- src/files/setup/setupame.c | 28 ++++----- src/files/setup/setupark.c | 28 ++++----- src/files/setup/setupate.c | 12 ++-- src/files/setup/setupazt.c | 28 ++++----- src/files/setup/setupcave.c | 62 ++++++++++---------- src/files/setup/setupdam.c | 26 ++++---- src/files/setup/setupdepo.c | 28 ++++----- src/files/setup/setupdish.c | 10 ++-- src/files/setup/setupear.c | 14 ++--- src/files/setup/setupeld.c | 12 ++-- src/files/setup/setupimp.c | 76 ++++++++++++------------ src/files/setup/setuplee.c | 36 ++++++------ src/files/setup/setuplip.c | 38 ++++++------ src/files/setup/setuplue.c | 34 +++++------ src/files/setup/setupoat.c | 2 +- src/files/setup/setuppam.c | 36 ++++++------ src/files/setup/setuppete.c | 42 ++++++------- src/files/setup/setuprit.c | 88 ++++++++++++++-------------- src/files/setup/setupsev.c | 80 ++++++++++++------------- src/files/setup/setupsho.c | 16 ++--- src/files/setup/setupstat.c | 24 ++++---- src/files/setup/setuptra.c | 36 ++++++------ src/files/setup/setupwax.c | 42 ++++++------- src/game/chr/chraicommands.c | 4 +- src/include/commands.h | 22 ++++++- src/include/game/chr/chraicommands.h | 4 +- src/setup/ailists.c | 12 ++-- src/setup/setup_000000.c | 4 +- 28 files changed, 431 insertions(+), 413 deletions(-) diff --git a/src/files/setup/setupame.c b/src/files/setup/setupame.c index 04e10382b..526f2388b 100644 --- a/src/files/setup/setupame.c +++ b/src/files/setup/setupame.c @@ -1134,8 +1134,8 @@ u8 func040a_start_path31[] = { set_unarmeddodgerating(0) set_accuracy(0) set_reaction_speed(0) - set_chr_health(CHR_SELF, 40) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) set_returnlist(CHR_SELF, 0x040a) @@ -1150,8 +1150,8 @@ u8 func040b_start_path32[] = { set_unarmeddodgerating(0) set_accuracy(0) set_reaction_speed(0) - set_chr_health(CHR_SELF, 40) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) assign_path(32) @@ -1165,8 +1165,8 @@ u8 func040c_start_path33[] = { set_unarmeddodgerating(0) set_accuracy(0) set_reaction_speed(0) - set_chr_health(CHR_SELF, 40) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) assign_path(33) @@ -1180,8 +1180,8 @@ u8 func040d_start_path34[] = { set_unarmeddodgerating(0) set_accuracy(10) set_reaction_speed(0) - set_chr_health(CHR_SELF, 40) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) assign_path(34) @@ -1198,7 +1198,7 @@ u8 func040e_start_path35[] = { }; u8 func0410_init_cass[] = { - set_chr_health(CHR_SELF, 1) + set_chr_maxdamage(CHR_SELF, 1) set_ailist(CHR_SELF, FUNC_CASS) endlist }; @@ -1415,7 +1415,7 @@ u8 func040f_cass[] = { }; u8 func0412_init_secretary[] = { - set_chr_health(CHR_SELF, 1) + set_chr_maxdamage(CHR_SELF, 1) set_ailist(CHR_SELF, FUNC_SECRETARY) endlist }; @@ -1890,7 +1890,7 @@ u8 func0414_programmer[] = { label(0x06) if_stage_flag_eq(STAGEFLAG_PC_DESTROYED, TRUE, /*goto*/ LABEL_PC_BROKEN) set_stage_flag(STAGEFLAG_PERSONALITY_DELETED) - set_chr_health(CHR_SELF, 1) + set_chr_maxdamage(CHR_SELF, 1) chr_do_animation(ANIM_TALKING_003D, 0, 193, 0x18, 0x10, CHR_SELF, 2) speak(CHR_TARGET, 0x022a, 0x1303, CHANNEL_3, COLOR_03_RED) // "Goodbye, Dr. Caroll." if_stage_flag_eq(STAGEFLAG_DOWNLOAD_COMPLETE, TRUE, /*goto*/ 0x2c) @@ -3336,8 +3336,8 @@ u8 func1012_trigger_x_music[] = { set_unarmeddodgerating(0) \ set_accuracy(accuracy) \ set_reaction_speed(0) \ - set_chr_health(CHR_SELF, health) \ - set_armor(0) \ + set_chr_maxdamage(CHR_SELF, health) \ + add_health_or_armor(0) \ set_recovery_speed(0) \ set_shield(0) @@ -3715,7 +3715,7 @@ u8 func101e_lift_door_sounds[] = { */ u8 func042e_init_surrendering_guard[] = { label(0xc4) - set_chr_health(CHR_SELF, 1) + set_chr_maxdamage(CHR_SELF, 1) set_ailist(CHR_SELF, FUNC_SURRENDERING_GUARD) endlist }; diff --git a/src/files/setup/setupark.c b/src/files/setup/setupark.c index 315fadb23..afbcdc59f 100644 --- a/src/files/setup/setupark.c +++ b/src/files/setup/setupark.c @@ -565,7 +565,7 @@ u8 func0401_drcaroll_following[] = { set_ailist(CHR_SELF, GFUNC_IDLE) set_target_chr(CHR_BOND) set_shield(100) - set_chr_health(CHR_SELF, 100) + set_chr_maxdamage(CHR_SELF, 100) label(0x20) dprint 'b','4',' ','s','h','i','e','l','d',' ','c','h','e','c','k','\n',0, try_unset_chr_flag_bank3_02000000(CHR_SELF, /*goto*/ 0x00) @@ -793,8 +793,8 @@ u8 func0410_init_top_guard[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(80) set_reaction_speed(10) - set_chr_health(CHR_SELF, 10) - set_armor(40) + set_chr_maxdamage(CHR_SELF, 10) + add_health_or_armor(40) set_recovery_speed(0) set_shield(0) goto_next(0x00) @@ -804,8 +804,8 @@ u8 func0410_init_top_guard[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(12) set_reaction_speed(10) - set_chr_health(CHR_SELF, 10) - set_armor(40) + set_chr_maxdamage(CHR_SELF, 10) + add_health_or_armor(40) set_recovery_speed(0) set_shield(0) @@ -1096,7 +1096,7 @@ u8 func0408_hovercopter[] = { move_object_to_pad(OBJ_HOVERCOPTER, 0x0199) begin_hovercar_path(0x02) restart_timer - set_chr_health(CHR_SELF, 42320) + set_chr_maxdamage(CHR_SELF, 42320) beginloop(0x1f) if_timer_gt(120, /*goto*/ 0x42) @@ -1621,7 +1621,7 @@ u8 func1009_init_top_room[] = { }; u8 func040b_init_tech1[] = { - set_chr_health(CHR_SELF, 1) + set_chr_maxdamage(CHR_SELF, 1) set_ailist(CHR_SELF, 0x0409) endlist }; @@ -1837,7 +1837,7 @@ u8 func040d_cass_necklace[] = { }; u8 func040c_init_tech2[] = { - set_chr_health(CHR_SELF, 1) + set_chr_maxdamage(CHR_SELF, 1) set_ailist(CHR_SELF, 0x040a) endlist }; @@ -2626,8 +2626,8 @@ u8 func0413_defend_pad[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(12) set_reaction_speed(10) - set_chr_health(CHR_SELF, 10) - set_armor(40) + set_chr_maxdamage(CHR_SELF, 10) + add_health_or_armor(40) set_recovery_speed(0) set_shield(0) set_shotlist(FUNC_GENERAL_COMBAT) @@ -2687,8 +2687,8 @@ u8 func0414_init_shock[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(12) set_reaction_speed(10) - set_chr_health(CHR_SELF, 40) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(0) set_recovery_speed(10) set_shield(0) set_ailist(CHR_SELF, FUNC_GENERAL_COMBAT) @@ -2702,8 +2702,8 @@ u8 func0415_init_10hp[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(12) set_reaction_speed(10) - set_chr_health(CHR_SELF, 10) - set_armor(40) + set_chr_maxdamage(CHR_SELF, 10) + add_health_or_armor(40) set_recovery_speed(0) set_shield(0) set_ailist(CHR_SELF, FUNC_GENERAL_COMBAT) diff --git a/src/files/setup/setupate.c b/src/files/setup/setupate.c index c62b6ab70..b63bc926c 100644 --- a/src/files/setup/setupate.c +++ b/src/files/setup/setupate.c @@ -527,8 +527,8 @@ u8 func0405_guard_init[] = { set_self_chrflag(CHRCFLAG_NOAUTOAIM) set_accuracy(200) set_reaction_speed(50) - set_chr_health(CHR_SELF, 20) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 20) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) set_ailist(CHR_SELF, GFUNC_IDLE) @@ -539,8 +539,8 @@ u8 func0406_jon_init[] = { set_self_chrflag(CHRCFLAG_NOAUTOAIM) set_accuracy(200) set_reaction_speed(75) - set_chr_health(CHR_SELF, 40) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) set_self_chrflag(CHRCFLAG_HIDDEN) @@ -554,8 +554,8 @@ u8 func0407_trent_init[] = { set_self_chrflag(CHRCFLAG_NOAUTOAIM) set_accuracy(200) set_reaction_speed(75) - set_chr_health(CHR_SELF, 40) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) set_self_chrflag(CHRCFLAG_HIDDEN) diff --git a/src/files/setup/setupazt.c b/src/files/setup/setupazt.c index b21c562a0..9d2405b02 100644 --- a/src/files/setup/setupazt.c +++ b/src/files/setup/setupazt.c @@ -762,8 +762,8 @@ u8 func0402_outro[] = { u8 func0407_init_blonde[] = { set_accuracy(20) set_reaction_speed(55) - set_chr_health(CHR_SELF, 40) - set_armor(60) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(60) set_recovery_speed(0) set_shield(0) set_ailist(CHR_SELF, GFUNC_UNALERTED) @@ -774,8 +774,8 @@ u8 func0406_init_stripes[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(16) set_reaction_speed(55) - set_chr_health(CHR_SELF, 60) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 60) + add_health_or_armor(0) set_recovery_speed(30) set_shield(0) set_ailist(CHR_SELF, GFUNC_UNALERTED) @@ -838,8 +838,8 @@ u8 func1006_msg_elvisbeable[] = { set_chr_dodge_rating(2, 0x0a) \ set_accuracy(16) \ set_reaction_speed(55) \ - set_chr_health(CHR_SELF, 60) \ - set_armor(0) \ + set_chr_maxdamage(CHR_SELF, 60) \ + add_health_or_armor(0) \ set_recovery_speed(30) \ set_shield(0) \ set_returnlist(CHR_SELF, function) \ @@ -944,8 +944,8 @@ u8 func0415_unused[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(16) set_reaction_speed(55) - set_chr_health(CHR_SELF, 60) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 60) + add_health_or_armor(0) set_recovery_speed(30) set_shield(0) try_equip_weapon(MODEL_CHRAVENGER, WEAPON_K7AVENGER, 0x00000000, /*goto*/ 0x08) @@ -1028,8 +1028,8 @@ u8 func0416_spawned_guard[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(16) set_reaction_speed(55) - set_chr_health(CHR_SELF, 60) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 60) + add_health_or_armor(0) set_recovery_speed(30) set_shield(0) try_equip_weapon(MODEL_CHRAVENGER, WEAPON_K7AVENGER, 0x00000000, /*goto*/ 0x08) @@ -1128,8 +1128,8 @@ u8 func0403_init_elvis[] = { set_self_chrflag(CHRCFLAG_INVINCIBLE_TO_GUNFIRE) set_accuracy(100) set_reaction_speed(100) - set_armor(1000) - set_chr_health(CHR_SELF, 1000) + add_health_or_armor(1000) + set_chr_maxdamage(CHR_SELF, 1000) set_self_chrflag(CHRCFLAG_00080000) assign_path(12) start_path @@ -1250,7 +1250,7 @@ u8 func0405_unused[] = { u8 func0417_init_robot[] = { set_accuracy(40) set_self_chrflag(CHRCFLAG_00020000) - set_chr_health(CHR_SELF, 250) + set_chr_maxdamage(CHR_SELF, 250) set_ailist(CHR_SELF, FUNC_ROBOT) endlist }; @@ -1451,7 +1451,7 @@ u8 func041a_pres_clone[] = { u8 func041b_init_president[] = { set_self_chrflag(CHRCFLAG_00080000) - set_chr_health(CHR_SELF, 300) + set_chr_maxdamage(CHR_SELF, 300) set_shield(0) set_ailist(CHR_SELF, FUNC_PRESIDENT_WAITING) endlist diff --git a/src/files/setup/setupcave.c b/src/files/setup/setupcave.c index 88da43592..7fbef288d 100644 --- a/src/files/setup/setupcave.c +++ b/src/files/setup/setupcave.c @@ -1109,8 +1109,8 @@ u8 func0405_start_path15[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(12) set_reaction_speed(70) - set_chr_health(CHR_SELF, 40) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) restart_timer @@ -1130,7 +1130,7 @@ u8 func0405_start_path15[] = { * Assigned to the stewardess from another unused function. */ u8 func040b_unused[] = { - set_chr_health(CHR_SELF, 1) + set_chr_maxdamage(CHR_SELF, 1) set_ailist(CHR_SELF, 0x040b) endlist }; @@ -1384,8 +1384,8 @@ u8 func1005_check_civilians_killed[] = { #define init_path(reaction, health, armor, recovery, pathid) \ set_accuracy(12) \ set_reaction_speed(reaction) \ - set_chr_health(CHR_SELF, health) \ - set_armor(armor) \ + set_chr_maxdamage(CHR_SELF, health) \ + add_health_or_armor(armor) \ set_recovery_speed(recovery) \ set_shield(0) \ assign_path(pathid) \ @@ -1436,8 +1436,8 @@ u8 func0422_start_path13[] = { set_chr_team(CHR_SELF, TEAM_04) set_accuracy(12) set_reaction_speed(45) - set_chr_health(CHR_SELF, 60) - set_armor(40) + set_chr_maxdamage(CHR_SELF, 60) + add_health_or_armor(40) set_recovery_speed(30) set_shield(0) rebuild_teams @@ -1452,8 +1452,8 @@ u8 func0423_start_path14[] = { set_chr_team(CHR_SELF, TEAM_04) set_accuracy(12) set_reaction_speed(45) - set_chr_health(CHR_SELF, 60) - set_armor(40) + set_chr_maxdamage(CHR_SELF, 60) + add_health_or_armor(40) set_recovery_speed(30) set_shield(0) rebuild_teams @@ -1467,8 +1467,8 @@ u8 func0423_start_path14[] = { u8 func0424_start_path15_unused[] = { set_accuracy(12) set_reaction_speed(45) - set_chr_health(CHR_SELF, 60) - set_armor(40) + set_chr_maxdamage(CHR_SELF, 60) + add_health_or_armor(40) set_recovery_speed(30) set_shield(0) assign_path(15) @@ -1478,7 +1478,7 @@ u8 func0424_start_path15_unused[] = { }; u8 func040c_init_secretary[] = { - set_chr_health(CHR_SELF, 1) + set_chr_maxdamage(CHR_SELF, 1) set_ailist(CHR_SELF, FUNC_SECRETARY) endlist }; @@ -2040,7 +2040,7 @@ u8 func100b_suitcase_scanning[] = { }; u8 func040d_init_office1[] = { - set_chr_health(CHR_SELF, 1) + set_chr_maxdamage(CHR_SELF, 1) set_ailist(CHR_SELF, FUNC_OFFICE1) endlist }; @@ -2179,7 +2179,7 @@ u8 func0409_office1[] = { }; u8 func040e_init_office2[] = { - set_chr_health(CHR_SELF, 1) + set_chr_maxdamage(CHR_SELF, 1) set_ailist(CHR_SELF, FUNC_OFFICE2) endlist }; @@ -2406,8 +2406,8 @@ u8 func0410_unused[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(22) set_reaction_speed(80) - set_chr_health(CHR_SELF, 40) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) set_self_chrflag(CHRCFLAG_00000040) @@ -2595,8 +2595,8 @@ u8 func0412_init_takeover_lackey[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(60) set_reaction_speed(80) - set_chr_health(CHR_SELF, 40) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) set_ailist(CHR_SELF, FUNC_TAKEOVER_LACKEY) @@ -2661,13 +2661,13 @@ u8 func0411_takeover_lackey[] = { }; u8 func0413_alaskan_console_guard[] = { - set_chr_health(CHR_SELF, 1) + set_chr_maxdamage(CHR_SELF, 1) set_ailist(CHR_SELF, GFUNC_UNALERTED) endlist }; u8 unregistered_function3[] = { - set_chr_health(CHR_SELF, 1) + set_chr_maxdamage(CHR_SELF, 1) set_ailist(CHR_SELF, FUNC_OFFICEWORKER) endlist }; @@ -2780,7 +2780,7 @@ u8 func0414_officeworker[] = { }; u8 func0415_alaskan_mountainlift_guard[] = { - set_chr_health(CHR_SELF, 1) + set_chr_maxdamage(CHR_SELF, 1) set_ailist(CHR_SELF, GFUNC_UNALERTED) endlist }; @@ -2893,8 +2893,8 @@ u8 func0403_unused[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(12) set_reaction_speed(45) - set_chr_health(CHR_SELF, 60) - set_armor(40) + set_chr_maxdamage(CHR_SELF, 60) + add_health_or_armor(40) set_recovery_speed(30) set_shield(0) set_chr_chrflag(CHR_SELF, CHRCFLAG_HIDDEN) @@ -3050,8 +3050,8 @@ u8 func0426_init_alaskan_guard[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(12) set_reaction_speed(70) - set_chr_health(CHR_SELF, 40) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) set_ailist(CHR_SELF, GFUNC_UNALERTED) @@ -3068,8 +3068,8 @@ u8 func0427_init_posttakeover_guard[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(12) set_reaction_speed(45) - set_chr_health(CHR_SELF, 60) - set_armor(40) + set_chr_maxdamage(CHR_SELF, 60) + add_health_or_armor(40) set_recovery_speed(30) set_shield(0) rebuild_teams @@ -3120,8 +3120,8 @@ u8 func0429_unused[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(22) set_reaction_speed(80) - set_chr_health(CHR_SELF, 40) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) set_ailist(CHR_SELF, GFUNC_UNALERTED) @@ -3135,8 +3135,8 @@ u8 func042a_foyer_spawner[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(12) set_reaction_speed(45) - set_chr_health(CHR_SELF, 60) - set_armor(40) + set_chr_maxdamage(CHR_SELF, 60) + add_health_or_armor(40) set_recovery_speed(30) set_shield(0) set_self_chrflag(CHRCFLAG_00000002) diff --git a/src/files/setup/setupdam.c b/src/files/setup/setupdam.c index 5e11fa819..5266ad63c 100644 --- a/src/files/setup/setupdam.c +++ b/src/files/setup/setupdam.c @@ -665,8 +665,8 @@ u8 func0408_guard_unalerted[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(18) set_reaction_speed(60) - set_chr_health(CHR_SELF, 70) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 70) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) set_ailist(CHR_SELF, GFUNC_UNALERTED) @@ -1291,8 +1291,8 @@ u8 func100f_check_researchdata_collected[] = { set_chr_dodge_rating(2, 0x0a) \ set_accuracy(18) \ set_reaction_speed(60) \ - set_chr_health(CHR_SELF, 70) \ - set_armor(0) \ + set_chr_maxdamage(CHR_SELF, 70) \ + add_health_or_armor(0) \ set_recovery_speed(0) \ set_shield(0) \ assign_path(pathid) \ @@ -1335,7 +1335,7 @@ u8 func0407_start_path02[] = { u8 func040e_init_labtech1[] = { set_self_chrflag(CHRCFLAG_04000000) - set_chr_health(CHR_SELF, 1) + set_chr_maxdamage(CHR_SELF, 1) set_ailist(CHR_SELF, FUNC_LABTECH1) endlist }; @@ -1410,7 +1410,7 @@ u8 func040b_labtech1[] = { u8 func040f_init_labtech2[] = { set_self_chrflag(CHRCFLAG_04000000) - set_chr_health(CHR_SELF, 1) + set_chr_maxdamage(CHR_SELF, 1) set_ailist(CHR_SELF, FUNC_LABTECH2) endlist }; @@ -1485,7 +1485,7 @@ u8 func040c_labtech2[] = { u8 func0410_init_labtech3[] = { set_self_chrflag(CHRCFLAG_04000000) - set_chr_health(CHR_SELF, 1) + set_chr_maxdamage(CHR_SELF, 1) set_ailist(CHR_SELF, FUNC_LABTECH3) endlist }; @@ -1860,7 +1860,7 @@ u8 func1010_alarm_responders[] = { }; u8 func0402_init_pilot[] = { - set_chr_health(CHR_SELF, 1) + set_chr_maxdamage(CHR_SELF, 1) set_ailist(CHR_SELF, FUNC_PILOT) endlist }; @@ -2271,8 +2271,8 @@ u8 func0413_guard_alerted[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(18) set_reaction_speed(60) - set_chr_health(CHR_SELF, 70) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 70) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) set_ailist(CHR_SELF, GFUNC_ALERTED) @@ -2455,7 +2455,7 @@ u8 func0415_elvis_at_start[] = { // Alive label(0x04) stop_chr - set_chr_health(CHR_SELF, 1) + set_chr_maxdamage(CHR_SELF, 1) restart_timer beginloop(0x0b) @@ -2573,8 +2573,8 @@ u8 func0415_elvis_at_start[] = { set_stage_flag(STAGEFLAG_ELVIS_WARPED_FROM_START) set_chr_chrflag(CHR_SELF, CHRCFLAG_HIDDEN) set_chr_chrflag(CHR_SELF, CHRCFLAG_INVINCIBLE_TO_GUNFIRE) - set_armor(2000) - set_chr_health(CHR_SELF, 1) + add_health_or_armor(2000) + set_chr_maxdamage(CHR_SELF, 1) set_ailist(CHR_SELF, GFUNC_IDLE) endlist }; diff --git a/src/files/setup/setupdepo.c b/src/files/setup/setupdepo.c index bb0f7dc64..531e24086 100644 --- a/src/files/setup/setupdepo.c +++ b/src/files/setup/setupdepo.c @@ -479,8 +479,8 @@ u8 func0409_start_path00[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(5) set_reaction_speed(30) - set_chr_health(CHR_SELF, 40) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) assign_path(0) @@ -493,8 +493,8 @@ u8 func040a_start_path01[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(5) set_reaction_speed(30) - set_chr_health(CHR_SELF, 40) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) assign_path(1) @@ -507,8 +507,8 @@ u8 func040b_start_path02[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(5) set_reaction_speed(30) - set_chr_health(CHR_SELF, 40) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) assign_path(2) @@ -521,8 +521,8 @@ u8 func040c_start_path03[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(5) set_reaction_speed(30) - set_chr_health(CHR_SELF, 40) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) assign_path(3) @@ -1045,8 +1045,8 @@ u8 func1009_spawner_during_decode[] = { set_chr_dodge_rating(2, 0x0a) \ set_accuracy(15) \ set_reaction_speed(25) \ - set_chr_health(CHR_SELF, 40) \ - set_armor(0) \ + set_chr_maxdamage(CHR_SELF, 40) \ + add_health_or_armor(0) \ set_recovery_speed(0) \ set_shield(0) \ try_equip_weapon(MODEL_CHRDY357, WEAPON_DY357MAGNUM, 0x10000000, /*goto*/ 0x06) \ @@ -2354,8 +2354,8 @@ u8 func0414_init_cloak2_guard[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(5) set_reaction_speed(25) - set_chr_health(CHR_SELF, 40) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) unset_self_chrflag(CHRCFLAG_INVINCIBLE_TO_GUNFIRE) @@ -2562,8 +2562,8 @@ u8 func101d_init_mines[] = { set_chr_dodge_rating(2, 0x0a) \ set_accuracy(accuracy) \ set_reaction_speed(reaction) \ - set_chr_health(CHR_SELF, 40) \ - set_armor(0) \ + set_chr_maxdamage(CHR_SELF, 40) \ + add_health_or_armor(0) \ set_recovery_speed(0) \ set_shield(0) \ set_ailist(CHR_SELF, function) diff --git a/src/files/setup/setupdish.c b/src/files/setup/setupdish.c index f1a69a397..89476d237 100644 --- a/src/files/setup/setupdish.c +++ b/src/files/setup/setupdish.c @@ -4687,8 +4687,8 @@ u8 func0407_holo5_guard1[] = { set_self_flag_bankx(CHRFLAG0_80000000, BANK_0) dprint 'C','R','E','A','T','E','D',' ','4',0, set_shotlist(FUNC_HOLO5_GUARD1) - set_chr_health(CHR_SELF, 300) - set_armor(300) + set_chr_maxdamage(CHR_SELF, 300) + add_health_or_armor(300) label(0x04) yield label(0x2f) @@ -4754,7 +4754,7 @@ u8 func0407_holo5_guard1[] = { }; u8 func0408_holo5_init_guard2[] = { - set_chr_health(CHR_SELF, 200) + set_chr_maxdamage(CHR_SELF, 200) set_alertness(100) set_chr_id(0x11) try_equip_weapon(MODEL_CHRFALCON2, WEAPON_FALCON2, 0x40000000, /*goto*/ 0x06) @@ -5061,7 +5061,7 @@ u8 func040f_holo6_init_guard4[] = { u8 func0415_holo_guard_unarmed_unalert[] = { set_alertness(100) - set_chr_health(CHR_SELF, 100) + set_chr_maxdamage(CHR_SELF, 100) yield yield yield @@ -5492,7 +5492,7 @@ u8 func0411_holo7_init_guard5[] = { u8 func0418_holo_guard_armed_unalert[] = { set_accuracy(50) set_reaction_speed(20) - set_chr_health(CHR_SELF, 40) + set_chr_maxdamage(CHR_SELF, 40) yield yield yield diff --git a/src/files/setup/setupear.c b/src/files/setup/setupear.c index 4c541ff7f..0b71a554f 100644 --- a/src/files/setup/setupear.c +++ b/src/files/setup/setupear.c @@ -825,8 +825,8 @@ s32 path13[] = { set_chr_dodge_rating(2, 0x0a) \ set_accuracy(1) \ set_reaction_speed(20) \ - set_chr_health(CHR_SELF, 40) \ - set_armor(0) \ + set_chr_maxdamage(CHR_SELF, 40) \ + add_health_or_armor(0) \ set_recovery_speed(0) \ set_shield(0) \ assign_path(pathid) \ @@ -904,7 +904,7 @@ u8 func0401_init_chr_with_flag[] = { }; u8 func0405_init_scientist[] = { - set_chr_health(CHR_SELF, 20) + set_chr_maxdamage(CHR_SELF, 20) set_ailist(CHR_SELF, FUNC_SCIENTIST) endlist }; @@ -3018,8 +3018,8 @@ u8 func040a_init_basic_guard[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(1) set_reaction_speed(20) - set_chr_health(CHR_SELF, 40) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) set_ailist(CHR_SELF, GFUNC_UNALERTED) @@ -3030,8 +3030,8 @@ u8 func040b_init_shock_guard[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(11) set_reaction_speed(20) - set_chr_health(CHR_SELF, 40) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(0) set_recovery_speed(10) set_shield(0) set_ailist(CHR_SELF, GFUNC_UNALERTED) diff --git a/src/files/setup/setupeld.c b/src/files/setup/setupeld.c index 43e9dcc7f..8d549cf2d 100644 --- a/src/files/setup/setupeld.c +++ b/src/files/setup/setupeld.c @@ -1448,7 +1448,7 @@ u8 func1004_check_negotiator[] = { }; u8 func0401_init_taker[] = { - set_chr_health(CHR_SELF, 1) + set_chr_maxdamage(CHR_SELF, 1) if_difficulty_gt(DIFF_SA, /*goto*/ 0x2d) unset_self_flag_bankx(CHRFLAG0_80000000, BANK_0) label(0x2d) @@ -1664,7 +1664,7 @@ u8 func100f_check_takers_dead[] = { }; u8 func0403_negotiator[] = { - set_chr_health(CHR_SELF, 1) + set_chr_maxdamage(CHR_SELF, 1) stop_chr beginloop(0x09) @@ -2494,8 +2494,8 @@ u8 func1015_check_computers_destroyed[] = { set_chr_dodge_rating(2, 0x0a) \ set_accuracy(accuracy) \ set_reaction_speed(reaction) \ - set_chr_health(CHR_SELF, health) \ - set_armor(0) \ + set_chr_maxdamage(CHR_SELF, health) \ + add_health_or_armor(0) \ set_recovery_speed(recovery) \ set_shield(0) @@ -2942,7 +2942,7 @@ u8 func101d_dual_cmp150[] = { }; u8 func0407_init_sniper[] = { - set_chr_health(CHR_SELF, 1) + set_chr_maxdamage(CHR_SELF, 1) stop_chr set_ailist(CHR_SELF, GFUNC_IDLE) endlist @@ -2952,7 +2952,7 @@ u8 func0410_carrington[] = { yield set_self_chrflag(CHRCFLAG_INVINCIBLE_TO_GUNFIRE) set_self_chrflag(CHRCFLAG_UNEXPLODABLE) - set_chr_health(CHR_SELF, 1) + set_chr_maxdamage(CHR_SELF, 1) chr_do_animation(0x017b, 1, 1, 0x06, 0x00, CHR_CARRINGTON, 2) set_ailist(CHR_SELF, GFUNC_IDLE) endlist diff --git a/src/files/setup/setupimp.c b/src/files/setup/setupimp.c index a59c23693..1d97db81c 100644 --- a/src/files/setup/setupimp.c +++ b/src/files/setup/setupimp.c @@ -613,8 +613,8 @@ u8 func1400_setup_counterop[] = { set_chr_dodge_rating(2, 0x00) \ set_accuracy(20) \ set_reaction_speed(70) \ - set_chr_health(CHR_SELF, 40) \ - set_armor(0) \ + set_chr_maxdamage(CHR_SELF, 40) \ + add_health_or_armor(0) \ set_recovery_speed(0) \ set_shield(90) \ set_self_flag_bankx(CHRFLAG1_00080000, BANK_1) \ @@ -1575,7 +1575,7 @@ u8 func100c_check_carrington_dead[] = { u8 func0415_init_hostage_fr1[] = { set_morale(5) - set_chr_health(CHR_SELF, 1) + set_chr_maxdamage(CHR_SELF, 1) set_accuracy(0) set_ailist(CHR_SELF, FUNC_FIRINGRANGE_HOSTAGE) endlist @@ -1583,7 +1583,7 @@ u8 func0415_init_hostage_fr1[] = { u8 func0416_init_hostage_fr2[] = { set_morale(7) - set_chr_health(CHR_SELF, 1) + set_chr_maxdamage(CHR_SELF, 1) set_accuracy(0) set_ailist(CHR_SELF, FUNC_FIRINGRANGE_HOSTAGE) endlist @@ -1707,7 +1707,7 @@ u8 func0419_init_firingrange_taker[] = { u8 func041b_init_hostage_holo[] = { set_morale(3) - set_chr_health(CHR_SELF, 1) + set_chr_maxdamage(CHR_SELF, 1) set_ailist(CHR_SELF, FUNC_HOSTAGE_HOLO) endlist }; @@ -1816,7 +1816,7 @@ u8 func041c_init_holoclone1[] = { rebuild_squadrons play_sound(0x05bc, CHANNEL_9) set_shotlist(FUNC_HOLOCLONE_ONSHOT) - set_chr_health(CHR_SELF, 1) + set_chr_maxdamage(CHR_SELF, 1) set_chr_id(CHR_HOLOCLONE1) jog_to_pad(0x0108) set_ailist(CHR_SELF, FUNC_HOLOCLONE) @@ -1829,7 +1829,7 @@ u8 func041d_init_holoclone2[] = { rebuild_squadrons play_sound(0x05bc, CHANNEL_5) set_shotlist(FUNC_HOLOCLONE_ONSHOT) - set_chr_health(CHR_SELF, 1) + set_chr_maxdamage(CHR_SELF, 1) set_chr_id(CHR_HOLOCLONE2) jog_to_pad(0x0109) set_ailist(CHR_SELF, FUNC_HOLOCLONE) @@ -1842,7 +1842,7 @@ u8 func041e_init_holoclone3[] = { rebuild_squadrons play_sound(0x05bc, CHANNEL_6) set_shotlist(FUNC_HOLOCLONE_ONSHOT) - set_chr_health(CHR_SELF, 1) + set_chr_maxdamage(CHR_SELF, 1) set_chr_id(CHR_HOLOCLONE3) jog_to_pad(0x010a) set_ailist(CHR_SELF, FUNC_HOLOCLONE) @@ -1934,8 +1934,8 @@ u8 func0423_init_shock[] = { set_chr_dodge_rating(2, 0x00) set_accuracy(20) set_reaction_speed(70) - set_chr_health(CHR_SELF, 40) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(0) set_recovery_speed(0) set_shield(90) set_ailist(CHR_SELF, GFUNC_IDLE) @@ -1948,8 +1948,8 @@ u8 func0426_init_saved_hostage[] = { if_chr_dying(CHR_SELF, /*goto*/ 0x2e) if_chr_unloaded(CHR_SELF, /*goto*/ 0x2e) set_chr_team(CHR_SELF, TEAM_NONCOMBAT) - set_armor(80) - set_chr_health(CHR_SELF, 1) + add_health_or_armor(80) + set_chr_maxdamage(CHR_SELF, 1) rebuild_teams rebuild_squadrons set_ailist(CHR_SELF, FUNC_HOSTAGE_THANK_AND_RUN) @@ -2036,7 +2036,7 @@ u8 func0428_init_drop_devastator[] = { unset_self_chrflag(CHRCFLAG_KILLCOUNTABLE) set_shotlist(FUNC_HOSTAGE_THANK_AND_RUN) set_chr_team(CHR_SELF, TEAM_NONCOMBAT) - set_chr_health(CHR_SELF, 40) + set_chr_maxdamage(CHR_SELF, 40) rebuild_teams rebuild_squadrons set_ailist(CHR_SELF, FUNC_DROP_DEVASTATOR) @@ -2180,14 +2180,14 @@ u8 func1011_check_info_takers_dead[] = { u8 func042c_init_hostage_device_f[] = { set_morale(1) - set_chr_health(CHR_SELF, 1) + set_chr_maxdamage(CHR_SELF, 1) set_ailist(CHR_SELF, FUNC_DEVICEROOM_HOSTAGE) endlist }; u8 func042d_init_hostage_device_m[] = { set_morale(6) - set_chr_health(CHR_SELF, 1) + set_chr_maxdamage(CHR_SELF, 1) set_ailist(CHR_SELF, FUNC_DEVICEROOM_HOSTAGE) endlist }; @@ -2228,7 +2228,7 @@ u8 func042b_deviceroom_hostage[] = { }; u8 func042f_init_taker_device_m[] = { - set_chr_health(CHR_SELF, 1) + set_chr_maxdamage(CHR_SELF, 1) set_ailist(CHR_SELF, FUNC_TAKER_DEVICE_M) endlist }; @@ -2280,7 +2280,7 @@ u8 func042e_taker_device_m[] = { }; u8 func0431_init_taker_device_f[] = { - set_chr_health(CHR_SELF, 1) + set_chr_maxdamage(CHR_SELF, 1) set_ailist(CHR_SELF, FUNC_TAKER_DEVICE_F) endlist }; @@ -2380,16 +2380,16 @@ u8 func0432_taker_attack[] = { u8 func0434_init_hostage_info_m[] = { set_morale(2) - set_armor(10) - set_chr_health(CHR_SELF, 1) + add_health_or_armor(10) + set_chr_maxdamage(CHR_SELF, 1) set_ailist(CHR_SELF, FUNC_INFOROOM_HOSTAGE) endlist }; u8 func0435_init_hostage_info_f[] = { set_morale(8) - set_armor(10) - set_chr_health(CHR_SELF, 1) + add_health_or_armor(10) + set_chr_maxdamage(CHR_SELF, 1) set_ailist(CHR_SELF, FUNC_INFOROOM_HOSTAGE) endlist }; @@ -2470,14 +2470,14 @@ u8 func1012_info_room[] = { set_chr_flag_bankx(CHR_HOSTAGE_INFO_M, CHRFLAG0_00002000, BANK_0) set_chr_flag_bankx(CHR_HOSTAGE_INFO_F, CHRFLAG0_00002000, BANK_0) set_chr_flag_bankx(CHR_HOSTAGE_INFO_M, CHRFLAG0_00000004, BANK_0) - set_chr_health(CHR_TAKER_INFO_M, 10) + set_chr_maxdamage(CHR_TAKER_INFO_M, 10) goto_next(0x2e) label(0x0a) set_chr_flag_bankx(CHR_HOSTAGE_INFO_M, CHRFLAG0_00002000, BANK_0) set_chr_flag_bankx(CHR_HOSTAGE_INFO_F, CHRFLAG0_00002000, BANK_0) set_chr_flag_bankx(CHR_HOSTAGE_INFO_F, CHRFLAG0_00000004, BANK_0) - set_chr_health(CHR_TAKER_INFO_F, 10) + set_chr_maxdamage(CHR_TAKER_INFO_F, 10) label(0x2e) restart_timer @@ -2494,7 +2494,7 @@ u8 func1012_info_room[] = { }; u8 func0437_init_taker_info_m[] = { - set_chr_health(CHR_SELF, 1) + set_chr_maxdamage(CHR_SELF, 1) set_ailist(CHR_SELF, FUNC_TAKER_INFO_M) endlist }; @@ -2527,7 +2527,7 @@ u8 func0436_taker_info_m[] = { }; u8 func0439_init_taker_info_f[] = { - set_chr_health(CHR_SELF, 1) + set_chr_maxdamage(CHR_SELF, 1) set_ailist(CHR_SELF, FUNC_TAKER_INFO_F) endlist }; @@ -3000,8 +3000,8 @@ u8 func1015_firingrange_pc[] = { set_chr_dodge_rating(2, 0x00) \ set_accuracy(20) \ set_reaction_speed(70) \ - set_chr_health(CHR_SELF, 40) \ - set_armor(0) \ + set_chr_maxdamage(CHR_SELF, 40) \ + add_health_or_armor(0) \ set_recovery_speed(0) \ set_shield(90) \ set_self_flag_bankx(CHRFLAG1_00080000, BANK_1) \ @@ -3297,7 +3297,7 @@ u8 func1022_skedar_shuttle[] = { }; u8 func043a_unused[] = { - set_chr_health(CHR_SELF, 1) + set_chr_maxdamage(CHR_SELF, 1) beginloop(0x12) if_objective_complete(3, /*goto*/ 0x08) @@ -3355,8 +3355,8 @@ u8 func043b_init_blonde[] = { set_chr_dodge_rating(2, 0x00) set_accuracy(20) set_reaction_speed(70) - set_chr_health(CHR_SELF, 40) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(0) set_recovery_speed(0) set_shield(90) set_returnlist(CHR_SELF, GFUNC_UNALERTED) @@ -3368,8 +3368,8 @@ u8 func043c_init_cisolder[] = { set_chr_dodge_rating(2, 0x00) set_accuracy(20) set_reaction_speed(70) - set_chr_health(CHR_SELF, 40) - set_armor(90) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(90) set_recovery_speed(0) set_shield(0) set_ailist(CHR_SELF, FUNC_DEFEND_PAD) @@ -3380,8 +3380,8 @@ u8 func043d_unused[] = { set_chr_dodge_rating(2, 0x00) set_accuracy(30) set_reaction_speed(70) - set_chr_health(CHR_SELF, 40) - set_armor(90) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(90) set_recovery_speed(0) set_shield(0) set_ailist(CHR_SELF, GFUNC_UNALERTED) @@ -3409,8 +3409,8 @@ u8 func0429_skedar4[] = { stop_chr set_accuracy(40) set_reaction_speed(70) - set_chr_health(CHR_SELF, 40) - set_armor(160) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(160) set_recovery_speed(0) set_shield(0) jog_to_pad(0x000c) @@ -3566,8 +3566,8 @@ u8 func1020_trigger_spawning[] = { u8 func042a_init_jonathan[] = { set_accuracy(100) set_reaction_speed(100) - set_chr_health(CHR_SELF, 40) - set_armor(1200) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(1200) set_recovery_speed(100) set_ailist(CHR_SELF, FUNC_DEFEND_PAD) endlist diff --git a/src/files/setup/setuplee.c b/src/files/setup/setuplee.c index 52b53906d..e9023cf06 100644 --- a/src/files/setup/setuplee.c +++ b/src/files/setup/setuplee.c @@ -654,7 +654,7 @@ u8 func040d_elvis_wait_for_hangar_entry[] = { set_self_chrflag(CHRCFLAG_00040000) set_accuracy(100) set_reaction_speed(100) - set_armor(200) + add_health_or_armor(200) set_alertness(100) set_self_chrflag(CHRCFLAG_HIDDEN) set_self_chrflag(CHRCFLAG_INVINCIBLE_TO_GUNFIRE) @@ -935,7 +935,7 @@ u8 func0409_elvis_follow[] = { u8 func041d_init_elvis_outside_prebridgelift[] = { set_shotlist(FUNC_ELVIS_OUTSIDE_PREBRIDGELIFT) - set_armor(600) + add_health_or_armor(600) set_ailist(CHR_SELF, FUNC_ELVIS_OUTSIDE_PREBRIDGELIFT) endlist }; @@ -1117,8 +1117,8 @@ u8 func040f_init_skedar[] = { // Alive set_accuracy(20) set_reaction_speed(75) - set_chr_health(CHR_SELF, 10) - set_armor(190) + set_chr_maxdamage(CHR_SELF, 10) + add_health_or_armor(190) set_recovery_speed(0) set_shield(0) set_ailist(CHR_SELF, GFUNC_RELATED_TO_SPAWNING) @@ -1142,8 +1142,8 @@ u8 func0410_wake_suspendedanim_skedar[] = { label(0x06) set_accuracy(20) set_reaction_speed(75) - set_chr_health(CHR_SELF, 10) - set_armor(190) + set_chr_maxdamage(CHR_SELF, 10) + add_health_or_armor(190) set_recovery_speed(0) set_shield(0) set_target_chr(CHR_BOND) @@ -1465,7 +1465,7 @@ u8 func1008_hangar_lifts[] = { }; u8 func0407_init_knifeable_skedar[] = { - set_armor(160) + add_health_or_armor(160) set_self_flag_bankx(CHRFLAG1_00080000, BANK_1) set_self_chrflag(CHRCFLAG_00040000) set_ailist(CHR_SELF, FUNC_KNIFEABLE_SKEDAR) @@ -1605,8 +1605,8 @@ u8 func1009_keep_door_open_in_intro[] = { #define init_path(pathid) \ set_accuracy(20) \ set_reaction_speed(75) \ - set_chr_health(CHR_SELF, 10) \ - set_armor(190) \ + set_chr_maxdamage(CHR_SELF, 10) \ + add_health_or_armor(190) \ set_recovery_speed(0) \ set_shield(0) \ assign_path(pathid) \ @@ -1818,7 +1818,7 @@ u8 func0418_init_hangar_maian[] = { label(0x06) unset_self_chrflag(CHRCFLAG_HIDDEN) - set_armor(200) + add_health_or_armor(200) set_reaction_speed(100) set_ailist(CHR_SELF, FUNC_HANGAR_MAIAN) endlist @@ -2124,8 +2124,8 @@ u8 func100e_bridgelift[] = { u8 func0415_bridgespawner[] = { set_accuracy(20) set_reaction_speed(75) - set_chr_health(CHR_SELF, 10) - set_armor(190) + set_chr_maxdamage(CHR_SELF, 10) + add_health_or_armor(190) set_recovery_speed(0) set_shield(0) set_chr_chrflag(CHR_SELF, CHRCFLAG_KILLCOUNTABLE) @@ -2212,8 +2212,8 @@ u8 func0416_init_bridgeclone[] = { set_chr_hiddenflag(CHR_SELF, CHRHFLAG_00400000) set_accuracy(20) set_reaction_speed(75) - set_chr_health(CHR_SELF, 10) - set_armor(190) + set_chr_maxdamage(CHR_SELF, 10) + add_health_or_armor(190) set_recovery_speed(0) set_shield(0) set_chr_chrflag(CHR_SELF, CHRCFLAG_KILLCOUNTABLE) @@ -2232,7 +2232,7 @@ u8 func0416_init_bridgeclone[] = { try_inherit_properties(CHR_BRIDGESPAWNER2, /*goto*/ 0x06) label(0x06) - set_armor(40) + add_health_or_armor(40) set_ailist(CHR_SELF, FUNC_BRIDGECLONE) endlist }; @@ -2919,8 +2919,8 @@ u8 func0c01_outro[] = { #define init_skedar(function) \ set_accuracy(20) \ set_reaction_speed(75) \ - set_chr_health(CHR_SELF, 10) \ - set_armor(190) \ + set_chr_maxdamage(CHR_SELF, 10) \ + add_health_or_armor(190) \ set_recovery_speed(0) \ set_shield(0) \ set_ailist(CHR_SELF, function) @@ -3572,7 +3572,7 @@ u8 func1022_setup_rtracker[] = { }; u8 func040b_init_cass[] = { - set_chr_health(CHR_SELF, 1) + set_chr_maxdamage(CHR_SELF, 1) set_ailist(CHR_SELF, GFUNC_IDLE) endlist }; diff --git a/src/files/setup/setuplip.c b/src/files/setup/setuplip.c index 671a29422..4e5556a55 100644 --- a/src/files/setup/setuplip.c +++ b/src/files/setup/setuplip.c @@ -1157,8 +1157,8 @@ u8 func1006_check_lab_accessed[] = { set_chr_dodge_rating(2, 0x0a) \ set_accuracy(accuracy) \ set_reaction_speed(35) \ - set_chr_health(CHR_SELF, health) \ - set_armor(0) \ + set_chr_maxdamage(CHR_SELF, health) \ + add_health_or_armor(0) \ set_recovery_speed(recovery) \ set_shield(0) \ assign_path(pathid) \ @@ -1672,8 +1672,8 @@ u8 func100a_random_doors[] = { u8 func0419_init_doorman[] = { set_accuracy(10) set_reaction_speed(35) - set_chr_health(CHR_SELF, 1) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 1) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) set_ailist(CHR_SELF, FUNC_DOORMAN) @@ -2246,7 +2246,7 @@ u8 func1010_give_keycard[] = { }; u8 func0414_init_mechanic[] = { - set_chr_health(CHR_SELF, 1) + set_chr_maxdamage(CHR_SELF, 1) set_ailist(CHR_SELF, FUNC_MECHANIC) endlist }; @@ -2533,8 +2533,8 @@ u8 func041e_unused_041e[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(10) set_reaction_speed(35) - set_chr_health(CHR_SELF, 80) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 80) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) set_chr_chrflag(CHR_SELF, CHRCFLAG_INVINCIBLE_TO_GUNFIRE) @@ -2773,7 +2773,7 @@ u8 func041f_labtech_lights[] = { }; u8 func0421_init_labtech_doors[] = { - set_chr_health(CHR_SELF, 1) + set_chr_maxdamage(CHR_SELF, 1) set_ailist(CHR_SELF, FUNC_LABTECH_DOORS) endlist }; @@ -2986,7 +2986,7 @@ u8 func1017_activate_autogun[] = { }; u8 func0423_init_labtech_records[] = { - set_chr_health(CHR_SELF, 1) + set_chr_maxdamage(CHR_SELF, 1) set_ailist(CHR_SELF, FUNC_LABTECH_RECORDS) endlist }; @@ -4011,8 +4011,8 @@ u8 func0429_spawn_while_xraying[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(8) set_reaction_speed(35) - set_chr_health(CHR_SELF, 50) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 50) + add_health_or_armor(0) set_recovery_speed(35) set_shield(0) set_self_chrflag(CHRCFLAG_00000002) @@ -4092,8 +4092,8 @@ u8 func042c_dragon_guard[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(8) set_reaction_speed(35) - set_chr_health(CHR_SELF, 50) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 50) + add_health_or_armor(0) set_recovery_speed(35) set_shield(0) set_ailist(CHR_SELF, GFUNC_UNALERTED) @@ -4104,8 +4104,8 @@ u8 func042d_superdragon_guard[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(10) set_reaction_speed(35) - set_chr_health(CHR_SELF, 80) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 80) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) set_ailist(CHR_SELF, GFUNC_UNALERTED) @@ -4116,8 +4116,8 @@ u8 func042e_biotech_guard[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(18) set_reaction_speed(35) - set_chr_health(CHR_SELF, 80) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 80) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) set_ailist(CHR_SELF, GFUNC_UNALERTED) @@ -4128,8 +4128,8 @@ u8 func042e_biotech_guard_alerted[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(18) set_reaction_speed(35) - set_chr_health(CHR_SELF, 80) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 80) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) set_target_chr(CHR_BOND) diff --git a/src/files/setup/setuplue.c b/src/files/setup/setuplue.c index 8ef62b049..dda179d5a 100644 --- a/src/files/setup/setuplue.c +++ b/src/files/setup/setuplue.c @@ -851,8 +851,8 @@ u8 func0426_8420[] = { set_chr_dodge_rating(2, 0x0a) \ set_accuracy(6) \ set_reaction_speed(50) \ - set_chr_health(CHR_SELF, 40) \ - set_armor(0) \ + set_chr_maxdamage(CHR_SELF, 40) \ + add_health_or_armor(0) \ set_recovery_speed(0) \ set_shield(0) \ assign_path(pathid) \ @@ -1370,8 +1370,8 @@ u8 func0411_init_hangar_guard1[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(8) set_reaction_speed(30) - set_chr_health(CHR_SELF, 40) - set_armor(10) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(10) set_recovery_speed(35) set_shield(0) set_squadron(SQUADRON_0B) @@ -1392,8 +1392,8 @@ u8 func0412_init_hangar_guard2[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(8) set_reaction_speed(30) - set_chr_health(CHR_SELF, 40) - set_armor(10) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(10) set_recovery_speed(35) set_shield(0) set_self_flag_bankx(CHRFLAG1_00080000, BANK_1) @@ -1414,8 +1414,8 @@ u8 func0413_init_hangar_guard3[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(8) set_reaction_speed(30) - set_chr_health(CHR_SELF, 40) - set_armor(10) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(10) set_recovery_speed(35) set_shield(0) set_self_flag_bankx(CHRFLAG1_00080000, BANK_1) @@ -1436,8 +1436,8 @@ u8 func0414_init_hangar_guard4[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(8) set_reaction_speed(30) - set_chr_health(CHR_SELF, 40) - set_armor(10) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(10) set_recovery_speed(35) set_shield(0) set_self_flag_bankx(CHRFLAG1_00080000, BANK_1) @@ -1662,7 +1662,7 @@ u8 func1001_objectives_failed_msg[] = { }; u8 func040a_top_interceptor[] = { - set_chr_health(CHR_SELF, 5000) + set_chr_maxdamage(CHR_SELF, 5000) set_object_flag_bank0(OBJ_INTERCEPTOR3, OBJECTFLAG0_INTERCEPTOR_DISABLED) restart_timer @@ -1677,7 +1677,7 @@ u8 func040a_top_interceptor[] = { unset_object_flag_bank0(OBJ_INTERCEPTOR3, OBJECTFLAG0_INTERCEPTOR_DISABLED) cmd0143 begin_hovercar_path(0x22) - set_chr_health(CHR_SELF, 5000) + set_chr_maxdamage(CHR_SELF, 5000) beginloop(0x04) chr_toggle_p1p2(CHR_SELF) @@ -1727,7 +1727,7 @@ u8 func040a_top_interceptor[] = { }; u8 func040c_init_bottom_interceptors[] = { - set_chr_health(CHR_SELF, 5000) + set_chr_maxdamage(CHR_SELF, 5000) set_object_flag_bank0(OBJ_INTERCEPTOR1, OBJECTFLAG0_INTERCEPTOR_DISABLED) set_object_flag_bank0(OBJ_INTERCEPTOR2, OBJECTFLAG0_INTERCEPTOR_DISABLED) @@ -2617,8 +2617,8 @@ u8 func0419_clone_spawner[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(8) set_reaction_speed(30) - set_chr_health(CHR_SELF, 40) - set_armor(10) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(10) set_recovery_speed(35) set_shield(0) set_self_chrflag(CHRCFLAG_00000002) @@ -2764,8 +2764,8 @@ u8 func040f_spawned_guard[] = { #define init_guard(accuracy, reaction, armor, recovery, function) \ set_accuracy(accuracy) \ set_reaction_speed(reaction) \ - set_chr_health(CHR_SELF, 40) \ - set_armor(armor) \ + set_chr_maxdamage(CHR_SELF, 40) \ + add_health_or_armor(armor) \ set_recovery_speed(recovery) \ set_shield(0) \ set_ailist(CHR_SELF, function) diff --git a/src/files/setup/setupoat.c b/src/files/setup/setupoat.c index 387778d13..db9c90058 100644 --- a/src/files/setup/setupoat.c +++ b/src/files/setup/setupoat.c @@ -46,7 +46,7 @@ u8 func0406_idle[] = { }; u8 func0408_idle_with_10_health[] = { - set_chr_health(CHR_SELF, 10) + set_chr_maxdamage(CHR_SELF, 10) set_ailist(CHR_SELF, GFUNC_IDLE) endlist }; diff --git a/src/files/setup/setuppam.c b/src/files/setup/setuppam.c index 3416c99b9..529bc9ad6 100644 --- a/src/files/setup/setuppam.c +++ b/src/files/setup/setuppam.c @@ -744,8 +744,8 @@ u8 func040b_init_elvis[] = { set_accuracy(100) set_reaction_speed(100) set_alertness(100) - set_chr_health(CHR_SELF, 1) - set_armor(900) + set_chr_maxdamage(CHR_SELF, 1) + add_health_or_armor(900) set_ailist(CHR_SELF, FUNC_ELVIS_FOLLOW_AND_REACTIVATE_TELEPORTALS) endlist }; @@ -2213,8 +2213,8 @@ u8 func042f_init_pelagic_guard[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(20) set_reaction_speed(65) - set_chr_health(CHR_SELF, 70) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 70) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) set_ailist(CHR_SELF, GFUNC_UNALERTED) @@ -2224,8 +2224,8 @@ u8 func042f_init_pelagic_guard[] = { u8 func0430_unused[] = { set_accuracy(20) set_reaction_speed(65) - set_chr_health(CHR_SELF, 10) - set_armor(70) + set_chr_maxdamage(CHR_SELF, 10) + add_health_or_armor(70) set_recovery_speed(0) set_shield(0) set_ailist(CHR_SELF, GFUNC_UNALERTED) @@ -3089,8 +3089,8 @@ u8 func041a_init_sniper[] = { // SA and PA set_accuracy(30) set_reaction_speed(65) - set_chr_health(CHR_SELF, 10) - set_armor(70) + set_chr_maxdamage(CHR_SELF, 10) + add_health_or_armor(70) set_recovery_speed(0) set_shield(0) set_ailist(CHR_SELF, FUNC_SNIPER_WAIT_FOR_DETECTION) @@ -3099,8 +3099,8 @@ u8 func041a_init_sniper[] = { label(0x2e) set_accuracy(20) set_reaction_speed(65) - set_chr_health(CHR_SELF, 10) - set_armor(70) + set_chr_maxdamage(CHR_SELF, 10) + add_health_or_armor(70) set_recovery_speed(0) set_shield(0) set_ailist(CHR_SELF, FUNC_SNIPER_WAIT_FOR_DETECTION) @@ -3391,8 +3391,8 @@ u8 func040e_init_miniskedar[] = { set_self_chrflag(CHRCFLAG_00020000) set_accuracy(0) set_reaction_speed(65) - set_chr_health(CHR_SELF, 20) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 20) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) set_self_chrflag(CHRCFLAG_00080000) @@ -4125,8 +4125,8 @@ u8 func1021_c6c4[] = { set_chr_dodge_rating(2, 0x0a) \ set_accuracy(20) \ set_reaction_speed(65) \ - set_chr_health(CHR_SELF, 70) \ - set_armor(0) \ + set_chr_maxdamage(CHR_SELF, 70) \ + add_health_or_armor(0) \ set_recovery_speed(0) \ set_shield(0) \ set_returnlist(CHR_SELF, function) \ @@ -4435,8 +4435,8 @@ u8 func042b_run_to_exit[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(40) set_reaction_speed(65) - set_chr_health(CHR_SELF, 10) - set_armor(70) + set_chr_maxdamage(CHR_SELF, 10) + add_health_or_armor(70) set_recovery_speed(0) set_shield(0) label(0x04) @@ -4506,8 +4506,8 @@ u8 func040f_miniskedar_unalerted[] = { set_self_chrflag(CHRCFLAG_00020000) set_accuracy(0) set_reaction_speed(65) - set_chr_health(CHR_SELF, 20) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 20) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) set_self_chrflag(CHRCFLAG_00080000) diff --git a/src/files/setup/setuppete.c b/src/files/setup/setuppete.c index 9b78f3ec6..5f213075f 100644 --- a/src/files/setup/setuppete.c +++ b/src/files/setup/setuppete.c @@ -865,12 +865,12 @@ u8 func040d_limo[] = { if_difficulty_lt(DIFF_SA, /*goto*/ 0x03) // SA and PA - set_chr_health(CHR_SELF, 34464) + set_chr_maxdamage(CHR_SELF, 34464) goto_next(0x04) // A label(0x03) - set_chr_health(CHR_SELF, 65456) + set_chr_maxdamage(CHR_SELF, 65456) // All difficulties label(0x04) @@ -916,12 +916,12 @@ u8 func040c_taxi[] = { if_difficulty_lt(DIFF_SA, /*goto*/ 0x03) // SA and PA - set_chr_health(CHR_SELF, 34464) + set_chr_maxdamage(CHR_SELF, 34464) goto_next(0x04) // A label(0x03) - set_chr_health(CHR_SELF, 65456) + set_chr_maxdamage(CHR_SELF, 65456) begin_hovercar_path(0x04) set_vehicle_speed(SPEED_WALK, 0) @@ -1732,8 +1732,8 @@ u8 func0413_bugspotter[] = { set_chr_dodge_rating(2, 0x0a) \ set_accuracy(4) \ set_reaction_speed(30) \ - set_chr_health(CHR_SELF, 40) \ - set_armor(0) \ + set_chr_maxdamage(CHR_SELF, 40) \ + add_health_or_armor(0) \ set_recovery_speed(0) \ set_shield(0) \ assign_path(pathid) \ @@ -1959,7 +1959,7 @@ u8 func041b_init_robot[] = { u8 func041a_robot[] = { set_self_chrflag(CHRCFLAG_00040000) - set_chr_health(CHR_SELF, 1) + set_chr_maxdamage(CHR_SELF, 1) if_chr_dying(CHR_SELF, /*goto*/ 0x0c) assign_path(0) start_path @@ -2089,8 +2089,8 @@ u8 func041e_sealer1[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(4) set_reaction_speed(30) - set_chr_health(CHR_SELF, 40) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) set_shotlist(GFUNC_IDLE) @@ -2360,8 +2360,8 @@ u8 func041f_alarm_responder[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(14) set_reaction_speed(20) - set_chr_health(CHR_SELF, 40) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) try_equip_weapon(MODEL_CHRDY357, WEAPON_DY357MAGNUM, 0x00000000, /*goto*/ 0x04) @@ -2892,8 +2892,8 @@ u8 func040e_6064[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(4) set_reaction_speed(30) - set_chr_health(CHR_SELF, 40) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) set_ailist(CHR_SELF, GFUNC_UNALERTED) @@ -2905,8 +2905,8 @@ u8 func040f_6088[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(20) set_reaction_speed(30) - set_chr_health(CHR_SELF, 40) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) set_ailist(CHR_SELF, GFUNC_UNALERTED) @@ -2914,8 +2914,8 @@ u8 func040f_6088[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(4) set_reaction_speed(30) - set_chr_health(CHR_SELF, 40) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) set_ailist(CHR_SELF, GFUNC_UNALERTED) @@ -2926,8 +2926,8 @@ u8 func0410_60d0[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(14) set_reaction_speed(20) - set_chr_health(CHR_SELF, 40) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) set_ailist(CHR_SELF, GFUNC_UNALERTED) @@ -2939,8 +2939,8 @@ u8 func0411_60f4[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(14) set_reaction_speed(20) - set_chr_health(CHR_SELF, 40) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(0) set_recovery_speed(40) set_shield(0) set_ailist(CHR_SELF, FUNC_FBI) diff --git a/src/files/setup/setuprit.c b/src/files/setup/setuprit.c index 8e88b47a8..bf8a1cd47 100644 --- a/src/files/setup/setuprit.c +++ b/src/files/setup/setuprit.c @@ -709,24 +709,24 @@ u8 func1006_hijack[] = { label(0x06) cmd01da(0x35) - set_chr_health(0x01, 10) - set_chr_health(0x04, 10) - set_chr_health(0x05, 10) - set_chr_health(0x06, 10) - set_chr_health(0x07, 10) - set_chr_health(0x08, 10) - set_chr_health(0x09, 10) - set_chr_health(0x0a, 10) - set_chr_health(0x0b, 10) - set_chr_health(0x0c, 10) - set_chr_health(0x0d, 10) - set_chr_health(0x0e, 10) - set_chr_health(0x0f, 10) - set_chr_health(0x10, 10) - set_chr_health(0x16, 10) - set_chr_health(0x17, 10) - set_chr_health(CHR_PILOT1, 10) - set_chr_health(CHR_PILOT2, 10) + set_chr_maxdamage(0x01, 10) + set_chr_maxdamage(0x04, 10) + set_chr_maxdamage(0x05, 10) + set_chr_maxdamage(0x06, 10) + set_chr_maxdamage(0x07, 10) + set_chr_maxdamage(0x08, 10) + set_chr_maxdamage(0x09, 10) + set_chr_maxdamage(0x0a, 10) + set_chr_maxdamage(0x0b, 10) + set_chr_maxdamage(0x0c, 10) + set_chr_maxdamage(0x0d, 10) + set_chr_maxdamage(0x0e, 10) + set_chr_maxdamage(0x0f, 10) + set_chr_maxdamage(0x10, 10) + set_chr_maxdamage(0x16, 10) + set_chr_maxdamage(0x17, 10) + set_chr_maxdamage(CHR_PILOT1, 10) + set_chr_maxdamage(CHR_PILOT2, 10) set_ailist(0x01, FUNC_REMOVE_IF_OFFSCREEN) yield set_ailist(CHR_STEWARDESS, FUNC_REMOVE_IF_OFFSCREEN) @@ -1163,7 +1163,7 @@ u8 func100a_autopilot_switch[] = { }; u8 func0406_init_president[] = { - set_chr_health(CHR_SELF, 0) + set_chr_maxdamage(CHR_SELF, 0) set_ailist(CHR_SELF, FUNC_PRESIDENT_IN_ROOM) endlist }; @@ -1412,7 +1412,7 @@ u8 func0405_president_in_room[] = { label(0x06) set_follow_chr(CHR_TARGET) - set_chr_health(CHR_SELF, 500) + set_chr_maxdamage(CHR_SELF, 500) set_shotlist(FUNC_PRESIDENT_RUNNING) set_ailist(CHR_SELF, FUNC_PRESIDENT_RUNNING) @@ -1671,8 +1671,8 @@ u8 func100c_cockpit_stripes[] = { set_chr_dodge_rating(2, 0x00) set_accuracy(14) set_reaction_speed(50) - set_chr_health(CHR_SELF, 60) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 60) + add_health_or_armor(0) set_recovery_speed(30) set_shield(0) set_self_chrflag(CHRCFLAG_00000040) @@ -1709,8 +1709,8 @@ u8 func0413_taker1[] = { set_self_chrflag(CHRCFLAG_00000020) set_chr_dodge_rating(2, 0x00) set_reaction_speed(50) - set_chr_health(CHR_SELF, 60) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 60) + add_health_or_armor(0) set_recovery_speed(30) set_shield(0) set_target_chr(CHR_PILOT1) @@ -1725,8 +1725,8 @@ u8 func0413_taker2[] = { set_self_chrflag(CHRCFLAG_00000020) set_chr_dodge_rating(2, 0x00) set_reaction_speed(50) - set_chr_health(CHR_SELF, 60) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 60) + add_health_or_armor(0) set_recovery_speed(30) set_shield(0) set_target_chr(CHR_PILOT2) @@ -1977,8 +1977,8 @@ u8 func0426_start_path00[] = { set_chr_dodge_rating(2, 0x00) set_accuracy(14) set_reaction_speed(70) - set_chr_health(CHR_SELF, 40) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) assign_path(0) @@ -1991,8 +1991,8 @@ u8 func0427_start_path01[] = { set_chr_dodge_rating(2, 0x00) set_accuracy(14) set_reaction_speed(70) - set_chr_health(CHR_SELF, 40) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) assign_path(1) @@ -2483,8 +2483,8 @@ u8 func0416_init_clone1[] = { set_chr_dodge_rating(2, 0x00) set_accuracy(14) set_reaction_speed(50) - set_chr_health(CHR_SELF, 60) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 60) + add_health_or_armor(0) set_recovery_speed(30) set_shield(0) set_self_flag_bankx(CHRFLAG1_00080000, BANK_1) @@ -2579,8 +2579,8 @@ u8 func0419_init_clone2[] = { set_chr_dodge_rating(2, 0x00) set_accuracy(14) set_reaction_speed(50) - set_chr_health(CHR_SELF, 60) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 60) + add_health_or_armor(0) set_recovery_speed(30) set_shield(0) set_self_flag_bankx(CHRFLAG1_00080000, BANK_1) @@ -2671,8 +2671,8 @@ u8 func041c_init_clone3[] = { set_chr_dodge_rating(2, 0x00) set_accuracy(14) set_reaction_speed(50) - set_chr_health(CHR_SELF, 60) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 60) + add_health_or_armor(0) set_recovery_speed(30) set_shield(0) set_self_flag_bankx(CHRFLAG1_00080000, BANK_1) @@ -2703,8 +2703,8 @@ u8 func041f_init_blonde[] = { set_chr_dodge_rating(2, 0x00) set_accuracy(24) set_reaction_speed(50) - set_chr_health(CHR_SELF, 60) - set_armor(100) + set_chr_maxdamage(CHR_SELF, 60) + add_health_or_armor(100) set_recovery_speed(100) set_shield(0) set_ailist(CHR_SELF, FUNC_BLONDE) @@ -3099,8 +3099,8 @@ u8 func042a_init_neutral[] = { set_chr_dodge_rating(2, 0x00) set_accuracy(14) set_reaction_speed(70) - set_chr_health(CHR_SELF, 40) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) rebuild_teams @@ -3113,8 +3113,8 @@ u8 func042b_reinit_stripes[] = { set_chr_dodge_rating(2, 0x00) set_accuracy(14) set_reaction_speed(50) - set_chr_health(CHR_SELF, 60) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 60) + add_health_or_armor(0) set_recovery_speed(30) set_shield(0) set_chr_team(CHR_SELF, TEAM_04) @@ -3262,7 +3262,7 @@ u8 func0407_steward_shot[] = { }; u8 func0407_stewardess[] = { - set_chr_health(CHR_SELF, 0) + set_chr_maxdamage(CHR_SELF, 0) set_shotlist(FUNC_STEWARDESS) if_chr_dying(CHR_SELF, /*goto*/ 0x06) if_chr_death_animation_finished(CHR_SELF, /*goto*/ 0x06) @@ -3781,7 +3781,7 @@ u8 func042c_remove_if_offscreen[] = { set_chr_team(CHR_SELF, TEAM_ALLY) rebuild_teams rebuild_squadrons - set_chr_health(CHR_SELF, 0) + set_chr_maxdamage(CHR_SELF, 0) label(0x04) yield diff --git a/src/files/setup/setupsev.c b/src/files/setup/setupsev.c index e453c7faf..ac0e8a4cd 100644 --- a/src/files/setup/setupsev.c +++ b/src/files/setup/setupsev.c @@ -878,8 +878,8 @@ u8 func1000_setup_counterop[] = { u8 func0401_start_path00[] = { set_accuracy(10) set_reaction_speed(0) - set_chr_health(CHR_SELF, 50) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 50) + add_health_or_armor(0) set_recovery_speed(35) set_shield(0) assign_path(0) @@ -891,8 +891,8 @@ u8 func0401_start_path00[] = { u8 func0402_start_path01[] = { set_accuracy(10) set_reaction_speed(0) - set_chr_health(CHR_SELF, 50) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 50) + add_health_or_armor(0) set_recovery_speed(35) set_shield(0) assign_path(1) @@ -904,8 +904,8 @@ u8 func0402_start_path01[] = { u8 func0403_start_path02[] = { set_accuracy(10) set_reaction_speed(0) - set_chr_health(CHR_SELF, 50) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 50) + add_health_or_armor(0) set_recovery_speed(35) set_shield(0) assign_path(2) @@ -917,8 +917,8 @@ u8 func0403_start_path02[] = { u8 func0404_start_path03[] = { set_accuracy(10) set_reaction_speed(0) - set_chr_health(CHR_SELF, 50) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 50) + add_health_or_armor(0) set_recovery_speed(35) set_shield(0) assign_path(3) @@ -930,8 +930,8 @@ u8 func0404_start_path03[] = { u8 func0405_start_path04[] = { set_accuracy(10) set_reaction_speed(0) - set_chr_health(CHR_SELF, 50) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 50) + add_health_or_armor(0) set_recovery_speed(35) set_shield(0) assign_path(4) @@ -943,8 +943,8 @@ u8 func0405_start_path04[] = { u8 func0406_start_path05[] = { set_accuracy(10) set_reaction_speed(0) - set_chr_health(CHR_SELF, 50) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 50) + add_health_or_armor(0) set_recovery_speed(35) set_shield(0) assign_path(5) @@ -956,8 +956,8 @@ u8 func0406_start_path05[] = { u8 func0407_start_path06[] = { set_accuracy(13) set_reaction_speed(0) - set_chr_health(CHR_SELF, 80) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 80) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) assign_path(6) @@ -969,8 +969,8 @@ u8 func0407_start_path06[] = { u8 func0408_start_path07[] = { set_accuracy(13) set_reaction_speed(0) - set_chr_health(CHR_SELF, 80) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 80) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) assign_path(7) @@ -982,8 +982,8 @@ u8 func0408_start_path07[] = { u8 func0409_start_path08[] = { set_accuracy(13) set_reaction_speed(0) - set_chr_health(CHR_SELF, 80) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 80) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) assign_path(8) @@ -995,8 +995,8 @@ u8 func0409_start_path08[] = { u8 func040a_start_path09[] = { set_accuracy(13) set_reaction_speed(0) - set_chr_health(CHR_SELF, 80) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 80) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) assign_path(9) @@ -1008,8 +1008,8 @@ u8 func040a_start_path09[] = { u8 func040b_start_path10[] = { set_accuracy(13) set_reaction_speed(0) - set_chr_health(CHR_SELF, 80) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 80) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) assign_path(10) @@ -1021,8 +1021,8 @@ u8 func040b_start_path10[] = { u8 func040c_start_path11[] = { set_accuracy(13) set_reaction_speed(0) - set_chr_health(CHR_SELF, 80) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 80) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) assign_path(11) @@ -1034,8 +1034,8 @@ u8 func040c_start_path11[] = { u8 func040d_start_path12[] = { set_accuracy(13) set_reaction_speed(0) - set_chr_health(CHR_SELF, 80) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 80) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) assign_path(12) @@ -1047,8 +1047,8 @@ u8 func040d_start_path12[] = { u8 func040e_start_path13[] = { set_accuracy(13) set_reaction_speed(0) - set_chr_health(CHR_SELF, 80) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 80) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) assign_path(13) @@ -1060,8 +1060,8 @@ u8 func040e_start_path13[] = { u8 func040f_start_path14[] = { set_accuracy(13) set_reaction_speed(0) - set_chr_health(CHR_SELF, 80) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 80) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) assign_path(14) @@ -1078,8 +1078,8 @@ u8 func1001_objectives_failed_msg[] = { u8 func0415_init_50hp_guard[] = { set_accuracy(10) set_reaction_speed(0) - set_chr_health(CHR_SELF, 50) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 50) + add_health_or_armor(0) set_recovery_speed(35) set_shield(0) set_ailist(CHR_SELF, GFUNC_UNALERTED) @@ -1089,8 +1089,8 @@ u8 func0415_init_50hp_guard[] = { u8 func0416_init_80hp_guard[] = { set_accuracy(13) set_reaction_speed(0) - set_chr_health(CHR_SELF, 80) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 80) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) set_ailist(CHR_SELF, GFUNC_UNALERTED) @@ -1100,8 +1100,8 @@ u8 func0416_init_80hp_guard[] = { u8 func0417_init_lx_guard[] = { set_accuracy(10) set_reaction_speed(100) - set_chr_health(CHR_SELF, 280) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 280) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) set_ailist(CHR_SELF, GFUNC_UNALERTED) @@ -1112,8 +1112,8 @@ u8 func0417_init_lx_guard[] = { u8 func0418_init_alerted_guard[] = { set_accuracy(13) set_reaction_speed(0) - set_chr_health(CHR_SELF, 80) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 80) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) set_ailist(CHR_SELF, GFUNC_ALERTED) @@ -1226,8 +1226,8 @@ u8 func0410_clone_spawner[] = { u8 func0411_init_clone[] = { set_accuracy(13) set_reaction_speed(0) - set_chr_health(CHR_SELF, 80) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 80) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) set_self_flag_bankx(CHRFLAG1_00080000, BANK_1) diff --git a/src/files/setup/setupsho.c b/src/files/setup/setupsho.c index ffc330361..eddf8f8aa 100644 --- a/src/files/setup/setupsho.c +++ b/src/files/setup/setupsho.c @@ -489,8 +489,8 @@ u8 intro[] = { u8 func0401_init_unarmed_skedar[] = { set_accuracy(0) set_reaction_speed(75) - set_chr_health(CHR_SELF, 40) - set_armor(160) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(160) set_recovery_speed(0) set_shield(0) set_self_chrflag(CHRCFLAG_00020000) @@ -720,8 +720,8 @@ u8 func0403_init_miniskedar[] = { set_self_chrflag(CHRCFLAG_00020000) set_accuracy(0) set_reaction_speed(75) - set_chr_health(CHR_SELF, 40) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) set_self_chrflag(CHRCFLAG_00080000) @@ -1638,8 +1638,8 @@ u8 func101c_setup_corridor_lighting[] = { u8 func040a_init_reaper_slayer_skedar[] = { set_accuracy(20) set_reaction_speed(75) - set_chr_health(CHR_SELF, 40) - set_armor(160) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(160) set_recovery_speed(0) set_shield(0) set_ailist(CHR_SELF, FUNC_REAPER_SLAYER_SKEDAR) @@ -1866,8 +1866,8 @@ u8 func040b_mauler_skedar[] = { set_self_chrflag(CHRCFLAG_00080000) set_accuracy(20) set_reaction_speed(50) - set_chr_health(CHR_SELF, 40) - set_armor(50) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(50) set_recovery_speed(0) set_shield(0) diff --git a/src/files/setup/setupstat.c b/src/files/setup/setupstat.c index 99510b19c..b372c4539 100644 --- a/src/files/setup/setupstat.c +++ b/src/files/setup/setupstat.c @@ -306,8 +306,8 @@ u8 func0403_init_maian_leader[] = { set_alertness(100) set_accuracy(100) set_reaction_speed(100) - set_chr_health(CHR_SELF, 40) - set_armor(300) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(300) set_recovery_speed(100) set_shield(0) set_ailist(CHR_SELF, FUNC_DEFEND) @@ -319,8 +319,8 @@ u8 func0402_init_king[] = { set_alertness(100) set_accuracy(100) set_reaction_speed(100) - set_chr_health(CHR_SELF, 40) - set_armor(300) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(300) set_recovery_speed(100) set_shield(0) set_self_chrflag(CHRCFLAG_UNEXPLODABLE) @@ -500,8 +500,8 @@ u8 func0405_init_maian[] = { label(0x2d) set_accuracy(100) set_reaction_speed(100) - set_chr_health(CHR_SELF, 200) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 200) + add_health_or_armor(0) set_recovery_speed(100) set_shield(0) set_self_flag_bankx(CHRFLAG1_00080000, BANK_1) @@ -824,8 +824,8 @@ u8 func0407_king1_skedar[] = { set_chr_hiddenflag(CHR_SELF, CHRHFLAG_00400000) set_accuracy(10) set_reaction_speed(50) - set_chr_health(CHR_SELF, 150) - set_armor(80) + set_chr_maxdamage(CHR_SELF, 150) + add_health_or_armor(80) set_recovery_speed(100) set_shield(0) set_self_flag_bankx(CHRFLAG1_00080000, BANK_1) @@ -845,8 +845,8 @@ u8 func0408_king2_skedar[] = { set_chr_hiddenflag(CHR_SELF, CHRHFLAG_00400000) set_accuracy(10) set_reaction_speed(50) - set_chr_health(CHR_SELF, 150) - set_armor(80) + set_chr_maxdamage(CHR_SELF, 150) + add_health_or_armor(80) set_recovery_speed(100) set_shield(0) set_self_flag_bankx(CHRFLAG1_00080000, BANK_1) @@ -866,8 +866,8 @@ u8 func0409_king3_skedar[] = { set_chr_hiddenflag(CHR_SELF, CHRHFLAG_00400000) set_accuracy(10) set_reaction_speed(50) - set_chr_health(CHR_SELF, 150) - set_armor(80) + set_chr_maxdamage(CHR_SELF, 150) + add_health_or_armor(80) set_recovery_speed(100) set_shield(0) set_self_flag_bankx(CHRFLAG1_00080000, BANK_1) diff --git a/src/files/setup/setuptra.c b/src/files/setup/setuptra.c index 6cfee310e..105a38806 100644 --- a/src/files/setup/setuptra.c +++ b/src/files/setup/setuptra.c @@ -794,9 +794,9 @@ u8 func0403_init_jonathan[] = { // All difficulties label(0x32) - set_armor(1200) + add_health_or_armor(1200) set_alertness(150) - set_chr_health(CHR_SELF, 1) + set_chr_maxdamage(CHR_SELF, 1) set_ailist(CHR_SELF, FUNC_JONATHAN_WAITING_FOR_MEETUP) endlist }; @@ -1548,8 +1548,8 @@ u8 func1008_spawngroup1_guard[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(10) set_reaction_speed(40) - set_chr_health(CHR_SELF, 40) - set_armor(40) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(40) set_recovery_speed(0) set_shield(0) try_equip_weapon(MODEL_CHRSUPERDRAGON, WEAPON_SUPERDRAGON, 0x00000000, /*goto*/ 0x06) @@ -1623,8 +1623,8 @@ u8 func1013_spawngroup2_guard[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(10) set_reaction_speed(40) - set_chr_health(CHR_SELF, 40) - set_armor(40) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(40) set_recovery_speed(0) set_shield(0) try_equip_weapon(MODEL_CHRSUPERDRAGON, WEAPON_SUPERDRAGON, 0x00000000, /*goto*/ 0x06) @@ -1726,8 +1726,8 @@ u8 func1014_spawngroup3_guard[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(10) set_reaction_speed(40) - set_chr_health(CHR_SELF, 40) - set_armor(40) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(40) set_recovery_speed(0) set_shield(0) try_equip_weapon(MODEL_CHRSUPERDRAGON, WEAPON_SUPERDRAGON, 0x00000000, /*goto*/ 0x06) @@ -1808,8 +1808,8 @@ u8 func1015_spawngroup4_guard[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(10) set_reaction_speed(40) - set_chr_health(CHR_SELF, 40) - set_armor(40) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(40) set_recovery_speed(0) set_shield(0) try_equip_weapon(MODEL_CHRSUPERDRAGON, WEAPON_SUPERDRAGON, 0x00000000, /*goto*/ 0x06) @@ -1977,8 +1977,8 @@ u8 func0412_init_elvis[] = { set_stage_flag(STAGEFLAG_ELVIS_REVIVED) label(0x0a) label(0x06) - set_armor(200) - set_chr_health(CHR_SELF, 1) + add_health_or_armor(200) + set_chr_maxdamage(CHR_SELF, 1) set_ailist(CHR_SELF, FUNC_ELVIS_FOLLOW) set_ailist(CHR_SELF, GFUNC_IDLE) endlist @@ -3194,8 +3194,8 @@ u8 func0416_spawn_during_follow[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(10) set_reaction_speed(40) - set_chr_health(CHR_SELF, 40) - set_armor(40) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(40) set_recovery_speed(0) set_shield(0) set_self_chrflag(CHRCFLAG_00040000) @@ -3265,8 +3265,8 @@ u8 func0419_init_biotech[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(20) set_reaction_speed(40) - set_chr_health(CHR_SELF, 40) - set_armor(0) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(0) set_recovery_speed(0) set_shield(0) set_returnlist(CHR_SELF, GFUNC_SEARCH_FOR_PLAYER) @@ -3278,8 +3278,8 @@ u8 func041a_init_superdragon_guard[] = { set_chr_dodge_rating(2, 0x0a) set_accuracy(10) set_reaction_speed(40) - set_chr_health(CHR_SELF, 40) - set_armor(40) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(40) set_recovery_speed(0) set_shield(0) set_ailist(CHR_SELF, GFUNC_UNALERTED) diff --git a/src/files/setup/setupwax.c b/src/files/setup/setupwax.c index fffc2accc..513ffdf6e 100644 --- a/src/files/setup/setupwax.c +++ b/src/files/setup/setupwax.c @@ -1071,8 +1071,8 @@ u8 func0406_start_path30[] = { u8 func0407_start_path31[] = { set_accuracy(40) set_reaction_speed(100) - set_chr_health(CHR_SELF, 40) - set_armor(40) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(40) set_recovery_speed(0) set_shield(0) set_returnlist(CHR_SELF, 0x0407) @@ -1085,8 +1085,8 @@ u8 func0407_start_path31[] = { u8 func0408_start_path32[] = { set_accuracy(40) set_reaction_speed(100) - set_chr_health(CHR_SELF, 40) - set_armor(40) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(40) set_recovery_speed(0) set_shield(0) assign_path(32) @@ -1098,8 +1098,8 @@ u8 func0408_start_path32[] = { u8 func0409_start_path33[] = { set_accuracy(40) set_reaction_speed(100) - set_chr_health(CHR_SELF, 40) - set_armor(40) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(40) set_recovery_speed(0) set_shield(0) assign_path(33) @@ -1111,8 +1111,8 @@ u8 func0409_start_path33[] = { u8 func040a_start_path34[] = { set_accuracy(40) set_reaction_speed(100) - set_chr_health(CHR_SELF, 40) - set_armor(40) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(40) set_recovery_speed(0) set_shield(0) assign_path(34) @@ -1124,8 +1124,8 @@ u8 func040a_start_path34[] = { u8 func040b_start_path35[] = { set_accuracy(40) set_reaction_speed(100) - set_chr_health(CHR_SELF, 40) - set_armor(40) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(40) set_recovery_speed(0) set_shield(0) assign_path(35) @@ -1137,8 +1137,8 @@ u8 func040b_start_path35[] = { u8 func040c_start_path36[] = { set_accuracy(40) set_reaction_speed(100) - set_chr_health(CHR_SELF, 40) - set_armor(40) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(40) set_recovery_speed(0) set_shield(0) assign_path(36) @@ -1220,8 +1220,8 @@ u8 func1000_setup_counterop[] = { u8 func040e_init_60hp_guard[] = { set_accuracy(40) set_reaction_speed(100) - set_chr_health(CHR_SELF, 60) - set_armor(40) + set_chr_maxdamage(CHR_SELF, 60) + add_health_or_armor(40) set_recovery_speed(0) set_shield(0) set_ailist(CHR_SELF, GFUNC_UNALERTED) @@ -1231,8 +1231,8 @@ u8 func040e_init_60hp_guard[] = { u8 func040f_init_40hp_guard[] = { set_accuracy(40) set_reaction_speed(100) - set_chr_health(CHR_SELF, 40) - set_armor(40) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(40) set_recovery_speed(0) set_shield(0) set_ailist(CHR_SELF, GFUNC_UNALERTED) @@ -1242,8 +1242,8 @@ u8 func040f_init_40hp_guard[] = { u8 func0410_init_searching_guard[] = { set_accuracy(40) set_reaction_speed(100) - set_chr_health(CHR_SELF, 40) - set_armor(40) + set_chr_maxdamage(CHR_SELF, 40) + add_health_or_armor(40) set_recovery_speed(0) set_shield(0) set_returnlist(CHR_SELF, GFUNC_SEARCH_FOR_PLAYER) @@ -1252,7 +1252,7 @@ u8 func0410_init_searching_guard[] = { }; u8 func0412_init_cass[] = { - set_chr_health(CHR_SELF, 40) + set_chr_maxdamage(CHR_SELF, 40) set_self_chrflag(CHRCFLAG_01000000) set_ailist(CHR_SELF, FUNC_CASS_IN_OFFICE) endlist @@ -1550,8 +1550,8 @@ u8 func1006_lift_disabling[] = { u8 func0414_init_chief[] = { set_accuracy(40) set_reaction_speed(100) - set_chr_health(CHR_SELF, 60) - set_armor(40) + set_chr_maxdamage(CHR_SELF, 60) + add_health_or_armor(40) set_recovery_speed(0) set_shield(0) set_morale(0) diff --git a/src/game/chr/chraicommands.c b/src/game/chr/chraicommands.c index 793273ee9..900078be6 100644 --- a/src/game/chr/chraicommands.c +++ b/src/game/chr/chraicommands.c @@ -4369,7 +4369,7 @@ bool aiSetChrNum(void) * @cmd 0096 */ GLOBAL_ASM( -glabel ai0096 +glabel aiSetMaxDamage /* f053938: 27bdffd0 */ addiu $sp,$sp,-48 /* f05393c: afb00018 */ sw $s0,0x18($sp) /* f053940: 3c10800a */ lui $s0,%hi(g_Vars) @@ -4478,7 +4478,7 @@ glabel ai0096 * @cmd 0097 */ GLOBAL_ASM( -glabel ai0097 +glabel aiAddHealth /* f053ab8: 3c03800a */ lui $v1,%hi(g_Vars) /* f053abc: 24639fc0 */ addiu $v1,$v1,%lo(g_Vars) /* f053ac0: 8c6e0434 */ lw $t6,0x434($v1) diff --git a/src/include/commands.h b/src/include/commands.h index 64879646d..f523e668b 100644 --- a/src/include/commands.h +++ b/src/include/commands.h @@ -775,12 +775,30 @@ mkshort(0x0095), \ newid, -#define set_chr_health(chr, value) \ +/** + * Sets the limit of how much health a chr or heli can take before they die. + * + * In most cases the value is assigned to the chr given by the chr argument, + * however if the command is run by an object (eg. hovercar or heli) it will be + * assigned to the object itself. + */ +#define set_chr_maxdamage(chr, value) \ mkshort(0x0096), \ chr, \ mkshort(value), -#define set_armor(value) \ +/** + * Easy to understand, but technically incorrect explanation: + * + * Adds health to the chr. If this causes the chr to exceed full health + * (ie. maxdamage) then the remainder is applied as armor. + * + * Relatively difficult to understand, but technically correct explanation: + * + * Reduces the damage that the chr has taken by the given value. This value + * may become negative, which has the effect of having body armor. + */ +#define add_health_or_armor(value) \ mkshort(0x0097), \ mkshort(value), diff --git a/src/include/game/chr/chraicommands.h b/src/include/game/chr/chraicommands.h index 628c4cd69..6ac6e1a86 100644 --- a/src/include/game/chr/chraicommands.h +++ b/src/include/game/chr/chraicommands.h @@ -152,8 +152,8 @@ /*0x0093*/ bool aiSetViewDistance(void); /*0x0094*/ bool aiSetGrenadeProbability(void); /*0x0095*/ bool aiSetChrNum(void); -/*0x0096*/ bool ai0096(void); -/*0x0097*/ bool ai0097(void); +/*0x0096*/ bool aiSetMaxDamage(void); +/*0x0097*/ bool aiAddHealth(void); /*0x0098*/ bool aiSetReactionSpeed(void); /*0x0099*/ bool aiSetRecoverySpeed(void); /*0x009a*/ bool aiSetAccuracy(void); diff --git a/src/setup/ailists.c b/src/setup/ailists.c index c66b7c981..456c869df 100644 --- a/src/setup/ailists.c +++ b/src/setup/ailists.c @@ -94,7 +94,7 @@ u8 func0006_unalerted[] = { label(0x05) dprint 'N','O','G','U','N','2','\n',0, dprint 'A','N','I','M',' ','O','B','J','E','C','T',' ','N','O','W','\n',0, - set_chr_health(CHR_SELF, 40) + set_chr_maxdamage(CHR_SELF, 40) object_do_animation(0x025a, 0xff, 0x02ff, 0xff) chr_do_animation(ANIM_STAND_UP_FROM_SITTING, 0, -1, 0x02, 0x10, CHR_SELF, 2) unset_self_flag_bankx(CHRFLAG1_DOINGIDLEANIMATION, BANK_1) @@ -399,7 +399,7 @@ u8 func0006_unalerted[] = { goto_next(0x16) label(0x13) - set_chr_health(CHR_SELF, 40) + set_chr_maxdamage(CHR_SELF, 40) goto_next(0x73) label(0x16) @@ -819,7 +819,7 @@ u8 func0008_wakeup[] = { // Stand up label(0x15) - set_chr_health(CHR_SELF, 40) + set_chr_maxdamage(CHR_SELF, 40) chr_do_animation(ANIM_STAND_UP_FROM_SITTING, 0, -1, 0x02, 0x10, CHR_SELF, 2) object_do_animation(0x025a, 0xff, 0x02ff, 0xff) goto_next(0x0c) @@ -2634,7 +2634,7 @@ u8 func000a_do_idle_animation[] = { goto_next(0x13) label(0x16) - set_chr_health(CHR_SELF, 1) + set_chr_maxdamage(CHR_SELF, 1) set_chr_hiddenflag(CHR_SELF, CHRHFLAG_TRIGGER_BUDDY_WARP) label(0x13) @@ -2822,7 +2822,7 @@ u8 func000d_init_combat[] = { // Stand up label(0x05) - set_chr_health(CHR_SELF, 40) + set_chr_maxdamage(CHR_SELF, 40) chr_do_animation(ANIM_STAND_UP_FROM_SITTING, 0, -1, 0x02, 0x10, CHR_SELF, 2) object_do_animation(0x025a, 0xff, 0x02ff, 0xff) @@ -5405,7 +5405,7 @@ u8 func0021_stop_and_idle[] = { */ u8 func0029_ai_bot_init[] = { dprint 'l','i','s','t',':',' ','a','i','b','o','t','i','n','i','t',0, - set_chr_health(CHR_SELF, 80) + set_chr_maxdamage(CHR_SELF, 80) set_reaction_speed(100) set_returnlist(CHR_SELF, GFUNC_AI_BOT_ALIVE) diff --git a/src/setup/setup_000000.c b/src/setup/setup_000000.c index f8621d471..df1a94b6f 100644 --- a/src/setup/setup_000000.c +++ b/src/setup/setup_000000.c @@ -14282,8 +14282,8 @@ bool (*g_CommandPointers[])(void) = { /*0x0093*/ aiSetViewDistance, /*0x0094*/ aiSetGrenadeProbability, /*0x0095*/ aiSetChrNum, - /*0x0096*/ ai0096, - /*0x0097*/ ai0097, + /*0x0096*/ aiSetMaxDamage, + /*0x0097*/ aiAddHealth, /*0x0098*/ aiSetReactionSpeed, /*0x0099*/ aiSetRecoverySpeed, /*0x009a*/ aiSetAccuracy,