Apply the ufeh to ACE_Recoil

This commit is contained in:
esteldunedain 2016-02-06 18:21:43 -03:00
parent 69dea087ca
commit 12d7a171e5
3 changed files with 12 additions and 12 deletions

View File

@ -1,14 +1,11 @@
class Extended_PreInit_EventHandlers { class Extended_PreInit_EventHandlers {
class ADDON { class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preInit)); init = QUOTE(call COMPILE_FILE(XEH_preInit));
}; };
}; };
class Extended_FiredBIS_EventHandlers { class Extended_PostInit_EventHandlers {
class CAManBase {
class ADDON { class ADDON {
clientFiredBIS = QUOTE(if (_this select 0 == ACE_player) then {_this call FUNC(camshake)};); init = QUOTE( call COMPILE_FILE(XEH_postInit) );
};
}; };
}; };

View File

@ -0,0 +1,4 @@
#include "script_component.hpp"
// Register fire event handler
["firedPlayer", DFUNC(camShake)] call EFUNC(common,addEventHandler);

View File

@ -1,12 +1,10 @@
/* /*
* Author: Orginal by Ryan Schultz, edited by KoffeinFlummi, commy2 * Author: Orginal by Ryan Schultz, edited by KoffeinFlummi, commy2
* Adds camera shake when firing * Adds camera shake when firing. Called from the unified fired EH only for the local player.
* From TMR: Small Arms * From TMR: Small Arms
* *
* Arguments: * Arguments:
* 0: Unit <OBJECT> * None. Parameters inherited from EFUNC(common,firedEH)
* 1: Weapon <STRING>
* 3: Muzzle <STRING>
* *
* Return Value: * Return Value:
* Nothing * Nothing
@ -18,13 +16,14 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
//IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"];
TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret);
#define BASE_POWER 0.40 #define BASE_POWER 0.40
#define BASE_TIME 0.19 #define BASE_TIME 0.19
#define BASE_FREQ 13 #define BASE_FREQ 13
#define RECOIL_COEF 40 #define RECOIL_COEF 40
params ["_unit", "_weapon", "_muzzle"];
if (toLower _weapon in ["throw", "put"]) exitWith {}; if (toLower _weapon in ["throw", "put"]) exitWith {};
private _powerMod = ([0, -0.1, -0.1, 0, -0.2] select (["STAND", "CROUCH", "PRONE", "UNDEFINED", ""] find stance _unit)) + ([0, -1, 0, -1] select (["INTERNAL", "EXTERNAL", "GUNNER", "GROUP"] find cameraView)); private _powerMod = ([0, -0.1, -0.1, 0, -0.2] select (["STAND", "CROUCH", "PRONE", "UNDEFINED", ""] find stance _unit)) + ([0, -1, 0, -1] select (["INTERNAL", "EXTERNAL", "GUNNER", "GROUP"] find cameraView));