fsm UberBot : integer; //------------------------------------------------------------------ // UberBot: // Intended to display the maximum amount of challenge that the game can provide. //------------------------------------------------------------------ //------------------------------------------------------------------ // Constants //------------------------------------------------------------------ const #include_ //------------------------------------------------------------------ // Types //------------------------------------------------------------------ type #include_ //------------------------------------------------------------------ // Variables //------------------------------------------------------------------ var static integer attackRange; // At what range do I start shooting? static integer withdrawRange1; // At what range do I withdraw? static integer withdrawRange2; // At what range do I withdraw? static integer withdrawRange3; // At what range do I withdraw? //------------------------------------------------------------------ // Init: my initialization function //------------------------------------------------------------------ function Init; code // script-specific variables attackRange = 9999; withdrawRange1 = 750; withdrawRange2 = 700; withdrawRange3 = 600; // driver settings SetFiringDelay (ME,0.0,0.0); SetIgnoreFriendlyFire (ME,true); SetIsShotRadius (ME,200); SetEntropyMood (ME,BRUTAL_END); SetCurMood (ME,BRUTAL_END); SetSkillLevel (ME,100,999,100); SetAttackThrottle (ME,100); SetMinSpeed (ME,100); EnablePerWeaponRayCasting (ME,TRUE); endfunction; //------------------------------------------------------------------ // StartState: my initial state //------------------------------------------------------------------ state StartState; code trans WaitToAmbushState; endstate; //------------------------------------------------------------------ // WaitInAmbushState: wait for someone to come close enough to attack //------------------------------------------------------------------ state WaitToAmbushState; code if (Bot_FindEnemy(attackrange)) then trans AttackState1; endif; OrderMoveLookOut; endstate; //------------------------------------------------------------------ // AttackState1: the ambush is over -- Jump Snipe!!! //------------------------------------------------------------------ state AttackState1; code if (LeaveAttackState1(withdrawRange1)) then trans AttackState2; endif; OrderAttackTactic(TACTIC_JUMP_AND_SHOOT,TRUE); endstate; //------------------------------------------------------------------ // AttackState2: done jump sniping, move around and snipe -- Snipe Evily!!! //------------------------------------------------------------------ state AttackState2; code if (LeaveAttackState2(withdrawRange2)) then trans AttackState3; endif; OrderAttackTactic(TACTIC_SNIPE,TRUE); endstate; //------------------------------------------------------------------ // AttackState3: done sniping, start doing hit and run -- Hit and Run!!! //------------------------------------------------------------------ state AttackState3; code if (LeaveAttackState3(withdrawRange3)) then trans WaitToAmbushState; endif; OrderAttackTactic(TACTIC_HIT_AND_RUN,TRUE); endstate; //------------------------------------------------------------------ // DeadState: OK, I kicked the bucket. //------------------------------------------------------------------ state DeadState; code orderDie; endstate; endfsm.