Streamline Vehicle Eventhandlers

Almost all eventhandlers getting set already when creating the base class of the vehicles like AllVehicles. So it is not needed to set it after that again. Until a few exceptions I removed or added the needed vehicle eventhandlers.

All helicopters have a fired eventhandler now as it should be. So finally if a helicopters shoots all crew members are in combat. This is the same if flares getting fired.

The fired evenhandler will be only executed for players now no longer for the server.

Note: The CSJ Gyro addon getting loaded very early so those addons need all eventhandlers set.
This commit is contained in:
AirwavesMan
2020-10-31 10:29:06 +01:00
parent 1210ce1eea
commit e6680aaa2f
7 changed files with 17 additions and 44 deletions

View File

@@ -13,11 +13,11 @@ class AH1Z_DZ: AH1Z {
supplyRadius = 1.3;
class Turrets;
class MainTurret;
class MainTurret;
class DefaultEventhandlers;
class EventHandlers: DefaultEventhandlers
{
fired = "_this call BIS_Effects_EH_Fired;";
killed = "_this call BIS_Effects_EH_Killed;";
engine = "if (_this select 1) then {(_this select 0) animate ['mainrotor_folded',1]; (_this select 0) animate ['mainrotor_unfolded',0]; (_this select 0) animate ['rotorshaft_unfolded',0];} else {_this select 0 setVariable ['engineOffTime',diag_tickTime,false];};"; //Unfold
};

View File

@@ -20,12 +20,6 @@ class AH6J_EP1_DZ: AH6J_EP1
fuelCapacity = 242;
supplyRadius = 1.3;
radartype = 0;
class DefaultEventhandlers;
class EventHandlers: DefaultEventhandlers
{
killed = "_this call BIS_Effects_EH_Killed;";
fired = "_this call BIS_Effects_EH_Fired;";
};
};
class AH6J_EP1_DZE: AH6J_EP1_DZ
@@ -93,13 +87,7 @@ class AH6X_DZ: AH6X_EP1 {
fuelCapacity = 242;
radartype = 0;
supplyRadius = 1.3;
class Turrets {};
class DefaultEventhandlers;
class EventHandlers: DefaultEventhandlers
{
killed = "_this call BIS_Effects_EH_Killed;";
};
class Upgrades
{

View File

@@ -30,9 +30,13 @@ class CH53_DZE : USEC_ch53_E {
transportMaxMagazines = 250;
transportmaxbackpacks = 15;
fuelCapacity = 3849;
class eventhandlers {
killed = "_this spawn BIS_Effects_EH_Killed;";
};
class EventHandlers: DefaultEventhandlers
{
fired = "_this call BIS_Effects_EH_Fired;";
killed = "_this call BIS_Effects_EH_Killed;";
};
class UserActions {
class RampOpen {
displayName = $STR_EPOCH_OPEN_RAMP;

View File

@@ -116,10 +116,10 @@ class CSJ_GyroP: Plane
class PushPlane {ACTION_PUSH;};
//class Repair {ACTION_REPAIR; radius = 4;};
//class Salvage {ACTION_SALVAGE; radius = 4;};
};
class DefaultEventhandlers;
class EventHandlers: DefaultEventhandlers
};
class Eventhandlers: DefaultEventhandlers
{
fired = "_this call BIS_Effects_EH_Fired;";
killed = "_this call BIS_Effects_EH_Killed;";
};
class Sounds
@@ -228,9 +228,9 @@ class CSJ_GyroC: Helicopter
//class Repair {ACTION_REPAIR; radius = 4;};
//class Salvage {ACTION_SALVAGE; radius = 4;};
};
class DefaultEventhandlers;
class EventHandlers: DefaultEventhandlers
class Eventhandlers: DefaultEventhandlers
{
fired = "_this call BIS_Effects_EH_Fired;";
killed = "_this call BIS_Effects_EH_Killed;";
};
class Sounds

View File

@@ -24,11 +24,6 @@ class pook_H13_base_DZE: pook_H13_base
hideWeaponsCargo = 0;
fuelCapacity = 450;
supplyRadius = 1.3;
class DefaultEventhandlers;
class EventHandlers: DefaultEventhandlers
{
killed = "_this call BIS_Effects_EH_Killed;";
};
};
class pook_medevac_DZE: pook_H13_base_DZE
@@ -182,13 +177,6 @@ class pook_gunship_DZ: pook_H13_base_DZE
selectionFireAnim = "zasleh";
weapons[] = {"pook_M60_dual","pook_H13Grenades","CMFlareLauncher"};
magazines[] = {"pook_1300Rnd_762x51_M60","pook_12Rnd_Grenade_Camel","60Rnd_CMFlareMagazine","60Rnd_CMFlareMagazine"};
class DefaultEventhandlers;
class Eventhandlers: DefaultEventhandlers
{
killed = "_this call BIS_Effects_EH_Killed;";
fired = "_this call BIS_Effects_EH_Fired;";
};
};
class pook_gunship_DZE: pook_gunship_DZ
@@ -309,13 +297,6 @@ class pook_transport_DZ: pook_H13_transport
class Turrets; // External class reference
class MainTurret; // External class reference
class DefaultEventhandlers;
class Eventhandlers: DefaultEventhandlers
{
killed = "_this call BIS_Effects_EH_Killed;";
fired = "_this call BIS_Effects_EH_Fired;";
};
};
class pook_transport_DZE: pook_transport_DZ

View File

@@ -83,11 +83,11 @@ class UH1Y_DZ: UH1_Base {
};
};
};
};
};
class DefaultEventhandlers;
class EventHandlers: DefaultEventhandlers
{
fired = "_this call BIS_Effects_EH_Fired;";
killed = "_this call BIS_Effects_EH_Killed;";
engine = "if (_this select 1) then {(_this select 0) animate ['mainrotor_folded',1]; (_this select 0) animate ['mainrotor_unfolded',0];} else {_this select 0 setVariable ['engineOffTime',diag_tickTime,false];};"; //Unfold
};

View File

@@ -15,9 +15,9 @@ class MV22_DZ : MV22 {
transportMaxMagazines = 400;
transportmaxbackpacks = 10;
fuelCapacity = 6513;
class DefaultEventhandlers;
class EventHandlers: DefaultEventhandlers
{
fired = "_this call BIS_Effects_EH_Fired;";
killed = "_this call BIS_Effects_EH_Killed;";
engine = "if (_this select 1) then {{_this select 0 animate [_x,0]} count ['engine_prop_1_1_turn','engine_prop_1_2_turn','engine_prop_1_3_turn','engine_prop_2_1_turn','engine_prop_2_2_turn','engine_prop_2_3_turn','engine_prop_1_1_close','engine_prop_1_3_close','engine_prop_2_1_close','engine_prop_2_2_close','pack_engine_1','pack_engine_2','turn_wing'];} else {_this select 0 setVariable ['engineOffTime',diag_tickTime,false];};"; //Unfold
};