Rename "close" gun function type to "melee"

This commit is contained in:
Ryan Dwyer 2022-12-02 22:46:40 +10:00
parent c20a31db57
commit 0063dcc71c
17 changed files with 98 additions and 98 deletions

View File

@ -1142,7 +1142,7 @@ bool bgun0f0990b0(struct weaponfunc *basefunc, struct weapon *weapon)
return true; return true;
} }
if ((basefunc->type & 0xff) == INVENTORYFUNCTYPE_CLOSE) { if ((basefunc->type & 0xff) == INVENTORYFUNCTYPE_MELEE) {
return true; return true;
} }
@ -1269,7 +1269,7 @@ s32 bgunTickIncIdle(struct handweaponinfo *info, s32 handnum, struct hand *hand,
if (info->gunctrl->wantammo) { if (info->gunctrl->wantammo) {
func = weaponGetFunction(&hand->gset, 1 - hand->gset.weaponfunc); func = weaponGetFunction(&hand->gset, 1 - hand->gset.weaponfunc);
if ((func->type & 0xff) != INVENTORYFUNCTYPE_CLOSE) { if ((func->type & 0xff) != INVENTORYFUNCTYPE_MELEE) {
sp30 = -1; sp30 = -1;
} }
} else { } else {
@ -2369,7 +2369,7 @@ const char var7f1ab938[] = "GiveMem: %d\n";
u32 var8007012c = 0x00000000; u32 var8007012c = 0x00000000;
u32 var80070130 = 0x00000000; u32 var80070130 = 0x00000000;
bool bgunTickIncAttackingClose(s32 handnum, struct hand *hand) bool bgunTickIncAttackingMelee(s32 handnum, struct hand *hand)
{ {
struct weaponfunc *func = gsetGetWeaponFunction(&hand->gset); struct weaponfunc *func = gsetGetWeaponFunction(&hand->gset);
@ -2384,7 +2384,7 @@ bool bgunTickIncAttackingClose(s32 handnum, struct hand *hand)
} }
hand->firing = true; hand->firing = true;
hand->attacktype = HANDATTACKTYPE_CLOSERANGE; hand->attacktype = HANDATTACKTYPE_MELEE;
hand->burstbullets++; hand->burstbullets++;
if (hand->triggeron) { if (hand->triggeron) {
@ -2404,7 +2404,7 @@ bool bgunTickIncAttackingClose(s32 handnum, struct hand *hand)
if (hand->stateminor == 0) { if (hand->stateminor == 0) {
if (hand->statecycles == 0) { if (hand->statecycles == 0) {
hand->firing = true; hand->firing = true;
hand->attacktype = HANDATTACKTYPE_CLOSERANGENOUNCLOAK; hand->attacktype = HANDATTACKTYPE_MELEENOUNCLOAK;
if (func->fire_animation) { if (func->fire_animation) {
bgunStartAnimation(func->fire_animation, handnum, hand); bgunStartAnimation(func->fire_animation, handnum, hand);
@ -2433,7 +2433,7 @@ bool bgunTickIncAttackingClose(s32 handnum, struct hand *hand)
if (hand->stateminor == 1) { if (hand->stateminor == 1) {
hand->firing = true; hand->firing = true;
hand->attacktype = HANDATTACKTYPE_CLOSERANGE; hand->attacktype = HANDATTACKTYPE_MELEE;
if (hand->gset.weaponnum == WEAPON_TRANQUILIZER && func->ammoindex >= 0) { if (hand->gset.weaponnum == WEAPON_TRANQUILIZER && func->ammoindex >= 0) {
if (hand->loadedammo[func->ammoindex] > bgunGetMinClipQty(WEAPON_TRANQUILIZER, FUNC_SECONDARY)) { if (hand->loadedammo[func->ammoindex] > bgunGetMinClipQty(WEAPON_TRANQUILIZER, FUNC_SECONDARY)) {
@ -2691,8 +2691,8 @@ s32 bgunTickIncAttack(struct handweaponinfo *info, s32 handnum, struct hand *han
case INVENTORYFUNCTYPE_THROW: case INVENTORYFUNCTYPE_THROW:
finished = bgunTickIncAttackingThrow(handnum, hand); finished = bgunTickIncAttackingThrow(handnum, hand);
break; break;
case INVENTORYFUNCTYPE_CLOSE: case INVENTORYFUNCTYPE_MELEE:
finished = bgunTickIncAttackingClose(handnum, hand); finished = bgunTickIncAttackingMelee(handnum, hand);
break; break;
case INVENTORYFUNCTYPE_SPECIAL: case INVENTORYFUNCTYPE_SPECIAL:
finished = bgunTickIncAttackingSpecial(hand); finished = bgunTickIncAttackingSpecial(hand);
@ -6140,7 +6140,7 @@ bool bgun0f0a27c8(void)
func = gsetGetWeaponFunction2(&hand->gset); func = gsetGetWeaponFunction2(&hand->gset);
if (func if (func
&& (func->type & 0xff) == INVENTORYFUNCTYPE_CLOSE && (func->type & 0xff) == INVENTORYFUNCTYPE_MELEE
&& hand->state == HANDSTATE_ATTACK && hand->state == HANDSTATE_ATTACK
&& hand->unk0ce8 != NULL && hand->unk0ce8 != NULL
&& hand->animmode == HANDANIMMODE_BUSY && hand->animmode == HANDANIMMODE_BUSY
@ -6154,7 +6154,7 @@ bool bgun0f0a27c8(void)
func = gsetGetWeaponFunction2(&hand->gset); func = gsetGetWeaponFunction2(&hand->gset);
if (func if (func
&& (func->type & 0xff) == INVENTORYFUNCTYPE_CLOSE && (func->type & 0xff) == INVENTORYFUNCTYPE_MELEE
&& hand->state == HANDSTATE_ATTACK && hand->state == HANDSTATE_ATTACK
&& hand->unk0ce8 != NULL && hand->unk0ce8 != NULL
&& hand->animmode == HANDANIMMODE_BUSY && hand->animmode == HANDANIMMODE_BUSY
@ -6180,7 +6180,7 @@ bool bgun0f0a28d8(void)
func = gsetGetWeaponFunction2(&hand->gset); func = gsetGetWeaponFunction2(&hand->gset);
if (func if (func
&& (func->type & 0xff) == INVENTORYFUNCTYPE_CLOSE && (func->type & 0xff) == INVENTORYFUNCTYPE_MELEE
&& hand->state == HANDSTATE_ATTACK && hand->state == HANDSTATE_ATTACK
&& hand->unk0ce8 != NULL && hand->unk0ce8 != NULL
&& hand->animmode == HANDANIMMODE_BUSY) { && hand->animmode == HANDANIMMODE_BUSY) {
@ -6193,7 +6193,7 @@ bool bgun0f0a28d8(void)
func = gsetGetWeaponFunction2(&hand->gset); func = gsetGetWeaponFunction2(&hand->gset);
if (func if (func
&& (func->type & 0xff) == INVENTORYFUNCTYPE_CLOSE && (func->type & 0xff) == INVENTORYFUNCTYPE_MELEE
&& hand->state == HANDSTATE_ATTACK && hand->state == HANDSTATE_ATTACK
&& hand->unk0ce8 != NULL && hand->unk0ce8 != NULL
&& hand->animmode == HANDANIMMODE_BUSY) { && hand->animmode == HANDANIMMODE_BUSY) {
@ -7407,7 +7407,7 @@ void bgunCreateFx(struct hand *hand, s32 handnum, struct weaponfunc *funcdef, s3
} }
if (funcdef) { if (funcdef) {
if ((funcdef->type & 0xff) == INVENTORYFUNCTYPE_CLOSE || (funcdef->type & INVENTORYFUNCTYPE_0200)) { if ((funcdef->type & 0xff) == INVENTORYFUNCTYPE_MELEE || (funcdef->type & INVENTORYFUNCTYPE_0200)) {
createbeam = false; createbeam = false;
} }

View File

@ -81,7 +81,7 @@ bool bmoveIsAutoAimYEnabledForCurrentWeapon(void)
return false; return false;
} }
if ((func->type & 0xff) == INVENTORYFUNCTYPE_CLOSE) { if ((func->type & 0xff) == INVENTORYFUNCTYPE_MELEE) {
return true; return true;
} }
} }
@ -139,7 +139,7 @@ bool bmoveIsAutoAimXEnabledForCurrentWeapon(void)
return false; return false;
} }
if ((func->type & 0xff) == INVENTORYFUNCTYPE_CLOSE) { if ((func->type & 0xff) == INVENTORYFUNCTYPE_MELEE) {
return true; return true;
} }
} }

View File

@ -115,7 +115,7 @@ void botReset(struct chrdata *chr, u8 respawning)
aibot->weaponnum = WEAPON_UNARMED; aibot->weaponnum = WEAPON_UNARMED;
aibot->gunfunc = FUNC_PRIMARY; aibot->gunfunc = FUNC_PRIMARY;
aibot->iscloserangeweapon = true; aibot->ismeleeweapon = true;
aibot->loadedammo[0] = 0; aibot->loadedammo[0] = 0;
aibot->loadedammo[1] = 0; aibot->loadedammo[1] = 0;
aibot->gotoprop = NULL; aibot->gotoprop = NULL;
@ -990,7 +990,7 @@ s32 botTick(struct prop *prop)
chrSetLookAngle(chr, newangle); chrSetLookAngle(chr, newangle);
if (chr->target != -1 && !aibot->iscloserangeweapon) { if (chr->target != -1 && !aibot->ismeleeweapon) {
bool left = chr->weapons_held[HAND_LEFT] ? true : false; bool left = chr->weapons_held[HAND_LEFT] ? true : false;
bool right = (0, chr->weapons_held[HAND_RIGHT] ? true : false); bool right = (0, chr->weapons_held[HAND_RIGHT] ? true : false);
@ -2430,7 +2430,7 @@ void botTickUnpaused(struct chrdata *chr)
// Bot doesn't have the weapon it was told to switch to // Bot doesn't have the weapon it was told to switch to
chr->aibot->weaponnum = WEAPON_UNARMED; chr->aibot->weaponnum = WEAPON_UNARMED;
chr->aibot->gunfunc = FUNC_PRIMARY; chr->aibot->gunfunc = FUNC_PRIMARY;
chr->aibot->iscloserangeweapon = 1; chr->aibot->ismeleeweapon = true;
} }
aibot->throwtimer60 = 0; aibot->throwtimer60 = 0;
@ -3332,7 +3332,7 @@ void botTickUnpaused(struct chrdata *chr)
} }
if (aibot->skrocket == NULL && aibot->changeguntimer60 <= 0) { if (aibot->skrocket == NULL && aibot->changeguntimer60 <= 0) {
if (aibot->iscloserangeweapon) { if (aibot->ismeleeweapon) {
// Consider punching, pistol whipping etc // Consider punching, pistol whipping etc
// Despite the name, punchtimer60 is used for all close // Despite the name, punchtimer60 is used for all close
// range attacks. Its value is 0 if not currently // range attacks. Its value is 0 if not currently

View File

@ -425,7 +425,7 @@ s32 botactGetShootInterval60(s32 weaponnum, s32 funcnum)
} else if (func->type == INVENTORYFUNCTYPE_SHOOT_PROJECTILE) { } else if (func->type == INVENTORYFUNCTYPE_SHOOT_PROJECTILE) {
struct weaponfunc_shoot *func2 = (struct weaponfunc_shoot *)func; struct weaponfunc_shoot *func2 = (struct weaponfunc_shoot *)func;
result = func2->unk24 + func2->unk25; result = func2->unk24 + func2->unk25;
} else if (func->type == INVENTORYFUNCTYPE_CLOSE && weaponnum != WEAPON_REAPER) { } else if (func->type == INVENTORYFUNCTYPE_MELEE && weaponnum != WEAPON_REAPER) {
result = 60; result = 60;
} }
} }

View File

@ -1103,7 +1103,7 @@ bool botinvSwitchToWeapon(struct chrdata *chr, s32 weaponnum, s32 funcnum)
func = weaponGetFunctionById(weaponnum, funcnum); func = weaponGetFunctionById(weaponnum, funcnum);
aibot->iscloserangeweapon = func && func->type == INVENTORYFUNCTYPE_CLOSE; aibot->ismeleeweapon = func && func->type == INVENTORYFUNCTYPE_MELEE;
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
if (chr->weapons_held[i]) { if (chr->weapons_held[i]) {

View File

@ -176,7 +176,7 @@ void botmgrAllocateBot(s32 chrnum, s32 aibotnum)
aibot->unk0a0 = 0; aibot->unk0a0 = 0;
aibot->gunfunc = FUNC_PRIMARY; aibot->gunfunc = FUNC_PRIMARY;
aibot->iscloserangeweapon = true; aibot->ismeleeweapon = true;
aibot->teamisonlyai = false; aibot->teamisonlyai = false;
aibot->hasbriefcase = false; aibot->hasbriefcase = false;
aibot->hascase = false; aibot->hascase = false;

View File

@ -5152,12 +5152,12 @@ void chrHit(struct shotdata *shotdata, struct hit *hit)
struct coord hitpos; struct coord hitpos;
struct coord sp98; struct coord sp98;
s16 sp90[3]; s16 sp90[3];
u8 isclose = false; u8 ismelee = false;
struct weaponfunc *func = gsetGetWeaponFunction(&shotdata->gset); struct weaponfunc *func = gsetGetWeaponFunction(&shotdata->gset);
f32 shield; f32 shield;
if (func && (func->type & 0xff) == INVENTORYFUNCTYPE_CLOSE) { if (func && (func->type & 0xff) == INVENTORYFUNCTYPE_MELEE) {
isclose = true; ismelee = true;
} }
// The prop that was hit could be an item held by the chr, // The prop that was hit could be an item held by the chr,
@ -5306,7 +5306,7 @@ void chrHit(struct shotdata *shotdata, struct hit *hit)
&& race != RACE_DRCAROLL && race != RACE_DRCAROLL
&& race != RACE_ROBOT && race != RACE_ROBOT
&& race != RACE_EYESPY && race != RACE_EYESPY
&& !isclose && !ismelee
&& shotdata->gset.weaponnum != WEAPON_TRANQUILIZER) { && shotdata->gset.weaponnum != WEAPON_TRANQUILIZER) {
u8 darker; u8 darker;
@ -5330,7 +5330,7 @@ void chrHit(struct shotdata *shotdata, struct hit *hit)
&& race != RACE_DRCAROLL && race != RACE_DRCAROLL
&& race != RACE_ROBOT && race != RACE_ROBOT
&& race != RACE_EYESPY && race != RACE_EYESPY
&& !isclose && !ismelee
&& shotdata->gset.weaponnum != WEAPON_TRANQUILIZER) { && shotdata->gset.weaponnum != WEAPON_TRANQUILIZER) {
u8 darker; u8 darker;

View File

@ -4248,7 +4248,7 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct gse
s32 race = CHRRACE(chr); s32 race = CHRRACE(chr);
f32 shield; f32 shield;
bool makedizzy; bool makedizzy;
bool isclose; bool ismelee;
struct prop *vprop = chr->prop; struct prop *vprop = chr->prop;
f32 headshotdamagescale = 1; f32 headshotdamagescale = 1;
bool usedshield = false; bool usedshield = false;
@ -4258,7 +4258,7 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct gse
f32 explosionforce = damage; f32 explosionforce = damage;
f32 healthscale = 1; f32 healthscale = 1;
f32 armourscale = 1; f32 armourscale = 1;
bool isfar = true; bool isshoot = true;
bool forceapplydamage = false; bool forceapplydamage = false;
struct weaponfunc *func; struct weaponfunc *func;
f32 amount; f32 amount;
@ -4338,15 +4338,15 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct gse
} }
func = gsetGetWeaponFunction(gset); func = gsetGetWeaponFunction(gset);
isclose = func && (func->type & 0xff) == INVENTORYFUNCTYPE_CLOSE; ismelee = func && (func->type & 0xff) == INVENTORYFUNCTYPE_MELEE;
makedizzy = race != RACE_DRCAROLL && gsetHasFunctionFlags(gset, FUNCFLAG_MAKEDIZZY); makedizzy = race != RACE_DRCAROLL && gsetHasFunctionFlags(gset, FUNCFLAG_MAKEDIZZY);
if (chr->prop == g_Vars.currentplayer->prop && g_Vars.currentplayer->invincible) { if (chr->prop == g_Vars.currentplayer->prop && g_Vars.currentplayer->invincible) {
return; return;
} }
if (isclose) { if (ismelee) {
isfar = false; isshoot = false;
} }
// Set a flag on the victim that makes them switch to their "shot" AI list // Set a flag on the victim that makes them switch to their "shot" AI list
@ -4633,7 +4633,7 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct gse
// If chr is dying or already dead, consider making their head flinch // If chr is dying or already dead, consider making their head flinch
// then we're done // then we're done
if (chr->actiontype == ACT_DIE || chr->actiontype == ACT_DEAD) { if (chr->actiontype == ACT_DIE || chr->actiontype == ACT_DEAD) {
if (hitpart == HITPART_HEAD && chr->actiontype == ACT_DIE && race != RACE_SKEDAR && isfar) { if (hitpart == HITPART_HEAD && chr->actiontype == ACT_DIE && race != RACE_SKEDAR && isshoot) {
struct coord pos; struct coord pos;
pos.x = vprop->pos.x - vector->x; pos.x = vprop->pos.x - vector->x;
pos.y = vprop->pos.y - vector->y; pos.y = vprop->pos.y - vector->y;
@ -4708,7 +4708,7 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct gse
} else { } else {
damage *= 4; damage *= 4;
if (isfar && !usedshield) { if (isshoot && !usedshield) {
chrFlinchHead(chr, angle); chrFlinchHead(chr, angle);
damage *= headshotdamagescale; damage *= headshotdamagescale;
@ -4809,7 +4809,7 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct gse
} }
// Handle player boost // Handle player boost
if (isclose && gset->weaponnum == WEAPON_REAPER) { if (ismelee && gset->weaponnum == WEAPON_REAPER) {
boostscale = 0.1f; boostscale = 0.1f;
} else if (g_Vars.normmplayerisrunning) { } else if (g_Vars.normmplayerisrunning) {
boostscale = 0.75f; boostscale = 0.75f;
@ -4894,7 +4894,7 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct gse
if (chr->aibot) { if (chr->aibot) {
f32 boostscale; f32 boostscale;
if (isclose && gset->weaponnum == WEAPON_REAPER) { if (ismelee && gset->weaponnum == WEAPON_REAPER) {
boostscale = 0.1f; boostscale = 0.1f;
} else { } else {
boostscale = 0.75f; boostscale = 0.75f;

View File

@ -467,13 +467,13 @@ f32 gsetGetDamage(struct gset *gset)
if (func) { if (func) {
if ((func->type & 0xff) == INVENTORYFUNCTYPE_SHOOT) { if ((func->type & 0xff) == INVENTORYFUNCTYPE_SHOOT) {
struct weaponfunc_shoot *fullfunc = (struct weaponfunc_shoot *)func; struct weaponfunc_shoot *shootfunc = (struct weaponfunc_shoot *)func;
damage = fullfunc->damage; damage = shootfunc->damage;
} }
if ((func->type & 0xff) == INVENTORYFUNCTYPE_CLOSE) { if ((func->type & 0xff) == INVENTORYFUNCTYPE_MELEE) {
struct weaponfunc_close *fullfunc = (struct weaponfunc_close *)func; struct weaponfunc_melee *meleefunc = (struct weaponfunc_melee *)func;
damage = fullfunc->damage; damage = meleefunc->damage;
if (gset->weaponnum == WEAPON_REAPER) { if (gset->weaponnum == WEAPON_REAPER) {
damage *= LVUPDATE60FREAL(); damage *= LVUPDATE60FREAL();
@ -481,8 +481,8 @@ f32 gsetGetDamage(struct gset *gset)
} }
if ((func->type & 0xff) == INVENTORYFUNCTYPE_THROW) { if ((func->type & 0xff) == INVENTORYFUNCTYPE_THROW) {
struct weaponfunc_throw *fullfunc = (struct weaponfunc_throw *)func; struct weaponfunc_throw *throwfunc = (struct weaponfunc_throw *)func;
damage = fullfunc->damage; damage = throwfunc->damage;
} }
} }
@ -577,7 +577,7 @@ u32 currentPlayerGetSight(void)
g_Vars.currentplayer->hands[HAND_RIGHT].gset.weaponnum, g_Vars.currentplayer->hands[HAND_RIGHT].gset.weaponnum,
g_Vars.currentplayer->hands[HAND_RIGHT].gset.weaponfunc); g_Vars.currentplayer->hands[HAND_RIGHT].gset.weaponfunc);
if (func && (func->type & 0xff) == INVENTORYFUNCTYPE_CLOSE) { if (func && (func->type & 0xff) == INVENTORYFUNCTYPE_MELEE) {
return SIGHT_NONE; return SIGHT_NONE;
} }

View File

@ -262,8 +262,8 @@ struct guncmd invanim_punch[] = {
gunscript_end gunscript_end
}; };
struct weaponfunc_close invfunc_unarmed_punch = { struct weaponfunc_melee invfunc_unarmed_punch = {
INVENTORYFUNCTYPE_CLOSE, INVENTORYFUNCTYPE_MELEE,
L_GUN_100, // name L_GUN_100, // name
0, // unused 0, // unused
-1, // ammoindex -1, // ammoindex
@ -286,8 +286,8 @@ struct weaponfunc_close invfunc_unarmed_punch = {
0, // unused 0, // unused
}; };
struct weaponfunc_close invfunc_unarmed_disarm = { struct weaponfunc_melee invfunc_unarmed_disarm = {
INVENTORYFUNCTYPE_CLOSE, INVENTORYFUNCTYPE_MELEE,
L_GUN_101, // name L_GUN_101, // name
0, // unused 0, // unused
-1, // ammoindex -1, // ammoindex
@ -526,8 +526,8 @@ struct weaponfunc_shootsingle invfunc_falcon2silenced_singleshot = {
1, // penetration 1, // penetration
}; };
struct weaponfunc_close invfunc_falcon2_pistolwhip = { struct weaponfunc_melee invfunc_falcon2_pistolwhip = {
INVENTORYFUNCTYPE_CLOSE, INVENTORYFUNCTYPE_MELEE,
L_GUN_094, // name L_GUN_094, // name
0, // unused 0, // unused
-1, // ammoindex -1, // ammoindex
@ -935,8 +935,8 @@ struct weaponfunc_shootsingle invfunc_dy357lx_singleshot = {
5, // penetration 5, // penetration
}; };
struct weaponfunc_close invfunc_dy357_pistolwhip = { struct weaponfunc_melee invfunc_dy357_pistolwhip = {
INVENTORYFUNCTYPE_CLOSE, INVENTORYFUNCTYPE_MELEE,
L_GUN_094, // name L_GUN_094, // name
0, // unused 0, // unused
-1, // ammoindex -1, // ammoindex
@ -2656,8 +2656,8 @@ struct weaponfunc_shootauto invfunc_reaper_shoot = {
88, // turretdecel 88, // turretdecel
}; };
struct weaponfunc_close invfunc_reaper_grind = { struct weaponfunc_melee invfunc_reaper_grind = {
INVENTORYFUNCTYPE_CLOSE, INVENTORYFUNCTYPE_MELEE,
L_GUN_106, // name L_GUN_106, // name
0, // unused 0, // unused
-1, // ammoindex -1, // ammoindex
@ -3858,8 +3858,8 @@ struct weaponfunc_shootsingle invfunc_tranquilizer_shoot = {
1, // penetration 1, // penetration
}; };
struct weaponfunc_close invfunc_tranquilizer_lethal = { struct weaponfunc_melee invfunc_tranquilizer_lethal = {
INVENTORYFUNCTYPE_CLOSE, INVENTORYFUNCTYPE_MELEE,
L_GUN_108, // name L_GUN_108, // name
0, // unused 0, // unused
0, // ammoindex 0, // ammoindex
@ -4899,8 +4899,8 @@ struct guncmd invanim_combatknife_reload[] = {
gunscript_end gunscript_end
}; };
struct weaponfunc_close invfunc_combatknife_slash = { struct weaponfunc_melee invfunc_combatknife_slash = {
INVENTORYFUNCTYPE_CLOSE, INVENTORYFUNCTYPE_MELEE,
L_GUN_109, // name L_GUN_109, // name
0, // unused 0, // unused
0, // ammoindex 0, // ammoindex

View File

@ -635,7 +635,7 @@ struct prop *shotCalculateHits(s32 handnum, bool arg1, struct coord *arg2, struc
explosiveshells = true; explosiveshells = true;
} }
if ((func->type & 0xff) == INVENTORYFUNCTYPE_CLOSE && arg1) { if ((func->type & 0xff) == INVENTORYFUNCTYPE_MELEE && arg1) {
shortrange = true; shortrange = true;
arg1 = false; arg1 = false;
} }
@ -664,9 +664,9 @@ struct prop *shotCalculateHits(s32 handnum, bool arg1, struct coord *arg2, struc
hitpos.y = shotdata.gunpos.y + shotdata.dir.y * 300; hitpos.y = shotdata.gunpos.y + shotdata.dir.y * 300;
hitpos.z = shotdata.gunpos.z + shotdata.dir.z * 300; hitpos.z = shotdata.gunpos.z + shotdata.dir.z * 300;
} else if (shortrange) { } else if (shortrange) {
if ((func->type & 0xff) == INVENTORYFUNCTYPE_CLOSE) { if ((func->type & 0xff) == INVENTORYFUNCTYPE_MELEE) {
struct weaponfunc_close *close = (struct weaponfunc_close *) func; struct weaponfunc_melee *meleefunc = (struct weaponfunc_melee *) func;
range = close->range; range = meleefunc->range;
} }
hitpos.x = shotdata.gunpos.x + shotdata.dir.x * range; hitpos.x = shotdata.gunpos.x + shotdata.dir.x * range;
@ -829,7 +829,7 @@ struct prop *shotCalculateHits(s32 handnum, bool arg1, struct coord *arg2, struc
bgunSetHitPos(&sp694.unk00); bgunSetHitPos(&sp694.unk00);
if (surfacetype->numwallhittexes > 0 && (!func || (func->type & 0xff) != INVENTORYFUNCTYPE_CLOSE)) { if (surfacetype->numwallhittexes > 0 && (!func || (func->type & 0xff) != INVENTORYFUNCTYPE_MELEE)) {
if (shotdata.gset.weaponnum != WEAPON_UNARMED if (shotdata.gset.weaponnum != WEAPON_UNARMED
&& shotdata.gset.weaponnum != WEAPON_LASER && shotdata.gset.weaponnum != WEAPON_LASER
&& shotdata.gset.weaponnum != WEAPON_TRANQUILIZER && shotdata.gset.weaponnum != WEAPON_TRANQUILIZER
@ -1103,7 +1103,7 @@ void func0f061fa8(struct shotdata *shotdata, struct prop *prop, f32 arg2, s32 hi
} }
} }
void handInflictCloseRangeDamage(s32 handnum, struct gset *gset, bool arg2) void handInflictMeleeDamage(s32 handnum, struct gset *gset, bool arg2)
{ {
s32 cdtypes; s32 cdtypes;
struct prop **ptr; struct prop **ptr;
@ -1170,9 +1170,9 @@ void handInflictCloseRangeDamage(s32 handnum, struct gset *gset, bool arg2)
struct model *model; struct model *model;
struct weaponfunc *func = gsetGetWeaponFunction(gset); struct weaponfunc *func = gsetGetWeaponFunction(gset);
if ((func->type & 0xff) == 3) { if ((func->type & 0xff) == INVENTORYFUNCTYPE_MELEE) {
struct weaponfunc_close *closefunc = (struct weaponfunc_close *)func; struct weaponfunc_melee *meleefunc = (struct weaponfunc_melee *)func;
rangelimit = closefunc->range; rangelimit = meleefunc->range;
} }
bgunGetCrossPos(&x, &y); bgunGetCrossPos(&x, &y);
@ -1308,12 +1308,12 @@ void handTickAttack(s32 handnum)
mpstats0f0b0520(); mpstats0f0b0520();
} }
break; break;
case HANDATTACKTYPE_CLOSERANGE: case HANDATTACKTYPE_MELEE:
chrUncloakTemporarily(g_Vars.currentplayer->prop->chr); chrUncloakTemporarily(g_Vars.currentplayer->prop->chr);
handInflictCloseRangeDamage(handnum, &gset, false); handInflictMeleeDamage(handnum, &gset, false);
break; break;
case HANDATTACKTYPE_CLOSERANGENOUNCLOAK: case HANDATTACKTYPE_MELEENOUNCLOAK:
handInflictCloseRangeDamage(handnum, &gset, true); handInflictMeleeDamage(handnum, &gset, true);
break; break;
case HANDATTACKTYPE_DETONATE: case HANDATTACKTYPE_DETONATE:
playerActivateRemoteMineDetonator(g_Vars.currentplayernum); playerActivateRemoteMineDetonator(g_Vars.currentplayernum);
@ -2548,14 +2548,14 @@ void autoaimTick(void)
{ {
struct prop *bestprop = NULL; struct prop *bestprop = NULL;
f32 aimpos[2] = {0, 0}; f32 aimpos[2] = {0, 0};
bool isclose = false; bool ismelee = false;
bool cangangsta = weaponHasFlag(bgunGetWeaponNum(HAND_RIGHT), WEAPONFLAG_GANGSTA); bool cangangsta = weaponHasFlag(bgunGetWeaponNum(HAND_RIGHT), WEAPONFLAG_GANGSTA);
bool iscmpsec = false; bool iscmpsec = false;
struct weaponfunc *func = currentPlayerGetWeaponFunction(HAND_RIGHT); struct weaponfunc *func = currentPlayerGetWeaponFunction(HAND_RIGHT);
s32 i; s32 i;
if (func && (func->type & 0xff) == INVENTORYFUNCTYPE_CLOSE) { if (func && (func->type & 0xff) == INVENTORYFUNCTYPE_MELEE) {
isclose = true; ismelee = true;
} }
if (frIsInTraining()) { if (frIsInTraining()) {
@ -2661,7 +2661,7 @@ void autoaimTick(void)
} }
} else if ((bmoveIsAutoAimYEnabledForCurrentWeapon() } else if ((bmoveIsAutoAimYEnabledForCurrentWeapon()
|| bmoveIsAutoAimXEnabledForCurrentWeapon() || bmoveIsAutoAimXEnabledForCurrentWeapon()
|| cangangsta) && !isclose) { || cangangsta) && !ismelee) {
// Standard auto aim // Standard auto aim
f32 bestthing = -1; f32 bestthing = -1;
struct prop *prop; struct prop *prop;

View File

@ -15654,7 +15654,7 @@ void objHit(struct shotdata *shotdata, struct hit *hit)
struct defaultobj *obj; struct defaultobj *obj;
struct coord sp110; struct coord sp110;
struct prop *prop; struct prop *prop;
u8 isclosefunc = false; u8 ismeleefunc = false;
s32 i; s32 i;
bool explosiveshells = false; bool explosiveshells = false;
bool spfc = hit->unk4c; bool spfc = hit->unk4c;
@ -15666,8 +15666,8 @@ void objHit(struct shotdata *shotdata, struct hit *hit)
s16 spdc[3]; s16 spdc[3];
if (func != NULL) { if (func != NULL) {
if ((func->type & 0xff) == INVENTORYFUNCTYPE_CLOSE) { if ((func->type & 0xff) == INVENTORYFUNCTYPE_MELEE) {
isclosefunc = true; ismeleefunc = true;
} }
if (func->flags & FUNCFLAG_EXPLOSIVESHELLS) { if (func->flags & FUNCFLAG_EXPLOSIVESHELLS) {
@ -15721,7 +15721,7 @@ void objHit(struct shotdata *shotdata, struct hit *hit)
} }
// Create sparks // Create sparks
if (!isclosefunc) { if (!ismeleefunc) {
if (chrIsUsingPaintball(g_Vars.currentplayer->prop->chr)) { if (chrIsUsingPaintball(g_Vars.currentplayer->prop->chr)) {
sparksCreate(prop->rooms[0], prop, &sp110, 0, 0, SPARKTYPE_PAINT); sparksCreate(prop->rooms[0], prop, &sp110, 0, 0, SPARKTYPE_PAINT);
} else { } else {
@ -15746,12 +15746,12 @@ void objHit(struct shotdata *shotdata, struct hit *hit)
// Play hit sound // Play hit sound
if (!spfc) { if (!spfc) {
bgunPlayGlassHitSound(&hit->prop->pos, hit->prop->rooms, hit->hitthing.texturenum); bgunPlayGlassHitSound(&hit->prop->pos, hit->prop->rooms, hit->hitthing.texturenum);
} else if (!isclosefunc) { } else if (!ismeleefunc) {
bgunPlayPropHitSound(&shotdata->gset, hit->prop, hit->hitthing.texturenum); bgunPlayPropHitSound(&shotdata->gset, hit->prop, hit->hitthing.texturenum);
} }
// Create wall hit (bullet hole) // Create wall hit (bullet hole)
if (!isclosefunc if (!ismeleefunc
&& hit->hitthing.texturenum != 10000 && hit->hitthing.texturenum != 10000
&& shotdata->gset.weaponnum != WEAPON_UNARMED && shotdata->gset.weaponnum != WEAPON_UNARMED
&& shotdata->gset.weaponnum != WEAPON_LASER && shotdata->gset.weaponnum != WEAPON_LASER

View File

@ -188,7 +188,7 @@ void sightTick(bool sighton)
newtracktype = SIGHTTRACKTYPE_THREATDETECTOR; newtracktype = SIGHTTRACKTYPE_THREATDETECTOR;
} }
if (func && (func->type & 0xff) == INVENTORYFUNCTYPE_CLOSE) { if (func && (func->type & 0xff) == INVENTORYFUNCTYPE_MELEE) {
newtracktype = SIGHTTRACKTYPE_NONE; newtracktype = SIGHTTRACKTYPE_NONE;
} }

View File

@ -1234,17 +1234,17 @@
#define HANDANIMMODE_IDLE 0 #define HANDANIMMODE_IDLE 0
#define HANDANIMMODE_BUSY 2 #define HANDANIMMODE_BUSY 2
#define HANDATTACKTYPE_SHOOT 1 #define HANDATTACKTYPE_SHOOT 1
#define HANDATTACKTYPE_SHOOTPROJECTILE 2 #define HANDATTACKTYPE_SHOOTPROJECTILE 2
#define HANDATTACKTYPE_THROWPROJECTILE 3 #define HANDATTACKTYPE_THROWPROJECTILE 3
#define HANDATTACKTYPE_CLOSERANGE 4 #define HANDATTACKTYPE_MELEE 4
#define HANDATTACKTYPE_DETONATE 5 #define HANDATTACKTYPE_DETONATE 5
#define HANDATTACKTYPE_BOOST 6 #define HANDATTACKTYPE_BOOST 6
#define HANDATTACKTYPE_REVERTBOOST 7 #define HANDATTACKTYPE_REVERTBOOST 7
#define HANDATTACKTYPE_CROUCH 8 #define HANDATTACKTYPE_CROUCH 8
#define HANDATTACKTYPE_RCP120CLOAK 9 #define HANDATTACKTYPE_RCP120CLOAK 9
#define HANDATTACKTYPE_CLOSERANGENOUNCLOAK 10 #define HANDATTACKTYPE_MELEENOUNCLOAK 10
#define HANDATTACKTYPE_UPLINK 12 #define HANDATTACKTYPE_UPLINK 12
#define HANDMODE_NONE 0 #define HANDMODE_NONE 0
#define HANDMODE_1 1 #define HANDMODE_1 1
@ -1416,7 +1416,7 @@
#define INVENTORYFUNCTYPE_SHOOT_PROJECTILE 0x0201 #define INVENTORYFUNCTYPE_SHOOT_PROJECTILE 0x0201
#define INVENTORYFUNCTYPE_0200 0x0200 #define INVENTORYFUNCTYPE_0200 0x0200
#define INVENTORYFUNCTYPE_THROW 0x0002 #define INVENTORYFUNCTYPE_THROW 0x0002
#define INVENTORYFUNCTYPE_CLOSE 0x0003 #define INVENTORYFUNCTYPE_MELEE 0x0003
#define INVENTORYFUNCTYPE_SPECIAL 0x0004 #define INVENTORYFUNCTYPE_SPECIAL 0x0004
#define INVENTORYFUNCTYPE_DEVICE 0x0005 #define INVENTORYFUNCTYPE_DEVICE 0x0005

View File

@ -41,7 +41,7 @@ bool bgun0f09aba4(struct hand *hand, struct handweaponinfo *info, s32 handnum, s
bool bgunTickIncAttackingShoot(struct handweaponinfo *info, s32 handnum, struct hand *hand); bool bgunTickIncAttackingShoot(struct handweaponinfo *info, s32 handnum, struct hand *hand);
bool bgunTickIncAttackingThrow(s32 handnum, struct hand *hand); bool bgunTickIncAttackingThrow(s32 handnum, struct hand *hand);
s32 bgunGetMinClipQty(s32 weaponnum, s32 funcnum); s32 bgunGetMinClipQty(s32 weaponnum, s32 funcnum);
bool bgunTickIncAttackingClose(s32 handnum, struct hand *hand); bool bgunTickIncAttackingMelee(s32 handnum, struct hand *hand);
bool bgunTickIncAttackingSpecial(struct hand *hand); bool bgunTickIncAttackingSpecial(struct hand *hand);
s32 bgunTickIncAttackEmpty(struct handweaponinfo *info, s32 handnum, struct hand *hand, s32 lvupdate); s32 bgunTickIncAttackEmpty(struct handweaponinfo *info, s32 handnum, struct hand *hand, s32 lvupdate);
s32 bgunTickIncAttack(struct handweaponinfo *info, s32 handnum, struct hand *hand, s32 lvupdate); s32 bgunTickIncAttack(struct handweaponinfo *info, s32 handnum, struct hand *hand, s32 lvupdate);

View File

@ -28,7 +28,7 @@ struct prop *shotCalculateHits(s32 handnum, bool arg1, struct coord *arg2, struc
struct prop *func0f061d54(s32 handnum, u32 arg1, u32 arg2); struct prop *func0f061d54(s32 handnum, u32 arg1, u32 arg2);
void shotCreate(s32 handnum, bool arg1, bool dorandom, s32 arg3, bool arg4); void shotCreate(s32 handnum, bool arg1, bool dorandom, s32 arg3, bool arg4);
void func0f061fa8(struct shotdata *shotdata, struct prop *prop, f32 arg2, s32 hitpart, struct modelnode *node, struct hitthing *hitthing, s32 arg6, struct modelnode *arg7, struct model *model, bool arg9, s32 arg10, struct coord *arg11, struct coord *arg12); void func0f061fa8(struct shotdata *shotdata, struct prop *prop, f32 arg2, s32 hitpart, struct modelnode *node, struct hitthing *hitthing, s32 arg6, struct modelnode *arg7, struct model *model, bool arg9, s32 arg10, struct coord *arg11, struct coord *arg12);
void handInflictCloseRangeDamage(s32 handnum, struct gset *gset, bool arg2); void handInflictMeleeDamage(s32 handnum, struct gset *gset, bool arg2);
void handTickAttack(s32 handnum); void handTickAttack(s32 handnum);
void handsTickAttack(void); void handsTickAttack(void);
void propExecuteTickOperation(struct prop *prop, s32 op); void propExecuteTickOperation(struct prop *prop, s32 op);

View File

@ -725,7 +725,7 @@ struct aibot {
/*0x048*/ s16 hillpadnum; /*0x048*/ s16 hillpadnum;
/*0x04a*/ s16 hillcovernum; /*0x04a*/ s16 hillcovernum;
/*0x04c*/ u8 unk04c_00 : 1; /*0x04c*/ u8 unk04c_00 : 1;
/*0x04c*/ u8 iscloserangeweapon : 1; /*0x04c*/ u8 ismeleeweapon : 1;
/*0x04c*/ u8 gunfunc : 1; /*0x04c*/ u8 gunfunc : 1;
/*0x04c*/ u8 unk04c_03 : 1; /*0x04c*/ u8 unk04c_03 : 1;
/*0x04c*/ u8 unk04c_04 : 1; /*0x04c*/ u8 unk04c_04 : 1;
@ -2976,7 +2976,7 @@ struct weaponfunc_throw {
/*0x20*/ f32 damage; /*0x20*/ f32 damage;
}; };
struct weaponfunc_close { struct weaponfunc_melee {
struct weaponfunc base; struct weaponfunc base;
/*0x14*/ f32 damage; /*0x14*/ f32 damage;
/*0x18*/ f32 range; /*0x18*/ f32 range;