From c055d44dcdb87e8db49fb23e632fc086aa44cce6 Mon Sep 17 00:00:00 2001 From: hybrid Date: Thu, 11 Jun 2026 19:53:22 +0300 Subject: init --- Client/FSM/conquest_helper.fsm | 148 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 Client/FSM/conquest_helper.fsm (limited to 'Client/FSM/conquest_helper.fsm') diff --git a/Client/FSM/conquest_helper.fsm b/Client/FSM/conquest_helper.fsm new file mode 100644 index 0000000..fab822e --- /dev/null +++ b/Client/FSM/conquest_helper.fsm @@ -0,0 +1,148 @@ +/*%FSM*/ +/*%FSM*/ +/* +item0[] = {"Init",0,4346,53.240814,-221.988968,143.240845,-171.989166,0.000000,"Init"}; +item1[] = {"End",1,250,-216.387955,-52.508366,-126.387947,-2.508394,0.000000,"End"}; +item2[] = {"Update_Conquest",2,250,-82.090652,-139.314026,7.909359,-89.314034,0.000000,"Update" \n "Conquest"}; +item3[] = {"Loop",4,218,53.846153,-139.681244,143.846161,-89.681236,0.000000,"Loop"}; +item4[] = {"Gameover",4,218,-216.387955,-139.464890,-126.387947,-89.464890,0.000000,"Gameover"}; +link0[] = {0,3}; +link1[] = {2,3}; +link2[] = {2,4}; +link3[] = {3,2}; +link4[] = {4,1}; +globals[] = {0.000000,0,0,0,0,640,480,1,8,6316128,1,-348.696411,348.696136,79.849762,-328.514618,921,592,1}; +window[] = {0,-1,-1,-1,-1,837,100,1513,100,1,939}; +*//*%FSM*/ +class FSM +{ + fsmName = "conquest_helper"; + class States + { + /*%FSM*/ + class Init + { + name = "Init"; + init = /*%FSM*/"_ntime = 0;"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Loop + { + priority = 0.000000; + to="Update_Conquest"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"time > _ntime"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class End + { + name = "End"; + init = /*%FSM*/""/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + }; + }; + /*%FSM*/ + /*%FSM*/ + class Update_Conquest + { + name = "Update_Conquest"; + init = /*%FSM*/"_t = [];" \n + "" \n + "{" \n + " if ((_x getVariable 'sideID') == sideID) then {_t = _t + [_x]};" \n + "} forEach towns;" \n + "" \n + "_set = [];" \n + "" \n + "if (count _t > 0) then {" \n + " {" \n + " _neighbors = _x getVariable ""neighbors"";" \n + " " \n + " if !(isNil ""_neighbors"") then {" \n + " {" \n + " if ((_x getVariable 'sideID') != sideID) then {" \n + " if (isNil {_x getVariable ""wfbe_marker""}) then {" \n + " _marker = Format [""wfbe_conquest_%1"", buildingMarker];" \n + " buildingMarker = buildingMarker + 1;" \n + " _x setVariable ['wfbe_marker', _marker];" \n + " createMarkerLocal [_marker, getPos _x];" \n + " _marker setMarkerColorLocal ""ColorOrange"";" \n + " _marker setMarkerShapeLocal ""ELLIPSE"";" \n + " _marker setMarkerAlphaLocal 0.4;" \n + " _marker setMarkerBrushLocal ""SOLID"";" \n + " _marker setMarkerSizeLocal [300,300];" \n + " };" \n + " if !(_x in _set) then {_set = _set + [_x]};" \n + " };" \n + " } forEach _neighbors;" \n + " };" \n + " } forEach _t;" \n + "} else {" \n + " _hq = (sideJoined) Call GetSideHQ;" \n + " _nearest = ([_hq, towns] Call SortByDistance) select 0;" \n + " if (isNil {_nearest getVariable ""wfbe_marker""}) then {" \n + " _marker = Format [""wfbe_conquest_%1"", buildingMarker];" \n + " buildingMarker = buildingMarker + 1;" \n + " _nearest setVariable ['wfbe_marker', _marker];" \n + " createMarkerLocal [_marker, getPos _nearest];" \n + " _marker setMarkerColorLocal ""ColorOrange"";" \n + " _marker setMarkerShapeLocal ""ELLIPSE"";" \n + " _marker setMarkerAlphaLocal 0.4;" \n + " _marker setMarkerBrushLocal ""SOLID"";" \n + " _marker setMarkerSizeLocal [300,300];" \n + " };" \n + " _set = [_nearest];" \n + "};" \n + "" \n + "_set = towns - _set;" \n + "{" \n + " if !(isNil {_x getVariable ""wfbe_marker""}) then {" \n + " deleteMarkerLocal (_x getVariable ""wfbe_marker"");" \n + " _x setVariable [""wfbe_marker"", nil];" \n + " };" \n + "} forEach _set;" \n + "" \n + "_ntime = time + 10;"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Gameover + { + priority = 0.000000; + to="End"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"gameOver"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Loop + { + priority = 0.000000; + to="Update_Conquest"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"time > _ntime"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + }; + initState="Init"; + finalStates[] = + { + "End", + }; +}; +/*%FSM*/ \ No newline at end of file -- cgit v1.3.1