Merge branch 'master' into Additional_UI_Client_settings

Conflicts:
	addons/reload/CfgEventHandlers.hpp
	addons/reload/functions/fnc_checkAmmo.sqf
This commit is contained in:
Glowbal 2015-03-08 17:03:25 +01:00
commit f08f8beeff
51 changed files with 1742 additions and 1509 deletions

View File

@ -15,7 +15,7 @@
</p>
<p align="center"><sup><strong>Requires the latest version of <a href="http://www.armaholic.com/page.php?id=18767">CBA A3</a> | <a href="#">BIF thread</a></strong></sup></p>
**ACE 3** is a join effort by the teams behind **ACE 2**, **AGM**, **CSE** and **RHS** to improve the realism and authenticity of Arma 3.
**ACE 3** is a join effort by the teams behind **ACE 2**, **AGM** and **CSE** to improve the realism and authenticity of Arma 3.
This mod is entirely **open-source**, and everyone is free to propose changes or maintain their own, customized version as long as they make their changes open to the public in accordance with the GNU General Public License (for more information check the license file attached to this project).
@ -32,7 +32,7 @@ More information on the purpose of the different components of ACE and which one
* Realistic ballistics including wind and humidity
* Backblast simulation
* Weapon resting and bipod deployment
* A fire control system for armored vehicles and helicopters
* A fire control system for armored vehicles and helicopters
***and more...***
For a full list of current features, check [the official wiki](https://github.com/KoffeinFlummi/ACE3/wiki).

Binary file not shown.

View File

@ -217,9 +217,8 @@ class CfgVehicles {
};*/
};
class I_Heli_Transport_02_F: Heli_Transport_02_base_F {};
class I_Heli_light_03_base_F: Helicopter_Base_F {
class Heli_light_03_base_F: Helicopter_Base_F {};
class I_Heli_light_03_base_F: Heli_light_03_base_F {
lockDetectionSystem = 0;
incomingMissileDetectionSystem = 16;
driverCanEject = 1;
@ -242,15 +241,15 @@ class CfgVehicles {
};
};
class I_Heli_light_03_F: I_Heli_light_03_base_F {
class I_Heli_light_03_F: Heli_light_03_base_F {
class Turrets: Turrets {
class MainTurret: MainTurret {};
};
};
class I_Heli_light_03_unarmed_base_F: I_Heli_light_03_base_F {};
class Heli_light_03_unarmed_base_F: Heli_light_03_base_F {};
class I_Heli_light_03_unarmed_F: I_Heli_light_03_unarmed_base_F {};
class I_Heli_light_03_unarmed_F: Heli_light_03_unarmed_base_F {};
class Plane_CAS_01_base_F: Plane_Base_F {
lockDetectionSystem = 12;
@ -303,7 +302,8 @@ class CfgVehicles {
};*/
};
class B_Heli_Transport_03_base_F: Helicopter_Base_H {
class Heli_Transport_03_base_F: Helicopter_Base_H {};
class B_Heli_Transport_03_base_F: Heli_Transport_03_base_F {
lockDetectionSystem = 12;
incomingMissileDetectionSystem = 16;
driverCanEject = 1;
@ -317,7 +317,7 @@ class CfgVehicles {
};
};
class B_Heli_Transport_03_unarmed_base_F: B_Heli_Transport_03_base_F {
class B_Heli_Transport_03_unarmed_base_F: Heli_Transport_03_base_F {
class Turrets: Turrets {
class CopilotTurret: CopilotTurret {
canEject = 1;

View File

@ -147,6 +147,7 @@ PREP(removeCameraEventHandler);
PREP(removeCustomEventHandler);
PREP(removeMapMarkerCreatedEventHandler);
PREP(removeScrollWheelEventHandler);
PREP(removeSpecificMagazine);
PREP(requestCallback);
PREP(resetAllDefaults);
PREP(restoreVariablesJIP);

View File

@ -0,0 +1,69 @@
/*
* Author: CAA-Picard
* Removes a magazine from the unit that has an specific ammo count
*
* Argument:
* 0: Player <OBJECT>
* 1: Magazine <STRING>
* 2: Ammo count <NUMBER>
*
* Return value:
* None
*/
#include "script_component.hpp"
EXPLODE_3_PVT(_this,_player,_magazineType,_ammoCount);
private ["_magazines","_index","_isRemoved"];
_isRemoved = false;
// Check uniform
_magazines = [magazinesAmmoCargo uniformContainer _player, {_this select 0 == _magazineType}] call FUNC(filter);
_index = _magazines find [_magazineType,_ammoCount];
if (_index > -1) exitWith {
{
_player removeItemFromUniform (_x select 0);
} forEach _magazines;
{
if (!_isRemoved && (_x isEqualTo [_magazineType,_ammoCount])) then {
_isRemoved = true;
} else {
(uniformContainer _player) addMagazineAmmoCargo [_x select 0, 1, _x select 1];
};
} forEach _magazines;
};
// Check vest
_magazines = [magazinesAmmoCargo vestContainer _player, {_this select 0 == _magazineType}] call FUNC(filter);
_index = _magazines find [_magazineType,_ammoCount];
if (_index > -1) exitWith {
{
_player removeItemFromVest (_x select 0);
} forEach _magazines;
{
if (!_isRemoved && (_x isEqualTo [_magazineType,_ammoCount])) then {
_isRemoved = true;
} else {
(vestContainer _player) addMagazineAmmoCargo [_x select 0, 1, _x select 1];
};
} forEach _magazines;
};
// Check backpack
_magazines = [magazinesAmmoCargo backpackContainer _player, {_this select 0 == _magazineType}] call FUNC(filter);
_index = _magazines find [_magazineType,_ammoCount];
if (_index > -1) exitWith {
{
_player removeItemFromBackpack (_x select 0);
} forEach _magazines;
{
if (!_isRemoved && (_x isEqualTo [_magazineType,_ammoCount])) then {
_isRemoved = true;
} else {
(backpackContainer _player) addMagazineAmmoCargo [_x select 0, 1, _x select 1];
};
} forEach _magazines;
};

View File

@ -28,7 +28,7 @@ class CfgVehicles {
displayName = $STR_ACE_FCS_ResetFCS;
enableInside = 1;
condition = QUOTE(call FUNC(canResetFCS));
statement = QUOTE([ARR_2(_vehicle,[_player] call DEFUNC(common,getTurretIndex))] call DFUNC(reset););
statement = QUOTE([ARR_2(vehicle _player,[_player] call DEFUNC(common,getTurretIndex))] call DFUNC(reset););
showDisabled = 0;
priority = 1;
icon = "";
@ -42,7 +42,7 @@ class CfgVehicles {
displayName = $STR_ACE_FCS_ResetFCS;
enableInside = 1;
condition = QUOTE(call FUNC(canResetFCS));
statement = QUOTE([ARR_2(_vehicle,[_player] call DEFUNC(common,getTurretIndex))] call DFUNC(reset););
statement = QUOTE([ARR_2(vehicle _player,[_player] call DEFUNC(common,getTurretIndex))] call DFUNC(reset););
showDisabled = 0;
priority = 1;
icon = "";
@ -492,13 +492,13 @@ class CfgVehicles {
};*/
};
class I_Heli_light_03_base_F: Helicopter_Base_F {
class Heli_light_03_base_F;
class I_Heli_light_03_base_F: Heli_light_03_base_F {
/*class Turrets: Turrets {
class MainTurret: MainTurret {};
};*/
};
class I_Heli_light_03_F: I_Heli_light_03_base_F {
class I_Heli_light_03_F: Heli_light_03_base_F {
/*class Turrets: Turrets {
class MainTurret: MainTurret {};
};*/

View File

@ -12,7 +12,7 @@
#include "script_component.hpp"
private ["_vehicle", "_weapon", "_ammo", "_magazine", "_projectile"];
private ["_vehicle", "_weapon", "_ammo", "_magazine", "_projectile","_velocityCorrection"];
_vehicle = _this select 0;
_weapon = _this select 1;
@ -30,7 +30,7 @@ if !([_gunner] call EFUNC(common,isPlayer)) exitWith {};
private ["_FCSMagazines", "_FCSElevation", "_offset"];
_FCSMagazines = _vehicle getVariable format ["%1_%2", QGVAR(Magazines), _turret];
_FCSMagazines = _vehicle getVariable [(format ["%1_%2", QGVAR(Magazines), _turret]), []];
_FCSElevation = _vehicle getVariable format ["%1_%2", QGVAR(Elevation), _turret];
if !(_magazine in _FCSMagazines) exitWith {};
@ -43,8 +43,12 @@ _offset = 0;
};
} forEach _FCSMagazines;
[_projectile, (_vehicle getVariable format ["%1_%2", QGVAR(Azimuth), _turret]), _offset, 0] call EFUNC(common,changeProjectileDirection);
// Correct velocity for weapons that have initVelocity
// @todo: Take into account negative initVelocities
_velocityCorrection = (vectorMagnitude velocity _projectile) -
getNumber (configFile >> "CfgMagazines" >> _magazine >> "initSpeed");
[_projectile, (_vehicle getVariable format ["%1_%2", QGVAR(Azimuth), _turret]), _offset, _velocityCorrection] call EFUNC(common,changeProjectileDirection);
// Air burst missile
// handle locally only

View File

@ -1,81 +1,63 @@
// by commy2
["ACE3",
localize "STR_ACE_FCS_LaseTarget",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !((!GVAR(enabled) && FUNC(canUseFCS)) || FUNC(canUseRangefinder)) exitWith {false};
["ACE3", QGVAR(lazeTarget), localize "STR_ACE_FCS_LaseTarget",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !((!GVAR(enabled) && FUNC(canUseFCS)) || FUNC(canUseRangefinder)) exitWith {false};
// prevent holding down
if (GETGVAR(isDownStateKey1,false)) exitWith {false};
GVAR(isDownStateKey1) = true;
if (GETGVAR(isDownStateKey1,false)) exitWith {false};
GVAR(isDownStateKey1) = true;
// Statement
[vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex)] call FUNC(keyDown);
// Return false so it doesn't block the rest weapon action
false
},
[15, [false, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
// Statement
[vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex)] call FUNC(keyDown);
// Return false so it doesn't block the rest weapon action
false
},
{
// prevent holding down
GVAR(isDownStateKey1) = false;
["ACE3",
localize "STR_ACE_FCS_LaseTarget",
{
// prevent holding down
GVAR(isDownStateKey1) = false;
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(GVAR(enabled) && FUNC(canUseFCS)) exitWith {false};
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(GVAR(enabled) && FUNC(canUseFCS)) exitWith {false};
// Statement
[vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex)] call FUNC(keyUp);
false
},
[15, [false, false, false]], false] call cba_fnc_addKeybind; //Tab Key
// Statement
[vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex)] call FUNC(keyUp);
false
},
[15, [false, false, false]],
false,
"keyup"
] call cba_fnc_registerKeybind;
["ACE3", QGVAR(adjustRangeUp), localize "STR_ACE_FCS_AdjustRangeUp",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false};
["ACE3",
localize "STR_ACE_FCS_AdjustRangeUp",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false};
// Statement
[vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), 50] call FUNC(adjustRange);
true
},
{false},
[201, [false, false, false]], false] call cba_fnc_addKeybind; //PageUp Key
// Statement
[vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), 50] call FUNC(adjustRange);
true
},
[201, [false, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
["ACE3", QGVAR(adjustRangDown), localize "STR_ACE_FCS_AdjustRangeDown",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false};
["ACE3",
localize "STR_ACE_FCS_AdjustRangeDown",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false};
// Statement
[vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), -50] call FUNC(adjustRange);
true
},
[209, [false, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
// Statement
[vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), -50] call FUNC(adjustRange);
true
},
{false},
[209, [false, false, false]], false] call cba_fnc_addKeybind; //PageDown Key

View File

@ -17,17 +17,19 @@
#include "script_component.hpp"
if (!hasInterface) exitWith {};
["ACE3", localize "STR_ACE_Goggles_WipeGlasses",
["ACE3", QGVAR(wipeGlasses), localize "STR_ACE_Goggles_WipeGlasses",
{
if (!(GETVAR(ace_player,ACE_isUnconscious,false))) exitWith {
call FUNC(clearGlasses);
true
};
false
}, [20, true, true, false], false, "keydown"] call CALLSTACK(cba_fnc_registerKeybind);
if (!(GETVAR(ace_player,ACE_isUnconscious,false))) exitWith {
call FUNC(clearGlasses);
true
};
false
},
{false},
[20, true, true, false], false] call CALLSTACK(cba_fnc_addKeybind);
if isNil(QGVAR(UsePP)) then {
GVAR(UsePP) = true;
GVAR(UsePP) = true;
};
GVAR(PostProcess) = ppEffectCreate ["ColorCorrections", 1995];
@ -47,78 +49,78 @@ GVAR(RainActive) = false;
GVAR(RainLastLevel) = 0;
FUNC(CheckGlasses) = {
if (GVAR(Current) != (goggles ace_player)) then {
GVAR(Current) = (goggles ace_player);
["GlassesChanged",[GVAR(Current)]] call EFUNC(common,localEvent);
};
if (GVAR(Current) != (goggles ace_player)) then {
GVAR(Current) = (goggles ace_player);
["GlassesChanged",[GVAR(Current)]] call EFUNC(common,localEvent);
};
};
player addEventHandler ["Explosion", {
if (alive ace_player) then {
call FUNC(ApplyDirtEffect);
if (GETBROKEN) exitWith {};
if (((_this select 1) call FUNC(GetExplosionIndex)) < getNumber(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_Resistance")) exitWith {};
if !([ace_player] call FUNC(isGogglesVisible)) exitWith {["GlassesCracked",[ace_player]] call EFUNC(common,localEvent);};
_effects = GETGLASSES(ace_player);
_effects set [BROKEN, true];
SETGLASSES(ace_player,_effects);
if (getText(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_OverlayCracked") != "" && {cameraOn == ace_player}) then {
if (call FUNC(ExternalCamera)) exitWith {};
if (isNull(GLASSDISPLAY)) then {
150 cutRsc["RscACE_Goggles", "PLAIN",1, false];
};
(GLASSDISPLAY displayCtrl 10650) ctrlSetText getText(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_OverlayCracked");
if (alive ace_player) then {
call FUNC(ApplyDirtEffect);
if (GETBROKEN) exitWith {};
if (((_this select 1) call FUNC(GetExplosionIndex)) < getNumber(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_Resistance")) exitWith {};
if !([ace_player] call FUNC(isGogglesVisible)) exitWith {["GlassesCracked",[ace_player]] call EFUNC(common,localEvent);};
_effects = GETGLASSES(ace_player);
_effects set [BROKEN, true];
SETGLASSES(ace_player,_effects);
if (getText(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_OverlayCracked") != "" && {cameraOn == ace_player}) then {
if (call FUNC(ExternalCamera)) exitWith {};
if (isNull(GLASSDISPLAY)) then {
150 cutRsc["RscACE_Goggles", "PLAIN",1, false];
};
(GLASSDISPLAY displayCtrl 10650) ctrlSetText getText(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_OverlayCracked");
};
["GlassesCracked",[ace_player]] call EFUNC(common,localEvent);
};
["GlassesCracked",[ace_player]] call EFUNC(common,localEvent);
};
}];
player addEventHandler ["Killed",{
GVAR(PostProcessEyes) ppEffectEnable false;
SETGLASSES(ace_player,GLASSESDEFAULT);
call FUNC(removeGlassesEffect);
GVAR(EffectsActive)=false;
ace_player setVariable ["ACE_EyesDamaged", false];
if (GVAR(EyesDamageScript) != -1) then {
[GVAR(EyesDamageScript)] call CALLSTACK(cba_fnc_removePreFrameHandler);
};
if (GVAR(DustHandler) != -1) then {
[GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler);
GVAR(DustHandler) = -1;
};
GVAR(PostProcessEyes) ppEffectEnable false;
SETGLASSES(ace_player,GLASSESDEFAULT);
call FUNC(removeGlassesEffect);
GVAR(EffectsActive)=false;
ace_player setVariable ["ACE_EyesDamaged", false];
if (GVAR(EyesDamageScript) != -1) then {
[GVAR(EyesDamageScript)] call CALLSTACK(cba_fnc_removePreFrameHandler);
};
if (GVAR(DustHandler) != -1) then {
[GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler);
GVAR(DustHandler) = -1;
};
}];
player addEventHandler ["Fired",{[_this select 0, _this select 1] call FUNC(dustHandler);}];
player AddEventHandler ["Take",{call FUNC(checkGlasses);}];
player AddEventHandler ["Put", {call FUNC(checkGlasses);}];
["GlassesChanged",{
SETGLASSES(ace_player,GLASSESDEFAULT);
SETGLASSES(ace_player,GLASSESDEFAULT);
if (call FUNC(ExternalCamera)) exitWith {call FUNC(RemoveGlassesEffect)};
if (call FUNC(ExternalCamera)) exitWith {call FUNC(RemoveGlassesEffect)};
if ([ace_player] call FUNC(isGogglesVisible)) then {
[_this select 0] call FUNC(applyGlassesEffect);
} else {
call FUNC(removeGlassesEffect);
};
if ([ace_player] call FUNC(isGogglesVisible)) then {
[_this select 0] call FUNC(applyGlassesEffect);
} else {
call FUNC(removeGlassesEffect);
};
}] call EFUNC(common,addEventHandler);
["GlassesCracked",{
if (_this select 0 != ace_player) exitWith {};
ace_player setVariable ["ACE_EyesDamaged", true];
if (GVAR(EyesDamageScript) != -1) then {
[GVAR(EyesDamageScript)] call CALLSTACK(cba_fnc_removePreFrameHandler);
};
GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [0.5,0.5,0.5,0.5],[1,1,1,0]];
GVAR(PostProcessEyes) ppEffectCommit 0;
GVAR(PostProcessEyes) ppEffectEnable true;
GVAR(EyesDamageScript) = [{
GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [1,1,1,1],[1,1,1,0]];
GVAR(PostProcessEyes) ppEffectCommit 5;
if (_this select 0 != ace_player) exitWith {};
ace_player setVariable ["ACE_EyesDamaged", true];
if (GVAR(EyesDamageScript) != -1) then {
[GVAR(EyesDamageScript)] call CALLSTACK(cba_fnc_removePreFrameHandler);
};
GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [0.5,0.5,0.5,0.5],[1,1,1,0]];
GVAR(PostProcessEyes) ppEffectCommit 0;
GVAR(PostProcessEyes) ppEffectEnable true;
GVAR(EyesDamageScript) = [{
GVAR(PostProcessEyes) ppEffectEnable false;
ace_player setVariable ["ACE_EyesDamaged", false];
GVAR(EyesDamageScript) = -1;
}, [], 5, 1] call EFUNC(common,waitAndExecute);
}, [], 25, 5] call EFUNC(common,waitAndExecute);
GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [1,1,1,1],[1,1,1,0]];
GVAR(PostProcessEyes) ppEffectCommit 5;
GVAR(EyesDamageScript) = [{
GVAR(PostProcessEyes) ppEffectEnable false;
ace_player setVariable ["ACE_EyesDamaged", false];
GVAR(EyesDamageScript) = -1;
}, [], 5, 1] call EFUNC(common,waitAndExecute);
}, [], 25, 5] call EFUNC(common,waitAndExecute);
}] call EFUNC(common,addEventHandler);
call FUNC(checkGlasses);
[FUNC(CheckGoggles), 1, []] call CBA_fnc_addPerFrameHandler;

View File

@ -10,19 +10,16 @@ GVAR(flashbangPPEffectCC) = ppEffectCreate ["ColorCorrections", 4265];
GVAR(flashbangPPEffectCC) ppEffectForceInNVG true;
// Add keybinds
["ACE3",
localize "STR_ACE_Grenades_SwitchGrenadeMode",
{
// Conditions: canInteract
_exceptions = [QEGVAR(captives,isNotEscorting)];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if (!([ACE_player] call EFUNC(common,canUseWeapon))) exitWith {false};
["ACE3", QGVAR(switchGrenadeMode), localize "STR_ACE_Grenades_SwitchGrenadeMode",
{
// Conditions: canInteract
_exceptions = [QEGVAR(captives,isNotEscorting)];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if (!([ACE_player] call EFUNC(common,canUseWeapon))) exitWith {false};
// Statement
[] call FUNC(nextMode);
},
[9, [false, false, false]], //8 key
false,
"keydown"
] call cba_fnc_registerKeybind;
// Statement
[] call FUNC(nextMode);
},
{false},
[9, [false, false, false]], false] call cba_fnc_addKeybind; //8 Key

View File

@ -6,30 +6,12 @@ _fnc = {
};
addMissionEventHandler ["Draw3D", _fnc];
["ACE3",
"Interact Key",
["ACE3", QGVAR(InteractKey), "Interact Key",
{_this call FUNC(keyDown)},
[219, [false, false, false]],
false,
"keydown"] call cba_fnc_registerKeybind;
["ACE3",
"Interact Key",
{_this call FUNC(keyUp)},
[219, [false, false, false]],
false,
"keyUp"] call cba_fnc_registerKeybind;
[219, [false, false, false]], false] call cba_fnc_addKeybind; //Left Windows Key
["ACE3",
"Self Actions Key",
["ACE3", QGVAR(SelfInteractKey), "Self Actions Key",
{_this call FUNC(keyDownSelfAction)},
[219, [false, true, false]],
false,
"keydown"] call cba_fnc_registerKeybind;
["ACE3",
"Self Actions Key",
{_this call FUNC(keyUpSelfAction)},
[219, [false, true, false]],
false,
"keyUp"] call cba_fnc_registerKeybind;
[219, [false, true, false]], false] call cba_fnc_addKeybind; //Left Windows Key + Ctrl/Strg

View File

@ -481,8 +481,8 @@ class CfgVehicles {
class ACE_Actions {
class ACE_MainActions {
displayName = "$STR_ACE_Interaction_MainAction";
selection = "";
distance = 10;
selection = "gunnerview";
distance = 2;
condition = "true";
};
};
@ -494,8 +494,8 @@ class CfgVehicles {
class ACE_Actions {
class ACE_MainActions {
displayName = "$STR_ACE_Interaction_MainAction";
selection = "";
distance = 10;
selection = "gunnerview";
distance = 2;
condition = "true";
};
};

View File

@ -16,92 +16,89 @@ GVAR(isOpeningDoor) = false;
// Add keybinds
["ACE3",
localize "STR_ACE_Interaction_OpenDoor",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(!GVAR(isOpeningDoor) &&
{[2] call FUNC(getDoor) select 1 != ''}
) exitWith {false};
["ACE3", QGVAR(openDoor), localize "STR_ACE_Interaction_OpenDoor",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(!GVAR(isOpeningDoor) &&
{[2] call FUNC(getDoor) select 1 != ''}
) exitWith {false};
// Statement
call EFUNC(interaction,openDoor);
true
},
[57, [false, true, false]],
false,
"keydown"
// Statement
call EFUNC(interaction,openDoor);
true
},
{},
[57, [false, true, false]], false] call cba_fnc_addKeybind;
["ACE3",
localize "STR_ACE_Interaction_OpenDoor",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(GVAR(isOpeningDoor)) exitWith {false};
// Statement
GVAR(isOpeningDoor) = false;
true
},
[57, [false, true, false]],
false,
"keyup"
] call cba_fnc_registerKeybind;
["ACE3",
localize "STR_ACE_Interaction_OpenDoor",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(GVAR(isOpeningDoor)) exitWith {false};
localize "STR_ACE_Interaction_TapShoulder",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !([ACE_player, cursorTarget] call FUNC(canTapShoulder)) exitWith {false};
// Statement
GVAR(isOpeningDoor) = false;
true
},
[57, [false, true, false]],
false,
"keyup"
// Statement
[ACE_player, cursorTarget] call FUNC(tapShoulder);
true
},
[20, [true, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
["ACE3",
localize "STR_ACE_Interaction_TapShoulder",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !([ACE_player, cursorTarget] call FUNC(canTapShoulder)) exitWith {false};
localize "STR_ACE_Interaction_ModifierKey",
{
// Conditions: canInteract
_exceptions = ["ACE_Drag_isNotDragging"];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Statement
[ACE_player, cursorTarget] call FUNC(tapShoulder);
true
},
[20, [true, false, false]],
false,
"keydown"
// Statement
ACE_Modifier = 1;
// Return false so it doesn't block other actions
false
},
[29, [false, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
["ACE3",
localize "STR_ACE_Interaction_ModifierKey",
{
// Conditions: canInteract
_exceptions = ["ACE_Drag_isNotDragging"];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
localize "STR_ACE_Interaction_ModifierKey",
{
// Conditions: canInteract
_exceptions = ["ACE_Drag_isNotDragging"];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Statement
ACE_Modifier = 1;
// Return false so it doesn't block other actions
false
},
[29, [false, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
["ACE3",
localize "STR_ACE_Interaction_ModifierKey",
{
// Conditions: canInteract
_exceptions = ["ACE_Drag_isNotDragging"];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Statement
ACE_Modifier = 0;
// Return false so it doesn't block other actions
false
},
[29, [false, false, false]],
false,
"keyup"
// Statement
ACE_Modifier = 0;
// Return false so it doesn't block other actions
false
},
[29, [false, false, false]],
false,
"keyup"
] call cba_fnc_registerKeybind;

View File

@ -1,5 +1,5 @@
class SlotInfo;
class MuzzleSlot;
class CfgWeapons {
@ -20,7 +20,7 @@ class CfgWeapons {
};
class WeaponSlotsInfo: WeaponSlotsInfo {
class MuzzleSlot: SlotInfo {
class MuzzleSlot: MuzzleSlot {
compatibleItems[] += {"ACE_muzzle_mzls_H"};
};
};
@ -59,7 +59,7 @@ class CfgWeapons {
};
class WeaponSlotsInfo: WeaponSlotsInfo {
class MuzzleSlot: SlotInfo {
class MuzzleSlot: MuzzleSlot {
compatibleItems[] += {"ACE_muzzle_mzls_H"};
};
};
@ -74,7 +74,7 @@ class CfgWeapons {
class EBR_base_F: Rifle_Long_Base_F {
class WeaponSlotsInfo: WeaponSlotsInfo {
class MuzzleSlot: SlotInfo {
class MuzzleSlot: MuzzleSlot {
compatibleItems[] += {"ACE_muzzle_mzls_B"};
};
};
@ -82,7 +82,7 @@ class CfgWeapons {
class DMR_01_base_F: Rifle_Long_Base_F {
class WeaponSlotsInfo: WeaponSlotsInfo {
class MuzzleSlot: SlotInfo {
class MuzzleSlot: MuzzleSlot {
compatibleItems[] += {"ACE_muzzle_mzls_B"};
};
};
@ -90,7 +90,7 @@ class CfgWeapons {
class LMG_Mk200_F: Rifle_Long_Base_F {
class WeaponSlotsInfo: WeaponSlotsInfo {
class MuzzleSlot: SlotInfo {
class MuzzleSlot: MuzzleSlot {
compatibleItems[] += {"ACE_muzzle_mzls_H"};
};
};
@ -98,7 +98,7 @@ class CfgWeapons {
class LMG_Zafir_F: Rifle_Long_Base_F {
class WeaponSlotsInfo: WeaponSlotsInfo {
class MuzzleSlot: SlotInfo {
class MuzzleSlot: MuzzleSlot {
compatibleItems[] += {"ACE_muzzle_mzls_B"};
};
};
@ -115,7 +115,7 @@ class CfgWeapons {
};
class WeaponSlotsInfo: WeaponSlotsInfo {
class MuzzleSlot: SlotInfo {
class MuzzleSlot: MuzzleSlot {
compatibleItems[] += {"ACE_muzzle_mzls_L"};
};
};
@ -129,7 +129,7 @@ class CfgWeapons {
};
class WeaponSlotsInfo: WeaponSlotsInfo {
class MuzzleSlot: SlotInfo {
class MuzzleSlot: MuzzleSlot {
compatibleItems[] += {"ACE_muzzle_mzls_L"};
};
};
@ -148,7 +148,7 @@ class CfgWeapons {
class pdw2000_base_F: Rifle_Base_F {
class WeaponSlotsInfo: WeaponSlotsInfo {
class MuzzleSlot: SlotInfo {
class MuzzleSlot: MuzzleSlot {
compatibleItems[] += {"ACE_muzzle_mzls_smg_02"};
};
};
@ -156,7 +156,7 @@ class CfgWeapons {
class SMG_01_Base: Rifle_Base_F {
class WeaponSlotsInfo: WeaponSlotsInfo {
class MuzzleSlot: SlotInfo {
class MuzzleSlot: MuzzleSlot {
compatibleItems[] += {"ACE_muzzle_mzls_smg_01"};
};
};
@ -164,7 +164,7 @@ class CfgWeapons {
class SMG_02_base_F: Rifle_Base_F {
class WeaponSlotsInfo: WeaponSlotsInfo {
class MuzzleSlot: SlotInfo {
class MuzzleSlot: MuzzleSlot {
compatibleItems[] += {"ACE_muzzle_mzls_smg_02"};
};
};
@ -180,7 +180,7 @@ class CfgWeapons {
class hgun_P07_F: Pistol_Base_F {
class WeaponSlotsInfo: WeaponSlotsInfo {
class MuzzleSlot: SlotInfo {
class MuzzleSlot: MuzzleSlot {
linkProxy = "\A3\data_f\proxies\weapon_slots\MUZZLE";
compatibleItems[] += {"ACE_muzzle_mzls_smg_02"};
};
@ -189,7 +189,7 @@ class CfgWeapons {
class hgun_Rook40_F: Pistol_Base_F {
class WeaponSlotsInfo: WeaponSlotsInfo {
class MuzzleSlot: SlotInfo {
class MuzzleSlot: MuzzleSlot {
linkProxy = "\A3\data_f\proxies\weapon_slots\MUZZLE";
compatibleItems[] += {"ACE_muzzle_mzls_smg_02"};
};
@ -198,7 +198,7 @@ class CfgWeapons {
class hgun_ACPC2_F: Pistol_Base_F {
class WeaponSlotsInfo: WeaponSlotsInfo {
class MuzzleSlot: SlotInfo {
class MuzzleSlot: MuzzleSlot {
compatibleItems[] += {"ACE_muzzle_mzls_smg_01"};
};
};
@ -206,7 +206,7 @@ class CfgWeapons {
class hgun_Pistol_heavy_01_F: Pistol_Base_F {
class WeaponSlotsInfo: WeaponSlotsInfo {
class MuzzleSlot: SlotInfo {
class MuzzleSlot: MuzzleSlot {
compatibleItems[] += {"ACE_muzzle_mzls_smg_01"};
};
};

File diff suppressed because it is too large Load Diff

View File

@ -630,25 +630,34 @@ class ACE_Medical_Advanced {
// How much does the pain get reduced?
painReduce = 0;
// How much will the heart rate be increased when the HR is low (below 55)? {minIncrease, maxIncrease, seconds}
hrIncreaseLow[] = {10, 20, 35};
hrIncreaseNormal[] = {10, 50, 40};
hrIncreaseHigh[] = {10, 40, 50};
hrIncreaseLow[] = {0, 0, 0};
hrIncreaseNormal[] = {0, 0, 0};
hrIncreaseHigh[] = {0, 0, 0};
// Callback once the heart rate values have been added.
hrCallback = "";
// How long until this medication has disappeared
timeInSystem = 120;
// How many of this type of medication can be in the system before the patient overdoses?
maxDose = 4;
// specific details for the ACE_Morphine treatment action.
// Function to execute upon overdose. Arguments passed to call back are 0: unit <OBJECT>, 1: medicationClassName <STRING>
onOverDose = "";
// The viscosity of a fluid is a measure of its resistance to gradual deformation by shear stress or tensile stress. For liquids, it corresponds to the informal concept of "thickness". This value will increase/decrease the viscoty of the blood with the percentage given. Where 100 = max. Using the minus will decrease viscosity
viscosityChange = 0;
// specific details for the ACE_Morphine treatment action
class Morphine {
painReduce = 1;
painReduce = 0.7;
hrIncreaseLow[] = {-10, -30, 35};
hrIncreaseNormal[] = {-10, -50, 40};
hrIncreaseHigh[] = {-10, -40, 50};
timeInSystem = 120;
timeInSystem = 500;
maxDose = 4;
inCompatableMedication[] = {};
viscosityChange = 10;
};
class Epinephrine {
painReduce = 1;
painReduce = 0;
hrIncreaseLow[] = {10, 20, 30};
hrIncreaseNormal[] = {10, 50, 20};
hrIncreaseHigh[] = {10, 40, 10};
@ -657,14 +666,21 @@ class ACE_Medical_Advanced {
inCompatableMedication[] = {};
};
class Atropine {
painReduce = 1;
hrIncreaseLow[] = {-10, -20, 15};
painReduce = 0;
hrIncreaseLow[] = {20, 30, 15};
hrIncreaseNormal[] = {-10, -50, 20};
hrIncreaseHigh[] = {-10, -40, 10};
timeInSystem = 120;
maxDose = 6;
inCompatableMedication[] = {};
};
class PainKillers {
painReduce = 0.7;
timeInSystem = 120;
maxDose = 10;
inCompatableMedication[] = {};
viscosityChange = 5;
};
};
class IV {
// volume is in millileters

View File

@ -65,7 +65,7 @@ class CfgVehicles {
displayName = "Bandage Head";
distance = 2.0;
condition = QUOTE([ARR_4(_player, _target, 'head', 'Bandage')] call DFUNC(canTreat));
statement = QUOTE([ARR_4(_player, _target, 'head', 'Bandage Head')] call DFUNC(treatment));
statement = QUOTE([ARR_4(_player, _target, 'head', 'Bandage')] call DFUNC(treatment));
showDisabled = 1;
priority = 2;
hotkey = "B";
@ -86,10 +86,10 @@ class CfgVehicles {
};
class ACE_ArmLeft {
class Bandage_LeftArm {
displayName = "Bandage Right Arm";
displayName = "Bandage Left Arm";
distance = 2.0;
condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Bandage')] call DFUNC(canTreat));
statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Bandage')] call DFUNC(treatment));
condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Bandage')] call DFUNC(canTreat));
statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Bandage')] call DFUNC(treatment));
showDisabled = 1;
priority = 2;
hotkey = "B";

View File

@ -13,7 +13,6 @@ GVAR(heartBeatSounds_Slow) = ["ACE_heartbeat_slow_1", "ACE_heartbeat_slow_2"];
["medical_woundUpdateRequest", FUNC(onWoundUpdateRequest)] call ace_common_fnc_addEventHandler;
// Initialize all effects
// @todo: make this a macro?
_fnc_createEffect = {
private ["_type", "_layer", "_default"];
_type = _this select 0;
@ -111,7 +110,6 @@ GVAR(effectTimeBlood) = time;
};
// Bleeding Indicator
// @todo: redo this after initial release
if (damage ACE_player > 0.1 and GVAR(effectTimeBlood) + 6 < time) then {
GVAR(effectTimeBlood) = time;
[500 * damage ACE_player] call BIS_fnc_bloodEffect;

View File

@ -1,21 +0,0 @@
/*
* Author: Glowbal
* Action for checking the pulse or heart rate of the patient
*
* Arguments:
* 0: The medic <OBJECT>
* 1: The patient <OBJECT>
*
* Return Value:
* NONE
*
* Public: No
*/
#include "script_component.hpp"
private ["_caller","_target","_title","_content"];
_caller = _this select 0;
_target = _this select 1;
[[_caller, _target], QUOTE(DFUNC(actionCheckPulseLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */

View File

@ -1,21 +0,0 @@
/*
* Author: Glowbal
* Action for checking the blood pressure of the patient
*
* Arguments:
* 0: The medic <OBJECT>
* 1: The patient <OBJECT>
*
* Return Value:
* NONE
*
* Public: No
*/
#include "script_component.hpp"
private ["_caller","_target"];
_caller = _this select 0;
_target = _this select 1;
[[_caller, _target], QUOTE(DFUNC(actionCheckBloodPressureLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */

View File

@ -34,7 +34,7 @@ if (!(_unit getvariable [QGVAR(inCardiacArrest),false])) then {
_change = (_values / _time);
_hrIncrease = _hrIncrease + _change;
if ( (_time - 1) < 0) then {
if ( (_time - 1) <= 0) then {
_time = 0;
_adjustment set [_foreachIndex, ObjNull];
[_unit] call _callBack;
@ -43,7 +43,8 @@ if (!(_unit getvariable [QGVAR(inCardiacArrest),false])) then {
_adjustment set [_foreachIndex, [_values - _change, _time]];
};
} else {
_adjustment set [_foreachIndex, ObjNull];
_adjustment set [_foreachIndex, ObjNull];
[_unit] call _callBack;
};
}foreach _adjustment;

View File

@ -18,13 +18,14 @@
#include "script_component.hpp"
private ["_target", "_className", "_variable", "_maxDosage", "_timeInSystem", "_incompatabileMeds", "_foundEntry", "_allUsedMedication","_allMedsFromClassname", "_usedMeds", "_hasOverDosed", "_med", "_limit", "_classNamesUsed", "_decreaseAmount"];
private ["_target", "_className", "_variable", "_maxDosage", "_timeInSystem", "_incompatabileMeds", "_foundEntry", "_allUsedMedication","_allMedsFromClassname", "_usedMeds", "_hasOverDosed", "_med", "_limit", "_classNamesUsed", "_decreaseAmount", "_viscosityChange", "_viscosityAdjustment", "_medicationConfig", "_onOverDose"];
_target = _this select 0;
_className = _this select 1;
_variable = _this select 2;
_maxDosage = _this select 3;
_timeInSystem = _this select 4;
_incompatabileMeds = _this select 5;
_viscosityChange = _this select 6;
_foundEntry = false;
_allUsedMedication = _target getvariable [QGVAR(allUsedMedication), []];
@ -48,7 +49,7 @@ if (!_foundEntry) then {
_usedMeds = _target getvariable [_variable, 0];
if (_usedMeds >= floor (_maxDosage + round(random(2)))) then {
if (_usedMeds >= floor (_maxDosage + round(random(2))) && _maxDosage >= 1) then {
[_target] call FUNC(setDead);
};
@ -64,15 +65,33 @@ _hasOverDosed = 0;
}foreach _allUsedMedication;
}foreach _incompatabileMeds;
if (_hasOverDosed > 0) then {
_medicationConfig = (configFile >> "ACE_Medical_Advanced" >> "Treatment" >> "Medication");
_onOverDose = getText (_medicationConfig >> "onOverDose");
if (isClass (_medicationConfig >> _className)) then {
_medicationConfig = (_medicationConfig >> _className);
if (isText (_medicationConfig >> "onOverDose")) then { _onOverDose = getText (_medicationConfig >> "onOverDose"); };
};
if (isNil _onOverDose) then {
_onOverDose = compile _onOverDose;
} else {
_onOverDose = missionNamespace getvariable _onOverDose;
};
[_target, _className] call _onOverDose;
};
_decreaseAmount = 1 / _timeInSystem;
_viscosityAdjustment = _viscosityChange / _timeInSystem;
[{
private ["_args", "_target", "_timeInSystem", "_variable", "_amountDecreased","_decreaseAmount", "_usedMeds"];
private ["_args", "_target", "_timeInSystem", "_variable", "_amountDecreased","_decreaseAmount", "_usedMeds", "_viscosityAdjustment"];
_args = _this select 0;
_target = _args select 0;
_timeInSystem = _args select 1;
_variable = _args select 2;
_amountDecreased = _args select 3;
_decreaseAmount = _args select 4;
_viscosityAdjustment = _args select 5;
_usedMeds = _target getvariable [_variable, 0];
_usedMeds = _usedMeds - _decreaseAmount;
@ -80,8 +99,11 @@ _decreaseAmount = 1 / _timeInSystem;
_amountDecreased = _amountDecreased + _decreaseAmount;
if (_amountDecreased >= 1 || (_usedMeds <= 0)) then {
// Restoring the viscosity while the medication is leaving the system
_target setvariable [QGVAR(peripheralResistance), ((_target getvariable [QGVAR(peripheralResistance), 100]) - _viscosityAdjustment) max 0];
if (_amountDecreased >= 1 || (_usedMeds <= 0) || !alive _target) then {
[(_this select 1)] call cba_fnc_removePerFrameHandler;
};
_args set [3, _amountDecreased];
}, 1, [_target, _timeInSystem, _variable, 0, _decreaseAmount] ] call CBA_fnc_addPerFrameHandler;
}, 1, [_target, _timeInSystem, _variable, 0, _decreaseAmount, _viscosityAdjustment] ] call CBA_fnc_addPerFrameHandler;

View File

@ -15,7 +15,7 @@
#include "script_component.hpp"
private ["_target", "_className", "_currentInSystem", "_medicationConfig", "_painReduce", "_hrIncreaseLow", "_hrIncreaseNorm", "_hrIncreaseHigh", "_maxDose", "_inCompatableMedication", "_timeInSystem", "_heartRate", "_pain"];
private ["_target", "_className", "_currentInSystem", "_medicationConfig", "_painReduce", "_hrIncreaseLow", "_hrIncreaseNorm", "_hrIncreaseHigh", "_maxDose", "_inCompatableMedication", "_timeInSystem", "_heartRate", "_pain", "_resistance", "_hrCallback"];
_target = _this select 0;
_className = _this select 1;
@ -33,6 +33,9 @@ _hrIncreaseNorm = getArray (_medicationConfig >> "hrIncreaseNormal");
_hrIncreaseHigh = getArray (_medicationConfig >> "hrIncreaseHigh");
_timeInSystem = getNumber (_medicationConfig >> "timeInSystem");
_maxDose = getNumber (_medicationConfig >> "maxDose");
_viscosityChange = getNumber (_medicationConfig >> "viscosityChange");
_hrCallback = getText (_medicationConfig >> "hrCallback");
_inCompatableMedication = [];
if (isClass (_medicationConfig >> _className)) then {
_medicationConfig = (_medicationConfig >> _className);
@ -43,6 +46,13 @@ if (isClass (_medicationConfig >> _className)) then {
if (isNumber (_medicationConfig >> "timeInSystem")) then { _timeInSystem = getNumber (_medicationConfig >> "timeInSystem"); };
if (isNumber (_medicationConfig >> "maxDose")) then { _maxDose = getNumber (_medicationConfig >> "maxDose"); };
if (isArray (_medicationConfig >> "inCompatableMedication")) then { _inCompatableMedication = getArray (_medicationConfig >> "inCompatableMedication"); };
if (isNumber (_medicationConfig >> "viscosityChange")) then { _viscosityChange = getNumber (_medicationConfig >> "viscosityChange"); };
if (isText (_medicationConfig >> "hrCallback")) then { _hrCallback = getText (_medicationConfig >> "hrCallback"); };
};
if (isNil _hrCallback) then {
_hrCallback = compile _hrCallback;
} else {
_hrCallback = missionNamespace getvariable _hrCallback;
};
// Adjust the heart rate based upon config entry
@ -50,12 +60,12 @@ _heartRate = _target getvariable [QGVAR(heartRate), 70];
if (alive _target) then {
if (_heartRate > 0) then {
if (_heartRate <= 45) then {
[_target, ((_hrIncreaseLow select 0) + random((_hrIncreaseLow select 1))), (_hrIncreaseLow select 2)] call FUNC(addHeartRateAdjustment);
[_target, ((_hrIncreaseLow select 0) + random((_hrIncreaseLow select 1))), (_hrIncreaseLow select 2), _hrCallback] call FUNC(addHeartRateAdjustment);
} else {
if (_heartRate > 120) then {
[_target, ((_hrIncreaseHigh select 0) + random((_hrIncreaseHigh select 1))), (_hrIncreaseHigh select 2)] call FUNC(addHeartRateAdjustment);
[_target, ((_hrIncreaseHigh select 0) + random((_hrIncreaseHigh select 1))), (_hrIncreaseHigh select 2), _hrCallback] call FUNC(addHeartRateAdjustment);
} else {
[_target, ((_hrIncreaseNorm select 0) + random((_hrIncreaseNorm select 1))), (_hrIncreaseNorm select 2)] call FUNC(addHeartRateAdjustment);
[_target, ((_hrIncreaseNorm select 0) + random((_hrIncreaseNorm select 1))), (_hrIncreaseNorm select 2), _hrCallback] call FUNC(addHeartRateAdjustment);
};
};
};
@ -69,7 +79,11 @@ if (_pain <= 0) then {
};
_target setvariable [QGVAR(pain), _pain];
_resistance = _unit getvariable [QGVAR(peripheralResistance), 100];
_resistance = _resistance + _viscosityChange;
_unit setvariable [QGVAR(peripheralResistance), _resistance max 0];
// Call back to ensure that the medication is decreased over time
[_target, _classname, _varName, _maxDose, _timeInSystem, _inCompatableMedication] call FUNC(onMedicationUsage);
[_target, _classname, _varName, _maxDose, _timeInSystem, _inCompatableMedication, _viscosityChange] call FUNC(onMedicationUsage);
true

View File

@ -18,20 +18,17 @@
}] call EFUNC(common,addEventHandler);
["ACE3",
localize "STR_ACE_Movement_Climb",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if (ACE_player != (vehicle ACE_player)) exitWith {false};
["ACE3", QGVAR(climb), localize "STR_ACE_Movement_Climb",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if (ACE_player != (vehicle ACE_player)) exitWith {false};
// Statement
[ACE_player] call FUNC(climb);
true
},
[47, [false, true, false]], //DIK_V + CTRL//STRG
false,
"keydown"
] call cba_fnc_registerKeybind;
// Statement
[ACE_player] call FUNC(climb);
true
},
{false},
[47, [false, true, false]], false] call cba_fnc_addKeybind; //DIK_V + CTRL//STRG

View File

@ -7,23 +7,20 @@ if (!hasInterface) exitWith {};
// Add keybinds
["ACE3",
localize "STR_ACE_NameTags_ShowNames",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
["ACE3", QGVAR(showNameTags), localize "STR_ACE_NameTags_ShowNames",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Statement
GVAR(ShowNamesTime) = time;
if (call FUNC(canShow)) then{ call FUNC(doShow); };
// Return false so it doesn't block other actions
false
},
[29, [false, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
// Statement
GVAR(ShowNamesTime) = time;
if (call FUNC(canShow)) then{ call FUNC(doShow); };
// Return false so it doesn't block other actions
false
},
{false},
[29, [false, false, false]], false] call cba_fnc_addKeybind; //LeftControl Key
// Draw handle

View File

@ -37,8 +37,7 @@ GVAR(ppEffectMuzzleFlash) ppEffectCommit 0;
["playerTurretChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler);
// Add keybinds
["ACE3",
localize "STR_ACE_NightVision_IncreaseNVGBrightness",
["ACE3", QGVAR(IncreaseNVGBrightness), localize "STR_ACE_NightVision_IncreaseNVGBrightness",
{
// Conditions: canInteract
_exceptions = [QEGVAR(captives,isNotEscorting)];
@ -50,13 +49,10 @@ localize "STR_ACE_NightVision_IncreaseNVGBrightness",
[ACE_player, 1] call FUNC(changeNVGBrightness);
true
},
[201, [false, false, true]], //PageUp + ALT
false,
"keydown"
] call cba_fnc_registerKeybind;
{false},
[201, [false, false, true]], false] call cba_fnc_addKeybind; //PageUp + ALT
["ACE3",
localize "STR_ACE_NightVision_DecreaseNVGBrightness",
["ACE3", QGVAR(DecreaseNVGBrightness), localize "STR_ACE_NightVision_DecreaseNVGBrightness",
{
// Conditions: canInteract
_exceptions = [QEGVAR(captives,isNotEscorting)];
@ -68,7 +64,5 @@ localize "STR_ACE_NightVision_DecreaseNVGBrightness",
[ACE_player, -1] call FUNC(changeNVGBrightness);
true
},
[209, [false, false, true]], //PageDown + ALT
false,
"keydown"
] call cba_fnc_registerKeybind;
{false},
[209, [false, false, true]], false] call cba_fnc_addKeybind; //PageDown + ALT

View File

@ -4,22 +4,19 @@
if !(hasInterface) exitWith {};
// Add keybinds
["ACE3",
localize "STR_ACE_Overheating_UnjamWeapon",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !([ACE_player] call EFUNC(common,canUseWeapon) &&
{currentWeapon ACE_player in (ACE_player getVariable [QGVAR(jammedWeapons), []])}
) exitWith {false};
["ACE3", QGVAR(unjamWeapon), localize "STR_ACE_Overheating_UnjamWeapon",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !([ACE_player] call EFUNC(common,canUseWeapon) &&
{currentWeapon ACE_player in (ACE_player getVariable [QGVAR(jammedWeapons), []])}
) exitWith {false};
// Statement
[ACE_player, currentMuzzle ACE_player, false] call FUNC(clearJam);
true
},
[19, [true, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
// Statement
[ACE_player, currentMuzzle ACE_player, false] call FUNC(clearJam);
true
},
{false},
[19, [true, false, false]], false] call cba_fnc_addKeybind; //R Key

View File

@ -16,26 +16,28 @@
#include "script_component.hpp"
if (!hasInterface) exitWith {};
["ACE3", localize "STR_ACE_Parachute_showAltimeter",
["ACE3", QGVAR(showAltimeter), localize "STR_ACE_Parachute_showAltimeter",
{
// Conditions: canInteract
_exceptions = [QEGVAR(interaction,isNotEscorting)];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
if (!('ACE_Altimeter' in assignedItems ace_player)) exitWith {false};
if (!(missionNamespace getVariable [QGVAR(AltimeterActive), false])) then {
[ace_player] call FUNC(showAltimeter);
} else {
call FUNC(hideAltimeter);
};
true
}, [24, false, false, false], false, "keydown"] call CALLSTACK(cba_fnc_registerKeybind);
// Conditions: canInteract
_exceptions = [QEGVAR(interaction,isNotEscorting)];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
if (!('ACE_Altimeter' in assignedItems ace_player)) exitWith {false};
if (!(missionNamespace getVariable [QGVAR(AltimeterActive), false])) then {
[ace_player] call FUNC(showAltimeter);
} else {
call FUNC(hideAltimeter);
};
true
},
{false},
[24, false, false, false], false] call CALLSTACK(cba_fnc_addKeybind);
GVAR(PFH) = false;
["playerVehicleChanged",{
if (!GVAR(PFH) && {(vehicle ACE_player) isKindOf "ParachuteBase"}) then {
GVAR(PFH) = true;
[FUNC(onEachFrame), 0.1, []] call CALLSTACK(cba_fnc_addPerFrameHandler);
};
if (!GVAR(PFH) && {(vehicle ACE_player) isKindOf "ParachuteBase"}) then {
GVAR(PFH) = true;
[FUNC(onEachFrame), 0.1, []] call CALLSTACK(cba_fnc_addPerFrameHandler);
};
}] call EFUNC(common,addEventHandler);
// don't show speed and height when in expert mode

View File

@ -49,7 +49,7 @@ class CfgVehicles {
displayName = "$STR_ACE_Parachute_NonSteerableParachute";
//picture = "\A3\Characters_F\data\ui\icon_b_parachute_ca.paa"; // @todo
//model = "\A3\Weapons_F\Ammoboxes\Bags\Backpack_Parachute"; // @todo
backpackSimulation = "ParachuteNonSteerable"; //ParachuteSteerable
// backpackSimulation = "ParachuteNonSteerable"; //ParachuteSteerable //Bis broke this in 1.40
ParachuteClass = "NonSteerable_Parachute_F";
maximumLoad = 0;
mass = 100;

View File

@ -223,43 +223,46 @@ class CfgVehicles {
class B_Truck_01_Repair_F: B_Truck_01_mover_F {
displayName = "$STR_ACE_RealisticNames_Truck_01_Repair_Name";
};
class Truck_02_base_F;
class O_Truck_02_transport_F: Truck_02_base_F {
class Truck_02_transport_base_F;
class O_Truck_02_transport_F: Truck_02_transport_base_F {
displayName = "$STR_ACE_RealisticNames_Truck_02_transport_Name";
};
class Truck_02_base_F;
class O_Truck_02_covered_F: Truck_02_base_F {
displayName = "$STR_ACE_RealisticNames_Truck_02_covered_Name";
};
class O_Truck_02_ammo_F: Truck_02_base_F {
class Truck_02_Ammo_base_F;
class O_Truck_02_ammo_F: Truck_02_Ammo_base_F {
displayName = "$STR_ACE_RealisticNames_Truck_02_ammo_Name";
};
class O_Truck_02_fuel_F: Truck_02_base_F {
class Truck_02_fuel_base_F;
class O_Truck_02_fuel_F: Truck_02_fuel_base_F {
displayName = "$STR_ACE_RealisticNames_Truck_02_fuel_Name";
};
class O_Truck_02_box_F: Truck_02_base_F {
class Truck_02_box_base_F;
class O_Truck_02_box_F: Truck_02_box_base_F {
displayName = "$STR_ACE_RealisticNames_Truck_02_box_Name";
};
class O_Truck_02_medical_F: O_Truck_02_box_F {
class Truck_02_medical_base_F;
class O_Truck_02_medical_F: Truck_02_medical_base_F {
displayName = "$STR_ACE_RealisticNames_Truck_02_medical_Name";
};
class I_Truck_02_transport_F: Truck_02_base_F {
class I_Truck_02_transport_F: Truck_02_transport_base_F {
displayName = "$STR_ACE_RealisticNames_Truck_02_transport_Name";
};
class I_Truck_02_covered_F: Truck_02_base_F {
displayName = "$STR_ACE_RealisticNames_Truck_02_covered_Name";
};
class I_Truck_02_ammo_F: Truck_02_base_F {
class I_Truck_02_ammo_F: Truck_02_Ammo_base_F {
displayName = "$STR_ACE_RealisticNames_Truck_02_ammo_Name";
};
class I_Truck_02_fuel_F: Truck_02_base_F {
class I_Truck_02_fuel_F: Truck_02_fuel_base_F {
displayName = "$STR_ACE_RealisticNames_Truck_02_fuel_Name";
};
class I_Truck_02_box_F: Truck_02_base_F {
class I_Truck_02_box_F: Truck_02_box_base_F {
displayName = "$STR_ACE_RealisticNames_Truck_02_box_Name";
};
class I_Truck_02_medical_F: I_Truck_02_box_F {
class I_Truck_02_medical_F: Truck_02_medical_base_F {
displayName = "$STR_ACE_RealisticNames_Truck_02_medical_Name";
};
@ -306,13 +309,12 @@ class CfgVehicles {
displayName = "$STR_ACE_RealisticNames_Heli_Light_01_civil_Name";
};
class B_Heli_Transport_03_base_F;
class B_Heli_Transport_03_F: B_Heli_Transport_03_base_F {
class Heli_Transport_03_base_F;
class B_Heli_Transport_03_F: Heli_Transport_03_base_F {
displayName = "$STR_ACE_RealisticNames_Heli_Transport_03_Name";
};
class B_Heli_Transport_03_unarmed_base_F: B_Heli_Transport_03_base_F {};
class B_Heli_Transport_03_unarmed_F: B_Heli_Transport_03_unarmed_base_F {
class Heli_Transport_03_unarmed_base_F;
class B_Heli_Transport_03_unarmed_F: Heli_Transport_03_unarmed_base_F {
displayName = "$STR_ACE_RealisticNames_Heli_Transport_03_unarmed_Name";
};
@ -320,17 +322,18 @@ class CfgVehicles {
class O_Heli_Light_02_F: Heli_Light_02_base_F {
displayName = "$STR_ACE_RealisticNames_Heli_Light_02_Name";
};
class O_Heli_Light_02_unarmed_F: Heli_Light_02_base_F {
class Heli_Light_02_unarmed_base_F;
class O_Heli_Light_02_unarmed_F: Heli_Light_02_unarmed_base_F {
displayName = "$STR_ACE_RealisticNames_Heli_Light_02_unarmed_Name";
};
class I_Heli_light_03_base_F;
class I_Heli_light_03_F: I_Heli_light_03_base_F {
class Heli_light_03_base_F;
class I_Heli_light_03_F: Heli_light_03_base_F {
displayName = "$STR_ACE_RealisticNames_Heli_light_03_Name";
};
class I_Heli_light_03_unarmed_base_F;
class I_Heli_light_03_unarmed_F: I_Heli_light_03_unarmed_base_F {
class Heli_light_03_unarmed_base_F;
class I_Heli_light_03_unarmed_F: Heli_light_03_unarmed_base_F {
displayName = "$STR_ACE_RealisticNames_Heli_light_03_unarmed_Name";
};

View File

@ -14,7 +14,7 @@ class Extended_PostInit_EventHandlers {
class Extended_Take_EventHandlers {
class CAManBase {
class ACE_AmmoIndicatorReload {
clientTake = QUOTE(if !(GVAR(DisplayText)) exitwith {}; if (_this select 0 == ACE_player && {(_this select 1) in [ARR_3(uniformContainer (_this select 0), vestContainer (_this select 0), backpackContainer (_this select 0))]} && {_this select 2 == currentMagazine (_this select 0)}) then {[ARR_3(_this select 0, vehicle (_this select 0), true)] call FUNC(checkAmmo)};);
clientTake = QUOTE(if (_this select 0 == ACE_player && {GVAR(DisplayText)} && {(_this select 1) in [ARR_3(uniformContainer (_this select 0), vestContainer (_this select 0), backpackContainer (_this select 0))]} && {_this select 2 == currentMagazine (_this select 0)}) then {[ARR_2(_this select 0, vehicle (_this select 0))] call FUNC(displayAmmo)};);
};
};
};

View File

@ -0,0 +1,12 @@
class CfgMagazines {
class CA_Magazine;
class 150Rnd_762x51_Box : CA_Magazine {
ACE_isBelt = 1;
};
class 100Rnd_65x39_caseless_mag;
class 200Rnd_65x39_cased_Box : 100Rnd_65x39_caseless_mag {
ACE_isBelt = 1;
};
};

View File

@ -0,0 +1,35 @@
class CfgVehicles {
class Man;
class CAManBase: Man {
class ACE_Actions {
class ACE_Weapon {
class ACE_LinkBelt {
displayName = "$STR_ACE_Reload_LinkBelt";
distance = 2.0;
condition = QUOTE([ARR_2(_player, _target)] call FUNC(canLinkBelt));
statement = QUOTE([ARR_2(_player, _target)] call FUNC(startLinkingBelt));
};
class ACE_CheckAmmo {
displayName = "$STR_ACE_Reload_checkAmmo";
distance = 2.0;
condition = QUOTE([ARR_2(_player, _target)] call FUNC(canCheckAmmo));
statement = QUOTE([ARR_2(_player, _target)] call FUNC(checkAmmo));
};
};
};
};
class LandVehicle;
class StaticWeapon: LandVehicle {
class ACE_Actions {
class ACE_MainActions {
class ACE_CheckAmmo {
displayName = "$STR_ACE_Reload_checkAmmo";
distance = 2.0;
condition = QUOTE([ARR_2(_player, _target)] call FUNC(canCheckAmmo));
statement = QUOTE([ARR_2(_player, _target)] call FUNC(checkAmmo));
};
};
};
};
};

View File

@ -4,21 +4,63 @@
if !(hasInterface) exitWith {};
// Add keybinds
["ACE3",
localize "STR_ACE_Reload_checkAmmo",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !([ACE_player] call EFUNC(common,canUseWeapon) ||
{(vehicle ACE_player) isKindOf 'StaticWeapon'}) exitWith {false};
["ACE3", QGVAR(checkAmmo), localize "STR_ACE_Reload_checkAmmo",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !([ACE_player] call EFUNC(common,canUseWeapon) ||
{(vehicle ACE_player) isKindOf 'StaticWeapon'}) exitWith {false};
// Statement
[ACE_player, vehicle ACE_player, false] call FUNC(checkAmmo);
true
},
[19, [false, true, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
// Statement
[ACE_player] call FUNC(checkAmmo);
true
},
{false},
[19, [false, true, false]], false] call cba_fnc_addKeybind;
// Listen for attempts to link ammo
["linkedAmmo", {
EXPLODE_3_PVT(_this,_receiver,_giver,_magazine);
diag_log "linkedAmmo";
diag_log _this;
private ["_magazineCfg","_magazineType"];
_magazineType = currentMagazine _receiver;
_magazineCfg = configFile >> "CfgMagazines" >> _magazineType;
// Return the magazine if it's the wrong type
if (_magazineType != (_magazine select 0)) exitWith {
["returnedAmmo", [_giver], [_giver,_receiver,_magazine]] call EFUNC(common,targetEvent);
};
private ["_ammoCount","_ammoMissing","_ammoAdded","_ammoRemaining"];
_ammoCount = _receiver ammo currentWeapon _receiver;
_ammoMissing = getNumber (_magazineCfg >> "count") - _ammoCount;
// Return the magazine if the belt is full or empty
if ((_ammoCount == 0) || _ammoMissing == 0) exitWith {
["returnedAmmo", [_giver], [_giver,_receiver,_magazine]] call EFUNC(common,targetEvent);
};
// Add the ammo
_ammoAdded = _ammoMissing min (_magazine select 1);
_receiver setAmmo [currentWeapon _receiver, _ammoCount + _ammoAdded];
if ((_magazine select 1) - _ammoAdded > 0) then {
["returnedAmmo", [_giver], [_giver,_receiver,[_magazineType,(_magazine select 1) - _ammoAdded]]] call EFUNC(common,targetEvent);
};
}] call EFUNC(common,addEventhandler);
// Listen for returned magazines
["returnedAmmo", {
EXPLODE_3_PVT(_this,_receiver,_giver,_magazine);
diag_log "returnedAmmo";
diag_log _this;
_receiver addMagazine _magazine;
}] call EFUNC(common,addEventhandler);

View File

@ -2,6 +2,10 @@
ADDON = false;
PREP(canCheckAmmo);
PREP(canLinkBelt);
PREP(checkAmmo);
PREP(displayAmmo);
PREP(startLinkingBelt);
ADDON = true;

View File

@ -5,13 +5,17 @@ class CfgPatches {
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"};
author[] = {"commy2","KoffeinFlummi"};
requiredAddons[] = {"ace_interaction"};
author[] = {"commy2","KoffeinFlummi","CAA-Picard"};
authorUrl = "https://github.com/commy2/";
VERSION_CONFIG;
};
};
#include "CfgVehicles.hpp"
#include "CfgMagazines.hpp"
#include "CfgEventHandlers.hpp"
#include "CfgActions.hpp"

View File

@ -0,0 +1,35 @@
/*
* Author: CAA-Picard
* Check if the player can check the ammo of the target.
*
* Argument:
* 0: Player <OBJECT>
* 1: Target <OBJECT>
*
* Return value:
* Can link belt<BOOL>
*/
#include "script_component.hpp"
EXPLODE_2_PVT(_this,_player,_target);
// Return true for static weapons if they have been fired once
if (_target isKindOf "StaticWeapon") exitWith {
(currentMagazine _target) != ""
};
// Return false for all other vehicles
if !(_target isKindOf "CAManBase") exitWith {false};
// For men
if (currentWeapon _target == "") exitWith {false};
// Check if their current magazine is a belt
_magazineType = currentMagazine _target;
_magazineCfg = configFile >> "CfgMagazines" >> _magazineType;
if (getNumber (_magazineCfg >> "ACE_isBelt") == 1) exitWith {true};
// Check for rocket launchers
if (currentWeapon _target == secondaryWeapon _target) exitWith {true};
false

View File

@ -0,0 +1,39 @@
/*
* Author: CAA-Picard
* Check if the target has an MG equiped with belt system that the player can link
*
* Argument:
* 0: Player <OBJECT>
* 1: Target <OBJECT>
*
* Return value:
* Can link belt<BOOL>
*/
#include "script_component.hpp"
EXPLODE_2_PVT(_this,_player,_target);
if (vehicle _target != _target) exitWith {false};
private ["_magazineCfg","_magazineType"];
_magazineType = currentMagazine _target;
_magazineCfg = configFile >> "CfgMagazines" >> _magazineType;
if (getNumber (_magazineCfg >> "ACE_isBelt") == 0) exitWith {false};
// Check if the ammo is not empty or full
private "_ammoCount";
_ammoCount = _target ammo currentWeapon _target;
// Exit if the belt is full or empty
if ((_ammoCount == 0) || (getNumber (_magazineCfg >> "count") - _ammoCount) == 0) exitWith {false};
// Check if the player has any of the same magazines
// Calculate max ammo
private "_maxAmmo";
_maxAmmo = 0;
{
_maxAmmo = _maxAmmo max (_x select 1);
} forEach ([magazinesAmmo _player, {_this select 0 == _magazineType}] call EFUNC(common,filter));
_maxAmmo > 0

View File

@ -1,12 +1,10 @@
/*
* Author: commy2
*
* Author: commy2 and CAA-Picard
* Count the ammo of the currently loaded magazine or count rifle grenades. Play animation and display message.
*
* Argument:
* 0: The player (Object)
* 1: The vehicle (Object)
* 2: Skip the animation? Used after reloading (Bool)
* 0: Player <OBJECT>
* 1: Target. Optional, if not suplied the player counts his personal or static weapon ammo <OBJECT>
*
* Return value:
* Nothing
@ -15,87 +13,24 @@
#define COUNT_BARS 12
private ["_unit", "_vehicle"];
EXPLODE_1_PVT(_this,_unit);
_unit = _this select 0;
_vehicle = _this select 1;
private ["_target"];
_target = vehicle _unit;
if (_unit != _vehicle && !(_vehicle isKindOf "StaticWeapon")) then {
_vehicle = _unit;
if (count _this > 1) then {
_target = _this select 1;
} else {
// If the unit is on foot, count it's own ammo
if (_unit == _target) exitWith {};
// If it's mounted on a movile weapon, count it's own ammo
if !(_target isKindOf "StaticWeapon") then {
_target = _unit;
};
};
[_vehicle, currentWeapon _vehicle, currentMuzzle _vehicle, currentMagazine _vehicle, _this select 2] spawn {
_vehicle = _this select 0;
_weapon = _this select 1;
_muzzle = _this select 2;
_magazine = _this select 3;
_skipDelay = _this select 4;
_unit playActionNow "Gear";
if (currentWeapon _vehicle == "") exitWith {};
if (typeName _muzzle != "STRING") then {_muzzle = _weapon};
_showNumber = false;
_ammo = 0;
_maxRounds = 1;
_count = 0;
// not grenade launcher
if (_muzzle == _weapon) then {
_maxRounds = getNumber (configFile >> "CfgMagazines" >> _magazine >> "count") max 1;
_ammo = _vehicle ammo _weapon;
if (_maxRounds >= COUNT_BARS) then {
_count = round (COUNT_BARS * _ammo / _maxRounds);
if (_ammo > 0) then {_count = _count max 1};
if (_ammo < _maxRounds) then {_count = _count min (COUNT_BARS - 1)};
} else {
_count = _ammo;
};
// grenade launcher
} else {
_showNumber = true;
_count = if (_magazine != "") then {
{_x == _magazine} count (magazines _vehicle + [_magazine])
} else {
{_x in getArray (configFile >> "CfgWeapons" >> _weapon >> _muzzle >> "Magazines")} count magazines _vehicle
};
};
if !(_skipDelay) then {
_vehicle playActionNow "Gear";
sleep 1
};
_text = if (_showNumber) then {
parseText format ["<t align='center' >%1x</t>", _count]
} else {
_color = [
2 * (1 - _ammo / _maxRounds) min 1,
2 * _ammo / _maxRounds min 1,
00
];
_string = "";
for "_a" from 1 to _count do {
_string = _string + "|";
};
_text = [_string, _color] call EFUNC(common,stringToColoredText);
_string = "";
for "_a" from (_count + 1) to (_maxRounds min COUNT_BARS) do {
_string = _string + "|";
};
composeText [
_text,
[_string, [0.5, 0.5, 0.5]] call EFUNC(common,stringToColoredText)
]
};
_picture = getText (configFile >> "CfgMagazines" >> _magazine >> "picture");
[_text, _picture] call EFUNC(common,displayTextPicture);
};
[FUNC(displayAmmo), [_target], 1, 0.1] call EFUNC(common,waitAndExecute);

View File

@ -0,0 +1,94 @@
/*
* Author: commy2 and CAA-Picard
* Display the ammo of the currently loaded magazine of the target or count rifle grenades.
*
* Argument:
* 0: Target <OBJECT>
*
* Return value:
* Nothing
*/
#include "script_component.hpp"
#define COUNT_BARS 12
EXPLODE_1_PVT(_this,_target);
private ["_weapon","_muzzle","_magazine","_showNumber","_ammo","_maxRounds","_count","_text","_color","_picture"];
_weapon = currentWeapon _target;
_muzzle = currentMuzzle _target;
_magazine = currentMagazine _target;
// currentWeapon returns "" for static weapons before they are shot once
if (_target isKindOf "StaticWeapon") then {
if (_weapon == "") then {
if (count (weapons _target) == 1) then {
_weapon = (weapons _target) select 0;
_muzzle = _weapon;
};
};
};
if (_weapon == "") exitWith {};
if (typeName _muzzle != "STRING") then {_muzzle = _weapon};
_showNumber = false;
_ammo = 0;
_maxRounds = 1;
_count = 0;
// not grenade launcher
if (_muzzle == _weapon) then {
_maxRounds = getNumber (configFile >> "CfgMagazines" >> _magazine >> "count") max 1;
_ammo = _target ammo _weapon;
if (_maxRounds >= COUNT_BARS) then {
_count = round (COUNT_BARS * _ammo / _maxRounds);
if (_ammo > 0) then {_count = _count max 1};
if (_ammo < _maxRounds) then {_count = _count min (COUNT_BARS - 1)};
} else {
_count = _ammo;
};
// grenade launcher
} else {
_showNumber = true;
_count = if (_magazine != "") then {
{_x == _magazine} count (magazines _target + [_magazine])
} else {
{_x in getArray (configFile >> "CfgWeapons" >> _weapon >> _muzzle >> "Magazines")} count magazines _target
};
};
_text = if (_showNumber) then {
parseText format ["<t align='center' >%1x</t>", _count]
} else {
_color = [
2 * (1 - _ammo / _maxRounds) min 1,
2 * _ammo / _maxRounds min 1,
00
];
_string = "";
for "_a" from 1 to _count do {
_string = _string + "|";
};
_text = [_string, _color] call EFUNC(common,stringToColoredText);
_string = "";
for "_a" from (_count + 1) to (_maxRounds min COUNT_BARS) do {
_string = _string + "|";
};
composeText [
_text,
[_string, [0.5, 0.5, 0.5]] call EFUNC(common,stringToColoredText)
]
};
_picture = getText (configFile >> "CfgMagazines" >> _magazine >> "picture");
[_text, _picture] call EFUNC(common,displayTextPicture);

View File

@ -0,0 +1,69 @@
/*
* Author: CAA-Picard
* Start linking the belt
*
* Argument:
* 0: Player <OBJECT>
* 1: Target <OBJECT>
*
* Return value:
* None
*/
#include "script_component.hpp"
EXPLODE_2_PVT(_this,_player,_target);
if (vehicle _target != _target) exitWith {false};
private ["_magazineCfg","_magazineType"];
_magazineType = currentMagazine _target;
_magazineCfg = configFile >> "CfgMagazines" >> _magazineType;
if (getNumber (_magazineCfg >> "ACE_isBelt") == 0) exitWith {false};
// Check if the ammo is not empty or full
private "_ammoCount";
_ammoCount = _target ammo currentWeapon _target;
// Exit if the belt is full or empty
if ((_ammoCount == 0) || (getNumber (_magazineCfg >> "count") - _ammoCount) == 0) exitWith {false};
// Check if the player has any of the same same magazines
// Calculate max ammo it can link
private "_maxAmmo";
_maxAmmo = 0;
{
_maxAmmo = _maxAmmo max (_x select 1);
} forEach ([magazinesAmmo _player, {_this select 0 == _magazineType}] call EFUNC(common,filter));
if (_maxAmmo == 0) exitWith {};
// Condition to call each frame
_condition = {
EXPLODE_2_PVT((_this select 0),_player,_target);
([_player, _target] call EFUNC(common,canInteract)) && ((_player distance _target) < 3) && ((speed _target) < 1)
};
_onFinish = {
EXPLODE_3_PVT((_this select 0),_player,_target,_magazine);
// Raise event on remote unit
["linkedAmmo", [_target], [_target, _player, _magazine]] call EFUNC(common,targetEvent);
};
_onFailure = {
EXPLODE_3_PVT((_this select 0),_player,_target,_magazine);
[_caller, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation);
// Add back the magazine with the former ammo count
_player addMagazine _magazine;
};
[_player, "AinvPknlMstpSnonWnonDr_medic5", 0] call EFUNC(common,doAnimation);
// Remove the magazine with maximum remaining ammo
[_player, _magazineType, _maxAmmo] call EFUNC(common,removeSpecificMagazine);
// Call progress bar
[4, [_player, _target, [_magazineType, _maxAmmo]], _onFinish, _onFailure, (localize "STR_ACE_Reload_LinkingBelt"), _condition] call EFUNC(common,progressBar);

View File

@ -32,5 +32,11 @@
<Portuguese>Munições</Portuguese>
<Russian>Боеприпасы</Russian>
</Key>
<Key ID="STR_ACE_Reload_LinkBelt">
<English>Link belt</English>
</Key>
<Key ID="STR_ACE_Reload_LinkingBelt">
<English>Linking belt...</English>
</Key>
</Package>
</Project>

View File

@ -4,24 +4,21 @@
if !(hasInterface) exitWith {};
// Add keybinds
["ACE3",
localize "STR_ACE_Resting_RestWeapon",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !([ACE_player] call EFUNC(common,canUseWeapon) &&
{inputAction 'reloadMagazine' == 0} &&
{!weaponLowered ACE_player} &&
{speed ACE_player < 1}) exitWith {false};
["ACE3", QGVAR(RestWeapon), localize "STR_ACE_Resting_RestWeapon",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !([ACE_player] call EFUNC(common,canUseWeapon) &&
{inputAction 'reloadMagazine' == 0} &&
{!weaponLowered ACE_player} &&
{speed ACE_player < 1}) exitWith {false};
// Statement
[ACE_player, vehicle ACE_player, currentWeapon ACE_player] call FUNC(restWeapon);
// Return false so it doesn't block other actions
false
},
[15, [false, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
// Statement
[ACE_player, vehicle ACE_player, currentWeapon ACE_player] call FUNC(restWeapon);
// Return false so it doesn't block other actions
false
},
{false},
[15, [false, false, false]], false] call cba_fnc_addKeybind;

View File

@ -2,24 +2,21 @@
#include "script_component.hpp"
//["Soldier", {_player = ACE_player; if (currentWeapon _player in (_player getVariable [QGVAR(safedWeapons), []])) then {[false] call FUNC(setSafeModeVisual)}] call EFUNC(common,addInfoDisplayEventHandler);
//@todo addEventHandler infoDisplayChanged with select 1 == "Soldier"
//@todo addEventHandler infoDisplayChanged with select 1 == "Soldier"
// Add keybinds
["ACE3",
localize "STR_ACE_SafeMode_SafeMode",
{
// Conditions: canInteract
_exceptions = [QEGVAR(interaction,isNotEscorting)];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false};
["ACE3", QGVAR(safeMode), localize "STR_ACE_SafeMode_SafeMode",
{
// Conditions: canInteract
_exceptions = [QEGVAR(interaction,isNotEscorting)];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false};
// Statement
[ACE_player, currentWeapon ACE_player, currentMuzzle ACE_player] call FUNC(lockSafety);
true
},
[41, [false, true, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
// Statement
[ACE_player, currentWeapon ACE_player, currentMuzzle ACE_player] call FUNC(lockSafety);
true
},
{false},
[41, [false, true, false]], false] call cba_fnc_addKeybind;

View File

@ -33,78 +33,66 @@ if !(hasInterface) exitWith {};
// Add keybinds
["ACE3",
localize "STR_ACE_Scopes_AdjustUp",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
[ACE_player] call FUNC(inventoryCheck);
if !([ACE_player, 0, 0.1] call FUNC(canAdjustScope)) exitWith {false};
["ACE3", QGVAR(AdjustUp), localize "STR_ACE_Scopes_AdjustUp",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
[ACE_player] call FUNC(inventoryCheck);
if !([ACE_player, 0, 0.1] call FUNC(canAdjustScope)) exitWith {false};
// Statement
[ACE_player, 0, 0.1] call FUNC(adjustScope);
true
},
[201, [false, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
// Statement
[ACE_player, 0, 0.1] call FUNC(adjustScope);
true
},
{false},
[201, [false, false, false]], false] call cba_fnc_addKeybind;
["ACE3",
localize "STR_ACE_Scopes_AdjustDown",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
[ACE_player] call FUNC(inventoryCheck);
if !([ACE_player, 0, -0.1] call FUNC(canAdjustScope)) exitWith {false};
["ACE3", QGVAR(AdjustDown), localize "STR_ACE_Scopes_AdjustDown",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
[ACE_player] call FUNC(inventoryCheck);
if !([ACE_player, 0, -0.1] call FUNC(canAdjustScope)) exitWith {false};
// Statement
[ACE_player, 0, -0.1] call FUNC(adjustScope);
true
},
[209, [false, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
// Statement
[ACE_player, 0, -0.1] call FUNC(adjustScope);
true
},
{false},
[209, [false, false, false]], false] call cba_fnc_addKeybind;
["ACE3",
localize "STR_ACE_Scopes_AdjustLeft",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
[ACE_player] call FUNC(inventoryCheck);
if !([ACE_player, -0.1, 0] call FUNC(canAdjustScope)) exitWith {false};
["ACE3", QGVAR(AdjustLeft), localize "STR_ACE_Scopes_AdjustLeft",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
[ACE_player] call FUNC(inventoryCheck);
if !([ACE_player, -0.1, 0] call FUNC(canAdjustScope)) exitWith {false};
// Statement
[ACE_player, -0.1, 0] call FUNC(adjustScope);
true
},
[209, [false, true, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
// Statement
[ACE_player, -0.1, 0] call FUNC(adjustScope);
true
},
{false},
[209, [false, true, false]], false] call cba_fnc_addKeybind;
["ACE3",
localize "STR_ACE_Scopes_AdjustRight",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
[ACE_player] call FUNC(inventoryCheck);
if !([ACE_player, 0.1, 0] call FUNC(canAdjustScope)) exitWith {false};
["ACE3", QGVAR(AdjustRight), localize "STR_ACE_Scopes_AdjustRight",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
[ACE_player] call FUNC(inventoryCheck);
if !([ACE_player, 0.1, 0] call FUNC(canAdjustScope)) exitWith {false};
// Statement
[ACE_player, 0.1, 0] call FUNC(adjustScope);
true
},
[201, [false, true, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
// Statement
[ACE_player, 0.1, 0] call FUNC(adjustScope);
true
},
{false},
[201, [false, true, false]], false] call cba_fnc_addKeybind;

View File

@ -1,6 +1,7 @@
class Mode_SemiAuto;
class Mode_Burst;
class Mode_FullAuto;
class MuzzleSlot;
// config inheritance of weapon slot info v1.32
class SlotInfo;
@ -21,7 +22,7 @@ class CfgWeapons {
class RifleCore;
class Rifle: RifleCore {
class WeaponSlotsInfo {
class MuzzleSlot: SlotInfo {};
class MuzzleSlot: MuzzleSlot {};
class CowsSlot: CowsSlot {};
class PointerSlot: PointerSlot {};
};

View File

@ -1,83 +1,62 @@
// by commy2
["ACE3",
localize "STR_ACE_Vector_AzimuthKey",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(currentWeapon ACE_player == "ACE_Vector" && {ACE_player == cameraOn} && {cameraView == "GUNNER"}) exitWith {false};
["ACE3", QGVAR(AzimuthKey), localize "STR_ACE_Vector_AzimuthKey",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(currentWeapon ACE_player == "ACE_Vector" && {ACE_player == cameraOn} && {cameraView == "GUNNER"}) exitWith {false};
// prevent holding down
if (GETGVAR(isDownStateKey1,false)) exitWith {false};
GVAR(isDownStateKey1) = true;
// prevent holding down
if (GETGVAR(isDownStateKey1,false)) exitWith {false};
GVAR(isDownStateKey1) = true;
// Statement
["azimuth"] call FUNC(onKeyDown);
true
},
[15, [false, false, false]],
false,
"keydown"
] call CBA_fnc_registerKeybind;
// Statement
["azimuth"] call FUNC(onKeyDown);
true
},
{
// prevent holding down
GVAR(isDownStateKey1) = false;
["ACE3",
localize "STR_ACE_Vector_AzimuthKey",
{
// prevent holding down
GVAR(isDownStateKey1) = false;
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Statement
["azimuth"] call FUNC(onKeyUp);
true
},
[15, [false, false, false]], false, 0] call CBA_fnc_addKeybind; //Tab Key
// Statement
["azimuth"] call FUNC(onKeyUp);
true
},
[15, [false, false, false]],
false,
"keyup"
] call CBA_fnc_registerKeybind;
["ACE3",
localize "STR_ACE_Vector_DistanceKey",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(currentWeapon ACE_player == "ACE_Vector" && {ACE_player == cameraOn} && {cameraView == "GUNNER"}) exitWith {false};
["ACE3", QGVAR(DistanceKey), localize "STR_ACE_Vector_DistanceKey",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(currentWeapon ACE_player == "ACE_Vector" && {ACE_player == cameraOn} && {cameraView == "GUNNER"}) exitWith {false};
// prevent holding down
if (GETGVAR(isDownStateKey2,false)) exitWith {false};
GVAR(isDownStateKey2) = true;
// prevent holding down
if (GETGVAR(isDownStateKey2,false)) exitWith {false};
GVAR(isDownStateKey2) = true;
// Statement
["distance"] call FUNC(onKeyDown);
true
},
[19, [false, false, false]],
false,
"keydown"
] call CBA_fnc_registerKeybind;
// Statement
["distance"] call FUNC(onKeyDown);
true
},
{
// prevent holding down
GVAR(isDownStateKey2) = false;
["ACE3",
localize "STR_ACE_Vector_DistanceKey",
{
// prevent holding down
GVAR(isDownStateKey2) = false;
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Statement
["distance"] call FUNC(onKeyUp);
true
},
[19, [false, false, false]],
false,
"keyup"
] call CBA_fnc_registerKeybind;
// Statement
["distance"] call FUNC(onKeyUp);
true
},
[19, [false, false, false]], false] call CBA_fnc_addKeybind; //R Key

View File

@ -1,7 +1,8 @@
class CfgAmmo {
class MissileBase;
class M_Mo_120mm_AT: MissileBase {
class Missile_AGM_02_F;
class M_Mo_120mm_AT: Missile_AGM_02_F {
cost = 400000; // Stop it from aiming at FUCKING RABBITS.
weaponLockSystem = 2;
};
@ -11,6 +12,7 @@ class CfgAmmo {
weaponLockSystem = 4;
};
class MissileBase;
class M_Mo_82mm_AT: MissileBase {
cost = 400000;
weaponLockSystem = 2;

View File

@ -4,22 +4,19 @@
if !(hasInterface) exitWith {};
// Add keybinds
["ACE3",
localize "STR_ACE_SpeedLimiter",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(ACE_player == driver vehicle ACE_player &&
{vehicle ACE_player isKindOf 'Car' ||
{vehicle ACE_player isKindOf 'Tank'}}) exitWith {false};
["ACE3", QGVAR(speedLimiter), localize "STR_ACE_SpeedLimiter",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(ACE_player == driver vehicle ACE_player &&
{vehicle ACE_player isKindOf 'Car' ||
{vehicle ACE_player isKindOf 'Tank'}}) exitWith {false};
// Statement
[ACE_player, vehicle ACE_player] call FUNC(speedLimiter);
true
},
[211, [false, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
// Statement
[ACE_player, vehicle ACE_player] call FUNC(speedLimiter);
true
},
{false},
[211, [false, false, false]], false] call cba_fnc_addKeybind; //DELETE Key

View File

@ -4,254 +4,212 @@
if !(hasInterface) exitWith {};
// Add keybinds
["ACE3",
localize "STR_ACE_WeaponSelect_SelectPistol",
{
// Conditions: canInteract
_exceptions = [QEGVAR(interaction,isNotEscorting)];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false};
["ACE3", QGVAR(SelectPistol), localize "STR_ACE_WeaponSelect_SelectPistol",
{
// Conditions: canInteract
_exceptions = [QEGVAR(interaction,isNotEscorting)];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false};
// Statement
[ACE_player, handgunWeapon ACE_player] call FUNC(selectWeaponMode);
true
},
[2, [false, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
// Statement
[ACE_player, handgunWeapon ACE_player] call FUNC(selectWeaponMode);
true
},
{false},
[2, [false, false, false]], false] call cba_fnc_addKeybind; //1 Key
["ACE3",
localize "STR_ACE_WeaponSelect_SelectRifle",
{
// Conditions: canInteract
_exceptions = [QEGVAR(interaction,isNotEscorting)];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false};
["ACE3", QGVAR(SelectRifle), localize "STR_ACE_WeaponSelect_SelectRifle",
{
// Conditions: canInteract
_exceptions = [QEGVAR(interaction,isNotEscorting)];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false};
// Statement
[ACE_player, primaryWeapon ACE_player] call FUNC(selectWeaponMode);
true
},
[3, [false, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
// Statement
[ACE_player, primaryWeapon ACE_player] call FUNC(selectWeaponMode);
true
},
{false},
[3, [false, false, false]], false] call cba_fnc_addKeybind; //2 Key
["ACE3",
localize "STR_ACE_WeaponSelect_SelectLauncher",
{
// Conditions: canInteract
_exceptions = [QEGVAR(interaction,isNotEscorting)];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false};
["ACE3", QGVAR(SelectRifleMuzzle), localize "STR_ACE_WeaponSelect_SelectRifleMuzzle",
{
// Conditions: canInteract
_exceptions = [QEGVAR(interaction,isNotEscorting)];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false};
// Statement
[ACE_player, secondaryWeapon ACE_player] call FUNC(selectWeaponMode);
true
},
[5, [false, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
// Statement
[ACE_player, primaryWeapon ACE_player] call FUNC(selectWeaponMuzzle);
true
},
{false},
[4, [false, false, false]], false] call cba_fnc_addKeybind; //3 Key
["ACE3",
localize "STR_ACE_WeaponSelect_SelectRifleMuzzle",
{
// Conditions: canInteract
_exceptions = [QEGVAR(interaction,isNotEscorting)];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false};
["ACE3", QGVAR(SelectLauncher), localize "STR_ACE_WeaponSelect_SelectLauncher",
{
// Conditions: canInteract
_exceptions = [QEGVAR(interaction,isNotEscorting)];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false};
// Statement
[ACE_player, primaryWeapon ACE_player] call FUNC(selectWeaponMuzzle);
true
},
[4, [false, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
// Statement
[ACE_player, secondaryWeapon ACE_player] call FUNC(selectWeaponMode);
true
},
{false},
[5, [false, false, false]], false] call cba_fnc_addKeybind; //4 Key
["ACE3",
localize "STR_ACE_WeaponSelect_SelectBinocular",
{
// Conditions: canInteract
_exceptions = [QEGVAR(interaction,isNotEscorting)];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false};
["ACE3", QGVAR(SelectBinocular), localize "STR_ACE_WeaponSelect_SelectBinocular",
{
// Conditions: canInteract
_exceptions = [QEGVAR(interaction,isNotEscorting)];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false};
// Statement
[ACE_player, binocular ACE_player] call FUNC(selectWeaponMode);
true
},
[6, [false, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
// Statement
[ACE_player, binocular ACE_player] call FUNC(selectWeaponMode);
true
},
{false},
[6, [false, false, false]], false] call cba_fnc_addKeybind; //5 Key
["ACE3",
localize "STR_ACE_WeaponSelect_SelectGrenadeFrag",
{
// Conditions: canInteract
_exceptions = [QEGVAR(interaction,isNotEscorting)];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false};
["ACE3", QGVAR(SelectGrenadeFrag), localize "STR_ACE_WeaponSelect_SelectGrenadeFrag",
{
// Conditions: canInteract
_exceptions = [QEGVAR(interaction,isNotEscorting)];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false};
// Statement
[ACE_player] call FUNC(selectGrenadeFrag);
true
},
[7, [false, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
// Statement
[ACE_player] call FUNC(selectGrenadeFrag);
true
},
{false},
[7, [false, false, false]], false] call cba_fnc_addKeybind; //6 Key
["ACE3",
localize "STR_ACE_WeaponSelect_SelectGrenadeOther",
{
// Conditions: canInteract
_exceptions = [QEGVAR(interaction,isNotEscorting)];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false};
["ACE3", QGVAR(SelectGrenadeOther), localize "STR_ACE_WeaponSelect_SelectGrenadeOther",
{
// Conditions: canInteract
_exceptions = [QEGVAR(interaction,isNotEscorting)];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false};
// Statement
[ACE_player] call FUNC(selectGrenadeOther);
true
},
[8, [false, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
// Statement
[ACE_player] call FUNC(selectGrenadeOther);
true
},
{false},
[8, [false, false, false]], false] call cba_fnc_addKeybind; //7 Key
["ACE3",
localize "STR_ACE_WeaponSelect_HolsterWeapon",
{
// Conditions: canInteract
_exceptions = [QEGVAR(interaction,isNotEscorting)];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false};
["ACE3", QGVAR(HolsterWeapon), localize "STR_ACE_WeaponSelect_HolsterWeapon",
{
// Conditions: canInteract
_exceptions = [QEGVAR(interaction,isNotEscorting)];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false};
// Statement
[ACE_player] call FUNC(putWeaponAway);
true
},
[11, [false, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
// Statement
[ACE_player] call FUNC(putWeaponAway);
true
},
{false},
[11, [false, false, false]], false] call cba_fnc_addKeybind; //0 Key
["ACE3",
localize "STR_ACE_WeaponSelect_EngineOn",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(ACE_player != vehicle ACE_player && {ACE_player == driver vehicle ACE_player} && {!isEngineOn vehicle ACE_player}) exitWith {false};
["ACE3", QGVAR(EngineOn), localize "STR_ACE_WeaponSelect_EngineOn",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(ACE_player != vehicle ACE_player && {ACE_player == driver vehicle ACE_player} && {!isEngineOn vehicle ACE_player}) exitWith {false};
// Statement
(vehicle ACE_player) engineOn true;
true
},
[3, [false, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
// Statement
(vehicle ACE_player) engineOn true;
true
},
{false},
[3, [false, false, false]], false] call cba_fnc_addKeybind; //2 Key
["ACE3",
localize "STR_ACE_WeaponSelect_EngineOff",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(ACE_player != vehicle ACE_player && {ACE_player == driver vehicle ACE_player} && {isEngineOn vehicle ACE_player}) exitWith {false};
["ACE3", QGVAR(EngineOff), localize "STR_ACE_WeaponSelect_EngineOff",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(ACE_player != vehicle ACE_player && {ACE_player == driver vehicle ACE_player} && {isEngineOn vehicle ACE_player}) exitWith {false};
// Statement
(vehicle ACE_player) engineOn false;
true
},
[2, [false, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
// Statement
(vehicle ACE_player) engineOn false;
true
},
{false},
[2, [false, false, false]], false] call cba_fnc_addKeybind; //1 Key
["ACE3",
localize "STR_ACE_WeaponSelect_SelectMainGun",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(ACE_player != vehicle ACE_player) exitWith {false};
["ACE3", QGVAR(SelectMainGun), localize "STR_ACE_WeaponSelect_SelectMainGun",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(ACE_player != vehicle ACE_player) exitWith {false};
// Statement
[ACE_player, vehicle ACE_player, 0] call FUNC(selectWeaponVehicle);
true
},
[4, [false, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
// Statement
[ACE_player, vehicle ACE_player, 0] call FUNC(selectWeaponVehicle);
true
},
{false},
[4, [false, false, false]], false] call cba_fnc_addKeybind; //3 Key
["ACE3",
localize "STR_ACE_WeaponSelect_SelectMachineGun",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(ACE_player != vehicle ACE_player) exitWith {false};
["ACE3", QGVAR(SelectMachineGun), localize "STR_ACE_WeaponSelect_SelectMachineGun",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(ACE_player != vehicle ACE_player) exitWith {false};
// Statement
[ACE_player, vehicle ACE_player, 1] call FUNC(selectWeaponVehicle);
true
},
[5, [false, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
// Statement
[ACE_player, vehicle ACE_player, 1] call FUNC(selectWeaponVehicle);
true
},
{false},
[5, [false, false, false]], false] call cba_fnc_addKeybind; //4 Key
["ACE3",
localize "STR_ACE_WeaponSelect_SelectMissiles",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(ACE_player != vehicle ACE_player) exitWith {false};
["ACE3", QGVAR(SelectMissiles), localize "STR_ACE_WeaponSelect_SelectMissiles",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(ACE_player != vehicle ACE_player) exitWith {false};
// Statement
[ACE_player, vehicle ACE_player, 2] call FUNC(selectWeaponVehicle);
true
},
[6, [false, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
// Statement
[ACE_player, vehicle ACE_player, 2] call FUNC(selectWeaponVehicle);
true
},
{false},
[6, [false, false, false]], false] call cba_fnc_addKeybind; //5 Key
["ACE3",
localize "STR_ACE_WeaponSelect_FireSmokeLauncher",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(ACE_player != vehicle ACE_player && {ACE_player == commander vehicle ACE_player}) exitWith {false};
["ACE3", QGVAR(FireSmokeLauncher), localize "STR_ACE_WeaponSelect_FireSmokeLauncher",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(ACE_player != vehicle ACE_player && {ACE_player == commander vehicle ACE_player}) exitWith {false};
// Statement
[vehicle ACE_player] call FUNC(fireSmokeLauncher);
true
},
[10, [false, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
// Statement
[vehicle ACE_player] call FUNC(fireSmokeLauncher);
true
},
{false},
[10, [false, false, false]], false] call cba_fnc_addKeybind; //9 Key

View File

@ -21,7 +21,6 @@
#include <string>
#define MAXELEVATION 20
#define SIMULATIONSTEP 0.05
#define MAXITERATIONS 120
#define PRECISION 0.1
#define RADIANS(X) (X / (180 / M_PI))
@ -45,7 +44,7 @@ std::vector<std::string> splitString(std::string input) {
}
double traceBullet(double initSpeed, double airFriction, double angle, double angleTarget, double distance) {
double velX, velY, posX, posY, posTargetX, posTargetY, velMag;
double velX, velY, posX, posY, lastPosX, lastPosY, posTargetX, posTargetY, velMag;
velX = cos(RADIANS(angle)) * initSpeed;
velY = sin(RADIANS(angle)) * initSpeed;
posX = 0;
@ -53,18 +52,24 @@ double traceBullet(double initSpeed, double airFriction, double angle, double an
posTargetX = cos(RADIANS(angleTarget)) * distance;
posTargetY = sin(RADIANS(angleTarget)) * distance;
double simulationStep = 0.05;
int i = 0;
while (i < MAXITERATIONS) {
lastPosX = posX;
lastPosY = posY;
simulationStep = 0.1 - 0.049 * (posX / posTargetX);
velMag = sqrt(pow(velX, 2) + pow(velY, 2));
velX += SIMULATIONSTEP * (velX * velMag * airFriction);
velY += SIMULATIONSTEP * (velY * velMag * airFriction - 9.81);
posX += velX * SIMULATIONSTEP;
posY += velY * SIMULATIONSTEP;
velX += simulationStep * (velX * velMag * airFriction);
velY += simulationStep * (velY * velMag * airFriction - 9.81);
posX += velX * simulationStep;
posY += velY * simulationStep;
if (posX >= posTargetX) { break; }
i++;
}
return posY - posTargetY;
double coef = (posTargetX - lastPosX) / (posX - lastPosX);
return (lastPosY + (posY - lastPosY) * coef) - posTargetY;
}
double getSolution(double initSpeed, double airFriction, double angleTarget, double distance) {