PARAM 1 shootrange 10 PARAM 2 engagedist 10 #PARAM 0 visibility 10 #PARAM 1 shootrange 3.5 #PARAM 2 engagedist 0.5 #start state state Base { Conditions { if GotTriggerArea == 1 goto Patrol if PreviousResult == 0 goto Patrol } Actions { IgnoreWallSplines DontPush } } 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 < 4.0 goto AttackOpp } Actions { FollowAttack } } state Think { Conditions { if GotOpponent == 0 goto Patrol if OpponentRange > 3.0 goto ApproachOpponent # if CircleClockwise "8192" == 1 goto CirclePlayerClockwise # if CircleAntiClockwise "8192" == 1 goto CirclePlayerAntiClockwise if Random < 0.5 goto AttackOpp if PreviousResult > 0.0 goto Wait } Actions { FaceOpponent "1.0" } } state Wait { Conditions { if OpponentRange > 4.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 > 4.0 goto ApproachOpponent if CircleClockwise "1024" == 0 goto Think } Actions { CircleOpponent "1.8" "walk" "CLOCKWISE" } } state CirclePlayerAntiClockwise { Conditions { if GotOpponent == 0 goto Patrol if OpponentRange > 4.0 goto ApproachOpponent if CircleAntiClockwise "1024" == 0 goto Think } Actions { CircleOpponent "1.8" "walk" "ANTICLOCKWISE" } } state TakenHit { Conditions { if GotOpponent == 0 goto Patrol if Timer > 0.5 goto AttackOpp } Actions { ResetTimer } }