123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- params [
- ["_target", objNull, [objNull]],
- ["_beamColour", [1,0.6,0.2], [[]]],
- ["_debrisColour", [0.3, 0.27, 0.15], [[]]]
- ];
- if (isNull _target) exitWith {systemChat "Invalid position given for beam target! Exited";};
- if (count _beamColour < 3) then {_beamColour = [1,0.6,0.2]; systemChat "Invalid colour given for beam, default used instead";};
- if (count _debrisColour < 3) then {_debrisColour = [0.3, 0.27, 0.15]; systemChat "Invalid colour given for beam debris, default used instead";};
- private _maxKillRange = 200;
- private _maxDamageRange = 400;
- private _targetPos = getPosATL _target;
- private _impactEmitter = "Land_HelipadEmpty_F" createVehicleLocal _targetPos;
- private _beamEmitter = "Land_Battery_F" createVehicleLocal _targetPos;
- _beamEmitter setPosATL [_targetPos#0, _targetPos#1, 2000];
- _beamEmitter setVelocity [0,0,-600];
- _flash = "#lightpoint" createVehicleLocal (getpos _beamEmitter);
- _flash setLightBrightness 300;
- _flash setLightAmbient _beamColour;
- _flash setLightColor _beamColour;
- _flash lightAttachObject [_beamEmitter, [0,0,200]];
- _flash spawn {sleep 0.1; deleteVehicle _this;};
- [_beamEmitter, _beamColour, _targetPos] spawn tts_beam_fnc_rayParticles;
- waitUntil {sleep 0.01; ((getPosATL _beamEmitter)#2 < 750)};
- _impactEmitter say3D ["laser", 20000, 1, false];
- waitUntil {sleep 0.01; vectorMagnitude (velocity _beamEmitter) < 20 || _beamEmitter distance _targetPos < 5 || (getPosATL _beamEmitter)#2 < 5};
- _impactEmitter say3D ["laser_impact", 20000, 1, false];
- _impactEmitter setPosATL (getPosATL _beamEmitter);
- deleteVehicle _beamEmitter;
- if (isServer) then {[_impactEmitter, _maxKillRange, _maxDamageRange] spawn tts_beam_fnc_explosionDamage;};
- [_impactEmitter, _debrisColour] spawn tts_beam_fnc_explosionParticles;
- [_target] spawn tts_beam_fnc_postProcessEffects;
- sleep 30;
- deleteVehicle _impactEmitter;
|