Set names for remaining chraction.c functions

This commit is contained in:
Ryan Dwyer
2025-02-10 18:32:05 +10:00
parent c44895b2b2
commit e9768fa727
17 changed files with 843 additions and 762 deletions
+32 -32
View File
@@ -4,11 +4,11 @@
#include "data.h"
#include "types.h"
bool chr_go_pos_is_waiting(struct chrdata *chr);
bool weapon_is_one_handed(struct prop *prop);
bool chr_gopos_is_waiting(struct chrdata *chr);
bool weapon_is_onehanded(struct prop *prop);
f32 chr_get_attack_entity_distance(struct chrdata *chr, u32 attackflags, s32 entityid);
void func0f02e3dc(struct coord *a, struct coord *b, struct coord *c, struct coord *d, struct coord *dst);
void func0f02e4f8(struct coord *arg0, struct coord *arg1, struct coord *dst);
void chr_calculate_push_contact_pos(struct coord *a, struct coord *b, struct coord *c, struct coord *d, struct coord *dst);
void chr_calculate_push_contact_pos_using_saved_edge(struct coord *arg0, struct coord *arg1, struct coord *dst);
void chr_stand(struct chrdata *chr);
bool chr_face_cover(struct chrdata *chr);
void chr_begin_death(struct chrdata *chr, struct coord *dir, f32 relangle, s32 hitpart, struct gset *gset, bool knockout, s32 aplayernum);
@@ -29,14 +29,14 @@ bool chr_has_los_to_prop(struct chrdata *chr, struct prop *prop);
bool chr_is_stopped(struct chrdata *chr);
bool chr_check_can_see_target(struct chrdata *chr);
bool chr_try_sidestep(struct chrdata *chr);
bool chr_try_jump_out(struct chrdata *chr);
bool chr_try_run_sideways(struct chrdata *chr);
bool chr_try_attack_walk(struct chrdata *chr);
bool chr_try_attack_run(struct chrdata *chr);
bool chr_try_attack_roll(struct chrdata *chr);
bool chr_try_attack_amount(struct chrdata *chr, u32 arg1, u32 arg2, u8 arg3, u8 arg4);
bool chr_try_jumpout(struct chrdata *chr);
bool chr_try_runsideways(struct chrdata *chr);
bool chr_try_attackwalk(struct chrdata *chr);
bool chr_try_attackrun(struct chrdata *chr);
bool chr_try_attackroll(struct chrdata *chr);
bool chr_try_attackamount(struct chrdata *chr, u32 arg1, u32 arg2, u8 arg3, u8 arg4);
bool chr_go_to_pad(struct chrdata *chr, s32 padnum, u32 goposflags);
s32 func0f03aca0(struct chrdata *chr, f32 arg1, u8 arg2);
s32 chr_go_to_cover_opposite_runfrompos(struct chrdata *chr, f32 arg1, u8 arg2);
bool chr_try_run_from_target(struct chrdata *chr);
bool chr_go_to_cover_prop(struct chrdata *chr);
bool chr_drop_item(struct chrdata *chr, u32 modelnum, u32 weaponnum);
@@ -45,22 +45,22 @@ bool chr_try_punch(struct chrdata *chr, u8 reverse);
struct eyespy *chr_to_eyespy(struct chrdata *chr);
void chr_update_fireslot(struct chrdata *chr, s32 handnum, bool withsound, bool withbeam, struct coord *from, struct coord *to);
f32 chr_get_theta(struct chrdata *chr);
f32 chr_get_aim_angle(struct chrdata *chr);
f32 chr_get_pitch_angle(struct chrdata *chr);
bool func0f03e9f4(struct chrdata *chr, struct attackanimconfig *animcfg, s32 arg2, s32 arg3, f32 arg4);
void chr_calculate_aim_end_properties(struct chrdata *chr, struct attackanimconfig *animcfg, bool firingleft, bool firingright, f32 shootrotx);
f32 chr_get_aimx_angle(struct chrdata *chr);
f32 chr_get_aimy_angle(struct chrdata *chr);
bool chr_calculate_aimend(struct chrdata *chr, struct attackanimconfig *animcfg, bool hasleftgun, bool hasrightgun, f32 arg4);
void chr_calculate_aimend_vertical(struct chrdata *chr, struct attackanimconfig *animcfg, bool hasleftgun, bool hasrightgun, f32 shootrotx);
f32 chr_get_aim_limit_angle(f32 sqdist);
bool chr_get_gun_pos(struct chrdata *chr, s32 handnum, struct coord *gunpos);
void chr_calculate_shield_hit(struct chrdata *chr, struct coord *pos, struct coord *vector, struct modelnode **node, s32 *hitpart, struct model **model, s32 *side);
void chr_calculate_trajectory(struct coord *frompos, f32 arg1, struct coord *aimpos, struct coord *arg3);
void func0f041a74(struct chrdata *chr);
void chr_tick_shots(struct chrdata *chr);
bool pos_is_moving_towards_pos_or_stopped_in_range(struct coord *prevpos, struct coord *moveddelta, struct coord *targetpos, f32 range);
bool pos_is_arriving_laterally_at_pos(struct coord *prevpos, struct coord *curpos, struct coord *targetpos, f32 range);
void chra_tick(struct chrdata *chr);
void cutscene_start(u32 ailistid);
void chra_tick_bg(void);
f32 chr_get_angle_to_pos(struct chrdata *chr, struct coord *pos);
bool chr_is_in_targets_fov_x(struct chrdata *chr, u8 fov360);
bool chr_is_in_targets_fovx(struct chrdata *chr, u8 fov360);
bool chr_is_vertical_angle_to_target_within(struct chrdata *chr, u8 arg1);
bool chr_is_target_in_fov(struct chrdata *chr, u8 arg1, u8 reverse);
bool chr_is_looking_at_pos(struct chrdata *chr, struct coord *pos, u8 arg2);
@@ -92,17 +92,17 @@ bool chr_flank(struct chrdata *chr, u32 angle360, struct coord *pos, u8 use_clos
void rebuild_teams(void);
void rebuild_squadrons(void);
void chr_avoid(struct chrdata *chr);
void func0f02e9a0(struct chrdata *chr, f32 mergetime);
void chr_stand_immediate(struct chrdata *chr, f32 mergetime);
f32 chr_get_shield(struct chrdata *chr);
void chr_die(struct chrdata *chr, s32 aplayernum);
struct path *path_find_by_id(u32 path_id);
bool chr_has_los_to_target(struct chrdata *chr);
void chr_record_last_hear_target_time(struct chrdata *chr);
bool chr_is_dead(struct chrdata *chr);
bool chr_try_attack_stand(struct chrdata *chr, u32 attackflags, s32 entityid);
bool chr_try_attack_kneel(struct chrdata *chr, u32 attackflags, s32 entityid);
bool chr_try_attack_lie(struct chrdata *chr, u32 attackflags, s32 entityid);
bool chr_try_modify_attack(struct chrdata *chr, u32 attackflags, s32 entityid);
bool chr_try_attackstand(struct chrdata *chr, u32 attackflags, s32 entityid);
bool chr_try_attackkneel(struct chrdata *chr, u32 attackflags, s32 entityid);
bool chr_try_attacklie(struct chrdata *chr, u32 attackflags, s32 entityid);
bool chr_try_modifyattack(struct chrdata *chr, u32 attackflags, s32 entityid);
bool chr_face_entity(struct chrdata *chr, u32 attackflags, s32 entityid);
bool chr_set_path(struct chrdata *chr, u32 path_id);
bool chr_try_start_patrol(struct chrdata *chr);
@@ -112,17 +112,17 @@ bool chr_go_to_target(struct chrdata *chr, u32 goposflags);
bool chr_go_to_chr(struct chrdata *chr, u32 dst_chrnum, u32 goposflags);
bool chr_go_to_prop(struct chrdata *chr, struct prop *prop, u32 goposflags);
bool chr_try_stop(struct chrdata *chr);
bool chr_try_surprised_one_hand(struct chrdata *chr);
bool chr_try_surprised_onehand(struct chrdata *chr);
bool chr_try_surprised_surrender(struct chrdata *chr);
bool chr_try_surprised_look_around(struct chrdata *chr);
bool chr_try_surprised_lookaround(struct chrdata *chr);
bool chr_try_kneel(struct chrdata *chr);
bool chr_try_start_anim(struct chrdata *chr, s32 animnum, f32 startframe, f32 endframe, u8 chranimflags, s32 merge, f32 speed);
bool chr_try_start_alarm(struct chrdata *chr, s32 pad_id);
bool chr_try_anim(struct chrdata *chr, s32 animnum, f32 startframe, f32 endframe, u8 chranimflags, s32 merge, f32 speed);
bool chr_try_startalarm(struct chrdata *chr, s32 pad_id);
bool chr_consider_grenade_throw(struct chrdata *chr, u32 attackflags, u32 entityid);
void chr_fade_corpse_when_off_screen(struct chrdata *chr);
void chr_fade_corpse_when_offscreen(struct chrdata *chr);
void chr_set_theta(struct chrdata *chr, f32 angle);
f32 chr_get_rot_y(struct chrdata *chr);
void chr_reset_aim_end_properties(struct chrdata *chr);
void chr_reset_aimend(struct chrdata *chr);
void chr_set_firing(struct chrdata *chr, s32 hand, bool firing);
void chr_stop_firing(struct chrdata *chr);
void chr_set_hand_firing(struct chrdata *chr, s32 hand, bool arg2);
@@ -130,7 +130,7 @@ void prop_unset_dangerous(struct prop *prop);
void prop_set_dangerous(struct prop *prop);
bool chr_detect_dangerous_object(struct chrdata *chr, u8 flags);
s32 chr_is_using_lift(struct chrdata *chr);
bool chr_try_sk_jump(struct chrdata *chr, u8 pouncebits, u8 arg2, s32 arg3, u8 arg4);
bool chr_try_skjump(struct chrdata *chr, u8 pouncebits, u8 arg2, s32 arg3, u8 arg4);
bool chr_saw_target_recently(struct chrdata *chr);
bool chr_heard_target_recently(struct chrdata *chr);
f32 chr_get_angle_to_target(struct chrdata *chr);
@@ -159,9 +159,9 @@ void chr_unset_stage_flag(struct chrdata *chr, u32 flag);
bool chr_has_stage_flag(struct chrdata *chr, u32 flag);
bool chr_is_hearing_target(struct chrdata *chr);
void chr_restart_timer(struct chrdata *chr);
bool chr_reset_near_miss(struct chrdata *chr);
bool chr_reset_nearmiss(struct chrdata *chr);
s32 chr_get_num_arghs(struct chrdata *chr);
s32 chr_get_num_close_arghs(struct chrdata *chr);
s32 chr_get_num_closearghs(struct chrdata *chr);
void decrement_byte(u8 *dst, u8 amount);
void increment_byte(u8 *dst, u8 amount);
bool chr_can_hear_alarm(struct chrdata *chr);
@@ -186,6 +186,6 @@ bool audio_was_not_played_recently(s16 audioid);
Gfx *chrs_render_chr_stats(Gfx *gdl, RoomNum *rooms);
void chr_toggle_model_part(struct chrdata *chr, s32 partnum);
bool chr_is_avoiding(struct chrdata *chr);
void chr_dr_caroll_emit_sparks(struct chrdata *chr);
void chr_drcaroll_emit_sparks(struct chrdata *chr);
#endif
+1 -1
View File
@@ -317,7 +317,7 @@
/*0x013b*/ bool ai_set_squadron(void);
/*0x013c*/ bool ai_face_cover(void);
/*0x013d*/ bool ai_if_dangerous_object_nearby(void);
/*0x013e*/ bool ai013e(void);
/*0x013e*/ bool ai_run_from_grenade(void);
/*0x013f*/ bool ai_if_heli_weapons_armed(void);
/*0x0140*/ bool ai_if_hoverbot_next_step(void);
/*0x0141*/ bool ai_shuffle_investigation_terminals(void);
+31 -18
View File
@@ -333,22 +333,35 @@ union filedataptr {
struct attackanimconfig {
/*0x00*/ s16 animnum;
/*0x04*/ f32 unk04; // frame number
/*0x08*/ f32 unk08;
/*0x0c*/ f32 unk0c;
/*0x10*/ f32 unk10; // frame number
/*0x14*/ f32 unk14; // frame number
/*0x18*/ f32 unk18; // frame number
/*0x1c*/ f32 unk1c; // frame number
/*0x20*/ f32 unk20; // frame number
/*0x24*/ f32 unk24; // frame number
/*0x28*/ f32 unk28; // frame number
/*0x2c*/ f32 unk2c; // frame number
/*0x30*/ f32 unk30;
/*0x34*/ f32 unk34;
/*0x38*/ f32 unk38;
/*0x3c*/ f32 unk3c;
/*0x40*/ f32 unk40;
/*0x44*/ f32 unk44;
/*0x08*/ f32 turnangleperframe;
/*0x0c*/ f32 angleoffset; // how far the "zero" X angle is off the chr's facing angle
// start <= aimstart <= shootstart <= recoilstart <= recoilend <= shootend <= aimend <= end
// start/end: Allows starting on a later frame or finishing on an earlier
// frame than what's in the animation. endframe may be -1.
// aimstart/aimend: When the chr can start swiveling their aim. They can do
// this while still raising their arm, before they are ready to shoot.
// shootstart/shootend: Chr will shoot during these frames if they have line
// of sight.
// recoilstart/recoilend: Recoil frames, for single shot pistols.
// Can be -1 if the anim doesn't have recoil frames.
/*0x10*/ f32 startframe;
/*0x14*/ f32 endframe;
/*0x18*/ f32 shootstartframe;
/*0x1c*/ f32 shootendframe;
/*0x20*/ f32 recoilstartframe;
/*0x24*/ f32 recoilendframe;
/*0x28*/ f32 aimstartframe;
/*0x2c*/ f32 aimendframe;
/*0x30*/ f32 maxup; // if aiming up more than this angle, chr will lean backwards
/*0x34*/ f32 maxdown; // if aiming down more than this angle, chr will lean forwards
/*0x38*/ f32 maxleft; // positive
/*0x3c*/ f32 maxright; // negative
/*0x40*/ f32 freearmfracup; // when aiming up, gunless arm will move by this fraction of the gun arm
/*0x44*/ f32 freearmfracdown; // when aiming down, gunless arm will move by this fraction of the gun arm
};
struct model;
@@ -2659,8 +2672,8 @@ struct player {
/*0x1960*/ u32 killsthislife;
/*0x1964*/ u32 healthdisplaytime60;
/*0x1968*/ f32 guncloseroffset;
/*0x196c*/ f32 shootrotx;
/*0x1970*/ f32 shootroty;
/*0x196c*/ f32 shootrotx; // up/down (rotation on X axis)
/*0x1970*/ f32 shootroty; // left/right (rotation on Y axis)
/*0x1974*/ char *award1;
/*0x1978*/ char *award2;
/*0x197c*/ struct coord chrmuzzlelastpos[2];