improve earthquake event

This commit is contained in:
vbawol 2017-08-30 16:38:48 -05:00
parent c89dffa1d0
commit ff4471552a

View File

@ -11,26 +11,24 @@ private ["_chance","_item","_marker","_minerals","_playersNearEpicenter","_posit
_position = [epoch_centerMarkerPosition, 0, EPOCH_dynamicVehicleArea, 10, 0, 1000, 0] call BIS_fnc_findSafePos;
if ((count _position) == 2) then{
_playersNearEpicenter = _position nearEntities[["Epoch_Male_F", "Epoch_Female_F"], 1000];
if !(_playersNearEpicenter isEqualTo[]) then{
// decrease chance with more players
_chance = linearConversion [1, 100, (count allPlayers), 0, 0.5, true];
if ((random 1) > _chance) then {
// decrease chance with more players
_chance = linearConversion [1, 100, (count allPlayers), 0, 0.5, true];
if ((random 1) > _chance) then {
if !(_playersNearEpicenter isEqualTo[]) then{
// send earthquake to each player in zone
{
[_position] remoteExec ['EPOCH_client_earthQuake',_x];
}forEach _playersNearEpicenter;
[_position] remoteExec ['EPOCH_client_earthQuake',_playersNearEpicenter];
};
// todo configize
_minerals = ["MineralDepositCopper_EPOCH", "MineralDepositGold_EPOCH", "MineralDepositSilver_EPOCH"];
_item = createVehicle[(selectRandom _minerals), _position, [], 0.0, "CAN_COLLIDE"];
if (EPOCH_showEarthQuakes) then{
_marker = createMarker[str(_position), _position];
_marker setMarkerShape "ICON";
_marker setMarkerType "mil_dot";
// _marker setMarkerText "Mineral";
_marker setMarkerColor "ColorGrey";
};
// Mineral veins
_minerals = ["MineralDepositCopper_EPOCH", "MineralDepositGold_EPOCH", "MineralDepositSilver_EPOCH"];
_item = createVehicle[(selectRandom _minerals), _position, [], 0.0, "CAN_COLLIDE"];
if (EPOCH_showEarthQuakes) then{
_marker = createMarker[str(_position), _position];
_marker setMarkerShape "ICON";
_marker setMarkerType "hd_objective";
// _marker setMarkerText "Mineral";
_marker setMarkerColor "ColorGrey";
};
};
};