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 withdrawRange; // At what range do I withdraw? //------------------------------------------------------------------ // Init: my initialization function //------------------------------------------------------------------ function Init; code // script-specific variables attackRange = 9999; withdrawRange = 250; // 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 AttackState; endif; OrderMoveLookOut; endstate; //------------------------------------------------------------------ // AttackState: the ambush is over -- let's kick some ass! //------------------------------------------------------------------ state AttackState; code if (LeaveAttackState(withdrawRange)) then trans WaitToAmbushState; endif; OrderAttackTactic(TACTIC_CIRCLE_OF_DEATH,TRUE); endstate; //------------------------------------------------------------------ // DeadState: OK, I kicked the bucket. //------------------------------------------------------------------ state DeadState; code orderDie; endstate; endfsm.