mirror of
https://github.com/DrBeef/JKXR.git
synced 2025-04-25 02:50:58 +00:00
Made stun baton a velocity triggered weapon
This commit is contained in:
parent
d00d0a6a26
commit
858c5b7f31
5 changed files with 14 additions and 8 deletions
|
@ -18,7 +18,11 @@ Authors : Simon Brown
|
||||||
#include <statindex.h>
|
#include <statindex.h>
|
||||||
#include "android/sys_local.h"
|
#include "android/sys_local.h"
|
||||||
#include "weapons.h"
|
#include "weapons.h"
|
||||||
|
#ifdef JK2_MODE
|
||||||
|
#include "../OpenJK/codeJK2//game/weapons.h"
|
||||||
|
#else
|
||||||
|
#include "../OpenJK/code/game/weapons.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
void SV_Trace( trace_t *results, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int passEntityNum, int contentmask, int capsule );
|
void SV_Trace( trace_t *results, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int passEntityNum, int contentmask, int capsule );
|
||||||
|
|
||||||
|
@ -397,7 +401,8 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
|
||||||
ALOGV("**WEAPON EVENT** veocity triggered -attack");
|
ALOGV("**WEAPON EVENT** veocity triggered -attack");
|
||||||
sendButtonAction("+attack", vr.secondaryVelocityTriggeredAttack);
|
sendButtonAction("+attack", vr.secondaryVelocityTriggeredAttack);
|
||||||
}
|
}
|
||||||
} else if (cl.frame.ps.weapon == WP_SABER) {
|
} else if (cl.frame.ps.weapon == WP_SABER ||
|
||||||
|
cl.frame.ps.weapon == WP_STUN_BATON) {
|
||||||
//Does weapon velocity trigger attack
|
//Does weapon velocity trigger attack
|
||||||
if (vr.velocitytriggered) {
|
if (vr.velocitytriggered) {
|
||||||
static bool fired = false;
|
static bool fired = false;
|
||||||
|
@ -410,7 +415,7 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
|
||||||
vr_weapon_velocity_trigger->value);
|
vr_weapon_velocity_trigger->value);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool triggered = (vr.primaryVelocityTriggeredAttack || vr.secondaryVelocityTriggeredAttack);
|
bool triggered = vr.primaryVelocityTriggeredAttack || (vr.dualsabers && vr.secondaryVelocityTriggeredAttack);
|
||||||
if (fired != triggered)
|
if (fired != triggered)
|
||||||
{
|
{
|
||||||
ALOGV("**WEAPON EVENT** veocity triggered %s",
|
ALOGV("**WEAPON EVENT** veocity triggered %s",
|
||||||
|
@ -486,7 +491,8 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
|
||||||
delta[2] = pOff->Pose.position.z - pWeapon->Pose.position.z;
|
delta[2] = pOff->Pose.position.z - pWeapon->Pose.position.z;
|
||||||
|
|
||||||
int anglesToSet = ANGLES_ADJUSTED;
|
int anglesToSet = ANGLES_ADJUSTED;
|
||||||
if (cl.frame.ps.weapon == WP_SABER)
|
if (cl.frame.ps.weapon == WP_SABER ||
|
||||||
|
cl.frame.ps.weapon == WP_STUN_BATON)
|
||||||
{
|
{
|
||||||
anglesToSet = ANGLES_SABER;
|
anglesToSet = ANGLES_SABER;
|
||||||
VectorNegate(delta, delta);
|
VectorNegate(delta, delta);
|
||||||
|
|
|
@ -6972,7 +6972,7 @@ void CG_Player( centity_t *cent ) {
|
||||||
|
|
||||||
if (cent->gent->client->ps.clientNum == 0) {
|
if (cent->gent->client->ps.clientNum == 0) {
|
||||||
vr->velocitytriggered = (!cg.renderingThirdPerson &&
|
vr->velocitytriggered = (!cg.renderingThirdPerson &&
|
||||||
(cg.snap->ps.weapon == WP_SABER || cg.snap->ps.weapon == WP_MELEE));
|
(cg.snap->ps.weapon == WP_SABER || cg.snap->ps.weapon == WP_MELEE || cg.snap->ps.weapon == WP_STUN_BATON));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ void WP_FireStunBaton( gentity_t *ent, qboolean alt_fire )
|
||||||
vec3_t angs, forward;
|
vec3_t angs, forward;
|
||||||
if ( BG_UseVRPosition(ent))
|
if ( BG_UseVRPosition(ent))
|
||||||
{
|
{
|
||||||
BG_CalculateVRWeaponPosition(muzzle, angs);
|
BG_CalculateVRSaberPosition(0, muzzle, angs);
|
||||||
AngleVectors(angs, forward, NULL, NULL);
|
AngleVectors(angs, forward, NULL, NULL);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -4890,7 +4890,7 @@ void CG_Player(centity_t *cent ) {
|
||||||
|
|
||||||
if (cent->gent->client->ps.clientNum == 0) {
|
if (cent->gent->client->ps.clientNum == 0) {
|
||||||
vr->velocitytriggered = (!cg.renderingThirdPerson &&
|
vr->velocitytriggered = (!cg.renderingThirdPerson &&
|
||||||
(cg.snap->ps.weapon == WP_SABER || cg.snap->ps.weapon == WP_MELEE));
|
(cg.snap->ps.weapon == WP_SABER || cg.snap->ps.weapon == WP_MELEE || cg.snap->ps.weapon == WP_STUN_BATON));
|
||||||
}
|
}
|
||||||
|
|
||||||
//Get the player's light level for stealth calculations
|
//Get the player's light level for stealth calculations
|
||||||
|
|
|
@ -41,7 +41,7 @@ void WP_FireStunBaton( gentity_t *ent, qboolean alt_fire )
|
||||||
vec3_t angs, forward;
|
vec3_t angs, forward;
|
||||||
if ( BG_UseVRPosition(ent))
|
if ( BG_UseVRPosition(ent))
|
||||||
{
|
{
|
||||||
BG_CalculateVRWeaponPosition(wpMuzzle, angs);
|
BG_CalculateVRSaberPosition(wpMuzzle, angs);
|
||||||
AngleVectors(angs, forward, NULL, NULL);
|
AngleVectors(angs, forward, NULL, NULL);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Reference in a new issue