浏览代码

change LE impulse;
adjust magclamps;

thefloff 3 年之前
父节点
当前提交
b497df3dc1

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

@@ -148,6 +148,9 @@ macro_prep_xeh(jammer\fnc_jammerControlActions.sqf,jammerControlActions)
 macro_prep_xeh(impulse\fnc_impulseApply.sqf,impulseApply)
 macro_prep_xeh(impulse\fnc_impulseIncrease.sqf,impulseIncrease)
 macro_prep_xeh(impulse\fnc_impulseDecrease.sqf,impulseDecrease)
+macro_prep_xeh(impulse\fnc_impulseApply_LE.sqf,impulseApplyLE)
+macro_prep_xeh(impulse\fnc_impulseIncrease_LE.sqf,impulseIncreaseLE)
+macro_prep_xeh(impulse\fnc_impulseDecrease_LE.sqf,impulseDecreaseLE)
 
 // Fired Deployables
 macro_prep_xeh(fired_deployable\fnc_fired_deployable_firedHandler.sqf,fired_deployable_firedHandler)

+ 95 - 0
addons - Copy/RD501_Main/functions/impulse/fnc_impulseApply_LE.sqf

@@ -0,0 +1,95 @@
+_vehicle = _this;
+
+//systemChat "apply";
+
+private _impulse_state = _vehicle getvariable ["impulsorStatus", 0];
+
+private _target_speed = 0;
+private _max_change = 0;
+private _accelerate = True;
+private _decelerate = True;
+private _stage_message = "";
+
+switch (_impulse_state) do
+{
+	case -1:
+	{
+		_target_speed = 100;
+		_max_change = 10;
+		_accelerate = False;
+		_stage_message = format["%1 kph", _target_speed];
+	};
+	case 0:
+	{
+		_target_speed = 0;
+		_max_change = 0;
+		_accelerate = False;
+		_decelerate = False;
+		_stage_message = "neutral";
+	};
+	case 1:
+	{
+		_target_speed = 200;
+		_max_change = 10;
+		_decelerate = False;
+		_stage_message = format["%1 kph", _target_speed];
+	};
+	case 2:
+	{
+		_target_speed = 400;
+		_max_change = 20;
+		_stage_message = format["%1 kph", _target_speed];
+	};
+	case 3:
+	{
+		_target_speed = 700;
+		_max_change = 30;
+		_stage_message = format["%1 kph", _target_speed];
+	};
+	default
+	{
+		hint "ERROR";
+	};
+};
+
+_titlehintimpulsor  = "<t color='#253f5c' size='2' shadow='1' shadowColor='#000000' align='center'>IMPULSOR</t>";
+_texthintimpulsor   = format ["<br /><t color='#ffffff' size='1.4' shadow='1' shadowColor='#000000' align='center'>Stage %1 - %2</t>", _impulse_state, _stage_message];
+hint parseText (_titlehintimpulsor+_texthintimpulsor);
+
+if (!_accelerate && !_decelerate) exitWith{};
+while {_vehicle getVariable ['impulsorStatus', 0] isEqualTo _impulse_state && alive _vehicle} do
+{
+	private _movement = velocity _vehicle;
+	private _velocity = speed _vehicle;
+	private _diff = _target_speed - _velocity;
+	private _change = 0;
+	
+	if (abs _diff < _max_change) then {
+		_change = _diff;
+	} else {
+		if (_diff < 0) then {
+			_change = -_max_change;
+		} else {
+			_change = _max_change;
+		};
+	};
+
+	if (_change > 0 && !_accelerate) then {
+		_change = 0;
+	};
+	if (_change < 0 && !_decelerate) then {
+		_change = 0;
+	};
+
+	// systemChat format ["%1 - %2 - %3 - %4 - %5", str _velocity, str _target_speed, str _diff, str _max_change, str _change];
+
+	if (_change != 0) then {
+		private _direction = vectorDir _vehicle;
+		_vehicle setVelocity [
+			(_movement select 0) + (_direction select 0) * _change, 
+			(_movement select 1) + (_direction select 1) * _change, 
+			(_movement select 2) + (_direction select 2) * _change
+			];
+	};
+	sleep 0.5;
+};

+ 13 - 0
addons - Copy/RD501_Main/functions/impulse/fnc_impulseDecrease_LE.sqf

@@ -0,0 +1,13 @@
+_vehicle = _this;
+
+//systemChat "decrease";
+
+private _impulse_state = _vehicle getvariable ["impulsorStatus", 0];
+_impulse_state = _impulse_state - 1;
+if (_impulse_state < -1) then
+{
+	_impulse_state = -1;
+};
+_vehicle setvariable ["impulsorStatus", _impulse_state, true];
+
+_this call rd501_fnc_impulseApplyLE;

+ 14 - 0
addons - Copy/RD501_Main/functions/impulse/fnc_impulseIncrease_LE.sqf

@@ -0,0 +1,14 @@
+_vehicle = _this;
+
+//systemChat "increase";
+
+private _impulse_state = _vehicle getvariable ["impulsorStatus", 0];
+if (speed _this < 10 && _impulse_state != -1) exitWith {};
+_impulse_state = _impulse_state + 1;
+if (_impulse_state > 3) then
+{
+	_impulse_state = 3;
+};
+_vehicle setvariable ["impulsorStatus", _impulse_state, true];
+
+_this call rd501_fnc_impulseApplyLE;

+ 5 - 2
addons - Copy/RD501_Vehicles/air/LAAT/config.cpp

@@ -294,6 +294,9 @@ class CfgVehicles
 		author="RD501";
 		forceInGarage = 1;
 
+		RD501_magclamp_large_offset[] = {0.0, 0.0, -3.5};
+		RD501_magclamp_small_offset[] = {0.0, 0.0, -3.5};
+
 		faction = macro_republic_faction
 		editorSubcategory = macro_editor_cat_air(Republic_heli)
 		vehicleClass = macro_editor_vehicle_type_air(Republic)
@@ -310,7 +313,7 @@ class CfgVehicles
 				priority = 0;
 				onlyForPlayer = 1;
 				condition = "((player == driver this) AND (alive this))";
-				statement = "this execVM ""\RD501_Main\functions\impulse\fnc_impulseIncrease.sqf""";
+				statement = "this execVM ""\RD501_Main\functions\impulse\fnc_impulseIncrease_LE.sqf""";
 				shortcut="User19"
 			};
 
@@ -321,7 +324,7 @@ class CfgVehicles
 				displayNameDefault = "";
 				textToolTip = "";
 				condition = "((player == driver this) AND (alive this))";
-				statement = "this execVM ""\RD501_Main\functions\impulse\fnc_impulseDecrease.sqf""";
+				statement = "this execVM ""\RD501_Main\functions\impulse\fnc_impulseDecrease_LE.sqf""";
 				shortcut="User20"
 			};
 		};

+ 3 - 0
addons - Copy/RD501_Vehicles/air/V19/config.cpp

@@ -52,6 +52,9 @@ class CfgVehicles
 		irTarget = 1;
 		irTargetSize = 1;
 		countermeasureActivationRadius = 2000;
+		
+		RD501_magclamp_large_offset[] = {0.0, 0.0, -6.0};
+		RD501_magclamp_small_forbidden = 1;
 
 		//flight model
 		maxSpeed=1100;

+ 3 - 0
addons - Copy/RD501_Vehicles/land/MASH/config.cpp

@@ -34,6 +34,9 @@ class CfgVehicles
 		forceInGarage = 1;
 		side = 1;
 
+		RD501_magclamp_large_offset[] = {0.0, 0.0, -2.0};
+		RD501_magclamp_small_offset[] = {0.0, 2.0, -2.0};
+
 		faction = macro_republic_faction
 		editorSubcategory = macro_editor_cat(Transport)
 		vehicleClass = macro_editor_vehicle_type(Transport)

+ 41 - 0
addons - Copy/RD501_Vehicles/land/RTT/config.cpp

@@ -0,0 +1,41 @@
+#include "../../../RD501_main/config_macros.hpp"
+
+class CfgPatches
+{
+	class macro_patch_name(rtt)
+	{
+		addonRootClass=macro_patch_name(vehicles)
+
+		requiredAddons[]=
+		{
+			macro_patch_name(vehicles)
+		};
+		requiredVersion=0.1;
+		units[]=
+		{
+			macro_new_vehicle(gar,rtt)
+		};
+		weapons[]={};
+	};
+};
+
+class CfgVehicles
+{
+    class 3as_RTT_Base;
+    class macro_new_vehicle(gar,rtt): 3as_RTT_Base {
+            side = 1;
+		    scope = 2;
+		    scopeCurator = 2;
+		    displayName = "Republic RTT";
+		    forceInGarage = 1;
+            faction = macro_republic_faction
+            editorSubcategory = macro_editor_cat(APC)
+            vehicleClass = macro_editor_vehicle_type(APC)
+
+            RD501_magclamp_large_offset[] = {0.0, 0.0, -4.0};
+            RD501_magclamp_small_offset[] = {0.0, 0.0, -4.0};
+
+            hiddenSelections[] = {"camo1"};
+            hiddenSelectionsTextures[] = {"3as\3as_rtt\data\rtt\exterior_CO.paa"};
+    };
+};