mirror of
https://github.com/DrBeef/JKXR.git
synced 2024-11-10 14:52:00 +00:00
Blocked Saber Pause
blocked saber will pause for a short time to indicate it was blocked implemented crouch toggle set cg_debugSaberCombat to 1 to show red saber when it is blocked too
This commit is contained in:
parent
42a79f4b13
commit
7a921c5e38
9 changed files with 45 additions and 31 deletions
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.drbeef.jk2quest"
|
||||
android:versionCode="27"
|
||||
android:versionName="0.3.8" android:installLocation="auto" >
|
||||
android:versionCode="28"
|
||||
android:versionName="0.3.9" android:installLocation="auto" >
|
||||
|
||||
<!-- Tell the system this app requires OpenGL ES 3.1. -->
|
||||
<uses-feature android:glEsVersion="0x00030002" android:required="true"/>
|
||||
|
|
|
@ -1323,6 +1323,7 @@ void JKVR_Init()
|
|||
vr_force_velocity_trigger = Cvar_Get( "vr_force_velocity_trigger", "2.0", CVAR_ARCHIVE);
|
||||
vr_two_handed_weapons = Cvar_Get ("vr_two_handed_weapons", "1", CVAR_ARCHIVE);
|
||||
vr_force_motion_controlled = Cvar_Get ("vr_force_motion_controlled", "1", CVAR_ARCHIVE);
|
||||
vr_crouch_toggle = Cvar_Get ("vr_crouch_toggle", "0", CVAR_ARCHIVE);
|
||||
|
||||
cvar_t *expanded_menu_enabled = Cvar_Get ("expanded_menu_enabled", "0", CVAR_ARCHIVE);
|
||||
if (FS_FileExists("expanded_menu.pk3")) {
|
||||
|
|
|
@ -14,7 +14,9 @@ typedef struct {
|
|||
bool weapon_stabilised;
|
||||
bool right_handed;
|
||||
bool player_moving;
|
||||
bool crouched;
|
||||
int cgzoommode;
|
||||
int saberBlockDebounce; // Amount of time after player is blocked that the saber position is fixed
|
||||
|
||||
int forceid;
|
||||
|
||||
|
@ -45,7 +47,7 @@ typedef struct {
|
|||
vec3_t weaponoffset_history[NUM_WEAPON_SAMPLES];
|
||||
float weaponoffset_history_timestamp[NUM_WEAPON_SAMPLES];
|
||||
|
||||
int item_selector = 0; // 1 - weapons/gadgets/saber stance, 2 - Force powers
|
||||
int item_selector; // 1 - weapons/gadgets/saber stance, 2 - Force powers
|
||||
|
||||
bool velocitytriggered;
|
||||
float primaryswingvelocity;
|
||||
|
|
|
@ -13,4 +13,5 @@ extern cvar_t *vr_weapon_velocity_trigger;
|
|||
extern cvar_t *vr_force_velocity_trigger;
|
||||
extern cvar_t *vr_two_handed_weapons;
|
||||
extern cvar_t *vr_force_motion_controlled;
|
||||
extern cvar_t *vr_crouch_toggle;
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@ cvar_t *vr_weapon_velocity_trigger;
|
|||
cvar_t *vr_force_velocity_trigger;
|
||||
cvar_t *vr_two_handed_weapons;
|
||||
cvar_t *vr_force_motion_controlled;
|
||||
cvar_t *vr_crouch_toggle;
|
||||
|
||||
ovrInputStateTrackedRemote leftTrackedRemoteState_old;
|
||||
ovrInputStateTrackedRemote leftTrackedRemoteState_new;
|
||||
|
|
|
@ -101,8 +101,12 @@ void HandleInput_Default( ovrInputStateGamepad *pFootTrackingNew, ovrInputStateG
|
|||
{
|
||||
//Set gun angles - We need to calculate all those we might need (including adjustments) for the client to then take its pick
|
||||
vec3_t rotation = {0};
|
||||
rotation[PITCH] = 45;
|
||||
QuatToYawPitchRoll(pWeapon->HeadPose.Pose.Orientation, rotation, vr.weaponangles_saber);
|
||||
|
||||
//if we are in saber block debounce, don't update the angles
|
||||
if (vr.saberBlockDebounce < cl.serverTime) {
|
||||
rotation[PITCH] = 45;
|
||||
QuatToYawPitchRoll(pWeapon->HeadPose.Pose.Orientation, rotation, vr.weaponangles_saber);
|
||||
}
|
||||
rotation[PITCH] = vr_weapon_pitchadjust->value;
|
||||
QuatToYawPitchRoll(pWeapon->HeadPose.Pose.Orientation, rotation, vr.weaponangles);
|
||||
|
||||
|
@ -295,14 +299,16 @@ void HandleInput_Default( ovrInputStateGamepad *pFootTrackingNew, ovrInputStateG
|
|||
VectorCopy(vr.weaponoffset, vr.weaponoffset_history[0]);
|
||||
vr.weaponoffset_history_timestamp[0] = vr.weaponoffset_timestamp;
|
||||
|
||||
VectorSet(vr.weaponposition, pWeapon->HeadPose.Pose.Position.x,
|
||||
pWeapon->HeadPose.Pose.Position.y, pWeapon->HeadPose.Pose.Position.z);
|
||||
if (vr.saberBlockDebounce < cl.serverTime) {
|
||||
VectorSet(vr.weaponposition, pWeapon->HeadPose.Pose.Position.x,
|
||||
pWeapon->HeadPose.Pose.Position.y, pWeapon->HeadPose.Pose.Position.z);
|
||||
|
||||
///Weapon location relative to view
|
||||
VectorSet(vr.weaponoffset, pWeapon->HeadPose.Pose.Position.x,
|
||||
pWeapon->HeadPose.Pose.Position.y, pWeapon->HeadPose.Pose.Position.z);
|
||||
VectorSubtract(vr.weaponoffset, vr.hmdposition, vr.weaponoffset);
|
||||
vr.weaponoffset_timestamp = Sys_Milliseconds();
|
||||
///Weapon location relative to view
|
||||
VectorSet(vr.weaponoffset, pWeapon->HeadPose.Pose.Position.x,
|
||||
pWeapon->HeadPose.Pose.Position.y, pWeapon->HeadPose.Pose.Position.z);
|
||||
VectorSubtract(vr.weaponoffset, vr.hmdposition, vr.weaponoffset);
|
||||
vr.weaponoffset_timestamp = Sys_Milliseconds();
|
||||
}
|
||||
|
||||
vec3_t velocity;
|
||||
VectorSet(velocity, pWeapon->HeadPose.LinearVelocity.x,
|
||||
|
@ -644,7 +650,15 @@ void HandleInput_Default( ovrInputStateGamepad *pFootTrackingNew, ovrInputStateG
|
|||
if ((secondaryButtonsNew & secondaryThumb) !=
|
||||
(secondaryButtonsOld & secondaryThumb)) {
|
||||
|
||||
sendButtonAction("+movedown", (secondaryButtonsNew & secondaryThumb));
|
||||
if (vr_crouch_toggle->integer)
|
||||
{
|
||||
vr.crouched = !vr.crouched;
|
||||
sendButtonAction("+movedown", vr.crouched);
|
||||
}
|
||||
else
|
||||
{
|
||||
sendButtonAction("+movedown", (secondaryButtonsNew & secondaryThumb));
|
||||
}
|
||||
}
|
||||
|
||||
//Use
|
||||
|
|
|
@ -1658,6 +1658,10 @@ Ghoul2 Insert End
|
|||
cg.weaponSelect = WP_BRYAR_PISTOL;
|
||||
cg.forcepowerSelect = FP_HEAL;
|
||||
|
||||
//reset some of the vr stuff here as we know we are starting afresh
|
||||
vr->saberBlockDebounce = 0;
|
||||
vr->crouched = false;
|
||||
|
||||
if (gbUseTheseValuesFromLoadSave)
|
||||
{
|
||||
gbUseTheseValuesFromLoadSave = qfalse; // ack
|
||||
|
|
|
@ -4670,26 +4670,10 @@ Ghoul2 Insert End
|
|||
saber_colors_t saberColor = client->ps.saberColor;
|
||||
if (cg_debugSaberCombat.integer)
|
||||
{
|
||||
if (client->ps.saberLockEnemy != ENTITYNUM_NONE)
|
||||
if (vr->saberBlockDebounce > cg.time)
|
||||
{
|
||||
saberColor = SABER_RED;
|
||||
}
|
||||
else if (client->ps.saberBlocked)
|
||||
{
|
||||
saberColor = SABER_ORANGE;
|
||||
}
|
||||
else if ( client->ps.saberDamageDebounceTime > level.time )
|
||||
{
|
||||
saberColor = SABER_YELLOW;
|
||||
}
|
||||
else if (saberTrail->inAction)
|
||||
{
|
||||
saberColor = SABER_GREEN;
|
||||
}
|
||||
else
|
||||
{
|
||||
saberColor = SABER_BLUE;
|
||||
}
|
||||
}
|
||||
|
||||
#define SABER_TRAIL_TIME 60.0f
|
||||
|
@ -4802,8 +4786,15 @@ Ghoul2 Insert End
|
|||
// will get rendered properly in a mirror...not sure if this is necessary??
|
||||
CG_DoSaber( org_, axis_[0], length, client->ps.saberLengthMax, saberColor, renderfx );
|
||||
|
||||
if (CG_getPlayer1stPersonSaber(cent) &&
|
||||
cent->gent->client->ps.saberEventFlags & (SEF_BLOCKED|SEF_PARRIED) &&
|
||||
vr->saberBlockDebounce < cg.time)
|
||||
{
|
||||
vr->saberBlockDebounce = cg.time + 200;
|
||||
}
|
||||
|
||||
if (CG_getPlayer1stPersonSaber(cent) &&
|
||||
cent->gent->client->ps.saberLockEnemy != ENTITYNUM_NONE)
|
||||
cent->gent->client->ps.saberLockEnemy != ENTITYNUM_NONE)
|
||||
{
|
||||
refEntity_t hiltEnt;
|
||||
memset( &hiltEnt, 0, sizeof(refEntity_t) );
|
||||
|
|
Binary file not shown.
Loading…
Reference in a new issue