-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from SilenceIsFatto/release-candidate
Add more logging, update firedNear, RPG reveal
- Loading branch information
Showing
7 changed files
with
91 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
hatg/addons/functions/functions/conditions/fn_getDetectionDistance.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
Author: | ||
Silence | ||
Description: | ||
Checks all the different factors in detection distance, returns the result | ||
Params: | ||
_unit <OBJECT> | ||
_stance <STRING> | ||
Dependencies: | ||
global variables: | ||
> hatg_setting_distance_close <INT> | ||
> hatg_setting_distance_close_multiplier <INT> | ||
Usage: | ||
[player, "PRONE"] call HATG_fnc_getDetectionDistance; | ||
Return: | ||
_distanceClose <FLOAT> | ||
*/ | ||
|
||
params ["_unit", ["_stance", "PRONE"]]; | ||
|
||
private _distanceClose = hatg_setting_distance_close; | ||
private _distanceCloseMultiplier = hatg_setting_distance_close_multiplier; | ||
|
||
// Can't think of a better way to do these if statements, there will be a more efficient way. Brain doesn't brain rn | ||
if (hatg_setting_simple) then { | ||
_distanceClose = 10; | ||
_distanceCloseMultiplier = 2; | ||
}; | ||
|
||
if (_stance == "CROUCH") then { | ||
_distanceClose = _distanceClose * _distanceCloseMultiplier; | ||
}; | ||
|
||
if (_stance == "STAND") then { | ||
_distanceClose = _distanceClose * (_distanceCloseMultiplier * 2); | ||
}; | ||
|
||
// Can't exactly merge these into 1 statement since the effects are meant to stack | ||
if (call HATG_fnc_isNight) then { | ||
_distanceClose = _distanceClose / 2; | ||
}; | ||
|
||
if (call HATG_fnc_isRaining) then { | ||
_distanceClose = _distanceClose / 2; | ||
}; | ||
|
||
if (call HATG_fnc_isFoggy) then { | ||
_distanceClose = _distanceClose / 2; | ||
}; | ||
|
||
if ([_unit] call HATG_fnc_isInBuilding) then { | ||
_distanceClose = _distanceClose / 2; | ||
}; | ||
|
||
if ([_unit] call HATG_fnc_hasGhillie) then { // ghillie should ideally have no benefit if standing | ||
_distanceClose = _distanceClose / 2; | ||
}; | ||
|
||
_distanceClose = _distanceClose max 5; | ||
|
||
_distanceClose; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
if (fog >= 0.6) exitWith {true}; | ||
if (fog >= 0.3) exitWith {true}; | ||
|
||
[format["Fog Level: %1", fog], 3, _fnc_scriptName] call HATG_fnc_log; | ||
|
||
false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
if (rain >= 0.6) exitWith {true}; | ||
if (rain >= 0.3) exitWith {true}; | ||
|
||
[format["Rain Level: %1", rain], 3, _fnc_scriptName] call HATG_fnc_log; | ||
|
||
false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters