-
Notifications
You must be signed in to change notification settings - Fork 345
/
powerReorg.sqf
88 lines (85 loc) · 2.52 KB
/
powerReorg.sqf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
private ["_marcador","_ciudad","_pos","_power","_datos","_powered","_numCiv","_numVeh","_roads","_prestigeOPFOR","_prestigeBLUFOR","_sitio"];
_marcador = _this select 0;
{
_ciudad = _x;
_pos = getMarkerPos _x;
_power = [power,_pos] call BIS_fnc_nearestPosition;
_powered = true;
if (_power == _marcador) then
{
//_datos = server getVariable _ciudad;
if (_marcador in destroyedCities) then
{
_powered = false;
//[-10,-10,_pos] remoteExec ["A3A_fnc_citySupportChange",2];
}
else
{
//_powered = _datos select 4;
if (lados getVariable [_marcador,sideUnknown] == buenos) then
{
if (lados getVariable [_ciudad,sideUnknown] == buenos) then
{
//hint format ["You achieved to bring power to %1, more people there supports our cause",_ciudad];
//[-10,10,_pos] remoteExec ["A3A_fnc_citySupportChange",2];
_nul = [5,0] remoteExec ["A3A_fnc_prestige",2];
}
else
{
//hint format ["You cutted off power to %1, less people support AAF there",_ciudad];
//[-10,0,_pos] remoteExec ["A3A_fnc_citySupportChange",2];
_nul = [-5,0] remoteExec ["A3A_fnc_prestige",2];
_powered = false;
};
}
else
{
if (lados getVariable [_ciudad,sideUnknown] == buenos) then
{
//hint format ["AAF has cut off power to %1, less people there supports our cause",_ciudad];
//[0,-10,_pos] remoteExec ["A3A_fnc_citySupportChange",2];
_nul = [5,0] remoteExec ["A3A_fnc_prestige",2];
_powered = false;
};
};
};
[_ciudad,_powered] spawn A3A_fnc_apagon;
};
} forEach ciudades;
_marcadores = fabricas recursos;
{
_sitio = _x;
_pos = getMarkerPos _x;
_power = [power,_pos] call BIS_fnc_nearestPosition;
_powered = true;
if (_power == _marcador) then
{
if (_marcador in destroyedCities) then
{
_powered = false;
//[-10,-10,_pos] remoteExec ["A3A_fnc_citySupportChange",2];
}
else
{
if (lados getVariable [_marcador,sideUnknown] == buenos) then
{
if (lados getVariable [_sitio,sideUnknown] == malos) then
{
//_ciudad = [ciudades,_pos] call BIS_fnc_nearestPosition;
//hint format ["You cutted off power to AAF resources near %1. They will be less productive from now",_ciudad];
_powered = false;
};
}
else
{
if (lados getVariable [_sitio,sideUnknown] == buenos) then
{
//_ciudad = [ciudades,_pos] call BIS_fnc_nearestPosition;
//hint format ["AAF cutted off power supply to our resources near %1. They will be less productive from now",_ciudad];
_powered = false;
};
};
};
[_sitio,_powered] spawn A3A_fnc_apagon;
};
} forEach _marcadores;