Epoch/Sources/epoch_code/System/cloak.fsm
2015-09-14 15:55:36 -05:00

741 lines
27 KiB
Plaintext

/*%FSM<COMPILE "F:\Program Files (x86)\Bohemia Interactive\Tools\FSM Editor Personal Edition\scriptedFSM.cfg, cloak brain">*/
/*%FSM<HEAD>*/
/*
item0[] = {"cloak",0,4346,-225.000000,-300.000000,-125.000000,-250.000000,0.000000,"cloak"};
item1[] = {"instinct",2,250,150.000000,-200.000000,250.000000,-150.000000,0.000000,"instinct"};
item2[] = {"action",2,250,150.000000,0.000000,250.000000,50.000000,0.000000,"action"};
item3[] = {"dispose",4,218,25.000000,-100.000000,125.000000,-50.000000,90.000000,"dispose"};
item4[] = {"reset___control",2,250,-100.000000,-200.000000,0.000000,-150.000000,0.000000,"reset / control"};
item5[] = {"_",8,218,-100.000000,-300.000000,0.000000,-250.000000,0.000000,""};
item6[] = {"complete",4,218,-100.000000,-100.000000,0.000000,-50.000000,100.000000,"complete"};
item7[] = {"end",1,250,-225.000000,-200.000000,-125.000000,-150.000000,0.000000,"end"};
item8[] = {"dispose",4,218,-100.000000,0.000000,0.000000,50.000000,120.000000,"dispose"};
item9[] = {"instinct_done",4,218,150.000000,-100.000000,250.000000,-50.000000,100.000000,"instinct done"};
item10[] = {"_",8,218,25.000000,-200.000000,125.000000,-150.000000,0.000000,""};
item11[] = {"final_checks",4,218,650.000000,0.000000,750.000000,50.000000,10.000000,"final checks"};
item12[] = {"check_status",4,218,475.000000,-175.000000,575.000000,-125.000000,110.000000,"check status"};
item13[] = {"check_status",4,218,475.000000,-25.000000,575.000000,25.000000,110.000000,"check status"};
item14[] = {"checking_status",2,250,650.000000,-100.000000,750.000000,-50.000000,0.000000,"checking status"};
item15[] = {"_",8,218,500.000000,-100.000000,600.000000,-50.000000,5.000000,""};
item16[] = {"return",2,250,375.000000,-100.000000,475.000000,-50.000000,0.000000,"return"};
item17[] = {"to_action",4,218,250.000000,-50.000000,350.000000,0.000000,0.000000,"to action"};
item18[] = {"to_instinct",4,218,250.000000,-150.000000,350.000000,-100.000000,0.000000,"to instinct"};
item19[] = {"target",4,218,700.000000,-225.000000,800.000000,-175.000000,90.000000,"target"};
item20[] = {"pre_vars",4,218,575.000000,-225.000000,675.000000,-175.000000,95.000000,"pre vars"};
item21[] = {"pre_dispose",2,250,-225.000000,0.000000,-125.000000,50.000000,0.000000,"pre dispose"};
item22[] = {"wait",4,218,-225.000000,-100.000000,-125.000000,-50.000000,0.000000,"wait"};
item23[] = {"teleport",4,218,150.000000,-300.000000,250.000000,-250.000000,70.000000,"teleport"};
item24[] = {"teleport",4,218,275.000000,75.000000,375.000000,125.000000,0.000000,"teleport"};
item25[] = {"call_teleport",2,250,275.000000,150.000000,375.000000,200.000000,0.000000,"call teleport"};
item26[] = {"_",8,218,150.000000,225.000000,250.000000,275.000000,5.000000,""};
item27[] = {"voice",4,218,25.000000,-300.000000,125.000000,-250.000000,80.000000,"voice"};
item28[] = {"voice",4,218,400.000000,75.000000,500.000000,125.000000,0.000000,"voice"};
item29[] = {"do_voice",2,250,400.000000,175.000000,500.000000,225.000000,0.000000,"do voice"};
item30[] = {"hover",4,218,275.000000,-300.000000,375.000000,-250.000000,60.000000,"hover"};
item31[] = {"hover",4,218,525.000000,75.000000,625.000000,125.000000,0.000000,"hover"};
item32[] = {"call_hover",2,250,525.000000,225.000000,625.000000,275.000000,0.000000,"call hover"};
link0[] = {0,5};
link1[] = {1,3};
link2[] = {1,9};
link3[] = {1,12};
link4[] = {1,23};
link5[] = {1,27};
link6[] = {1,30};
link7[] = {2,6};
link8[] = {2,8};
link9[] = {2,13};
link10[] = {2,24};
link11[] = {2,28};
link12[] = {2,31};
link13[] = {3,1};
link14[] = {4,10};
link15[] = {5,4};
link16[] = {6,4};
link17[] = {8,21};
link18[] = {9,2};
link19[] = {10,1};
link20[] = {11,14};
link21[] = {12,14};
link22[] = {13,14};
link23[] = {14,11};
link24[] = {14,15};
link25[] = {14,19};
link26[] = {14,20};
link27[] = {15,16};
link28[] = {16,17};
link29[] = {16,18};
link30[] = {17,2};
link31[] = {18,1};
link32[] = {19,14};
link33[] = {20,14};
link34[] = {21,22};
link35[] = {22,7};
link36[] = {23,1};
link37[] = {24,25};
link38[] = {25,26};
link39[] = {26,2};
link40[] = {27,1};
link41[] = {28,29};
link42[] = {29,26};
link43[] = {30,1};
link44[] = {31,32};
link45[] = {32,26};
globals[] = {25.000000,1,0,0,16777215,640,480,1,259,6316128,1,-197.096085,802.296997,393.904968,-479.966309,683,880,1};
window[] = {2,-1,-1,-1,-1,707,182,1207,182,3,701};
*//*%FSM</HEAD>*/
class FSM
{
fsmName = "cloak brain";
class States
{
/*%FSM<STATE "cloak">*/
class cloak
{
name = "cloak";
init = /*%FSM<STATEINIT""">*/"_unit = _this select 0;" \n
"_bomb = _this select 1;" \n
"_trgt = player;" \n
"if(count _this > 2)then{" \n
"_trgt = _this select 2;" \n
"};" \n
"_grp = group _unit;" \n
"" \n
"//Behaviour Vars" \n
"" \n
"_cRange = getNumber (missionConfigFile >> ""CfgEpochCloak"" >> ""cRange"");" \n
"_cAggression = getNumber (missionConfigFile >> ""CfgEpochCloak"" >> ""cAggression"");" \n
"_attackFrequency = getNumber (missionConfigFile >> ""CfgEpochCloak"" >> ""attackFrequency"");" \n
"_attackDist = getNumber (missionConfigFile >> ""CfgEpochCloak"" >> ""attackDistance"");" \n
"_trgtChangeFreq = getNumber (missionConfigFile >> ""CfgEpochCloak"" >> ""targetChangeFrequency"");" \n
"_teleportChance = getNumber (missionConfigFile >> ""CfgEpochCloak"" >> ""teleportChance"");" \n
"_hoverFreq = getNumber (missionConfigFile >> ""CfgEpochCloak"" >> ""hoverFrequency"");" \n
"_trgtFov = 105;//FOV of player - cloak moves when outside of view" \n
"" \n
"//Check Vars - Set Defaults" \n
"" \n
"if(_cRange < 60 || _cRange > 600)then{_cRange = 300;};" \n
"if(_cAggression < 1 || _cAggression > 100)then{_cAggression = 75;};" \n
"if(_attackFrequency < 120)then{_attackFrequency = 120;};" \n
"if(_attackDist < 16)then{_attackDist = 42;};" \n
"if(_trgtChangeFreq < 42)then{_trgtChangeFreq = 42;};" \n
"if(_teleportChance < 1)then{_teleportChance = 12;};" \n
"if(_hoverFreq < 240)then{_hoverFreq = 1280;};" \n
"" \n
"" \n
"" \n
"_sHit = [objNull, 0];" \n
"_sFiredNear = [objNull, 0];" \n
"" \n
"//Common" \n
"_nrTrgts = [player];" \n
"_trgtArray = [""Epoch_Man_Base_F"",""Epoch_Female_base_F""];" \n
"" \n
"//FSM" \n
"_cloakWalkHandle = -1;" \n
"_cloakHoverHandle = -1;" \n
"" \n
"//Control Vars" \n
"_sFreqCheck = 1.5;" \n
"_lFreqCheck = 12;" \n
"_checkEntry = """";" \n
"_doneCheck = false;" \n
"" \n
"//Base Vars" \n
"_rnd = 100;" \n
"_callDispose = false;" \n
"_doDispose = false;" \n
"_isBehind = false;" \n
"_avDist = _cRange;" \n
"_lastAlert = diag_tickTime;" \n
"_lastAttack = diag_tickTime;" \n
"_lastTrgt = diag_tickTime;" \n
"_doTeleport = false;" \n
"_callTeleport = false;" \n
"_callVoice = false;" \n
"_doHover = false;" \n
"_callHover = false;" \n
"" \n
"" \n
"" \n
"" \n
"_decisionMade = false;" \n
"_actionDone = false;" \n
"_criteria =""(false)"";" \n
"_sWait = 0;" \n
"_f = diag_tickTime;" \n
"_c = _f - _sFreqCheck;//Ensure checks done straight away on first run" \n
"_lastAlert = _f;" \n
"_lastFly = _f ;" \n
"" \n
"//Checks" \n
"_dist = 0;" \n
"_sanityCheck = 100;" \n
"" \n
"//Setup" \n
"if(behaviour _unit !=""STEALTH"")then{" \n
"_grp setBehaviour ""STEALTH"";" \n
"};" \n
"_unit setUnitPos ""UP""; " \n
"" \n
"//Debug" \n
"_showDebug = {" \n
"//hint format [""Cloak: %1\nReady: %2\nBehind: %3\nTarget: %5FPS:%4"",_debugDo,moveToCompleted _unit, _isBehind,diag_fps,_trgt];" \n
"};" \n
"" \n
"axecloak = _unit;" \n
"" \n
""/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "_">*/
class _
{
priority = 0.000000;
to="reset___control";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/""/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "instinct">*/
class instinct
{
name = "instinct";
init = /*%FSM<STATEINIT""">*/"//systemchat format [""BI:%1"",diag_tickTime];"/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "check_status">*/
class check_status
{
priority = 110.000000;
to="checking_status";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"diag_tickTime > _c + _sFreqCheck;"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"_checkEntry = ""instinct"";" \n
"_sanityCheck = 100;" \n
"" \n
""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "instinct_done">*/
class instinct_done
{
priority = 100.000000;
to="action";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"_decisionMade;"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"_decisionMade = false;"/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "dispose">*/
class dispose
{
priority = 90.000000;
to="instinct";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"({alive _x} count (_nrTrgts) == 0) || !alive _unit || _callDispose;"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"_doDispose = true;" \n
"_decisionMade = true;" \n
"" \n
"" \n
""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "voice">*/
class voice
{
priority = 80.000000;
to="instinct";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"(_trgtDist < _attackDist && _canSee && diag_tickTime - _lastAttack > _attackFrequency && random 100 < _cAggression) || _callVoice"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"_doVoice = true;" \n
"_decisionMade = true;" \n
"_callVoice = false;"/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "teleport">*/
class teleport
{
priority = 70.000000;
to="instinct";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"_trgtDist < 2 || _callTeleport"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"_doTeleport = true;" \n
"_decisionMade = true;" \n
"_callTeleport = false;"/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "hover">*/
class hover
{
priority = 60.000000;
to="instinct";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"_callHover"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"_doHover = true;" \n
"_decisionMade = true;" \n
"_callHover = false;"/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "action">*/
class action
{
name = "action";
init = /*%FSM<STATEINIT""">*/"//systemchat format [""BA:%1"",diag_tickTime];"/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "dispose">*/
class dispose
{
priority = 120.000000;
to="pre_dispose";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"_doDispose;"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "check_status">*/
class check_status
{
priority = 110.000000;
to="checking_status";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"diag_tickTime > _c + _sFreqCheck;"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"_checkEntry = ""action"";" \n
"_sanityCheck = 100;" \n
"" \n
"" \n
""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "complete">*/
class complete
{
priority = 100.000000;
to="reset___control";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"_actionDone && ((call compile _criteria) || (diag_tickTime > (_t + _sWait)));"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"" \n
"if(!isNil ""_criteriaMetAction"")then{" \n
"call _criteriaMetAction;" \n
"};" \n
"" \n
"" \n
"" \n
"" \n
"" \n
"" \n
"" \n
"" \n
"" \n
""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "voice">*/
class voice
{
priority = 0.000000;
to="do_voice";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"_doVoice"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"_doVoice = false;"/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "hover">*/
class hover
{
priority = 0.000000;
to="call_hover";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"_doHover"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"_doHover = false;"/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "teleport">*/
class teleport
{
priority = 0.000000;
to="call_teleport";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"_doTeleport"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"_doTeleport = false;"/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "reset___control">*/
class reset___control
{
name = "reset___control";
init = /*%FSM<STATEINIT""">*/"//Brain Vars" \n
"_criteria =""(false)"";" \n
"_criteriaMetAction = nil;" \n
"_actionDone = false;" \n
"_sWait = 0;" \n
"" \n
"" \n
"//Walking" \n
"if(_cloakWalkHandle < 0)then{" \n
"_startLoad = diag_tickTime;" \n
"_cloakWalkHandle = [_unit, _trgt] execFSM ""\x\addons\a3_epoch_code\System\cloakOnFoot.fsm"";" \n
"axeWalkHandle = _cloakWalkHandle;" \n
"//systemchat format[""Call Walking in %1"",diag_tickTime - _startLoad];" \n
"};" \n
"" \n
"//Base Vars" \n
"_t = diag_tickTime;" \n
"" \n
""/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "_">*/
class _
{
priority = 0.000000;
to="instinct";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/""/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "end">*/
class end
{
name = "end";
init = /*%FSM<STATEINIT""">*/"(typeOf _unit) call EPOCH_unitSpawnDecrease;" \n
"if!(isNull _unit)then{" \n
"deleteVehicle _unit;" \n
"};" \n
"" \n
"" \n
""/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "checking_status">*/
class checking_status
{
name = "checking_status";
init = /*%FSM<STATEINIT""">*/"" \n
"//Put vars to check in here - only run once per check session." \n
"if!(_doneCheck)then{" \n
"" \n
"_dist = _unit distance _trgt;" \n
"" \n
"" \n
"//systemchat format [""C:%1"",diag_tickTime];" \n
"//[] call _showDebug;" \n
"" \n
"" \n
"_doneCheck = true;" \n
"};" \n
"" \n
""/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "pre_vars">*/
class pre_vars
{
priority = 95.000000;
to="checking_status";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"_sanityCheck > 95;"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"//_windDir = winddir;" \n
"" \n
"_sanityCheck = 95;"/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "target">*/
class target
{
priority = 90.000000;
to="checking_status";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"_sanityCheck > 90;"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"_trgtDist = _unit distance _trgt;" \n
"_nrTrgts = _unit nearEntities [_trgtArray, _cRange];" \n
"_trgtPos = getPosATL _trgt;" \n
"_isBehind = !([_trgtPos,getdir _trgt,_trgtFov,position _unit] call BIS_fnc_inAngleSector);" \n
"_cloakPos = getPosATL _unit;" \n
"_canSee = (!lineIntersects [eyePos _unit, aimPos _trgt, _unit, _trgt]);" \n
"" \n
"" \n
"_tmpDist = 0;" \n
"if (count _nrTrgts > 1) then {" \n
"" \n
"{" \n
"_unitDist = _x distance _unit;" \n
"_tmpDist = _tmpDist + _unitDist;" \n
"" \n
"if(_unitDist < 2)then{" \n
"_callTeleport = true;" \n
"};" \n
"" \n
"}forEach _nrTrgts;" \n
"" \n
"_avDist = _tmpDist / (count _nrTrgts);" \n
"};" \n
"" \n
"" \n
"if(diag_tickTime - _lastFly > _hoverFreq)then{" \n
"if(_cloakHoverHandle < 0 && _canSee && _trgtDist >12)then{" \n
"" \n
"if((_trgtPos select 2) - (_cloakPos select 2) > 2)then{" \n
"_callHover = true;" \n
"};" \n
"" \n
"};" \n
"};" \n
"" \n
"" \n
"if(diag_tickTime - _lastTrgt > _trgtChangeFreq)then{" \n
"//Target Random Player" \n
"if(_avDist < _trgtDist)then{" \n
"_trgt = _nrTrgts select (floor (random count _nrTrgts));" \n
"};" \n
"" \n
"if(_cloakWalkHandle > -1)then{" \n
"_cloakWalkHandle setFSMVariable[""_trgt"",_trgt];" \n
"};" \n
"" \n
"_lastTrgt = diag_tickTime;" \n
"};" \n
"" \n
"" \n
"_sanityCheck = 90;"/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "final_checks">*/
class final_checks
{
priority = 10.000000;
to="checking_status";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"_sanityCheck > 10;"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"" \n
"//Target Dead" \n
"if(!(alive _trgt) && count _nrTrgts > 0)then{" \n
"_trgt = _nrTrgts select (floor (random count _nrTrgts));" \n
"};" \n
"" \n
"//Call random teleport" \n
"if!(_isBehind)then{" \n
"if(random 100 < (_teleportChance / 15))then{" \n
"_callTeleport = true;" \n
"};" \n
"};" \n
"" \n
"//Share vars" \n
"if(_cloakWalkHandle > -1)then{" \n
"" \n
"_cloakWalkHandle setFSMVariable[""_canSee"",_canSee];" \n
"_cloakWalkHandle setFSMVariable[""_isBehind"",_isBehind];" \n
"_cloakWalkHandle setFSMVariable[""_trgtDist"",_trgtDist];" \n
"" \n
"};" \n
"" \n
"//call _showDebug;" \n
"_sanityCheck = 0;" \n
"" \n
"" \n
"" \n
""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "_">*/
class _
{
priority = 5.000000;
to="return";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/""/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"_doneCheck = false;"/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "return">*/
class return
{
name = "return";
init = /*%FSM<STATEINIT""">*/"_c = diag_tickTime;" \n
"_sanityCheck = 100;" \n
""/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "to_instinct">*/
class to_instinct
{
priority = 0.000000;
to="instinct";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"(_checkEntry == ""instinct"");"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"_checkEntry = """";" \n
""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "to_action">*/
class to_action
{
priority = 0.000000;
to="action";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"(_checkEntry == ""action"");"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"_checkEntry = """";"/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "pre_dispose">*/
class pre_dispose
{
name = "pre_dispose";
init = /*%FSM<STATEINIT""">*/"//hint ""Dispose cloak Brain"";" \n
"" \n
"if(_cloakWalkHandle > -1)then{" \n
"_cloakWalkHandle setFSMVariable [""_callDispose"", true];" \n
"};"/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "wait">*/
class wait
{
priority = 0.000000;
to="end";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"(diag_tickTime - _t) > 120"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "call_teleport">*/
class call_teleport
{
name = "call_teleport";
init = /*%FSM<STATEINIT""">*/"[_unit, _trgt] execFSM ""\x\addons\a3_epoch_code\System\cloakTeleport.fsm"";" \n
"" \n
"_sWait = 0;" \n
"_actionDone = true;" \n
"_criteria = ""true"";" \n
""/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "_">*/
class _
{
priority = 5.000000;
to="action";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/""/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"_doneCheck = false;"/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "do_voice">*/
class do_voice
{
name = "do_voice";
init = /*%FSM<STATEINIT""">*/"_unit setDir ([_unit, _trgt] call BIS_fnc_dirTo);" \n
"" \n
"" \n
"if(diag_tickTime - _lastAlert > 480 && random 100 < _cAggression)then{" \n
"_unit say3D ""cultist_laugh"";" \n
"EPOCH_say3D_PVS = [player, _unit, 8,Epoch_personalToken];" \n
"publicVariableServer ""EPOCH_say3D_PVS"";" \n
"_lastAlert = diag_tickTime;" \n
"" \n
"" \n
"}else{" \n
"" \n
"_unit say3D ""cultist_talk"";" \n
"EPOCH_say3D_PVS = [player, _unit, 7,Epoch_personalToken];" \n
"publicVariableServer ""EPOCH_say3D_PVS"";" \n
"" \n
"};" \n
"" \n
"_lastAttack = diag_tickTime;" \n
"_sWait = 0;" \n
"_actionDone = true;" \n
"_criteria = ""true"";" \n
""/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "_">*/
class _
{
priority = 5.000000;
to="action";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/""/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"_doneCheck = false;"/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "call_hover">*/
class call_hover
{
name = "call_hover";
init = /*%FSM<STATEINIT""">*/"_cloakHoverHandle = [_unit, _trgt] execFSM ""\x\addons\a3_epoch_code\System\cloakHover.fsm"";" \n
"_lastFly = diag_tickTime;" \n
"" \n
"_sWait = 0;" \n
"_actionDone = true;" \n
"_criteria = format [""completedFSM %1"", _cloakHoverHandle];" \n
"_criteriaMetAction = {" \n
"_cloakHoverHandle = -1;" \n
"};" \n
""/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "_">*/
class _
{
priority = 5.000000;
to="action";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/""/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"_doneCheck = false;"/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
};
/*%FSM</STATE>*/
};
initState="cloak";
finalStates[] =
{
"end",
};
};
/*%FSM</COMPILE>*/