mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge pull request #2463 from acemod/cleanupNightvision
Cleanup Nightvision
This commit is contained in:
commit
4cc9b91d68
@ -23,25 +23,22 @@
|
|||||||
|
|
||||||
if (!hasInterface) exitWith {};
|
if (!hasInterface) exitWith {};
|
||||||
|
|
||||||
private ["_vehicle", "_weapon", "_ammo", "_magazine", "_player"];
|
params ["_vehicle", "_weapon", "", "", "_ammo", "_magazine"];
|
||||||
|
|
||||||
_vehicle = _this select 0;
|
|
||||||
_weapon = _this select 1;
|
|
||||||
_ammo = _this select 4;
|
|
||||||
_magazine = _this select 5;
|
|
||||||
|
|
||||||
|
private "_player";
|
||||||
_player = ACE_player;
|
_player = ACE_player;
|
||||||
|
|
||||||
//If our vehicle didn't shoot, or we're not in NVG mode, exit
|
//If our vehicle didn't shoot, or we're not in NVG mode, exit
|
||||||
if ((_vehicle != (vehicle _player)) || {(currentVisionMode _player) != 1}) exitWith {};
|
if ((_vehicle != (vehicle _player)) || {(currentVisionMode _player) != 1}) exitWith {};
|
||||||
//If we are mounted, and it wasn't our weapon system that fired, exit
|
//If we are mounted, and it wasn't our weapon system that fired, exit
|
||||||
if (_player != _vehicle && {!(_weapon in (_vehicle weaponsTurret ([_player] call EFUNC(common,getTurretIndex))))}) exitWith {};
|
if (_player != _vehicle && {!(_weapon in (_vehicle weaponsTurret ([_player] call EFUNC(common,getTurretIndex))))}) exitWith {};
|
||||||
|
|
||||||
private ["_silencer", "_visibleFireCoef", "_visibleFireTimeCoef", "_visibleFire", "_visibleFireTime", "_nvgBrightnessCoef", "_fnc_isTracer", "_darkness"];
|
private["_darkness", "_nvgBrightnessCoef", "_silencer", "_visibleFire", "_visibleFireCoef", "_visibleFireTime", "_visibleFireTimeCoef"];
|
||||||
|
|
||||||
_silencer = switch (_weapon) do {
|
_silencer = switch (_weapon) do {
|
||||||
case (primaryWeapon _player) : {primaryWeaponItems _player select 0};
|
case (primaryWeapon _player): {(primaryWeaponItems _player) select 0};
|
||||||
case (secondaryWeapon _player) : {secondaryWeaponItems _player select 0};
|
case (secondaryWeapon _player): {(secondaryWeaponItems _player) select 0};
|
||||||
case (handgunWeapon _player) : {handgunItems _player select 0};
|
case (handgunWeapon _player): {(handgunItems _player) select 0};
|
||||||
default {""};
|
default {""};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -83,7 +80,7 @@ _darkness = 1 - (call EFUNC(common,ambientBrightness));
|
|||||||
_visibleFire = _darkness * _visibleFireCoef * _visibleFire * _nvgBrightnessCoef / 10 min 1;
|
_visibleFire = _darkness * _visibleFireCoef * _visibleFire * _nvgBrightnessCoef / 10 min 1;
|
||||||
_visibleFireTime = _darkness * _visibleFireTimeCoef * _visibleFireTime * _nvgBrightnessCoef / 10 min 0.5;
|
_visibleFireTime = _darkness * _visibleFireTimeCoef * _visibleFireTime * _nvgBrightnessCoef / 10 min 0.5;
|
||||||
|
|
||||||
// ["NightVision", [_visibleFire, _visibleFireTime], {format ["visibleFire: %1 - visibleFireTime: %2", _this select 0, _this select 1]}] call AGM_Debug_fnc_log; //todo
|
TRACE_2("Player Shot, Adjusting NVG Effect", _visibleFire, _visibleFireTime);
|
||||||
|
|
||||||
GVAR(ppEffectMuzzleFlash) ppEffectAdjust [1, 1, _visibleFire, [0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1]];
|
GVAR(ppEffectMuzzleFlash) ppEffectAdjust [1, 1, _visibleFire, [0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1]];
|
||||||
GVAR(ppEffectMuzzleFlash) ppEffectCommit 0;
|
GVAR(ppEffectMuzzleFlash) ppEffectCommit 0;
|
||||||
|
@ -16,10 +16,12 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
if (!hasInterface) exitWith {};
|
params ["_player", "_changeInBrightness"];
|
||||||
|
TRACE_2("params",_player,_changeInBrightness);
|
||||||
|
|
||||||
private ["_brightness"];
|
private ["_brightness"];
|
||||||
|
|
||||||
PARAMS_2(_player,_changeInBrightness);
|
if (!hasInterface) exitWith {};
|
||||||
|
|
||||||
_brightness = _player getVariable [QGVAR(NVGBrightness), 0];
|
_brightness = _player getVariable [QGVAR(NVGBrightness), 0];
|
||||||
|
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
#define COMPONENT nightvision
|
#define COMPONENT nightvision
|
||||||
#include "\z\ace\addons\main\script_mod.hpp"
|
#include "\z\ace\addons\main\script_mod.hpp"
|
||||||
|
|
||||||
|
// #define DEBUG_MODE_FULL
|
||||||
|
|
||||||
#ifdef DEBUG_ENABLED_NIGHTVISION
|
#ifdef DEBUG_ENABLED_NIGHTVISION
|
||||||
#define DEBUG_MODE_FULL
|
#define DEBUG_MODE_FULL
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user