mirror of
https://github.com/astromaddie/HaloCE-VR.git
synced 2026-10-21 13:00:14 +02:00
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.
1009 lines
26 KiB
C
1009 lines
26 KiB
C
/*
|
|
UNITS.H
|
|
*/
|
|
|
|
#ifndef __UNITS_H
|
|
#define __UNITS_H
|
|
#pragma once
|
|
|
|
/* ---------- headers */
|
|
|
|
#include "ai/ai.h"
|
|
#include "objects/objects.h"
|
|
|
|
/* ---------- constants */
|
|
|
|
enum
|
|
{
|
|
MAXIMUM_WEAPONS_PER_UNIT = 4,
|
|
NUMBER_OF_UNIT_USER_ANIMATIONS = 2,
|
|
};
|
|
|
|
enum unit_add_weapon_mode
|
|
{
|
|
_unit_add_weapon_normal = 0,
|
|
_unit_add_weapon_starting,
|
|
_unit_add_weapon_replace,
|
|
};
|
|
|
|
enum unit_speech_priority
|
|
{
|
|
_unit_speech_none = 0,
|
|
_unit_speech_idle,
|
|
_unit_speech_pain,
|
|
_unit_speech_talk,
|
|
_unit_speech_communicate,
|
|
_unit_speech_shout,
|
|
_unit_speech_scripted,
|
|
_unit_speech_involuntary,
|
|
_unit_speech_exclamation,
|
|
_unit_speech_scream,
|
|
_unit_speech_death,
|
|
NUMBER_OF_UNIT_SPEECH_PRIORITIES,
|
|
};
|
|
|
|
enum unit_nearby_seat_result
|
|
{
|
|
_unit_nearby_seat_none = 0,
|
|
_unit_nearby_seat_occupied,
|
|
_unit_nearby_seat_available,
|
|
};
|
|
|
|
enum
|
|
{
|
|
MAXIMUM_ATTACKERS_PER_UNIT = 4,
|
|
};
|
|
|
|
enum
|
|
{
|
|
_unit_actively_controlled_bit = 0,
|
|
_unit_changed_aiming_angles_bit,
|
|
_unit_desired_weapon_invalid_bit,
|
|
_unit_exact_facing_bit,
|
|
_unit_active_camouflaged_bit,
|
|
_unit_super_camouflaged_bit,
|
|
_unit_controllable_bit,
|
|
_unit_ignore_hard_pings_bit,
|
|
_unit_must_set_up_dialogue_bit,
|
|
_unit_placed_here_dead_bit,
|
|
_unit_ignored_by_actors_bit,
|
|
_unit_preferred_target_bit,
|
|
_unit_no_falling_damage_bit,
|
|
_unit_feign_death_allowed_bit,
|
|
_unit_aim_without_turning_bit,
|
|
_unit_attached_melee_attack_bit,
|
|
_unit_not_enterable_by_player_bit,
|
|
_unit_spawned_actors_bit,
|
|
_unit_unloading_bit,
|
|
_unit_integrated_light_on_bit,
|
|
_unit_doesnt_drop_items_bit,
|
|
_unit_has_already_been_hacky_hacky_hacked_bit,
|
|
_unit_cannot_blink_bit,
|
|
_unit_impervious_bit,
|
|
_unit_suspended_bit,
|
|
_unit_running_blindly_bit,
|
|
_unit_integrated_night_vision_on_bit,
|
|
_unit_possessed_by_recording_bit,
|
|
_unit_desired_integrated_light_on_bit,
|
|
_unit_desired_integrated_light_off_bit,
|
|
NUMBER_OF_UNIT_DATUM_FLAGS
|
|
};
|
|
|
|
enum
|
|
{
|
|
_unit_control_crouch_modifier_bit = 0,
|
|
_unit_control_jump_bit,
|
|
_unit_control_user_animation1_bit,
|
|
_unit_control_user_animation2_bit,
|
|
_unit_control_integrated_light_bit,
|
|
_unit_control_exact_facing_bit,
|
|
_unit_control_action_bit,
|
|
_unit_control_use_equipment_bit,
|
|
_unit_control_look_dont_turn_bit,
|
|
_unit_control_force_alert_bit,
|
|
_unit_control_weapon_reload_bit,
|
|
_unit_control_weapon_primary_trigger_bit,
|
|
_unit_control_weapon_secondary_trigger_bit,
|
|
_unit_control_throw_grenade_bit,
|
|
_unit_control_swap_weapons_bit,
|
|
NUMBER_OF_UNIT_CONTROL_FLAGS,
|
|
|
|
UNIT_CONTROL_DRIVER_MASK =
|
|
FLAG(_unit_control_crouch_modifier_bit) |
|
|
FLAG(_unit_control_jump_bit) |
|
|
FLAG(_unit_control_user_animation1_bit) |
|
|
FLAG(_unit_control_user_animation2_bit) |
|
|
FLAG(_unit_control_integrated_light_bit) |
|
|
FLAG(_unit_control_exact_facing_bit),
|
|
|
|
UNIT_CONTROL_GUNNER_MASK =
|
|
FLAG(_unit_control_weapon_reload_bit) |
|
|
FLAG(_unit_control_weapon_primary_trigger_bit) |
|
|
FLAG(_unit_control_weapon_secondary_trigger_bit) |
|
|
FLAG(_unit_control_throw_grenade_bit) |
|
|
FLAG(_unit_control_swap_weapons_bit),
|
|
};
|
|
|
|
enum
|
|
{
|
|
_unit_state_idle = 0,
|
|
_unit_state_gesture,
|
|
_unit_state_turn_left,
|
|
_unit_state_turn_right,
|
|
_unit_state_move_front,
|
|
_unit_state_move_back,
|
|
_unit_state_move_left,
|
|
_unit_state_move_right,
|
|
_unit_state_stunned_move_front,
|
|
_unit_state_stunned_move_back,
|
|
_unit_state_stunned_move_left,
|
|
_unit_state_stunned_move_right,
|
|
_unit_state_slide_front,
|
|
_unit_state_slide_back,
|
|
_unit_state_slide_left,
|
|
_unit_state_slide_right,
|
|
_unit_state_flying_front,
|
|
_unit_state_flying_back,
|
|
_unit_state_flying_left,
|
|
_unit_state_flying_right,
|
|
_unit_state_airborne,
|
|
_unit_state_land_soft,
|
|
_unit_state_land_hard,
|
|
_unit_state_hard_ping,
|
|
_unit_state_dying_airborne,
|
|
_unit_state_dying,
|
|
_unit_state_entering_seat,
|
|
_unit_state_exiting_seat,
|
|
_unit_state_user_animation,
|
|
_unit_state_ai_impulse,
|
|
_unit_state_melee_attack,
|
|
_unit_state_melee_airborne,
|
|
_unit_state_melee_continuous,
|
|
_unit_state_throw_grenade,
|
|
_unit_state_resurrect_front,
|
|
_unit_state_resurrect_back,
|
|
_unit_state_feeding,
|
|
_unit_state_opening,
|
|
_unit_state_closing,
|
|
_unit_state_leap_start,
|
|
_unit_state_leap_airborne,
|
|
_unit_state_leap_melee,
|
|
_unit_state_shield_sapping,
|
|
_unit_state_hovering,
|
|
NUMBER_OF_UNIT_STATES,
|
|
};
|
|
|
|
enum
|
|
{
|
|
_unit_animation_postpone_weapon_ik_until_interpolation_ends_bit = 0,
|
|
_unit_animation_showing_acceleration_bit,
|
|
_unit_animation_ignore_translation_bit,
|
|
_unit_animation_fallen_on_front_bit,
|
|
NUMBER_OF_UNIT_ANIMATION_FLAGS,
|
|
};
|
|
|
|
|
|
enum
|
|
{
|
|
_unit_animation_state_asleep = 0,
|
|
_unit_animation_state_alert,
|
|
_unit_animation_state_suspicious,
|
|
_unit_animation_state_in_combat,
|
|
_unit_animation_state_wary,
|
|
_unit_animation_state_flee,
|
|
_unit_animation_state_flaming,
|
|
NUMBER_OF_UNIT_ANIMATION_STATES,
|
|
};
|
|
|
|
enum
|
|
{
|
|
_unit_seat_animation_airborne_dead = 0,
|
|
_unit_seat_animation_landing_dead,
|
|
_unit_seat_animation_acceleration_front_back,
|
|
_unit_seat_animation_acceleration_left_right,
|
|
_unit_seat_animation_acceleration_up_down,
|
|
_unit_seat_animation_push_impact,
|
|
_unit_seat_animation_twist_impact,
|
|
_unit_seat_animation_seat_enter,
|
|
_unit_seat_animation_seat_exit,
|
|
_unit_seat_animation_looking,
|
|
_unit_seat_animation_mouth_aperture,
|
|
_unit_seat_animation_emotions,
|
|
_unit_seat_animation_unused3,
|
|
_unit_seat_animation_user0,
|
|
_unit_seat_animation_user1,
|
|
_unit_seat_animation_user2,
|
|
_unit_seat_animation_user3,
|
|
_unit_seat_animation_user4,
|
|
_unit_seat_animation_user5,
|
|
_unit_seat_animation_user6,
|
|
_unit_seat_animation_user7,
|
|
_unit_seat_animation_user8,
|
|
_unit_seat_animation_user9,
|
|
_unit_seat_animation_flying_front,
|
|
_unit_seat_animation_flying_back,
|
|
_unit_seat_animation_flying_left,
|
|
_unit_seat_animation_flying_right,
|
|
_unit_seat_animation_opening,
|
|
_unit_seat_animation_closing,
|
|
_unit_seat_animation_hovering,
|
|
NUMBER_OF_UNIT_SEAT_ANIMATIONS,
|
|
};
|
|
|
|
enum
|
|
{
|
|
_unit_weapon_class_animation_idle = 0,
|
|
_unit_weapon_class_animation_gesture,
|
|
_unit_weapon_class_animation_turning_left,
|
|
_unit_weapon_class_animation_turning_right,
|
|
_unit_weapon_class_animation_diving_front,
|
|
_unit_weapon_class_animation_diving_back,
|
|
_unit_weapon_class_animation_diving_left,
|
|
_unit_weapon_class_animation_diving_right,
|
|
_unit_weapon_class_animation_moving_front,
|
|
_unit_weapon_class_animation_moving_back,
|
|
_unit_weapon_class_animation_moving_left,
|
|
_unit_weapon_class_animation_moving_right,
|
|
_unit_weapon_class_animation_sliding_front,
|
|
_unit_weapon_class_animation_sliding_back,
|
|
_unit_weapon_class_animation_sliding_left,
|
|
_unit_weapon_class_animation_sliding_right,
|
|
_unit_weapon_class_animation_airborne,
|
|
_unit_weapon_class_animation_land_soft,
|
|
_unit_weapon_class_animation_land_hard,
|
|
_unit_weapon_class_animation_land_mine,
|
|
_unit_weapon_class_animation_throw_grenade,
|
|
_unit_weapon_class_animation_disarm,
|
|
_unit_weapon_class_animation_drop,
|
|
_unit_weapon_class_animation_ready,
|
|
_unit_weapon_class_animation_put_away,
|
|
_unit_weapon_class_animation_aiming_still,
|
|
_unit_weapon_class_animation_aiming_moving,
|
|
_unit_weapon_class_animation_surprise_front,
|
|
_unit_weapon_class_animation_surprise_back,
|
|
_unit_weapon_class_animation_berserk,
|
|
_unit_weapon_class_animation_evade_left,
|
|
_unit_weapon_class_animation_evade_right,
|
|
_unit_weapon_class_animation_signal_move,
|
|
_unit_weapon_class_animation_signal_attack,
|
|
_unit_weapon_class_animation_signal_warn,
|
|
_unit_weapon_class_animation_moving_wounded_front,
|
|
_unit_weapon_class_animation_moving_wounded_back,
|
|
_unit_weapon_class_animation_moving_wounded_left,
|
|
_unit_weapon_class_animation_moving_wounded_right,
|
|
_unit_weapon_class_animation_melee_attack,
|
|
_unit_weapon_class_animation_celebrate,
|
|
_unit_weapon_class_animation_panic,
|
|
_unit_weapon_class_animation_melee_airborne,
|
|
_unit_weapon_class_animation_flaming,
|
|
_unit_weapon_class_animation_resurrect_front,
|
|
_unit_weapon_class_animation_resurrect_back,
|
|
_unit_weapon_class_animation_melee_continuous,
|
|
_unit_weapon_class_animation_feeding,
|
|
_unit_weapon_class_animation_leap_start,
|
|
_unit_weapon_class_animation_leap_airborne,
|
|
_unit_weapon_class_animation_leap_melee,
|
|
_unit_weapon_class_animation_zapping,
|
|
_unit_weapon_class_animation_unused11,
|
|
_unit_weapon_class_animation_unused12,
|
|
_unit_weapon_class_animation_unused13,
|
|
NUMBER_OF_UNIT_WEAPON_CLASS_ANIMATIONS,
|
|
};
|
|
|
|
|
|
enum
|
|
{
|
|
_unit_grenade_human_fragmentation = 0,
|
|
_unit_grenade_covenant_plasma,
|
|
NUMBER_OF_UNIT_GRENADE_TYPES
|
|
};
|
|
|
|
enum
|
|
{
|
|
cause_for_camo_regrowth_default = 0,
|
|
cause_for_camo_regrowth_shot_fired,
|
|
};
|
|
|
|
enum
|
|
{
|
|
_unit_aiming_speed_alert = 0,
|
|
_unit_aiming_speed_casual,
|
|
NUMBER_OF_UNIT_AIMING_SPEEDS,
|
|
};
|
|
|
|
enum
|
|
{
|
|
_unit_grenade_throw_idle = 0,
|
|
_unit_grenade_throw_wind_up,
|
|
_unit_grenade_throw_in_hand,
|
|
_unit_grenade_throw_ending,
|
|
NUMBER_OF_UNIT_GRENADE_ATTACK_STATES,
|
|
};
|
|
|
|
enum
|
|
{
|
|
_unit_base_seat_asleep = 0,
|
|
_unit_base_seat_alert,
|
|
_unit_base_seat_stand,
|
|
_unit_base_seat_crouch,
|
|
_unit_base_seat_flee,
|
|
_unit_base_seat_flaming,
|
|
NUMBER_OF_UNIT_BASE_SEATS,
|
|
};
|
|
|
|
enum
|
|
{
|
|
_unit_base_weapon_none = 0,
|
|
NUMBER_OF_UNIT_BASE_WEAPONS,
|
|
};
|
|
|
|
enum
|
|
{
|
|
_unit_scream_falling = 0,
|
|
_unit_scream_grenade_attached_to_us,
|
|
_unit_scream_burning_to_death,
|
|
_unit_scream_destroyed_limb,
|
|
_unit_scream_destroyed_head,
|
|
_unit_scream_resurrection,
|
|
NUMBER_OF_UNIT_SCREAM_TYPES
|
|
};
|
|
|
|
enum
|
|
{
|
|
_unit_estimate_none = 0,
|
|
_unit_estimate_head_standing,
|
|
_unit_estimate_head_crouching,
|
|
_unit_estimate_gun_position,
|
|
NUMBER_OF_UNIT_ESTIMATE_POSITION_MODES,
|
|
};
|
|
|
|
/* ---------- macros */
|
|
|
|
#define unit_get(index) ((struct unit_datum*)object_get_and_verify_type(index, _object_mask_unit))
|
|
#define unit_try_and_get(index) ((struct unit_datum*)object_try_and_get_and_verify_type(index, _object_mask_unit))
|
|
|
|
/* ---------- structures */
|
|
|
|
struct unit_control_data;
|
|
struct scenario_unit_datum;
|
|
struct location;
|
|
|
|
struct unit_animation
|
|
{
|
|
word flags;
|
|
short aiming_screen_index;
|
|
short looking_screen_index;
|
|
short last_ping_animation_index;
|
|
char seat_index;
|
|
char weapon_index;
|
|
char weapon_type_index;
|
|
char state;
|
|
char action;
|
|
char overlay_action;
|
|
char desired_state;
|
|
char base_seat_index;
|
|
char emotion_index;
|
|
struct animation_state action_animation;
|
|
struct animation_state overlay_action_animation;
|
|
struct animation_state soft_ping_animation;
|
|
boolean aiming_with_euler_screen;
|
|
boolean looking_with_euler_screen;
|
|
real_rectangle2d aiming_screen_bounds;
|
|
real_rectangle2d looking_screen_bounds;
|
|
long external_animation_graph_index;
|
|
struct animation_state external_animation;
|
|
};
|
|
|
|
struct unit_animation_update_data
|
|
{
|
|
char state_desired;
|
|
boolean crouching;
|
|
};
|
|
|
|
typedef char unit_animation_update_data_size_assert[
|
|
sizeof(struct unit_animation_update_data) == 0x2 ? 1 : -1];
|
|
|
|
struct unit_speech_item
|
|
{
|
|
short priority;
|
|
short vocalization_type;
|
|
long sound_definition_index;
|
|
short delay_time;
|
|
short ai_notification_delay;
|
|
short pause_time;
|
|
word pad;
|
|
struct ai_information_packet ai;
|
|
};
|
|
|
|
struct unit_speech
|
|
{
|
|
struct unit_speech_item current;
|
|
struct unit_speech_item queued;
|
|
short damage_minor_decay_timer;
|
|
short damage_minor_sounds;
|
|
short damage_minor_timer;
|
|
short damage_major_timer;
|
|
long last_speech_finished_time;
|
|
boolean played;
|
|
boolean notified_ai;
|
|
boolean finished;
|
|
boolean pad;
|
|
short pre_delay_timer;
|
|
short sound_timer;
|
|
short ai_delay_timer;
|
|
short post_delay_timer;
|
|
long impulse_sound_index;
|
|
};
|
|
|
|
struct unit_attacker
|
|
{
|
|
unsigned long game_time_stamp;
|
|
real damage_inflicted;
|
|
long object_index;
|
|
long player_index;
|
|
};
|
|
|
|
struct _unit_datum
|
|
{
|
|
long actor_index;
|
|
long swarm_actor_index;
|
|
long swarm_next_unit_index;
|
|
long swarm_prev_unit_index;
|
|
unsigned long flags;
|
|
unsigned long control_flags;
|
|
short timer;
|
|
char shield_sap_timeout;
|
|
char magic_seat_index;
|
|
long persistent_control_timer;
|
|
unsigned long persistent_control_flags;
|
|
long player_index;
|
|
short last_unit_effect_type;
|
|
short override_emotion_animation_index;
|
|
long game_time_at_last_unit_effect;
|
|
real_vector3d desired_facing_vector;
|
|
real_vector3d desired_aiming_vector;
|
|
real_vector3d aiming_vector;
|
|
real_vector3d aiming_velocity;
|
|
real_vector3d desired_looking_vector;
|
|
real_vector3d looking_vector;
|
|
real_vector3d looking_velocity;
|
|
real_vector3d throttle;
|
|
real primary_trigger;
|
|
char aiming_speed;
|
|
char melee_attack_state;
|
|
char melee_continuous_damage_effect_timer;
|
|
byte flaming_death_delay;
|
|
char weapon_drop_delay_ticks;
|
|
char grenade_throw_state;
|
|
short grenade_throw_ticks;
|
|
short grenade_throw_full_power_ticks;
|
|
long grenade_object_index;
|
|
struct unit_animation animation;
|
|
real ambient_illumination;
|
|
real self_illumination;
|
|
real mouth_aperture;
|
|
long last_entrance_attempt;
|
|
short parent_seat_index;
|
|
short current_weapon_index;
|
|
short desired_weapon_index;
|
|
long weapon_object_indices[MAXIMUM_WEAPONS_PER_UNIT];
|
|
long weapon_last_used_at_game_time[MAXIMUM_WEAPONS_PER_UNIT];
|
|
long equipment_object_index;
|
|
char current_grenade_index;
|
|
char desired_grenade_index;
|
|
char grenade_counts[NUMBER_OF_UNIT_GRENADE_TYPES];
|
|
char current_zoom_level;
|
|
char desired_zoom_level;
|
|
char gunner_inactive_ticks;
|
|
byte aiming_change;
|
|
long driver_object_index;
|
|
long gunner_object_index;
|
|
long last_vehicle_index;
|
|
long game_time_at_last_vehicle_exit;
|
|
short fake_encounter_index;
|
|
short fake_squad_index;
|
|
real seat_power[2];
|
|
real integrated_light_power;
|
|
real integrated_light_battery;
|
|
real integrated_night_vision_power;
|
|
real_point3d seat_last_position;
|
|
real_vector3d seat_last_velocity;
|
|
real_vector3d seat_acceleration;
|
|
real_vector3d seat_desired_acceleration;
|
|
real active_camouflage;
|
|
real active_camouflage_super_amount;
|
|
long dialogue_index;
|
|
struct unit_speech speech;
|
|
short last_damage_category;
|
|
short delayed_damage_timer;
|
|
real delayed_damage_peak;
|
|
long delayed_damage_attacker_object_index;
|
|
long flaming_death_attacker_object_index;
|
|
real run_blindly_angle;
|
|
real run_blindly_angle_delta;
|
|
long time_of_death;
|
|
short feign_death_timer;
|
|
short cause_for_camo_regrowth;
|
|
real body_stun;
|
|
short body_stun_ticks;
|
|
short killing_spree_count;
|
|
long killing_spree_last_time;
|
|
struct unit_attacker attackers[MAXIMUM_ATTACKERS_PER_UNIT];
|
|
short user_animation_indices[NUMBER_OF_UNIT_USER_ANIMATIONS];
|
|
};
|
|
|
|
struct unit_datum
|
|
{
|
|
long definition_index;
|
|
struct _object_datum object;
|
|
struct _unit_datum unit;
|
|
};
|
|
|
|
/* ---------- prototypes/UNITS.C */
|
|
|
|
struct unit_control_data;
|
|
|
|
void unit_control(
|
|
long unit_index,
|
|
struct unit_control_data const *control_data);
|
|
boolean unit_unsuspecting(
|
|
long unit_index,
|
|
real_point3d const *point);
|
|
void units_initialize(
|
|
void);
|
|
long units_debug_get_next_unit(
|
|
long unit_index);
|
|
long units_debug_get_closest_unit(
|
|
long unit_index);
|
|
void unit_debug_ninja_rope(
|
|
long unit_index);
|
|
void units_initialize_for_new_map(
|
|
void);
|
|
void units_dispose_from_old_map(
|
|
void);
|
|
void units_dispose(
|
|
void);
|
|
void unit_kill(
|
|
long unit_index);
|
|
void unit_kill_silent(
|
|
long unit_index);
|
|
void unit_kill_no_statistics(
|
|
long unit_index);
|
|
void unit_delete(
|
|
long unit_index);
|
|
void unit_handle_region_destroyed(
|
|
long object_index,
|
|
short region_index,
|
|
unsigned long damage_flags);
|
|
void unit_exit_seat_end(
|
|
long unit_index);
|
|
void units_update(void);
|
|
void unit_export_function_values(
|
|
long object_index);
|
|
|
|
short unit_get_zoom_level(
|
|
long unit_index);
|
|
real unit_get_zoom_magnification(
|
|
long unit_index,
|
|
short zoom_level);
|
|
short unit_test_spawning(
|
|
long unit_index);
|
|
void unit_persistent_control(
|
|
long unit_index,
|
|
long control_ticks,
|
|
unsigned long persistent_control_flags);
|
|
boolean unit_get_seat_entrance_point(
|
|
long unit_index,
|
|
long parent_unit_index,
|
|
short seat_index,
|
|
real_point3d *entrance_point,
|
|
real_point3d *seat_point,
|
|
real_point3d *hint_point);
|
|
boolean unit_get_melee_range_and_ticks(
|
|
long unit_index,
|
|
boolean secondary,
|
|
short *melee_tick,
|
|
real *attack_time,
|
|
short *frame_count,
|
|
real *damage_time);
|
|
boolean unit_can_see_point(
|
|
long unit_index,
|
|
real_point3d const *point,
|
|
real field_of_view);
|
|
boolean unit_has_animation_to_enter_seat(
|
|
long unit_index,
|
|
long target_unit_index,
|
|
short seat_index);
|
|
void unit_impulse(
|
|
long unit_index,
|
|
long impulse_index,
|
|
real_vector3d const *impulse,
|
|
real magnitude);
|
|
boolean unit_set_user_animation(
|
|
long unit_index,
|
|
long animation_index,
|
|
short index);
|
|
boolean unit_has_weapon_with_flag(
|
|
long unit_index,
|
|
long flag_index);
|
|
long unit_scripting_unit_riders(
|
|
long unit_index);
|
|
boolean unit_scripting_vehicle_test_seat_list(
|
|
long vehicle_index,
|
|
char const *seat_name,
|
|
long object_list_index);
|
|
void unit_scripting_set_seat(
|
|
long unit_index,
|
|
char const *seat_label);
|
|
void unit_handle_deleted_object(
|
|
long object_index,
|
|
long deleted_object_index);
|
|
|
|
boolean unit_update(long unit_index);
|
|
|
|
void unit_euler_aiming_update(
|
|
real_matrix4x3 const *orientation,
|
|
real_vector3d *aiming_vector,
|
|
real_vector3d const *desired_aiming_vector,
|
|
real_vector3d *aiming_velocity,
|
|
real_rectangle2d const *aiming_bounds,
|
|
real angular_velocity_limit,
|
|
real angular_acceleration_limit);
|
|
|
|
void unit_unzoom(long unit_index);
|
|
|
|
void unit_destroy(
|
|
long unit_index);
|
|
void unit_died(long unit_index, boolean feigned);
|
|
void unit_get_head_position(long unit_index, union real_point3d *head_position);
|
|
char const *unit_get_speech_priority_name(
|
|
short priority);
|
|
char const *unit_describe_speech(
|
|
long unit_index,
|
|
boolean abbreviated,
|
|
long buffer_size,
|
|
char *buffer);
|
|
void unit_get_camera_position(long unit_index, real_point3d *camera_position);
|
|
void unit_estimate_position(
|
|
long unit_index,
|
|
short estimate_mode,
|
|
real_point3d const *body_position,
|
|
real_vector3d *desired_facing,
|
|
real_vector3d *desired_gun_offset,
|
|
real_point3d *estimated_position);
|
|
void unit_get_center_of_mass(
|
|
long unit_index,
|
|
real_point3d *center_of_mass);
|
|
boolean unit_test_animation_impulse(
|
|
long unit_index,
|
|
short animation_impulse);
|
|
boolean unit_start_animation_impulse(
|
|
long unit_index,
|
|
short animation_impulse,
|
|
real_vector2d *alignment_vector);
|
|
long unit_get_aiming_unit_index(long unit_index);
|
|
void unit_get_aiming_vector(
|
|
long unit_index,
|
|
real_vector3d *aiming_vector);
|
|
void unit_get_looking_vector(
|
|
long unit_index,
|
|
real_vector3d *looking_vector);
|
|
void unit_get_facing_vector(
|
|
long unit_index,
|
|
real_vector3d *facing_vector);
|
|
boolean unit_controllable(
|
|
long unit_index);
|
|
void unit_set_controllable(
|
|
long unit_index,
|
|
boolean controllable);
|
|
long unit_scripting_unit_driver(
|
|
long unit_index);
|
|
long unit_scripting_unit_gunner(
|
|
long unit_index);
|
|
void unit_detach_from_parent(
|
|
long unit_index);
|
|
boolean unit_scripting_vehicle_test_seat(
|
|
long vehicle_index,
|
|
char const *seat_name,
|
|
long unit_index);
|
|
long unit_get_current_equipment(
|
|
long unit_index);
|
|
void unit_delete_current_equipment(
|
|
long unit_index);
|
|
void unit_delete_all_weapons(
|
|
long unit_index);
|
|
boolean unit_add_equipment_to_inventory(
|
|
long unit_index,
|
|
long equipment_index,
|
|
short replace);
|
|
boolean unit_add_weapon_to_inventory(
|
|
long unit_index,
|
|
long weapon_index,
|
|
long is_starting_weapon);
|
|
boolean unit_add_grenade_to_inventory(
|
|
long unit_index,
|
|
long equipment_index);
|
|
short unit_get_weapon_count(
|
|
long unit_index);
|
|
boolean unit_get_current_flashlight_state(
|
|
long unit_index);
|
|
void unit_abort_animation(
|
|
long unit_index);
|
|
void unit_open(
|
|
long unit_index);
|
|
void unit_close(
|
|
long unit_index);
|
|
void scripting_set_magic_base_seat(
|
|
char const *seat_name);
|
|
void unit_start_running_blindly(
|
|
long unit_index);
|
|
void unit_stop_running_blindly(
|
|
long unit_index);
|
|
void unit_set_emotion(
|
|
long unit_index,
|
|
word emotion_index);
|
|
boolean unit_is_playing_custom_animation(
|
|
long unit_index);
|
|
boolean unit_flying_through_air(
|
|
long unit_index);
|
|
void unit_stop_custom_animation(
|
|
long unit_index);
|
|
boolean unit_melee_attack_begin(
|
|
long unit_index,
|
|
boolean continuous,
|
|
real_vector2d const *alignment_vector);
|
|
boolean unit_leap_begin(
|
|
long unit_index,
|
|
real_vector2d const *alignment_vector);
|
|
void unit_impact_melee_damage(
|
|
long unit_index,
|
|
long target_object_index,
|
|
short node_index,
|
|
short region_index,
|
|
short material_index,
|
|
real_point3d const *position,
|
|
real_vector3d const *object_normal,
|
|
struct location const *location);
|
|
void scripting_magic_melee_attack(
|
|
void);
|
|
boolean unit_try_and_exit_seat(
|
|
long unit_index);
|
|
short vehicle_scripting_unload(
|
|
long vehicle_index,
|
|
char const *seat_name);
|
|
void unit_scripting_exit_vehicle(
|
|
long unit_index);
|
|
void unit_adjust_projectile_ray(
|
|
long unit_index,
|
|
real_point3d *origin,
|
|
real_vector3d *direction,
|
|
real *velocity,
|
|
boolean adjust_origin,
|
|
boolean use_aiming_vector);
|
|
void unit_render_debug(
|
|
long object_index);
|
|
boolean unit_clip_to_aiming_bounds(long unit_index, real_vector3d *vector, boolean use_aiming_screen);
|
|
long unit_inventory_get_weapon(long unit_index, short index);
|
|
short unit_inventory_next_weapon(
|
|
long unit_index,
|
|
short current_index,
|
|
short delta);
|
|
short unit_inventory_next_grenade(long unit_index, short current_index, short delta);
|
|
short unit_inventory_get_must_be_readied_weapon(
|
|
long unit_index);
|
|
boolean unit_has_weapon_definition_index(
|
|
long unit_index,
|
|
long weapon_definition_index);
|
|
short unit_get_grenade_count(
|
|
long unit_index,
|
|
short grenade_type);
|
|
short unit_get_current_grenade_type(
|
|
long unit_index);
|
|
short unit_add_grenade_type_to_inventory(
|
|
long unit_index,
|
|
short grenade_type,
|
|
short grenade_count);
|
|
boolean unit_start_user_animation(
|
|
long unit_index,
|
|
long animation_graph_index,
|
|
char const *animation_name,
|
|
boolean interpolate);
|
|
short unit_get_custom_animation_time(
|
|
long unit_index);
|
|
boolean unit_approve_weapon_pickup(
|
|
long unit_index,
|
|
long weapon_index);
|
|
boolean unit_set_seat(
|
|
long unit_index,
|
|
char const *seat_label);
|
|
|
|
|
|
boolean unit_can_use_weapon(
|
|
long unit_index,
|
|
long weapon_index);
|
|
boolean unit_approve_weapon_swap(
|
|
long unit_index,
|
|
long weapon_index);
|
|
boolean unit_solo_player_integrated_night_vision_is_active(
|
|
void);
|
|
boolean unit_new(
|
|
long object_index);
|
|
short unit_get_animation_frames_remaining(
|
|
long unit_index,
|
|
short *animation_state);
|
|
boolean unit_overcharged(
|
|
long unit_index);
|
|
short unit_find_nearby_seat(
|
|
long unit_index,
|
|
long target_unit_index,
|
|
short *seat_index);
|
|
short vehicle_scripting_find_available_seats(
|
|
long vehicle_index,
|
|
char const *seat_substring_name,
|
|
short seat_desire_type,
|
|
short *seat_indices,
|
|
short maximum_seat_count);
|
|
short vehicle_scripting_load_magic(
|
|
long vehicle_index,
|
|
char const *seat_name,
|
|
long object_list_index);
|
|
boolean unit_can_enter_seat(
|
|
long unit_index,
|
|
long target_unit_index,
|
|
short seat_index,
|
|
long *occupant_unit_index);
|
|
boolean unit_enter_seat(
|
|
long unit_index,
|
|
long target_unit_index,
|
|
short seat_index);
|
|
boolean unit_has_weapon(
|
|
long unit_index,
|
|
long weapon_index);
|
|
void unit_drop_current_equipment(
|
|
long unit_index);
|
|
void unit_set_mouth_aperture(
|
|
long unit_index,
|
|
real mouth_aperture);
|
|
|
|
void unit_set_possessed(
|
|
long unit_index,
|
|
boolean possessed);
|
|
void unit_set_enterable_by_player(
|
|
long unit_index,
|
|
boolean enterable_by_player);
|
|
void unit_aim_without_turning(
|
|
long unit_index,
|
|
boolean aim_without_turning);
|
|
void unit_set_actively_controlled(long unit_index, boolean actively_controlled);
|
|
void unit_scripting_can_blink(
|
|
long unit_index,
|
|
boolean can_blink);
|
|
void unit_scripting_doesnt_drop_items(
|
|
long object_list_index);
|
|
void unit_set_desired_flashlight_state(
|
|
long unit_index,
|
|
boolean desired_state);
|
|
void units_set_desired_flashlight_state(
|
|
long object_list_index,
|
|
boolean desired_state);
|
|
boolean unit_driven_by_ai(
|
|
long unit_index);
|
|
boolean unit_gunned_by_ai(
|
|
long unit_index);
|
|
boolean unit_seat_filled(
|
|
long unit_index,
|
|
short seat_index);
|
|
boolean unit_seat_is_driver(
|
|
long unit_index,
|
|
short seat_index);
|
|
boolean unit_seat_is_gunner(
|
|
long unit_index,
|
|
short seat_index);
|
|
boolean unit_seat_allow_noncombatants(
|
|
long unit_index,
|
|
short seat_index);
|
|
boolean unit_is_busy(long object_index);
|
|
void unit_scripting_set_emotion_animation(long unit_index, char const *animation_name);
|
|
void unit_scripting_suspended(
|
|
long unit_index,
|
|
boolean suspended);
|
|
boolean any_unit_is_dangerous(
|
|
void);
|
|
boolean unit_custom_animation_at_frame(
|
|
long unit_index,
|
|
long animation_graph_index,
|
|
char const *animation_name,
|
|
boolean interpolate,
|
|
short frame_index);
|
|
|
|
boolean unit_drop_current_weapon(long unit_index, boolean immediate);
|
|
|
|
boolean unit_throw_grenade_begin(long unit_index, real_vector2d const *alignment_vector);
|
|
|
|
void unit_damage_aftermath(
|
|
long unit_index,
|
|
struct damage_data *damage_data,
|
|
unsigned long damage_flags,
|
|
real shield_damage,
|
|
real body_damage,
|
|
real body_damage_multiplier,
|
|
short body_part);
|
|
|
|
void unit_place(
|
|
long unit_index,
|
|
struct scenario_unit_datum const *scenario_unit);
|
|
void unit_scripting_enter_vehicle(
|
|
long unit_index,
|
|
long vehicle_index,
|
|
char const *seat_name);
|
|
void unit_preprocess_node_orientations(
|
|
long unit_index,
|
|
struct real_orientation *node_orientations);
|
|
void unit_postprocess_node_matrices(
|
|
long object_index,
|
|
struct real_matrix4x3 *node_matrices);
|
|
|
|
|
|
/* ---------- prototypes/UNIT_DIALOGUE.C */
|
|
|
|
short unit_test_speech(
|
|
long unit_index,
|
|
short priority,
|
|
boolean allow_recursive_lookup,
|
|
boolean allow_queue,
|
|
long *unit_last_speech_time,
|
|
short *vocalization_type_reference,
|
|
long *sound_definition_index_reference);
|
|
void unit_speak(
|
|
long unit_index,
|
|
short play_type,
|
|
struct unit_speech_item const *speech_item);
|
|
short unit_get_speech_priority_by_name(
|
|
char const *name);
|
|
void unit_notify_impulse_sound(
|
|
long unit_index,
|
|
long sound_definition_index,
|
|
long impulse_sound_index);
|
|
boolean unit_is_speaking(
|
|
long unit_index);
|
|
boolean unit_make_damage_sound(
|
|
long unit_index,
|
|
struct damage_data *damage_data,
|
|
boolean died,
|
|
boolean died_instantly,
|
|
real body_damage,
|
|
real shield_damage);
|
|
boolean unit_scream(
|
|
long unit_index,
|
|
short scream_type);
|
|
void unit_animation_start_action(
|
|
long unit_index,
|
|
short action);
|
|
void unit_handle_weapon_state_change(
|
|
long object_index,
|
|
short new_state);
|
|
void unit_cause_player_melee_damage(
|
|
long unit_index);
|
|
short unit_update_animation(
|
|
long unit_index,
|
|
struct unit_animation_update_data *data);
|
|
void unit_dialogue_update(
|
|
long unit_index);
|
|
|
|
|
|
/* ---------- globals */
|
|
|
|
extern short magic_base_animation_seat_index;
|
|
extern boolean debug_objects_unit_mouth_apeture;
|
|
extern boolean debug_objects_unit_seats;
|
|
extern boolean debug_objects_unit_vectors;
|
|
extern boolean stun_enable;
|
|
extern boolean debug_damage_taken;
|
|
extern boolean debug_unit_illumination;
|
|
extern boolean debug_unit_animations;
|
|
extern boolean debug_unit_all_animations;
|
|
|
|
/* ---------- public code */
|
|
|
|
#endif // __UNITS_H
|