Merge pull request #2145 from jokoho48/codeCleanupGrenades

Code cleanup of Grenades module
This commit is contained in:
PabstMirror 2015-08-14 20:18:30 -05:00
commit e160a62599
6 changed files with 81 additions and 84 deletions

View File

@ -2,7 +2,7 @@
#include "script_component.hpp"
["flashbangExplosion", {_this call FUNC(flashbangExplosionEH)}] call EFUNC(common,addEventHandler);
["flashbangExplosion", DFUNC(flashbangExplosionEH)] call EFUNC(common,addEventHandler);
if !(hasInterface) exitWith {};

View File

@ -6,7 +6,7 @@
* 0: The grenade <OBJECT>
*
* Return Value:
* Nothing
* None
*
* Example:
* [theGrenade] call ace_grenades_fnc_flashbangExplosionEH
@ -16,8 +16,7 @@
#include "script_component.hpp"
private ["_affected", "_strength", "_posGrenade", "_posUnit", "_angleGrenade", "_angleView", "_angleDiff", "_light", "_losCount", "_dirToUnitVector", "_eyeDir", "_eyePos"];
PARAMS_1(_grenade);
params ["_grenade"];
_affected = _grenade nearEntities ["CAManBase", 20];
@ -34,7 +33,7 @@ _affected = _grenade nearEntities ["CAManBase", 20];
_x setSkill ((skill _x) / 50);
[{
PARAMS_1(_unit);
params ["_unit"];
//Make sure we don't enable AI for unconscious units
if (!(_unit getVariable ["ace_isunconscious", false])) then {
[_unit, false] call EFUNC(common,disableAI);
@ -54,7 +53,8 @@ _affected = _grenade nearEntities ["CAManBase", 20];
if (!lineIntersects [(_posGrenade vectorAdd _x), _eyePos, _grenade, ACE_player]) then {
_losCount = _losCount + 1;
};
} forEach [[0,0,0], [0,0,0.2], [0.1, 0.1, 0.1], [-0.1, -0.1, 0.1]];
true
} count [[0,0,0], [0,0,0.2], [0.1, 0.1, 0.1], [-0.1, -0.1, 0.1]];
TRACE_1("Line of sight count (out of 4)",_losCount);
if (_losCount <= 1) then {
_strength = _strength / 10;
@ -93,7 +93,7 @@ _affected = _grenade nearEntities ["CAManBase", 20];
//Delete the light after 0.1 seconds
[{
PARAMS_1(_light);
params ["light"];
deleteVehicle _light;
}, [_light], 0.1] call EFUNC(common,waitAndExecute);
@ -105,7 +105,7 @@ _affected = _grenade nearEntities ["CAManBase", 20];
//PARTIALRECOVERY - start decreasing effect over ACE_time
[{
PARAMS_1(_strength);
params ["_strength"];
GVAR(flashbangPPEffectCC) ppEffectAdjust [1,1,0,[1,1,1,0],[0,0,0,1],[0,0,0,0]];
GVAR(flashbangPPEffectCC) ppEffectCommit (10 * _strength);
}, [_strength], (7 * _strength), 0] call EFUNC(common,waitAndExecute);
@ -117,4 +117,5 @@ _affected = _grenade nearEntities ["CAManBase", 20];
};
};
};
} forEach _affected;
true
} count _affected;

View File

@ -6,7 +6,7 @@
* 0: projectile - Flashbang Grenade <OBJECT>
*
* Return Value:
* Nothing
* None
*
* Example:
* [theFlashbang] call ace_grenades_fnc_flashbangThrownFuze
@ -14,12 +14,11 @@
* Public: No
*/
#include "script_component.hpp"
PARAMS_1(_projectile);
params ["_projectile"];
if (alive _projectile) then {
playSound3D ["A3\Sounds_F\weapons\Explosion\explosion_mine_1.wss", _projectile, false, getPosASL _projectile, 5, 1.2, 400];
private "_affected";
_affected = _projectile nearEntities ["CAManBase", 50];
["flashbangExplosion", _affected, [_projectile]] call EFUNC(common,targetEvent);

View File

@ -3,7 +3,7 @@
* Select the next throwing mode and display message.
*
* Arguments:
* Nothing
* None
*
* Return Value:
* Handeled <BOOL>

View File

@ -12,7 +12,7 @@
* 6: projectile - Object of the projectile that was shot <OBJECT>
*
* Return Value:
* Nothing
* None
*
* Example:
* [clientFiredBIS-XEH] call ace_grenades_fnc_throwGrenade
@ -21,11 +21,8 @@
*/
#include "script_component.hpp"
private ["_unit", "_weapon", "_projectile", "_mode", "_fuzeTime"];
_unit = _this select 0;
_weapon = _this select 1;
_projectile = _this select 6;
private ["_mode", "_fuzeTime"];
params ["_unit", "_weapon", "", "", "", "", "_projectile"];
if (_unit != ACE_player) exitWith {};
if (_weapon != "Throw") exitWith {};

View File

@ -8,85 +8,85 @@ PixelShaderID = "Super";
VertexShaderID = "Super";
class Stage1
{
texture = "z\ace\addons\grenades\textures\ace_m84_nohq.paa";
uvSource = "tex";
class uvTransform
{
aside[] = {1,0,0};
up[] = {0,1,0};
dir[] = {0,0,0};
pos[] = {0,0,0};
};
texture = "z\ace\addons\grenades\textures\ace_m84_nohq.paa";
uvSource = "tex";
class uvTransform
{
aside[] = {1,0,0};
up[] = {0,1,0};
dir[] = {0,0,0};
pos[] = {0,0,0};
};
};
class Stage2
{
texture = "#(argb,8,8,3)color(0.5,0.5,0.5,1,DT)";
uvSource = "tex";
class uvTransform
{
aside[] = {0,9,0};
up[] = {4.5,0,0};
dir[] = {0,0,0};
pos[] = {0,0,0};
};
texture = "#(argb,8,8,3)color(0.5,0.5,0.5,1,DT)";
uvSource = "tex";
class uvTransform
{
aside[] = {0,9,0};
up[] = {4.5,0,0};
dir[] = {0,0,0};
pos[] = {0,0,0};
};
};
class Stage3
{
texture = "#(argb,8,8,3)color(0.5,0.5,0.5,0,MC)";
uvSource = "tex";
class uvTransform
{
aside[] = {1,0,0};
up[] = {0,1,0};
dir[] = {0,0,0};
pos[] = {0,0,0};
};
texture = "#(argb,8,8,3)color(0.5,0.5,0.5,0,MC)";
uvSource = "tex";
class uvTransform
{
aside[] = {1,0,0};
up[] = {0,1,0};
dir[] = {0,0,0};
pos[] = {0,0,0};
};
};
class Stage4
{
texture = "#(argb,8,8,3)color(1,1,1,1,AS)";
uvSource = "tex";
class uvTransform
{
aside[] = {1,0,0};
up[] = {0,1,0};
dir[] = {0,0,0};
pos[] = {0,0,0};
};
texture = "#(argb,8,8,3)color(1,1,1,1,AS)";
uvSource = "tex";
class uvTransform
{
aside[] = {1,0,0};
up[] = {0,1,0};
dir[] = {0,0,0};
pos[] = {0,0,0};
};
};
class Stage5
{
texture = "z\ace\addons\grenades\textures\ace_m84_smdi.paa";
uvSource = "tex";
class uvTransform
{
aside[] = {1,0,0};
up[] = {0,1,0};
dir[] = {0,0,0};
pos[] = {0,0,0};
};
texture = "z\ace\addons\grenades\textures\ace_m84_smdi.paa";
uvSource = "tex";
class uvTransform
{
aside[] = {1,0,0};
up[] = {0,1,0};
dir[] = {0,0,0};
pos[] = {0,0,0};
};
};
class Stage6
{
texture = "#(ai,16,2,2)fresnel(10.4,8.3)";
uvSource = "tex";
class uvTransform
{
aside[] = {1,0,0};
up[] = {0,1,0};
dir[] = {0,0,1};
pos[] = {0,0,0};
};
texture = "#(ai,16,2,2)fresnel(10.4,8.3)";
uvSource = "tex";
class uvTransform
{
aside[] = {1,0,0};
up[] = {0,1,0};
dir[] = {0,0,1};
pos[] = {0,0,0};
};
};
class Stage7
{
texture = "a3\data_f\env_land_co.paa";
uvSource = "tex";
class uvTransform
{
aside[] = {1,0,0};
up[] = {0,1,0};
dir[] = {0,0,0};
pos[] = {0,0,0};
};
};
texture = "a3\data_f\env_land_co.paa";
uvSource = "tex";
class uvTransform
{
aside[] = {1,0,0};
up[] = {0,1,0};
dir[] = {0,0,0};
pos[] = {0,0,0};
};
};