PARAM 0 visibility 10 PARAM 1 shootrange 3.5 PARAM 2 engagedist 0.5 #start state state Base { Actions { MessageWait "BOGGLEATTACK" 1 SetState "Patrol" } } state Patrol { Conditions { if GotOpponent == 1 goto StartFight } Actions { FollowPath } } #get to the main path state StartFight { Conditions { if GotOpponent == 0 goto Patrol } Actions { GoToLevelPath SetState "ApproachOpponent" } } #follow the opponent till we get in range state ApproachAttack { Conditions { if GotOpponent == 0 goto Patrol if Timer > 0.5 goto Think } Actions { ResetTimer FollowAttack } } state ApproachOpponent { Conditions { if GotOpponent == 0 goto Patrol if OpponentRange < 3.0 goto AttackOpp } Actions { FollowAttack } } state Think { Conditions { if GotOpponent == 0 goto Patrol # if OpponentRange < 1.7 goto ApproachAttack if OpponentRange > 3.0 goto ApproachOpponent if CircleClockwise "4096" == 1 goto CirclePlayerClockwise if CircleAntiClockwise "4096" == 1 goto CirclePlayerAntiClockwise if Random < 0.5 goto AttackOpp if PreviousResult > 0.0 goto Wait } Actions { FaceOpponent "1.0" } } state Wait { Conditions { if OpponentRange > 3.0 goto ApproachOpponent } Actions { FaceOpponent "1.0" Setstate "Think" } } state AttackOpp { Conditions { if Timer > 1.0 goto Wait } Actions { ResetTimer EngageOpponent "goalrange engagedist" "firerange shootrange" "instant" } } state CirclePlayerClockwise { Conditions { if GotOpponent == 0 goto Patrol if OpponentRange > 3.0 goto ApproachOpponent if CircleClockwise "1024" == 0 goto Think } Actions { CircleOpponent "1.6" "walk" "facing" "CLOCKWISE" } } state CirclePlayerAntiClockwise { Conditions { if GotOpponent == 0 goto Patrol if OpponentRange > 3.0 goto ApproachOpponent if CircleAntiClockwise "1024" == 0 goto Think } Actions { CircleOpponent "1.6" "walk" "facing" "ANTICLOCKWISE" } }