Rename weapon definition structs to be suffixed with def
This commit is contained in:
parent
3a6ae92d2d
commit
51c8d83659
|
@ -416,8 +416,8 @@ void am_get_slot_details(s32 slot, u32 *flags, char *label)
|
|||
s32 qty;
|
||||
s32 secs;
|
||||
s32 modulo;
|
||||
struct weaponfunc *prifunc;
|
||||
struct weaponfunc *secfunc;
|
||||
struct funcdef *prifunc;
|
||||
struct funcdef *secfunc;
|
||||
|
||||
switch (g_AmMenus[g_AmIndex].screenindex) {
|
||||
case 0: // Weapon screen
|
||||
|
|
|
@ -307,8 +307,8 @@ void am_tick(void)
|
|||
|
||||
// If weapon has no functions, skip past function screen
|
||||
if (g_AmMenus[g_AmIndex].screenindex == 1) {
|
||||
struct weaponfunc *pri = gset_get_funcdef_by_gset_funcnum(&g_Vars.currentplayer->hands[0].gset, FUNC_PRIMARY);
|
||||
struct weaponfunc *sec = gset_get_funcdef_by_gset_funcnum(&g_Vars.currentplayer->hands[0].gset, FUNC_SECONDARY);
|
||||
struct funcdef *pri = gset_get_funcdef_by_gset_funcnum(&g_Vars.currentplayer->hands[0].gset, FUNC_PRIMARY);
|
||||
struct funcdef *sec = gset_get_funcdef_by_gset_funcnum(&g_Vars.currentplayer->hands[0].gset, FUNC_SECONDARY);
|
||||
|
||||
if (!pri && !sec) {
|
||||
am_change_screen(gotonextscreen);
|
||||
|
|
|
@ -424,7 +424,7 @@ void bgun_execute_gun_vis_commands(struct hand *hand, struct modeldef *modeldef,
|
|||
|
||||
void bgun_update_ammo_visibility(struct hand *hand, struct modeldef *modeldef)
|
||||
{
|
||||
struct weapon *weapon = gset_get_weapondef(hand->gset.weaponnum);
|
||||
struct weapondef *weapon = gset_get_weapondef(hand->gset.weaponnum);
|
||||
s32 i;
|
||||
s32 j;
|
||||
|
||||
|
@ -862,7 +862,7 @@ void bgun_get_weapon_info(struct handweaponinfo *info, s32 handnum)
|
|||
s32 bgun_get_ammo_state(s32 funcnum, struct handweaponinfo *info, struct hand *hand)
|
||||
{
|
||||
s32 state = GUNAMMOSTATE_CLIPFULL;
|
||||
struct weaponfunc *func = gset_get_funcdef_by_gset_funcnum(&hand->gset, funcnum);
|
||||
struct funcdef *func = gset_get_funcdef_by_gset_funcnum(&hand->gset, funcnum);
|
||||
|
||||
if (!func) {
|
||||
return GUNAMMOSTATE_DEPLETED;
|
||||
|
@ -903,7 +903,7 @@ s32 bgun_get_ammo_state(s32 funcnum, struct handweaponinfo *info, struct hand *h
|
|||
|
||||
void bgun0f098df8(s32 weaponfunc, struct handweaponinfo *info, struct hand *hand, u8 onebullet, u8 checkunequipped)
|
||||
{
|
||||
struct weaponfunc *func = gset_get_funcdef_by_gset_funcnum(&hand->gset, weaponfunc);
|
||||
struct funcdef *func = gset_get_funcdef_by_gset_funcnum(&hand->gset, weaponfunc);
|
||||
|
||||
if (func && func->ammoindex != -1) {
|
||||
s32 ammoindex = func->ammoindex;
|
||||
|
@ -982,7 +982,7 @@ bool bgun_clip_has_ammo(s32 handnum)
|
|||
return false;
|
||||
}
|
||||
|
||||
bool bgun0f0990b0(struct weaponfunc *basefunc, struct weapon *weapon)
|
||||
bool bgun0f0990b0(struct funcdef *basefunc, struct weapondef *weapon)
|
||||
{
|
||||
if (!basefunc) {
|
||||
return true;
|
||||
|
@ -997,7 +997,7 @@ bool bgun0f0990b0(struct weaponfunc *basefunc, struct weapon *weapon)
|
|||
}
|
||||
|
||||
if ((basefunc->type & 0xff) == INVENTORYFUNCTYPE_SPECIAL) {
|
||||
struct weaponfunc_special *func = (struct weaponfunc_special *)basefunc;
|
||||
struct funcdef_special *func = (struct funcdef_special *)basefunc;
|
||||
|
||||
if (func->specialfunc != HANDATTACKTYPE_DETONATE
|
||||
&& func->specialfunc != HANDATTACKTYPE_BOOST
|
||||
|
@ -1023,8 +1023,8 @@ bool bgun0f0990b0(struct weaponfunc *basefunc, struct weapon *weapon)
|
|||
|
||||
bool bgun0f099188(struct hand *hand, s32 gunfunc)
|
||||
{
|
||||
struct weaponfunc *func = gset_get_funcdef_by_gset_funcnum(&hand->gset, gunfunc);
|
||||
struct weapon *weapon = gset_get_weapondef(hand->gset.weaponnum);
|
||||
struct funcdef *func = gset_get_funcdef_by_gset_funcnum(&hand->gset, gunfunc);
|
||||
struct weapondef *weapon = gset_get_weapondef(hand->gset.weaponnum);
|
||||
|
||||
if (bgun_is_using_secondary_function() == gunfunc) {
|
||||
return false;
|
||||
|
@ -1042,7 +1042,7 @@ s32 bgun_tick_inc_idle(struct handweaponinfo *info, s32 handnum, struct hand *ha
|
|||
bool changefunc;
|
||||
s32 next;
|
||||
struct hand *lhand;
|
||||
struct weaponfunc *func;
|
||||
struct funcdef *func;
|
||||
|
||||
hand->lastdirvalid = false;
|
||||
hand->burstbullets = 0;
|
||||
|
@ -1354,7 +1354,7 @@ bool bgun_is_reloading(struct hand *hand)
|
|||
s32 bgun_tick_inc_reload(struct handweaponinfo *info, s32 handnum, struct hand *hand, s32 lvupdate)
|
||||
{
|
||||
u32 stack;
|
||||
struct weaponfunc *func = gset_get_funcdef_by_gset(&hand->gset);
|
||||
struct funcdef *func = gset_get_funcdef_by_gset(&hand->gset);
|
||||
|
||||
if (g_Vars.currentplayer->isdead) {
|
||||
hand->animmode = HANDANIMMODE_IDLE;
|
||||
|
@ -1590,7 +1590,7 @@ s32 bgun_tick_inc_changefunc(struct handweaponinfo *info, s32 handnum, struct ha
|
|||
return 0;
|
||||
}
|
||||
|
||||
s32 bgun0f09a3f8(struct hand *hand, struct weaponfunc *func)
|
||||
s32 bgun0f09a3f8(struct hand *hand, struct funcdef *func)
|
||||
{
|
||||
bool burst = false;
|
||||
bool smallburst = false;
|
||||
|
@ -1629,7 +1629,7 @@ s32 bgun0f09a3f8(struct hand *hand, struct weaponfunc *func)
|
|||
}
|
||||
|
||||
if ((func->type & 0xff00) == 0x100) {
|
||||
struct weaponfunc_shootauto *autofunc = (struct weaponfunc_shootauto *) func;
|
||||
struct funcdef_shootauto *autofunc = (struct funcdef_shootauto *) func;
|
||||
|
||||
if (autofunc->turretaccel > 0) {
|
||||
if (hand->gs_float1 < 1) {
|
||||
|
@ -1685,7 +1685,7 @@ s32 bgun0f09a3f8(struct hand *hand, struct weaponfunc *func)
|
|||
}
|
||||
|
||||
if ((func->type & 0xff00) == (INVENTORYFUNCTYPE_SHOOT_AUTOMATIC & 0xff00)) {
|
||||
struct weaponfunc_shootauto *autofunc = (struct weaponfunc_shootauto *) func;
|
||||
struct funcdef_shootauto *autofunc = (struct funcdef_shootauto *) func;
|
||||
|
||||
if (autofunc->turretdecel > 0) {
|
||||
if (hand->gs_float1 > 0) {
|
||||
|
@ -1708,7 +1708,7 @@ s32 bgun0f09a3f8(struct hand *hand, struct weaponfunc *func)
|
|||
return -1;
|
||||
}
|
||||
|
||||
void bgun0f09a6f8(struct handweaponinfo *info, s32 handnum, struct hand *hand, struct weaponfunc *func)
|
||||
void bgun0f09a6f8(struct handweaponinfo *info, s32 handnum, struct hand *hand, struct funcdef *func)
|
||||
{
|
||||
bool usesammo = true;
|
||||
|
||||
|
@ -1721,7 +1721,7 @@ void bgun0f09a6f8(struct handweaponinfo *info, s32 handnum, struct hand *hand, s
|
|||
hand->firing = true;
|
||||
|
||||
if ((func->type & 0xff00) == 0x100) {
|
||||
struct weaponfunc_shootauto *autofunc = (struct weaponfunc_shootauto *) func;
|
||||
struct funcdef_shootauto *autofunc = (struct funcdef_shootauto *) func;
|
||||
f32 tmp;
|
||||
f32 tmp2;
|
||||
|
||||
|
@ -1849,7 +1849,7 @@ void bgun0f09a6f8(struct handweaponinfo *info, s32 handnum, struct hand *hand, s
|
|||
}
|
||||
}
|
||||
|
||||
bool bgun_tick_recoil(struct hand *hand, struct handweaponinfo *info, s32 handnum, struct weaponfunc_shoot *func)
|
||||
bool bgun_tick_recoil(struct hand *hand, struct handweaponinfo *info, s32 handnum, struct funcdef_shoot *func)
|
||||
{
|
||||
s32 unk24;
|
||||
s32 unk25;
|
||||
|
@ -1858,7 +1858,7 @@ bool bgun_tick_recoil(struct hand *hand, struct handweaponinfo *info, s32 handnu
|
|||
s32 unk27;
|
||||
s32 recoverytime60;
|
||||
s32 curframe;
|
||||
struct weapon *weapondef;
|
||||
struct weapondef *weapondef;
|
||||
f32 mult1;
|
||||
f32 recoildist;
|
||||
f32 recoilangle;
|
||||
|
@ -2011,7 +2011,7 @@ bool bgun_tick_inc_attacking_shoot(struct handweaponinfo *info, s32 handnum, str
|
|||
{
|
||||
static u32 var80070128 = 99;
|
||||
|
||||
struct weaponfunc *func = gset_get_funcdef_by_gset(&hand->gset);
|
||||
struct funcdef *func = gset_get_funcdef_by_gset(&hand->gset);
|
||||
bool canfireagain;
|
||||
s32 sp64;
|
||||
s32 sp60;
|
||||
|
@ -2051,7 +2051,7 @@ bool bgun_tick_inc_attacking_shoot(struct handweaponinfo *info, s32 handnum, str
|
|||
sp60 = bgun0f09a3f8(hand, func);
|
||||
|
||||
if ((func->type & 0xff00) == 0x100) {
|
||||
struct weaponfunc_shootauto *autofunc = (struct weaponfunc_shootauto *) func;
|
||||
struct funcdef_shootauto *autofunc = (struct funcdef_shootauto *) func;
|
||||
f32 floats[12];
|
||||
|
||||
if (autofunc->vibrationstart != NULL && autofunc->vibrationmax != NULL) {
|
||||
|
@ -2083,7 +2083,7 @@ bool bgun_tick_inc_attacking_shoot(struct handweaponinfo *info, s32 handnum, str
|
|||
|
||||
if (hand->stateminor == HANDSTATEMINOR_ATTACK_SHOOT_2) {
|
||||
if (hand->stateflags & HANDSTATEFLAG_FIRED) {
|
||||
canfireagain = bgun_tick_recoil(hand, info, handnum, (struct weaponfunc_shoot *) func);
|
||||
canfireagain = bgun_tick_recoil(hand, info, handnum, (struct funcdef_shoot *) func);
|
||||
} else {
|
||||
canfireagain = true;
|
||||
}
|
||||
|
@ -2110,7 +2110,7 @@ bool bgun_tick_inc_attacking_shoot(struct handweaponinfo *info, s32 handnum, str
|
|||
|
||||
bool bgun_tick_inc_attacking_throw(s32 handnum, struct hand *hand)
|
||||
{
|
||||
struct weaponfunc_throw *func = (struct weaponfunc_throw *) gset_get_funcdef_by_gset(&hand->gset);
|
||||
struct funcdef_throw *func = (struct funcdef_throw *) gset_get_funcdef_by_gset(&hand->gset);
|
||||
|
||||
if (func == NULL) {
|
||||
return true;
|
||||
|
@ -2222,7 +2222,7 @@ u32 var80070130 = 0x00000000;
|
|||
|
||||
bool bgun_tick_inc_attacking_melee(s32 handnum, struct hand *hand)
|
||||
{
|
||||
struct weaponfunc *func = gset_get_funcdef_by_gset(&hand->gset);
|
||||
struct funcdef *func = gset_get_funcdef_by_gset(&hand->gset);
|
||||
|
||||
if (func == NULL) {
|
||||
return true;
|
||||
|
@ -2330,7 +2330,7 @@ bool bgun_tick_inc_attacking_melee(s32 handnum, struct hand *hand)
|
|||
|
||||
bool bgun_tick_inc_attacking_special(struct hand *hand)
|
||||
{
|
||||
struct weaponfunc_special *func = (struct weaponfunc_special *) gset_get_funcdef_by_gset(&hand->gset);
|
||||
struct funcdef_special *func = (struct funcdef_special *) gset_get_funcdef_by_gset(&hand->gset);
|
||||
|
||||
if (!func) {
|
||||
return true;
|
||||
|
@ -2398,7 +2398,7 @@ s32 bgun_tick_inc_attackempty(struct handweaponinfo *info, s32 handnum, struct h
|
|||
bool restartedanim = false;
|
||||
|
||||
if ((hand->stateflags & HANDSTATEFLAG_BUSY) == 0) {
|
||||
struct weaponfunc *func = NULL;
|
||||
struct funcdef *func = NULL;
|
||||
|
||||
if (info->definition) {
|
||||
func = gset_get_funcdef_by_gset(&hand->gset);
|
||||
|
@ -2526,7 +2526,7 @@ s32 bgun_tick_inc_attackempty(struct handweaponinfo *info, s32 handnum, struct h
|
|||
s32 bgun_tick_inc_attack(struct handweaponinfo *info, s32 handnum, struct hand *hand, s32 lvupdate)
|
||||
{
|
||||
u32 stack;
|
||||
struct weaponfunc *func = NULL;
|
||||
struct funcdef *func = NULL;
|
||||
bool finished = true;
|
||||
u32 stack2;
|
||||
|
||||
|
@ -2663,7 +2663,7 @@ bool bgun0f09bf44(s32 handnum)
|
|||
s32 bgun_tick_inc_changegun(struct handweaponinfo *info, s32 handnum, struct hand *hand, s32 lvupdate)
|
||||
{
|
||||
u32 stack;
|
||||
struct weapon *weapon = info->definition;
|
||||
struct weapondef *weapon = info->definition;
|
||||
|
||||
if (hand->statecycles == 0) {
|
||||
if (g_Vars.normmplayerisrunning == false) {
|
||||
|
@ -3230,7 +3230,7 @@ void bgun_calculate_blend(s32 handnum)
|
|||
{
|
||||
s32 sp60[2];
|
||||
s32 sp58[2];
|
||||
struct weapon *weapon = gset_get_weapondef(bgun_get_weapon_num(handnum));
|
||||
struct weapondef *weapon = gset_get_weapondef(bgun_get_weapon_num(handnum));
|
||||
f32 sway = weapon->sway;
|
||||
struct player *player = g_Vars.currentplayer;
|
||||
|
||||
|
@ -3832,11 +3832,11 @@ void bgun_tick_master_load(void)
|
|||
s32 i;
|
||||
struct casing *casing;
|
||||
struct hand *hand;
|
||||
struct weaponfunc *func;
|
||||
struct weaponfunc *shootfunc;
|
||||
struct weapon *weapondef;
|
||||
struct funcdef *func;
|
||||
struct funcdef *shootfunc;
|
||||
struct weapondef *weapondef;
|
||||
s32 casingindex;
|
||||
struct inventory_ammo *ammodef;
|
||||
struct ammodef *ammodef;
|
||||
s32 value;
|
||||
s32 bodynum;
|
||||
s32 headnum;
|
||||
|
@ -4198,9 +4198,9 @@ void bgun0f09ed2c(struct defaultobj *obj, struct coord *newpos, Mtxf *arg2, stru
|
|||
struct defaultobj *bgun_create_thrown_projectile2(struct chrdata *chr, struct gset *gset, struct coord *pos, RoomNum *rooms, Mtxf *arg4, struct coord *velocity)
|
||||
{
|
||||
struct defaultobj *obj = NULL;
|
||||
struct weaponfunc *basefunc;
|
||||
struct weaponfunc_throw *func;
|
||||
struct weapon *weapon = gset_get_weapondef(gset->weaponnum);
|
||||
struct funcdef *basefunc;
|
||||
struct funcdef_throw *func;
|
||||
struct weapondef *weapon = gset_get_weapondef(gset->weaponnum);
|
||||
struct weaponobj *weaponobj;
|
||||
struct autogunobj *autogun;
|
||||
Mtxf mtx;
|
||||
|
@ -4211,7 +4211,7 @@ struct defaultobj *bgun_create_thrown_projectile2(struct chrdata *chr, struct gs
|
|||
}
|
||||
|
||||
basefunc = weapon->functions[gset->weaponfunc];
|
||||
func = (struct weaponfunc_throw *) basefunc;
|
||||
func = (struct funcdef_throw *) basefunc;
|
||||
|
||||
if (func == NULL) {
|
||||
return false;
|
||||
|
@ -4523,7 +4523,7 @@ void bgun_update_held_rocket(s32 handnum)
|
|||
}
|
||||
}
|
||||
|
||||
void bgun_create_held_rocket(s32 handnum, struct weaponfunc_shootprojectile *func)
|
||||
void bgun_create_held_rocket(s32 handnum, struct funcdef_shootprojectile *func)
|
||||
{
|
||||
struct hand *hand = &g_Vars.currentplayer->hands[handnum];
|
||||
struct weaponobj *obj;
|
||||
|
@ -4560,7 +4560,7 @@ void bgun_free_held_rocket(s32 handnum)
|
|||
|
||||
void bgun_create_fired_projectile(s32 handnum)
|
||||
{
|
||||
struct weapon *weapondef;
|
||||
struct weapondef *weapondef;
|
||||
struct hand *hand;
|
||||
Mtxf sp270;
|
||||
struct coord sp264;
|
||||
|
@ -4575,8 +4575,8 @@ void bgun_create_fired_projectile(s32 handnum)
|
|||
struct coord *extrapos;
|
||||
struct coord spawnpos;
|
||||
struct weaponobj *weapon;
|
||||
struct weaponfunc *tmp;
|
||||
struct weaponfunc_shootprojectile *funcdef;
|
||||
struct funcdef *tmp;
|
||||
struct funcdef_shootprojectile *funcdef;
|
||||
struct coord aimpos;
|
||||
struct coord sp1bc;
|
||||
f32 frac;
|
||||
|
@ -4600,7 +4600,7 @@ void bgun_create_fired_projectile(s32 handnum)
|
|||
tmp = weapondef->functions[hand->gset.weaponfunc];
|
||||
|
||||
if (tmp && tmp->type == INVENTORYFUNCTYPE_SHOOT_PROJECTILE) {
|
||||
funcdef = (struct weaponfunc_shootprojectile *)tmp;
|
||||
funcdef = (struct funcdef_shootprojectile *)tmp;
|
||||
|
||||
mtx4_load_identity(&sp270);
|
||||
bgun_calculate_player_shot_spread(&gunpos, &gundir, handnum, true);
|
||||
|
@ -5032,7 +5032,7 @@ void bgun_swivel(f32 screenx, f32 screeny, f32 crossdamp, f32 aimdamp)
|
|||
*/
|
||||
void bgun_swivel_with_damp(f32 screenx, f32 screeny, f32 crossdamp)
|
||||
{
|
||||
struct weapon *weapon = gset_get_weapondef(bgun_get_weapon_num(HAND_RIGHT));
|
||||
struct weapondef *weapon = gset_get_weapondef(bgun_get_weapon_num(HAND_RIGHT));
|
||||
f32 aimdamp = PAL ? weapon->aimsettings->aimdamppal : weapon->aimsettings->aimdamp;
|
||||
|
||||
if (aimdamp < crossdamp) {
|
||||
|
@ -5050,7 +5050,7 @@ void bgun_swivel_with_damp(f32 screenx, f32 screeny, f32 crossdamp)
|
|||
*/
|
||||
void bgun_swivel_without_damp(f32 screenx, f32 screeny)
|
||||
{
|
||||
struct weapon *weapon = gset_get_weapondef(bgun_get_weapon_num(HAND_RIGHT));
|
||||
struct weapondef *weapon = gset_get_weapondef(bgun_get_weapon_num(HAND_RIGHT));
|
||||
f32 aimdamp = PAL ? weapon->aimsettings->aimdamppal : weapon->aimsettings->aimdamp;
|
||||
|
||||
bgun_swivel(screenx, screeny, PAL ? 0.935f : 0.945f, aimdamp);
|
||||
|
@ -5088,11 +5088,11 @@ void bgun_calculate_player_shot_spread(struct coord *gunpos2d, struct coord *gun
|
|||
f32 spread = 0;
|
||||
f32 scaledspread;
|
||||
f32 randfactor;
|
||||
struct weaponfunc *func = gset_get_current_funcdef(handnum);
|
||||
struct funcdef *func = gset_get_current_funcdef(handnum);
|
||||
struct player *player = g_Vars.currentplayer;
|
||||
|
||||
if (func != NULL && (func->type & 0xff) == INVENTORYFUNCTYPE_SHOOT) {
|
||||
struct weaponfunc_shoot *shootfunc = (struct weaponfunc_shoot *) func;
|
||||
struct funcdef_shoot *shootfunc = (struct funcdef_shoot *) func;
|
||||
spread = shootfunc->spread;
|
||||
}
|
||||
|
||||
|
@ -5142,7 +5142,7 @@ void bgun_calculate_bot_shot_spread(struct coord *arg0, s32 weaponnum, s32 funcn
|
|||
{
|
||||
f32 spread = 0.0f;
|
||||
f32 radius;
|
||||
struct weapon *weapondef = gset_get_weapondef(weaponnum);
|
||||
struct weapondef *weapondef = gset_get_weapondef(weaponnum);
|
||||
f32 x;
|
||||
f32 y;
|
||||
Mtxf mtx;
|
||||
|
@ -5150,10 +5150,10 @@ void bgun_calculate_bot_shot_spread(struct coord *arg0, s32 weaponnum, s32 funcn
|
|||
u32 stack;
|
||||
|
||||
if (weapondef) {
|
||||
struct weaponfunc *funcdef = weapondef->functions[funcnum];
|
||||
struct funcdef *funcdef = weapondef->functions[funcnum];
|
||||
|
||||
if (funcdef && (funcdef->type & 0xff) == INVENTORYFUNCTYPE_SHOOT) {
|
||||
struct weaponfunc_shoot *shootfunc = (struct weaponfunc_shoot *)funcdef;
|
||||
struct funcdef_shoot *shootfunc = (struct funcdef_shoot *)funcdef;
|
||||
spread = shootfunc->spread;
|
||||
}
|
||||
}
|
||||
|
@ -5558,7 +5558,7 @@ bool bgun_has_ammo_for_weapon(s32 weaponnum)
|
|||
{
|
||||
bool ammodefexists = false;
|
||||
bool hasammo = false;
|
||||
struct weapon *weapon = gset_get_weapondef(weaponnum);
|
||||
struct weapondef *weapon = gset_get_weapondef(weaponnum);
|
||||
s32 i;
|
||||
|
||||
if (weapon == NULL) {
|
||||
|
@ -5566,10 +5566,10 @@ bool bgun_has_ammo_for_weapon(s32 weaponnum)
|
|||
}
|
||||
|
||||
for (i = 0; i < 2; i++) {
|
||||
struct weaponfunc *func = gset_get_funcdef_by_weaponnum_funcnum(weaponnum, i);
|
||||
struct funcdef *func = gset_get_funcdef_by_weaponnum_funcnum(weaponnum, i);
|
||||
|
||||
if (func && func->ammoindex >= 0) {
|
||||
struct inventory_ammo *ammo = weapon->ammos[func->ammoindex];
|
||||
struct ammodef *ammo = weapon->ammos[func->ammoindex];
|
||||
|
||||
if (ammo) {
|
||||
ammodefexists = true;
|
||||
|
@ -5668,8 +5668,8 @@ u8 g_AutoSwitchWeaponsSecondary[] = {
|
|||
void bgun_auto_switch_weapon(void)
|
||||
{
|
||||
s32 i;
|
||||
struct weapon *weapon;
|
||||
struct weaponfunc *func;
|
||||
struct weapondef *weapon;
|
||||
struct funcdef *func;
|
||||
s32 weaponnum;
|
||||
s32 newweaponnum = -1;
|
||||
s32 firstweaponnum = -1;
|
||||
|
@ -5813,7 +5813,7 @@ s32 bgun_get_attack_type(s32 handnum)
|
|||
|
||||
char *bgun_get_name(s32 weaponnum)
|
||||
{
|
||||
struct weapon *weapon = g_Weapons[weaponnum];
|
||||
struct weapondef *weapon = g_Weapons[weaponnum];
|
||||
|
||||
if (weapon) {
|
||||
return lang_get(weapon->name);
|
||||
|
@ -5824,7 +5824,7 @@ char *bgun_get_name(s32 weaponnum)
|
|||
|
||||
u16 bgun_get_name_id(s32 weaponnum)
|
||||
{
|
||||
struct weapon *weapon = g_Weapons[weaponnum];
|
||||
struct weapondef *weapon = g_Weapons[weaponnum];
|
||||
|
||||
if (weapon) {
|
||||
return weapon->name;
|
||||
|
@ -5835,7 +5835,7 @@ u16 bgun_get_name_id(s32 weaponnum)
|
|||
|
||||
char *bgun_get_short_name(s32 weaponnum)
|
||||
{
|
||||
struct weapon *weapon = g_Weapons[weaponnum];
|
||||
struct weapondef *weapon = g_Weapons[weaponnum];
|
||||
|
||||
if (weapon) {
|
||||
return lang_get(weapon->shortname);
|
||||
|
@ -5878,11 +5878,11 @@ void bgun_start_slide(s32 handnum)
|
|||
void bgun_update_slide(s32 handnum)
|
||||
{
|
||||
f32 slidemax = 0.0f;
|
||||
struct weaponfunc *funcdef = gset_get_current_funcdef(handnum);
|
||||
struct funcdef *funcdef = gset_get_current_funcdef(handnum);
|
||||
struct player *player = g_Vars.currentplayer;
|
||||
|
||||
if (funcdef && ((funcdef->type & 0xff) == INVENTORYFUNCTYPE_SHOOT)) {
|
||||
struct weaponfunc_shoot *shootfunc = (struct weaponfunc_shoot *)funcdef;
|
||||
struct funcdef_shoot *shootfunc = (struct funcdef_shoot *)funcdef;
|
||||
slidemax = shootfunc->slidemax;
|
||||
}
|
||||
|
||||
|
@ -6000,7 +6000,7 @@ void bgun0f0a256c(s32 mtxindex, Mtxf *mtx)
|
|||
bool bgun_allows_fullscreen_autoaim(void)
|
||||
{
|
||||
struct hand *hand;
|
||||
struct weaponfunc *func;
|
||||
struct funcdef *func;
|
||||
|
||||
// Right hand
|
||||
hand = &g_Vars.currentplayer->hands[HAND_RIGHT];
|
||||
|
@ -6045,7 +6045,7 @@ bool bgun_allows_fullscreen_autoaim(void)
|
|||
bool bgun_allows_fullscreen_autoaim2(void)
|
||||
{
|
||||
struct hand *hand;
|
||||
struct weaponfunc *func;
|
||||
struct funcdef *func;
|
||||
|
||||
hand = &g_Vars.currentplayer->hands[HAND_RIGHT];
|
||||
func = gset_get_funcdef_by_gset2(&hand->gset);
|
||||
|
@ -6160,7 +6160,7 @@ void bgun_disarm(struct prop *attackerprop)
|
|||
// Or drop it at player's feet with the pin pulled maybe...
|
||||
if (weaponnum == WEAPON_GRENADE || weaponnum == WEAPON_NBOMB) {
|
||||
for (i = 0; i < 2; i++) {
|
||||
struct weaponfunc *func = gset_get_funcdef_by_gset(&player->hands[i].gset);
|
||||
struct funcdef *func = gset_get_funcdef_by_gset(&player->hands[i].gset);
|
||||
|
||||
if ((func->type & 0xff) == INVENTORYFUNCTYPE_THROW
|
||||
&& player->hands[i].state == HANDSTATE_ATTACK
|
||||
|
@ -6417,7 +6417,7 @@ void bgun_start_detonate_animation(s32 playernum)
|
|||
* rotation (reloading and equip/unequip do not). It also implements a delay on
|
||||
* reverting to the normal rotation.
|
||||
*/
|
||||
void bgun_update_gangsta(struct hand *hand, s32 handnum, struct coord *arg2, struct weaponfunc *funcdef, Mtxf *arg4, Mtxf *arg5)
|
||||
void bgun_update_gangsta(struct hand *hand, s32 handnum, struct coord *arg2, struct funcdef *funcdef, Mtxf *arg4, Mtxf *arg5)
|
||||
{
|
||||
f32 tmp;
|
||||
struct coord sp38 = {0, 0, 0};
|
||||
|
@ -6513,7 +6513,7 @@ void bgun_update_gangsta(struct hand *hand, s32 handnum, struct coord *arg2, str
|
|||
* forcecreatesmoke controls whether smoke should be created while the gun is
|
||||
* still firing.
|
||||
*/
|
||||
void bgun_update_smoke(struct hand *hand, s32 handnum, s32 weaponnum, struct weaponfunc *funcdef)
|
||||
void bgun_update_smoke(struct hand *hand, s32 handnum, s32 weaponnum, struct funcdef *funcdef)
|
||||
{
|
||||
if (hand->firing) {
|
||||
if (weaponnum == WEAPON_DY357MAGNUM || weaponnum == WEAPON_DY357LX) {
|
||||
|
@ -6991,7 +6991,7 @@ void bgun_eject_magnum_casings(struct hand *hand, s32 handnum, struct modeldef *
|
|||
/**
|
||||
* Create and/or update the rocket prop that sits inside the rocket launcher.
|
||||
*/
|
||||
void bgun_update_rocket_launcher(struct hand *hand, s32 handnum, struct weaponfunc_shootprojectile *func)
|
||||
void bgun_update_rocket_launcher(struct hand *hand, s32 handnum, struct funcdef_shootprojectile *func)
|
||||
{
|
||||
if (hand->rocket == NULL && hand->loadedammo[0] > 0) {
|
||||
bgun_create_held_rocket(handnum, func);
|
||||
|
@ -7136,8 +7136,8 @@ void bgun_tick_eject(struct hand *hand, struct modeldef *modeldef, bool isdetona
|
|||
}
|
||||
}
|
||||
|
||||
void bgun0f0a4e44(struct hand *hand, struct weapon *weapondef, struct modeldef *modeldef,
|
||||
struct weaponfunc *funcdef, s32 maxburst, u8 *allocation, s32 weaponnum,
|
||||
void bgun0f0a4e44(struct hand *hand, struct weapondef *weapondef, struct modeldef *modeldef,
|
||||
struct funcdef *funcdef, s32 maxburst, u8 *allocation, s32 weaponnum,
|
||||
bool **arg7, s32 mtxindex, Mtxf *arg9, Mtxf *arg10)
|
||||
{
|
||||
Mtxf spd8;
|
||||
|
@ -7228,7 +7228,7 @@ void bgun0f0a4e44(struct hand *hand, struct weapon *weapondef, struct modeldef *
|
|||
* Create casing and beam for a fired weapon,
|
||||
* and uncloak if the weapon is a throwable or fired projectile.
|
||||
*/
|
||||
void bgun_create_fx(struct hand *hand, s32 handnum, struct weaponfunc *funcdef, s32 weaponnum, struct modeldef *modeldef, u8 *allocation)
|
||||
void bgun_create_fx(struct hand *hand, s32 handnum, struct funcdef *funcdef, s32 weaponnum, struct modeldef *modeldef, u8 *allocation)
|
||||
{
|
||||
f32 ground;
|
||||
bool createbeam = true;
|
||||
|
@ -7345,11 +7345,11 @@ void bgun0f0a5550(s32 handnum)
|
|||
struct modelnode *node;
|
||||
struct player *player = g_Vars.currentplayer;
|
||||
struct hand *hand = player->hands + handnum;
|
||||
struct weaponfunc *funcdef;
|
||||
struct weaponfunc_shoot *shootfunc = NULL;
|
||||
struct funcdef *funcdef;
|
||||
struct funcdef_shoot *shootfunc = NULL;
|
||||
s32 i;
|
||||
s32 weaponnum = bgun_get_weapon_num2(handnum);
|
||||
struct weapon *weapondef;
|
||||
struct weapondef *weapondef;
|
||||
Mtxf *mtx;
|
||||
bool isdetonator = false;
|
||||
f32 fspare1;
|
||||
|
@ -7369,7 +7369,7 @@ void bgun0f0a5550(s32 handnum)
|
|||
funcdef = gset_get_funcdef_by_gset2(&hand->gset);
|
||||
|
||||
if (funcdef && (funcdef->type & 0xff) == INVENTORYFUNCTYPE_SHOOT) {
|
||||
shootfunc = (struct weaponfunc_shoot *)funcdef;
|
||||
shootfunc = (struct funcdef_shoot *)funcdef;
|
||||
}
|
||||
|
||||
bgun_update_blend(hand, handnum);
|
||||
|
@ -7845,7 +7845,7 @@ void bgun0f0a5550(s32 handnum)
|
|||
|
||||
switch (weaponnum) {
|
||||
case WEAPON_ROCKETLAUNCHER:
|
||||
bgun_update_rocket_launcher(hand, handnum, (struct weaponfunc_shootprojectile *)funcdef);
|
||||
bgun_update_rocket_launcher(hand, handnum, (struct funcdef_shootprojectile *)funcdef);
|
||||
break;
|
||||
case WEAPON_DY357MAGNUM:
|
||||
case WEAPON_DY357LX:
|
||||
|
@ -9099,7 +9099,7 @@ void bgun_tick_gameplay(bool triggeron)
|
|||
|
||||
// Remove throwable items from inventory if there's no more left
|
||||
for (i = 0; i < inv_get_count(); i++) {
|
||||
struct weapon *weapon;
|
||||
struct weapondef *weapon;
|
||||
s32 weaponnum = inv_get_weapon_num_by_index(i);
|
||||
s32 equippedweaponnum;
|
||||
|
||||
|
@ -9192,7 +9192,7 @@ void bgun_tick_gameplay(bool triggeron)
|
|||
|
||||
if (cheat_is_active(CHEAT_UNLIMITEDAMMONORELOADS)) {
|
||||
s32 i;
|
||||
struct weapon *weapon;
|
||||
struct weapondef *weapon;
|
||||
struct hand *lhand = &g_Vars.currentplayer->hands[HAND_LEFT];
|
||||
struct hand *rhand = &g_Vars.currentplayer->hands[HAND_RIGHT];
|
||||
|
||||
|
@ -9483,7 +9483,7 @@ void bgun_give_max_ammo(bool force)
|
|||
|
||||
u32 bgun_get_ammo_type_for_weapon(u32 weaponnum, u32 func)
|
||||
{
|
||||
struct weapon *weapon = gset_get_weapondef(weaponnum);
|
||||
struct weapondef *weapon = gset_get_weapondef(weaponnum);
|
||||
|
||||
if (!weapon) {
|
||||
return 0;
|
||||
|
@ -9498,10 +9498,10 @@ u32 bgun_get_ammo_type_for_weapon(u32 weaponnum, u32 func)
|
|||
|
||||
s32 bgun_get_ammo_qty_for_weapon(u32 weaponnum, u32 func)
|
||||
{
|
||||
struct weapon *weapon = gset_get_weapondef(weaponnum);
|
||||
struct weapondef *weapon = gset_get_weapondef(weaponnum);
|
||||
|
||||
if (weapon) {
|
||||
struct inventory_ammo *ammo = weapon->ammos[func];
|
||||
struct ammodef *ammo = weapon->ammos[func];
|
||||
|
||||
if (ammo) {
|
||||
return bgun_get_reserved_ammo_count(ammo->type);
|
||||
|
@ -9513,10 +9513,10 @@ s32 bgun_get_ammo_qty_for_weapon(u32 weaponnum, u32 func)
|
|||
|
||||
void bgun_set_ammo_qty_for_weapon(u32 weaponnum, u32 func, u32 quantity)
|
||||
{
|
||||
struct weapon *weapon = gset_get_weapondef(weaponnum);
|
||||
struct weapondef *weapon = gset_get_weapondef(weaponnum);
|
||||
|
||||
if (weapon) {
|
||||
struct inventory_ammo *ammo = weapon->ammos[func];
|
||||
struct ammodef *ammo = weapon->ammos[func];
|
||||
|
||||
if (ammo) {
|
||||
bgun_set_ammo_quantity(ammo->type, quantity);
|
||||
|
@ -9526,8 +9526,8 @@ void bgun_set_ammo_qty_for_weapon(u32 weaponnum, u32 func, u32 quantity)
|
|||
|
||||
s32 bgun_get_ammo_capacity_for_weapon(s32 weaponnum, s32 func)
|
||||
{
|
||||
struct weapon *weapon = gset_get_weapondef(weaponnum);
|
||||
struct inventory_ammo *ammo = weapon->ammos[func];
|
||||
struct weapondef *weapon = gset_get_weapondef(weaponnum);
|
||||
struct ammodef *ammo = weapon->ammos[func];
|
||||
|
||||
if (ammo) {
|
||||
return g_AmmoTypes[ammo->type].capacity;
|
||||
|
@ -9938,7 +9938,7 @@ Gfx *bgun_draw_hud(Gfx *gdl)
|
|||
s32 reserveheight = 36;
|
||||
s32 clipheight = 57;
|
||||
s32 xpos;
|
||||
struct weapon *weapon = gset_get_weapondef(player->gunctrl.weaponnum);
|
||||
struct weapondef *weapon = gset_get_weapondef(player->gunctrl.weaponnum);
|
||||
u32 alpha;
|
||||
u32 fncolour;
|
||||
s32 funcnum;
|
||||
|
@ -9954,7 +9954,7 @@ Gfx *bgun_draw_hud(Gfx *gdl)
|
|||
s32 y;
|
||||
s32 textheight;
|
||||
s32 textwidth;
|
||||
struct weaponfunc *func;
|
||||
struct funcdef *func;
|
||||
u16 nameid;
|
||||
struct hand *lefthand = &player->hands[HAND_LEFT];
|
||||
|
||||
|
@ -10191,12 +10191,12 @@ Gfx *bgun_draw_hud(Gfx *gdl)
|
|||
}
|
||||
|
||||
if (weapon && weapon->functions[hand->gset.weaponfunc] != NULL) {
|
||||
ammoindex = ((struct weaponfunc *)(weapon->functions[hand->gset.weaponfunc]))->ammoindex;
|
||||
ammoindex = ((struct funcdef *)(weapon->functions[hand->gset.weaponfunc]))->ammoindex;
|
||||
}
|
||||
|
||||
if (ammoindex == -1) {
|
||||
if (weapon->functions[1 - hand->gset.weaponfunc] != NULL) {
|
||||
ammoindex = ((struct weaponfunc *)(weapon->functions[1 - hand->gset.weaponfunc]))->ammoindex;
|
||||
ammoindex = ((struct funcdef *)(weapon->functions[1 - hand->gset.weaponfunc]))->ammoindex;
|
||||
}
|
||||
|
||||
if (ammoindex == -1) {
|
||||
|
@ -10419,7 +10419,7 @@ void bgun0f0abd30(s32 handnum)
|
|||
struct player *player = g_Vars.currentplayer;
|
||||
struct hand *hand = &player->hands[handnum];
|
||||
struct gunctrl *gunctrl = &player->gunctrl;
|
||||
struct weapon *weapon = gset_get_weapondef(hand->gset.weaponnum);
|
||||
struct weapondef *weapon = gset_get_weapondef(hand->gset.weaponnum);
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < 2; i++) {
|
||||
|
|
|
@ -74,7 +74,7 @@ bool bmove_is_autoaim_y_enabled(void)
|
|||
|
||||
bool bmove_is_autoaim_y_enabled_for_current_weapon(void)
|
||||
{
|
||||
struct weaponfunc *func = gset_get_current_funcdef(0);
|
||||
struct funcdef *func = gset_get_current_funcdef(0);
|
||||
|
||||
if (func) {
|
||||
if (func->flags & FUNCFLAG_NOAUTOAIM) {
|
||||
|
@ -132,7 +132,7 @@ bool bmove_is_autoaim_x_enabled(void)
|
|||
|
||||
bool bmove_is_autoaim_x_enabled_for_current_weapon(void)
|
||||
{
|
||||
struct weaponfunc *func = gset_get_current_funcdef(0);
|
||||
struct funcdef *func = gset_get_current_funcdef(0);
|
||||
|
||||
if (func) {
|
||||
if (func->flags & FUNCFLAG_NOAUTOAIM) {
|
||||
|
|
|
@ -422,7 +422,7 @@ u32 bot_pickup_prop(struct prop *prop, struct chrdata *chr)
|
|||
}
|
||||
|
||||
if (itemtype) {
|
||||
struct weapon *weapondef = gset_get_weapondef(weapon->weaponnum);
|
||||
struct weapondef *weapondef = gset_get_weapondef(weapon->weaponnum);
|
||||
s32 originalpad = botinv_get_weapon_pad(chr, weapon->weaponnum);
|
||||
s32 currentpad = obj->pad;
|
||||
|
||||
|
@ -472,7 +472,7 @@ bool bot_test_prop_for_pickup(struct prop *prop, struct chrdata *chr)
|
|||
|
||||
struct weaponobj *weaponobj;
|
||||
s32 itemtype;
|
||||
struct weapon *weapon;
|
||||
struct weapondef *weapon;
|
||||
bool singleonly;
|
||||
s32 i;
|
||||
|
||||
|
@ -3530,7 +3530,7 @@ void bot_tick_unpaused(struct chrdata *chr)
|
|||
}
|
||||
|
||||
if (throw) {
|
||||
struct weaponfunc *func;
|
||||
struct funcdef *func;
|
||||
|
||||
chr_uncloak_temporarily(chr);
|
||||
botact_try_remove_ammo_from_reserve(aibot, aibot->weaponnum, aibot->gunfunc, 1);
|
||||
|
@ -3617,7 +3617,7 @@ void bot_tick_unpaused(struct chrdata *chr)
|
|||
}
|
||||
|
||||
if (weapon_get_num_ticks_per_shot(aibot->weaponnum, aibot->gunfunc) <= 0 && firing) {
|
||||
struct weaponfunc *func;
|
||||
struct funcdef *func;
|
||||
aibot->nextbullettimer60[i] = botact_get_shoot_interval60(aibot->weaponnum, aibot->gunfunc);
|
||||
|
||||
#if PAL
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
s32 botact_get_ammo_type_by_function(s32 weaponnum, s32 funcnum)
|
||||
{
|
||||
if (weaponnum >= WEAPON_FALCON2 && weaponnum <= WEAPON_SUICIDEPILL) {
|
||||
struct inventory_ammo *ammo = gset_get_ammodef(weaponnum, funcnum);
|
||||
struct ammodef *ammo = gset_get_ammodef(weaponnum, funcnum);
|
||||
|
||||
if (ammo) {
|
||||
return ammo->type;
|
||||
|
@ -35,7 +35,7 @@ s32 botact_get_ammo_type_by_function(s32 weaponnum, s32 funcnum)
|
|||
s32 botact_get_clip_capacity_by_function(s32 weaponnum, u32 funcnum)
|
||||
{
|
||||
if (weaponnum >= WEAPON_FALCON2 && weaponnum <= WEAPON_SUICIDEPILL) {
|
||||
struct inventory_ammo *ammo = gset_get_ammodef(weaponnum, funcnum);
|
||||
struct ammodef *ammo = gset_get_ammodef(weaponnum, funcnum);
|
||||
|
||||
if (ammo) {
|
||||
return ammo->clipsize;
|
||||
|
@ -407,20 +407,20 @@ s32 botact_get_shoot_interval60(s32 weaponnum, s32 funcnum)
|
|||
{
|
||||
s32 stack[2];
|
||||
s32 result = 1;
|
||||
struct weapon *weapon = gset_get_weapondef(weaponnum);
|
||||
struct weapondef *weapon = gset_get_weapondef(weaponnum);
|
||||
|
||||
if (weapon) {
|
||||
struct weaponfunc *func = weapon->functions[funcnum];
|
||||
struct funcdef *func = weapon->functions[funcnum];
|
||||
|
||||
if (func) {
|
||||
if (func->type == INVENTORYFUNCTYPE_SHOOT_SINGLE) {
|
||||
struct weaponfunc_shoot *func2 = (struct weaponfunc_shoot *)func;
|
||||
struct funcdef_shoot *func2 = (struct funcdef_shoot *)func;
|
||||
result = func2->unk24 + func2->unk25;
|
||||
} else if (func->type == INVENTORYFUNCTYPE_SHOOT_AUTOMATIC) {
|
||||
struct weaponfunc_shoot *func2 = (struct weaponfunc_shoot *)func;
|
||||
struct funcdef_shoot *func2 = (struct funcdef_shoot *)func;
|
||||
result = func2->unk24 + func2->unk25;
|
||||
} else if (func->type == INVENTORYFUNCTYPE_SHOOT_PROJECTILE) {
|
||||
struct weaponfunc_shoot *func2 = (struct weaponfunc_shoot *)func;
|
||||
struct funcdef_shoot *func2 = (struct funcdef_shoot *)func;
|
||||
result = func2->unk24 + func2->unk25;
|
||||
} else if (func->type == INVENTORYFUNCTYPE_MELEE && weaponnum != WEAPON_REAPER) {
|
||||
result = 60;
|
||||
|
|
|
@ -1019,7 +1019,7 @@ void botinv_tick(struct chrdata *chr)
|
|||
bool botinv_switch_to_weapon(struct chrdata *chr, s32 weaponnum, s32 funcnum)
|
||||
{
|
||||
struct invitem *item;
|
||||
struct weaponfunc *func;
|
||||
struct funcdef *func;
|
||||
struct aibot *aibot;
|
||||
s32 i;
|
||||
s32 modelnum;
|
||||
|
|
|
@ -4606,7 +4606,7 @@ void chr_hit(struct shotdata *shotdata, struct hit *hit)
|
|||
struct coord sp98;
|
||||
s16 hitpos_s16[3];
|
||||
u8 ismelee = false;
|
||||
struct weaponfunc *func = gset_get_funcdef_by_gset(&shotdata->gset);
|
||||
struct funcdef *func = gset_get_funcdef_by_gset(&shotdata->gset);
|
||||
f32 shield;
|
||||
|
||||
if (func && (func->type & 0xff) == INVENTORYFUNCTYPE_MELEE) {
|
||||
|
|
|
@ -4270,7 +4270,7 @@ void chr_damage(struct chrdata *chr, f32 damage, struct coord *vector, struct gs
|
|||
f32 armourscale = 1;
|
||||
bool isshoot = true;
|
||||
bool forceapplydamage = false;
|
||||
struct weaponfunc *func;
|
||||
struct funcdef *func;
|
||||
f32 amount;
|
||||
bool canchoke = true;
|
||||
s32 aplayernum = -1;
|
||||
|
@ -6974,7 +6974,7 @@ bool chr_try_attack_amount(struct chrdata *chr, u32 arg1, u32 arg2, u8 lower, u8
|
|||
s32 quantity;
|
||||
f32 percentage;
|
||||
struct weaponobj *weapon = chr->weapons_held[0]->weapon;
|
||||
struct inventory_ammo *ammo;
|
||||
struct ammodef *ammo;
|
||||
|
||||
quantity = 1;
|
||||
|
||||
|
@ -10094,8 +10094,8 @@ void chr_tick_shoot(struct chrdata *chr, s32 handnum)
|
|||
struct coord sp15c;
|
||||
Mtxf projectilemtx;
|
||||
Mtxf yrotmtx;
|
||||
struct weapon *weapondef = gset_get_weapondef(gset.weaponnum);
|
||||
struct weaponfunc_shootprojectile *func = weapondef->functions[gset.weaponfunc];
|
||||
struct weapondef *weapondef = gset_get_weapondef(gset.weaponnum);
|
||||
struct funcdef_shootprojectile *func = weapondef->functions[gset.weaponfunc];
|
||||
|
||||
// Handle creating the projectile
|
||||
if (gset.weaponnum == WEAPON_ROCKETLAUNCHER
|
||||
|
|
114
src/game/gset.c
114
src/game/gset.c
|
@ -16,7 +16,7 @@
|
|||
#include "data.h"
|
||||
#include "types.h"
|
||||
|
||||
struct weapon *gset_get_weapondef(s32 itemid)
|
||||
struct weapondef *gset_get_weapondef(s32 itemid)
|
||||
{
|
||||
if (itemid < 0) {
|
||||
return NULL;
|
||||
|
@ -29,9 +29,9 @@ struct weapon *gset_get_weapondef(s32 itemid)
|
|||
return g_Weapons[itemid];
|
||||
}
|
||||
|
||||
struct weaponfunc *gset_get_funcdef_by_weaponnum_funcnum(u32 weaponnum, u32 which)
|
||||
struct funcdef *gset_get_funcdef_by_weaponnum_funcnum(u32 weaponnum, u32 which)
|
||||
{
|
||||
struct weapon *weapon = gset_get_weapondef(weaponnum);
|
||||
struct weapondef *weapon = gset_get_weapondef(weaponnum);
|
||||
|
||||
if (weapon) {
|
||||
return weapon->functions[which];
|
||||
|
@ -40,9 +40,9 @@ struct weaponfunc *gset_get_funcdef_by_weaponnum_funcnum(u32 weaponnum, u32 whic
|
|||
return NULL;
|
||||
}
|
||||
|
||||
struct weaponfunc *gset_get_funcdef_by_gset2(struct gset *gset)
|
||||
struct funcdef *gset_get_funcdef_by_gset2(struct gset *gset)
|
||||
{
|
||||
struct weapon *weapon = gset_get_weapondef(gset->weaponnum);
|
||||
struct weapondef *weapon = gset_get_weapondef(gset->weaponnum);
|
||||
|
||||
if (weapon) {
|
||||
return weapon->functions[gset->weaponfunc];
|
||||
|
@ -51,9 +51,9 @@ struct weaponfunc *gset_get_funcdef_by_gset2(struct gset *gset)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
struct weaponfunc *gset_get_funcdef_by_gset(struct gset *gset)
|
||||
struct funcdef *gset_get_funcdef_by_gset(struct gset *gset)
|
||||
{
|
||||
struct weapon *weapon = g_Weapons[gset->weaponnum];
|
||||
struct weapondef *weapon = g_Weapons[gset->weaponnum];
|
||||
|
||||
if (weapon) {
|
||||
return weapon->functions[gset->weaponfunc];
|
||||
|
@ -62,9 +62,9 @@ struct weaponfunc *gset_get_funcdef_by_gset(struct gset *gset)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
struct weaponfunc *gset_get_funcdef_by_gset_funcnum(struct gset *gset, s32 which)
|
||||
struct funcdef *gset_get_funcdef_by_gset_funcnum(struct gset *gset, s32 which)
|
||||
{
|
||||
struct weapon *weapon = g_Weapons[gset->weaponnum];
|
||||
struct weapondef *weapon = g_Weapons[gset->weaponnum];
|
||||
|
||||
if (weapon) {
|
||||
return weapon->functions[which];
|
||||
|
@ -73,9 +73,9 @@ struct weaponfunc *gset_get_funcdef_by_gset_funcnum(struct gset *gset, s32 which
|
|||
return NULL;
|
||||
}
|
||||
|
||||
struct weaponfunc *gset_get_current_funcdef(u32 hand)
|
||||
struct funcdef *gset_get_current_funcdef(u32 hand)
|
||||
{
|
||||
struct weapon *weapon = gset_get_weapondef(g_Vars.currentplayer->hands[hand].gset.weaponnum);
|
||||
struct weapondef *weapon = gset_get_weapondef(g_Vars.currentplayer->hands[hand].gset.weaponnum);
|
||||
|
||||
if (weapon) {
|
||||
return weapon->functions[g_Vars.currentplayer->hands[hand].gset.weaponfunc];
|
||||
|
@ -86,7 +86,7 @@ struct weaponfunc *gset_get_current_funcdef(u32 hand)
|
|||
|
||||
u32 gset_get_num_functions(u32 weaponnum)
|
||||
{
|
||||
struct weapon *weapon = gset_get_weapondef(weaponnum);
|
||||
struct weapondef *weapon = gset_get_weapondef(weaponnum);
|
||||
s32 i;
|
||||
|
||||
if (!weapon) {
|
||||
|
@ -104,7 +104,7 @@ u32 gset_get_num_functions(u32 weaponnum)
|
|||
|
||||
struct invaimsettings *gset_get_aim_settings(struct gset *gset)
|
||||
{
|
||||
struct weapon *weapon = gset_get_weapondef(gset->weaponnum);
|
||||
struct weapondef *weapon = gset_get_weapondef(gset->weaponnum);
|
||||
|
||||
if (weapon) {
|
||||
return weapon->aimsettings;
|
||||
|
@ -113,10 +113,10 @@ struct invaimsettings *gset_get_aim_settings(struct gset *gset)
|
|||
return &invaimsettings_default;
|
||||
}
|
||||
|
||||
struct inventory_ammo *gset_get_ammodef(u32 weaponnum, u32 funcnum)
|
||||
struct ammodef *gset_get_ammodef(u32 weaponnum, u32 funcnum)
|
||||
{
|
||||
struct weapon *weapon = gset_get_weapondef(weaponnum);
|
||||
struct weaponfunc *func = gset_get_funcdef_by_weaponnum_funcnum(weaponnum, funcnum);
|
||||
struct weapondef *weapon = gset_get_weapondef(weaponnum);
|
||||
struct funcdef *func = gset_get_funcdef_by_weaponnum_funcnum(weaponnum, funcnum);
|
||||
|
||||
if (func && weapon && func->ammoindex >= 0) {
|
||||
return weapon->ammos[func->ammoindex];
|
||||
|
@ -127,7 +127,7 @@ struct inventory_ammo *gset_get_ammodef(u32 weaponnum, u32 funcnum)
|
|||
|
||||
void gset_get_weapon_pos(struct coord *pos)
|
||||
{
|
||||
struct weapon *weapon = gset_get_weapondef(bgun_get_weapon_num(HAND_RIGHT));
|
||||
struct weapondef *weapon = gset_get_weapondef(bgun_get_weapon_num(HAND_RIGHT));
|
||||
|
||||
if (weapon) {
|
||||
pos->x = weapon->posx;
|
||||
|
@ -138,7 +138,7 @@ void gset_get_weapon_pos(struct coord *pos)
|
|||
|
||||
void gset_set_weapon_pos(struct coord *pos)
|
||||
{
|
||||
struct weapon *weapon = gset_get_weapondef(bgun_get_weapon_num(HAND_RIGHT));
|
||||
struct weapondef *weapon = gset_get_weapondef(bgun_get_weapon_num(HAND_RIGHT));
|
||||
|
||||
if (weapon) {
|
||||
weapon->posx = pos->x;
|
||||
|
@ -155,7 +155,7 @@ f32 gset_get_xshift(s32 handnum)
|
|||
f32 gset_get_xpos(s32 hand)
|
||||
{
|
||||
f32 x;
|
||||
struct weapon *weapon;
|
||||
struct weapondef *weapon;
|
||||
|
||||
if (hand == 0) {
|
||||
weapon = gset_get_weapondef(bgun_get_weapon_num2(0));
|
||||
|
@ -187,7 +187,7 @@ f32 gset_get_xpos(s32 hand)
|
|||
f32 gset_get_gun_zoom_fov(void)
|
||||
{
|
||||
s32 index = -1;
|
||||
struct weapon *weapon;
|
||||
struct weapondef *weapon;
|
||||
|
||||
switch (bgun_get_weapon_num2(0)) {
|
||||
case WEAPON_SNIPERRIFLE:
|
||||
|
@ -279,7 +279,7 @@ void gset_zoom_in(f32 fovpersec)
|
|||
|
||||
bool gset_has_weapon_flag(s32 itemid, u32 flag)
|
||||
{
|
||||
struct weapon *weapon = gset_get_weapondef(itemid);
|
||||
struct weapondef *weapon = gset_get_weapondef(itemid);
|
||||
|
||||
if (!weapon) {
|
||||
return false;
|
||||
|
@ -290,7 +290,7 @@ bool gset_has_weapon_flag(s32 itemid, u32 flag)
|
|||
|
||||
bool gset_has_aim_flag(s32 weaponnum, u32 flag)
|
||||
{
|
||||
struct weapon *weapon = gset_get_weapondef(weaponnum);
|
||||
struct weapondef *weapon = gset_get_weapondef(weaponnum);
|
||||
|
||||
if (!weapon) {
|
||||
return false;
|
||||
|
@ -301,8 +301,8 @@ bool gset_has_aim_flag(s32 weaponnum, u32 flag)
|
|||
|
||||
bool gset_has_ammo_flag(s32 weaponnum, s32 funcnum, u32 flag)
|
||||
{
|
||||
struct weapon *weapon = gset_get_weapondef(weaponnum);
|
||||
struct inventory_ammo *ammo;
|
||||
struct weapondef *weapon = gset_get_weapondef(weaponnum);
|
||||
struct ammodef *ammo;
|
||||
|
||||
if (weapon == NULL) {
|
||||
return false;
|
||||
|
@ -329,7 +329,7 @@ void gset_stub2(s32 arg0)
|
|||
|
||||
s32 gset_get_device_state(s32 weaponnum)
|
||||
{
|
||||
struct weapon *weapon = gset_get_weapondef(weaponnum);
|
||||
struct weapondef *weapon = gset_get_weapondef(weaponnum);
|
||||
s32 i;
|
||||
|
||||
if (!weapon) {
|
||||
|
@ -338,7 +338,7 @@ s32 gset_get_device_state(s32 weaponnum)
|
|||
|
||||
for (i = 0; i < ARRAYCOUNT(weapon->functions); i++) {
|
||||
if (weapon->functions[i]) {
|
||||
struct weaponfunc_device *devicefunc = weapon->functions[i];
|
||||
struct funcdef_device *devicefunc = weapon->functions[i];
|
||||
|
||||
if ((devicefunc->base.type & 0xff) == INVENTORYFUNCTYPE_DEVICE) {
|
||||
if ((g_Vars.currentplayer->devicesactive & devicefunc->device) == 0) {
|
||||
|
@ -355,7 +355,7 @@ s32 gset_get_device_state(s32 weaponnum)
|
|||
|
||||
void gset_set_device_active(s32 weaponnum, bool active)
|
||||
{
|
||||
struct weapon *weapon = gset_get_weapondef(weaponnum);
|
||||
struct weapondef *weapon = gset_get_weapondef(weaponnum);
|
||||
s32 i;
|
||||
|
||||
if (!weapon) {
|
||||
|
@ -364,7 +364,7 @@ void gset_set_device_active(s32 weaponnum, bool active)
|
|||
|
||||
for (i = 0; i < ARRAYCOUNT(weapon->functions); i++) {
|
||||
if (weapon->functions[i]) {
|
||||
struct weaponfunc_device *devicefunc = weapon->functions[i];
|
||||
struct funcdef_device *devicefunc = weapon->functions[i];
|
||||
|
||||
if ((devicefunc->base.type & 0xff) == INVENTORYFUNCTYPE_DEVICE) {
|
||||
if (active) {
|
||||
|
@ -385,7 +385,7 @@ void gset_set_device_active(s32 weaponnum, bool active)
|
|||
|
||||
u16 gset_get_filenum(s32 weaponnum)
|
||||
{
|
||||
struct weapon *weapon = NULL;
|
||||
struct weapondef *weapon = NULL;
|
||||
|
||||
if (weaponnum != -1) {
|
||||
weapon = g_Weapons[weaponnum];
|
||||
|
@ -423,10 +423,10 @@ void gset_populate(s32 handnum, struct gset *gset)
|
|||
}
|
||||
}
|
||||
|
||||
struct inventory_ammo *gset_get_current_ammodef(struct gset *gset)
|
||||
struct ammodef *gset_get_current_ammodef(struct gset *gset)
|
||||
{
|
||||
struct weaponfunc *func = gset_get_funcdef_by_gset(gset);
|
||||
struct weapon *weapon = gset_get_weapondef(gset->weaponnum);
|
||||
struct funcdef *func = gset_get_funcdef_by_gset(gset);
|
||||
struct weapondef *weapon = gset_get_weapondef(gset->weaponnum);
|
||||
|
||||
if (func && func->ammoindex >= 0) {
|
||||
return weapon->ammos[func->ammoindex];
|
||||
|
@ -437,10 +437,10 @@ struct inventory_ammo *gset_get_current_ammodef(struct gset *gset)
|
|||
|
||||
u8 gset_get_single_penetration(struct gset *gset)
|
||||
{
|
||||
struct weaponfunc *func = gset_get_funcdef_by_gset(gset);
|
||||
struct funcdef *func = gset_get_funcdef_by_gset(gset);
|
||||
|
||||
if (func && (func->type & 0xff) == INVENTORYFUNCTYPE_SHOOT) {
|
||||
struct weaponfunc_shoot *funcshoot = (struct weaponfunc_shoot *)func;
|
||||
struct funcdef_shoot *funcshoot = (struct funcdef_shoot *)func;
|
||||
return funcshoot->penetration;
|
||||
}
|
||||
|
||||
|
@ -450,7 +450,7 @@ u8 gset_get_single_penetration(struct gset *gset)
|
|||
s32 gset_get_casing_type(struct gset *gset)
|
||||
{
|
||||
s32 result = 0;
|
||||
struct inventory_ammo *ammo = gset_get_current_ammodef(gset);
|
||||
struct ammodef *ammo = gset_get_current_ammodef(gset);
|
||||
|
||||
if (ammo) {
|
||||
result = ammo->casingeject;
|
||||
|
@ -461,11 +461,11 @@ s32 gset_get_casing_type(struct gset *gset)
|
|||
|
||||
f32 gset_get_impact_force(struct gset *gset)
|
||||
{
|
||||
struct weaponfunc *func = gset_get_funcdef_by_gset(gset);
|
||||
struct funcdef *func = gset_get_funcdef_by_gset(gset);
|
||||
f32 result = 0;
|
||||
|
||||
if (func && (func->type & 0xff) == INVENTORYFUNCTYPE_SHOOT) {
|
||||
struct weaponfunc_shoot *funcshoot = (struct weaponfunc_shoot *)func;
|
||||
struct funcdef_shoot *funcshoot = (struct funcdef_shoot *)func;
|
||||
result = funcshoot->impactforce;
|
||||
}
|
||||
|
||||
|
@ -474,17 +474,17 @@ f32 gset_get_impact_force(struct gset *gset)
|
|||
|
||||
f32 gset_get_damage(struct gset *gset)
|
||||
{
|
||||
struct weaponfunc *func = gset_get_funcdef_by_gset(gset);
|
||||
struct funcdef *func = gset_get_funcdef_by_gset(gset);
|
||||
f32 damage = 0;
|
||||
|
||||
if (func) {
|
||||
if ((func->type & 0xff) == INVENTORYFUNCTYPE_SHOOT) {
|
||||
struct weaponfunc_shoot *shootfunc = (struct weaponfunc_shoot *)func;
|
||||
struct funcdef_shoot *shootfunc = (struct funcdef_shoot *)func;
|
||||
damage = shootfunc->damage;
|
||||
}
|
||||
|
||||
if ((func->type & 0xff) == INVENTORYFUNCTYPE_MELEE) {
|
||||
struct weaponfunc_melee *meleefunc = (struct weaponfunc_melee *)func;
|
||||
struct funcdef_melee *meleefunc = (struct funcdef_melee *)func;
|
||||
damage = meleefunc->damage;
|
||||
|
||||
if (gset->weaponnum == WEAPON_REAPER) {
|
||||
|
@ -493,7 +493,7 @@ f32 gset_get_damage(struct gset *gset)
|
|||
}
|
||||
|
||||
if ((func->type & 0xff) == INVENTORYFUNCTYPE_THROW) {
|
||||
struct weaponfunc_throw *throwfunc = (struct weaponfunc_throw *)func;
|
||||
struct funcdef_throw *throwfunc = (struct funcdef_throw *)func;
|
||||
damage = throwfunc->damage;
|
||||
}
|
||||
}
|
||||
|
@ -512,11 +512,11 @@ f32 gset_get_damage(struct gset *gset)
|
|||
u8 gset_get_fireslot_duration(struct gset *gset)
|
||||
{
|
||||
#if VERSION >= VERSION_PAL_FINAL
|
||||
struct weaponfunc *func = gset_get_funcdef_by_gset(gset);
|
||||
struct funcdef *func = gset_get_funcdef_by_gset(gset);
|
||||
u8 result = 0;
|
||||
|
||||
if (func && (func->type & 0xff) == INVENTORYFUNCTYPE_SHOOT) {
|
||||
struct weaponfunc_shoot *funcshoot = (struct weaponfunc_shoot *)func;
|
||||
struct funcdef_shoot *funcshoot = (struct funcdef_shoot *)func;
|
||||
result = funcshoot->duration60;
|
||||
}
|
||||
|
||||
|
@ -526,10 +526,10 @@ u8 gset_get_fireslot_duration(struct gset *gset)
|
|||
|
||||
return result;
|
||||
#else
|
||||
struct weaponfunc *func = gset_get_funcdef_by_gset(gset);
|
||||
struct funcdef *func = gset_get_funcdef_by_gset(gset);
|
||||
|
||||
if (func && (func->type & 0xff) == INVENTORYFUNCTYPE_SHOOT) {
|
||||
struct weaponfunc_shoot *funcshoot = (struct weaponfunc_shoot *)func;
|
||||
struct funcdef_shoot *funcshoot = (struct funcdef_shoot *)func;
|
||||
return funcshoot->duration60;
|
||||
}
|
||||
|
||||
|
@ -539,10 +539,10 @@ u8 gset_get_fireslot_duration(struct gset *gset)
|
|||
|
||||
u16 gset_get_single_shoot_sound(struct gset *gset)
|
||||
{
|
||||
struct weaponfunc *func = gset_get_funcdef_by_gset(gset);
|
||||
struct funcdef *func = gset_get_funcdef_by_gset(gset);
|
||||
|
||||
if (func && (func->type & 0xff) == INVENTORYFUNCTYPE_SHOOT) {
|
||||
struct weaponfunc_shoot *funcshoot = (struct weaponfunc_shoot *)func;
|
||||
struct funcdef_shoot *funcshoot = (struct funcdef_shoot *)func;
|
||||
return funcshoot->shootsound;
|
||||
}
|
||||
|
||||
|
@ -551,7 +551,7 @@ u16 gset_get_single_shoot_sound(struct gset *gset)
|
|||
|
||||
bool gset_has_function_flags(struct gset *gset, u32 flags)
|
||||
{
|
||||
struct weaponfunc *func = gset_get_funcdef_by_gset(gset);
|
||||
struct funcdef *func = gset_get_funcdef_by_gset(gset);
|
||||
|
||||
if (func) {
|
||||
return (func->flags & flags) == flags;
|
||||
|
@ -564,11 +564,11 @@ s8 weapon_get_num_ticks_per_shot(u32 weaponnum, u32 funcindex)
|
|||
{
|
||||
u32 stack[2];
|
||||
s32 result = 0;
|
||||
struct weapon *weapon = gset_get_weapondef(weaponnum);
|
||||
struct weaponfunc *func = weapon->functions[funcindex];
|
||||
struct weapondef *weapon = gset_get_weapondef(weaponnum);
|
||||
struct funcdef *func = weapon->functions[funcindex];
|
||||
|
||||
if (func && func->type == INVENTORYFUNCTYPE_SHOOT_AUTOMATIC) {
|
||||
struct weaponfunc_shootauto *autofunc = (struct weaponfunc_shootauto *)func;
|
||||
struct funcdef_shootauto *autofunc = (struct funcdef_shootauto *)func;
|
||||
|
||||
result = 3600.0f / autofunc->maxrpm;
|
||||
}
|
||||
|
@ -585,7 +585,7 @@ s8 weapon_get_num_ticks_per_shot(u32 weaponnum, u32 funcindex)
|
|||
|
||||
u32 gset_get_sight(void)
|
||||
{
|
||||
struct weaponfunc *func = gset_get_funcdef_by_weaponnum_funcnum(
|
||||
struct funcdef *func = gset_get_funcdef_by_weaponnum_funcnum(
|
||||
g_Vars.currentplayer->hands[HAND_RIGHT].gset.weaponnum,
|
||||
g_Vars.currentplayer->hands[HAND_RIGHT].gset.weaponfunc);
|
||||
|
||||
|
@ -657,7 +657,7 @@ u32 gset_get_sight(void)
|
|||
void gset_get_noise_settings(struct gset *gset, struct noisesettings *dst)
|
||||
{
|
||||
struct noisesettings *settings = NULL;
|
||||
struct weaponfunc *func = gset_get_funcdef_by_gset(gset);
|
||||
struct funcdef *func = gset_get_funcdef_by_gset(gset);
|
||||
|
||||
if (func != NULL) {
|
||||
settings = func->noisesettings;
|
||||
|
@ -676,7 +676,7 @@ void gset_get_noise_settings(struct gset *gset, struct noisesettings *dst)
|
|||
|
||||
struct guncmd *gset_get_equip_anim(struct gset *gset)
|
||||
{
|
||||
struct weapon *weapon = g_Weapons[gset->weaponnum];
|
||||
struct weapondef *weapon = g_Weapons[gset->weaponnum];
|
||||
|
||||
if (weapon) {
|
||||
return weapon->equip_animation;
|
||||
|
@ -687,7 +687,7 @@ struct guncmd *gset_get_equip_anim(struct gset *gset)
|
|||
|
||||
struct guncmd *gset_get_unequip_anim(struct gset *gset)
|
||||
{
|
||||
struct weapon *weapon = g_Weapons[gset->weaponnum];
|
||||
struct weapondef *weapon = g_Weapons[gset->weaponnum];
|
||||
|
||||
if (weapon) {
|
||||
return weapon->unequip_animation;
|
||||
|
@ -698,7 +698,7 @@ struct guncmd *gset_get_unequip_anim(struct gset *gset)
|
|||
|
||||
struct guncmd *gset_get_pritosec_anim(struct gset *gset)
|
||||
{
|
||||
struct weapon *weapon = g_Weapons[gset->weaponnum];
|
||||
struct weapondef *weapon = g_Weapons[gset->weaponnum];
|
||||
|
||||
if (weapon) {
|
||||
return weapon->pritosec_animation;
|
||||
|
@ -709,7 +709,7 @@ struct guncmd *gset_get_pritosec_anim(struct gset *gset)
|
|||
|
||||
struct guncmd *gset_get_sectopri_anim(struct gset *gset)
|
||||
{
|
||||
struct weapon *weapon = g_Weapons[gset->weaponnum];
|
||||
struct weapondef *weapon = g_Weapons[gset->weaponnum];
|
||||
|
||||
if (weapon) {
|
||||
return weapon->sectopri_animation;
|
||||
|
|
|
@ -670,13 +670,13 @@ void casing_create_for_hand(s32 handnum, f32 ground, Mtxf *mtx)
|
|||
f32 spc8[3][3];
|
||||
s32 weaponnum = bgun_get_weapon_num(handnum);
|
||||
s32 casingtype = -1;
|
||||
struct weaponfunc *func = gset_get_funcdef_by_gset2(&player->hands[handnum].gset);
|
||||
struct weapon *weapondef = gset_get_weapondef(player->gunctrl.weaponnum);
|
||||
struct weaponfunc_shoot *shootfunc = NULL;
|
||||
struct funcdef *func = gset_get_funcdef_by_gset2(&player->hands[handnum].gset);
|
||||
struct weapondef *weapondef = gset_get_weapondef(player->gunctrl.weaponnum);
|
||||
struct funcdef_shoot *shootfunc = NULL;
|
||||
struct modeldef *modeldef;
|
||||
|
||||
if ((func->type & 0xff) == INVENTORYFUNCTYPE_SHOOT) {
|
||||
shootfunc = (struct weaponfunc_shoot *)func;
|
||||
shootfunc = (struct funcdef_shoot *)func;
|
||||
}
|
||||
|
||||
if (func->ammoindex < 0) {
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -3654,8 +3654,8 @@ u8 var80072d88 = 255;
|
|||
|
||||
char *inv_menu_text_primary_function(struct menuitem *item)
|
||||
{
|
||||
struct weaponfunc *primaryfunc = gset_get_funcdef_by_weaponnum_funcnum(g_InventoryWeapon, 0);
|
||||
struct weaponfunc *secondaryfunc = gset_get_funcdef_by_weaponnum_funcnum(g_InventoryWeapon, 1);
|
||||
struct funcdef *primaryfunc = gset_get_funcdef_by_weaponnum_funcnum(g_InventoryWeapon, 0);
|
||||
struct funcdef *secondaryfunc = gset_get_funcdef_by_weaponnum_funcnum(g_InventoryWeapon, 1);
|
||||
|
||||
if (primaryfunc && secondaryfunc) {
|
||||
return lang_get(primaryfunc->name);
|
||||
|
@ -3666,8 +3666,8 @@ char *inv_menu_text_primary_function(struct menuitem *item)
|
|||
|
||||
char *inv_menu_text_secondary_function(struct menuitem *item)
|
||||
{
|
||||
struct weaponfunc *primaryfunc = gset_get_funcdef_by_weaponnum_funcnum(g_InventoryWeapon, 0);
|
||||
struct weaponfunc *secondaryfunc = gset_get_funcdef_by_weaponnum_funcnum(g_InventoryWeapon, 1);
|
||||
struct funcdef *primaryfunc = gset_get_funcdef_by_weaponnum_funcnum(g_InventoryWeapon, 0);
|
||||
struct funcdef *secondaryfunc = gset_get_funcdef_by_weaponnum_funcnum(g_InventoryWeapon, 1);
|
||||
|
||||
if (secondaryfunc) {
|
||||
return lang_get(secondaryfunc->name);
|
||||
|
@ -3767,7 +3767,7 @@ void func0f105948(s32 weaponnum)
|
|||
};
|
||||
|
||||
s32 useindex;
|
||||
struct weapon *weapon;
|
||||
struct weapondef *weapon;
|
||||
u32 stack;
|
||||
s32 wantindex;
|
||||
|
||||
|
@ -3862,7 +3862,7 @@ MenuDialogHandlerResult inventory_menu_dialog(s32 operation, struct menudialogde
|
|||
*/
|
||||
char *inv_menu_text_weapon_name(struct menuitem *item)
|
||||
{
|
||||
struct weapon *weapon = gset_get_weapondef(g_InventoryWeapon);
|
||||
struct weapondef *weapon = gset_get_weapondef(g_InventoryWeapon);
|
||||
|
||||
if (weapon) {
|
||||
if (weapon->manufacturer == L_GUN_000) { // "\n"
|
||||
|
@ -3880,7 +3880,7 @@ char *inv_menu_text_weapon_name(struct menuitem *item)
|
|||
*/
|
||||
char *inv_menu_text_weapon_manufacturer(struct menuitem *item)
|
||||
{
|
||||
struct weapon *weapon = gset_get_weapondef(g_InventoryWeapon);
|
||||
struct weapondef *weapon = gset_get_weapondef(g_InventoryWeapon);
|
||||
u32 textid = L_GUN_000; // "\n"
|
||||
|
||||
if (weapon) {
|
||||
|
@ -3902,7 +3902,7 @@ char *inv_menu_text_weapon_manufacturer(struct menuitem *item)
|
|||
|
||||
char *inv_menu_text_weapon_description(struct menuitem *item)
|
||||
{
|
||||
struct weapon *weapon = gset_get_weapondef(g_InventoryWeapon);
|
||||
struct weapondef *weapon = gset_get_weapondef(g_InventoryWeapon);
|
||||
|
||||
if (weapon) {
|
||||
if (g_InventoryWeapon == WEAPON_EYESPY && g_Vars.currentplayer->eyespy) {
|
||||
|
|
|
@ -159,21 +159,21 @@ void modelmgr_allocate_slots(s32 numobjs, s32 numchrs)
|
|||
bool modelmgr_load_projectile_modeldefs(s32 weaponnum)
|
||||
{
|
||||
bool result = false;
|
||||
struct weapon *weapon = g_Weapons[weaponnum];
|
||||
struct weapondef *weapon = g_Weapons[weaponnum];
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i != 2; i++) {
|
||||
if (weapon->functions[i]) {
|
||||
struct weaponfunc *genericfunc = weapon->functions[i];
|
||||
struct funcdef *genericfunc = weapon->functions[i];
|
||||
|
||||
if (genericfunc->type == INVENTORYFUNCTYPE_SHOOT_PROJECTILE) {
|
||||
struct weaponfunc_shootprojectile *func = (struct weaponfunc_shootprojectile *)genericfunc;
|
||||
struct funcdef_shootprojectile *func = (struct funcdef_shootprojectile *)genericfunc;
|
||||
|
||||
if (func->projectilemodelnum >= 0) {
|
||||
result |= setup_load_modeldef(func->projectilemodelnum);
|
||||
}
|
||||
} else if (genericfunc->type == INVENTORYFUNCTYPE_THROW) {
|
||||
struct weaponfunc_throw *func = (struct weaponfunc_throw *)genericfunc;
|
||||
struct funcdef_throw *func = (struct funcdef_throw *)genericfunc;
|
||||
|
||||
if (func->projectilemodelnum >= 0) {
|
||||
result |= setup_load_modeldef(func->projectilemodelnum);
|
||||
|
|
|
@ -354,7 +354,7 @@ struct menudialogdef g_MpPauseControlMenuDialog = {
|
|||
#if VERSION >= VERSION_JPN_FINAL
|
||||
char *mp_menu_text_weapon_description(struct menuitem *item)
|
||||
{
|
||||
struct weapon *weapondef = gset_get_weapondef(g_Menus[g_MpPlayerNum].training.weaponnum);
|
||||
struct weapondef *weapondef = gset_get_weapondef(g_Menus[g_MpPlayerNum].training.weaponnum);
|
||||
|
||||
if (weapondef != NULL) {
|
||||
if (g_Menus[g_MpPlayerNum].training.weaponnum == WEAPON_EYESPY) {
|
||||
|
@ -425,7 +425,7 @@ char *mp_menu_text_weapon_description(struct menuitem *item)
|
|||
#else
|
||||
char *mp_menu_text_weapon_description(struct menuitem *item)
|
||||
{
|
||||
struct weapon *weapon = gset_get_weapondef(g_Menus[g_MpPlayerNum].mppause.weaponnum);
|
||||
struct weapondef *weapon = gset_get_weapondef(g_Menus[g_MpPlayerNum].mppause.weaponnum);
|
||||
|
||||
if (weapon) {
|
||||
return lang_get(weapon->description);
|
||||
|
|
|
@ -584,7 +584,7 @@ struct prop *shot_calculate_hits(s32 handnum, bool isshooting, struct coord *gun
|
|||
struct shotdata shotdata;
|
||||
s32 i;
|
||||
s32 s1 = 0;
|
||||
struct weaponfunc *func;
|
||||
struct funcdef *func;
|
||||
bool laserstream = false;
|
||||
bool ismelee = false;
|
||||
f32 range = 200;
|
||||
|
@ -669,7 +669,7 @@ struct prop *shot_calculate_hits(s32 handnum, bool isshooting, struct coord *gun
|
|||
hitpos.z = shotdata.gunpos3d.z + shotdata.gundir3d.z * 300;
|
||||
} else if (ismelee) {
|
||||
if ((func->type & 0xff) == INVENTORYFUNCTYPE_MELEE) {
|
||||
struct weaponfunc_melee *meleefunc = (struct weaponfunc_melee *) func;
|
||||
struct funcdef_melee *meleefunc = (struct funcdef_melee *) func;
|
||||
range = meleefunc->range;
|
||||
}
|
||||
|
||||
|
@ -1192,10 +1192,10 @@ void hand_inflict_melee_damage(s32 handnum, struct gset *gset, bool arg2)
|
|||
f32 spfc[2];
|
||||
f32 spf4[2];
|
||||
struct model *model;
|
||||
struct weaponfunc *func = gset_get_funcdef_by_gset(gset);
|
||||
struct funcdef *func = gset_get_funcdef_by_gset(gset);
|
||||
|
||||
if ((func->type & 0xff) == INVENTORYFUNCTYPE_MELEE) {
|
||||
struct weaponfunc_melee *meleefunc = (struct weaponfunc_melee *)func;
|
||||
struct funcdef_melee *meleefunc = (struct funcdef_melee *)func;
|
||||
rangelimit = meleefunc->range;
|
||||
}
|
||||
|
||||
|
@ -2393,7 +2393,7 @@ f32 prop_calculate_autoaim_score(struct prop *prop, struct coord *screenpos, f32
|
|||
f32 left;
|
||||
f32 right;
|
||||
f32 result = -2;
|
||||
struct weaponfunc *func = gset_get_current_funcdef(HAND_RIGHT);
|
||||
struct funcdef *func = gset_get_current_funcdef(HAND_RIGHT);
|
||||
bool usefullscreen = forcefullscreen;
|
||||
bool sp4c;
|
||||
f32 sp48;
|
||||
|
@ -2577,7 +2577,7 @@ void autoaim_tick(void)
|
|||
bool ismelee = false;
|
||||
bool cangangsta = gset_has_weapon_flag(bgun_get_weapon_num(HAND_RIGHT), WEAPONFLAG_GANGSTA);
|
||||
bool iscmpsec = false;
|
||||
struct weaponfunc *func = gset_get_current_funcdef(HAND_RIGHT);
|
||||
struct funcdef *func = gset_get_current_funcdef(HAND_RIGHT);
|
||||
s32 i;
|
||||
|
||||
if (func && (func->type & 0xff) == INVENTORYFUNCTYPE_MELEE) {
|
||||
|
|
|
@ -15685,7 +15685,7 @@ void obj_hit(struct shotdata *shotdata, struct hit *hit)
|
|||
s32 i;
|
||||
bool explosiveshells = false;
|
||||
bool slowsbullet = hit->slowsbullet;
|
||||
struct weaponfunc *func = gset_get_funcdef_by_gset(&shotdata->gset);
|
||||
struct funcdef *func = gset_get_funcdef_by_gset(&shotdata->gset);
|
||||
struct coord spec;
|
||||
f32 tmp;
|
||||
struct prop *spe4;
|
||||
|
|
|
@ -161,7 +161,7 @@ void sight_tick(bool sighton)
|
|||
s32 i;
|
||||
s32 index;
|
||||
struct invaimsettings *gunsettings = gset_get_aim_settings(&g_Vars.currentplayer->hands[0].gset);
|
||||
struct weaponfunc *func = gset_get_funcdef_by_weaponnum_funcnum(g_Vars.currentplayer->hands[0].gset.weaponnum,
|
||||
struct funcdef *func = gset_get_funcdef_by_weaponnum_funcnum(g_Vars.currentplayer->hands[0].gset.weaponnum,
|
||||
g_Vars.currentplayer->hands[0].gset.weaponfunc);
|
||||
|
||||
g_Vars.currentplayer->sighttimer240 += g_Vars.lvupdate240;
|
||||
|
|
|
@ -1656,7 +1656,7 @@ void fr_tick(void)
|
|||
s32 j;
|
||||
f32 dist;
|
||||
u32 stack;
|
||||
struct inventory_ammo *ammo;
|
||||
struct ammodef *ammo;
|
||||
u8 exploding;
|
||||
bool oldside;
|
||||
struct modelrodata_bbox *bbox;
|
||||
|
|
|
@ -313,7 +313,7 @@ MenuItemHandlerResult fr_difficulty_menu_handler(s32 operation, struct menuitem
|
|||
|
||||
char *fr_primary_function_menu_text(struct menuitem *item)
|
||||
{
|
||||
struct weaponfunc *func = gset_get_funcdef_by_weaponnum_funcnum(fr_get_weapon_by_slot(fr_get_slot()), FUNC_PRIMARY);
|
||||
struct funcdef *func = gset_get_funcdef_by_weaponnum_funcnum(fr_get_weapon_by_slot(fr_get_slot()), FUNC_PRIMARY);
|
||||
|
||||
if (func) {
|
||||
return lang_get(func->name);
|
||||
|
@ -324,7 +324,7 @@ char *fr_primary_function_menu_text(struct menuitem *item)
|
|||
|
||||
char *fr_secondary_function_menu_text(struct menuitem *item)
|
||||
{
|
||||
struct weaponfunc *func = gset_get_funcdef_by_weaponnum_funcnum(fr_get_weapon_by_slot(fr_get_slot()), FUNC_SECONDARY);
|
||||
struct funcdef *func = gset_get_funcdef_by_weaponnum_funcnum(fr_get_weapon_by_slot(fr_get_slot()), FUNC_SECONDARY);
|
||||
|
||||
if (func) {
|
||||
return lang_get(func->name);
|
||||
|
|
|
@ -232,7 +232,7 @@ extern bool g_ObjectiveChecksDisabled;
|
|||
extern u16 var8006ae90[];
|
||||
extern u16 var8006af0c[];
|
||||
extern u16 var8006af8c[];
|
||||
extern struct weapon *g_Weapons[];
|
||||
extern struct weapondef *g_Weapons[];
|
||||
extern u32 g_BgunGunMemBaseSize4Mb2P;
|
||||
extern bool g_CasingsActive;
|
||||
extern s32 g_MaxModels;
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
#include "data.h"
|
||||
#include "types.h"
|
||||
|
||||
struct weapon *gset_get_weapondef(s32 itemid);
|
||||
struct weaponfunc *gset_get_funcdef_by_weaponnum_funcnum(u32 weaponnum, u32 which);
|
||||
struct weaponfunc *gset_get_funcdef_by_gset2(struct gset *gset);
|
||||
struct weaponfunc *gset_get_funcdef_by_gset(struct gset *gset);
|
||||
struct weaponfunc *gset_get_funcdef_by_gset_funcnum(struct gset *gset, s32 which);
|
||||
struct weaponfunc *gset_get_current_funcdef(u32 hand);
|
||||
struct weapondef *gset_get_weapondef(s32 itemid);
|
||||
struct funcdef *gset_get_funcdef_by_weaponnum_funcnum(u32 weaponnum, u32 which);
|
||||
struct funcdef *gset_get_funcdef_by_gset2(struct gset *gset);
|
||||
struct funcdef *gset_get_funcdef_by_gset(struct gset *gset);
|
||||
struct funcdef *gset_get_funcdef_by_gset_funcnum(struct gset *gset, s32 which);
|
||||
struct funcdef *gset_get_current_funcdef(u32 hand);
|
||||
struct invaimsettings *gset_get_aim_settings(struct gset *gset);
|
||||
struct inventory_ammo *gset_get_ammodef(u32 weaponnum, u32 funcnum);
|
||||
struct ammodef *gset_get_ammodef(u32 weaponnum, u32 funcnum);
|
||||
f32 gset_get_xshift(s32 handnum);
|
||||
f32 gset_get_xpos(s32 handnum);
|
||||
f32 gset_get_gun_zoom_fov(void);
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
extern struct noisesettings invnoisesettings_silent;
|
||||
extern struct invaimsettings invaimsettings_default;
|
||||
extern struct weapon *g_Weapons[WEAPON_SUICIDEPILL + 1];
|
||||
extern struct weapondef *g_Weapons[WEAPON_SUICIDEPILL + 1];
|
||||
|
||||
void inv_reset(void);
|
||||
void inv_init(s32 numdoubles);
|
||||
|
|
|
@ -2111,7 +2111,7 @@ struct hand {
|
|||
/*0x0814*/ struct beam beam;
|
||||
/*0x0840*/ f32 noiseradius;
|
||||
/*0x0844*/ u32 fingerroty;
|
||||
/*0x0848*/ f32 slidetrans; // 0 at rest, positive when back (struct weaponfunc_shoot.slidemax)
|
||||
/*0x0848*/ f32 slidetrans; // 0 at rest, positive when back (struct funcdef_shoot.slidemax)
|
||||
/*0x084c*/ bool slideinc; // true when moving back, false when moving forward or not moving
|
||||
/*0x0850*/ struct weaponobj *rocket;
|
||||
/*0x0854*/ bool firedrocket;
|
||||
|
@ -2865,7 +2865,7 @@ struct gunviscmd {
|
|||
u16 unk08;
|
||||
};
|
||||
|
||||
struct weaponfunc {
|
||||
struct funcdef {
|
||||
/*0x00*/ s32 type;
|
||||
/*0x04*/ u16 name;
|
||||
/*0x06*/ u8 unk06; // not used
|
||||
|
@ -2875,8 +2875,8 @@ struct weaponfunc {
|
|||
/*0x10*/ u32 flags;
|
||||
};
|
||||
|
||||
struct weaponfunc_shoot {
|
||||
struct weaponfunc base;
|
||||
struct funcdef_shoot {
|
||||
struct funcdef base;
|
||||
/*0x14*/ struct recoilsettings *recoilsettings;
|
||||
/*0x18*/ s8 recoverytime60;
|
||||
/*0x1c*/ f32 damage;
|
||||
|
@ -2900,12 +2900,12 @@ struct weaponfunc_shoot {
|
|||
/*0x3c*/ u8 penetration;
|
||||
};
|
||||
|
||||
struct weaponfunc_shootsingle {
|
||||
struct weaponfunc_shoot base;
|
||||
struct funcdef_shootsingle {
|
||||
struct funcdef_shoot base;
|
||||
};
|
||||
|
||||
struct weaponfunc_shootauto {
|
||||
struct weaponfunc_shoot base;
|
||||
struct funcdef_shootauto {
|
||||
struct funcdef_shoot base;
|
||||
/*0x40*/ f32 initialrpm; // rounds per minute
|
||||
/*0x44*/ f32 maxrpm; // rounds per minute
|
||||
/*0x48*/ f32 *vibrationstart;
|
||||
|
@ -2914,8 +2914,8 @@ struct weaponfunc_shootauto {
|
|||
/*0x51*/ s8 turretdecel;
|
||||
};
|
||||
|
||||
struct weaponfunc_shootprojectile {
|
||||
struct weaponfunc_shoot base;
|
||||
struct funcdef_shootprojectile {
|
||||
struct funcdef_shoot base;
|
||||
/*0x40*/ s32 projectilemodelnum;
|
||||
/*0x44*/ u32 unk44; // unused
|
||||
/*0x48*/ f32 scale;
|
||||
|
@ -2927,16 +2927,16 @@ struct weaponfunc_shootprojectile {
|
|||
/*0x60*/ s16 soundnum;
|
||||
};
|
||||
|
||||
struct weaponfunc_throw {
|
||||
struct weaponfunc base;
|
||||
struct funcdef_throw {
|
||||
struct funcdef base;
|
||||
/*0x14*/ s32 projectilemodelnum;
|
||||
/*0x18*/ s16 activatetime60; // time until proxies become active, or timed mine/grenade explodes
|
||||
/*0x1c*/ s32 recoverytime60; // time before player can throw another
|
||||
/*0x20*/ f32 damage;
|
||||
};
|
||||
|
||||
struct weaponfunc_melee {
|
||||
struct weaponfunc base;
|
||||
struct funcdef_melee {
|
||||
struct funcdef base;
|
||||
/*0x14*/ f32 damage;
|
||||
/*0x18*/ f32 range;
|
||||
/*0x1c*/ u32 unk1c; // unused
|
||||
|
@ -2953,19 +2953,19 @@ struct weaponfunc_melee {
|
|||
/*0x48*/ u32 unk48; // unused
|
||||
};
|
||||
|
||||
struct weaponfunc_special {
|
||||
struct weaponfunc base;
|
||||
struct funcdef_special {
|
||||
struct funcdef base;
|
||||
/*0x14*/ s32 specialfunc;
|
||||
/*0x18*/ s32 recoverytime60;
|
||||
/*0x1c*/ u16 soundnum; // unused
|
||||
};
|
||||
|
||||
struct weaponfunc_device {
|
||||
struct weaponfunc base;
|
||||
struct funcdef_device {
|
||||
struct funcdef base;
|
||||
/*0x14*/ u32 device;
|
||||
};
|
||||
|
||||
struct inventory_ammo {
|
||||
struct ammodef {
|
||||
u32 type;
|
||||
u32 casingeject;
|
||||
s16 clipsize;
|
||||
|
@ -2978,7 +2978,7 @@ struct modelpartvisibility {
|
|||
u8 visible;
|
||||
};
|
||||
|
||||
struct weapon {
|
||||
struct weapondef {
|
||||
/*0x00*/ u16 hi_model;
|
||||
/*0x02*/ u16 lo_model;
|
||||
/*0x04*/ struct guncmd *equip_animation;
|
||||
|
@ -2986,7 +2986,7 @@ struct weapon {
|
|||
/*0x0c*/ struct guncmd *pritosec_animation;
|
||||
/*0x10*/ struct guncmd *sectopri_animation;
|
||||
/*0x14*/ void *functions[2];
|
||||
/*0x1c*/ struct inventory_ammo *ammos[2];
|
||||
/*0x1c*/ struct ammodef *ammos[2];
|
||||
/*0x24*/ struct invaimsettings *aimsettings;
|
||||
/*0x28*/ f32 muzzlez;
|
||||
/*0x2c*/ f32 posx;
|
||||
|
@ -5542,7 +5542,7 @@ struct botweaponconfig {
|
|||
|
||||
struct handweaponinfo {
|
||||
s32 weaponnum;
|
||||
struct weapon *definition;
|
||||
struct weapondef *definition;
|
||||
struct gunctrl *gunctrl;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue