Skip to content

Commit

Permalink
civ hint timer
Browse files Browse the repository at this point in the history
  • Loading branch information
nomisum committed Mar 15, 2016
1 parent 61cc991 commit dd853d4
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions player/civKilledMarker.sqf
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
_pos = _this select 0;
_delay = 120; // 120 default


showCivKilledHint = {
playSound "signal_lost";
Expand All @@ -15,5 +17,20 @@ createCivKilledMarker = {
diag_log format ["CivKills: Marker %1 created", _marker];
};

_closesttown = (nearestLocations [_pos,["NameCityCapital","NameCity","NameVillage"],10000]) select 0;

if (count _closesttown > 0) then {
_town_pos = position _closesttown;
_distance = floor (_town_pos distance _pos);
_delay = _distance / 5;
};

diag_log format ["distance of killed civ to next town %2 is %1, delay is %3 secs.",_distance,text _closesttown,_delay];




sleep _delay;

[_pos] call createCivKilledMarker;
call showCivKilledHint;

0 comments on commit dd853d4

Please sign in to comment.