mirror of
https://github.com/DrBeef/JKXR.git
synced 2024-11-25 13:31:03 +00:00
TBDC and more..
- Merged TBDC changes from JKO - Made B/Y buttons not switch when switched sticks (so saber toggle is on correct hand) - Fixed issue with switched sticks making item selector scroll use wrong thumbstick - Fix crash when using built in menu to choose alternative saber (need to find out where model has gone though)
This commit is contained in:
parent
72fc1b9b83
commit
fc72b58bb6
15 changed files with 191 additions and 57 deletions
|
@ -56,9 +56,11 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
|
||||||
uint32_t secondaryButtonsNew;
|
uint32_t secondaryButtonsNew;
|
||||||
uint32_t secondaryButtonsOld;
|
uint32_t secondaryButtonsOld;
|
||||||
int primaryButton1;
|
int primaryButton1;
|
||||||
int primaryButton2;
|
bool primaryButton2New;
|
||||||
|
bool primaryButton2Old;
|
||||||
int secondaryButton1;
|
int secondaryButton1;
|
||||||
int secondaryButton2;
|
bool secondaryButton2New;
|
||||||
|
bool secondaryButton2Old;
|
||||||
int primaryThumb;
|
int primaryThumb;
|
||||||
int secondaryThumb;
|
int secondaryThumb;
|
||||||
if (vr_control_scheme->integer == LEFT_HANDED_DEFAULT && vr_switch_sticks->integer)
|
if (vr_control_scheme->integer == LEFT_HANDED_DEFAULT && vr_switch_sticks->integer)
|
||||||
|
@ -76,6 +78,7 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
|
||||||
primaryThumb = xrButton_RThumb;
|
primaryThumb = xrButton_RThumb;
|
||||||
secondaryThumb = xrButton_LThumb;
|
secondaryThumb = xrButton_LThumb;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vr_switch_sticks->integer)
|
if (vr_switch_sticks->integer)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
|
@ -88,9 +91,7 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
|
||||||
primaryButtonsNew = pOffTrackedRemoteNew->Buttons;
|
primaryButtonsNew = pOffTrackedRemoteNew->Buttons;
|
||||||
primaryButtonsOld = pOffTrackedRemoteOld->Buttons;
|
primaryButtonsOld = pOffTrackedRemoteOld->Buttons;
|
||||||
primaryButton1 = offButton1;
|
primaryButton1 = offButton1;
|
||||||
primaryButton2 = offButton2;
|
|
||||||
secondaryButton1 = domButton1;
|
secondaryButton1 = domButton1;
|
||||||
secondaryButton2 = domButton2;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -101,11 +102,15 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
|
||||||
secondaryButtonsNew = pOffTrackedRemoteNew->Buttons;
|
secondaryButtonsNew = pOffTrackedRemoteNew->Buttons;
|
||||||
secondaryButtonsOld = pOffTrackedRemoteOld->Buttons;
|
secondaryButtonsOld = pOffTrackedRemoteOld->Buttons;
|
||||||
primaryButton1 = domButton1;
|
primaryButton1 = domButton1;
|
||||||
primaryButton2 = domButton2;
|
|
||||||
secondaryButton1 = offButton1;
|
secondaryButton1 = offButton1;
|
||||||
secondaryButton2 = offButton2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Don't switch B/Y buttons even if switched sticks
|
||||||
|
primaryButton2New = domButton2 & pDominantTrackedRemoteNew->Buttons;
|
||||||
|
primaryButton2Old = domButton2 & pDominantTrackedRemoteOld->Buttons;
|
||||||
|
secondaryButton2New = offButton2 & pOffTrackedRemoteNew->Buttons;
|
||||||
|
secondaryButton2Old = offButton2 & pOffTrackedRemoteOld->Buttons;
|
||||||
|
|
||||||
//Allow weapon alignment mode toggle on x
|
//Allow weapon alignment mode toggle on x
|
||||||
if (vr_align_weapons->value)
|
if (vr_align_weapons->value)
|
||||||
{
|
{
|
||||||
|
@ -173,14 +178,7 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*else if(cl.serverTime > vr.saberBlockDebounce + 3000)
|
|
||||||
{
|
|
||||||
if(vr.saberBounceMove < 82)
|
|
||||||
{
|
|
||||||
vr.saberBounceMove = 82;
|
|
||||||
}
|
|
||||||
vr.saberBlockDebounce = cl.serverTime + TBDC_SABER_BOUNCETIME;
|
|
||||||
}*/
|
|
||||||
QuatToYawPitchRoll(pWeapon->Pose.orientation, rotation, vr.weaponangles[ANGLES_SABER]);
|
QuatToYawPitchRoll(pWeapon->Pose.orientation, rotation, vr.weaponangles[ANGLES_SABER]);
|
||||||
QuatToYawPitchRoll(pOff->Pose.orientation, rotation, vr.offhandangles[ANGLES_SABER]);
|
QuatToYawPitchRoll(pOff->Pose.orientation, rotation, vr.offhandangles[ANGLES_SABER]);
|
||||||
|
|
||||||
|
@ -225,9 +223,7 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
|
||||||
}
|
}
|
||||||
|
|
||||||
//Close the datapad
|
//Close the datapad
|
||||||
if (((secondaryButtonsNew & secondaryButton2) !=
|
if (secondaryButton2New && !secondaryButton2Old) {
|
||||||
(secondaryButtonsOld & secondaryButton2)) &&
|
|
||||||
(secondaryButtonsNew & secondaryButton2)) {
|
|
||||||
Sys_QueEvent(0, SE_KEY, A_TAB, true, 0, NULL);
|
Sys_QueEvent(0, SE_KEY, A_TAB, true, 0, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -307,15 +303,26 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
|
||||||
|
|
||||||
//Left/right to switch between which selector we are using
|
//Left/right to switch between which selector we are using
|
||||||
if (vr.item_selector == 1) {
|
if (vr.item_selector == 1) {
|
||||||
|
float x, y;
|
||||||
|
if (vr_switch_sticks->integer)
|
||||||
|
{
|
||||||
|
x = pSecondaryJoystick->x;
|
||||||
|
y = pSecondaryJoystick->y;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
x = pPrimaryJoystick->x;
|
||||||
|
y = pPrimaryJoystick->y;
|
||||||
|
}
|
||||||
static bool selectorSwitched = false;
|
static bool selectorSwitched = false;
|
||||||
if (between(-0.2f, pPrimaryJoystick->y, 0.2f) &&
|
if (between(-0.2f, y, 0.2f) &&
|
||||||
(primaryJoystickX > 0.8f || primaryJoystickX < -0.8f)) {
|
(x > 0.8f || x < -0.8f)) {
|
||||||
|
|
||||||
if (!selectorSwitched) {
|
if (!selectorSwitched) {
|
||||||
if (primaryJoystickX > 0.8f) {
|
if (x > 0.8f) {
|
||||||
sendButtonActionSimple("itemselectornext");
|
sendButtonActionSimple("itemselectornext");
|
||||||
selectorSwitched = true;
|
selectorSwitched = true;
|
||||||
} else if (primaryJoystickX < -0.8f) {
|
} else if (x < -0.8f) {
|
||||||
sendButtonActionSimple("itemselectorprev");
|
sendButtonActionSimple("itemselectorprev");
|
||||||
selectorSwitched = true;
|
selectorSwitched = true;
|
||||||
}
|
}
|
||||||
|
@ -327,20 +334,31 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
|
||||||
|
|
||||||
//Left/right to switch between which selector we are using
|
//Left/right to switch between which selector we are using
|
||||||
if (vr.item_selector == 2) {
|
if (vr.item_selector == 2) {
|
||||||
|
float x, y;
|
||||||
|
if (vr_switch_sticks->integer)
|
||||||
|
{
|
||||||
|
x = pPrimaryJoystick->x;
|
||||||
|
y = pPrimaryJoystick->y;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
x = pSecondaryJoystick->x;
|
||||||
|
y = pSecondaryJoystick->y;
|
||||||
|
}
|
||||||
static bool selectorSwitched = false;
|
static bool selectorSwitched = false;
|
||||||
if (between(-0.2f, pSecondaryJoystick->y, 0.2f) &&
|
if (between(-0.2f, y, 0.2f) &&
|
||||||
(pSecondaryJoystick->x > 0.8f || pSecondaryJoystick->x < -0.8f)) {
|
(x > 0.8f || x < -0.8f)) {
|
||||||
|
|
||||||
if (!selectorSwitched) {
|
if (!selectorSwitched) {
|
||||||
if (pSecondaryJoystick->x > 0.8f) {
|
if (x > 0.8f) {
|
||||||
sendButtonActionSimple("itemselectornext");
|
sendButtonActionSimple("itemselectornext");
|
||||||
selectorSwitched = true;
|
selectorSwitched = true;
|
||||||
} else if (pSecondaryJoystick->x < -0.8f) {
|
} else if (x < -0.8f) {
|
||||||
sendButtonActionSimple("itemselectorprev");
|
sendButtonActionSimple("itemselectorprev");
|
||||||
selectorSwitched = true;
|
selectorSwitched = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (between(-0.4f, pSecondaryJoystick->x, 0.4f)) {
|
} else if (between(-0.4f, x, 0.4f)) {
|
||||||
selectorSwitched = false;
|
selectorSwitched = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -716,7 +734,7 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
|
||||||
}
|
}
|
||||||
|
|
||||||
//B Button
|
//B Button
|
||||||
if ((primaryButtonsNew & primaryButton2) != (primaryButtonsOld & primaryButton2)) {
|
if (primaryButton2New != primaryButton2Old) {
|
||||||
if (vr.cgzoommode == 1 || vr.cgzoommode == 3)
|
if (vr.cgzoommode == 1 || vr.cgzoommode == 3)
|
||||||
{ // Exit scope only when using binoculars or nightvision
|
{ // Exit scope only when using binoculars or nightvision
|
||||||
sendButtonActionSimple("exitscope");
|
sendButtonActionSimple("exitscope");
|
||||||
|
@ -724,13 +742,13 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
|
||||||
else if (cl.frame.ps.weapon == WP_SABER && vr.velocitytriggered)
|
else if (cl.frame.ps.weapon == WP_SABER && vr.velocitytriggered)
|
||||||
{
|
{
|
||||||
//B button toggles saber on/off in first person
|
//B button toggles saber on/off in first person
|
||||||
if (primaryButtonsNew & primaryButton2) {
|
if (primaryButton2New && !primaryButton2Old) {
|
||||||
sendButtonActionSimple("togglesaber");
|
sendButtonActionSimple("togglesaber");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (cl.frame.ps.weapon != WP_DISRUPTOR)
|
else if (cl.frame.ps.weapon != WP_DISRUPTOR)
|
||||||
{
|
{
|
||||||
sendButtonAction("+altattack", (primaryButtonsNew & primaryButton2));
|
sendButtonAction("+altattack", primaryButton2New);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -811,7 +829,7 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
|
||||||
{
|
{
|
||||||
//Apply a filter and quadratic scaler so small movements are easier to make
|
//Apply a filter and quadratic scaler so small movements are easier to make
|
||||||
float dist = 0;
|
float dist = 0;
|
||||||
if (vr.item_selector != 2)
|
if (vr.item_selector != (vr_switch_sticks->integer ? 1 : 2))
|
||||||
{
|
{
|
||||||
dist = length(pSecondaryJoystick->x, pSecondaryJoystick->y);
|
dist = length(pSecondaryJoystick->x, pSecondaryJoystick->y);
|
||||||
}
|
}
|
||||||
|
@ -844,9 +862,7 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
|
||||||
}
|
}
|
||||||
|
|
||||||
//Open the datapad
|
//Open the datapad
|
||||||
if (((secondaryButtonsNew & secondaryButton2) !=
|
if (secondaryButton2New && !secondaryButton2Old) {
|
||||||
(secondaryButtonsOld & secondaryButton2)) &&
|
|
||||||
(secondaryButtonsNew & secondaryButton2)) {
|
|
||||||
Sys_QueEvent(0, SE_KEY, A_TAB, true, 0, NULL);
|
Sys_QueEvent(0, SE_KEY, A_TAB, true, 0, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3063,9 +3063,24 @@ static void CG_DrawCrosshair3D(int type) // 0 - force, 1 - weapons
|
||||||
|
|
||||||
ent.radius = w / 640 * xmax * trace.fraction * 2048 / 64.0f;
|
ent.radius = w / 640 * xmax * trace.fraction * 2048 / 64.0f;
|
||||||
ent.customShader = hShader;
|
ent.customShader = hShader;
|
||||||
ent.shaderRGBA[0] = (type == 0 && !cg_forceCrosshair) ? 0 : 255;
|
if(type == 0 && !cg_forceCrosshair) //Not Active Force Crosshair
|
||||||
ent.shaderRGBA[1] = (type == 0) ? 0 : 255;
|
{
|
||||||
|
ent.shaderRGBA[0] = 255;
|
||||||
|
ent.shaderRGBA[1] = 180;
|
||||||
|
ent.shaderRGBA[2] = 180;
|
||||||
|
}
|
||||||
|
else if(type == 0) //Active Force Crosshair
|
||||||
|
{
|
||||||
|
ent.shaderRGBA[0] = 255;
|
||||||
|
ent.shaderRGBA[1] = 90;
|
||||||
|
ent.shaderRGBA[2] = 90;
|
||||||
|
}
|
||||||
|
else //Regular Crosshair
|
||||||
|
{
|
||||||
|
ent.shaderRGBA[0] = 255;
|
||||||
|
ent.shaderRGBA[1] = 255;
|
||||||
ent.shaderRGBA[2] = 255;
|
ent.shaderRGBA[2] = 255;
|
||||||
|
}
|
||||||
ent.shaderRGBA[3] = 255;
|
ent.shaderRGBA[3] = 255;
|
||||||
|
|
||||||
cgi_R_AddRefEntityToScene(&ent);
|
cgi_R_AddRefEntityToScene(&ent);
|
||||||
|
|
|
@ -33,6 +33,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
#include "../Rufl/hstring.h"
|
#include "../Rufl/hstring.h"
|
||||||
#include "bg_local.h"
|
#include "bg_local.h"
|
||||||
#include <JKXR/VrClientInfo.h>
|
#include <JKXR/VrClientInfo.h>
|
||||||
|
#include <JKXR/VrTBDC.h>
|
||||||
|
|
||||||
#define LOOK_SWING_SCALE 0.5f
|
#define LOOK_SWING_SCALE 0.5f
|
||||||
#define CG_SWINGSPEED 0.3f
|
#define CG_SWINGSPEED 0.3f
|
||||||
|
@ -6810,12 +6811,12 @@ Ghoul2 Insert End
|
||||||
|
|
||||||
if (CG_getPlayer1stPersonSaber(cent) &&
|
if (CG_getPlayer1stPersonSaber(cent) &&
|
||||||
cent->gent->client->ps.saberEventFlags & (SEF_BLOCKED|SEF_PARRIED) &&
|
cent->gent->client->ps.saberEventFlags & (SEF_BLOCKED|SEF_PARRIED) &&
|
||||||
|
cent->gent->client->ps.saberBounceMove != LS_NONE &&
|
||||||
vr->saberBlockDebounce < cg.time &&
|
vr->saberBlockDebounce < cg.time &&
|
||||||
bladeNum == 0) // Only need to do this for the first blade
|
bladeNum == 0) // Only need to do this for the first blade
|
||||||
{
|
{
|
||||||
cvar_t *vr_saber_block_debounce_time = gi.cvar("vr_saber_block_debounce_time", "200", CVAR_ARCHIVE); // defined in VrCvars.h
|
vr->saberBlockDebounce = cg.time + TBDC_SABER_BOUNCETIME;
|
||||||
vr->saberBlockDebounce = cg.time + vr_saber_block_debounce_time->integer;
|
vr->saberBounceMove = cent->gent->client->ps.saberBounceMove;
|
||||||
|
|
||||||
cgi_HapticEvent("shotgun_fire", 0, vr->right_handed ? (2 - saberNum) : (1 + saberNum), 100, 0, 0);
|
cgi_HapticEvent("shotgun_fire", 0, vr->right_handed ? (2 - saberNum) : (1 + saberNum), 100, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8532,7 +8533,8 @@ Ghoul2 Insert End
|
||||||
|
|
||||||
for ( int saberNum = 0; saberNum < numSabers; saberNum++ )
|
for ( int saberNum = 0; saberNum < numSabers; saberNum++ )
|
||||||
{
|
{
|
||||||
if (saberNum == 0 && cent->currentState.saberInFlight)
|
if ((saberNum == 0 && cent->currentState.saberInFlight) ||
|
||||||
|
cent->gent->client->ps.saber[saberNum].name == nullptr)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2257,11 +2257,40 @@ int NPC_ShotEntity( gentity_t *ent, vec3_t impactPos )
|
||||||
}
|
}
|
||||||
|
|
||||||
int location = Q_irand(0, 99);
|
int location = Q_irand(0, 99);
|
||||||
if (location < 65 || cg.renderingThirdPerson ||
|
int torsoRatio = 65;
|
||||||
|
int legsRatio = 20;
|
||||||
|
int headRatio = 15;
|
||||||
|
|
||||||
|
switch ( g_spskill->integer )
|
||||||
|
{
|
||||||
|
//Easiest difficulty, low chance of hittitng anything else
|
||||||
|
case 0:
|
||||||
|
torsoRatio = 90;
|
||||||
|
legsRatio = 5;
|
||||||
|
headRatio = 5;
|
||||||
|
break;
|
||||||
|
|
||||||
|
//Medium difficulty, half-half chance of picking up the player
|
||||||
|
case 1:
|
||||||
|
torsoRatio = 60;
|
||||||
|
legsRatio = 25;
|
||||||
|
headRatio = 15;
|
||||||
|
break;
|
||||||
|
|
||||||
|
//Hardest difficulty, always turn on attacking player
|
||||||
|
case 2:
|
||||||
|
default:
|
||||||
|
torsoRatio = 50;
|
||||||
|
legsRatio = 35;
|
||||||
|
headRatio = 15;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (location < torsoRatio || cg.renderingThirdPerson ||
|
||||||
ent->client == NULL || ent->client->ps.clientNum != 0) {
|
ent->client == NULL || ent->client->ps.clientNum != 0) {
|
||||||
// 65% chance (unless ent is not the player, then always go for chest, which is original behaviour)
|
// 65% chance (unless ent is not the player, then always go for chest, which is original behaviour)
|
||||||
CalcEntitySpot(ent, SPOT_CHEST, targ);
|
CalcEntitySpot(ent, SPOT_CHEST, targ);
|
||||||
} else if (location < 85) {
|
} else if (location < legsRatio + torsoRatio) {
|
||||||
// 20% chance
|
// 20% chance
|
||||||
CalcEntitySpot(ent, SPOT_LEGS, targ);
|
CalcEntitySpot(ent, SPOT_LEGS, targ);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -27,6 +27,9 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
#include "wp_saber.h"
|
#include "wp_saber.h"
|
||||||
#include "g_vehicles.h"
|
#include "g_vehicles.h"
|
||||||
#include "../cgame/cg_local.h"
|
#include "../cgame/cg_local.h"
|
||||||
|
|
||||||
|
extern cvar_t *g_TeamBeefDirectorsCut;
|
||||||
|
|
||||||
#if !defined(RUFL_HSTRING_INC)
|
#if !defined(RUFL_HSTRING_INC)
|
||||||
#include "../Rufl/hstring.h"
|
#include "../Rufl/hstring.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -25,7 +25,6 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
#include "../rd-common/tr_public.h"
|
#include "../rd-common/tr_public.h"
|
||||||
|
|
||||||
|
|
||||||
// bg_pmove.c -- both games player movement code
|
// bg_pmove.c -- both games player movement code
|
||||||
// takes a playerstate and a usercmd as input and returns a modifed playerstate
|
// takes a playerstate and a usercmd as input and returns a modifed playerstate
|
||||||
|
|
||||||
|
@ -46,6 +45,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
#include "g_vehicles.h"
|
#include "g_vehicles.h"
|
||||||
#include <float.h>
|
#include <float.h>
|
||||||
#include <JKXR/VrClientInfo.h>
|
#include <JKXR/VrClientInfo.h>
|
||||||
|
#include <JKXR/VrTBDC.h>
|
||||||
|
|
||||||
extern qboolean G_DoDismemberment( gentity_t *self, vec3_t point, int mod, int damage, int hitLoc, qboolean force = qfalse );
|
extern qboolean G_DoDismemberment( gentity_t *self, vec3_t point, int mod, int damage, int hitLoc, qboolean force = qfalse );
|
||||||
extern qboolean G_EntIsUnlockedDoor( int entityNum );
|
extern qboolean G_EntIsUnlockedDoor( int entityNum );
|
||||||
|
@ -14085,7 +14085,19 @@ static void PM_Weapon( void )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
PM_AddEvent( EV_FIRE_WEAPON );
|
PM_AddEvent( EV_FIRE_WEAPON );
|
||||||
|
|
||||||
|
if(pm->ps->weapon == WP_BRYAR_PISTOL && g_TeamBeefDirectorsCut->integer == 1)
|
||||||
|
{
|
||||||
|
addTime = TBDC_BRYAR_PISTOL_FIRERATE;
|
||||||
|
}
|
||||||
|
else if(pm->ps->weapon == WP_BLASTER && g_TeamBeefDirectorsCut->integer == 1)
|
||||||
|
{
|
||||||
|
addTime = TBDC_BLASTER_FIRERATE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
addTime = weaponData[pm->ps->weapon].fireTime;
|
addTime = weaponData[pm->ps->weapon].fireTime;
|
||||||
|
}
|
||||||
|
|
||||||
switch( pm->ps->weapon)
|
switch( pm->ps->weapon)
|
||||||
{
|
{
|
||||||
|
|
|
@ -34,6 +34,8 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
#include "Q3_Interface.h"
|
#include "Q3_Interface.h"
|
||||||
#include "g_navigator.h"
|
#include "g_navigator.h"
|
||||||
|
|
||||||
|
extern cvar_t *g_TeamBeefDirectorsCut;
|
||||||
|
|
||||||
#define TURN_OFF 0x00000100
|
#define TURN_OFF 0x00000100
|
||||||
|
|
||||||
extern qboolean Rosh_TwinPresent( gentity_t *self );
|
extern qboolean Rosh_TwinPresent( gentity_t *self );
|
||||||
|
@ -6055,7 +6057,7 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker, const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// figure momentum add, even if the damage won't be taken
|
// figure momentum add, even if the damage won't be taken
|
||||||
if ( knockback && !(dflags&DAMAGE_DEATH_KNOCKBACK) ) //&& targ->client
|
if ( knockback && (!(dflags&DAMAGE_DEATH_KNOCKBACK) || (g_TeamBeefDirectorsCut->integer == 1 && targ->s.number != 0))) //&& targ->client //GB not the player
|
||||||
{
|
{
|
||||||
G_ApplyKnockback( targ, newDir, knockback );
|
G_ApplyKnockback( targ, newDir, knockback );
|
||||||
G_CheckKnockdown( targ, attacker, newDir, dflags, mod );
|
G_CheckKnockdown( targ, attacker, newDir, dflags, mod );
|
||||||
|
@ -6718,6 +6720,10 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker, const
|
||||||
{//special case because this is shotgun-ish damage, we need to multiply the knockback
|
{//special case because this is shotgun-ish damage, we need to multiply the knockback
|
||||||
knockback *= 12;//*6 for 6 flechette shots
|
knockback *= 12;//*6 for 6 flechette shots
|
||||||
}
|
}
|
||||||
|
else if(g_TeamBeefDirectorsCut->integer == 1)
|
||||||
|
{
|
||||||
|
knockback *= 2;
|
||||||
|
}
|
||||||
G_ApplyKnockback( targ, newDir, knockback );
|
G_ApplyKnockback( targ, newDir, knockback );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,8 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
#include "w_local.h"
|
#include "w_local.h"
|
||||||
|
|
||||||
#include "bg_local.h"
|
#include "bg_local.h"
|
||||||
|
#include <JKXR/VrTBDC.h>
|
||||||
|
extern cvar_t *g_TeamBeefDirectorsCut;
|
||||||
|
|
||||||
|
|
||||||
//---------------
|
//---------------
|
||||||
|
@ -75,7 +77,12 @@ void WP_FireBryarPistol( gentity_t *ent, qboolean alt_fire )
|
||||||
|
|
||||||
WP_MissileTargetHint(ent, start, forward);
|
WP_MissileTargetHint(ent, start, forward);
|
||||||
|
|
||||||
gentity_t *missile = CreateMissile( start, forward, BRYAR_PISTOL_VEL, 10000, ent, alt_fire );
|
float velocity = BRYAR_PISTOL_VEL;
|
||||||
|
if(ent->client && ent->client->ps.clientNum == 0 && g_TeamBeefDirectorsCut->integer == 1)
|
||||||
|
{
|
||||||
|
velocity = TBDC_BRYAR_PISTOL_VEL;
|
||||||
|
}
|
||||||
|
gentity_t *missile = CreateMissile( start, forward, velocity, 10000, ent, alt_fire );
|
||||||
|
|
||||||
missile->classname = "bryar_proj";
|
missile->classname = "bryar_proj";
|
||||||
if ( ent->s.weapon == WP_BLASTER_PISTOL
|
if ( ent->s.weapon == WP_BLASTER_PISTOL
|
||||||
|
|
|
@ -28,6 +28,8 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
#include "bg_local.h"
|
#include "bg_local.h"
|
||||||
#include <JKXR/VrClientInfo.h>
|
#include <JKXR/VrClientInfo.h>
|
||||||
|
#include <JKXR/VrTBDC.h>
|
||||||
|
extern cvar_t *g_TeamBeefDirectorsCut;
|
||||||
|
|
||||||
|
|
||||||
//---------------
|
//---------------
|
||||||
|
@ -60,6 +62,11 @@ void WP_FireBlasterMissile( gentity_t *ent, vec3_t start, vec3_t dir, qboolean a
|
||||||
velocity *= BLASTER_NPC_HARD_VEL_CUT;
|
velocity *= BLASTER_NPC_HARD_VEL_CUT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(ent->client && ent->client->ps.clientNum == 0 && g_TeamBeefDirectorsCut->integer == 1)
|
||||||
|
{
|
||||||
|
velocity = TBDC_BLASTER_VELOCITY;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WP_TraceSetStart( ent, start, vec3_origin, vec3_origin );//make sure our start point isn't on the other side of a wall
|
WP_TraceSetStart( ent, start, vec3_origin, vec3_origin );//make sure our start point isn't on the other side of a wall
|
||||||
|
|
|
@ -28,6 +28,8 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
#include "bg_local.h"
|
#include "bg_local.h"
|
||||||
|
|
||||||
#include <JKXR/VrClientInfo.h>
|
#include <JKXR/VrClientInfo.h>
|
||||||
|
#include <JKXR/VrTBDC.h>
|
||||||
|
extern cvar_t *g_TeamBeefDirectorsCut;
|
||||||
|
|
||||||
//-------------------
|
//-------------------
|
||||||
// Wookiee Bowcaster
|
// Wookiee Bowcaster
|
||||||
|
@ -98,7 +100,14 @@ static void WP_BowcasterMainFire( gentity_t *ent )
|
||||||
for ( int i = 0; i < count; i++ )
|
for ( int i = 0; i < count; i++ )
|
||||||
{
|
{
|
||||||
// create a range of different velocities
|
// create a range of different velocities
|
||||||
|
if(ent->client && ent->client->ps.clientNum == 0 && g_TeamBeefDirectorsCut->integer == 1)
|
||||||
|
{
|
||||||
|
vel = TBDC_BOWCASTER_VELOCITY * ( Q_flrand(-1.0f, 1.0f) * BOWCASTER_VEL_RANGE + 1.0f );;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
vel = BOWCASTER_VELOCITY * ( Q_flrand(-1.0f, 1.0f) * BOWCASTER_VEL_RANGE + 1.0f );
|
vel = BOWCASTER_VELOCITY * ( Q_flrand(-1.0f, 1.0f) * BOWCASTER_VEL_RANGE + 1.0f );
|
||||||
|
}
|
||||||
|
|
||||||
vectoangles( forward, angs );
|
vectoangles( forward, angs );
|
||||||
|
|
||||||
|
@ -168,7 +177,12 @@ static void WP_BowcasterAltFire( gentity_t *ent )
|
||||||
|
|
||||||
WP_MissileTargetHint(ent, start, forward);
|
WP_MissileTargetHint(ent, start, forward);
|
||||||
|
|
||||||
gentity_t *missile = CreateMissile( start, forward, BOWCASTER_VELOCITY, 10000, ent, qtrue );
|
float velocity = BOWCASTER_VELOCITY;
|
||||||
|
if(ent->client && ent->client->ps.clientNum == 0 && g_TeamBeefDirectorsCut->integer == 1)
|
||||||
|
{
|
||||||
|
velocity = TBDC_BOWCASTER_VELOCITY;
|
||||||
|
}
|
||||||
|
gentity_t *missile = CreateMissile( start, forward, velocity, 10000, ent, qtrue );
|
||||||
|
|
||||||
missile->classname = "bowcaster_alt_proj";
|
missile->classname = "bowcaster_alt_proj";
|
||||||
missile->s.weapon = WP_BOWCASTER;
|
missile->s.weapon = WP_BOWCASTER;
|
||||||
|
|
|
@ -26,6 +26,8 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
#include "wp_saber.h"
|
#include "wp_saber.h"
|
||||||
#include "w_local.h"
|
#include "w_local.h"
|
||||||
#include "bg_local.h"
|
#include "bg_local.h"
|
||||||
|
#include <JKXR/VrTBDC.h>
|
||||||
|
extern cvar_t *g_TeamBeefDirectorsCut;
|
||||||
|
|
||||||
//-------------------
|
//-------------------
|
||||||
// DEMP2
|
// DEMP2
|
||||||
|
@ -53,7 +55,12 @@ static void WP_DEMP2_MainFire( gentity_t *ent )
|
||||||
|
|
||||||
WP_MissileTargetHint(ent, start, forward);
|
WP_MissileTargetHint(ent, start, forward);
|
||||||
|
|
||||||
gentity_t *missile = CreateMissile( start, forward, DEMP2_VELOCITY, 10000, ent );
|
float velocity = DEMP2_VELOCITY;
|
||||||
|
if(ent->client && ent->client->ps.clientNum == 0 && g_TeamBeefDirectorsCut->integer == 1)
|
||||||
|
{
|
||||||
|
velocity = TBDC_DEMP2_VELOCITY;
|
||||||
|
}
|
||||||
|
gentity_t *missile = CreateMissile( start, forward, velocity, 10000, ent );
|
||||||
|
|
||||||
missile->classname = "demp2_proj";
|
missile->classname = "demp2_proj";
|
||||||
missile->s.weapon = WP_DEMP2;
|
missile->s.weapon = WP_DEMP2;
|
||||||
|
|
|
@ -26,6 +26,8 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
#include "wp_saber.h"
|
#include "wp_saber.h"
|
||||||
#include "w_local.h"
|
#include "w_local.h"
|
||||||
#include "bg_local.h"
|
#include "bg_local.h"
|
||||||
|
#include <JKXR/VrTBDC.h>
|
||||||
|
extern cvar_t *g_TeamBeefDirectorsCut;
|
||||||
|
|
||||||
//-------------------
|
//-------------------
|
||||||
// Heavy Repeater
|
// Heavy Repeater
|
||||||
|
@ -43,7 +45,12 @@ static void WP_RepeaterMainFire( gentity_t *ent, vec3_t dir )
|
||||||
|
|
||||||
WP_MissileTargetHint(ent, start, dir);
|
WP_MissileTargetHint(ent, start, dir);
|
||||||
|
|
||||||
gentity_t *missile = CreateMissile( start, dir, REPEATER_VELOCITY, 10000, ent );
|
float velocity = REPEATER_VELOCITY;
|
||||||
|
if(ent->client && ent->client->ps.clientNum == 0 && g_TeamBeefDirectorsCut->integer == 1)
|
||||||
|
{
|
||||||
|
velocity = TBDC_REPEATER_VELOCITY;
|
||||||
|
}
|
||||||
|
gentity_t *missile = CreateMissile( start, dir, velocity, 10000, ent );
|
||||||
|
|
||||||
missile->classname = "repeater_proj";
|
missile->classname = "repeater_proj";
|
||||||
missile->s.weapon = WP_REPEATER;
|
missile->s.weapon = WP_REPEATER;
|
||||||
|
@ -109,7 +116,12 @@ static void WP_RepeaterAltFire( gentity_t *ent )
|
||||||
}
|
}
|
||||||
|
|
||||||
WP_MissileTargetHint(ent, start, forward);
|
WP_MissileTargetHint(ent, start, forward);
|
||||||
missile = CreateMissile( start, forward, REPEATER_ALT_VELOCITY, 10000, ent, qtrue );
|
float velocity = REPEATER_ALT_VELOCITY;
|
||||||
|
if(ent->client && ent->client->ps.clientNum == 0 && g_TeamBeefDirectorsCut->integer == 1)
|
||||||
|
{
|
||||||
|
velocity = TBDC_REPEATER_ALT_VELOCITY;
|
||||||
|
}
|
||||||
|
missile = CreateMissile( start, forward, velocity, 10000, ent, qtrue );
|
||||||
}
|
}
|
||||||
|
|
||||||
missile->classname = "repeater_alt_proj";
|
missile->classname = "repeater_alt_proj";
|
||||||
|
|
|
@ -26,6 +26,8 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
#include "wp_saber.h"
|
#include "wp_saber.h"
|
||||||
#include "w_local.h"
|
#include "w_local.h"
|
||||||
#include "bg_local.h"
|
#include "bg_local.h"
|
||||||
|
#include <JKXR/VrTBDC.h>
|
||||||
|
extern cvar_t *g_TeamBeefDirectorsCut;
|
||||||
|
|
||||||
//-----------------------
|
//-----------------------
|
||||||
// Rocket Launcher
|
// Rocket Launcher
|
||||||
|
@ -54,7 +56,12 @@ void rocketThink( gentity_t *ent )
|
||||||
}
|
}
|
||||||
if ( ent->enemy && ent->enemy->inuse )
|
if ( ent->enemy && ent->enemy->inuse )
|
||||||
{
|
{
|
||||||
float vel = (ent->spawnflags&1)?ent->speed:ROCKET_VELOCITY;
|
float baseVelocity = ROCKET_VELOCITY;
|
||||||
|
if(ent->client && ent->client->ps.clientNum == 0 && g_TeamBeefDirectorsCut->integer == 1)
|
||||||
|
{
|
||||||
|
baseVelocity = TBDC_ROCKET_VELOCITY;
|
||||||
|
}
|
||||||
|
float vel = (ent->spawnflags&1)?ent->speed:baseVelocity;
|
||||||
float newDirMult = ent->angle?ent->angle*2.0f:1.0f;
|
float newDirMult = ent->angle?ent->angle*2.0f:1.0f;
|
||||||
float oldDirMult = ent->angle?(1.0f-ent->angle)*2.0f:1.0f;
|
float oldDirMult = ent->angle?(1.0f-ent->angle)*2.0f:1.0f;
|
||||||
|
|
||||||
|
|
|
@ -4791,8 +4791,6 @@ Ghoul2 Insert End
|
||||||
cent->gent->client->ps.saberBounceMove != LS_NONE &&
|
cent->gent->client->ps.saberBounceMove != LS_NONE &&
|
||||||
vr->saberBlockDebounce < cg.time)
|
vr->saberBlockDebounce < cg.time)
|
||||||
{
|
{
|
||||||
//cvar_t *vr_saber_block_debounce_time = gi.cvar("vr_saber_block_debounce_time", "1000", CVAR_ARCHIVE); // defined in VrCvars.h
|
|
||||||
//vr->saberBlockDebounce = cg.time + vr_saber_block_debounce_time->integer;
|
|
||||||
vr->saberBlockDebounce = cg.time + TBDC_SABER_BOUNCETIME;
|
vr->saberBlockDebounce = cg.time + TBDC_SABER_BOUNCETIME;
|
||||||
vr->saberBounceMove = cent->gent->client->ps.saberBounceMove;
|
vr->saberBounceMove = cent->gent->client->ps.saberBounceMove;
|
||||||
cgi_HapticEvent("shotgun_fire", 0, 0, 100, 0, 0);
|
cgi_HapticEvent("shotgun_fire", 0, 0, 100, 0, 0);
|
||||||
|
|
|
@ -29,7 +29,6 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
#include "g_functions.h"
|
#include "g_functions.h"
|
||||||
#include "bg_local.h"
|
#include "bg_local.h"
|
||||||
#include <JKXR/VrClientInfo.h>
|
#include <JKXR/VrClientInfo.h>
|
||||||
extern cvar_t *g_TeamBeefDirectorsCut;
|
|
||||||
|
|
||||||
//-----------------------
|
//-----------------------
|
||||||
// Golan Arms Flechette
|
// Golan Arms Flechette
|
||||||
|
|
Loading…
Reference in a new issue