Adding RoE weapons

This commit is contained in:
Grant Bagwell 2020-11-18 15:48:17 +01:00
parent 841e47cd9d
commit 92fa4000ef
15 changed files with 238 additions and 130 deletions

View file

@ -104,7 +104,7 @@ public:
virtual void SetLocalClient( int clientNum ) = 0; virtual void SetLocalClient( int clientNum ) = 0;
virtual void SetVRClientInfo(vrClientInfo *pVRClientInfo) = 0; virtual void SetVRClientInfo(vrClientInfo *pVRClientInfo) = 0;
virtual void CheckRenderCvars() = 0;
virtual void EvaluateVRMoveMode(idVec3 &viewangles, usercmd_t &cmd, int buttonCurrentlyClicked, float snapTurn) = 0; virtual void EvaluateVRMoveMode(idVec3 &viewangles, usercmd_t &cmd, int buttonCurrentlyClicked, float snapTurn) = 0;
virtual bool CMDButtonsAttackCall(int &teleportCanceled) = 0; virtual bool CMDButtonsAttackCall(int &teleportCanceled) = 0;
virtual bool CMDButtonsPhysicalCrouch() = 0; virtual bool CMDButtonsPhysicalCrouch() = 0;

View file

@ -215,6 +215,8 @@ public:
return head.GetEntity(); return head.GetEntity();
}; };
void PlayFootStepSound( void );
protected: protected:
friend class idAnimState; friend class idAnimState;
@ -289,11 +291,12 @@ protected:
// copies animation from body to head joints // copies animation from body to head joints
void CopyJointsFromBodyToHead( void ); void CopyJointsFromBodyToHead( void );
private: private:
void SyncAnimChannels( int channel, int syncToChannel, int blendFrames ); void SyncAnimChannels( int channel, int syncToChannel, int blendFrames );
void FinishSetup( void ); void FinishSetup( void );
void SetupHead( void ); void SetupHead( void );
void PlayFootStepSound( void );
void Event_EnableEyeFocus( void ); void Event_EnableEyeFocus( void );
void Event_DisableEyeFocus( void ); void Event_DisableEyeFocus( void );

View file

@ -96,6 +96,42 @@ const char *idGameLocal::sufaceTypeNames[ MAX_SURFACE_TYPES ] = {
"ricochet", "surftype10", "surftype11", "surftype12", "surftype13", "surftype14", "surftype15" "ricochet", "surftype10", "surftype11", "surftype12", "surftype13", "surftype14", "surftype15"
}; };
// List of all defs used by the player that will stay on the fast timeline
static const char* fastEntityList[] =
{
"player_doommarine",
"weapon_chainsaw",
"weapon_fists",
"weapon_flashlight",
"weapon_rocketlauncher",
"projectile_rocket",
"weapon_machinegun",
"projectile_bullet_machinegun",
"weapon_pistol",
"projectile_bullet_pistol",
"weapon_handgrenade",
"projectile_grenade",
"weapon_bfg",
"projectile_bfg",
"weapon_chaingun",
"projectile_chaingunbullet",
"weapon_pda",
"weapon_plasmagun",
"projectile_plasmablast",
"weapon_shotgun",
"projectile_bullet_shotgun",
"weapon_soulcube",
"projectile_soulblast",
"weapon_shotgun_double",
"projectile_shotgunbullet_double",
"weapon_grabber",
"weapon_bloodstone_active1",
"weapon_bloodstone_active2",
"weapon_bloodstone_active3",
"weapon_bloodstone_passive",
NULL
};
/* /*
=========== ===========
GetGameAPI GetGameAPI
@ -776,10 +812,6 @@ void idGameLocal::SetLocalClient( int clientNum ) {
void idGameLocal::SetVRClientInfo(vrClientInfo *pVR) void idGameLocal::SetVRClientInfo(vrClientInfo *pVR)
{ {
/*
pVR->hmdorientation[0] = 0.0;
pVR->hmdorientation[1] = 0.0;
pVR->hmdorientation[2] = 0.0;*/
pVRClientInfo = pVR; pVRClientInfo = pVR;
} }
@ -986,6 +1018,23 @@ bool idGameLocal::AnimatorGetJointTransform(idAnimator* animator, jointHandle_t
return animator->GetJointTransform( jointHandle, -1, offset, axis ); return animator->GetJointTransform( jointHandle, -1, offset, axis );
} }
void idGameLocal::CheckRenderCvars()
{
// Koz
if ( game->isVR )
{
if ( vr_useFloorHeight.IsModified() || ( vr_normalViewHeight.IsModified() && vr_useFloorHeight.GetInteger() == 0 ) || vr_scale.IsModified() || commonVr->shouldRecenter )
{
commonVr->HMDResetTrackingOriginOffset();
vr_useFloorHeight.ClearModified();
vr_normalViewHeight.ClearModified();
vr_scale.ClearModified();
commonVr->shouldRecenter = false;
}
}
}
/* /*
================ ================
Koz begin Koz begin

View file

@ -356,6 +356,9 @@ public:
virtual void SetLocalClient( int clientNum ); virtual void SetLocalClient( int clientNum );
virtual void SetVRClientInfo(vrClientInfo *pVRClientInfo); virtual void SetVRClientInfo(vrClientInfo *pVRClientInfo);
virtual void EvaluateVRMoveMode(idVec3 &viewangles, usercmd_t &cmd, int buttonCurrentlyClicked, float snapTurn); virtual void EvaluateVRMoveMode(idVec3 &viewangles, usercmd_t &cmd, int buttonCurrentlyClicked, float snapTurn);
virtual void CheckRenderCvars();
//GB Trying to move animator function //GB Trying to move animator function
virtual bool AnimatorGetJointTransform(idAnimator* animator, jointHandle_t jointHandle, int currentTime, idVec3 &offset, idMat3 &axis ); virtual bool AnimatorGetJointTransform(idAnimator* animator, jointHandle_t jointHandle, int currentTime, idVec3 &offset, idMat3 &axis );
virtual bool CMDButtonsAttackCall(int &teleportCanceled); virtual bool CMDButtonsAttackCall(int &teleportCanceled);

View file

@ -1561,25 +1561,31 @@ void idPlayer::Init( void ) {
oldFlags = 0; oldFlags = 0;
weaponEnabled = true; weaponEnabled = true;
risingWeaponHand = -1;
weapon_soulcube = SlotForWeapon( "weapon_soulcube" ); weapon_soulcube = SlotForWeapon( "weapon_soulcube" );
weapon_pda = SlotForWeapon( "weapon_pda" ); weapon_pda = SlotForWeapon( "weapon_pda" );
weapon_fists = SlotForWeapon( "weapon_fists" ); weapon_fists = SlotForWeapon( "weapon_fists" );
weapon_flashlight = SlotForWeapon( "weapon_flashlight" ); weapon_flashlight = SlotForWeapon( "weapon_flashlight" );
weapon_chainsaw = SlotForWeapon( "weapon_chainsaw" ); weapon_chainsaw = SlotForWeapon( "weapon_chainsaw" );
showWeaponViewModel = GetUserInfo()->GetBool( "ui_showGun" ); weapon_bloodstone = SlotForWeapon( "weapon_bloodstone_passive" );
harvest_lock = false; weapon_bloodstone_active1 = SlotForWeapon( "weapon_bloodstone_active1" );
weapon_bloodstone_active2 = SlotForWeapon( "weapon_bloodstone_active2" );
weapon_bloodstone_active3 = SlotForWeapon( "weapon_bloodstone_active3" );
harvest_lock = false;
// Koz begin; // Koz begin;
weapon_pistol = SlotForWeapon( "weapon_pistol" ); weapon_pistol = SlotForWeapon( "weapon_pistol" );
weapon_shotgun = SlotForWeapon( "weapon_shotgun" ); weapon_shotgun = SlotForWeapon( "weapon_shotgun" );
weapon_machinegun = SlotForWeapon( "weapon_machinegun" ); weapon_shotgun_double = SlotForWeapon( "weapon_shotgun_double" );
weapon_chaingun = SlotForWeapon( "weapon_chaingun" ); weapon_machinegun = SlotForWeapon( "weapon_machinegun" );
weapon_handgrenade = SlotForWeapon( "weapon_handgrenade" ); weapon_chaingun = SlotForWeapon( "weapon_chaingun" );
weapon_plasmagun = SlotForWeapon( "weapon_plasmagun" ); weapon_handgrenade = SlotForWeapon( "weapon_handgrenade" );
weapon_rocketlauncher = SlotForWeapon( "weapon_rocketlauncher" ); weapon_plasmagun = SlotForWeapon( "weapon_plasmagun" );
weapon_bfg = SlotForWeapon( "weapon_bfg" ); weapon_rocketlauncher = SlotForWeapon( "weapon_rocketlauncher" );
weapon_flashlight_new = SlotForWeapon( "weapon_flashlight_new" ); weapon_bfg = SlotForWeapon( "weapon_bfg" );
// Koz end weapon_flashlight_new = SlotForWeapon( "weapon_flashlight_new" );
weapon_grabber = SlotForWeapon( "weapon_grabber" );
// Koz end
lastDmgTime = 0; lastDmgTime = 0;
@ -2177,17 +2183,23 @@ void idPlayer::Save( idSaveGame *savefile ) const {
savefile->WriteInt( weapon_fists ); savefile->WriteInt( weapon_fists );
savefile->WriteInt( weapon_flashlight ); savefile->WriteInt( weapon_flashlight );
savefile->WriteInt( weapon_chainsaw ); savefile->WriteInt( weapon_chainsaw );
// Koz savefile->WriteInt( weapon_bloodstone );
savefile->WriteInt( weapon_pistol ); savefile->WriteInt( weapon_bloodstone_active1 );
savefile->WriteInt( weapon_shotgun ); savefile->WriteInt( weapon_bloodstone_active2 );
savefile->WriteInt( weapon_machinegun ); savefile->WriteInt( weapon_bloodstone_active3 );
savefile->WriteInt( weapon_chaingun ); // Koz
savefile->WriteInt( weapon_handgrenade ); savefile->WriteInt( weapon_pistol );
savefile->WriteInt( weapon_plasmagun ); savefile->WriteInt( weapon_shotgun );
savefile->WriteInt( weapon_rocketlauncher ); savefile->WriteInt( weapon_shotgun_double );
savefile->WriteInt( weapon_bfg ); savefile->WriteInt( weapon_machinegun );
savefile->WriteInt( weapon_flashlight_new ); savefile->WriteInt( weapon_chaingun );
// Koz end savefile->WriteInt( weapon_handgrenade );
savefile->WriteInt( weapon_plasmagun );
savefile->WriteInt( weapon_rocketlauncher );
savefile->WriteInt( weapon_bfg );
savefile->WriteInt( weapon_flashlight_new );
savefile->WriteInt( weapon_grabber );
// Koz end
savefile->WriteBool( harvest_lock ); savefile->WriteBool( harvest_lock );
savefile->WriteInt( heartRate ); savefile->WriteInt( heartRate );
@ -2530,21 +2542,30 @@ void idPlayer::Restore( idRestoreGame *savefile ) {
savefile->ReadBool(objectiveSystemOpen); savefile->ReadBool(objectiveSystemOpen);
savefile->ReadInt(weapon_soulcube); savefile->ReadInt( weapon_soulcube );
savefile->ReadInt(weapon_pda); savefile->ReadInt( weapon_pda );
savefile->ReadInt(weapon_fists); savefile->ReadInt( weapon_fists );
savefile->ReadInt( weapon_flashlight ); savefile->ReadInt( weapon_flashlight );
savefile->ReadInt( weapon_chainsaw ); savefile->ReadInt( weapon_chainsaw );
savefile->ReadInt( weapon_bloodstone );
savefile->ReadInt( weapon_bloodstone_active1 );
savefile->ReadInt( weapon_bloodstone_active2 );
savefile->ReadInt( weapon_bloodstone_active3 );
// Koz
savefile->ReadInt( weapon_pistol ); savefile->ReadInt( weapon_pistol );
savefile->ReadInt( weapon_shotgun ); savefile->ReadInt( weapon_shotgun );
savefile->ReadInt( weapon_machinegun ); savefile->ReadInt( weapon_shotgun_double );
savefile->ReadInt( weapon_chaingun ); savefile->ReadInt( weapon_machinegun );
savefile->ReadInt( weapon_handgrenade ); savefile->ReadInt( weapon_chaingun );
savefile->ReadInt( weapon_plasmagun ); savefile->ReadInt( weapon_handgrenade );
savefile->ReadInt( weapon_rocketlauncher ); savefile->ReadInt( weapon_plasmagun );
savefile->ReadInt( weapon_bfg ); savefile->ReadInt( weapon_rocketlauncher );
savefile->ReadInt( weapon_flashlight_new ); savefile->ReadInt( weapon_bfg );
savefile->ReadInt( weapon_flashlight_new );
savefile->ReadInt( weapon_grabber );
// Koz end
savefile->ReadBool( harvest_lock ); savefile->ReadBool( harvest_lock );
savefile->ReadInt(heartRate); savefile->ReadInt(heartRate);
@ -2678,6 +2699,8 @@ void idPlayer::Restore( idRestoreGame *savefile ) {
savefile->ReadInt( hands[ 1 - vr_weaponHand.GetInteger() ].weaponSwitchTime ); savefile->ReadInt( hands[ 1 - vr_weaponHand.GetInteger() ].weaponSwitchTime );
savefile->ReadBool(weaponEnabled); savefile->ReadBool(weaponEnabled);
risingWeaponHand = -1;
savefile->ReadBool(showWeaponViewModel); savefile->ReadBool(showWeaponViewModel);
savefile->ReadSkin(skin); savefile->ReadSkin(skin);
@ -13750,7 +13773,7 @@ void idPlayer::CalculateViewFlashlightPos( idVec3 &origin, idMat3 &axis, idVec3
origin += flashlightOffset.x * axis[1] + flashlightOffset.y * axis[0] + flashlightOffset.z * axis[2]; origin += flashlightOffset.x * axis[1] + flashlightOffset.y * axis[0] + flashlightOffset.z * axis[2];
curWeap = weaponWithFlashlightMounted->IdentifyWeapon(); curWeap = weaponWithFlashlightMounted->IdentifyWeapon();
if ( curWeap == WEAPON_ROCKETLAUNCHER ) if ( curWeap == WEAPON_SHOTGUN_DOUBLE || curWeap == WEAPON_ROCKETLAUNCHER )
{ {
//hack was already present in the code to fix borked alignments for these weapons, //hack was already present in the code to fix borked alignments for these weapons,
//we need to put them back //we need to put them back

View file

@ -68,7 +68,7 @@ const int FOCUS_TIME = 300;
const int FOCUS_GUI_TIME = 200; // Koz fixme, only change in VR. Previously 500, reduced to 200 to drop weapon out of guis faster. const int FOCUS_GUI_TIME = 200; // Koz fixme, only change in VR. Previously 500, reduced to 200 to drop weapon out of guis faster.
const int NUM_QUICK_SLOTS = 4; const int NUM_QUICK_SLOTS = 4;
const int MAX_WEAPONS = 16; const int MAX_WEAPONS = 32;
const int weapon_empty_hand = -2; // Carl: todo, maybe a different constant const int weapon_empty_hand = -2; // Carl: todo, maybe a different constant
@ -82,19 +82,6 @@ const int ZERO_VOLUME = -40; // volume at zero
const int DMG_VOLUME = 5; // volume when taking damage const int DMG_VOLUME = 5; // volume when taking damage
const int DEATH_VOLUME = 15; // volume at death const int DEATH_VOLUME = 15; // volume at death
/*const int WEAPON_FISTS = 0;
const int WEAPON_PISTOL = 1;
const int WEAPON_SHOTGUN = 2;
const int WEAPON_MACHINEGUN = 3;
const int WEAPON_CHAINGUN = 4;
const int WEAPON_GREANDE = 5;
const int WEAPON_PLASMARIFLE = 6;
const int WEAPON_ROCKETLAUNCHER = 7;
const int WEAPON_BFG = 8;
const int WEAPON_SOULCUBE = 9;
const int WEAPON_CHAINSAW = 10;
const int WEAPON_FLASHLIGHT = 11;*/
const int SAVING_THROW_TIME = 5000; // maximum one "saving throw" every five seconds const int SAVING_THROW_TIME = 5000; // maximum one "saving throw" every five seconds
extern const int ASYNC_PLAYER_INV_AMMO_BITS; extern const int ASYNC_PLAYER_INV_AMMO_BITS;
@ -579,19 +566,26 @@ public:
int weapon_pda; int weapon_pda;
int weapon_fists; int weapon_fists;
int weapon_flashlight; int weapon_flashlight;
int weapon_chainsaw; int weapon_chainsaw;
bool harvest_lock; int weapon_bloodstone;
// Koz begin int weapon_bloodstone_active1;
int weapon_pistol; int weapon_bloodstone_active2;
int weapon_shotgun; int weapon_bloodstone_active3;
int weapon_machinegun; bool harvest_lock;
int weapon_chaingun; // Koz begin
int weapon_handgrenade; int weapon_pistol;
int weapon_plasmagun; int weapon_shotgun;
int weapon_rocketlauncher; int weapon_shotgun_double;
int weapon_bfg; int weapon_machinegun;
int weapon_flashlight_new; int weapon_chaingun;
// Koz end int weapon_handgrenade;
int weapon_plasmagun;
int weapon_rocketlauncher;
int weapon_bfg;
int weapon_flashlight_new;
int weapon_grabber;
int heartRate; int heartRate;
idInterpolate<float> heartInfo; idInterpolate<float> heartInfo;
int lastHeartAdjust; int lastHeartAdjust;

View file

@ -27,7 +27,7 @@
// *** Oculus HMD Variables // *** Oculus HMD Variables
idCVar vr_scale( "vr_scale", "1.0", CVAR_FLOAT | CVAR_ARCHIVE | CVAR_GAME, "World scale. Everything virtual is this times as big." ); idCVar vr_scale( "vr_scale", "1.0", CVAR_FLOAT | CVAR_ARCHIVE | CVAR_GAME, "World scale. Everything virtual is this times as big." );
//In Menu - not working (needs virtual function) //In Menu - added virtual function - needs testing
idCVar vr_useFloorHeight( "vr_useFloorHeight", "0", CVAR_INTEGER | CVAR_ARCHIVE | CVAR_GAME, "0 = Custom eye height. 1 = Marine Eye Height. 2 = Normal View Height. 3 = make floor line up by Doomguy crouching. 4 = make everything line up by scaling world to your height.", 0, 4 ); idCVar vr_useFloorHeight( "vr_useFloorHeight", "0", CVAR_INTEGER | CVAR_ARCHIVE | CVAR_GAME, "0 = Custom eye height. 1 = Marine Eye Height. 2 = Normal View Height. 3 = make floor line up by Doomguy crouching. 4 = make everything line up by scaling world to your height.", 0, 4 );
idCVar vr_normalViewHeight( "vr_normalViewHeight", "73", CVAR_FLOAT | CVAR_ARCHIVE | CVAR_GAME, "Height of player's view while standing, in real world inches." ); idCVar vr_normalViewHeight( "vr_normalViewHeight", "73", CVAR_FLOAT | CVAR_ARCHIVE | CVAR_GAME, "Height of player's view while standing, in real world inches." );
@ -169,7 +169,7 @@ idCVar vr_crouchMode( "vr_crouchMode", "0", CVAR_INTEGER | CVAR_GAME | CVAR_ARCH
idCVar vr_crouchTriggerDist( "vr_crouchTriggerDist", "7", CVAR_FLOAT | CVAR_ARCHIVE, " Distance ( in real-world inches ) player must crouch in real life to toggle crouch\n" ); idCVar vr_crouchTriggerDist( "vr_crouchTriggerDist", "7", CVAR_FLOAT | CVAR_ARCHIVE, " Distance ( in real-world inches ) player must crouch in real life to toggle crouch\n" );
idCVar vr_crouchHideBody( "vr_crouchHideBody", "0", CVAR_FLOAT | CVAR_ARCHIVE, "Hide body ( if displayed ) when crouching. 0 = Dont hide, 1 = hide." ); idCVar vr_crouchHideBody( "vr_crouchHideBody", "0", CVAR_FLOAT | CVAR_ARCHIVE, "Hide body ( if displayed ) when crouching. 0 = Dont hide, 1 = hide." );
idCVar vr_frameCheck( "vr_frameCheck", "0", CVAR_INTEGER | CVAR_ARCHIVE, "0 = bypass frame check" ); idCVar vr_frameCheck( "vr_frameCheck", "1", CVAR_INTEGER | CVAR_ARCHIVE, "0 = bypass frame check" );
idCVar vr_teleportSkipHandrails( "vr_teleportSkipHandrails", "0", CVAR_INTEGER | CVAR_ARCHIVE, "Teleport aim ingnores handrails. 1 = true" ); idCVar vr_teleportSkipHandrails( "vr_teleportSkipHandrails", "0", CVAR_INTEGER | CVAR_ARCHIVE, "Teleport aim ingnores handrails. 1 = true" );
idCVar vr_teleportShowAimAssist( "vr_teleportShowAimAssist", "0", CVAR_INTEGER | CVAR_ARCHIVE, "Move telepad target to reflect aim assist. 1 = true" ); idCVar vr_teleportShowAimAssist( "vr_teleportShowAimAssist", "0", CVAR_INTEGER | CVAR_ARCHIVE, "Move telepad target to reflect aim assist. 1 = true" );
@ -205,10 +205,6 @@ idCVar vr_headshotMultiplier( "vr_headshotMultiplier", "2.5", CVAR_FLOAT | CVAR_
// Carl // Carl
idCVar vr_weaponCycleMode( "vr_weaponCycleMode", "0", CVAR_INTEGER | CVAR_GAME | CVAR_ARCHIVE, "When cycling through weapons\n0 = skip holstered weapons, 1 = include holstered weapons, 2 = flashlight but not holstered, 3 = holstered+flashlight, 4 = holstered+flashlight+pda" ); idCVar vr_weaponCycleMode( "vr_weaponCycleMode", "0", CVAR_INTEGER | CVAR_GAME | CVAR_ARCHIVE, "When cycling through weapons\n0 = skip holstered weapons, 1 = include holstered weapons, 2 = flashlight but not holstered, 3 = holstered+flashlight, 4 = holstered+flashlight+pda" );
idCVar vr_gripMode( "vr_gripMode", "0", CVAR_INTEGER | CVAR_GAME | CVAR_ARCHIVE, "How the grip button works\n0 = context sensitive toggle, 1 = context sensitive toggle no surface, 2 = toggle for weapons/items hold for physics objects, 3 = toggle for weapons hold for physics/items, 4 = always toggle (can drop), 5 = Dead and Burried, 6 = hold to hold, 7 = hold to hold squeeze for action" ); idCVar vr_gripMode( "vr_gripMode", "0", CVAR_INTEGER | CVAR_GAME | CVAR_ARCHIVE, "How the grip button works\n0 = context sensitive toggle, 1 = context sensitive toggle no surface, 2 = toggle for weapons/items hold for physics objects, 3 = toggle for weapons hold for physics/items, 4 = always toggle (can drop), 5 = Dead and Burried, 6 = hold to hold, 7 = hold to hold squeeze for action" );
idCVar vr_doubleClickGrip( "vr_doubleClickGrip", "0", CVAR_INTEGER | CVAR_GAME | CVAR_ARCHIVE, "Double-clicking grip 0 = does nothing, 1 = drops or does action (depending on grip mode). Not implemented!" );
idCVar vr_pickUpMode( "vr_pickUpMode", "1", CVAR_INTEGER | CVAR_GAME | CVAR_ARCHIVE, "How to pick up/collect/use items and powerups 0 = walk over, 1 = walk/touch, 2 = touch, 3 = manual grip, 4 = put in body, 5 = put in properly, 6 = hold and press trigger" );
//What is this??
idCVar vr_reloadMode( "vr_reloadMode", "0", CVAR_INTEGER | CVAR_GAME | CVAR_ARCHIVE, "How to reload your weapon\n0 = button, 1 = with other hand, 2 = with other empty hand, 3 = Dead and Burried" );
idCVar vr_mustEmptyHands( "vr_mustEmptyHands", "0", CVAR_BOOL | CVAR_GAME | CVAR_ARCHIVE, "Do you need to have an empty hand to interact with things?\n0 = no, it works automatically; 1 = yes, your hand must be empty" ); idCVar vr_mustEmptyHands( "vr_mustEmptyHands", "0", CVAR_BOOL | CVAR_GAME | CVAR_ARCHIVE, "Do you need to have an empty hand to interact with things?\n0 = no, it works automatically; 1 = yes, your hand must be empty" );
idCVar vr_contextSensitive( "vr_contextSensitive", "1", CVAR_BOOL | CVAR_GAME | CVAR_ARCHIVE, "Are buttons context sensitive?\n0 = no just map the buttons in the binding window, 1 = yes, context sensitive buttons (default)" ); idCVar vr_contextSensitive( "vr_contextSensitive", "1", CVAR_BOOL | CVAR_GAME | CVAR_ARCHIVE, "Are buttons context sensitive?\n0 = no just map the buttons in the binding window, 1 = yes, context sensitive buttons (default)" );
idCVar vr_dualWield( "vr_dualWield", "2", CVAR_INTEGER | CVAR_GAME | CVAR_ARCHIVE, "Can you use two weapons at once?\n0 = not even fists, 1 = nothing, 2 = only flashlight, 3 = only grenades (VFR), 4 = only grenades/flashlight, 5 = only pistols, 6 = only pistols/flashlight, 7 = only pistols/grenades/flashlight, 8 = yes" ); idCVar vr_dualWield( "vr_dualWield", "2", CVAR_INTEGER | CVAR_GAME | CVAR_ARCHIVE, "Can you use two weapons at once?\n0 = not even fists, 1 = nothing, 2 = only flashlight, 3 = only grenades (VFR), 4 = only grenades/flashlight, 5 = only pistols, 6 = only pistols/flashlight, 7 = only pistols/grenades/flashlight, 8 = yes" );

View file

@ -541,8 +541,7 @@ extern idCVar vr_headshotMultiplier;
extern idCVar vr_weaponCycleMode; extern idCVar vr_weaponCycleMode;
extern idCVar vr_gripMode; extern idCVar vr_gripMode;
extern idCVar vr_doubleClickGrip; extern idCVar vr_doubleClickGrip;
extern idCVar vr_pickUpMode;
extern idCVar vr_reloadMode;
extern idCVar vr_mustEmptyHands; extern idCVar vr_mustEmptyHands;
extern idCVar vr_contextSensitive; extern idCVar vr_contextSensitive;
extern idCVar vr_dualWield; extern idCVar vr_dualWield;

View file

@ -1209,28 +1209,31 @@ weapon_t idWeapon::IdentifyWeapon()
{ {
idStr weaponName = weaponDef->GetName(); idStr weaponName = weaponDef->GetName();
if ( idStr::Icmp( "weapon_fists", weaponDef->GetName() ) == 0 ) currentIdentifiedWeapon = WEAPON_FISTS; if ( idStr::Icmp( "weapon_fists", weaponDef->GetName() ) == 0 ) currentIdentifiedWeapon = WEAPON_FISTS;
else if ( idStr::Icmp( "weapon_chainsaw", weaponDef->GetName() ) == 0 ) currentIdentifiedWeapon = WEAPON_CHAINSAW; else if ( idStr::Icmp( "weapon_chainsaw", weaponDef->GetName() ) == 0 ) currentIdentifiedWeapon = WEAPON_CHAINSAW;
else if ( idStr::Icmp( "weapon_pistol", weaponDef->GetName() ) == 0 ) currentIdentifiedWeapon = WEAPON_PISTOL; else if ( idStr::Icmp( "weapon_pistol", weaponDef->GetName() ) == 0 ) currentIdentifiedWeapon = WEAPON_PISTOL;
else if ( idStr::Icmp( "weapon_shotgun", weaponDef->GetName() ) == 0 ) currentIdentifiedWeapon = WEAPON_SHOTGUN; else if ( idStr::Icmp( "weapon_shotgun", weaponDef->GetName() ) == 0 ) currentIdentifiedWeapon = WEAPON_SHOTGUN;
else if ( idStr::Icmp( "weapon_machinegun", weaponDef->GetName() ) == 0 ) currentIdentifiedWeapon = WEAPON_MACHINEGUN; else if ( idStr::Icmp( "weapon_machinegun", weaponDef->GetName() ) == 0 ) currentIdentifiedWeapon = WEAPON_MACHINEGUN;
else if ( idStr::Icmp( "weapon_chaingun", weaponDef->GetName() ) == 0 ) currentIdentifiedWeapon = WEAPON_CHAINGUN; else if ( idStr::Icmp( "weapon_chaingun", weaponDef->GetName() ) == 0 ) currentIdentifiedWeapon = WEAPON_CHAINGUN;
else if ( idStr::Icmp( "weapon_handgrenade", weaponDef->GetName() ) == 0 ) currentIdentifiedWeapon = WEAPON_HANDGRENADE; else if ( idStr::Icmp( "weapon_handgrenade", weaponDef->GetName() ) == 0 ) currentIdentifiedWeapon = WEAPON_HANDGRENADE;
else if ( idStr::Icmp( "weapon_plasmagun", weaponDef->GetName() ) == 0 ) currentIdentifiedWeapon = WEAPON_PLASMAGUN; else if ( idStr::Icmp( "weapon_plasmagun", weaponDef->GetName() ) == 0 ) currentIdentifiedWeapon = WEAPON_PLASMAGUN;
else if ( idStr::Icmp( "weapon_rocketlauncher", weaponDef->GetName() ) == 0 ) currentIdentifiedWeapon = WEAPON_ROCKETLAUNCHER; else if ( idStr::Icmp( "weapon_rocketlauncher", weaponDef->GetName() ) == 0 ) currentIdentifiedWeapon = WEAPON_ROCKETLAUNCHER;
else if ( idStr::Icmp( "weapon_bfg", weaponDef->GetName() ) == 0 ) currentIdentifiedWeapon = WEAPON_BFG; else if ( idStr::Icmp( "weapon_bfg", weaponDef->GetName() ) == 0 ) currentIdentifiedWeapon = WEAPON_BFG;
else if ( idStr::Icmp( "weapon_soulcube", weaponDef->GetName() ) == 0 ) currentIdentifiedWeapon = WEAPON_SOULCUBE; else if ( idStr::Icmp( "weapon_soulcube", weaponDef->GetName() ) == 0 ) currentIdentifiedWeapon = WEAPON_SOULCUBE;
else if ( idStr::Icmp( "weapon_artifact", weaponDef->GetName() ) == 0 ) currentIdentifiedWeapon = WEAPON_ARTIFACT; else if ( idStr::Icmp( "weapon_shotgun_double_mp", weaponDef->GetName() ) == 0 ) currentIdentifiedWeapon = WEAPON_SHOTGUN_DOUBLE_MP;
else if ( idStr::Icmp( "weapon_bloodstone_passive", weaponDef->GetName() ) == 0 ) currentIdentifiedWeapon = WEAPON_ARTIFACT; else if ( idStr::Icmp( "weapon_grabber", weaponDef->GetName() ) == 0 ) currentIdentifiedWeapon = WEAPON_GRABBER;
else if ( idStr::Icmp( "weapon_bloodstone_active1", weaponDef->GetName() ) == 0 ) currentIdentifiedWeapon = WEAPON_ARTIFACT; else if ( idStr::Icmp( "weapon_shotgun_double", weaponDef->GetName() ) == 0 ) currentIdentifiedWeapon = WEAPON_SHOTGUN_DOUBLE;
else if ( idStr::Icmp( "weapon_bloodstone_active2", weaponDef->GetName() ) == 0 ) currentIdentifiedWeapon = WEAPON_ARTIFACT; else if ( idStr::Icmp( "weapon_artifact", weaponDef->GetName() ) == 0 ) currentIdentifiedWeapon = WEAPON_ARTIFACT;
else if ( idStr::Icmp( "weapon_bloodstone_active3", weaponDef->GetName() ) == 0 ) currentIdentifiedWeapon = WEAPON_ARTIFACT; else if ( idStr::Icmp( "weapon_bloodstone_passive", weaponDef->GetName() ) == 0 ) currentIdentifiedWeapon = WEAPON_ARTIFACT;
else if ( idStr::Icmp( "weapon_pda", weaponDef->GetName() ) == 0 ) currentIdentifiedWeapon = WEAPON_PDA; else if ( idStr::Icmp( "weapon_bloodstone_active1", weaponDef->GetName() ) == 0 ) currentIdentifiedWeapon = WEAPON_ARTIFACT;
else if ( idStr::Icmp( "weapon_flashlight_new", weaponDef->GetName() ) == 0 ) currentIdentifiedWeapon = lastIdentifiedWeapon; else if ( idStr::Icmp( "weapon_bloodstone_active2", weaponDef->GetName() ) == 0 ) currentIdentifiedWeapon = WEAPON_ARTIFACT;
//else if ( idStr::Icmp( "weapon_flashlight_new", weaponDef->GetName() ) == 0 ) currentIdentifiedWeapon = WEAPON_FLASHLIGHT; else if ( idStr::Icmp( "weapon_bloodstone_active3", weaponDef->GetName() ) == 0 ) currentIdentifiedWeapon = WEAPON_ARTIFACT;
//else if ( idStr::Icmp( "weapon_flashlight", weaponDef->GetName() ) == 0 ) currentIdentifiedWeapon = WEAPON_FLASHLIGHT; else if ( idStr::Icmp( "weapon_pda", weaponDef->GetName() ) == 0 ) currentIdentifiedWeapon = WEAPON_PDA;
else currentIdentifiedWeapon = WEAPON_NONE; else if ( idStr::Icmp( "weapon_flashlight_new", weaponDef->GetName() ) == 0 ) currentIdentifiedWeapon = lastIdentifiedWeapon;
lastIdentifiedWeapon = currentIdentifiedWeapon; //else if ( idStr::Icmp( "weapon_flashlight_new", weaponDef->GetName() ) == 0 ) currentWeapon = WEAPON_FLASHLIGHT;
//else if ( idStr::Icmp( "weapon_flashlight", weaponDef->GetName() ) == 0 ) currentWeapon = WEAPON_FLASHLIGHT;
else currentIdentifiedWeapon = WEAPON_NONE;
lastIdentifiedWeapon = currentIdentifiedWeapon;
} }
} }
if ( currentIdentifiedWeapon == WEAPON_FLASHLIGHT ) common->Printf( "Identify weapon returned %s\n", weaponDef->GetName() ); if ( currentIdentifiedWeapon == WEAPON_FLASHLIGHT ) common->Printf( "Identify weapon returned %s\n", weaponDef->GetName() );
@ -1756,6 +1759,30 @@ bool idWeapon::GetMuzzlePositionWithHacks( idVec3& origin, idMat3& axis )
break; break;
} }
case WEAPON_SHOTGUN_DOUBLE:
{
// joint doesn't point straight, so rotate it
//const jointHandle_t bodJoint = animator.GetJointHandle("trigger");
//GetGlobalJointTransform(true, bodJoint, discardedOrigin, axis);
std::swap( axis[0], axis[2] ); // Koz fixme just swap like the rocketlauncher this should work now test and cleanup
//axis[0] = -axis[0];
//common->Printf( "GMPWH returning value for WEAPON_SHOTGUN_DOUBLE \n" );
break;
}
case WEAPON_GRABBER:
{
idVec3 forward = axis[0];
forward.Normalize();
const float scaleOffset = 4.0f;
forward *= scaleOffset;
origin += forward;
break;
}
case WEAPON_PLASMAGUN: case WEAPON_PLASMAGUN:
{ {
// the barrel of the plasma rifle is angled down by default, bring it up a little so it shoots straight. // the barrel of the plasma rifle is angled down by default, bring it up a little so it shoots straight.
@ -3684,7 +3711,7 @@ void idWeapon::Event_LaunchProjectiles( int num_projectiles, float spread, float
weapon_t currentWeap; weapon_t currentWeap;
currentWeap = IdentifyWeapon(); currentWeap = IdentifyWeapon();
if ( currentWeap == WEAPON_SHOTGUN) if ( currentWeap == WEAPON_SHOTGUN || currentWeap == WEAPON_SHOTGUN_DOUBLE || currentWeap == WEAPON_SHOTGUN_DOUBLE_MP )
{ {
//idPlayer *player; //idPlayer *player;
//player = gameLocal.GetLocalPlayer(); //player = gameLocal.GetLocalPlayer();

View file

@ -65,6 +65,9 @@ typedef enum { // Koz weapon enumerations
WEAPON_ROCKETLAUNCHER, WEAPON_ROCKETLAUNCHER,
WEAPON_BFG, WEAPON_BFG,
WEAPON_SOULCUBE, WEAPON_SOULCUBE,
WEAPON_SHOTGUN_DOUBLE,
WEAPON_SHOTGUN_DOUBLE_MP,
WEAPON_GRABBER,
WEAPON_ARTIFACT, WEAPON_ARTIFACT,
WEAPON_PDA, WEAPON_PDA,
WEAPON_FLASHLIGHT, WEAPON_FLASHLIGHT,
@ -73,19 +76,22 @@ typedef enum { // Koz weapon enumerations
// Koz flashlightOffsets - values are used to move flashlight model to 'mount' to the active weapon. Hacky McCrappyHack was here. // Koz flashlightOffsets - values are used to move flashlight model to 'mount' to the active weapon. Hacky McCrappyHack was here.
const idVec3 flashlightOffsets[int(WEAPON_NUM_WEAPONS)] = { idVec3( 0.0f, 0.0f, 0.0f ), // WEAPON_NONE const idVec3 flashlightOffsets[int(WEAPON_NUM_WEAPONS)] = { idVec3( 0.0f, 0.0f, 0.0f ), // WEAPON_NONE
idVec3( 0.0f, 0.0f, 0.0f ), // WEAPON_FISTS idVec3( 0.0f, 0.0f, 0.0f ), // WEAPON_FISTS
idVec3( 0.0f, 0.0f, 0.0f ), // WEAPON_CHAINSAW idVec3( 0.0f, 0.0f, 0.0f ), // WEAPON_CHAINSAW
idVec3( -1.25f, -6.5f, 0.9f ), // WEAPON_PISTOL idVec3( -1.25f, -6.5f, 0.9f ), // WEAPON_PISTOL
idVec3( -1.75f, -3.5f, 1.15f ), // WEAPON_SHOTGUN idVec3( -1.75f, -3.5f, 1.15f ), // WEAPON_SHOTGUN
idVec3( -2.2f, -7.5f, 1.2f ), // WEAPON_MACHINEGUN idVec3( -2.2f, -7.5f, 1.2f ), // WEAPON_MACHINEGUN
idVec3( -2.3f, -11.25f, -4.5f ), // WEAPON_CHAINGUN idVec3( -2.3f, -11.25f, -4.5f ), // WEAPON_CHAINGUN
idVec3( 0.0f, 0.0f, 0.0f ), // WEAPON_HANDGRENADE idVec3( 0.0f, 0.0f, 0.0f ), // WEAPON_HANDGRENADE
idVec3( -3.0f, -6.5f, 1.65f ), // WEAPON_PLASMAGUN idVec3( -3.0f, -6.5f, 1.65f ), // WEAPON_PLASMAGUN
idVec3( 4.4f, -14.5f, -3.5f ), // WEAPON_ROCKETLAUNCHER idVec3( 4.4f, -14.5f, -3.5f ), // WEAPON_ROCKETLAUNCHER
idVec3( -0.5f, -6.0f, 6.9f ), // WEAPON_BFG idVec3( -0.5f, -6.0f, 6.9f ), // WEAPON_BFG
idVec3( 0.0f, 0.0f, 0.0f ), // WEAPON_SOULCUBE idVec3( 0.0f, 0.0f, 0.0f ), // WEAPON_SOULCUBE
idVec3( 0.0f, 0.0f, 0.0f ), // WEAPON_ARTIFACT idVec3( -0.5f, -9.5f, -2.0f ), // WEAPON_SHOTGUN_DOUBLE
idVec3( 0.0f, 0.0f, 0.0f ) // WEAPON_PDA idVec3( -0.5f, -9.0f, -2.0f ), // WEAPON_SHOTGUN_DOUBLE_MP
idVec3( -4.25f, 6.0, 1.25f ), // WEAPON_GRABBER
idVec3( 0.0f, 0.0f, 0.0f ), // WEAPON_ARTIFACT
idVec3( 0.0f, 0.0f, 0.0f ) // WEAPON_PDA
}; };
typedef int ammo_t; typedef int ammo_t;

View file

@ -352,3 +352,11 @@ idCVar g_infiniteAmmo( "g_infiniteAmmo", "0", CVAR_GAME | CVAR_BOOL, "infinite a
idCVar g_useWeaponDepthHack( "g_useWeaponDepthHack", "0", CVAR_BOOL | CVAR_GAME | CVAR_ARCHIVE, "Crunch z depth on weapons" );// Koz idCVar g_useWeaponDepthHack( "g_useWeaponDepthHack", "0", CVAR_BOOL | CVAR_GAME | CVAR_ARCHIVE, "Crunch z depth on weapons" );// Koz
idCVar g_weaponShadows( "g_weaponShadows", "1", CVAR_BOOL | CVAR_GAME | CVAR_ARCHIVE, "Cast shadows from weapons" ); // Koz idCVar g_weaponShadows( "g_weaponShadows", "1", CVAR_BOOL | CVAR_GAME | CVAR_ARCHIVE, "Cast shadows from weapons" ); // Koz
idCVar timescale( "timescale", "1", CVAR_SYSTEM | CVAR_FLOAT, "Number of game frames to run per render frame", 0.001f, 100.0f ); idCVar timescale( "timescale", "1", CVAR_SYSTEM | CVAR_FLOAT, "Number of game frames to run per render frame", 0.001f, 100.0f );
idCVar g_grabberHoldSeconds( "g_grabberHoldSeconds", "3", CVAR_GAME | CVAR_FLOAT | CVAR_CHEAT, "number of seconds to hold object" );
idCVar g_grabberEnableShake( "g_grabberEnableShake", "1", CVAR_GAME | CVAR_BOOL | CVAR_CHEAT, "enable the grabber shake" );
idCVar g_grabberRandomMotion( "g_grabberRandomMotion", "1", CVAR_GAME | CVAR_BOOL | CVAR_CHEAT, "enable random motion on the grabbed object" );
idCVar g_grabberHardStop( "g_grabberHardStop", "1", CVAR_GAME | CVAR_BOOL | CVAR_CHEAT, "hard stops object if too fast" );
idCVar g_grabberDamping( "g_grabberDamping", "0.5", CVAR_GAME | CVAR_FLOAT | CVAR_CHEAT, "damping of grabber" );
idCVar g_xp_bind_run_once( "g_xp_bind_run_once", "0", CVAR_GAME | CVAR_BOOL | CVAR_ARCHIVE, "Rebind all controls once for D3XP." );

View file

@ -250,6 +250,14 @@ extern idCVar si_spectators;
extern idCVar net_clientSelfSmoothing; extern idCVar net_clientSelfSmoothing;
extern idCVar net_clientLagOMeter; extern idCVar net_clientLagOMeter;
extern idCVar g_grabberHoldSeconds;
extern idCVar g_grabberEnableShake;
extern idCVar g_grabberRandomMotion;
extern idCVar g_grabberHardStop;
extern idCVar g_grabberDamping;
extern idCVar g_xp_bind_run_once;
//VR CVARS //VR CVARS
extern idCVar vr_ipd; extern idCVar vr_ipd;
extern idCVar vr_worldscale; extern idCVar vr_worldscale;
@ -266,6 +274,8 @@ extern idCVar g_useWeaponDepthHack;
extern idCVar g_weaponShadows; extern idCVar g_weaponShadows;
extern idCVar timescale; extern idCVar timescale;
extern const char *si_gameTypeArgs[]; extern const char *si_gameTypeArgs[];
extern const char *ui_skinArgs[]; extern const char *ui_skinArgs[];

View file

@ -29,6 +29,7 @@ If you have questions concerning this license or the applicable additional terms
#include "sys/platform.h" #include "sys/platform.h"
#include "framework/UsercmdGen.h" #include "framework/UsercmdGen.h"
#include "physics/Physics.h" #include "physics/Physics.h"
#include "physics/Force_Grab.h" #include "physics/Force_Grab.h"
#include "WorldSpawn.h" #include "WorldSpawn.h"

View file

@ -31,6 +31,7 @@ If you have questions concerning this license or the applicable additional terms
#include "physics/Force.h" #include "physics/Force.h"
#include "Force.h"
/* /*
=============================================================================== ===============================================================================

View file

@ -282,19 +282,7 @@ See if some cvars that we watch have changed
static void R_CheckCvars( void ) { static void R_CheckCvars( void ) {
globalImages->CheckCvars(); globalImages->CheckCvars();
//GB Not Currently working - Fix (Create a Virtual Function) //game->CheckRenderCvars();
// Koz
/*if ( game->isVR )
{
if ( vr_useFloorHeight.IsModified() || ( vr_normalViewHeight.IsModified() && vr_useFloorHeight.GetInteger() == 0 ) || vr_scale.IsModified() || commonVr->shouldRecenter )
{
commonVr->HMDResetTrackingOriginOffset();
vr_useFloorHeight.ClearModified();
vr_normalViewHeight.ClearModified();
vr_scale.ClearModified();
commonVr->shouldRecenter = false;
}
}*/
// gamma stuff // gamma stuff
if ( r_gamma.IsModified() || r_brightness.IsModified() ) { if ( r_gamma.IsModified() || r_brightness.IsModified() ) {