Grenades Cleanup

Shouldn't be any change to functionality
Headers
Formating
simplifying (waitAndExecute)
exceptions/canInteract for keybind
This commit is contained in:
PabstMirror 2015-02-14 00:39:01 -06:00
parent fb3a610649
commit 1a61148053
14 changed files with 413 additions and 417 deletions

View File

@ -1,89 +1,89 @@
class CfgAmmo { class CfgAmmo {
class FlareCore; class FlareCore;
class FlareBase: FlareCore { class FlareBase: FlareCore {
intensity = 20000; intensity = 20000;
flareSize = 12; flareSize = 12;
}; };
class F_40mm_White: FlareBase { class F_40mm_White: FlareBase {
intensity = 40000; intensity = 40000;
flareSize = 12; flareSize = 12;
}; };
class F_20mm_White: FlareBase { class F_20mm_White: FlareBase {
intensity = 20000; intensity = 20000;
flareSize = 12; flareSize = 12;
}; };
class F_Signal_Green: FlareBase { class F_Signal_Green: FlareBase {
intensity = 20000; intensity = 20000;
flareSize = 12; flareSize = 12;
}; };
class Flare_82mm_AMOS_White: FlareCore { class Flare_82mm_AMOS_White: FlareCore {
intensity = 80000; intensity = 80000;
flareSize = 12; flareSize = 12;
}; };
class F_20mm_Red: F_20mm_White {}; class F_20mm_Red: F_20mm_White {};
class F_20mm_Green: F_20mm_White {}; class F_20mm_Green: F_20mm_White {};
class F_20mm_Yellow: F_20mm_White {}; class F_20mm_Yellow: F_20mm_White {};
class ACE_F_Hand_White: F_20mm_White { class ACE_F_Hand_White: F_20mm_White {
grenadeBurningSound[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; grenadeBurningSound[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5};
grenadeFireSound[] = {"SmokeShellSoundHit1",0.25,"SmokeShellSoundHit2",0.25,"SmokeShellSoundHit3",0.5}; grenadeFireSound[] = {"SmokeShellSoundHit1",0.25,"SmokeShellSoundHit2",0.25,"SmokeShellSoundHit3",0.5};
soundTrigger[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; soundTrigger[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5};
SmokeShellSoundHit1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_1",1.25893,1,100}; SmokeShellSoundHit1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_1",1.25893,1,100};
SmokeShellSoundHit2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_2",1.25893,1,100}; SmokeShellSoundHit2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_2",1.25893,1,100};
SmokeShellSoundHit3[] = {"A3\Sounds_F\weapons\smokeshell\smoke_3",1.25893,1,100}; SmokeShellSoundHit3[] = {"A3\Sounds_F\weapons\smokeshell\smoke_3",1.25893,1,100};
SmokeShellSoundLoop1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop1",0.125893,1,70}; SmokeShellSoundLoop1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop1",0.125893,1,70};
SmokeShellSoundLoop2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop2",0.125893,1,70}; SmokeShellSoundLoop2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop2",0.125893,1,70};
timeToLive = 60; timeToLive = 60;
}; };
class ACE_F_Hand_Red: F_20mm_Red { class ACE_F_Hand_Red: F_20mm_Red {
grenadeBurningSound[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; grenadeBurningSound[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5};
grenadeFireSound[] = {"SmokeShellSoundHit1",0.25,"SmokeShellSoundHit2",0.25,"SmokeShellSoundHit3",0.5}; grenadeFireSound[] = {"SmokeShellSoundHit1",0.25,"SmokeShellSoundHit2",0.25,"SmokeShellSoundHit3",0.5};
soundTrigger[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; soundTrigger[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5};
SmokeShellSoundHit1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_1",1.25893,1,100}; SmokeShellSoundHit1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_1",1.25893,1,100};
SmokeShellSoundHit2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_2",1.25893,1,100}; SmokeShellSoundHit2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_2",1.25893,1,100};
SmokeShellSoundHit3[] = {"A3\Sounds_F\weapons\smokeshell\smoke_3",1.25893,1,100}; SmokeShellSoundHit3[] = {"A3\Sounds_F\weapons\smokeshell\smoke_3",1.25893,1,100};
SmokeShellSoundLoop1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop1",0.125893,1,70}; SmokeShellSoundLoop1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop1",0.125893,1,70};
SmokeShellSoundLoop2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop2",0.125893,1,70}; SmokeShellSoundLoop2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop2",0.125893,1,70};
timeToLive = 60; timeToLive = 60;
}; };
class ACE_F_Hand_Green: F_20mm_Green { class ACE_F_Hand_Green: F_20mm_Green {
grenadeBurningSound[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; grenadeBurningSound[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5};
grenadeFireSound[] = {"SmokeShellSoundHit1",0.25,"SmokeShellSoundHit2",0.25,"SmokeShellSoundHit3",0.5}; grenadeFireSound[] = {"SmokeShellSoundHit1",0.25,"SmokeShellSoundHit2",0.25,"SmokeShellSoundHit3",0.5};
soundTrigger[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; soundTrigger[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5};
SmokeShellSoundHit1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_1",1.25893,1,100}; SmokeShellSoundHit1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_1",1.25893,1,100};
SmokeShellSoundHit2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_2",1.25893,1,100}; SmokeShellSoundHit2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_2",1.25893,1,100};
SmokeShellSoundHit3[] = {"A3\Sounds_F\weapons\smokeshell\smoke_3",1.25893,1,100}; SmokeShellSoundHit3[] = {"A3\Sounds_F\weapons\smokeshell\smoke_3",1.25893,1,100};
SmokeShellSoundLoop1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop1",0.125893,1,70}; SmokeShellSoundLoop1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop1",0.125893,1,70};
SmokeShellSoundLoop2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop2",0.125893,1,70}; SmokeShellSoundLoop2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop2",0.125893,1,70};
timeToLive = 60; timeToLive = 60;
}; };
class ACE_F_Hand_Yellow: F_20mm_Yellow { class ACE_F_Hand_Yellow: F_20mm_Yellow {
grenadeBurningSound[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; grenadeBurningSound[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5};
grenadeFireSound[] = {"SmokeShellSoundHit1",0.25,"SmokeShellSoundHit2",0.25,"SmokeShellSoundHit3",0.5}; grenadeFireSound[] = {"SmokeShellSoundHit1",0.25,"SmokeShellSoundHit2",0.25,"SmokeShellSoundHit3",0.5};
soundTrigger[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; soundTrigger[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5};
SmokeShellSoundHit1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_1",1.25893,1,100}; SmokeShellSoundHit1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_1",1.25893,1,100};
SmokeShellSoundHit2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_2",1.25893,1,100}; SmokeShellSoundHit2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_2",1.25893,1,100};
SmokeShellSoundHit3[] = {"A3\Sounds_F\weapons\smokeshell\smoke_3",1.25893,1,100}; SmokeShellSoundHit3[] = {"A3\Sounds_F\weapons\smokeshell\smoke_3",1.25893,1,100};
SmokeShellSoundLoop1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop1",0.125893,1,70}; SmokeShellSoundLoop1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop1",0.125893,1,70};
SmokeShellSoundLoop2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop2",0.125893,1,70}; SmokeShellSoundLoop2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop2",0.125893,1,70};
timeToLive = 60; timeToLive = 60;
}; };
class ACE_G_M84: F_20mm_Yellow { class ACE_G_M84: F_20mm_Yellow {
useFlare = 0; useFlare = 0;
flareSize = 0; flareSize = 0;
intensity = 0; intensity = 0;
grenadeBurningSound[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; grenadeBurningSound[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5};
grenadeFireSound[] = {"SmokeShellSoundHit1",0.25,"SmokeShellSoundHit2",0.25,"SmokeShellSoundHit3",0.5}; grenadeFireSound[] = {"SmokeShellSoundHit1",0.25,"SmokeShellSoundHit2",0.25,"SmokeShellSoundHit3",0.5};
soundTrigger[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; soundTrigger[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5};
SmokeShellSoundHit1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_1",1.25893,1,100}; SmokeShellSoundHit1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_1",1.25893,1,100};
SmokeShellSoundHit2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_2",1.25893,1,100}; SmokeShellSoundHit2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_2",1.25893,1,100};
SmokeShellSoundHit3[] = {"A3\Sounds_F\weapons\smokeshell\smoke_3",1.25893,1,100}; SmokeShellSoundHit3[] = {"A3\Sounds_F\weapons\smokeshell\smoke_3",1.25893,1,100};
SmokeShellSoundLoop1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop1",0.125893,1,70}; SmokeShellSoundLoop1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop1",0.125893,1,70};
SmokeShellSoundLoop2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop2",0.125893,1,70}; SmokeShellSoundLoop2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop2",0.125893,1,70};
timeToLive = 60; timeToLive = 60;
fuseDistance = 2.3; fuseDistance = 2.3;
model = PATHTOF(models\ACE_m84_thrown.p3d); model = PATHTOF(models\ACE_m84_thrown.p3d);
}; };
}; };

View File

@ -1,19 +1,19 @@
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_PostInit_EventHandlers { class Extended_PostInit_EventHandlers {
class ADDON { class ADDON {
clientInit = QUOTE( call COMPILE_FILE(XEH_postInitClient) ); init = QUOTE( call COMPILE_FILE(XEH_postInit) );
}; };
}; };
class Extended_FiredBIS_EventHandlers { class Extended_FiredBIS_EventHandlers {
class CAManBase { class CAManBase {
class ADDON { class ADDON {
clientFiredBIS = QUOTE( _this call FUNC(throwGrenade) ); clientFiredBIS = QUOTE( _this call FUNC(throwGrenade) );
};
}; };
};
}; };

View File

@ -1,60 +1,60 @@
class CfgMagazines { class CfgMagazines {
class HandGrenade; class HandGrenade;
class ACE_HandFlare_Base: HandGrenade { class ACE_HandFlare_Base: HandGrenade {
value = 2; value = 2;
nameSoundWeapon = "smokeshell"; nameSoundWeapon = "smokeshell";
nameSound = "smokeshell"; nameSound = "smokeshell";
mass = 4; mass = 4;
initSpeed = 22; initSpeed = 22;
}; };
class ACE_HandFlare_White: ACE_HandFlare_Base { class ACE_HandFlare_White: ACE_HandFlare_Base {
ammo = "ACE_F_Hand_White"; ammo = "ACE_F_Hand_White";
displayname = "$STR_ACE_Grenades_M127A1_White_Name"; displayname = "$STR_ACE_Grenades_M127A1_White_Name";
descriptionshort = "$STR_ACE_Grenades_M127A1_White_Description"; descriptionshort = "$STR_ACE_Grenades_M127A1_White_Description";
displayNameShort = "$STR_ACE_Grenades_M127A1_White_NameShort"; displayNameShort = "$STR_ACE_Grenades_M127A1_White_NameShort";
model = "\A3\weapons_f\ammo\flare_white"; model = "\A3\weapons_f\ammo\flare_white";
picture = "\A3\Weapons_F\Data\UI\gear_flare_white_ca.paa"; picture = "\A3\Weapons_F\Data\UI\gear_flare_white_ca.paa";
}; };
class ACE_HandFlare_Red: ACE_HandFlare_Base { class ACE_HandFlare_Red: ACE_HandFlare_Base {
ammo = "ACE_F_Hand_Red"; ammo = "ACE_F_Hand_Red";
displayname = "$STR_ACE_Grenades_M127A1_Red_Name"; displayname = "$STR_ACE_Grenades_M127A1_Red_Name";
descriptionshort = "$STR_ACE_Grenades_M127A1_Red_Description"; descriptionshort = "$STR_ACE_Grenades_M127A1_Red_Description";
displayNameShort = "$STR_ACE_Grenades_M127A1_Red_NameShort"; displayNameShort = "$STR_ACE_Grenades_M127A1_Red_NameShort";
model = "\A3\weapons_f\ammo\flare_red"; model = "\A3\weapons_f\ammo\flare_red";
picture = "\A3\Weapons_F\Data\UI\gear_flare_red_ca.paa"; picture = "\A3\Weapons_F\Data\UI\gear_flare_red_ca.paa";
}; };
class ACE_HandFlare_Green: ACE_HandFlare_Base { class ACE_HandFlare_Green: ACE_HandFlare_Base {
ammo = "ACE_F_Hand_Green"; ammo = "ACE_F_Hand_Green";
displayname = "$STR_ACE_Grenades_M127A1_Green_Name"; displayname = "$STR_ACE_Grenades_M127A1_Green_Name";
descriptionshort = "$STR_ACE_Grenades_M127A1_Green_Description"; descriptionshort = "$STR_ACE_Grenades_M127A1_Green_Description";
displayNameShort = "$STR_ACE_Grenades_M127A1_Green_NameShort"; displayNameShort = "$STR_ACE_Grenades_M127A1_Green_NameShort";
model = "\A3\weapons_f\ammo\flare_green"; model = "\A3\weapons_f\ammo\flare_green";
picture = "\A3\Weapons_F\Data\UI\gear_flare_green_ca.paa"; picture = "\A3\Weapons_F\Data\UI\gear_flare_green_ca.paa";
}; };
class ACE_HandFlare_Yellow: ACE_HandFlare_Base { class ACE_HandFlare_Yellow: ACE_HandFlare_Base {
ammo = "ACE_F_Hand_Yellow"; ammo = "ACE_F_Hand_Yellow";
displayname = "$STR_ACE_Grenades_M127A1_Yellow_Name"; displayname = "$STR_ACE_Grenades_M127A1_Yellow_Name";
descriptionshort = "$STR_ACE_Grenades_M127A1_Yellow_Description"; descriptionshort = "$STR_ACE_Grenades_M127A1_Yellow_Description";
displayNameShort = "$STR_ACE_Grenades_M127A1_Yellow_NameShort"; displayNameShort = "$STR_ACE_Grenades_M127A1_Yellow_NameShort";
model = "\A3\weapons_f\ammo\flare_yellow"; model = "\A3\weapons_f\ammo\flare_yellow";
picture = "\A3\Weapons_F\Data\UI\gear_flare_yellow_ca.paa"; picture = "\A3\Weapons_F\Data\UI\gear_flare_yellow_ca.paa";
}; };
class ACE_M84: HandGrenade { class ACE_M84: HandGrenade {
ammo = "ACE_G_M84"; ammo = "ACE_G_M84";
displayname = "$STR_ACE_Grenades_M84_Name"; displayname = "$STR_ACE_Grenades_M84_Name";
descriptionshort = "$STR_ACE_Grenades_M84_Description"; descriptionshort = "$STR_ACE_Grenades_M84_Description";
displayNameShort = "M84"; displayNameShort = "M84";
model = PATHTOF(models\ACE_m84.p3d); model = PATHTOF(models\ACE_m84.p3d);
picture = PATHTOF(UI\ACE_m84_x_ca.paa); picture = PATHTOF(UI\ACE_m84_x_ca.paa);
}; };
class 3Rnd_UGL_FlareGreen_F; class 3Rnd_UGL_FlareGreen_F;
class 6Rnd_GreenSignal_F: 3Rnd_UGL_FlareGreen_F { class 6Rnd_GreenSignal_F: 3Rnd_UGL_FlareGreen_F {
ammo = "F_40mm_Green"; ammo = "F_40mm_Green";
initSpeed = 120; initSpeed = 120;
}; };
class 6Rnd_RedSignal_F: 6Rnd_GreenSignal_F { class 6Rnd_RedSignal_F: 6Rnd_GreenSignal_F {
ammo = "F_40mm_Red"; ammo = "F_40mm_Red";
initSpeed = 120; initSpeed = 120;
}; };
}; };

View File

@ -1,45 +1,45 @@
#define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \ #define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \
name = #ITEM; \ name = #ITEM; \
count = COUNT; \ count = COUNT; \
}; };
class CfgVehicles { class CfgVehicles {
class NATO_Box_Base; class NATO_Box_Base;
class EAST_Box_Base; class EAST_Box_Base;
class IND_Box_Base; class IND_Box_Base;
class Box_NATO_Support_F; class Box_NATO_Support_F;
class Box_NATO_Grenades_F: NATO_Box_Base { class Box_NATO_Grenades_F: NATO_Box_Base {
class TransportItems { class TransportItems {
MACRO_ADDITEM(ACE_HandFlare_White,12) MACRO_ADDITEM(ACE_HandFlare_White,12)
MACRO_ADDITEM(ACE_HandFlare_Green,12) MACRO_ADDITEM(ACE_HandFlare_Green,12)
MACRO_ADDITEM(ACE_M84,12) MACRO_ADDITEM(ACE_M84,12)
};
}; };
};
class Box_East_Grenades_F: EAST_Box_Base { class Box_East_Grenades_F: EAST_Box_Base {
class TransportItems { class TransportItems {
MACRO_ADDITEM(ACE_HandFlare_Yellow,12) MACRO_ADDITEM(ACE_HandFlare_Yellow,12)
MACRO_ADDITEM(ACE_HandFlare_Red,12) MACRO_ADDITEM(ACE_HandFlare_Red,12)
MACRO_ADDITEM(ACE_M84,12) MACRO_ADDITEM(ACE_M84,12)
};
}; };
};
class Box_IND_Grenades_F: IND_Box_Base { class Box_IND_Grenades_F: IND_Box_Base {
class TransportItems { class TransportItems {
MACRO_ADDITEM(ACE_HandFlare_Yellow,12) MACRO_ADDITEM(ACE_HandFlare_Yellow,12)
MACRO_ADDITEM(ACE_HandFlare_Green,12) MACRO_ADDITEM(ACE_HandFlare_Green,12)
MACRO_ADDITEM(ACE_M84,12) MACRO_ADDITEM(ACE_M84,12)
};
}; };
};
class ACE_Box_Misc: Box_NATO_Support_F { class ACE_Box_Misc: Box_NATO_Support_F {
class TransportItems { class TransportItems {
MACRO_ADDITEM(ACE_HandFlare_White,12) MACRO_ADDITEM(ACE_HandFlare_White,12)
MACRO_ADDITEM(ACE_HandFlare_Red,12) MACRO_ADDITEM(ACE_HandFlare_Red,12)
MACRO_ADDITEM(ACE_HandFlare_Green,12) MACRO_ADDITEM(ACE_HandFlare_Green,12)
MACRO_ADDITEM(ACE_HandFlare_Yellow,12) MACRO_ADDITEM(ACE_HandFlare_Yellow,12)
MACRO_ADDITEM(ACE_M84,12) MACRO_ADDITEM(ACE_M84,12)
};
}; };
};
}; };

View File

@ -1,23 +1,23 @@
class CfgWeapons { class CfgWeapons {
class GrenadeLauncher; class GrenadeLauncher;
class Throw: GrenadeLauncher { class Throw: GrenadeLauncher {
muzzles[] += {"ACE_HandFlare_WhiteMuzzle", "ACE_HandFlare_RedMuzzle", "ACE_HandFlare_GreenMuzzle", "ACE_HandFlare_YellowMuzzle", "ACE_M84Muzzle"}; muzzles[] += {"ACE_HandFlare_WhiteMuzzle", "ACE_HandFlare_RedMuzzle", "ACE_HandFlare_GreenMuzzle", "ACE_HandFlare_YellowMuzzle", "ACE_M84Muzzle"};
class ThrowMuzzle; class ThrowMuzzle;
class ACE_HandFlare_WhiteMuzzle: ThrowMuzzle { class ACE_HandFlare_WhiteMuzzle: ThrowMuzzle {
magazines[] = {"ACE_HandFlare_White"}; magazines[] = {"ACE_HandFlare_White"};
};
class ACE_HandFlare_RedMuzzle: ThrowMuzzle {
magazines[] = {"ACE_HandFlare_Red"};
};
class ACE_HandFlare_GreenMuzzle: ThrowMuzzle {
magazines[] = {"ACE_HandFlare_Green"};
};
class ACE_HandFlare_YellowMuzzle: ThrowMuzzle {
magazines[] = {"ACE_HandFlare_Yellow"};
};
class ACE_M84Muzzle: ThrowMuzzle {
magazines[] = {"ACE_M84"};
};
}; };
class ACE_HandFlare_RedMuzzle: ThrowMuzzle {
magazines[] = {"ACE_HandFlare_Red"};
};
class ACE_HandFlare_GreenMuzzle: ThrowMuzzle {
magazines[] = {"ACE_HandFlare_Green"};
};
class ACE_HandFlare_YellowMuzzle: ThrowMuzzle {
magazines[] = {"ACE_HandFlare_Yellow"};
};
class ACE_M84Muzzle: ThrowMuzzle {
magazines[] = {"ACE_M84"};
};
};
}; };

View File

@ -0,0 +1,28 @@
// by commy2
#include "script_component.hpp"
["flashbangExplosion", {_this call FUNC(flashbangExplosionEH)}] call EFUNC(common,addEventHandler);
if !(hasInterface) exitWith {};
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};
// Statement
[] call FUNC(nextMode);
},
[9, [false, false, false]], //8 key
false,
"keydown"
] call cba_fnc_registerKeybind;

View File

@ -1,13 +0,0 @@
// by commy2
#include "script_component.hpp"
GVAR(flashbangPPEffectCC) = ppEffectCreate ["ColorCorrections", 4265];
GVAR(flashbangPPEffectCC) ppEffectForceInNVG true;
["ACE3",
localize "STR_ACE_Grenades_SwitchGrenadeMode",
{_this call FUNC(nextMode)},
[9, [false, false, false]], //8 key
false,
"keydown"] call cba_fnc_registerKeybind;

View File

@ -2,12 +2,9 @@
ADDON = false; ADDON = false;
PREP(flashbangEffectStages);
PREP(flashbangExplosionEH); PREP(flashbangExplosionEH);
PREP(flashbangThrownFuze); PREP(flashbangThrownFuze);
PREP(nextMode); PREP(nextMode);
PREP(throwGrenade); PREP(throwGrenade);
["flashbangExplosion", { _this call DFUNC(flashbangExplosionEH) }] call EFUNC(common,addEventHandler);
ADDON = true; ADDON = true;

View File

@ -1,15 +1,15 @@
#include "script_component.hpp" #include "script_component.hpp"
class CfgPatches { class CfgPatches {
class ADDON { class ADDON {
units[] = {}; units[] = {};
weapons[] = {}; weapons[] = {};
requiredVersion = REQUIRED_VERSION; requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"}; requiredAddons[] = {"ace_common"};
author[] = {"commy2", "KoffeinFlummi"}; author[] = {"commy2", "KoffeinFlummi"};
authorUrl = "https://github.com/commy2/"; authorUrl = "https://github.com/commy2/";
VERSION_CONFIG; VERSION_CONFIG;
}; };
}; };
#include "CfgEventHandlers.hpp" #include "CfgEventHandlers.hpp"

View File

@ -1,57 +0,0 @@
/*
* Author: KoffeinFlummi, Pabst Mirror
*
* Handles the different stages of the flash bang effect recovery
*
* Arguments:
* ARRAY[
* 0-ARRAY - PARAMS:
* 0: NUMBER - Stage, controls a case statement
* 1: NUMBER - Time To Wait Until
* 2: VARIES - Stage's Variable
* 1-NUMBER perFrame handle
* Return Value:
* None
*/
#include "script_component.hpp"
private ["_stage", "_waitUntilTime"];
_stage = (_this select 0) select 0;
_waitUntilTime = (_this select 0) select 1;
if (_waitUntilTime > time) exitWith {};
//remove frameEH
[(_this select 1)] call cba_fnc_removePerFrameHandler;
switch (_stage) do {
case(EFFECT_STAGE_RESETAI): {
private "_unit";
_unit = (_this select 0) select 2;
_unit enableAI "MOVE";
_unit enableAI "ANIM";
_unit enableAI "AUTOTARGET";
_unit enableAI "TARGET";
_unit enableAI "FSM";
_unit setSkill (skill _unit * 50);
};
case(EFFECT_STAGE_DELETELIGHT): {
private "_light";
_light = (_this select 0) select 2;
deleteVehicle _light;
};
case(EFFECT_STAGE_PARTIALRECOVERY): {
private "_strength";
_strength = (_this select 0) select 2;
GVAR(flashbangPPEffectCC) ppEffectAdjust [1,1,0,[1,1,1,0],[0,0,0,1],[0,0,0,0]];
GVAR(flashbangPPEffectCC) ppEffectCommit (10 * _strength);
};
case(EFFECT_STAGE_FULLRECOVERY): {
GVAR(flashbangPPEffectCC) ppEffectEnable false;
};
default {
TRACE_1("EffectStage Bad Stage", _stage);
};
};

View File

@ -1,85 +1,109 @@
/* /*
* Author: KoffeinFlummi * Author: KoffeinFlummi
* * Creates the flashbang effect and knock out AI units.
* Creates the flashbang effect and knock out AI units. *
* * Arguments:
* Arguments: * 0: The grenade <OBJECT>
* 0: The grenade (Object) *
* * Return Value:
* Return Value: * Nothing
* None *
*/ * Example:
* [theGrenade] call ace_grenades_fnc_flashbangExplosionEH
*
* Public: No
*/
#include "script_component.hpp" #include "script_component.hpp"
private ["_grenade", "_affected", "_strength", "_posGrenade", "_posUnit", "_angleGrenade", "_angleView", "_angleDiff", "_light"]; private ["_affected", "_strength", "_posGrenade", "_posUnit", "_angleGrenade", "_angleView", "_angleDiff", "_light"];
_grenade = _this select 0; PARAMS_1(_grenade);
_affected = _grenade nearEntities ["CAManBase", 50]; _affected = _grenade nearEntities ["CAManBase", 50];
{ {
if ((local _x) && {alive _x}) then { if ((local _x) && {alive _x}) then {
_strength = 1 - ((_x distance _grenade) min 15) / 15; _strength = 1 - ((_x distance _grenade) min 15) / 15;
if (_x != ACE_player) then { if (_x != ACE_player) then {
//must be AI //must be AI
_x disableAI "MOVE"; _x disableAI "MOVE";
_x disableAI "ANIM"; _x disableAI "ANIM";
_x disableAI "AUTOTARGET"; _x disableAI "AUTOTARGET";
_x disableAI "TARGET"; _x disableAI "TARGET";
_x disableAI "FSM"; _x disableAI "FSM";
_x setSkill ((skill _x) / 50); _x setSkill ((skill _x) / 50);
[FUNC(flashbangEffectStages), 0, [EFFECT_STAGE_RESETAI, (time + (7 * _strength)), _x]] call CBA_fnc_addPerFrameHandler; [{
} else { PARAMS_1(_unit);
//Do effects for player _unit enableAI "MOVE";
// is there line of sight to the grenade? _unit enableAI "ANIM";
_posGrenade = getPosASL _grenade; _unit enableAI "AUTOTARGET";
_posGrenade set [2, (_posGrenade select 2) + 0.2]; // compensate for grenade glitching into ground _unit enableAI "TARGET";
if (lineIntersects [_posGrenade, getPosASL _x, _grenade, _x]) then { _unit enableAI "FSM";
_strength = _strength / 10; _unit setSkill (skill _unit * 50);
}; }, [_x], (7 * _strength), 0.1] call EFUNC(common,waitAndExecute); //0.1 precision is fine for AI
} else {
//Do effects for player
// is there line of sight to the grenade?
_posGrenade = getPosASL _grenade;
_posGrenade set [2, (_posGrenade select 2) + 0.2]; // compensate for grenade glitching into ground
if (lineIntersects [_posGrenade, getPosASL _x, _grenade, _x]) then {
_strength = _strength / 10;
};
// beeeeeeeeeeeeeeeeeeeeeeeeeeeeep // beeeeeeeeeeeeeeeeeeeeeeeeeeeeep
if (isClass (configFile >> "CfgPatches" >> "ACE_Hearing") and _strength > 0) then { if (isClass (configFile >> "CfgPatches" >> "ACE_Hearing") and _strength > 0) then {
[_x, 0.5 + (_strength / 2)] call EFUNC(hearing,earRinging); [_x, 0.5 + (_strength / 2)] call EFUNC(hearing,earRinging);
}; };
// account for people looking away by slightly // account for people looking away by slightly
// reducing the effect for visual effects. // reducing the effect for visual effects.
_posUnit = getPos _x; _posUnit = getPos _x;
_posGrenade = getPos _grenade; _posGrenade = getPos _grenade;
_angleGrenade = ((_posGrenade select 0) - (_posUnit select 0)) atan2 ((_posGrenade select 1) - (_posUnit select 1)); _angleGrenade = ((_posGrenade select 0) - (_posUnit select 0)) atan2 ((_posGrenade select 1) - (_posUnit select 1));
_angleGrenade = (_angleGrenade + 360) % 360; _angleGrenade = (_angleGrenade + 360) % 360;
_angleView = (eyeDirection player select 0) atan2 (eyeDirection player select 1); _angleView = (eyeDirection ACE_player select 0) atan2 (eyeDirection ACE_player select 1);
_angleView = (_angleView + 360) % 360; _angleView = (_angleView + 360) % 360;
_angleDiff = 180 - abs (abs (_angleGrenade - _angleView) - 180); _angleDiff = 180 - abs (abs (_angleGrenade - _angleView) - 180);
_angleDiff = ((_angleDiff - 45) max 0); _angleDiff = ((_angleDiff - 45) max 0);
_strength = _strength - _strength * (_angleDiff / 135); _strength = _strength - _strength * (_angleDiff / 135);
// create flash to illuminate environment // create flash to illuminate environment
_light = "#lightpoint" createVehicleLocal getPos _grenade; _light = "#lightpoint" createVehicleLocal (getPos _grenade);
_light setLightBrightness 200; _light setLightBrightness 200;
_light setLightAmbient [1,1,1]; _light setLightAmbient [1,1,1];
_light setLightColor [1,1,1]; _light setLightColor [1,1,1];
_light setLightDayLight true; _light setLightDayLight true;
[FUNC(flashbangEffectStages), 0, [EFFECT_STAGE_DELETELIGHT, (time + (0.1)), _light]] call CBA_fnc_addPerFrameHandler; //Delete the light after 0.1 seconds
[{
PARAMS_1(_light);
deleteVehicle _light;
}, [_light], 0.1, 0] call EFUNC(common,waitAndExecute);
// blind player // blind player
if (_strength > 0.1) then { if (_strength > 0.1) then {
GVAR(flashbangPPEffectCC) ppEffectEnable true; GVAR(flashbangPPEffectCC) ppEffectEnable true;
GVAR(flashbangPPEffectCC) ppEffectAdjust [1,1,(0.8 + _strength) min 1,[1,1,1,0],[0,0,0,1],[0,0,0,0]]; GVAR(flashbangPPEffectCC) ppEffectAdjust [1,1,(0.8 + _strength) min 1,[1,1,1,0],[0,0,0,1],[0,0,0,0]];
GVAR(flashbangPPEffectCC) ppEffectCommit 0.01; GVAR(flashbangPPEffectCC) ppEffectCommit 0.01;
[FUNC(flashbangEffectStages), 0, [EFFECT_STAGE_PARTIALRECOVERY, (time + (7 * _strength)), _strength]] call CBA_fnc_addPerFrameHandler; //PARTIALRECOVERY - start decreasing effect over time
[FUNC(flashbangEffectStages), 0, [ EFFECT_STAGE_FULLRECOVERY, (time + (17 * _strength))]] call CBA_fnc_addPerFrameHandler; [{
}; PARAMS_1(_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);
//FULLRECOVERY - end effect
[{
GVAR(flashbangPPEffectCC) ppEffectEnable false;
}, [], (17 * _strength), 0] call EFUNC(common,waitAndExecute);
};
};
}; };
};
} forEach _affected; } forEach _affected;

View File

@ -1,18 +1,25 @@
//Waits for the grenade fuze to trigger and 'explode' /*
* Author: commy2
* Waits for the flashbang grenade fuze to trigger and 'explode'
*
* Arguments:
* 0: projectile - Flashbang Grenade <OBJECT>
*
* Return Value:
* Nothing
*
* Example:
* [theFlashbang] call ace_grenades_fnc_flashbangThrownFuze
*
* Public: No
*/
#include "script_component.hpp" #include "script_component.hpp"
_projectile = (_this select 0) select 0; PARAMS_1(_projectile);
_waitUntilTime = (_this select 0) select 1;
if (_waitUntilTime > time) exitWith {};
//remove frameEH
[(_this select 1)] call cba_fnc_removePerFrameHandler;
if (alive _projectile) then { if (alive _projectile) then {
playSound3D ["A3\Sounds_F\weapons\Explosion\explosion_mine_1.wss", _projectile, false, getPosASL _projectile, 5, 1.2, 400]; playSound3D ["A3\Sounds_F\weapons\Explosion\explosion_mine_1.wss", _projectile, false, getPosASL _projectile, 5, 1.2, 400];
_affected = _projectile nearEntities ["CAManBase", 50]; _affected = _projectile nearEntities ["CAManBase", 50];
["flashbangExplosion", _affected, [_projectile]] call EFUNC(common,targetEvent); ["flashbangExplosion", _affected, [_projectile]] call EFUNC(common,targetEvent);
}; };

View File

@ -1,40 +1,41 @@
/* /*
* Author: commy2 * Author: commy2
*
* Select the next throwing mode and display message. * Select the next throwing mode and display message.
* *
* Argument: * Arguments:
* Nothing
*
* Return value:
* Nothing * Nothing
*
* Return Value:
* Handeled <BOOL>
*
* Example:
* [] call ace_grenades_fnc_nextMode
*
* Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_mode", "_hint"];
if (!([ACE_player] call EFUNC(common,canUseWeapon))) exitWith {false}; private ["_mode", "_hint"];
_mode = missionNamespace getVariable [QGVAR(currentThrowMode), 0]; _mode = missionNamespace getVariable [QGVAR(currentThrowMode), 0];
if (_mode == 4) then { if (_mode == 4) then {
_mode = 0; _mode = 0;
} else { } else {
_mode = _mode + 1; _mode = _mode + 1;
}; };
// ROLL GRENADE DOESN'T WORK RIGHT NOW // ROLL GRENADE DOESN'T WORK RIGHT NOW
if (_mode == 3) then { if (_mode == 3) then {
_mode = 4; _mode = 4;
}; };
_hint = [ _hint = [
localize "STR_ACE_Grenades_NormalThrow", localize "STR_ACE_Grenades_NormalThrow",
localize "STR_ACE_Grenades_HighThrow", localize "STR_ACE_Grenades_HighThrow",
localize "STR_ACE_Grenades_PreciseThrow", localize "STR_ACE_Grenades_PreciseThrow",
localize "STR_ACE_Grenades_RollGrenade", localize "STR_ACE_Grenades_RollGrenade",
localize "STR_ACE_Grenades_DropGrenade" localize "STR_ACE_Grenades_DropGrenade"
] select _mode; ] select _mode;
[_hint] call EFUNC(common,displayTextStructured); [_hint] call EFUNC(common,displayTextStructured);

View File

@ -1,15 +1,24 @@
/* /*
* Author: commy2 * Author: commy2
* * Adjust the grenades throwing direction and speed to the selected throwing mode.
* Adjust the grenades throwing direction and speed to the selected throwing mode. *
* * Arguments:
* Argument: * 0: unit - Object the event handler is assigned to <OBJECT>
* input from "Fired" eventhandler * 1: weapon - Fired weapon <STRING>
* * 2: muzzle - Muzzle that was used <STRING>
* Return value: * 3: mode - Current mode of the fired weapon <STRING>
* Nothing * 4: ammo - Ammo used <STRING>
*/ * 5: magazine - magazine name which was used <STRING>
* 6: projectile - Object of the projectile that was shot <OBJECT>
*
* Return Value:
* Nothing
*
* Example:
* [clientFiredBIS-XEH] call ace_grenades_fnc_throwGrenade
*
* Public: No
*/
#include "script_component.hpp" #include "script_component.hpp"
private ["_unit", "_weapon", "_projectile", "_mode", "_fuzeTime"]; private ["_unit", "_weapon", "_projectile", "_mode", "_fuzeTime"];
@ -24,38 +33,38 @@ if (_weapon != "Throw") exitWith {};
_mode = missionNamespace getVariable [QGVAR(currentThrowMode), 0]; _mode = missionNamespace getVariable [QGVAR(currentThrowMode), 0];
if (_mode != 0) then { if (_mode != 0) then {
private "_velocity"; private "_velocity";
_velocity = velocity _projectile; _velocity = velocity _projectile;
switch (_mode) do { switch (_mode) do {
//high throw //high throw
case 1 : { case 1 : {
_velocity = [ _velocity = [
0.5 * (_velocity select 0), 0.5 * (_velocity select 0),
0.5 * (_velocity select 1), 0.5 * (_velocity select 1),
[0, 0, 0] distance (_velocity vectorMultiply 0.5) [0, 0, 0] distance (_velocity vectorMultiply 0.5)
]; ];
};
//precise throw
case 2 : {
_velocity = (_unit weaponDirection _weapon) vectorMultiply (vectorMagnitude _velocity);
};
//roll grande
case 3 : {
//@todo
};
//drop grenade
case 4 : {
_velocity = [0, 0, 0];
};
}; };
//precise throw
case 2 : {
_velocity = (_unit weaponDirection _weapon) vectorMultiply (vectorMagnitude _velocity);
};
//roll grande
case 3 : {
//@todo
};
//drop grenade
case 4 : {
_velocity = [0, 0, 0];
};
};
_projectile setVelocity _velocity; _projectile setVelocity _velocity;
}; };
if (typeOf _projectile == "ACE_G_M84") then { if (typeOf _projectile == "ACE_G_M84") then {
_fuzeTime = getNumber (configFile >> "CfgAmmo" >> typeOf _projectile >> "fuseDistance"); _fuzeTime = getNumber (configFile >> "CfgAmmo" >> typeOf _projectile >> "fuseDistance");
// _fuzeTime = getNumber (configFile >> "CfgAmmo" >> typeOf _projectile >> "explosionTime"); //@toDo pretty sure this should be explosionTime not fuseDistance // _fuzeTime = getNumber (configFile >> "CfgAmmo" >> typeOf _projectile >> "explosionTime"); //@toDo pretty sure this should be explosionTime not fuseDistance
[FUNC(flashbangThrownFuze), 0, [_projectile, (time + _fuzeTime)]] call CBA_fnc_addPerFrameHandler; [FUNC(flashbangThrownFuze), [_projectile], _fuzeTime, 0] call EFUNC(common,waitAndExecute);
}; };