Browse Source

Merge branch 'add-droideka-shield' into patch1121

m3ales 4 years ago
parent
commit
03f865c47a

+ 73 - 0
addons - Copy/RD501_Droids/BX/config.cpp

@@ -12,6 +12,7 @@ class CfgPatches
         requiredVersion = 0.1;
         units[] = {
             macro_new_unit_class(opfor,BX),
+			macro_new_unit_class(opfor,BX_shield)
         };
     };
 };
@@ -87,4 +88,76 @@ class CfgVehicles
 			_3(macro_zip_tie)
 		};
     };
+    class macro_new_unit_class(opfor,BX_shield): 3AS_BX_DROID_F
+    {
+        displayName = "BX Commando Droid(Shield)";
+		author = "RD501";
+		scope = 2;
+		faction = macro_cis_faction
+		editorSubcategory = macro_editor_cat(CIS_SpecOps)
+		cost = 4
+
+		weapons[]=
+		{
+			"JLTS_E5_shield",
+			"Throw",
+			"Put"
+		};
+		respawnWeapons[]=
+		{
+			"JLTS_E5_shield",
+			"Throw",
+			"Put"
+		};
+		magazines[]=
+		{
+			"JLTS_E5_mag",
+			"JLTS_E5_mag",
+			"JLTS_E5_mag",
+			macro_thermal_imp,
+			macro_thermal_imp,
+			macro_smoke,
+			macro_smoke,
+			macro_flashbang,
+			macro_flashbang,
+			macro_dioxis_grenade
+		};
+		respawnMagazines[]=
+		{
+			"JLTS_E5_mag",
+			"JLTS_E5_mag",
+			"JLTS_E5_mag",
+			macro_thermal_imp,
+			macro_thermal_imp,
+			macro_smoke,
+			macro_smoke,
+			macro_flashbang,
+			macro_flashbang,
+			macro_dioxis_grenade
+		};
+		linkeditems[]=
+		{
+			"ItemGPS",
+			"ItemMap",
+			"ItemCompass",
+			"ItemWatch",
+			"JLTS_droid_comlink",
+			"JLTS_NVG_droid_chip_1"
+		};
+		respawnlinkeditems[]=
+		{
+			"ItemGPS",
+			"ItemMap",
+			"ItemCompass",
+			"ItemWatch",
+			"JLTS_droid_comlink",
+			"JLTS_NVG_droid_chip_1"
+		};
+		items[]={
+			_3(macro_zip_tie)
+		};
+		respawnItems[]={
+			_3(macro_zip_tie)
+		};
+    };
 }

+ 3 - 0
addons - Copy/RD501_Main/XEH_preInit.sqf

@@ -155,4 +155,7 @@ macro_prep_xeh(fired_deployable\fnc_fired_deployable_deployServer.sqf,fired_depl
 macro_prep_xeh(fired_deployable\fnc_fired_deployable_loopSoundLocal.sqf,fired_deployable_loopSoundLocal)
 macro_prep_xeh(fired_deployable\fnc_fired_deployable_endSoundLocal.sqf,fired_deployable_endSoundLocal)
 
+// Droideka Shield
+macro_prep_xeh(init\deka_shield_init.sqf,deka_shield_init)
+
 diag_log "RD501 PREP Complete";

+ 24 - 0
addons - Copy/RD501_Main/functions/init/deka_shield_init.sqf

@@ -0,0 +1,24 @@
+params ["_unit"];
+
+private _hitEH = _unit addEventHandler ["HitPart", { 
+	(_this select 0) params ["_target", "_shooter", "_projectile", "_position", "_velocity", "_selection", "_ammo", "_vector", "_radius", "_surfaceType", "_isDirect"];
+	[{
+		params["_unit"];
+		private _ehId = _unit getVariable ["rd501_dekashield_hitEH", -1];
+		if(alive _unit && _ehId != -1) then {
+			private _position = getPosATL _unit;
+			private _shield = "RD501_Droideka_Shield" createVehicle _position;
+			_unit setVariable ["rd501_dekashield_attached", _shield, true];
+			_shield setPosATL _position;
+			_shield attachTo [_unit, [0,0,0]];
+			[{
+				params["_shield"];
+				deleteVehicle _shield;
+			}, [_shield], 60] call CBA_fnc_waitAndExecute;
+			_unit setVariable ["rd501_dekashield_hitEH", -1, true];
+			_unit removeEventHandler ["", _ehId];
+		};
+	}, [_target], 1] call CBA_fnc_waitAndExecute;
+}];
+
+_unit setVariable ["rd501_dekashield_hitEH", _hitEH, false];

+ 18 - 2
addons - Copy/RD501_Vehicles/land/droideka/config.cpp

@@ -13,7 +13,8 @@ class CfgPatches
 		requiredVersion=0.1;
 		units[]=
 		{
-			macro_new_vehicle(droideka,base)
+			macro_new_vehicle(droideka,base),
+			macro_new_vehicle(droideka,normal)
 		};
 		weapons[]=
 		{
@@ -59,6 +60,21 @@ class CfgVehicles
 			};
 		};
 	};
-
+	class macro_new_vehicle(droideka,normal): macro_new_vehicle(droideka,base)
+	{
+		displayName = "Droideka (Moveable)";
+		forceInGarage = 0;
+	};
 
 };
+
+class Extended_Init_EventHandlers
+{
+	class macro_new_vehicle(droideka,base)
+	{
+		class rd501_deka_shield
+		{
+			init = "_this call rd501_fnc_deka_shield_init";
+		};
+	};
+}

+ 35 - 1
addons - Copy/RD501_Vehicles/static/shields/config.cpp

@@ -19,7 +19,8 @@ class CfgPatches
 		units[]=
 		{
 			"RD501_Squad_Shield",
-			"RD501_Squad_Shield_trench"
+			"RD501_Squad_Shield_trench",
+			"RD501_Droideka_Shield"
 		};
 		weapons[]=
 		{
@@ -78,6 +79,39 @@ class CfgVehicles
 		displayName="Trench Shield";
 		model="\RD501_Vehicles\static\shields\trench\trench.p3d";
 		icon="iconObject_1x1";
+		rd501_fired_deployable_loopSound = "rd501_squad_shield_loop";
+		rd501_fired_deployable_loopDuration = 14;
+		rd501_fired_deployable_endSound = "rd501_squad_shield_end";
+		rd501_fired_deployable_endDuration = 1;
+		rd501_fired_deployable_soundDistance = 150;
+		vehicleClass = macro_editor_vehicle_type(statics)
+		editorCategory =  macro_editor_cat(statics)
+		editorSubcategory = macro_editor_cat(static_msc)
+	};
+	class RD501_Droideka_Shield: Land_House_Small_03_V1_ruins_F
+	{
+		author="$STR_A3_Bohemia_Interactive";
+		mapSize=21.1;
+		class SimpleObject
+		{
+			eden=0;
+			animate[]={};
+			hide[]={};
+			verticalOffset=-0.023;
+			verticalOffsetWorld=0;
+			init="''";
+		};
+		editorPreview="\A3\EditorPreviews_F\Data\CfgVehicles\Land_House_Small_03_V1_ruins_F.jpg";
+		scope=2;
+		scopeCurator=2;
+		displayName="Trench Shield";
+		model="\RD501_Vehicles\static\shields\bubble\deka_shield.p3d";
+		icon="iconObject_1x1";
+		rd501_fired_deployable_loopSound = "rd501_squad_shield_loop";
+		rd501_fired_deployable_loopDuration = 14;
+		rd501_fired_deployable_endSound = "rd501_squad_shield_end";
+		rd501_fired_deployable_endDuration = 1;
+		rd501_fired_deployable_soundDistance = 200;
 		vehicleClass = macro_editor_vehicle_type(statics)
 		editorCategory =  macro_editor_cat(statics)
 		editorSubcategory = macro_editor_cat(static_msc)

BIN
addons - Copy/RD501_Vehicles/static/shields/trench/trench.p3d


+ 5 - 1
addons - Copy/RD501_Weapons/Grenades/config.cpp

@@ -98,7 +98,7 @@ class CfgWeapons
 	};
 	class Throw: GrenadeLauncher
 	{
-		muzzles[] += {"Shadow_Muzzle","Imploder_Muzzle","Thermaldet_Muzzle","Squad_Shield_Muzzle","Throwable_C_Type_Muzzle"};
+		muzzles[] += {"Shadow_Muzzle","Imploder_Muzzle","Thermaldet_Muzzle","Squad_Shield_Muzzle","Squad_Shield_Trench_Muzzle","Throwable_C_Type_Muzzle"};
 		class Shadow_Muzzle: ThrowMuzzle
 		{
 			magazines[] = {"RD501_BlueShadow_Grenade"};
@@ -115,6 +115,10 @@ class CfgWeapons
 		{
 			magazines[] = {macro_new_mag(squad_shield_sigma,1)};
 		};
+		class Squad_Shield_Trench_Muzzle: ThrowMuzzle
+		{
+			magazines[] = {macro_new_mag(squad_shield_alpha,1)};
+		};
 		class Throwable_C_Type_Muzzle: ThrowMuzzle
 		{
 			magazines[] = {macro_new_mag(throwable_c_type,1)};

+ 11 - 0
addons - Copy/RD501_Weapons/_ammo/config.cpp

@@ -305,6 +305,17 @@ class CfgAmmo
         rd501_fired_deployable_timeToLive = 60;
 		simulation="shotShell";
 	}
+	class macro_new_ammo(squad_shield_alpha) : 3AS_CoreDetonator_1RND
+	{
+		hit=0;
+		indirectHit=0;
+		indirectHitRange=0;
+		model="\RD501_Weapons\Grenades\data\icecream.p3d";
+		rd501_fired_deployable = 1;
+        rd501_fired_deployable_object = "RD501_Squad_Shield_trench";
+        rd501_fired_deployable_timeToLive = 120;
+		simulation="shotShell";
+	}
 ///////////////////////////////////////////////////////////////////////
 /////////////////////////Shotgun///////////////////////////////////////
 //////////////////////////////////////////////////////////////////////

+ 11 - 0
addons - Copy/RD501_Weapons/_mag/config.cpp

@@ -370,6 +370,17 @@ class CfgMagazines
 		descriptionShort = "Republic Thermal Imploder";
 		picture="\RD501_Weapons\_mag\data\rd501_icon_mag_imploder.paa";
 	};
+	class macro_new_mag(squad_shield_alpha,1):3AS_BaridumCore
+	{
+		author="RD501";
+		scope=2;
+		displayName = "Republic Squad Shield Alpha";
+		displayNameShort = "Squad Shield Alpha";
+		count=1;
+		ammo = macro_new_ammo(squad_shield_alpha)
+		descriptionShort = "Republic Thermal Imploder";
+		picture="\RD501_Weapons\_mag\data\rd501_icon_mag_imploder.paa";
+	};
 
 	////////////////////////////////////////////////////
 	/////////////Missile  Magazines/////////////////////