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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
|
/*%FSM<COMPILE "E:\Bohemia Interactive\ArmA 2\FSM Editor Personal Edition\scriptedFSM.cfg, updatecamp">*/
/*%FSM<HEAD>*/
/*
item0[] = {"Init",0,250,-63.253571,-299.618378,26.746418,-249.618469,0.000000,"Init"};
item1[] = {"End",1,250,-182.368073,-113.480629,-92.368042,-63.480659,0.000000,"End"};
item2[] = {"Gameover",4,218,-182.650177,-187.482422,-92.650192,-137.482452,0.000000,"Gameover"};
item3[] = {"_",8,218,-34.448154,-230.434799,-2.642141,-207.859543,0.000000,""};
item4[] = {"Camp_Core",2,250,-63.405182,-187.376434,26.594841,-137.376434,0.000000,"Camp Core"};
item5[] = {"Camp_Advanced",2,4346,-64.617218,-39.786873,25.382790,10.213146,0.000000,"Camp" \n "Advanced"};
item6[] = {"Empty",4,218,57.329758,-187.310150,147.329803,-137.310150,0.000000,"Empty"};
item7[] = {"Not_Empty",4,218,-63.807266,-111.064079,26.192720,-61.064079,0.000000,"Not Empty"};
item8[] = {"Capture",4,218,-182.872635,-39.579437,-92.872635,10.420566,0.000000,"Capture"};
item9[] = {"Skip",4,218,57.688011,-38.769463,147.687988,11.230536,0.000000,"Skip"};
item10[] = {"",7,210,215.273621,-222.741318,223.273621,-214.741318,0.000000,""};
item11[] = {"_",2,250,174.323486,-38.769455,264.323486,11.230541,0.000000,""};
item12[] = {"Capture",2,250,-301.937958,-38.769463,-211.937988,11.230541,0.000000,"Capture"};
item13[] = {"",7,210,-260.177917,-222.741318,-252.177872,-214.741318,0.000000,""};
link0[] = {0,3};
link1[] = {2,1};
link2[] = {3,4};
link3[] = {4,2};
link4[] = {4,6};
link5[] = {4,7};
link6[] = {5,8};
link7[] = {5,9};
link8[] = {6,11};
link9[] = {7,5};
link10[] = {8,12};
link11[] = {9,11};
link12[] = {10,3};
link13[] = {11,10};
link14[] = {12,13};
link15[] = {13,3};
globals[] = {0.000000,0,0,0,0,640,480,1,29,6316128,1,-374.429932,315.755920,137.483551,-318.334381,885,911,1};
window[] = {2,-1,-1,-1,-1,802,50,1435,50,3,903};
*//*%FSM</HEAD>*/
class FSM
{
fsmName = "updatecamp";
class States
{
/*%FSM<STATE "Init">*/
class Init
{
name = "Init";
init = /*%FSM<STATEINIT""">*/"_lastUpdate = -5;" \n
"" \n
"_camp = _this Select 0;" \n
"_town = _this Select 1;" \n
"_flag = _this Select 2;" \n
"" \n
"_delay = 3;" \n
"_timeToCapture = 0;" \n
"_townName = str _town;" \n
"_campName = Str _camp;" \n
"" \n
"_townSideID = _town getVariable ""sideID"";" \n
"_supply = _town getVariable ""supplyValue"";" \n
"_tcmode = 'WFBE_TOWNCONQUESTMODE' Call GetNamespace;" \n
"_lastSupply = _supply;" \n
"" \n
"_awaits = _delay;"/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "_">*/
class _
{
priority = 0.000000;
to="Camp_Core";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"time - _lastUpdate > _awaits"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "End">*/
class End
{
name = "End";
init = /*%FSM<STATEINIT""">*/""/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "Camp_Core">*/
class Camp_Core
{
name = "Camp_Core";
init = /*%FSM<STATEINIT""">*/"_lastUpdate = time + random(0.2);" \n
"" \n
"_objects = _camp NearEntities[""Man"",5];" \n
"_livingUnits = _objects Call GetLiveUnits;" \n
"_west = West CountSide _livingUnits;" \n
"_east = East CountSide _livingUnits;" \n
"" \n
"_awaits = (_delay) Call GetSleepFPS;"/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "Empty">*/
class Empty
{
priority = 0.000000;
to="_";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"_east == 0 && _west == 0 && !gameOver"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "Not_Empty">*/
class Not_Empty
{
priority = 0.000000;
to="Camp_Advanced";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"(_east != 0 || _west != 0) && !gameOver"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "Gameover">*/
class Gameover
{
priority = 0.000000;
to="End";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"gameOver"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "Camp_Advanced">*/
class Camp_Advanced
{
name = "Camp_Advanced";
init = /*%FSM<STATEINIT""">*/"_skip = false;" \n
"_capture = false;" \n
"" \n
"_sideID = _camp getVariable ""sideID"";" \n
"_supply = _town getVariable ""supplyValue"";" \n
"_timeToCapture = _camp getVariable ""supplyValue"";" \n
"_townSideID = _town getVariable ""sideID"";" \n
"" \n
"if (_tcmode > 0) then {" \n
" if (_west > 0 && !(_town getVariable ""wfbe_cancap_w"") && (_townSideID != WESTID)) then {_west = 0;_skip = true};" \n
" if (_east > 0 && !(_town getVariable ""wfbe_cancap_e"") && (_townSideID != EASTID)) then {_east = 0; _skip = true};" \n
"};" \n
"" \n
"_force = (_east + _west) * _delay;" \n
"if (_sideID == EASTID && _east > 0) then {_timeToCapture = _timeToCapture + _east};" \n
"if (_sideID == EASTID && _west > 0) then {_timeToCapture = _timeToCapture - _west};" \n
"if (_sideID == WESTID && _west > 0) then {_timeToCapture = _timeToCapture + _west};" \n
"if (_sideID == WESTID && _east > 0) then {_timeToCapture = _timeToCapture - _east};" \n
"if (_sideID != EASTID && _sideID != WESTID) then {_timeToCapture = _timeToCapture - _force};" \n
"if (_timeToCapture > _supply) then {_timeToCapture = _supply};" \n
"if (_timeToCapture <= 0) then {_skip = true;_capture = true};" \n
"if (!_skip) then {" \n
" if (_timeToCapture == _lastSupply && _force == 0 && _sideID == _townSideID) then {_timeToCapture = _supply};" \n
" _lastSupply = _supply;" \n
" if (_timeToCapture == (_camp getVariable ""supplyValue"")) then {_skip = true};" \n
" if (!_skip) then {_camp setVariable [""supplyValue"",_timeToCapture,true]};" \n
"};"/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "Skip">*/
class Skip
{
priority = 0.000000;
to="_";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"!_capture"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "Capture">*/
class Capture
{
priority = 0.000000;
to="Capture";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"_capture"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "_">*/
class _
{
name = "_";
init = /*%FSM<STATEINIT""">*/""/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "_">*/
class _
{
priority = 0.000000;
to="Camp_Core";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"time - _lastUpdate > _awaits"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "Capture">*/
class Capture
{
name = "Capture";
init = /*%FSM<STATEINIT""">*/"_captureSideID = WESTID;" \n
"if (_sideID == WESTID || (_sideID == RESISTANCEID && _east > 0)) then {_captureSideID = EASTID};" \n
"_side = _sideID Call GetSideFromID;" \n
"if (_sideID == WESTID || _sideID == EASTID) then {[""LostAt"",""Strongpoint"",_side,_town] Spawn SideMessage};" \n
"_camp setVariable [""sideID"",_captureSideID,true];" \n
"WFBE_CampCaptured = [nil,'CLTFNCCAMPCAPTURED',[_town,_captureSideID,_camp]];" \n
"publicVariable 'WFBE_CampCaptured';" \n
"if (isHostedServer) then {[nil,'CLTFNCCAMPCAPTURED',[_town,_captureSideID,_camp]] Spawn HandlePVF};" \n
"_side = _captureSideID Call GetSideFromID;" \n
"if (_captureSideID != RESISTANCEID) then {[""CapturedNear"",""Strongpoint"",_side,_town] Spawn SideMessage};" \n
"_texture = Format[""WFBE_%1FLAG"",str _side] Call GetNamespace;" \n
"_flag setFlagTexture _texture;" \n
"if (_townSideID == _captureSideID) then {_timeToCapture = _supply};" \n
"if (_townSideID != _captureSideID) then {_timeToCapture = _town getVariable ""startingSupplyValue""};" \n
"_sideID = _captureSideID;" \n
"_camp setVariable [""supplyValue"",_timeToCapture,true];"/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "_">*/
class _
{
priority = 0.000000;
to="Camp_Core";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"time - _lastUpdate > _awaits"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
};
/*%FSM</STATE>*/
};
initState="Init";
finalStates[] =
{
"End"
};
};
/*%FSM</COMPILE>*/
|