Improve gun anim symbol names

This commit is contained in:
Ryan Dwyer
2024-08-21 23:25:18 +10:00
parent 79ff231ee6
commit e55afd283f
7 changed files with 367 additions and 338 deletions
+19 -8
View File
@@ -1222,11 +1222,17 @@
#define GUNAMMOREASON_OPTION 0x01
#define GUNAMMOREASON_NOCONTROL 0x02
#define GUNAMMOSTATE_DEPLETED -1
#define GUNAMMOSTATE_NEEDRELOAD 0
#define GUNAMMOSTATE_CLIPYES_HELDYES 1
#define GUNAMMOSTATE_CLIPYES_HELDNO 2
#define GUNAMMOSTATE_CLIPFULL 3
#define GUNCMD_END 0
#define GUNCMD_SHOWPART 1
#define GUNCMD_HIDEPART 2
#define GUNCMD_WAITFORZRELEASED 3
#define GUNCMD_WAITTIME 4
#define GUNCMD_ALLOWFEATURE 4
#define GUNCMD_PLAYSOUND 5
#define GUNCMD_INCLUDE 6
#define GUNCMD_RANDOM 7
@@ -1235,6 +1241,11 @@
#define GUNCMD_PLAYANIMATION 10
#define GUNCMD_SETSOUNDSPEED 11
#define GUNFEATURE_RELOAD 1
#define GUNFEATURE_ATTACK 2
#define GUNFEATURE_ATTACKAGAIN 3
#define GUNFEATURE_CLICK 5
#define GUNMEMOWNER_BONDGUN 0
#define GUNMEMOWNER_INVMENU 1
#define GUNMEMOWNER_CHRBODY 2
@@ -4441,9 +4452,9 @@ enum weaponnum {
#define WEAPON_MPLOCATION14 254
#define WEAPON_MPLOCATION15 255
#define INVAIMFLAG_MANUALZOOM 0x00000001
#define INVAIMFLAG_AUTOAIM 0x00000002
#define INVAIMFLAG_ACCURATESINGLESHOT 0x00000004
#define INVAIMFLAG_MANUALZOOM 0x00000001
#define INVAIMFLAG_AUTOAIM 0x00000002
#define INVAIMFLAG_ACCURATESINGLESHOT 0x00000004
#define WEAPONFLAG_THROWABLE 0x00000001 // Entire weapon is throwable (eg. grendes, mines, knives)
#define WEAPONFLAG_00000004 0x00000004
@@ -4456,9 +4467,9 @@ enum weaponnum {
#define WEAPONFLAG_00000400 0x00000400
#define WEAPONFLAG_00000800 0x00000800 // MP briefcase
#define WEAPONFLAG_DUALWIELD 0x00001000 // Allow dual wielding
#define WEAPONFLAG_00002000 0x00002000
#define WEAPONFLAG_HASGUNSCRIPT 0x00002000
#define WEAPONFLAG_00004000 0x00004000
#define WEAPONFLAG_00008000 0x00008000 // Editor: "Special environment mapping"
#define WEAPONFLAG_BRIGHTER 0x00008000 // Use extra light to illuminate weapon
#define WEAPONFLAG_HASHANDS 0x00020000
#define WEAPONFLAG_HIDEMENUMODEL 0x00040000 // Don't display the rotating model in the inventory menu
#define WEAPONFLAG_GANGSTA 0x00080000 // Allow turning the gun sideways at close range
@@ -4467,8 +4478,8 @@ enum weaponnum {
#define WEAPONFLAG_DETERMINER_F_AN 0x00400000 // "Picked up an ..." (full version)
#define WEAPONFLAG_DETERMINER_S_THE 0x00800000 // "The ..." (short version - when vertically split)
#define WEAPONFLAG_DETERMINER_F_THE 0x01000000 // "Picked up the ..." (full version)
#define WEAPONFLAG_02000000 0x02000000 // Slayer
#define WEAPONFLAG_04000000 0x04000000
#define WEAPONFLAG_RESETMATRICES 0x02000000 // Slayer
#define WEAPONFLAG_KEEPFUNCWHENEMPTY 0x04000000 // Don't change to secondary function when primary is out of ammo
#define WEAPONFLAG_UNDROPPABLE 0x08000000 // Do not drop when disarmed or killed
#define WEAPONFLAG_DETERMINER_S_SOME 0x10000000 // "Some ..." (short version - when vertically split)
#define WEAPONFLAG_DETERMINER_F_SOME 0x20000000 // "Picked up some ..." (full version)
+12 -13
View File
@@ -14,27 +14,26 @@ void bgun_tick_unequipped_reload(void);
bool bgun_test_gun_vis_command(struct gunviscmd *cmd, struct hand *hand);
void bgun_set_part_visible(s16 partnum, bool visible, struct hand *hand, struct modeldef *modeldef);
void bgun_execute_gun_vis_commands(struct hand *hand, struct modeldef *arg1, struct gunviscmd *command);
void bgun0f098030(struct hand *hand, struct modeldef *arg1);
f32 bgun0f09815c(struct hand *hand);
void bgun0f0981e8(struct hand *hand, struct modeldef *modeldef);
bool bgun0f098884(struct guncmd *cmd, struct gset *gset);
void bgun_update_ammo_visibility(struct hand *hand, struct modeldef *arg1);
f32 bgun_get_current_keyframe(struct hand *hand);
void bgun_tick_anim(struct hand *hand, struct modeldef *modeldef);
bool bgun_test_condition(struct guncmd *cmd, struct gset *gset);
void bgun_start_animation(struct guncmd *cmd, s32 handnum, struct hand *hand);
bool bgun0f098a44(struct hand *hand, s32 time);
bool bgun_is_anim_busy(struct hand *hand);
void bgun_reset_anim(struct hand *hand);
void bgun_get_weapon_info(struct handweaponinfo *info, s32 handnum);
s32 bgun0f098ca0(s32 arg0, struct handweaponinfo *info, struct hand *hand);
s32 bgun_get_ammo_state(s32 arg0, struct handweaponinfo *info, struct hand *hand);
void bgun0f098df8(s32 weaponfunc, struct handweaponinfo *info, struct hand *hand, u8 onebullet, u8 checkunequipped);
void bgun0f098f8c(struct handweaponinfo *info, struct hand *hand);
bool bgun0f099008(s32 handnum);
bool bgun_clip_has_ammo(s32 handnum);
bool bgun0f0990b0(struct weaponfunc *basefunc, struct weapon *weapon);
bool bgun0f099188(struct hand *hand, s32 gunfunc);
s32 bgun_tick_inc_idle(struct handweaponinfo *info, s32 handnum, struct hand *hand, s32 lvupdate);
void bgun_set_arm_pitch(struct hand *hand, f32 angle);
s32 bgun_tick_inc_auto_switch(struct handweaponinfo *info, s32 handnum, struct hand *hand, s32 lvupdate);
s32 bgun_tick_inc_autoswitch(struct handweaponinfo *info, s32 handnum, struct hand *hand, s32 lvupdate);
bool bgun_is_reloading(struct hand *hand);
s32 bgun_tick_inc_reload(struct handweaponinfo *info, s32 handnum, struct hand *hand, s32 lvupdate);
s32 bgun_tick_inc_change_func(struct handweaponinfo *info, s32 handnum, struct hand *hand, s32 lvupdate);
s32 bgun_tick_inc_changefunc(struct handweaponinfo *info, s32 handnum, struct hand *hand, s32 lvupdate);
s32 bgun0f09a3f8(struct hand *hand, struct weaponfunc *func);
void bgun0f09a6f8(struct handweaponinfo *info, s32 handnum, struct hand *hand, struct weaponfunc *func);
bool bgun_tick_recoil(struct hand *hand, struct handweaponinfo *info, s32 handnum, struct weaponfunc_shoot *func);
@@ -43,12 +42,12 @@ bool bgun_tick_inc_attacking_throw(s32 handnum, struct hand *hand);
s32 bgun_get_min_clip_qty(s32 weaponnum, s32 funcnum);
bool bgun_tick_inc_attacking_melee(s32 handnum, struct hand *hand);
bool bgun_tick_inc_attacking_special(struct hand *hand);
s32 bgun_tick_inc_attack_empty(struct handweaponinfo *info, s32 handnum, struct hand *hand, s32 lvupdate);
s32 bgun_tick_inc_attackempty(struct handweaponinfo *info, s32 handnum, struct hand *hand, s32 lvupdate);
s32 bgun_tick_inc_attack(struct handweaponinfo *info, s32 handnum, struct hand *hand, s32 lvupdate);
bool bgun_is_ready_to_switch(s32 handnum);
bool bgun_can_free_weapon(s32 handnum);
bool bgun0f09bf44(s32 handnum);
s32 bgun_tick_inc_change_gun(struct handweaponinfo *info, s32 handnum, struct hand *hand, s32 lvupdate);
s32 bgun_tick_inc_changegun(struct handweaponinfo *info, s32 handnum, struct hand *hand, s32 lvupdate);
s32 bgun_tick_inc_state2(struct handweaponinfo *info, s32 handnum, struct hand *hand, s32 lvupdate);
s32 bgun_tick_inc(struct handweaponinfo *info, s32 handnum, s32 lvupdate);
bool bgun_set_state(s32 handnum, s32 state);
@@ -114,7 +113,7 @@ void bgun_start_slide(s32 handnum);
void bgun_update_slide(s32 handnum);
f32 bgun0f0a2498(f32 arg0, f32 arg1, f32 arg2, f32 arg3);
void bgun0f0a24f0(struct coord *arg0, s32 handnum);
bool bgun0f0a27c8(void);
bool bgun_allows_fullscreen_autoaim(void);
void bgun_handle_player_dead(void);
bool bgun_is_mission_critical(s32 weaponnum);
void bgun_disarm(struct prop *attacker);
@@ -129,7 +128,7 @@ void bgun_update_sniper_rifle(struct modeldef *modeldef, u8 *allocation);
void bgun_update_devastator(struct hand *hand, u8 *allocation, struct modeldef *modeldef);
void bgun_update_shotgun(struct hand *hand, u8 *allocation, bool *arg2, struct modeldef *modeldef);
void bgun_update_laser(struct hand *hand);
void bgun_update_magnum(struct hand *hand, s32 handnum, struct modeldef *modeldef, Mtxf *mtx);
void bgun_eject_magnum_casings(struct hand *hand, s32 handnum, struct modeldef *modeldef, Mtxf *mtx);
void bgun_update_rocket_launcher(struct hand *hand, s32 handnum, struct weaponfunc_shootprojectile *func);
void bgun0f0a45d0(struct hand *hand, struct modeldef *modeldef, bool isdetonator);
void bgun_tick_eject(struct hand *hand, struct modeldef *modeldef, bool isdetonator);
+6 -6
View File
@@ -10,20 +10,20 @@
#define gunscript_waitforzreleased(keyframe) \
{ GUNCMD_WAITFORZRELEASED, 0, keyframe },
#define gunscript_waittime(keyframe, time) \
{ GUNCMD_WAITTIME, 0, keyframe, time },
#define gunscript_allowfeature(keyframe, feature) \
{ GUNCMD_ALLOWFEATURE, 0, keyframe, feature },
#define gunscript_playsound(keyframe, sound) \
{ GUNCMD_PLAYSOUND, 0, keyframe, sound },
#define gunscript_include(unk1, address) \
{ GUNCMD_INCLUDE, unk1, 0, (u32)address },
{ GUNCMD_INCLUDE, unk1, 0, (uintptr_t) address },
#define gunscript_random(probability, address) \
{ GUNCMD_RANDOM, 0, probability, (u32)address },
{ GUNCMD_RANDOM, 0, probability, (uintptr_t) address },
#define gunscript_repeatuntilfull(triggerkey, dontloop, gototrigger) \
{ GUNCMD_REPEATUNTILFULL, 0, triggerkey, (dontloop << 16) | gototrigger },
#define gunscript_repeatuntilfull(keyframe, gotokeyframe) \
{ GUNCMD_REPEATUNTILFULL, 0, keyframe, gotokeyframe },
#define gunscript_popoutsackofpills(unk1) \
{ GUNCMD_POPOUTSACKOFPILLS, 0, unk1 },
+20 -8
View File
@@ -2216,7 +2216,7 @@ struct hand {
/*0x0cc8*/ u8 unk0cc8_01 : 1;
/*0x0cc8*/ u8 unk0cc8_02 : 1;
/*0x0cc8*/ u8 incrementalreloading : 1;
/*0x0cc8*/ u8 unk0cc8_04 : 3;
/*0x0cc8*/ u8 ejectcount : 3;
/*0x0cc8*/ u8 unk0cc8_07 : 1;
/*0x0cc8*/ u8 unk0cc8_08 : 1;
/*0x0cc9*/ u8 animloopcount;
@@ -2225,7 +2225,7 @@ struct hand {
/*0x0cdc*/ u32 statejob;
/*0x0ce0*/ s32 statevar1;
/*0x0ce4*/ s32 attacktype;
/*0x0ce8*/ struct guncmd *unk0ce8;
/*0x0ce8*/ struct guncmd *animcmd;
/*0x0cec*/ ubool hasdotinfo;
/*0x0cf0*/ struct coord dotpos;
/*0x0cfc*/ struct coord dotrot;
@@ -2248,7 +2248,7 @@ struct hand {
/*0x0d50*/ f32 unk0d50[3][3];
/*0x0d74*/ u16 gunroundsspent[4]; // actually a countdown timer
/*0x0d7c*/ s32 ispare1;
/*0x0d80*/ struct guncmd *unk0d80;
/*0x0d80*/ struct guncmd *animcmd2;
/*0x0d84*/ struct sndstate *audiohandle;
/*0x0d88*/ u32 ispare4;
/*0x0d8c*/ u32 ispare5;
@@ -2266,8 +2266,8 @@ struct hand {
/*0x0dbc*/ u32 fspare7;
/*0x0dc0*/ u32 fspare8;
/*0x0dc4*/ struct abmag abmag;
/*0x0dcc*/ s32 *unk0dcc;
/*0x0dd0*/ s32 *unk0dd0;
/*0x0dcc*/ s32 *compiledgunmodelcmds;
/*0x0dd0*/ s32 *compiledhandmodelcmds;
/*0x0dd4*/ s32 unk0dd4;
/*0x0dd8*/ Mtxf *unk0dd8;
};
@@ -5252,9 +5252,21 @@ struct stageallocation {
struct guncmd {
u8 type;
u8 unk01;
u16 unk02;
s32 unk04;
u8 condition;
union {
u16 animnum;
u16 keyframe;
u16 probability;
};
union {
s32 feature;
s32 partnum;
s32 soundnum;
s32 soundspeed;
s32 animparams;
s32 gotokeyframe;
struct guncmd *targetcmd;
};
};
struct pakthing {