mirror of
https://github.com/DrBeef/RTCWQuest.git
synced 2025-04-22 23:11:02 +00:00
Add weapon spread configuration
This commit is contained in:
parent
e42680ca81
commit
bea98592d2
5 changed files with 49 additions and 14 deletions
|
@ -1509,6 +1509,7 @@ void RTCWVR_Init()
|
|||
vr_haptic_intensity = Cvar_Get ("vr_haptic_intensity", "1.0", CVAR_ARCHIVE);
|
||||
vr_menu_item_touched = Cvar_Get ("vr_menu_item_touched", "0", CVAR_TEMP);
|
||||
vr_refresh = Cvar_Get ("vr_refresh", "72", CVAR_ARCHIVE);
|
||||
vr_spread_reduce = Cvar_Get ("vr_spread_reduce", "0", CVAR_ARCHIVE);
|
||||
|
||||
//Defaults
|
||||
vr_control_scheme = Cvar_Get( "vr_control_scheme", "0", CVAR_ARCHIVE);
|
||||
|
|
|
@ -21,3 +21,4 @@ cvar_t *vr_irl_crouch_to_stand_ratio;
|
|||
cvar_t *vr_haptic_intensity;
|
||||
cvar_t *vr_menu_item_touched;
|
||||
cvar_t *vr_refresh;
|
||||
cvar_t *vr_spread_reduce;
|
||||
|
|
|
@ -2014,6 +2014,9 @@ void FireWeapon( gentity_t *ent ) {
|
|||
}
|
||||
|
||||
// fire the specific weapon
|
||||
float spreadReduce = 0;
|
||||
trap_Cvar_VariableValue("vr_spread_reduce", &spreadReduce);
|
||||
float spreadCorrection = 1 - spreadReduce;
|
||||
switch ( ent->s.weapon ) {
|
||||
case WP_KNIFE:
|
||||
Weapon_Knife( ent );
|
||||
|
@ -2025,26 +2028,26 @@ void FireWeapon( gentity_t *ent ) {
|
|||
// jpw
|
||||
break;
|
||||
case WP_LUGER:
|
||||
Bullet_Fire( ent, LUGER_SPREAD * aimSpreadScale, LUGER_DAMAGE );
|
||||
Bullet_Fire( ent, LUGER_SPREAD * aimSpreadScale * (ent->aiCharacter ? 1 : spreadCorrection), LUGER_DAMAGE );
|
||||
if (gVR && !( ent->r.svFlags & SVF_CASTAI )) // only recoil the weapon if this is the player
|
||||
gVR->weapon_recoil = WEAPON_RECOIL;
|
||||
break;
|
||||
case WP_SILENCER:
|
||||
Bullet_Fire( ent, SILENCER_SPREAD * aimSpreadScale, LUGER_DAMAGE );
|
||||
Bullet_Fire( ent, SILENCER_SPREAD * aimSpreadScale * (ent->aiCharacter ? 1 : spreadCorrection), LUGER_DAMAGE );
|
||||
if (gVR && !( ent->r.svFlags & SVF_CASTAI )) // only recoil the weapon if this is the player
|
||||
gVR->weapon_recoil = WEAPON_RECOIL;
|
||||
break;
|
||||
case WP_AKIMBO: //----(SA) added
|
||||
case WP_COLT:
|
||||
Bullet_Fire( ent, COLT_SPREAD * aimSpreadScale, COLT_DAMAGE );
|
||||
Bullet_Fire( ent, COLT_SPREAD * aimSpreadScale * (ent->aiCharacter ? 1 : spreadCorrection), COLT_DAMAGE );
|
||||
if (gVR && !( ent->r.svFlags & SVF_CASTAI )) // only recoil the weapon if this is the player
|
||||
gVR->weapon_recoil = WEAPON_RECOIL;
|
||||
break;
|
||||
case WP_VENOM:
|
||||
weapon_venom_fire( ent, qfalse, aimSpreadScale );
|
||||
weapon_venom_fire( ent, qfalse, aimSpreadScale * (ent->aiCharacter ? 1 : spreadCorrection) );
|
||||
break;
|
||||
case WP_SNIPERRIFLE:
|
||||
Bullet_Fire( ent, SNIPER_SPREAD * aimSpreadScale, SNIPER_DAMAGE );
|
||||
Bullet_Fire( ent, SNIPER_SPREAD * aimSpreadScale * (ent->aiCharacter ? 1 : spreadCorrection), SNIPER_DAMAGE );
|
||||
// JPW NERVE -- added muzzle flip in multiplayer
|
||||
if ( !ent->aiCharacter ) {
|
||||
// if (g_gametype.integer != GT_SINGLE_PLAYER) {
|
||||
|
@ -2058,7 +2061,7 @@ void FireWeapon( gentity_t *ent ) {
|
|||
// jpw
|
||||
break;
|
||||
case WP_SNOOPERSCOPE:
|
||||
Bullet_Fire( ent, SNOOPER_SPREAD * aimSpreadScale, SNOOPER_DAMAGE );
|
||||
Bullet_Fire( ent, SNOOPER_SPREAD * aimSpreadScale * (ent->aiCharacter ? 1 : spreadCorrection), SNOOPER_DAMAGE );
|
||||
// JPW NERVE -- added muzzle flip in multiplayer
|
||||
if ( !ent->aiCharacter ) {
|
||||
// if (g_gametype.integer != GT_SINGLE_PLAYER) {
|
||||
|
@ -2071,10 +2074,10 @@ void FireWeapon( gentity_t *ent ) {
|
|||
// jpw
|
||||
break;
|
||||
case WP_MAUSER:
|
||||
Bullet_Fire( ent, MAUSER_SPREAD * aimSpreadScale, MAUSER_DAMAGE );
|
||||
Bullet_Fire( ent, MAUSER_SPREAD * aimSpreadScale * (ent->aiCharacter ? 1 : spreadCorrection), MAUSER_DAMAGE );
|
||||
break;
|
||||
case WP_GARAND:
|
||||
Bullet_Fire( ent, GARAND_SPREAD * aimSpreadScale, GARAND_DAMAGE );
|
||||
Bullet_Fire( ent, GARAND_SPREAD * aimSpreadScale * (ent->aiCharacter ? 1 : spreadCorrection), GARAND_DAMAGE );
|
||||
break;
|
||||
//----(SA) added
|
||||
case WP_FG42SCOPE:
|
||||
|
@ -2088,19 +2091,19 @@ void FireWeapon( gentity_t *ent ) {
|
|||
SetClientViewAngle( ent,viewang );
|
||||
}
|
||||
case WP_FG42:
|
||||
Bullet_Fire( ent, FG42_SPREAD * aimSpreadScale, FG42_DAMAGE );
|
||||
Bullet_Fire( ent, FG42_SPREAD * aimSpreadScale * (ent->aiCharacter ? 1 : spreadCorrection), FG42_DAMAGE );
|
||||
break;
|
||||
//----(SA) end
|
||||
case WP_STEN:
|
||||
Bullet_Fire( ent, STEN_SPREAD * aimSpreadScale, STEN_DAMAGE );
|
||||
Bullet_Fire( ent, STEN_SPREAD * aimSpreadScale * (ent->aiCharacter ? 1 : spreadCorrection), STEN_DAMAGE );
|
||||
break;
|
||||
case WP_AKIMBO_MP40:
|
||||
case WP_MP40:
|
||||
Bullet_Fire( ent, MP40_SPREAD * aimSpreadScale, MP40_DAMAGE );
|
||||
Bullet_Fire( ent, MP40_SPREAD * aimSpreadScale * (ent->aiCharacter ? 1 : spreadCorrection), MP40_DAMAGE );
|
||||
break;
|
||||
case WP_AKIMBO_THOMPSON:
|
||||
case WP_THOMPSON:
|
||||
Bullet_Fire( ent, THOMPSON_SPREAD * aimSpreadScale, THOMPSON_DAMAGE );
|
||||
Bullet_Fire( ent, THOMPSON_SPREAD * aimSpreadScale * (ent->aiCharacter ? 1 : spreadCorrection), THOMPSON_DAMAGE );
|
||||
break;
|
||||
case WP_PANZERFAUST:
|
||||
ent->client->ps.classWeaponTime = level.time; // JPW NERVE
|
||||
|
|
|
@ -320,7 +320,22 @@ itemDef
|
|||
visible 1
|
||||
}
|
||||
|
||||
|
||||
itemDef {
|
||||
name vr
|
||||
group grpControls
|
||||
type ITEM_TYPE_SLIDER
|
||||
text "Weapon Spread Reduce:"
|
||||
cvarfloat "vr_spread_reduce" 0 0 1
|
||||
rect 82 240 290 12
|
||||
textalign ITEM_ALIGN_RIGHT
|
||||
textalignx 142
|
||||
textaligny 10
|
||||
textscale .23
|
||||
style WINDOW_STYLE_FILLED
|
||||
backcolor 1 1 1 .07
|
||||
forecolor 1 1 1 1
|
||||
visible 1
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -294,7 +294,22 @@ itemDef
|
|||
visible 1
|
||||
}
|
||||
|
||||
|
||||
itemDef {
|
||||
name ingame_vr
|
||||
group grpControls
|
||||
type ITEM_TYPE_SLIDER
|
||||
text "Weapon Spread Reduce:"
|
||||
cvarfloat "vr_spread_reduce" 0 0 1
|
||||
rect 82 240 290 12
|
||||
textalign ITEM_ALIGN_RIGHT
|
||||
textalignx 142
|
||||
textaligny 10
|
||||
textscale .23
|
||||
style WINDOW_STYLE_FILLED
|
||||
backcolor 1 1 1 .07
|
||||
forecolor 1 1 1 1
|
||||
visible 1
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue