Added weapon resting & weapon jam sounds

This commit is contained in:
Glowbal 2015-02-01 11:11:51 +01:00
parent 2deb5ffacb
commit 3f0b6650e0
12 changed files with 49 additions and 1 deletions

View File

@ -3,4 +3,24 @@ class CfgSounds {
sound[] = {QUOTE(PATHTOF(sounds\barrelswap.ogg)),5,1,200}; sound[] = {QUOTE(PATHTOF(sounds\barrelswap.ogg)),5,1,200};
titles[] = {}; titles[] = {};
}; };
class GVAR(jamming_rifle) {
name=QGVAR(jamming_rifle);
sound[]={QUOTE(PATHTOF(sounds\jamming_rifle.wav)),1,1};
titles[]={};
};
class GVAR(jamming_pistol) {
name=QGVAR(jamming_pistol);
sound[]={QUOTE(PATHTOF(sounds\jamming_pistol.wav)),1,1};
titles[]={};
};
class GVAR(fixing_rifle) {
name=QGVAR(fixing_rifle);
sound[]={QUOTE(PATHTOF(sounds\fixing_rifle.wav)),1,1};
titles[]={};
};
class GVAR(fixing_pistol) {
name= QGVAR(fixing_pistol);
sound[]={QUOTE(PATHTOF(sounds\fixing_pistol.wav)),1,1};
titles[]={};
};
}; };

View File

@ -42,6 +42,12 @@ if (_weapon in _jammedWeapons) then {
_unit playActionNow _clearJamAction; _unit playActionNow _clearJamAction;
}; };
if (_weapon == primaryWeapon _unit) then {
playSound QGVAR(fixing_rifle);
} else {
if (_weapon == secondaryWeapon _unit) then {
playSound QGVAR(fixing_pistol);
};
};
[localize "STR_ACE_Overheating_WeaponUnjammed"] call EFUNC(common,displayTextStructured); [localize "STR_ACE_Overheating_WeaponUnjammed"] call EFUNC(common,displayTextStructured);
}; };

View File

@ -0,0 +1,14 @@
class CfgSounds {
class GVAR(rest)
{
name=QGVAR(rest);
sound[]={QUOTE(PATHTOF(sounds\weaponrest_rest.wav)),1,1};
titles[]={};
};
class GVAR(unrest)
{
name=QGVAR(unrest);
sound[]={QUOTE(PATHTOF(sounds\weaponrest_unrest.wav)),1,1};
titles[]={};
};
};

View File

@ -17,3 +17,5 @@ class CfgPatches {
#include "CfgWeapons.hpp" #include "CfgWeapons.hpp"
#include "CfgMoves.hpp" #include "CfgMoves.hpp"
#include "CfgSounds.hpp"

View File

@ -14,6 +14,8 @@
EXPLODE_3_PVT(_this,_unit,_vehicle,_weapon); EXPLODE_3_PVT(_this,_unit,_vehicle,_weapon);
systemChat format["restingWeapon %1", _this];
if (_weapon != primaryWeapon _unit) exitWith {}; if (_weapon != primaryWeapon _unit) exitWith {};
if (_unit getVariable ["ACE_weaponRested", false]) exitWith {_this call FUNC(unRestWeapon)}; if (_unit getVariable ["ACE_weaponRested", false]) exitWith {_this call FUNC(unRestWeapon)};
@ -33,6 +35,8 @@ if (true in _intersects) then {
// REST THE WEAPON // REST THE WEAPON
addCamShake CAMSHAKE; addCamShake CAMSHAKE;
playSound QGVAR(rest);
// playSound3D [QUOTE(PATHTOF(sounds\weaponrest_rest.wav)), _unit];
if ([_weapon] call FUNC(hasBipod) && {_intersects select 3}) then { if ([_weapon] call FUNC(hasBipod) && {_intersects select 3}) then {
_unit setVariable ["ACE_bipodDeployed", true]; _unit setVariable ["ACE_bipodDeployed", true];

View File

@ -43,6 +43,8 @@ if (_unit getVariable ["ACE_bipodDeployed", false]) then {
_picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture"); _picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture");
[localize "STR_ACE_Resting_WeaponLifted", _picture] call EFUNC(common,displayTextPicture); [localize "STR_ACE_Resting_WeaponLifted", _picture] call EFUNC(common,displayTextPicture);
}; };
playSound QGVAR(unrest);
//playSound3D [QUOTE(PATHTOF(sounds\weaponrest_unrest.wav)), _unit];
_unit setVariable ["ACE_weaponRested", false]; _unit setVariable ["ACE_weaponRested", false];
_unit setVariable ["ACE_bipodDeployed", false]; _unit setVariable ["ACE_bipodDeployed", false];