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