/*%FSM*/ /*%FSM*/ /* item0[] = {"Init",0,250,-64.944939,-176.579712,25.055046,-126.579880,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[] = {"Truck_is_Dead",4,218,-216.668854,-56.267559,-126.668869,-6.267574,1.000000,"Truck is" \n "Dead"}; item5[] = {"Check_Wrecks",2,4346,66.545509,15.865158,156.545563,65.865219,0.000000,"Check Wrecks"}; item6[] = {"Has_Driver",4,218,-66.545601,15.865162,23.454397,65.865189,0.000000,"Has Driver"}; item7[] = {"_",8,218,-37.459465,-108.411957,-3.868937,-87.498108,0.000000,""}; link0[] = {0,7}; link1[] = {1,3}; link2[] = {1,4}; link3[] = {1,6}; link4[] = {3,1}; link5[] = {4,2}; link6[] = {5,3}; link7[] = {6,5}; link8[] = {7,1}; globals[] = {0.000000,0,0,0,0,640,480,1,29,6316128,1,-280.138428,228.260757,186.219727,-258.197296,588,514,1}; window[] = {0,-1,-1,-1,-1,732,48,1308,98,1,606}; *//*%FSM*/ class FSM { fsmName = "updatesalvage"; class States { /*%FSM*/ class Init { name = "Init"; init = /*%FSM*/"_vehicle = _this select 0;" \n "" \n "_salvagerRange = 'WFBE_SALVAGERRANGE' Call GetNamespace;" \n "_percentage = 'WFBE_SALVAGERPERCENT' Call GetNamespace;" \n "" \n "_lastUpdate = time;"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class _ { priority = 0.000000; to="Check_Towns"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/""/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class Check_Towns { name = "Check_Towns"; init = /*%FSM*/"_lastUpdate = time;"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class Truck_is_Dead { priority = 1.000000; to="End"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"gameOver || !(alive _vehicle)"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class Has_Driver { priority = 0.000000; to="Check_Wrecks"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"!(isNull (driver _vehicle)) && !gameOver && alive _vehicle"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class Loop { priority = 0.000000; to="Check_Towns"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"time - _lastUpdate > 5 && !gameOver && alive _vehicle"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class End { name = "End"; init = /*%FSM*/""/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { }; }; /*%FSM*/ /*%FSM*/ class Check_Wrecks { name = "Check_Wrecks"; init = /*%FSM*/"_vehicles = nearestObjects [getPos _vehicle, ['Car','Motorcycle','Ship','Air','Tank','StaticWeapon'],_salvagerRange];" \n "" \n "_wrecks = [];" \n "{" \n " if !(alive _x) then {_wrecks = _wrecks + [_x]};" \n "} forEach _vehicles;" \n "" \n "_hqw = (west) Call GetSideHQ;" \n "_hqe = (east) Call GetSideHQ;" \n "" \n "_wrecks = _wrecks - [_hqw,_hqe];" \n "" \n "_overAllCost = 0;" \n "{" \n " _isNeeded = _x getVariable 'keepAlive';" \n " " \n " if (isNil '_isNeeded') then {" \n " _get = (typeOf _x) Call GetNamespace;" \n " _salvageCost = 250;" \n " if !(isNil '_get') then {" \n " _salvageCost = round(((_get select QUERYUNITPRICE)*_percentage) / 100);" \n " };" \n " " \n " _overAllCost = _overAllCost + _salvageCost;" \n " (Format [localize 'STR_WF_CHAT_Salvaged_Unit',_salvageCost,[typeOf _x,'displayName'] Call GetConfigInfo]) Call GroupChatMessage;" \n " " \n " deleteVehicle _x;" \n " };" \n "} foreach _wrecks;" \n "" \n "if (_overAllCost > 0) then {(_overAllCost) Call ChangePlayerfunds};"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class Loop { priority = 0.000000; to="Check_Towns"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"time - _lastUpdate > 5 && !gameOver && alive _vehicle"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ }; initState="Init"; finalStates[] = { "End", }; }; /*%FSM*/