123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- //----------
- //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
- //Function that makes at-te gun do more dmg
- rexiAtteBulMux={
-
-
- _rexiUnit = (_this select 0);
- _rexiProjType = _this select 4;
- _rexiProjectile = _this select 6;
- _rexiUp = vectorUp _rexiProjectile;
- _rexiProjPos = getPosASL _rexiProjectile;
- _RexiDist=1;
- for "_i" from 1 to 4 do {
-
- _rexiO = _rexiProjType createVehicle _rexiProjPos;
- _rexiO setPosASL [
- (_rexiProjPos select 0) + ((vectorDir _rexiUnit) select 0)*(_RexiDist),
- (_rexiProjPos select 1) + ((vectorDir _rexiUnit) select 1)*(_RexiDist),
- (_rexiProjPos select 2) + ((vectorDir _rexiUnit) select 2)*(_RexiDist)
- ];
- _rexiO setVectorDirAndUp[(vectorDir _rexiUnit),_rexiUp];
- _rexiO setVelocity velocity _rexiProjectile;
- };
-
- };//end at-te bul mux
- //general script
- rexiAtteBase={
- params["_vic"];
-
- _rexiHasBeenModded= _vic getVariable ["modded", false];
-
- //adds the ability to check how much dmg the at-te has taken
- _vic addAction ["<t color='#00FF00'>Hull Damage Report</t>",
- {
- hint parseText format["<t color='#0099FF'> Hull Integrity is :%1%2</t>",((1-(damage (_this select 0)))*100),"%"];
- },[1],0,false,true,""," commander _target == _this "];
-
-
- _vic removeAllEventHandlers "Fired";
-
- //ads repair function
- _vic addAction ["<t color='#FC6F07'>Repair</t>",
- {
- [_this select 0] execVM "scripts\zeus3denScripts\vehicleBased\actionMenu\Repair\repairTo65.sqf";
- }];
- //handles reducing dmg taken by at-te
- _vic addeventhandler ["HandleDamage",
- {
- _rexiUnit = _this select 0;
- _rexiSelection = _this select 1;
- _rexiPassedDamage = _this select 2;
- _rexiOldDamage = 0;
- _rexiDmgScaleFactor=3;
- switch(_rexiSelection)do{
- case(""):{_rexiOldDamage = damage _rexiUnit;};
- default{};
- };
- _rexiReturn = _rexiOldDamage + ((_rexiPassedDamage - _rexiOldDamage) / _rexiDmgScaleFactor);
- _rexiReturn
- }];
- };//end at-te Base
- ["Republic_ATTE", "init",rexiAtteBase, true, [], true] call CBA_fnc_addClassEventHandler;
- ["Republic_ATTE", "fired",rexiAtteBulMux] call CBA_fnc_addClassEventHandler;
|