atteBase.sqf 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. //----------
  2. //Now this file is called in the init.sqf. Thus whenever the the atteTypeSelector is executed and the at-te from there is spawned,this is ran
  3. //general script
  4. rexiAtteBase={
  5. params["_vic"];
  6. _rexiHasBeenModded= _vic getVariable ["modded", false];
  7. //adds the ability to check how much dmg the at-te has taken
  8. _vic addAction ["<t color='#00FF00'>Hull Damage Report</t>",
  9. {
  10. hint parseText format["<t color='#0099FF'> Hull Integrity is :%1%2</t>",((1-(damage (_this select 0)))*100),"%"];
  11. }];
  12. _vic removeAllEventHandlers "Fired";
  13. //ads repair function
  14. _vic addAction ["<t color='#FC6F07'>Repair</t>",
  15. {
  16. [_this select 0] execVM "scripts\zeus3denScripts\vehicleBased\actionMenu\Repair\repairTo65.sqf";
  17. }];
  18. //handles reducing dmg taken by at-te
  19. _vic addeventhandler ["HandleDamage",
  20. {
  21. _rexiUnit = _this select 0;
  22. _rexiSelection = _this select 1;
  23. _rexiPassedDamage = _this select 2;
  24. _rexiOldDamage = 0;
  25. _rexiDmgScaleFactor=3;
  26. switch(_rexiSelection)do{
  27. case(""):{_rexiOldDamage = damage _rexiUnit;};
  28. default{};
  29. };
  30. _rexiReturn = _rexiOldDamage + ((_rexiPassedDamage - _rexiOldDamage) / _rexiDmgScaleFactor);
  31. _rexiReturn
  32. }];
  33. //Removes the standard weapon and replaces it with a 120mm cannon
  34. _vic removeWeaponTurret ["Cannon_ATTE", [0]];
  35. _vic addWeaponTurret ["cannon_120mm", [0]];
  36. for [{_i=0}, {_i<(5)}, {_i=_i+1}] do
  37. {
  38. _vic addMagazineTurret ["32Rnd_120mm_APFSDS_shells_Tracer_Green" ,[0]];
  39. };
  40. };//end at-te Base
  41. //Add repair ability to turrets and makes it so that they cant die 100%,just disabled
  42. UAVT={
  43. params["_vic"];
  44. comment "ADDS REPAIR";
  45. _vic addAction ["<t color='#47FF1A'>Repair Turret</t>",
  46. {[_this select 0] execVM "scripts\zeus3denScripts\vehicleBased\actionMenu\Repair\repairTo65.sqf";}];
  47. _vic addEventHandler ["HandleDamage", {
  48. _damage = _this select 2;
  49. if ( (_this select 1 == "") and (_damage > 0.75) ) then
  50. {
  51. _damage = 0.75;
  52. }
  53. else
  54. {
  55. };
  56. _damage;
  57. }];
  58. };
  59. ["B_HMG_01_A_F", "init",UAVT, true, [], true] call CBA_fnc_addClassEventHandler;
  60. ["Republic_ATTE", "init",rexiAtteBase, true, [], true] call CBA_fnc_addClassEventHandler;