Files
astromaddie--HaloCE-VR/source/game/game_globals.c
T
Jonas Volman f3aadeab98 Reconcile five Halo functions and approved declaration batches
Integrate coherent B3, P2/K17 prerequisites, completed K1-K16 + S, and the independent profile/effects rulings. Five gains and two explicitly approved B3 debits: net +3 strict functions, +2770 meaningful/+2800 padded bytes (+2774 progress credit). No additional losses; Halo objects 394 to 396 and data unchanged.

Clean rebuild, identical 8252-row stable sweep, 68 valid parks, admission/provider checks, 467-unit warning comparison, unchanged fake scan, and 1318 tests passed. Preserve canonical helper recoveries and unrelated work. Full evidence and disclosures in docs/object_matching_logs/astra_five_function_reconciliation_20260928.md.
2026-09-28 23:17:10 -07:00

225 lines
5.7 KiB
C

/*
GAME_GLOBALS.C
symbols in this file:
000A4800 0050:
_material_get_name (0000)
000A4850 00b0:
_code_000a4850 (0000)
000A4900 0020:
_game_difficulty_get_value (0000)
000A4920 0090:
_game_difficulty_get_team_value (0000)
0025C218 0046:
_global_difficulty_friend_settings (0000)
0025C260 000e:
??_C@_0O@EIMPMJIN@hunter?5shield?$AA@ (0000)
0025C270 0004:
??_C@_03MKIOHCPB@ice?$AA@ (0000)
0025C274 0014:
??_C@_0BE@CBHAJPBP@elite?5energy?5shield?$AA@ (0000)
0025C288 0007:
??_C@_06NGLEBKLK@leaves?$AA@ (0000)
0025C290 0006:
??_C@_05ELAABIKM@water?$AA@ (0000)
0025C298 0008:
??_C@_07OKMKCOHH@plastic?$AA@ (0000)
0025C2A0 000b:
??_C@_0L@ONGKNPHB@human?5skin?$AA@ (0000)
0025C2AC 000c:
??_C@_0M@JHKIJLAC@human?5armor?$AA@ (0000)
0025C2B8 0015:
??_C@_0BF@POPDIFGF@cyborg?5energy?5shield?$AA@ (0000)
0025C2D0 000d:
??_C@_0N@MOLHGIAG@cyborg?5armor?$AA@ (0000)
0025C2E0 0013:
??_C@_0BD@JNMCHJMD@flood?5carrier?5form?$AA@ (0000)
0025C2F4 0012:
??_C@_0BC@CLALDLJP@flood?5combat?5form?$AA@ (0000)
0025C308 0015:
??_C@_0BF@CCOECBII@engineer?5force?5field?$AA@ (0000)
0025C320 000e:
??_C@_0O@HGNLFKPA@engineer?5skin?$AA@ (0000)
0025C330 0015:
??_C@_0BF@PLJMMMAA@jackal?5energy?5shield?$AA@ (0000)
0025C348 000c:
??_C@_0M@ENBNENLN@hunter?5skin?$AA@ (0000)
0025C354 000d:
??_C@_0N@FNKGCAL@hunter?5armor?$AA@ (0000)
0025C364 000c:
??_C@_0M@EGKGIPKM@force?5field?$AA@ (0000)
0025C370 0006:
??_C@_05NGDBJHKI@glass?$AA@ (0000)
0025C378 0007:
??_C@_06GDEDHEOL@rubber?$AA@ (0000)
0025C380 000e:
??_C@_0O@JCOFHDDO@metal?5?$CIthick?$CJ?$AA@ (0000)
0025C390 000d:
??_C@_0N@LPNIIDHE@metal?5?$CIthin?$CJ?$AA@ (0000)
0025C3A0 000f:
??_C@_0P@FANLOPFG@metal?5?$CIhollow?$CJ?$AA@ (0000)
0025C3B0 0005:
??_C@_04FDHAPBNG@wood?$AA@ (0000)
0025C3B8 0005:
??_C@_04HPKDHBOB@snow?$AA@ (0000)
0025C3C0 0006:
??_C@_05PGFPPJKB@stone?$AA@ (0000)
0025C3C8 0005:
??_C@_04EHONEKBC@sand?$AA@ (0000)
0025C3D0 0005:
??_C@_04PGHGBCK@dirt?$AA@ (0000)
0025C3D8 003b:
??_C@_0DL@CDBBBJKO@material_type?$DO?$DN0?5?$CG?$CG?5material_typ@ (0000)
0025C414 0023:
??_C@_0CD@GJEDGBCH@c?3?2halo?2SOURCE?2game?2game_globals@ (0000)
0025C438 0045:
??_C@_0EF@IDAEGPKL@?$CIvalue_type?5?$DO?$DN?50?$CJ?5?$CG?$CG?5?$CIvalue_type@ (0000)
002DE780 0084:
_global_material_type_strings (0000)
*/
/* ---------- headers */
#include "cseries/cseries.h"
#include "game/game.h"
#include "game/game_engine.h"
#include "game/game_globals.h"
#include "game/game_allegiance.h"
#include "scenario/scenario.h"
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes */
/* ---------- globals */
char const *global_material_type_strings[NUMBER_OF_MATERIAL_TYPES] =
{
"dirt",
"sand",
"stone",
"snow",
"wood",
"metal (hollow)",
"metal (thin)",
"metal (thick)",
"rubber",
"glass",
"force field",
"grunt",
"hunter armor",
"hunter skin",
"elite",
"jackal",
"jackal energy shield",
"engineer skin",
"engineer force field",
"flood combat form",
"flood carrier form",
"cyborg armor",
"cyborg energy shield",
"human armor",
"human skin",
"sentinel",
"monitor",
"plastic",
"water",
"leaves",
"elite energy shield",
"ice",
"hunter shield",
};
short const global_difficulty_friend_settings[NUMBER_OF_GAME_DIFFICULTY_VALUES] =
{
_game_difficulty_value_friend_damage,
_game_difficulty_value_friend_vitality,
_game_difficulty_value_friend_shield,
_game_difficulty_value_friend_recharge,
NONE, NONE, NONE, NONE, NONE, NONE,
NONE, NONE, NONE, NONE, NONE, NONE, NONE, NONE, NONE, NONE,
NONE, NONE, NONE, NONE, NONE, NONE, NONE, NONE, NONE, NONE,
NONE, NONE, NONE, NONE, NONE,
};
/* ---------- public code */
char const *material_get_name(
short material_type)
{
if (material_type != NONE)
{
match_assert("c:\\halo\\SOURCE\\game\\game_globals.c", 0x389,
material_type>=0 && material_type<NUMBER_OF_MATERIAL_TYPES);
return global_material_type_strings[material_type];
}
return "NONE";
}
/* ---------- private code */
static real game_difficulty_get_value_by_difficulty(
short value_type,
short difficulty)
{
real result = 1.0f;
struct game_globals *game_globals = scenario_get_game_globals();
struct game_globals_difficulty_information *difficulty_information;
short difficulty_level;
match_assert("c:\\halo\\SOURCE\\game\\game_globals.c", 0x39a,
(value_type >= 0) && (value_type < NUMBER_OF_GAME_DIFFICULTY_VALUES));
if (game_globals && game_globals->difficulty_information.count)
{
difficulty_information = TAG_BLOCK_GET_ELEMENT(
&game_globals->difficulty_information,
0,
struct game_globals_difficulty_information);
if (difficulty_information)
{
if (difficulty < 0)
difficulty_level = 0;
else
difficulty_level = MIN(difficulty, NUMBER_OF_GAME_DIFFICULTY_LEVELS - 1);
result = difficulty_information->values[value_type][difficulty_level];
}
}
return result;
}
real game_difficulty_get_value(
short value_type)
{
return game_difficulty_get_value_by_difficulty(value_type, game_difficulty_level_get());
}
real game_difficulty_get_team_value(
short value_type,
short team_index)
{
short difficulty = game_difficulty_level_get();
short friend_value_type;
if (game_engine_running())
difficulty = _game_difficulty_level_normal;
else if (!game_team_is_enemy(_game_team_player, team_index))
{
match_assert("c:\\halo\\SOURCE\\game\\game_globals.c", 0x3bd,
(value_type >= 0) && (value_type < NUMBER_OF_GAME_DIFFICULTY_VALUES));
friend_value_type = global_difficulty_friend_settings[value_type];
if (friend_value_type == NONE)
return game_difficulty_get_value_by_difficulty(value_type, _game_difficulty_level_normal);
return game_difficulty_get_value_by_difficulty(friend_value_type, difficulty);
}
return game_difficulty_get_value_by_difficulty(value_type, difficulty);
}