From e55afd283f47d09a0d293895ccc3d7ae5140bc48 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Wed, 21 Aug 2024 23:25:18 +1000 Subject: [PATCH] Improve gun anim symbol names --- src/game/bondgun.c | 367 +++++++++++++++++++------------------ src/game/invitems.c | 244 ++++++++++++------------ src/game/prop.c | 2 +- src/include/constants.h | 27 ++- src/include/game/bondgun.h | 25 ++- src/include/gunscript.h | 12 +- src/include/types.h | 28 ++- 7 files changed, 367 insertions(+), 338 deletions(-) diff --git a/src/game/bondgun.c b/src/game/bondgun.c index d8175a8e2..606b631fb 100644 --- a/src/game/bondgun.c +++ b/src/game/bondgun.c @@ -579,7 +579,7 @@ void bgun_execute_gun_vis_commands(struct hand *hand, struct modeldef *modeldef, } } -void bgun0f098030(struct hand *hand, struct modeldef *modeldef) +void bgun_update_ammo_visibility(struct hand *hand, struct modeldef *modeldef) { struct weapon *weapon = weapon_find_by_id(hand->gset.weaponnum); s32 i; @@ -601,10 +601,10 @@ void bgun0f098030(struct hand *hand, struct modeldef *modeldef) } } -f32 bgun0f09815c(struct hand *hand) +f32 bgun_get_current_keyframe(struct hand *hand) { - if (hand->animmode == HANDANIMMODE_BUSY && hand->unk0ce8 != NULL) { - if (hand->unk0ce8->unk04 < 0) { + if (hand->animmode == HANDANIMMODE_BUSY && hand->animcmd != NULL) { + if (hand->animcmd->animparams < 0) { // if reverse animation return model_get_num_anim_frames(&hand->gunmodel) - model_get_cur_anim_frame(&hand->gunmodel); } @@ -614,14 +614,14 @@ f32 bgun0f09815c(struct hand *hand) return 0; } -void bgun0f0981e8(struct hand *hand, struct modeldef *modeldef) +void bgun_tick_anim(struct hand *hand, struct modeldef *modeldef) { #if VERSION >= VERSION_PAL_BETA - f32 s4; - f32 s2; + f32 oldkeyframe; + f32 newkeyframe; #else - s32 s2; - s32 s4; + s32 newkeyframe; + s32 oldkeyframe; #endif struct guncmd *cmd; f32 animspeed; @@ -630,12 +630,12 @@ void bgun0f0981e8(struct hand *hand, struct modeldef *modeldef) s32 partnums[15]; bool partsvisible[15]; s32 partframes[15]; - s32 s0; + s32 numparts; s32 index; - hand->unk0cc8_04 = false; + hand->ejectcount = 0; - if (hand->animmode == HANDANIMMODE_BUSY && bgun0f09815c(hand) >= model_get_num_anim_frames(&hand->gunmodel) - 1) { + if (hand->animmode == HANDANIMMODE_BUSY && bgun_get_current_keyframe(hand) >= model_get_num_anim_frames(&hand->gunmodel) - 1) { hand->animmode = HANDANIMMODE_IDLE; } @@ -651,13 +651,13 @@ void bgun0f0981e8(struct hand *hand, struct modeldef *modeldef) if (hand->animload >= 0) { animspeedmult = 1.0f; - animspeed = hand->unk0ce8->unk04 / 10000.0f; + animspeed = hand->animcmd->animparams / 10000.0f; if (hand->unk0d0e_07 && g_Vars.currentplayer->hands[HAND_LEFT].inuse) { animspeedmult = RANDOMFRAC() * 0.77f + 0.7f; } - if (hand->unk0ce8 && animspeed < 0.0f) { + if (hand->animcmd && animspeed < 0.0f) { model_set_animation(&hand->gunmodel, hand->animload, false, 0.0f, animspeedmult * animspeed, 0.0f); model_set_anim_frame(&hand->gunmodel, model_get_num_anim_frames(&hand->gunmodel)); } else { @@ -678,51 +678,55 @@ void bgun0f0981e8(struct hand *hand, struct modeldef *modeldef) #endif } - s4 = bgun0f09815c(hand); + oldkeyframe = bgun_get_current_keyframe(hand); #if VERSION >= VERSION_PAL_BETA - s2 = hand->animframeincfreal + s4; + newkeyframe = oldkeyframe + hand->animframeincfreal; #else - s2 = hand->animframeinc + s4; + newkeyframe = oldkeyframe + hand->animframeinc; #endif - if (s4 == 0 && s2 > 0) { - s4--; + if (oldkeyframe == 0 && newkeyframe > 0) { + oldkeyframe--; } - if (hand->unk0ce8) { + // This loop processes guncmds *prior* to incrementing the model's animation. + // Commands in this loop are able to adjust the keyframe in order to loop or pause a frame. + if (hand->animcmd) { done = false; - cmd = hand->unk0ce8; + cmd = hand->animcmd; if (cmd) { - s0 = 0; + numparts = 0; do { if (cmd->type == GUNCMD_END) { done = true; } else if (cmd->type == GUNCMD_SHOWPART || cmd->type == GUNCMD_HIDEPART) { - if (s2 >= cmd->unk02) { + if (newkeyframe >= cmd->keyframe) { s32 i; + + // Find in partnums list or append index = -1; - for (i = 0; i < s0; i++) { - if (cmd->unk04 == partnums[i]) { + for (i = 0; i < numparts; i++) { + if (cmd->partnum == partnums[i]) { index = i; } } if (index == -1) { - index = s0; - s0++; + index = numparts; + numparts++; if (1); - partnums[index] = cmd->unk04; + partnums[index] = cmd->partnum; partframes[index] = -1; } - if (cmd->unk02 > partframes[index]) { - partframes[index] = cmd->unk02; + if (cmd->keyframe > partframes[index]) { + partframes[index] = cmd->keyframe; partsvisible[index] = cmd->type == GUNCMD_SHOWPART ? true : false; } } @@ -730,9 +734,9 @@ void bgun0f0981e8(struct hand *hand, struct modeldef *modeldef) switch (cmd->type) { case GUNCMD_WAITFORZRELEASED: if (hand->unk0cc8_01) { - if (s2 >= cmd->unk02 && s4 < cmd->unk02 && s4 < s2) { + if (newkeyframe >= cmd->keyframe && oldkeyframe < cmd->keyframe && oldkeyframe < newkeyframe) { #if VERSION >= VERSION_PAL_BETA - f32 tmp = cmd->unk02 - bgun0f09815c(hand); + f32 tmp = cmd->keyframe - bgun_get_current_keyframe(hand); tmp /= 2; if (hand->animframeincfreal > tmp) { @@ -744,41 +748,41 @@ void bgun0f0981e8(struct hand *hand, struct modeldef *modeldef) hand->animframeincfreal = model_get_abs_anim_speed(&hand->gunmodel) * PALUPF(hand->animframeinc); } - s2 = hand->animframeincfreal + s4; + newkeyframe = oldkeyframe + hand->animframeincfreal; #else - s32 tmp = cmd->unk02 - (s32) bgun0f09815c(hand); + s32 tmp = cmd->keyframe - (s32) bgun_get_current_keyframe(hand); tmp /= 2; if (hand->animframeinc > tmp) { hand->animframeinc = tmp; } - s2 = hand->animframeinc + s4; + newkeyframe = oldkeyframe + hand->animframeinc; #endif } } break; case GUNCMD_REPEATUNTILFULL: - if (hand->incrementalreloading && s2 >= cmd->unk02 && s4 < cmd->unk02 && s4 < s2) { + if (hand->incrementalreloading && newkeyframe >= cmd->keyframe && oldkeyframe < cmd->keyframe && oldkeyframe < newkeyframe) { #if VERSION >= VERSION_PAL_BETA - f32 sp78 = s2; + f32 foundkeyframe = newkeyframe; - while (sp78 >= cmd->unk02) { - sp78 += cmd->unk04 - cmd->unk02; + while (foundkeyframe >= cmd->keyframe) { + foundkeyframe += cmd->gotokeyframe - cmd->keyframe; } - s4 = sp78; + oldkeyframe = foundkeyframe; hand->animframeinc = 0; hand->animframeincfreal = 0; #else - s32 sp78 = cmd->unk04 + (((s32)s2 - cmd->unk02) % ((cmd->unk02 - cmd->unk04) + 1)); - s4 = sp78; + s32 foundkeyframe = cmd->gotokeyframe + ((newkeyframe - cmd->keyframe) % ((cmd->keyframe - cmd->gotokeyframe) + 1)); + oldkeyframe = foundkeyframe; hand->animframeinc = 0; #endif - model_set_anim_frame(&hand->gunmodel, sp78); + model_set_anim_frame(&hand->gunmodel, foundkeyframe); hand->animloopcount++; - s2 = sp78; + newkeyframe = foundkeyframe; } break; } @@ -787,16 +791,17 @@ void bgun0f0981e8(struct hand *hand, struct modeldef *modeldef) cmd++; } while (!done); - if (s0 > 0) { + if (numparts > 0) { s32 i; - for (i = 0; i < s0; i++) { + for (i = 0; i < numparts; i++) { bgun_set_part_visible(partnums[i], partsvisible[i], hand, modeldef); } } } } + // Apply the keyframe to the model #if VERSION >= VERSION_PAL_BETA model_set_anim_play_speed(&hand->gunmodel, PALUPF(4.0f), 0); model_tick_anim_quarter_speed(&hand->gunmodel, hand->animframeinc, true); @@ -804,11 +809,12 @@ void bgun0f0981e8(struct hand *hand, struct modeldef *modeldef) model_tick_anim(&hand->gunmodel, hand->animframeinc, true); #endif - s2 = bgun0f09815c(hand); + // Run post-anim gun commands + newkeyframe = bgun_get_current_keyframe(hand); - if (hand->unk0ce8) { + if (hand->animcmd) { bool done = false; - struct guncmd *cmd = hand->unk0ce8; + struct guncmd *cmd = hand->animcmd; f32 speed = 1.0f; bool hasspeed = false; #if VERSION < VERSION_NTSC_1_0 @@ -820,18 +826,18 @@ void bgun0f0981e8(struct hand *hand, struct modeldef *modeldef) if (cmd->type == GUNCMD_END) { done = true; } else { - if (s2 >= cmd->unk02 && s4 < cmd->unk02 && s4 < s2) { + if (newkeyframe >= cmd->keyframe && oldkeyframe < cmd->keyframe && oldkeyframe < newkeyframe) { switch (cmd->type) { case GUNCMD_PLAYSOUND: #if VERSION >= VERSION_NTSC_1_0 if (hasspeed) { - snd00010718(0, 0, AL_VOL_FULL, AL_PAN_CENTER, cmd->unk04, speed, 1, -1, 1); + snd00010718(0, 0, AL_VOL_FULL, AL_PAN_CENTER, cmd->soundnum, speed, 1, -1, 1); hasspeed = false; } else { - snd00010718(0, 0, AL_VOL_FULL, AL_PAN_CENTER, cmd->unk04, 1.0f, 1, -1, 1); + snd00010718(0, 0, AL_VOL_FULL, AL_PAN_CENTER, cmd->soundnum, 1.0f, 1, -1, 1); } #else - audiohandle = snd_start(var80095200, cmd->unk04, NULL, -1, -1, -1, -1, -1); + audiohandle = snd_start(var80095200, cmd->soundnum, NULL, -1, -1, -1, -1, -1); if (hasspeed && audiohandle) { hasspeed = false; @@ -840,11 +846,11 @@ void bgun0f0981e8(struct hand *hand, struct modeldef *modeldef) #endif break; case GUNCMD_SETSOUNDSPEED: - speed = cmd->unk04 / 1000.0f; + speed = cmd->soundspeed / 1000.0f; hasspeed = true; break; case GUNCMD_POPOUTSACKOFPILLS: - hand->unk0cc8_04++; + hand->ejectcount++; break; } } @@ -857,19 +863,19 @@ void bgun0f0981e8(struct hand *hand, struct modeldef *modeldef) } } -bool bgun0f098884(struct guncmd *cmd, struct gset *gset) +bool bgun_test_condition(struct guncmd *cmd, struct gset *gset) { s32 result = false; - if (cmd->unk01 == 0) { + if (cmd->condition == 0) { return true; } - if (cmd->unk01 == 1 && g_Vars.currentplayer->hands[HAND_LEFT].inuse == true) { + if (cmd->condition == 1 && g_Vars.currentplayer->hands[HAND_LEFT].inuse == true) { result = true; } - if (cmd->unk01 == 2 && gset->weaponfunc == FUNC_SECONDARY) { + if (cmd->condition == 2 && gset->weaponfunc == FUNC_SECONDARY) { result = true; } @@ -884,14 +890,14 @@ void bgun_start_animation(struct guncmd *cmd, s32 handnum, struct hand *hand) u32 rand = random() % 100; while (loopcmd->type != GUNCMD_END) { - if (bgun0f098884(loopcmd, &hand->gset) && !done) { + if (bgun_test_condition(loopcmd, &hand->gset) && !done) { if (loopcmd->type == GUNCMD_INCLUDE) { done = true; - bgun_start_animation((struct guncmd *)loopcmd->unk04, handnum, hand); + bgun_start_animation(loopcmd->targetcmd, handnum, hand); } else if (loopcmd->type == GUNCMD_RANDOM) { - if ((struct guncmd *)loopcmd->unk04 != hand->unk0d80 && loopcmd->unk02 > rand) { + if (loopcmd->targetcmd != hand->animcmd2 && rand < loopcmd->probability) { done = true; - bgun_start_animation((struct guncmd *)loopcmd->unk04, handnum, hand); + bgun_start_animation(loopcmd->targetcmd, handnum, hand); } } } @@ -899,62 +905,62 @@ void bgun_start_animation(struct guncmd *cmd, s32 handnum, struct hand *hand) loopcmd++; } } else { - hand->animload = cmd->unk02; + hand->animload = cmd->animnum; hand->animmode = HANDANIMMODE_IDLE; hand->unk0cc8_01 = 0; hand->incrementalreloading = false; - hand->unk0ce8 = cmd; + hand->animcmd = cmd; hand->animloopcount = 0; - hand->unk0cc8_02 = 0; + hand->unk0cc8_02 = false; hand->unk0d0e_07 = false; - hand->unk0d80 = cmd; + hand->animcmd2 = cmd; } } -bool bgun0f098a44(struct hand *hand, s32 time) +bool bgun_anim_allows_feature(struct hand *hand, s32 feature) { - struct guncmd *cmd = hand->unk0ce8; - s32 waittimekeyframe = -1; + struct guncmd *cmd = hand->animcmd; + s32 allowkeyframe = -1; s32 zreleasekeyframe = -1; if (hand->animmode == HANDANIMMODE_IDLE) { return (hand->animload == -1); } - while (cmd->type != GUNCMD_END && waittimekeyframe == -1) { + while (cmd->type != GUNCMD_END && allowkeyframe == -1) { if (cmd->type == GUNCMD_WAITFORZRELEASED) { - zreleasekeyframe = cmd->unk02; + zreleasekeyframe = cmd->keyframe; } - if (cmd->type == GUNCMD_WAITTIME && time == cmd->unk04) { - waittimekeyframe = cmd->unk02; + if (cmd->type == GUNCMD_ALLOWFEATURE && cmd->feature == feature) { + allowkeyframe = cmd->keyframe; } cmd++; } - if (waittimekeyframe >= 0) { + if (allowkeyframe >= 0) { #if VERSION >= VERSION_PAL_BETA - if (hand->unk0cc8_01 && bgun0f09815c(hand) <= zreleasekeyframe) { + if (hand->unk0cc8_01 && bgun_get_current_keyframe(hand) <= zreleasekeyframe) { return false; } - return (bgun0f09815c(hand) + hand->animframeincfreal >= waittimekeyframe); + return (bgun_get_current_keyframe(hand) + hand->animframeincfreal >= allowkeyframe); #else - if (hand->unk0cc8_01 && (s32)bgun0f09815c(hand) <= zreleasekeyframe) { + if (hand->unk0cc8_01 && (s32)bgun_get_current_keyframe(hand) <= zreleasekeyframe) { return false; } - return (bgun0f09815c(hand) + hand->animframeinc >= waittimekeyframe); + return (bgun_get_current_keyframe(hand) + hand->animframeinc >= allowkeyframe); #endif } return true; } -s32 bgun0f098b80(struct hand *hand, s32 arg1) +s32 bgun_find_allowfeature(struct hand *hand, s32 feature) { - struct guncmd *cmd = hand->unk0ce8; + struct guncmd *cmd = hand->animcmd; s32 keyframe = -1; if (hand->animmode == HANDANIMMODE_IDLE) { @@ -962,10 +968,8 @@ s32 bgun0f098b80(struct hand *hand, s32 arg1) } while (cmd->type != GUNCMD_END && keyframe == -1) { - if (cmd->type == GUNCMD_WAITTIME) { - if (cmd->unk04 == arg1) { - keyframe = cmd->unk02; - } + if (cmd->type == GUNCMD_ALLOWFEATURE && cmd->feature == feature) { + keyframe = cmd->keyframe; } cmd++; @@ -989,7 +993,7 @@ void bgun_reset_anim(struct hand *hand) hand->animmode = HANDANIMMODE_IDLE; hand->unk0cc8_01 = false; hand->incrementalreloading = false; - hand->unk0ce8 = NULL; + hand->animcmd = NULL; hand->animloopcount = 0; hand->unk0cc8_02 = false; hand->unk0d0e_07 = false; @@ -1012,20 +1016,19 @@ void bgun_get_weapon_info(struct handweaponinfo *info, s32 handnum) * 2 = has ammo in clip but none in reserve * 3 = gun doesn't use ammo or clip is full */ -s32 bgun0f098ca0(s32 funcnum, struct handweaponinfo *info, struct hand *hand) +s32 bgun_get_ammo_state(s32 funcnum, struct handweaponinfo *info, struct hand *hand) { - s32 result = 3; + s32 state = GUNAMMOSTATE_CLIPFULL; struct weaponfunc *func = weapon_get_function(&hand->gset, funcnum); if (!func) { - return -1; + return GUNAMMOSTATE_DEPLETED; } if (func->ammoindex != -1) { s32 ammoindex = func->ammoindex; - if (info->gunctrl->ammotypes[ammoindex] >= 0 - && hand->loadedammo[ammoindex] < hand->clipsizes[ammoindex]) { + if (info->gunctrl->ammotypes[ammoindex] >= 0 && hand->loadedammo[ammoindex] < hand->clipsizes[ammoindex]) { s32 minqty = 1; if (info->weaponnum == WEAPON_SHOTGUN && funcnum == FUNC_SECONDARY) { @@ -1036,23 +1039,23 @@ s32 bgun0f098ca0(s32 funcnum, struct handweaponinfo *info, struct hand *hand) minqty = bgun_get_min_clip_qty(WEAPON_TRANQUILIZER, FUNC_SECONDARY); } - result = 1; + state = GUNAMMOSTATE_CLIPYES_HELDYES; if (hand->loadedammo[ammoindex] < minqty) { - result = 0; + state = GUNAMMOSTATE_NEEDRELOAD; if (g_Vars.currentplayer->ammoheldarr[info->gunctrl->ammotypes[ammoindex]] == 0) { - result = -1; + state = GUNAMMOSTATE_DEPLETED; } } else { if (g_Vars.currentplayer->ammoheldarr[info->gunctrl->ammotypes[ammoindex]] == 0) { - result = 2; + state = GUNAMMOSTATE_CLIPYES_HELDNO; } } } } - return result; + return state; } void bgun0f098df8(s32 weaponfunc, struct handweaponinfo *info, struct hand *hand, u8 onebullet, u8 checkunequipped) @@ -1119,17 +1122,17 @@ void bgun0f098f8c(struct handweaponinfo *info, struct hand *hand) } } -bool bgun0f099008(s32 handnum) +bool bgun_clip_has_ammo(s32 handnum) { struct handweaponinfo info; bgun_get_weapon_info(&info, handnum); - if (bgun0f098ca0(0, &info, &g_Vars.currentplayer->hands[handnum]) > 0) { + if (bgun_get_ammo_state(FUNC_PRIMARY, &info, &g_Vars.currentplayer->hands[handnum]) > GUNAMMOSTATE_NEEDRELOAD) { return true; } - if (bgun0f098ca0(1, &info, &g_Vars.currentplayer->hands[handnum]) > 0) { + if (bgun_get_ammo_state(FUNC_SECONDARY, &info, &g_Vars.currentplayer->hands[handnum]) > GUNAMMOSTATE_NEEDRELOAD) { return true; } @@ -1191,8 +1194,8 @@ s32 bgun_tick_inc_idle(struct handweaponinfo *info, s32 handnum, struct hand *ha { bool usesec; s32 gunfunc = bgun_is_using_secondary_function(); - s32 sp34; - s32 sp30; + s32 ammostate; + s32 ammostate2; bool changefunc; s32 next; struct hand *lhand; @@ -1217,18 +1220,18 @@ s32 bgun_tick_inc_idle(struct handweaponinfo *info, s32 handnum, struct hand *ha hand->unk0cc8_08 = false; if (hand->inuse) { - sp34 = bgun0f098ca0(hand->gset.weaponfunc, info, hand); + ammostate = bgun_get_ammo_state(hand->gset.weaponfunc, info, hand); // Handle changing gun function if (gunfunc != hand->gset.weaponfunc && hand->modenext != HANDMODE_RELOAD) { changefunc = true; - if (hand->unk0cc8_07 && bgun0f098ca0(1 - hand->gset.weaponfunc, info, hand) < 0) { + if (hand->unk0cc8_07 && bgun_get_ammo_state(1 - hand->gset.weaponfunc, info, hand) < 0) { changefunc = false; } if (changefunc && info->weaponnum == WEAPON_COMBATKNIFE) { - if (sp34 == 0) { + if (ammostate == GUNAMMOSTATE_NEEDRELOAD) { hand->count60 = 0; hand->count = 0; hand->gset.weaponfunc = gunfunc; @@ -1237,7 +1240,7 @@ s32 bgun_tick_inc_idle(struct handweaponinfo *info, s32 handnum, struct hand *ha return lvupdate; } } else { - if (sp34 < 0) { + if (ammostate <= GUNAMMOSTATE_DEPLETED) { changefunc = false; } } @@ -1252,7 +1255,7 @@ s32 bgun_tick_inc_idle(struct handweaponinfo *info, s32 handnum, struct hand *ha } } - if (sp34 < 0) { + if (ammostate <= GUNAMMOSTATE_DEPLETED) { // Attempted to shoot with no ammo // Consider switching to another weapon @@ -1266,26 +1269,24 @@ s32 bgun_tick_inc_idle(struct handweaponinfo *info, s32 handnum, struct hand *ha usesec = FUNCISSEC(); if (usesec == gunfunc) { - sp30 = bgun0f098ca0(1 - hand->gset.weaponfunc, info, hand); + ammostate2 = bgun_get_ammo_state(1 - hand->gset.weaponfunc, info, hand); - if (bgun0f099188(hand, 1 - hand->gset.weaponfunc) - && info->weaponnum != WEAPON_REAPER) { + if (bgun0f099188(hand, 1 - hand->gset.weaponfunc) && info->weaponnum != WEAPON_REAPER) { if (info->gunctrl->wantammo) { func = weapon_get_function(&hand->gset, 1 - hand->gset.weaponfunc); if ((func->type & 0xff) != INVENTORYFUNCTYPE_MELEE) { - sp30 = -1; + ammostate2 = GUNAMMOSTATE_DEPLETED; } } else { - sp30 = -1; + ammostate2 = GUNAMMOSTATE_DEPLETED; } } - if (sp30 < 0) { + if (ammostate2 <= GUNAMMOSTATE_DEPLETED) { hand->unk0cc8_08 = true; } else { - if (!weapon_has_flag(info->weaponnum, WEAPONFLAG_04000000) - || hand->gset.weaponfunc == FUNC_SECONDARY) { + if (!weapon_has_flag(info->weaponnum, WEAPONFLAG_KEEPFUNCWHENEMPTY) || hand->gset.weaponfunc == FUNC_SECONDARY) { hand->unk0cc8_07 = true; if (bgun_set_state(handnum, HANDSTATE_CHANGEFUNC)) { @@ -1294,7 +1295,7 @@ s32 bgun_tick_inc_idle(struct handweaponinfo *info, s32 handnum, struct hand *ha } } } - } else if (sp34 == 0) { + } else if (ammostate == GUNAMMOSTATE_NEEDRELOAD) { // Clip is empty if (hand->triggeron && info->weaponnum != WEAPON_NONE) { hand->unk0cc8_01 = false; @@ -1338,7 +1339,7 @@ s32 bgun_tick_inc_idle(struct handweaponinfo *info, s32 handnum, struct hand *ha hand->count = 0; hand->modenext = HANDMODE_NONE; - if (next == HANDMODE_RELOAD && sp34 < 2 && sp34 >= 0) { + if (next == HANDMODE_RELOAD && ammostate < GUNAMMOSTATE_CLIPYES_HELDNO && ammostate >= GUNAMMOSTATE_NEEDRELOAD) { if (bgun_set_state(handnum, HANDSTATE_RELOAD)) { if (handnum && handnum && handnum); return lvupdate; @@ -1378,10 +1379,10 @@ void bgun_set_arm_pitch(struct hand *hand, f32 angle) hand->posrotmtx.m[3][2] = sinf(angle) * 15.0f; } -s32 bgun_tick_inc_auto_switch(struct handweaponinfo *info, s32 handnum, struct hand *hand, s32 lvupdate) +s32 bgun_tick_inc_autoswitch(struct handweaponinfo *info, s32 handnum, struct hand *hand, s32 lvupdate) { u32 stack; - s32 someval; + s32 ammostate; s32 gunfunc = bgun_is_using_secondary_function(); if (!hand->inuse && bgun_set_state(handnum, HANDSTATE_IDLE)) { @@ -1423,7 +1424,7 @@ s32 bgun_tick_inc_auto_switch(struct handweaponinfo *info, s32 handnum, struct h } if (hand->inuse) { - someval = bgun0f098ca0(gunfunc, info, hand); + ammostate = bgun_get_ammo_state(gunfunc, info, hand); if (info->weaponnum == WEAPON_TIMEDMINE || info->weaponnum == WEAPON_PROXIMITYMINE) { hand->gset.weaponfunc = gunfunc; @@ -1443,11 +1444,11 @@ s32 bgun_tick_inc_auto_switch(struct handweaponinfo *info, s32 handnum, struct h bgun_get_weapon_info(&otherinfo, 1 - handnum); if (otherhand->inuse) { - if (bgun0f098ca0(0, &otherinfo, otherhand) >= 0) { + if (bgun_get_ammo_state(FUNC_PRIMARY, &otherinfo, otherhand) > GUNAMMOSTATE_DEPLETED) { ready = false; } - if (bgun0f098ca0(1, &otherinfo, otherhand) >= 0) { + if (bgun_get_ammo_state(FUNC_SECONDARY, &otherinfo, otherhand) > GUNAMMOSTATE_DEPLETED) { ready = false; } @@ -1465,7 +1466,7 @@ s32 bgun_tick_inc_auto_switch(struct handweaponinfo *info, s32 handnum, struct h } } - if (someval <= 1 && someval >= 0) { + if (ammostate <= GUNAMMOSTATE_CLIPYES_HELDYES && ammostate >= GUNAMMOSTATE_NEEDRELOAD) { if (g_Vars.currentplayer->hands[1 - handnum].state != HANDSTATE_RELOAD) { hand->count60 = 0; hand->count = 0; @@ -1571,19 +1572,21 @@ s32 bgun_tick_inc_reload(struct handweaponinfo *info, s32 handnum, struct hand * } } else { if (info->definition->ammos[func->ammoindex]->flags & AMMOFLAG_INCREMENTALRELOAD) { - if (bgun0f098a44(hand, 1)) { + if (bgun_anim_allows_feature(hand, GUNFEATURE_RELOAD)) { if ((hand->stateflags & HANDSTATEFLAG_BUSY) == 0) { - s32 value; + s32 ammostate; bgun0f098df8(hand->gset.weaponfunc, info, hand, 1, 0); - hand->stateflags |= HANDSTATEFLAG_BUSY; - value = bgun0f098ca0(hand->gset.weaponfunc, info, hand); - if (value >= 2) { + hand->stateflags |= HANDSTATEFLAG_BUSY; + + ammostate = bgun_get_ammo_state(hand->gset.weaponfunc, info, hand); + + if (ammostate >= GUNAMMOSTATE_CLIPYES_HELDNO) { hand->incrementalreloading = false; } - if (value == -1) { + if (ammostate == GUNAMMOSTATE_DEPLETED) { hand->incrementalreloading = false; } } @@ -1602,7 +1605,7 @@ s32 bgun_tick_inc_reload(struct handweaponinfo *info, s32 handnum, struct hand * #endif } else { if ((hand->stateflags & HANDSTATEFLAG_BUSY) == 0) { - if (bgun0f098a44(hand, 1)) { + if (bgun_anim_allows_feature(hand, GUNFEATURE_RELOAD)) { bgun0f098df8(hand->gset.weaponfunc, info, hand, 0, 0); hand->stateflags |= HANDSTATEFLAG_BUSY; } @@ -1710,7 +1713,7 @@ s32 bgun_tick_inc_reload(struct handweaponinfo *info, s32 handnum, struct hand * return 0; } -s32 bgun_tick_inc_change_func(struct handweaponinfo *info, s32 handnum, struct hand *hand, s32 lvupdate) +s32 bgun_tick_inc_changefunc(struct handweaponinfo *info, s32 handnum, struct hand *hand, s32 lvupdate) { struct guncmd *cmd; bool more = false; @@ -2190,7 +2193,7 @@ bool bgun_tick_inc_attacking_shoot(struct handweaponinfo *info, s32 handnum, str hand->burstbullets = 0; } - if (!bgun0f098a44(hand, 2)) { + if (!bgun_anim_allows_feature(hand, GUNFEATURE_ATTACK)) { sp64 = 0; } @@ -2295,7 +2298,7 @@ bool bgun_tick_inc_attacking_throw(s32 handnum, struct hand *hand) hand->unk0cc8_01 = false; } - if (bgun0f098a44(hand, 2)) { + if (bgun_anim_allows_feature(hand, GUNFEATURE_ATTACK)) { hand->stateminor = HANDSTATEMINOR_ATTACK_THROW_1; hand->unk0cc8_01 = false; } @@ -2422,7 +2425,7 @@ bool bgun_tick_inc_attacking_melee(s32 handnum, struct hand *hand) hand->unk0cc8_01 = false; } - if (bgun0f098a44(hand, 2)) { + if (bgun_anim_allows_feature(hand, GUNFEATURE_ATTACK)) { hand->stateminor = HANDSTATEMINOR_ATTACK_MELEE_1; hand->unk0cc8_01 = false; } @@ -2431,7 +2434,7 @@ bool bgun_tick_inc_attacking_melee(s32 handnum, struct hand *hand) } } - if (hand->stateminor == HANDSTATEMINOR_ATTACK_MELEE_3 && bgun0f098a44(hand, 3)) { + if (hand->stateminor == HANDSTATEMINOR_ATTACK_MELEE_3 && bgun_anim_allows_feature(hand, GUNFEATURE_ATTACKAGAIN)) { hand->stateminor = HANDSTATEMINOR_ATTACK_MELEE_1; hand->unk0cc8_01 = false; } @@ -2449,7 +2452,7 @@ bool bgun_tick_inc_attacking_melee(s32 handnum, struct hand *hand) } if (func->fire_animation) { - if (func->fire_animation && !bgun0f098a44(hand, 3)) { + if (func->fire_animation && !bgun_anim_allows_feature(hand, GUNFEATURE_ATTACKAGAIN)) { hand->stateminor = HANDSTATEMINOR_ATTACK_MELEE_3; } else { hand->stateminor = HANDSTATEMINOR_ATTACK_MELEE_2; @@ -2517,7 +2520,7 @@ bool bgun_tick_inc_attacking_special(struct hand *hand) return false; } -s32 bgun_tick_inc_attack_empty(struct handweaponinfo *info, s32 handnum, struct hand *hand, s32 lvupdate) +s32 bgun_tick_inc_attackempty(struct handweaponinfo *info, s32 handnum, struct hand *hand, s32 lvupdate) { u32 stack; bool playsound = false; @@ -2567,7 +2570,7 @@ s32 bgun_tick_inc_attack_empty(struct handweaponinfo *info, s32 handnum, struct if (!restartedanim && hand->stateframes > TICKS(25)) { playsound = true; } - } else if (bgun0f098a44(hand, 5)) { + } else if (bgun_anim_allows_feature(hand, GUNFEATURE_CLICK)) { playsound = true; } break; @@ -2814,7 +2817,7 @@ bool bgun0f09bf44(s32 handnum) return result; } -s32 bgun_tick_inc_change_gun(struct handweaponinfo *info, s32 handnum, struct hand *hand, s32 lvupdate) +s32 bgun_tick_inc_changegun(struct handweaponinfo *info, s32 handnum, struct hand *hand, s32 lvupdate) { u32 stack; struct weapon *weapon = info->definition; @@ -2834,7 +2837,7 @@ s32 bgun_tick_inc_change_gun(struct handweaponinfo *info, s32 handnum, struct ha if (weapon_has_flag(info->weaponnum, WEAPONFLAG_THROWABLE) && !(info->weaponnum == WEAPON_REMOTEMINE && handnum == HAND_LEFT) - && bgun0f098ca0(0, info, hand) < 0) { + && bgun_get_ammo_state(FUNC_PRIMARY, info, hand) <= GUNAMMOSTATE_DEPLETED) { skipanim = true; } @@ -2977,7 +2980,7 @@ s32 bgun_tick_inc_change_gun(struct handweaponinfo *info, s32 handnum, struct ha if (weapon_has_flag(info->weaponnum, WEAPONFLAG_THROWABLE) && (info->weaponnum != WEAPON_REMOTEMINE || handnum != HAND_LEFT) - && bgun0f098ca0(0, info, hand) < 0 + && bgun_get_ammo_state(FUNC_PRIMARY, info, hand) <= GUNAMMOSTATE_DEPLETED && bgun_set_state(handnum, HANDSTATE_AUTOSWITCH)) { hand->stateminor = HANDSTATEMINOR_AUTOSWITCH_DELETE; return lvupdate; @@ -3201,16 +3204,16 @@ s32 bgun_tick_inc(struct handweaponinfo *info, s32 handnum, s32 lvupdate) result = bgun_tick_inc_state2(info, handnum, hand, lvupdate); break; case HANDSTATE_CHANGEGUN: - result = bgun_tick_inc_change_gun(info, handnum, hand, lvupdate); + result = bgun_tick_inc_changegun(info, handnum, hand, lvupdate); break; case HANDSTATE_ATTACKEMPTY: - result = bgun_tick_inc_attack_empty(info, handnum, hand, lvupdate); + result = bgun_tick_inc_attackempty(info, handnum, hand, lvupdate); break; case HANDSTATE_AUTOSWITCH: - result = bgun_tick_inc_auto_switch(info, handnum, hand, lvupdate); + result = bgun_tick_inc_autoswitch(info, handnum, hand, lvupdate); break; case HANDSTATE_CHANGEFUNC: - result = bgun_tick_inc_change_func(info, handnum, hand, lvupdate); + result = bgun_tick_inc_changefunc(info, handnum, hand, lvupdate); break; } @@ -4156,7 +4159,7 @@ void bgun_tick_master_load(void) model_init(&hand->handmodel, player->gunctrl.handmodeldef, hand->handsavedata, false); } - hand->unk0dcc = (s32 *) player->gunctrl.memloadptr; + hand->compiledgunmodelcmds = (s32 *) player->gunctrl.memloadptr; value = bgun_create_model_cmd_list(&hand->gunmodel, player->gunctrl.gunmodeldef->rootnode, (s32 *) player->gunctrl.memloadptr); @@ -4165,7 +4168,7 @@ void bgun_tick_master_load(void) player->gunctrl.memloadremaining -= value; if (player->gunctrl.handmodeldef != 0) { - hand->unk0dd0 = (s32 *) player->gunctrl.memloadptr; + hand->compiledhandmodelcmds = (s32 *) player->gunctrl.memloadptr; value = bgun_create_model_cmd_list(&hand->handmodel, player->gunctrl.handmodeldef->rootnode, (s32 *) player->gunctrl.memloadptr); @@ -5042,14 +5045,14 @@ void bgun_swivel(f32 screenx, f32 screeny, f32 crossdamp, f32 aimdamp) // recentre until the reload animation is almost complete if (!player->hands[HAND_LEFT].inuse && player->hands[HAND_RIGHT].state == HANDSTATE_RELOAD - && player->hands[HAND_RIGHT].unk0ce8) { + && player->hands[HAND_RIGHT].animcmd) { numframes = 25; if (player->hands[HAND_RIGHT].gset.weaponnum == WEAPON_CROSSBOW) { numframes = 5; } - if ((s32)bgun0f09815c(&player->hands[HAND_RIGHT]) < model_get_num_anim_frames(&player->hands[HAND_RIGHT].gunmodel) - numframes) { + if ((s32)bgun_get_current_keyframe(&player->hands[HAND_RIGHT]) < model_get_num_anim_frames(&player->hands[HAND_RIGHT].gunmodel) - numframes) { x[HAND_RIGHT] = 0.0f; y[HAND_RIGHT] = 0.0f; ignore[HAND_RIGHT] = true; @@ -6051,7 +6054,7 @@ void bgun_update_slide(s32 handnum) player->hands[handnum].slideinc = false; } } else if (player->hands[handnum].loadedammo[FUNC_PRIMARY] > 0) { - if (bgun0f098a44(&player->hands[handnum], 3)) { + if (bgun_anim_allows_feature(&player->hands[handnum], GUNFEATURE_ATTACKAGAIN)) { // Slide is moving forwards if (player->hands[handnum].slidetrans > 0.0f) { player->hands[handnum].slidetrans -= slidemax * 0.16666667f * g_Vars.lvupdate60freal; @@ -6151,23 +6154,28 @@ void bgun0f0a256c(s32 mtxindex, Mtxf *mtx) } } -bool bgun0f0a27c8(void) +bool bgun_allows_fullscreen_autoaim(void) { struct hand *hand; struct weaponfunc *func; + // Right hand hand = &g_Vars.currentplayer->hands[HAND_RIGHT]; - func = gset_get_weapon_function2(&hand->gset); - if (func - && (func->type & 0xff) == INVENTORYFUNCTYPE_MELEE - && hand->state == HANDSTATE_ATTACK - && hand->unk0ce8 != NULL - && hand->animmode == HANDANIMMODE_BUSY - && !bgun0f098a44(hand, 2)) { - return true; + if (1) { + func = gset_get_weapon_function2(&hand->gset); + + if (func + && (func->type & 0xff) == INVENTORYFUNCTYPE_MELEE + && hand->state == HANDSTATE_ATTACK + && hand->animcmd != NULL + && hand->animmode == HANDANIMMODE_BUSY + && !bgun_anim_allows_feature(hand, GUNFEATURE_ATTACK)) { + return true; + } } + // Left hand hand = &g_Vars.currentplayer->hands[HAND_LEFT]; if (hand->inuse) { @@ -6176,9 +6184,9 @@ bool bgun0f0a27c8(void) if (func && (func->type & 0xff) == INVENTORYFUNCTYPE_MELEE && hand->state == HANDSTATE_ATTACK - && hand->unk0ce8 != NULL + && hand->animcmd != NULL && hand->animmode == HANDANIMMODE_BUSY - && !bgun0f098a44(hand, 2)) { + && !bgun_anim_allows_feature(hand, GUNFEATURE_ATTACK)) { return true; } } @@ -6187,11 +6195,11 @@ bool bgun0f0a27c8(void) } /** - * This function is the same as above but it doesn't call bgun0f098a44(). + * This function is the same as above but it doesn't call bgun_anim_allows_feature(). * * This function is unused. */ -bool bgun0f0a28d8(void) +bool bgun_allows_fullscreen_autoaim2(void) { struct hand *hand; struct weaponfunc *func; @@ -6202,7 +6210,7 @@ bool bgun0f0a28d8(void) if (func && (func->type & 0xff) == INVENTORYFUNCTYPE_MELEE && hand->state == HANDSTATE_ATTACK - && hand->unk0ce8 != NULL + && hand->animcmd != NULL && hand->animmode == HANDANIMMODE_BUSY) { return true; } @@ -6215,7 +6223,7 @@ bool bgun0f0a28d8(void) if (func && (func->type & 0xff) == INVENTORYFUNCTYPE_MELEE && hand->state == HANDSTATE_ATTACK - && hand->unk0ce8 != NULL + && hand->animcmd != NULL && hand->animmode == HANDANIMMODE_BUSY) { return true; } @@ -7111,13 +7119,13 @@ void bgun_update_laser(struct hand *hand) /** * Create ammo casing so they can be ejected during reload. */ -void bgun_update_magnum(struct hand *hand, s32 handnum, struct modeldef *modeldef, Mtxf *mtx) +void bgun_eject_magnum_casings(struct hand *hand, s32 handnum, struct modeldef *modeldef, Mtxf *mtx) { f32 ground = g_Vars.currentplayer->vv_ground; s32 i; if (modeldef != NULL) { - for (i = 0; i < hand->unk0cc8_04; i++) { + for (i = 0; i < hand->ejectcount; i++) { struct modelnode *node = model_get_part(modeldef, 0x0a + random() % 6); if (node) { @@ -7609,23 +7617,23 @@ void bgun0f0a5550(s32 handnum) modeldef = player->gunctrl.gunmodeldef; mtxallocation = gfx_allocate(modeldef->nummatrices * sizeof(Mtxf)); - if (weapon_has_flag(weaponnum, WEAPONFLAG_02000000)) { + if (weapon_has_flag(weaponnum, WEAPONFLAG_RESETMATRICES)) { for (i = 0; i < modeldef->nummatrices; i++) { mtx = (Mtxf *)(mtxallocation + i * sizeof(Mtxf)); mtx4_load_identity(mtx); } } - bgun_execute_model_cmd_list(hand->unk0dcc); + bgun_execute_model_cmd_list(hand->compiledgunmodelcmds); if (player->gunctrl.handmodeldef != NULL) { - bgun_execute_model_cmd_list(hand->unk0dd0); + bgun_execute_model_cmd_list(hand->compiledhandmodelcmds); } - bgun0f098030(hand, modeldef); + bgun_update_ammo_visibility(hand, modeldef); - if (weapon_has_flag(weaponnum, WEAPONFLAG_00002000)) { - bgun0f0981e8(hand, modeldef); + if (weapon_has_flag(weaponnum, WEAPONFLAG_HASGUNSCRIPT)) { + bgun_tick_anim(hand, modeldef); } } @@ -7707,7 +7715,7 @@ void bgun0f0a5550(s32 handnum) mtx4_copy(&sp2c4, (Mtxf *)mtxallocation); - if (hand->unk0cc8_04 > 0) { + if (hand->ejectcount > 0) { switch (weaponnum) { case WEAPON_GRENADE: case WEAPON_NBOMB: @@ -8001,8 +8009,8 @@ void bgun0f0a5550(s32 handnum) break; case WEAPON_DY357MAGNUM: case WEAPON_DY357LX: - if (hand->unk0cc8_04 > 0) { - bgun_update_magnum(hand, handnum, modeldef, (Mtxf *)mtxallocation); + if (hand->ejectcount > 0) { + bgun_eject_magnum_casings(hand, handnum, modeldef, (Mtxf *)mtxallocation); } break; } @@ -10922,7 +10930,7 @@ void bgun_render(Gfx **gdlptr) if (hand->visible) { gdl = beam_render(gdl, &hand->beam, 0, 0); - if (weapon_has_flag(hand->gset.weaponnum, WEAPONFLAG_00008000)) { + if (weapon_has_flag(hand->gset.weaponnum, WEAPONFLAG_BRIGHTER)) { gSPSetLights1(gdl++, var80070090); gSPLookAt(gdl++, cam_get_look_at()); } @@ -11845,13 +11853,12 @@ void bgun_tick_gameplay(bool triggeron) if (player->playertrigtime240 > TICKS(80)) { gunsfiring[player->curguntofire] = 1; - if (bgun0f099008(1 - player->curguntofire) - || player->hands[1 - player->curguntofire].triggeron) { + if (bgun_clip_has_ammo(1 - player->curguntofire) || player->hands[1 - player->curguntofire].triggeron) { gunsfiring[1 - player->curguntofire] = 1; } } else { if (player->playertriggerprev == false && - (bgun0f099008(1 - player->curguntofire) || !bgun0f099008(player->curguntofire))) { + (bgun_clip_has_ammo(1 - player->curguntofire) || !bgun_clip_has_ammo(player->curguntofire))) { player->curguntofire = 1 - player->curguntofire; } @@ -12703,7 +12710,7 @@ Gfx *bgun_draw_hud(Gfx *gdl) bgun_get_weapon_info(&info, HAND_RIGHT); tmpfuncnum = bgun_is_using_secondary_function(); - if (bgun0f098ca0(tmpfuncnum, &info, hand) >= 0) { + if (bgun_get_ammo_state(tmpfuncnum, &info, hand) > GUNAMMOSTATE_DEPLETED) { funcnum = tmpfuncnum; } #endif diff --git a/src/game/invitems.c b/src/game/invitems.c index d8f3cbda1..855b91f58 100644 --- a/src/game/invitems.c +++ b/src/game/invitems.c @@ -229,36 +229,36 @@ struct weapon invitem_nothing = { WEAPONFLAG_DUALWIELD, }; -struct guncmd invanim_punch_type3[] = { +struct guncmd invanim_punch_left[] = { gunscript_playanimation(ANIM_GUN_UNARMED_LEFTPUNCH, 0, 10000) - gunscript_waittime(7, 2) + gunscript_allowfeature(7, GUNFEATURE_ATTACK) gunscript_end }; -struct guncmd invanim_punch_type1[] = { +struct guncmd invanim_punch_right[] = { gunscript_playanimation(ANIM_GUN_UNARMED_RIGHTPUNCH, 0, 10000) - gunscript_waittime(8, 2) + gunscript_allowfeature(8, GUNFEATURE_ATTACK) gunscript_end }; -struct guncmd invanim_punch_type2[] = { +struct guncmd invanim_punch_push[] = { gunscript_playanimation(ANIM_GUN_UNARMED_RIGHTPUSH, 0, 10000) - gunscript_waittime(7, 2) + gunscript_allowfeature(7, GUNFEATURE_ATTACK) gunscript_end }; -struct guncmd invanim_punch_type4[] = { +struct guncmd invanim_punch_double[] = { gunscript_playanimation(ANIM_GUN_UNARMED_DOUBLEPUNCH, 0, 10000) - gunscript_waittime(8, 2) - gunscript_waittime(18, 3) + gunscript_allowfeature(8, GUNFEATURE_ATTACK) + gunscript_allowfeature(18, GUNFEATURE_ATTACKAGAIN) gunscript_end }; struct guncmd invanim_punch[] = { - gunscript_random(20, invanim_punch_type1) - gunscript_random(40, invanim_punch_type2) - gunscript_random(60, invanim_punch_type3) - gunscript_include(0, invanim_punch_type4) + gunscript_random(20, invanim_punch_right) + gunscript_random(40, invanim_punch_push) + gunscript_random(60, invanim_punch_left) + gunscript_include(0, invanim_punch_double) gunscript_end }; @@ -332,7 +332,7 @@ struct weapon invitem_unarmed = { L_GUN_006, // name L_GUN_000, // manufacturer L_GUN_155, // description - WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00002000 | WEAPONFLAG_HIDEMENUMODEL | WEAPONFLAG_UNDROPPABLE, + WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_HASGUNSCRIPT | WEAPONFLAG_HIDEMENUMODEL | WEAPONFLAG_UNDROPPABLE, }; struct modelpartvisibility invpartvisibility_falcon2[] = { @@ -402,7 +402,7 @@ struct guncmd invanim_falcon2_reload_singlewield[] = { gunscript_showpart(1, MODELPART_FALCON2_MAGAZINE1) gunscript_playsound(10, SFX_01D8) gunscript_hidepart(19, MODELPART_FALCON2_MAGAZINE1) - gunscript_waittime(24, 1) + gunscript_allowfeature(24, GUNFEATURE_RELOAD) #if VERSION >= VERSION_NTSC_1_0 gunscript_playsound(24, SFX_80F6) #else @@ -410,7 +410,7 @@ struct guncmd invanim_falcon2_reload_singlewield[] = { #endif gunscript_hidepart(24, MODELPART_FALCON2_MAGAZINE2) gunscript_playsound(53, SFX_01DB) - gunscript_waittime(53, 3) + gunscript_allowfeature(53, GUNFEATURE_ATTACKAGAIN) gunscript_end }; @@ -421,7 +421,7 @@ struct guncmd invanim_falcon2scope_reload_singlewield[] = { gunscript_showpart(1, MODELPART_FALCON2_MAGAZINE1) gunscript_playsound(10, SFX_01D8) gunscript_hidepart(19, MODELPART_FALCON2_MAGAZINE1) - gunscript_waittime(24, 1) + gunscript_allowfeature(24, GUNFEATURE_RELOAD) #if VERSION >= VERSION_NTSC_1_0 gunscript_playsound(24, SFX_80F6) #else @@ -429,7 +429,7 @@ struct guncmd invanim_falcon2scope_reload_singlewield[] = { #endif gunscript_hidepart(24, MODELPART_FALCON2_MAGAZINE2) gunscript_playsound(53, SFX_01DB) - gunscript_waittime(53, 3) + gunscript_allowfeature(53, GUNFEATURE_ATTACKAGAIN) gunscript_end }; @@ -438,7 +438,7 @@ struct guncmd invanim_falcon2_reload_dualwield[] = { gunscript_hidepart(1, MODELPART_FALCON2_MAGAZINE2) gunscript_showpart(1, MODELPART_FALCON2_MAGAZINE1) gunscript_playsound(6, SFX_01D8) - gunscript_waittime(50, 1) + gunscript_allowfeature(50, GUNFEATURE_RELOAD) #if VERSION >= VERSION_NTSC_1_0 gunscript_playsound(50, SFX_80F6) #else @@ -462,7 +462,7 @@ struct guncmd invanim_falcon2scope_reload[] = { struct guncmd invanim_falcon2_pistolwhip[] = { gunscript_playanimation(ANIM_GUN_FALCON2_WHIP, 0, 10000) - gunscript_waittime(23, 2) + gunscript_allowfeature(23, GUNFEATURE_ATTACK) gunscript_end }; @@ -478,7 +478,7 @@ struct guncmd invanim_falcon2_unequip[] = { struct guncmd invanim_falcon2_shoot[] = { gunscript_playanimation(ANIM_GUN_FALCON2_SHOOT, 0, 10000) - gunscript_waittime(9, 5) + gunscript_allowfeature(9, GUNFEATURE_CLICK) gunscript_end }; @@ -592,7 +592,7 @@ struct weapon invitem_falcon2 = { L_GUN_007, // name L_GUN_150, // manufacturer L_GUN_156, // description - WEAPONFLAG_00000004 | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_DUALWIELD | WEAPONFLAG_00002000 | WEAPONFLAG_00008000 | WEAPONFLAG_HASHANDS | WEAPONFLAG_GANGSTA, + WEAPONFLAG_00000004 | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_DUALWIELD | WEAPONFLAG_HASGUNSCRIPT | WEAPONFLAG_BRIGHTER | WEAPONFLAG_HASHANDS | WEAPONFLAG_GANGSTA, }; struct weapon invitem_falcon2scope = { @@ -617,7 +617,7 @@ struct weapon invitem_falcon2scope = { L_GUN_009, // name L_GUN_150, // manufacturer L_GUN_158, // description - WEAPONFLAG_00000004 | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_DUALWIELD | WEAPONFLAG_00002000 | WEAPONFLAG_00008000 | WEAPONFLAG_HASHANDS, + WEAPONFLAG_00000004 | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_DUALWIELD | WEAPONFLAG_HASGUNSCRIPT | WEAPONFLAG_BRIGHTER | WEAPONFLAG_HASHANDS, }; struct weapon invitem_falcon2silencer = { @@ -642,7 +642,7 @@ struct weapon invitem_falcon2silencer = { L_GUN_008, // name L_GUN_150, // manufacturer L_GUN_157, // description - WEAPONFLAG_00000004 | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_DUALWIELD | WEAPONFLAG_00002000 | WEAPONFLAG_00008000 | WEAPONFLAG_HASHANDS | WEAPONFLAG_GANGSTA, + WEAPONFLAG_00000004 | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_DUALWIELD | WEAPONFLAG_HASGUNSCRIPT | WEAPONFLAG_BRIGHTER | WEAPONFLAG_HASHANDS | WEAPONFLAG_GANGSTA, }; struct modelpartvisibility invpartvisibility_magsec[] = { @@ -675,8 +675,8 @@ struct guncmd invanim_magsec_reload_singlewield[] = { #else gunscript_playsound(27, SFX_01D9) #endif - gunscript_waittime(30, 1) - gunscript_waittime(56, 3) + gunscript_allowfeature(30, GUNFEATURE_RELOAD) + gunscript_allowfeature(56, GUNFEATURE_ATTACKAGAIN) gunscript_setsoundspeed(58, 1300) gunscript_playsound(58, SFX_01DB) gunscript_end @@ -694,7 +694,7 @@ struct guncmd invanim_magsec_reload_dualwield[] = { #else gunscript_playsound(47, SFX_01D9) #endif - gunscript_waittime(49, 1) + gunscript_allowfeature(49, GUNFEATURE_RELOAD) gunscript_setsoundspeed(69, 1300) gunscript_playsound(69, SFX_01DB) gunscript_end @@ -708,7 +708,7 @@ struct guncmd invanim_magsec_reload[] = { struct guncmd invanim_magsec_shoot[] = { gunscript_playanimation(ANIM_GUN_MAGSEC4_SHOOT, 0, 10000) - gunscript_waittime(12, 5) + gunscript_allowfeature(12, GUNFEATURE_CLICK) gunscript_end }; @@ -798,7 +798,7 @@ struct weapon invitem_magsec = { L_GUN_010, // name L_GUN_151, // manufacturer L_GUN_159, // description - WEAPONFLAG_00000004 | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_DUALWIELD | WEAPONFLAG_00002000 | WEAPONFLAG_00004000 | WEAPONFLAG_HASHANDS | WEAPONFLAG_GANGSTA, + WEAPONFLAG_00000004 | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_DUALWIELD | WEAPONFLAG_HASGUNSCRIPT | WEAPONFLAG_00004000 | WEAPONFLAG_HASHANDS | WEAPONFLAG_GANGSTA, }; struct modelpartvisibility invpartvisibility_dy357[] = { @@ -825,8 +825,8 @@ struct gunviscmd gunviscmds_magnum[] = { struct guncmd invanim_dy357_shoot[] = { gunscript_playanimation(ANIM_GUN_DY357_SHOOT, 0, 10000) - gunscript_waittime(12, 5) - gunscript_waittime(12, 2) + gunscript_allowfeature(12, GUNFEATURE_CLICK) + gunscript_allowfeature(12, GUNFEATURE_ATTACK) gunscript_end }; @@ -856,7 +856,7 @@ struct guncmd invanim_dy357_reload_singlewield[] = { gunscript_hidepart(121, MODELPART_MAGNUM_CART4) gunscript_hidepart(121, MODELPART_MAGNUM_CART5) gunscript_hidepart(121, MODELPART_MAGNUM_CART6) - gunscript_waittime(123, 1) + gunscript_allowfeature(123, GUNFEATURE_RELOAD) gunscript_playsound(147, SFX_05CD) gunscript_end }; @@ -874,7 +874,7 @@ struct guncmd invanim_dy357_reload_dualwield[] = { gunscript_popoutsackofpills(85) gunscript_setsoundspeed(114, 1210) gunscript_playsound(114, SFX_01D8) - gunscript_waittime(123, 1) + gunscript_allowfeature(123, GUNFEATURE_RELOAD) gunscript_playsound(147, SFX_05CD) gunscript_end }; @@ -887,7 +887,7 @@ struct guncmd invanim_dy357_reload[] = { struct guncmd invanim_dy357_pistolwhip[] = { gunscript_playanimation(ANIM_GUN_DY357_WHIP, 0, 10000) - gunscript_waittime(23, 2) + gunscript_allowfeature(23, GUNFEATURE_ATTACK) gunscript_end }; @@ -989,7 +989,7 @@ struct weapon invitem_dy357 = { L_GUN_012, // name L_GUN_149, // manufacturer L_GUN_161, // description - WEAPONFLAG_00000004 | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_DUALWIELD | WEAPONFLAG_00002000 | WEAPONFLAG_00004000 | WEAPONFLAG_00008000 | WEAPONFLAG_HASHANDS, + WEAPONFLAG_00000004 | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_DUALWIELD | WEAPONFLAG_HASGUNSCRIPT | WEAPONFLAG_00004000 | WEAPONFLAG_BRIGHTER | WEAPONFLAG_HASHANDS, }; struct weapon invitem_dy357lx = { @@ -1014,7 +1014,7 @@ struct weapon invitem_dy357lx = { L_GUN_013, // name L_GUN_149, // manufacturer L_GUN_162, // description - WEAPONFLAG_00000004 | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_DUALWIELD | WEAPONFLAG_00002000 | WEAPONFLAG_00004000 | WEAPONFLAG_00008000 | WEAPONFLAG_HASHANDS, + WEAPONFLAG_00000004 | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_DUALWIELD | WEAPONFLAG_HASGUNSCRIPT | WEAPONFLAG_00004000 | WEAPONFLAG_BRIGHTER | WEAPONFLAG_HASHANDS, }; struct modelpartvisibility invpartvisibility_phoenix[] = { @@ -1056,7 +1056,7 @@ struct guncmd invanim_phoenix_equiporreload[] = { struct guncmd invanim_phoenix_shoot[] = { gunscript_playanimation(ANIM_GUN_PHOENIX_SHOOT, 0, 10000) - gunscript_waittime(9, 5) + gunscript_allowfeature(9, GUNFEATURE_CLICK) gunscript_end }; @@ -1134,7 +1134,7 @@ struct weapon invitem_phoenix = { L_GUN_014, // name L_GUN_153, // manufacturer L_GUN_163, // description - WEAPONFLAG_00000004 | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_DUALWIELD | WEAPONFLAG_00002000 | WEAPONFLAG_00004000 | WEAPONFLAG_00008000 | WEAPONFLAG_HASHANDS | WEAPONFLAG_GANGSTA, + WEAPONFLAG_00000004 | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_DUALWIELD | WEAPONFLAG_HASGUNSCRIPT | WEAPONFLAG_00004000 | WEAPONFLAG_BRIGHTER | WEAPONFLAG_HASHANDS | WEAPONFLAG_GANGSTA, }; struct modelpartvisibility invpartvisibility_mauler[] = { @@ -1151,7 +1151,7 @@ struct gunviscmd gunviscmds_mauler[] = { struct guncmd invanim_mauler_shoot[] = { gunscript_playanimation(ANIM_GUN_MAULER_SHOOT, 0, 10000) - gunscript_waittime(9, 5) + gunscript_allowfeature(9, GUNFEATURE_CLICK) gunscript_end }; @@ -1164,14 +1164,14 @@ struct guncmd invanim_mauler_reload_singlewield[] = { gunscript_hidepart(18, MODELPART_MAULER_MAGAZINE1) gunscript_setsoundspeed(20, 2500) gunscript_playsound(20, SFX_DOOR_8012) - gunscript_waittime(25, 1) + gunscript_allowfeature(25, GUNFEATURE_RELOAD) gunscript_showpart(25, MODELPART_MAULER_MAGAZINE1) gunscript_hidepart(25, MODELPART_MAULER_MAGAZINE2) gunscript_setsoundspeed(27, 2000) gunscript_playsound(27, SFX_05C5) gunscript_setsoundspeed(61, 1000) gunscript_playsound(61, SFX_01DB) - gunscript_waittime(61, 3) + gunscript_allowfeature(61, GUNFEATURE_ATTACKAGAIN) gunscript_end }; @@ -1183,7 +1183,7 @@ struct guncmd invanim_mauler_reload_dualwield[] = { gunscript_playsound(40, SFX_DOOR_8012) gunscript_setsoundspeed(47, 2000) gunscript_playsound(47, SFX_05C5) - gunscript_waittime(47, 1) + gunscript_allowfeature(47, GUNFEATURE_RELOAD) gunscript_setsoundspeed(68, 1000) gunscript_playsound(68, SFX_01DB) gunscript_end @@ -1274,7 +1274,7 @@ struct weapon invitem_mauler = { L_GUN_011, // name L_GUN_152, // manufacturer L_GUN_160, // description - WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_DUALWIELD | WEAPONFLAG_00002000 | WEAPONFLAG_00004000 | WEAPONFLAG_HASHANDS, + WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_DUALWIELD | WEAPONFLAG_HASGUNSCRIPT | WEAPONFLAG_00004000 | WEAPONFLAG_HASHANDS, }; struct modelpartvisibility invpartvisibility_cmp150[] = { @@ -1305,7 +1305,7 @@ struct guncmd invanim_cmp150_reload_singlewield[] = { #endif gunscript_hidepart(45, MODELPART_CMP150_MAGAZINE2) gunscript_showpart(45, MODELPART_CMP150_MAGAZINE1) - gunscript_waittime(45, 1) + gunscript_allowfeature(45, GUNFEATURE_RELOAD) gunscript_playsound(86, SFX_0431) gunscript_end }; @@ -1325,7 +1325,7 @@ struct guncmd invanim_cmp150_reload_dualwield[] = { #endif gunscript_hidepart(61, MODELPART_CMP150_MAGAZINE2) gunscript_showpart(61, MODELPART_CMP150_MAGAZINE1) - gunscript_waittime(61, 1) + gunscript_allowfeature(61, GUNFEATURE_RELOAD) gunscript_playsound(76, SFX_0431) gunscript_end }; @@ -1338,7 +1338,7 @@ struct guncmd invanim_cmp150_reload[] = { struct guncmd invanim_cmp150_shoot[] = { gunscript_playanimation(ANIM_GUN_CMP150_SHOOT, 0, 10000) - gunscript_waittime(14, 5) + gunscript_allowfeature(14, GUNFEATURE_CLICK) gunscript_waitforzreleased(14) gunscript_end }; @@ -1441,7 +1441,7 @@ struct weapon invitem_cmp150 = { L_GUN_015, // name L_GUN_149, // manufacturer L_GUN_164, // description - WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_DUALWIELD | WEAPONFLAG_00002000 | WEAPONFLAG_00004000 | WEAPONFLAG_00008000 | WEAPONFLAG_HASHANDS | WEAPONFLAG_04000000 | WEAPONFLAG_AIMTRACK, + WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_DUALWIELD | WEAPONFLAG_HASGUNSCRIPT | WEAPONFLAG_00004000 | WEAPONFLAG_BRIGHTER | WEAPONFLAG_HASHANDS | WEAPONFLAG_KEEPFUNCWHENEMPTY | WEAPONFLAG_AIMTRACK, }; struct modelpartvisibility invpartvisibility_cyclone[] = { @@ -1478,7 +1478,7 @@ struct guncmd invanim_cyclone_equiporreload[] = { struct guncmd invanim_cyclone_shoot[] = { gunscript_playanimation(ANIM_GUN_CYCLONE_SHOOT, 0, 10000) - gunscript_waittime(5, 5) + gunscript_allowfeature(5, GUNFEATURE_CLICK) gunscript_waitforzreleased(5) gunscript_end }; @@ -1569,7 +1569,7 @@ struct weapon invitem_cyclone = { L_GUN_020, // name L_GUN_151, // manufacturer L_GUN_169, // description - WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_DUALWIELD | WEAPONFLAG_00002000 | WEAPONFLAG_00004000 | WEAPONFLAG_HASHANDS, + WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_DUALWIELD | WEAPONFLAG_HASGUNSCRIPT | WEAPONFLAG_00004000 | WEAPONFLAG_HASHANDS, }; struct guncmd invanim_rcp120_reload[] = { @@ -1587,7 +1587,7 @@ struct guncmd invanim_rcp120_reload[] = { struct guncmd invanim_rcp120_shoot[] = { gunscript_playanimation(ANIM_GUN_RCP120_SHOOT, 0, 10000) - gunscript_waittime(10, 5) + gunscript_allowfeature(10, GUNFEATURE_CLICK) gunscript_waitforzreleased(10) gunscript_end }; @@ -1674,7 +1674,7 @@ struct weapon invitem_rcp120 = { L_GUN_022, // name L_GUN_151, // manufacturer L_GUN_170, // description - WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_00002000 | WEAPONFLAG_00004000 | WEAPONFLAG_00008000 | WEAPONFLAG_HASHANDS | WEAPONFLAG_DETERMINER_S_AN | WEAPONFLAG_DETERMINER_F_AN, + WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_HASGUNSCRIPT | WEAPONFLAG_00004000 | WEAPONFLAG_BRIGHTER | WEAPONFLAG_HASHANDS | WEAPONFLAG_DETERMINER_S_AN | WEAPONFLAG_DETERMINER_F_AN, }; struct guncmd invanim_callisto_reload[] = { @@ -1688,7 +1688,7 @@ struct guncmd invanim_callisto_reload[] = { struct guncmd invanim_callisto_shoot[] = { gunscript_playanimation(ANIM_GUN_CALLISTO_SHOOT, 0, 10000) - gunscript_waittime(8, 5) + gunscript_allowfeature(8, GUNFEATURE_CLICK) gunscript_waitforzreleased(8) gunscript_end }; @@ -1789,7 +1789,7 @@ struct weapon invitem_callisto = { L_GUN_023, // name L_GUN_153, // manufacturer L_GUN_171, // description - WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_00002000 | WEAPONFLAG_00004000 | WEAPONFLAG_00008000 | WEAPONFLAG_HASHANDS, + WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_HASGUNSCRIPT | WEAPONFLAG_00004000 | WEAPONFLAG_BRIGHTER | WEAPONFLAG_HASHANDS, }; struct gunviscmd gunviscmds_dragon[] = { @@ -1813,7 +1813,7 @@ struct guncmd invanim_dragon_reload[] = { gunscript_playsound(8, SFX_0053) gunscript_hidepart(17, MODELPART_DRAGON_MAGAZINE2) gunscript_showpart(17, MODELPART_DRAGON_MAGAZINE1) - gunscript_waittime(41, 1) + gunscript_allowfeature(41, GUNFEATURE_RELOAD) gunscript_playsound(41, SFX_05C5) gunscript_showpart(41, MODELPART_DRAGON_MAGAZINE2) gunscript_hidepart(41, MODELPART_DRAGON_MAGAZINE1) @@ -1892,7 +1892,7 @@ struct weapon invitem_dragon = { L_GUN_017, // name L_GUN_149, // manufacturer L_GUN_166, // description - WEAPONFLAG_AICANUSE | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_00002000 | WEAPONFLAG_00004000 | WEAPONFLAG_HASHANDS | WEAPONFLAG_04000000, + WEAPONFLAG_AICANUSE | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_HASGUNSCRIPT | WEAPONFLAG_00004000 | WEAPONFLAG_HASHANDS | WEAPONFLAG_KEEPFUNCWHENEMPTY, }; struct gunviscmd gunviscmds_superdragon[] = { @@ -1914,7 +1914,7 @@ struct guncmd invanim_superdragon_reload[] = { gunscript_hidepart(16, MODELPART_SUPERDRAGON_MAGAZINE3) gunscript_showpart(16, MODELPART_SUPERDRAGON_MAGAZINE1) gunscript_playsound(41, SFX_05C5) - gunscript_waittime(43, 1) + gunscript_allowfeature(43, GUNFEATURE_RELOAD) gunscript_showpart(43, MODELPART_SUPERDRAGON_MAGAZINE3) gunscript_hidepart(43, MODELPART_SUPERDRAGON_MAGAZINE1) gunscript_end @@ -1928,7 +1928,7 @@ struct guncmd invanim_superdragon_grenadereload[] = { gunscript_hidepart(30, MODELPART_SUPERDRAGON_MAGAZINE4) gunscript_hidepart(64, MODELPART_SUPERDRAGON_MAGAZINE2) gunscript_showpart(64, MODELPART_SUPERDRAGON_MAGAZINE4) - gunscript_waittime(64, 1) + gunscript_allowfeature(64, GUNFEATURE_RELOAD) gunscript_setsoundspeed(66, 850) gunscript_playsound(66, SFX_05C5) gunscript_end @@ -2051,7 +2051,7 @@ struct weapon invitem_superdragon = { L_GUN_018, // name L_GUN_149, // manufacturer L_GUN_167, // description - WEAPONFLAG_AICANUSE | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_00002000 | WEAPONFLAG_00004000 | WEAPONFLAG_HASHANDS, + WEAPONFLAG_AICANUSE | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_HASGUNSCRIPT | WEAPONFLAG_00004000 | WEAPONFLAG_HASHANDS, }; struct gunviscmd gunviscmds_ar34[] = { @@ -2075,7 +2075,7 @@ struct guncmd invanim_ar34_reload[] = { gunscript_playsound(67, SFX_8025) gunscript_hidepart(72, MODELPART_AR34_MAGAZINE2) gunscript_showpart(72, MODELPART_AR34_MAGAZINE1) - gunscript_waittime(72, 1) + gunscript_allowfeature(72, GUNFEATURE_RELOAD) gunscript_setsoundspeed(95, 900) gunscript_playsound(95, SFX_05C5) gunscript_end @@ -2179,7 +2179,7 @@ struct weapon invitem_ar34 = { L_GUN_016, // name L_GUN_000, // manufacturer L_GUN_165, // description - WEAPONFLAG_AICANUSE | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_00002000 | WEAPONFLAG_00004000 | WEAPONFLAG_HASHANDS | WEAPONFLAG_DETERMINER_S_AN | WEAPONFLAG_DETERMINER_F_AN | WEAPONFLAG_04000000, + WEAPONFLAG_AICANUSE | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_HASGUNSCRIPT | WEAPONFLAG_00004000 | WEAPONFLAG_HASHANDS | WEAPONFLAG_DETERMINER_S_AN | WEAPONFLAG_DETERMINER_F_AN | WEAPONFLAG_KEEPFUNCWHENEMPTY, }; struct gunviscmd gunviscmds_k7avenger[] = { @@ -2199,7 +2199,7 @@ struct guncmd invanim_k7avenger_reload[] = { gunscript_playsound(15, SFX_0053) gunscript_hidepart(22, MODELPART_K7AVENGER_MAGAZINE1) gunscript_showpart(48, MODELPART_K7AVENGER_MAGAZINE2) - gunscript_waittime(68, 1) + gunscript_allowfeature(68, GUNFEATURE_RELOAD) gunscript_hidepart(69, MODELPART_K7AVENGER_MAGAZINE2) gunscript_showpart(69, MODELPART_K7AVENGER_MAGAZINE1) gunscript_setsoundspeed(69, 1400) @@ -2322,10 +2322,10 @@ struct weapon invitem_k7avenger = { L_GUN_149, // manufacturer L_GUN_168, // description #if VERSION >= VERSION_NTSC_1_0 - WEAPONFLAG_AICANUSE | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_00002000 | WEAPONFLAG_HASHANDS, + WEAPONFLAG_AICANUSE | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_HASGUNSCRIPT | WEAPONFLAG_HASHANDS, #else // NTSC beta uses "an" in "Picked up an K7 Avenger" - WEAPONFLAG_AICANUSE | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_00002000 | WEAPONFLAG_HASHANDS | WEAPONFLAG_DETERMINER_S_AN | WEAPONFLAG_DETERMINER_F_AN, + WEAPONFLAG_AICANUSE | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_HASGUNSCRIPT | WEAPONFLAG_HASHANDS | WEAPONFLAG_DETERMINER_S_AN | WEAPONFLAG_DETERMINER_F_AN, #endif }; @@ -2357,7 +2357,7 @@ struct guncmd invanim_laptopgun_reload[] = { gunscript_showpart(63, MODELPART_LAPTOPGUN_MAGAZINE1) gunscript_playsound(63, SFX_04F8) gunscript_hidepart(85, MODELPART_LAPTOPGUN_MAGAZINE1) - gunscript_waittime(85, 1) + gunscript_allowfeature(85, GUNFEATURE_RELOAD) gunscript_playsound(85, SFX_05C5) gunscript_playsound(91, SFX_04F9) gunscript_end @@ -2365,7 +2365,7 @@ struct guncmd invanim_laptopgun_reload[] = { struct guncmd invanim_laptopgun_shoot[] = { gunscript_playanimation(ANIM_GUN_LAPTOP_SHOOT, 0, 10000) - gunscript_waittime(10, 5) + gunscript_allowfeature(10, GUNFEATURE_CLICK) gunscript_waitforzreleased(10) gunscript_end }; @@ -2464,7 +2464,7 @@ struct weapon invitem_laptopgun = { L_GUN_024, // name L_GUN_150, // manufacturer L_GUN_172, // description - WEAPONFLAG_AICANUSE | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_00002000 | WEAPONFLAG_00008000 | WEAPONFLAG_HASHANDS | WEAPONFLAG_04000000, + WEAPONFLAG_AICANUSE | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_HASGUNSCRIPT | WEAPONFLAG_BRIGHTER | WEAPONFLAG_HASHANDS | WEAPONFLAG_KEEPFUNCWHENEMPTY, }; struct gunviscmd gunviscmds_shotgun[] = { @@ -2482,23 +2482,23 @@ struct guncmd invanim_shotgun_reload[] = { gunscript_playanimation(ANIM_GUN_SHOTGUN_RELOAD, 0, 10000) gunscript_showpart(1, MODELPART_SHOTGUN_CART) gunscript_playsound(67, SFX_01D8) - gunscript_waittime(74, 1) + gunscript_allowfeature(74, GUNFEATURE_RELOAD) gunscript_hidepart(75, MODELPART_SHOTGUN_CART) - gunscript_repeatuntilfull(0x0054, 0x0000, 0x0032) + gunscript_repeatuntilfull(84, 50) gunscript_playsound(103, SFX_RELOAD_04FB) gunscript_end }; struct guncmd invanim_shotgun_singleshot[] = { gunscript_playanimation(ANIM_GUN_SHOTGUN_SHOOT_SINGLE, 0, 10000) - gunscript_waittime(9, 2) + gunscript_allowfeature(9, GUNFEATURE_ATTACK) gunscript_playsound(34, SFX_RELOAD_04FB) gunscript_end }; struct guncmd invanim_shotgun_doubleshot[] = { gunscript_playanimation(ANIM_GUN_SHOTGUN_SHOOT_DOUBLE, 0, 10000) - gunscript_waittime(9, 2) + gunscript_allowfeature(9, GUNFEATURE_ATTACK) gunscript_playsound(54, SFX_RELOAD_04FB) gunscript_end }; @@ -2581,7 +2581,7 @@ struct weapon invitem_shotgun = { L_GUN_025, // name L_GUN_149, // manufacturer L_GUN_173, // description - WEAPONFLAG_AICANUSE | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_00002000 | WEAPONFLAG_00004000 | WEAPONFLAG_HASHANDS, + WEAPONFLAG_AICANUSE | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_HASGUNSCRIPT | WEAPONFLAG_00004000 | WEAPONFLAG_HASHANDS, }; f32 vibrationstart_reaper[] = {0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0}; @@ -2602,7 +2602,7 @@ struct gunviscmd gunviscmds_reaper[] = { struct guncmd invanim_reaper_shoot[] = { gunscript_playanimation(ANIM_GUN_REAPER_SHOOT, 0, 10000) - gunscript_waittime(12, 5) + gunscript_allowfeature(12, GUNFEATURE_CLICK) gunscript_end }; @@ -2614,7 +2614,7 @@ struct guncmd invanim_reaper_reload[] = { gunscript_playsound(124, SFX_05C6) gunscript_showpart(134, MODELPART_REAPER_MAGAZINE1) gunscript_hidepart(134, MODELPART_REAPER_MAGAZINE2) - gunscript_waittime(134, 1) + gunscript_allowfeature(134, GUNFEATURE_RELOAD) gunscript_end }; @@ -2710,7 +2710,7 @@ struct weapon invitem_reaper = { L_GUN_026, // name L_GUN_152, // manufacturer L_GUN_174, // description - WEAPONFLAG_AICANUSE | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_00002000 | WEAPONFLAG_HASHANDS, + WEAPONFLAG_AICANUSE | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_HASGUNSCRIPT | WEAPONFLAG_HASHANDS, }; struct modelpartvisibility invpartvisibility_rocketlauncher[] = { @@ -2729,7 +2729,7 @@ struct guncmd invanim_rocketlauncher_reload[] = { gunscript_playsound(16, SFX_04F9) gunscript_playsound(40, SFX_0053) gunscript_showpart(24, MODELPART_ROCKETLAUNCHER_ROCKET) - gunscript_waittime(76, 1) + gunscript_allowfeature(76, GUNFEATURE_RELOAD) gunscript_hidepart(76, MODELPART_ROCKETLAUNCHER_ROCKET) gunscript_playsound(77, SFX_05D1) gunscript_setsoundspeed(106, 1000) @@ -2848,7 +2848,7 @@ struct weapon invitem_rocketlauncher = { L_GUN_027, // name L_GUN_149, // manufacturer L_GUN_175, // description - WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00002000 | WEAPONFLAG_00004000 | WEAPONFLAG_HASHANDS | WEAPONFLAG_AIMTRACK, + WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_HASGUNSCRIPT | WEAPONFLAG_00004000 | WEAPONFLAG_HASHANDS | WEAPONFLAG_AIMTRACK, }; struct guncmd invanim_slayer_shoot[] = { @@ -2958,7 +2958,7 @@ struct weapon invitem_slayer = { L_GUN_029, // name L_GUN_152, // manufacturer L_GUN_177, // description - WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00002000 | WEAPONFLAG_00004000 | WEAPONFLAG_HASHANDS | WEAPONFLAG_02000000, + WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_HASGUNSCRIPT | WEAPONFLAG_00004000 | WEAPONFLAG_HASHANDS | WEAPONFLAG_RESETMATRICES, }; struct gunviscmd gunviscmds_devastator[] = { @@ -2981,7 +2981,7 @@ struct guncmd invanim_devastator_reload[] = { gunscript_playsound(47, SFX_05C5) gunscript_hidepart(47, MODELPART_DEVASTATOR_MAGAZINE1) gunscript_showpart(47, MODELPART_DEVASTATOR_MAGAZINE2) - gunscript_waittime(47, 1) + gunscript_allowfeature(47, GUNFEATURE_RELOAD) gunscript_playsound(66, SFX_05CC) gunscript_end }; @@ -3083,7 +3083,7 @@ struct weapon invitem_devastator = { L_GUN_028, // name L_GUN_149, // manufacturer L_GUN_176, // description - WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00002000 | WEAPONFLAG_00004000 | WEAPONFLAG_HASHANDS, + WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_HASGUNSCRIPT | WEAPONFLAG_00004000 | WEAPONFLAG_HASHANDS, }; struct weaponfunc invfunc_mine_threatdetector = { @@ -3109,7 +3109,7 @@ struct guncmd invanim_mine_unequip[] = { struct guncmd invanim_mine_throw[] = { gunscript_playanimation(ANIM_GUN_MINE_THROW, 0, 10000) gunscript_waitforzreleased(10) - gunscript_waittime(13, 2) + gunscript_allowfeature(13, GUNFEATURE_ATTACK) gunscript_end }; @@ -3161,7 +3161,7 @@ struct weapon invitem_timedmine = { L_GUN_038, // name L_GUN_000, // manufacturer L_GUN_185, // description - WEAPONFLAG_THROWABLE | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00002000 | WEAPONFLAG_HASHANDS, + WEAPONFLAG_THROWABLE | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_HASGUNSCRIPT | WEAPONFLAG_HASHANDS, }; struct gunviscmd gunviscmds_remotemine[] = { @@ -3185,7 +3185,7 @@ struct guncmd invanim_remotemine_unequip[] = { struct guncmd invanim_remotemine_throw[] = { gunscript_playanimation(ANIM_GUN_REMOTEMINE_THROW, 0, 10000) gunscript_waitforzreleased(10) - gunscript_waittime(11, 2) + gunscript_allowfeature(11, GUNFEATURE_ATTACK) gunscript_end }; @@ -3255,7 +3255,7 @@ struct weapon invitem_remotemine = { L_GUN_040, // name L_GUN_000, // manufacturer L_GUN_187, // description - WEAPONFLAG_THROWABLE | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00002000 | WEAPONFLAG_HASHANDS, + WEAPONFLAG_THROWABLE | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_HASGUNSCRIPT | WEAPONFLAG_HASHANDS, }; struct weaponfunc_throw invfunc_proxymine_throw = { @@ -3302,7 +3302,7 @@ struct weapon invitem_proximitymine = { L_GUN_039, // name L_GUN_000, // manufacturer L_GUN_186, // description - WEAPONFLAG_THROWABLE | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00002000 | WEAPONFLAG_HASHANDS, + WEAPONFLAG_THROWABLE | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_HASGUNSCRIPT | WEAPONFLAG_HASHANDS, }; struct guncmd invanim_ecmmine_equip[] = { @@ -3317,7 +3317,7 @@ struct guncmd invanim_ecmmine_unequip[] = { struct guncmd invanim_ecmmine_throw[] = { gunscript_playanimation(ANIM_GUN_ECMMINE_UNEQUIP, 0, 10000) - gunscript_waittime(23, 2) + gunscript_allowfeature(23, GUNFEATURE_ATTACK) gunscript_end }; @@ -3369,7 +3369,7 @@ struct weapon invitem_ecmmine = { L_GUN_041, // name L_GUN_000, // manufacturer L_GUN_188, // description - WEAPONFLAG_THROWABLE | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_00000040 | WEAPONFLAG_00002000 | WEAPONFLAG_HASHANDS | WEAPONFLAG_DETERMINER_S_AN | WEAPONFLAG_DETERMINER_F_AN | WEAPONFLAG_UNDROPPABLE, + WEAPONFLAG_THROWABLE | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_00000040 | WEAPONFLAG_HASGUNSCRIPT | WEAPONFLAG_HASHANDS | WEAPONFLAG_DETERMINER_S_AN | WEAPONFLAG_DETERMINER_F_AN | WEAPONFLAG_UNDROPPABLE, }; // Some unfinished Reaper-like gun. The name is "Timed Mine". The primary @@ -3409,7 +3409,7 @@ struct guncmd invanim_grenade_throw[] = { gunscript_popoutsackofpills(6) gunscript_playsound(6, SFX_05C1) gunscript_waitforzreleased(43) - gunscript_waittime(49, 2) + gunscript_allowfeature(49, GUNFEATURE_ATTACK) gunscript_end }; @@ -3476,7 +3476,7 @@ struct weapon invitem_grenade = { L_GUN_036, // name L_GUN_000, // manufacturer L_GUN_183, // description - WEAPONFLAG_THROWABLE | WEAPONFLAG_00000004 | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_00002000 | WEAPONFLAG_00008000 | WEAPONFLAG_HASHANDS, + WEAPONFLAG_THROWABLE | WEAPONFLAG_00000004 | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_HASGUNSCRIPT | WEAPONFLAG_BRIGHTER | WEAPONFLAG_HASHANDS, }; struct weaponfunc_throw invfunc_nbomb_throw = { @@ -3537,7 +3537,7 @@ struct weapon invitem_nbomb = { L_GUN_037, // name L_GUN_000, // manufacturer L_GUN_184, // description - WEAPONFLAG_THROWABLE | WEAPONFLAG_00000004 | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_00002000 | WEAPONFLAG_00008000 | WEAPONFLAG_HASHANDS | WEAPONFLAG_DETERMINER_S_AN | WEAPONFLAG_DETERMINER_F_AN, + WEAPONFLAG_THROWABLE | WEAPONFLAG_00000004 | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_HASGUNSCRIPT | WEAPONFLAG_BRIGHTER | WEAPONFLAG_HASHANDS | WEAPONFLAG_DETERMINER_S_AN | WEAPONFLAG_DETERMINER_F_AN, }; struct gunviscmd gunviscmds_farsight[] = { @@ -3549,7 +3549,7 @@ struct guncmd invanim_farsight_reload[] = { gunscript_playanimation(ANIM_GUN_FARSIGHT_RELOAD, 0, 10000) gunscript_showpart(1, MODELPART_FARSIGHT_ORB) gunscript_playsound(72, SFX_RELOAD_FARSIGHT) - gunscript_waittime(76, 1) + gunscript_allowfeature(76, GUNFEATURE_RELOAD) gunscript_hidepart(82, MODELPART_FARSIGHT_ORB) gunscript_end }; @@ -3650,7 +3650,7 @@ struct weapon invitem_farsight = { L_GUN_031, // name L_GUN_000, // manufacturer L_GUN_178, // description - WEAPONFLAG_AICANUSE | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_00002000 | WEAPONFLAG_00004000 | WEAPONFLAG_HASHANDS, + WEAPONFLAG_AICANUSE | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_HASGUNSCRIPT | WEAPONFLAG_00004000 | WEAPONFLAG_HASHANDS, }; struct gunviscmd gunviscmds_crossbow[] = { @@ -3667,10 +3667,10 @@ struct guncmd invanim_crossbow_reload[] = { gunscript_hidepart(19, MODELPART_CROSSBOW_0028) gunscript_showpart(19, MODELPART_CROSSBOW_BOLT) gunscript_playsound(45, SFX_04FC) - gunscript_waittime(50, 1) + gunscript_allowfeature(50, GUNFEATURE_RELOAD) gunscript_hidepart(50, MODELPART_CROSSBOW_BOLT) gunscript_showpart(50, MODELPART_CROSSBOW_0028) - gunscript_repeatuntilfull(0x0044, 0x0000, 0x0013) + gunscript_repeatuntilfull(68, 19) gunscript_end }; @@ -3794,7 +3794,7 @@ struct weapon invitem_crossbow = { L_GUN_033, // name L_GUN_000, // manufacturer L_GUN_180, // description - WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_00002000 | WEAPONFLAG_HASHANDS, + WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_HASGUNSCRIPT | WEAPONFLAG_HASHANDS, }; struct gunviscmd gunviscmds_tranquilizer[] = { @@ -3805,13 +3805,13 @@ struct gunviscmd gunviscmds_tranquilizer[] = { struct guncmd invanim_tranquilizer_lethalinject[] = { gunscript_playanimation(ANIM_GUN_TRANQUILIZER_INJECT, 0, 10000) - gunscript_waittime(18, 2) + gunscript_allowfeature(18, GUNFEATURE_ATTACK) gunscript_end }; struct guncmd invanim_tranquilizer_shoot[] = { gunscript_playanimation(ANIM_GUN_TRANQUILIZER_SHOOT, 0, 10000) - gunscript_waittime(7, 5) + gunscript_allowfeature(7, GUNFEATURE_CLICK) gunscript_end }; @@ -3824,7 +3824,7 @@ struct guncmd invanim_tranquilizer_reload[] = { gunscript_popoutsackofpills(1) gunscript_setsoundspeed(3, 3500) gunscript_playsound(3, SFX_DOOR_8016) - gunscript_waittime(39, 1) + gunscript_allowfeature(39, GUNFEATURE_RELOAD) gunscript_hidepart(39, MODELPART_TRANQUILIZER_MAGAZINE3) gunscript_showpart(39, MODELPART_TRANQUILIZER_MAGAZINE2) gunscript_setsoundspeed(39, 3500) @@ -3923,7 +3923,7 @@ struct weapon invitem_tranquilizer = { L_GUN_034, // name L_GUN_000, // manufacturer L_GUN_181, // description - WEAPONFLAG_00000004 | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_00002000 | WEAPONFLAG_00004000 | WEAPONFLAG_00008000 | WEAPONFLAG_HASHANDS, + WEAPONFLAG_00000004 | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_HASGUNSCRIPT | WEAPONFLAG_00004000 | WEAPONFLAG_BRIGHTER | WEAPONFLAG_HASHANDS, }; struct inventory_ammo invammo_psychosisgun = { @@ -3978,7 +3978,7 @@ struct weapon invitem_psychosisgun = { L_GUN_049, // name L_GUN_000, // manufacturer L_GUN_210, // description - WEAPONFLAG_00000004 | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_00002000 | WEAPONFLAG_00004000 | WEAPONFLAG_00008000 | WEAPONFLAG_HASHANDS, + WEAPONFLAG_00000004 | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_HASGUNSCRIPT | WEAPONFLAG_00004000 | WEAPONFLAG_BRIGHTER | WEAPONFLAG_HASHANDS, }; struct gunviscmd gunviscmds_sniperrifle[] = { @@ -4005,7 +4005,7 @@ struct guncmd invanim_sniperrifle_reload[] = { #endif gunscript_hidepart(72, MODELPART_SNIPERRIFLE_MAGAZINE2) gunscript_showpart(72, MODELPART_SNIPERRIFLE_MAGAZINE1) - gunscript_waittime(72, 1) + gunscript_allowfeature(72, GUNFEATURE_RELOAD) gunscript_end }; @@ -4095,7 +4095,7 @@ struct weapon invitem_sniperrifle = { L_GUN_032, // name L_GUN_000, // manufacturer L_GUN_179, // description - WEAPONFLAG_AICANUSE | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_00002000 | WEAPONFLAG_00004000 | WEAPONFLAG_HASHANDS, + WEAPONFLAG_AICANUSE | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_HASGUNSCRIPT | WEAPONFLAG_00004000 | WEAPONFLAG_HASHANDS, }; struct guncmd invanim_laser_equip[] = { @@ -4180,7 +4180,7 @@ struct weapon invitem_laser = { L_GUN_047, // name L_GUN_150, // manufacturer L_GUN_189, // description - WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_00002000 | WEAPONFLAG_00008000 | WEAPONFLAG_HASHANDS | WEAPONFLAG_DONTCOUNTSHOTS | WEAPONFLAG_04000000, + WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_HASGUNSCRIPT | WEAPONFLAG_BRIGHTER | WEAPONFLAG_HASHANDS | WEAPONFLAG_DONTCOUNTSHOTS | WEAPONFLAG_KEEPFUNCWHENEMPTY, }; struct modelpartvisibility invpartvisibility_classic[] = { @@ -4195,7 +4195,7 @@ struct gunviscmd gunviscmds_classicpistol[] = { struct guncmd invanim_pp9i_shoot[] = { gunscript_playanimation(ANIM_GUN_PP9I_SHOOT, 0, 10000) - gunscript_waittime(10, 5) + gunscript_allowfeature(10, GUNFEATURE_CLICK) gunscript_end }; @@ -4251,12 +4251,12 @@ struct weapon invitem_pp9i = { L_GUN_050, // name L_GUN_000, // manufacturer L_GUN_000, // description - WEAPONFLAG_00000004 | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_DUALWIELD | WEAPONFLAG_00002000 | WEAPONFLAG_00004000 | WEAPONFLAG_00008000 | WEAPONFLAG_HASHANDS | WEAPONFLAG_GANGSTA, + WEAPONFLAG_00000004 | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_DUALWIELD | WEAPONFLAG_HASGUNSCRIPT | WEAPONFLAG_00004000 | WEAPONFLAG_BRIGHTER | WEAPONFLAG_HASHANDS | WEAPONFLAG_GANGSTA, }; struct guncmd invanim_cc13_shoot[] = { gunscript_playanimation(ANIM_GUN_CC13_SHOOT, 0, 10000) - gunscript_waittime(10, 5) + gunscript_allowfeature(10, GUNFEATURE_CLICK) gunscript_end }; @@ -4312,7 +4312,7 @@ struct weapon invitem_cc13 = { L_GUN_051, // name L_GUN_000, // manufacturer L_GUN_000, // description - WEAPONFLAG_00000004 | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_DUALWIELD | WEAPONFLAG_00002000 | WEAPONFLAG_00004000 | WEAPONFLAG_00008000 | WEAPONFLAG_HASHANDS | WEAPONFLAG_GANGSTA, + WEAPONFLAG_00000004 | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_DUALWIELD | WEAPONFLAG_HASGUNSCRIPT | WEAPONFLAG_00004000 | WEAPONFLAG_BRIGHTER | WEAPONFLAG_HASHANDS | WEAPONFLAG_GANGSTA, }; struct weaponfunc_shootauto invfunc_kl01313_shoot = { @@ -4373,7 +4373,7 @@ struct weapon invitem_kl01313 = { L_GUN_052, // name L_GUN_000, // manufacturer L_GUN_000, // description - WEAPONFLAG_00000004 | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_DUALWIELD | WEAPONFLAG_00008000, + WEAPONFLAG_00000004 | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_DUALWIELD | WEAPONFLAG_BRIGHTER, }; struct weaponfunc_shootauto invfunc_kf7special_shoot = { @@ -4434,7 +4434,7 @@ struct weapon invitem_kf7special = { L_GUN_053, // name L_GUN_000, // manufacturer L_GUN_000, // description - WEAPONFLAG_00000004 | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_DUALWIELD | WEAPONFLAG_00008000, + WEAPONFLAG_00000004 | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_DUALWIELD | WEAPONFLAG_BRIGHTER, }; struct weaponfunc_shootauto invfunc_zzt9mm_shoot = { @@ -4495,7 +4495,7 @@ struct weapon invitem_zzt9mm = { L_GUN_054, // name L_GUN_000, // manufacturer L_GUN_000, // description - WEAPONFLAG_00000004 | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_DUALWIELD | WEAPONFLAG_00008000, + WEAPONFLAG_00000004 | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_DUALWIELD | WEAPONFLAG_BRIGHTER, }; struct weaponfunc_shootauto invfunc_dmc_shoot = { @@ -4556,7 +4556,7 @@ struct weapon invitem_dmc = { L_GUN_055, // name L_GUN_000, // manufacturer L_GUN_000, // description - WEAPONFLAG_00000004 | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_DUALWIELD | WEAPONFLAG_00008000, + WEAPONFLAG_00000004 | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_DUALWIELD | WEAPONFLAG_BRIGHTER, }; struct weaponfunc_shootauto invfunc_ar53_shoot = { @@ -4617,7 +4617,7 @@ struct weapon invitem_ar53 = { L_GUN_056, // name L_GUN_000, // manufacturer L_GUN_000, // description - WEAPONFLAG_00000004 | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_DUALWIELD | WEAPONFLAG_00008000 | WEAPONFLAG_DETERMINER_S_AN | WEAPONFLAG_DETERMINER_F_AN, + WEAPONFLAG_00000004 | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_DUALWIELD | WEAPONFLAG_BRIGHTER | WEAPONFLAG_DETERMINER_S_AN | WEAPONFLAG_DETERMINER_F_AN, }; struct weaponfunc_shootauto invfunc_rcp45_shoot = { @@ -4678,7 +4678,7 @@ struct weapon invitem_rcp45 = { L_GUN_057, // name L_GUN_000, // manufacturer L_GUN_000, // description - WEAPONFLAG_00000004 | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_DUALWIELD | WEAPONFLAG_00008000 | WEAPONFLAG_DETERMINER_S_AN | WEAPONFLAG_DETERMINER_F_AN, + WEAPONFLAG_00000004 | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_DUALWIELD | WEAPONFLAG_BRIGHTER | WEAPONFLAG_DETERMINER_S_AN | WEAPONFLAG_DETERMINER_F_AN, }; struct weaponfunc invfunc_briefcase_use = { @@ -4850,13 +4850,13 @@ struct gunviscmd gunviscmds_knife[] = { struct guncmd invanim_combatknife_equip[] = { gunscript_playanimation(ANIM_GUN_KNIFE_EQUIP, 0, 10000) - gunscript_waittime(24, 2) + gunscript_allowfeature(24, GUNFEATURE_ATTACK) gunscript_end }; struct guncmd invanim_combatknife_slash2[] = { gunscript_playanimation(ANIM_GUN_KNIFE_SLASH, 0, 10000) - gunscript_waittime(24, 2) + gunscript_allowfeature(24, GUNFEATURE_ATTACK) gunscript_end }; @@ -4883,13 +4883,13 @@ struct guncmd invanim_combatknife_sectopri[] = { struct guncmd invanim_combatknife_throw[] = { gunscript_playanimation(ANIM_GUN_KNIFE_THROW, 0, 10000) gunscript_waitforzreleased(12) - gunscript_waittime(16, 2) + gunscript_allowfeature(16, GUNFEATURE_ATTACK) gunscript_end }; struct guncmd invanim_unused_8007f05c[] = { gunscript_playanimation(ANIM_041C, 0, 10000) - gunscript_waittime(22, 1) + gunscript_allowfeature(22, GUNFEATURE_RELOAD) gunscript_end }; @@ -4967,7 +4967,7 @@ struct weapon invitem_combatknife = { L_GUN_035, // name L_GUN_000, // manufacturer L_GUN_182, // description - WEAPONFLAG_THROWABLE | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_DUALWIELD | WEAPONFLAG_00002000 | WEAPONFLAG_00004000 | WEAPONFLAG_00008000 | WEAPONFLAG_HASHANDS | WEAPONFLAG_04000000, + WEAPONFLAG_THROWABLE | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_DUALWIELD | WEAPONFLAG_HASGUNSCRIPT | WEAPONFLAG_00004000 | WEAPONFLAG_BRIGHTER | WEAPONFLAG_HASHANDS | WEAPONFLAG_KEEPFUNCWHENEMPTY, }; struct weaponfunc_throw invfunc_bug_throw = { @@ -5209,7 +5209,7 @@ struct weapon invitem_cloakingdevice = { L_GUN_073, // name L_GUN_000, // manufacturer L_GUN_195, // description - WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_04000000, + WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_KEEPFUNCWHENEMPTY, }; struct weaponfunc_special invfunc_combatboost_boost = { @@ -5268,7 +5268,7 @@ struct weapon invitem_combatboost = { L_GUN_074, // name L_GUN_000, // manufacturer L_GUN_190, // description - WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_04000000 | WEAPONFLAG_DETERMINER_S_SOME | WEAPONFLAG_DETERMINER_F_SOME, + WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_KEEPFUNCWHENEMPTY | WEAPONFLAG_DETERMINER_S_SOME | WEAPONFLAG_DETERMINER_F_SOME, }; struct weaponfunc_device invfunc_suicidepill_primary = { @@ -5582,7 +5582,7 @@ struct weapon invitem_datauplink = { L_GUN_075, // name L_GUN_000, // manufacturer L_GUN_197, // description - WEAPONFLAG_ONEHANDED | WEAPONFLAG_00000040 | WEAPONFLAG_00002000 | WEAPONFLAG_HASHANDS | WEAPONFLAG_UNDROPPABLE | WEAPONFLAG_FIRETOACTIVATE, + WEAPONFLAG_ONEHANDED | WEAPONFLAG_00000040 | WEAPONFLAG_HASGUNSCRIPT | WEAPONFLAG_HASHANDS | WEAPONFLAG_UNDROPPABLE | WEAPONFLAG_FIRETOACTIVATE, }; struct weapon invitem_doordecoder = { @@ -6131,7 +6131,7 @@ struct weapon invitem_kingsceptre = { L_GUN_027, // name L_GUN_000, // manufacturer L_GUN_000, // description - WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_00002000 | WEAPONFLAG_00004000 | WEAPONFLAG_HASHANDS | WEAPONFLAG_AIMTRACK, + WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_HASGUNSCRIPT | WEAPONFLAG_00004000 | WEAPONFLAG_HASHANDS | WEAPONFLAG_AIMTRACK, }; struct guncmd invanim_tester_shoot[] = { @@ -6191,7 +6191,7 @@ struct weapon invitem_tester = { L_GUN_058, // name L_GUN_000, // manufacturer L_GUN_000, // description - WEAPONFLAG_00000004 | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_00000400 | WEAPONFLAG_00002000 | WEAPONFLAG_00008000, + WEAPONFLAG_00000004 | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_00000400 | WEAPONFLAG_HASGUNSCRIPT | WEAPONFLAG_BRIGHTER, }; struct weapon *g_Weapons[] = { diff --git a/src/game/prop.c b/src/game/prop.c index 98155be72..1fc9478cd 100644 --- a/src/game/prop.c +++ b/src/game/prop.c @@ -2397,7 +2397,7 @@ f32 prop_calculate_autoaim_score(struct prop *prop, struct coord *screenpos, f32 struct prop *playerprop; s32 ok; - if (func && bgun0f0a27c8()) { + if (func && bgun_allows_fullscreen_autoaim()) { usefullscreen = true; } diff --git a/src/include/constants.h b/src/include/constants.h index 0444ca350..64aae5114 100644 --- a/src/include/constants.h +++ b/src/include/constants.h @@ -1222,11 +1222,17 @@ #define GUNAMMOREASON_OPTION 0x01 #define GUNAMMOREASON_NOCONTROL 0x02 +#define GUNAMMOSTATE_DEPLETED -1 +#define GUNAMMOSTATE_NEEDRELOAD 0 +#define GUNAMMOSTATE_CLIPYES_HELDYES 1 +#define GUNAMMOSTATE_CLIPYES_HELDNO 2 +#define GUNAMMOSTATE_CLIPFULL 3 + #define GUNCMD_END 0 #define GUNCMD_SHOWPART 1 #define GUNCMD_HIDEPART 2 #define GUNCMD_WAITFORZRELEASED 3 -#define GUNCMD_WAITTIME 4 +#define GUNCMD_ALLOWFEATURE 4 #define GUNCMD_PLAYSOUND 5 #define GUNCMD_INCLUDE 6 #define GUNCMD_RANDOM 7 @@ -1235,6 +1241,11 @@ #define GUNCMD_PLAYANIMATION 10 #define GUNCMD_SETSOUNDSPEED 11 +#define GUNFEATURE_RELOAD 1 +#define GUNFEATURE_ATTACK 2 +#define GUNFEATURE_ATTACKAGAIN 3 +#define GUNFEATURE_CLICK 5 + #define GUNMEMOWNER_BONDGUN 0 #define GUNMEMOWNER_INVMENU 1 #define GUNMEMOWNER_CHRBODY 2 @@ -4441,9 +4452,9 @@ enum weaponnum { #define WEAPON_MPLOCATION14 254 #define WEAPON_MPLOCATION15 255 -#define INVAIMFLAG_MANUALZOOM 0x00000001 -#define INVAIMFLAG_AUTOAIM 0x00000002 -#define INVAIMFLAG_ACCURATESINGLESHOT 0x00000004 +#define INVAIMFLAG_MANUALZOOM 0x00000001 +#define INVAIMFLAG_AUTOAIM 0x00000002 +#define INVAIMFLAG_ACCURATESINGLESHOT 0x00000004 #define WEAPONFLAG_THROWABLE 0x00000001 // Entire weapon is throwable (eg. grendes, mines, knives) #define WEAPONFLAG_00000004 0x00000004 @@ -4456,9 +4467,9 @@ enum weaponnum { #define WEAPONFLAG_00000400 0x00000400 #define WEAPONFLAG_00000800 0x00000800 // MP briefcase #define WEAPONFLAG_DUALWIELD 0x00001000 // Allow dual wielding -#define WEAPONFLAG_00002000 0x00002000 +#define WEAPONFLAG_HASGUNSCRIPT 0x00002000 #define WEAPONFLAG_00004000 0x00004000 -#define WEAPONFLAG_00008000 0x00008000 // Editor: "Special environment mapping" +#define WEAPONFLAG_BRIGHTER 0x00008000 // Use extra light to illuminate weapon #define WEAPONFLAG_HASHANDS 0x00020000 #define WEAPONFLAG_HIDEMENUMODEL 0x00040000 // Don't display the rotating model in the inventory menu #define WEAPONFLAG_GANGSTA 0x00080000 // Allow turning the gun sideways at close range @@ -4467,8 +4478,8 @@ enum weaponnum { #define WEAPONFLAG_DETERMINER_F_AN 0x00400000 // "Picked up an ..." (full version) #define WEAPONFLAG_DETERMINER_S_THE 0x00800000 // "The ..." (short version - when vertically split) #define WEAPONFLAG_DETERMINER_F_THE 0x01000000 // "Picked up the ..." (full version) -#define WEAPONFLAG_02000000 0x02000000 // Slayer -#define WEAPONFLAG_04000000 0x04000000 +#define WEAPONFLAG_RESETMATRICES 0x02000000 // Slayer +#define WEAPONFLAG_KEEPFUNCWHENEMPTY 0x04000000 // Don't change to secondary function when primary is out of ammo #define WEAPONFLAG_UNDROPPABLE 0x08000000 // Do not drop when disarmed or killed #define WEAPONFLAG_DETERMINER_S_SOME 0x10000000 // "Some ..." (short version - when vertically split) #define WEAPONFLAG_DETERMINER_F_SOME 0x20000000 // "Picked up some ..." (full version) diff --git a/src/include/game/bondgun.h b/src/include/game/bondgun.h index 6ba6383f3..7a8adb5ce 100644 --- a/src/include/game/bondgun.h +++ b/src/include/game/bondgun.h @@ -14,27 +14,26 @@ void bgun_tick_unequipped_reload(void); bool bgun_test_gun_vis_command(struct gunviscmd *cmd, struct hand *hand); void bgun_set_part_visible(s16 partnum, bool visible, struct hand *hand, struct modeldef *modeldef); void bgun_execute_gun_vis_commands(struct hand *hand, struct modeldef *arg1, struct gunviscmd *command); -void bgun0f098030(struct hand *hand, struct modeldef *arg1); -f32 bgun0f09815c(struct hand *hand); -void bgun0f0981e8(struct hand *hand, struct modeldef *modeldef); -bool bgun0f098884(struct guncmd *cmd, struct gset *gset); +void bgun_update_ammo_visibility(struct hand *hand, struct modeldef *arg1); +f32 bgun_get_current_keyframe(struct hand *hand); +void bgun_tick_anim(struct hand *hand, struct modeldef *modeldef); +bool bgun_test_condition(struct guncmd *cmd, struct gset *gset); void bgun_start_animation(struct guncmd *cmd, s32 handnum, struct hand *hand); -bool bgun0f098a44(struct hand *hand, s32 time); bool bgun_is_anim_busy(struct hand *hand); void bgun_reset_anim(struct hand *hand); void bgun_get_weapon_info(struct handweaponinfo *info, s32 handnum); -s32 bgun0f098ca0(s32 arg0, struct handweaponinfo *info, struct hand *hand); +s32 bgun_get_ammo_state(s32 arg0, struct handweaponinfo *info, struct hand *hand); void bgun0f098df8(s32 weaponfunc, struct handweaponinfo *info, struct hand *hand, u8 onebullet, u8 checkunequipped); void bgun0f098f8c(struct handweaponinfo *info, struct hand *hand); -bool bgun0f099008(s32 handnum); +bool bgun_clip_has_ammo(s32 handnum); bool bgun0f0990b0(struct weaponfunc *basefunc, struct weapon *weapon); bool bgun0f099188(struct hand *hand, s32 gunfunc); s32 bgun_tick_inc_idle(struct handweaponinfo *info, s32 handnum, struct hand *hand, s32 lvupdate); void bgun_set_arm_pitch(struct hand *hand, f32 angle); -s32 bgun_tick_inc_auto_switch(struct handweaponinfo *info, s32 handnum, struct hand *hand, s32 lvupdate); +s32 bgun_tick_inc_autoswitch(struct handweaponinfo *info, s32 handnum, struct hand *hand, s32 lvupdate); bool bgun_is_reloading(struct hand *hand); s32 bgun_tick_inc_reload(struct handweaponinfo *info, s32 handnum, struct hand *hand, s32 lvupdate); -s32 bgun_tick_inc_change_func(struct handweaponinfo *info, s32 handnum, struct hand *hand, s32 lvupdate); +s32 bgun_tick_inc_changefunc(struct handweaponinfo *info, s32 handnum, struct hand *hand, s32 lvupdate); s32 bgun0f09a3f8(struct hand *hand, struct weaponfunc *func); void bgun0f09a6f8(struct handweaponinfo *info, s32 handnum, struct hand *hand, struct weaponfunc *func); bool bgun_tick_recoil(struct hand *hand, struct handweaponinfo *info, s32 handnum, struct weaponfunc_shoot *func); @@ -43,12 +42,12 @@ bool bgun_tick_inc_attacking_throw(s32 handnum, struct hand *hand); s32 bgun_get_min_clip_qty(s32 weaponnum, s32 funcnum); bool bgun_tick_inc_attacking_melee(s32 handnum, struct hand *hand); bool bgun_tick_inc_attacking_special(struct hand *hand); -s32 bgun_tick_inc_attack_empty(struct handweaponinfo *info, s32 handnum, struct hand *hand, s32 lvupdate); +s32 bgun_tick_inc_attackempty(struct handweaponinfo *info, s32 handnum, struct hand *hand, s32 lvupdate); s32 bgun_tick_inc_attack(struct handweaponinfo *info, s32 handnum, struct hand *hand, s32 lvupdate); bool bgun_is_ready_to_switch(s32 handnum); bool bgun_can_free_weapon(s32 handnum); bool bgun0f09bf44(s32 handnum); -s32 bgun_tick_inc_change_gun(struct handweaponinfo *info, s32 handnum, struct hand *hand, s32 lvupdate); +s32 bgun_tick_inc_changegun(struct handweaponinfo *info, s32 handnum, struct hand *hand, s32 lvupdate); s32 bgun_tick_inc_state2(struct handweaponinfo *info, s32 handnum, struct hand *hand, s32 lvupdate); s32 bgun_tick_inc(struct handweaponinfo *info, s32 handnum, s32 lvupdate); bool bgun_set_state(s32 handnum, s32 state); @@ -114,7 +113,7 @@ void bgun_start_slide(s32 handnum); void bgun_update_slide(s32 handnum); f32 bgun0f0a2498(f32 arg0, f32 arg1, f32 arg2, f32 arg3); void bgun0f0a24f0(struct coord *arg0, s32 handnum); -bool bgun0f0a27c8(void); +bool bgun_allows_fullscreen_autoaim(void); void bgun_handle_player_dead(void); bool bgun_is_mission_critical(s32 weaponnum); void bgun_disarm(struct prop *attacker); @@ -129,7 +128,7 @@ void bgun_update_sniper_rifle(struct modeldef *modeldef, u8 *allocation); void bgun_update_devastator(struct hand *hand, u8 *allocation, struct modeldef *modeldef); void bgun_update_shotgun(struct hand *hand, u8 *allocation, bool *arg2, struct modeldef *modeldef); void bgun_update_laser(struct hand *hand); -void bgun_update_magnum(struct hand *hand, s32 handnum, struct modeldef *modeldef, Mtxf *mtx); +void bgun_eject_magnum_casings(struct hand *hand, s32 handnum, struct modeldef *modeldef, Mtxf *mtx); void bgun_update_rocket_launcher(struct hand *hand, s32 handnum, struct weaponfunc_shootprojectile *func); void bgun0f0a45d0(struct hand *hand, struct modeldef *modeldef, bool isdetonator); void bgun_tick_eject(struct hand *hand, struct modeldef *modeldef, bool isdetonator); diff --git a/src/include/gunscript.h b/src/include/gunscript.h index 224c1dd7c..636a63e15 100644 --- a/src/include/gunscript.h +++ b/src/include/gunscript.h @@ -10,20 +10,20 @@ #define gunscript_waitforzreleased(keyframe) \ { GUNCMD_WAITFORZRELEASED, 0, keyframe }, -#define gunscript_waittime(keyframe, time) \ - { GUNCMD_WAITTIME, 0, keyframe, time }, +#define gunscript_allowfeature(keyframe, feature) \ + { GUNCMD_ALLOWFEATURE, 0, keyframe, feature }, #define gunscript_playsound(keyframe, sound) \ { GUNCMD_PLAYSOUND, 0, keyframe, sound }, #define gunscript_include(unk1, address) \ - { GUNCMD_INCLUDE, unk1, 0, (u32)address }, + { GUNCMD_INCLUDE, unk1, 0, (uintptr_t) address }, #define gunscript_random(probability, address) \ - { GUNCMD_RANDOM, 0, probability, (u32)address }, + { GUNCMD_RANDOM, 0, probability, (uintptr_t) address }, -#define gunscript_repeatuntilfull(triggerkey, dontloop, gototrigger) \ - { GUNCMD_REPEATUNTILFULL, 0, triggerkey, (dontloop << 16) | gototrigger }, +#define gunscript_repeatuntilfull(keyframe, gotokeyframe) \ + { GUNCMD_REPEATUNTILFULL, 0, keyframe, gotokeyframe }, #define gunscript_popoutsackofpills(unk1) \ { GUNCMD_POPOUTSACKOFPILLS, 0, unk1 }, diff --git a/src/include/types.h b/src/include/types.h index a61323cb1..aa069bea4 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -2216,7 +2216,7 @@ struct hand { /*0x0cc8*/ u8 unk0cc8_01 : 1; /*0x0cc8*/ u8 unk0cc8_02 : 1; /*0x0cc8*/ u8 incrementalreloading : 1; - /*0x0cc8*/ u8 unk0cc8_04 : 3; + /*0x0cc8*/ u8 ejectcount : 3; /*0x0cc8*/ u8 unk0cc8_07 : 1; /*0x0cc8*/ u8 unk0cc8_08 : 1; /*0x0cc9*/ u8 animloopcount; @@ -2225,7 +2225,7 @@ struct hand { /*0x0cdc*/ u32 statejob; /*0x0ce0*/ s32 statevar1; /*0x0ce4*/ s32 attacktype; - /*0x0ce8*/ struct guncmd *unk0ce8; + /*0x0ce8*/ struct guncmd *animcmd; /*0x0cec*/ ubool hasdotinfo; /*0x0cf0*/ struct coord dotpos; /*0x0cfc*/ struct coord dotrot; @@ -2248,7 +2248,7 @@ struct hand { /*0x0d50*/ f32 unk0d50[3][3]; /*0x0d74*/ u16 gunroundsspent[4]; // actually a countdown timer /*0x0d7c*/ s32 ispare1; - /*0x0d80*/ struct guncmd *unk0d80; + /*0x0d80*/ struct guncmd *animcmd2; /*0x0d84*/ struct sndstate *audiohandle; /*0x0d88*/ u32 ispare4; /*0x0d8c*/ u32 ispare5; @@ -2266,8 +2266,8 @@ struct hand { /*0x0dbc*/ u32 fspare7; /*0x0dc0*/ u32 fspare8; /*0x0dc4*/ struct abmag abmag; - /*0x0dcc*/ s32 *unk0dcc; - /*0x0dd0*/ s32 *unk0dd0; + /*0x0dcc*/ s32 *compiledgunmodelcmds; + /*0x0dd0*/ s32 *compiledhandmodelcmds; /*0x0dd4*/ s32 unk0dd4; /*0x0dd8*/ Mtxf *unk0dd8; }; @@ -5252,9 +5252,21 @@ struct stageallocation { struct guncmd { u8 type; - u8 unk01; - u16 unk02; - s32 unk04; + u8 condition; + union { + u16 animnum; + u16 keyframe; + u16 probability; + }; + union { + s32 feature; + s32 partnum; + s32 soundnum; + s32 soundspeed; + s32 animparams; + s32 gotokeyframe; + struct guncmd *targetcmd; + }; }; struct pakthing {