summaryrefslogtreecommitdiffstats
path: root/Client/FSM/updatecapture.fsm
diff options
context:
space:
mode:
authorhybrid <hybrid@hybridlabs.pro>2026-06-11 19:55:41 +0300
committerhybrid <hybrid@hybridlabs.pro>2026-06-11 19:55:41 +0300
commitdee52083d359434fc3ac51a871c1b836d092d2ac (patch)
tree89bbb6326348a99bcf4a68761bd0c9628b80d4bb /Client/FSM/updatecapture.fsm
downloada2wf_lingor-dee52083d359434fc3ac51a871c1b836d092d2ac.tar.gz
a2wf_lingor-dee52083d359434fc3ac51a871c1b836d092d2ac.tar.bz2
a2wf_lingor-dee52083d359434fc3ac51a871c1b836d092d2ac.zip
init
Diffstat (limited to 'Client/FSM/updatecapture.fsm')
-rw-r--r--Client/FSM/updatecapture.fsm262
1 files changed, 262 insertions, 0 deletions
diff --git a/Client/FSM/updatecapture.fsm b/Client/FSM/updatecapture.fsm
new file mode 100644
index 0000000..0dd0934
--- /dev/null
+++ b/Client/FSM/updatecapture.fsm
@@ -0,0 +1,262 @@
+/*%FSM<COMPILE "D:\ArmA2\FSM Editor Personal Edition\scriptedFSM.cfg, updatecapture">*/
+/*%FSM<HEAD>*/
+/*
+item0[] = {"Init",0,4346,64.981941,-136.945908,154.981949,-86.946060,0.000000,"Init"};
+item1[] = {"Check_Towns",2,250,-66.836029,-56.267544,23.163887,-6.267582,0.000000,"Check Towns"};
+item2[] = {"End",1,250,-218.006683,15.304325,-128.006653,65.304314,0.000000,"End"};
+item3[] = {"Loop",4,218,65.605347,-56.267605,155.605377,-6.267574,0.000000,"Loop"};
+item4[] = {"Gameover",4,218,-216.668854,-56.267559,-126.668869,-6.267574,0.000000,"Gameover"};
+item5[] = {"Update_Capture",2,250,66.545486,22.916348,156.545471,72.916397,0.000000,"Update Capture"};
+item6[] = {"In_Range",4,218,-66.545563,22.916351,23.454376,72.916374,0.000000,"In Range"};
+item7[] = {"Not_in_Range",4,218,-167.954971,85.174767,-77.955025,135.174774,0.000000,"Not in Range"};
+item8[] = {"Hide",2,250,215.453018,86.056137,305.453064,136.056137,0.000000,"Hide"};
+link0[] = {0,3};
+link1[] = {1,3};
+link2[] = {1,4};
+link3[] = {1,6};
+link4[] = {1,7};
+link5[] = {3,1};
+link6[] = {4,2};
+link7[] = {5,3};
+link8[] = {6,5};
+link9[] = {7,8};
+link10[] = {8,3};
+globals[] = {0.000000,0,0,0,0,640,480,1,25,6316128,1,-526.153625,526.153442,261.834167,-341.160065,1024,906,1};
+window[] = {2,-1,-1,-1,-1,834,200,1460,200,3,1042};
+*//*%FSM</HEAD>*/
+class FSM
+{
+ fsmName = "updatecapture";
+ class States
+ {
+ /*%FSM<STATE "Init">*/
+ class Init
+ {
+ name = "Init";
+ init = /*%FSM<STATEINIT""">*/"disableSerialization;" \n
+ "_delay = 4;" \n
+ "_lastCheck = """";" \n
+ "_lastSID = -1;" \n
+ "_lastUpdate = time;" \n
+ "" \n
+ "_tcarm = 'WFBE_TOWNCAPTUREASSISTRANGEMODIFIER' Call GetNamespace;" \n
+ "" \n
+ "_colorBlue = [0,0,0.7,0.7];" \n
+ "_colorGreen = [0,0.7,0,0.7];" \n
+ "_colorRed = [0.7,0,0,0.7];" \n
+ "" \n
+ "_colorFriendly = switch ('Friendly' Call GetMarkerColoration) do {" \n
+ " case ""ColorGreen"": {_colorGreen};" \n
+ " case ""ColorBlue"": {_colorBlue};" \n
+ " case ""ColorRed"": {_colorRed};" \n
+ " default {_colorGreen};" \n
+ "};" \n
+ "" \n
+ "_colorEnemy = switch ('Enemy' Call GetMarkerColoration) do {" \n
+ " case ""ColorGreen"": {_colorGreen};" \n
+ " case ""ColorBlue"": {_colorBlue};" \n
+ " case ""ColorRed"": {_colorRed};" \n
+ " default {_colorRed};" \n
+ "};" \n
+ "" \n
+ "_coloResistance = switch ('Resistance' Call GetMarkerColoration) do {" \n
+ " case ""ColorGreen"": {_colorGreen};" \n
+ " case ""ColorBlue"": {_colorBlue};" \n
+ " case ""ColorRed"": {_colorRed};" \n
+ " default {_colorBlue};" \n
+ "};"/*%FSM</STATEINIT""">*/;
+ precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
+ class Links
+ {
+ /*%FSM<LINK "Loop">*/
+ class Loop
+ {
+ priority = 0.000000;
+ to="Check_Towns";
+ precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
+ condition=/*%FSM<CONDITION""">*/"time - _lastUpdate > 2 && !gameOver"/*%FSM</CONDITION""">*/;
+ action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
+ };
+ /*%FSM</LINK>*/
+ };
+ };
+ /*%FSM</STATE>*/
+ /*%FSM<STATE "Check_Towns">*/
+ class Check_Towns
+ {
+ name = "Check_Towns";
+ init = /*%FSM<STATEINIT""">*/"_sorted = [player,towns] Call SortByDistance;" \n
+ "_nearest = _sorted select 0;" \n
+ "_range = (_nearest getVariable ""range"") * _tcarm;" \n
+ "" \n
+ "_update = false;" \n
+ "if (player distance _nearest < _range && alive player) then {_update = true};" \n
+ "" \n
+ "_lastUpdate = time;"/*%FSM</STATEINIT""">*/;
+ precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
+ class Links
+ {
+ /*%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<LINK "In_Range">*/
+ class In_Range
+ {
+ priority = 0.000000;
+ to="Update_Capture";
+ precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
+ condition=/*%FSM<CONDITION""">*/"_update && !gameOver"/*%FSM</CONDITION""">*/;
+ action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
+ };
+ /*%FSM</LINK>*/
+ /*%FSM<LINK "Not_in_Range">*/
+ class Not_in_Range
+ {
+ priority = 0.000000;
+ to="Hide";
+ precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
+ condition=/*%FSM<CONDITION""">*/"!_update && !gameOver"/*%FSM</CONDITION""">*/;
+ action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
+ };
+ /*%FSM</LINK>*/
+ /*%FSM<LINK "Loop">*/
+ class Loop
+ {
+ priority = 0.000000;
+ to="Check_Towns";
+ precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
+ condition=/*%FSM<CONDITION""">*/"time - _lastUpdate > 2 && !gameOver"/*%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 "Update_Capture">*/
+ class Update_Capture
+ {
+ name = "Update_Capture";
+ init = /*%FSM<STATEINIT""">*/"_sideID = _nearest getVariable ""sideID"";" \n
+ "if (isNil '_sideID') then {_sideID = -1};" \n
+ "_curSV = _nearest getVariable ""supplyValue"";" \n
+ "_maxSV = _nearest getVariable ""maxSupplyValue"";" \n
+ "_txt = """";" \n
+ "_nObjects = nearestObjects [player, WFCAMP, 10];" \n
+ "_nObject = if (count _nObjects > 0) then {_nObjects select 0} else {objNull};" \n
+ "if !(isNull _nObject) then {" \n
+ " _sideID = _nObject getVariable ""sideID"";" \n
+ " if !(isNil '_sideID') then {" \n
+ " _curSV = _nObject getVariable ""supplyValue"";" \n
+ " if (_lastCheck == ""Town"") then {_delay = 0};" \n
+ " _lastCheck = ""Camp"";" \n
+ " } else {" \n
+ " _sideID = -1;" \n
+ " };" \n
+ " if (player distance _nObject >= 10) then {" \n
+ " _lastCheck = ""Town"";" \n
+ " _sideID = _nearest getVariable ""sideID"";" \n
+ " _curSV = _nearest getVariable ""supplyValue"";" \n
+ " _txt = Format [""SV: %1/%2"",_curSV,_maxSV];" \n
+ " };" \n
+ "} else {" \n
+ " if (_lastCheck == ""Camp"") then {_delay = 0};" \n
+ " _lastCheck = ""Town"";" \n
+ " _txt = Format [""SV: %1/%2"",_curSV,_maxSV];" \n
+ "};" \n
+ "" \n
+ "_barColor = [];" \n
+ "if (_sideID == RESISTANCEID || _sideID == -1) then {_barColor = _coloResistance};" \n
+ "if ((_sideID == WESTID)&&(sideID == WESTID) || (_sideID == EASTID)&&(sideID == EASTID)) then {_barColor = _colorFriendly}; //--- Green" \n
+ "if ((_sideID == WESTID)&&(sideID == EASTID) || (_sideID == EASTID)&&(sideID == WESTID)) then {_barColor = _colorEnemy};" \n
+ "if (_sideID != _lastSID) then {_delay = 0};" \n
+ "if (isNull ([""currentCutDisplay""] call BIS_FNC_GUIget)) then {12450 cutRsc[""OptionsAvailable"",""PLAIN"",0];_delay = 0};" \n
+ "if (!isNull ([""currentCutDisplay""] call BIS_FNC_GUIget)) then {" \n
+ " _control = ([""currentCutDisplay""] call BIS_FNC_GUIget) DisplayCtrl 3800;" \n
+ " _control ctrlShow true;" \n
+ " _control CtrlSetBackgroundColor _barColor;" \n
+ " _backgroundControl = ([""currentCutDisplay""] call BIS_FNC_GUIget) DisplayCtrl 3600;" \n
+ " _backgroundControl ctrlShow true;" \n
+ " _backgroundControl CtrlSetBackgroundColor [0.1882, 0.2588, 0.149, 0.76];" \n
+ " _textControl = ([""currentCutDisplay""] call BIS_FNC_GUIget) DisplayCtrl 3900;" \n
+ " _textControl ctrlShow true;" \n
+ " _textControl ctrlSetText _txt;" \n
+ " _maxWidth = (CtrlPosition _backgroundControl Select 2) - 0.02;" \n
+ " _position = CtrlPosition _control;" \n
+ " _position Set[2,_maxWidth * _curSV / _maxSV];" \n
+ " _control CtrlSetPosition _position;" \n
+ " _control CtrlCommit _delay;" \n
+ " _delay = 4;" \n
+ " _lastSID = _sideID;" \n
+ "};"/*%FSM</STATEINIT""">*/;
+ precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
+ class Links
+ {
+ /*%FSM<LINK "Loop">*/
+ class Loop
+ {
+ priority = 0.000000;
+ to="Check_Towns";
+ precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
+ condition=/*%FSM<CONDITION""">*/"time - _lastUpdate > 2 && !gameOver"/*%FSM</CONDITION""">*/;
+ action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
+ };
+ /*%FSM</LINK>*/
+ };
+ };
+ /*%FSM</STATE>*/
+ /*%FSM<STATE "Hide">*/
+ class Hide
+ {
+ name = "Hide";
+ init = /*%FSM<STATEINIT""">*/"_delay = 0;" \n
+ "if (isNull ([""currentCutDisplay""] call BIS_FNC_GUIget)) then {12450 cutRsc[""OptionsAvailable"",""PLAIN"",0]};" \n
+ "if (!isNull ([""currentCutDisplay""] call BIS_FNC_GUIget)) then {" \n
+ " _control = ([""currentCutDisplay""] call BIS_FNC_GUIget) DisplayCtrl 3800;" \n
+ " _backgroundControl = ([""currentCutDisplay""] call BIS_FNC_GUIget) DisplayCtrl 3600;" \n
+ " _textControl = ([""currentCutDisplay""] call BIS_FNC_GUIget) DisplayCtrl 3900;" \n
+ " _control ctrlShow false;" \n
+ " _backgroundControl ctrlShow false;" \n
+ " _textControl ctrlShow false;" \n
+ "};"/*%FSM</STATEINIT""">*/;
+ precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
+ class Links
+ {
+ /*%FSM<LINK "Loop">*/
+ class Loop
+ {
+ priority = 0.000000;
+ to="Check_Towns";
+ precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
+ condition=/*%FSM<CONDITION""">*/"time - _lastUpdate > 2 && !gameOver"/*%FSM</CONDITION""">*/;
+ action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
+ };
+ /*%FSM</LINK>*/
+ };
+ };
+ /*%FSM</STATE>*/
+ };
+ initState="Init";
+ finalStates[] =
+ {
+ "End"
+ };
+};
+/*%FSM</COMPILE>*/ \ No newline at end of file