PARAM 0 visibility 10 PARAM 1 shootrange 3.5 PARAM 2 engagedist 2.5 #start state state Base { Conditions { if LevelValue "Ankl" != 0 goto Patrol } Actions { NoAttack SetHitPoints "default 1.0" Disable DontPush # IgnoreWallSplines Respawnable "origin" AttackPriority "set 0" } } state Patrol { Conditions { if LevelValue "Ankl" != 1 goto ManageState if GotOpponent == 1 goto StartFight } Actions { Enable NoAttack "false" BlockAttacks "false" FollowPlayer "Run" } } #get to the main path state StartFight { Conditions { if LevelValue "Ankl" != 1 goto ManageState if GotOpponent == 0 goto Patrol } Actions { GoToLevelPath SetState "ApproachOpponent" } } #follow the opponent till we get in range state ApproachAttack { Conditions { if LevelValue "Ankl" != 1 goto ManageState if GotOpponent == 0 goto Patrol if Timer > 0.5 goto Think } Actions { ResetTimer FollowAttack } } state ApproachOpponent { Conditions { if LevelValue "Ankl" != 1 goto ManageState if GotOpponent == 0 goto Patrol if OpponentRange < 2.75 goto AttackOpp } Actions { FollowAttack } } state Think { Conditions { if LevelValue "Ankl" != 1 goto ManageState if GotOpponent == 0 goto Patrol if OpponentRange > 2.5 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 "0.5" } } state Wait { Conditions { if LevelValue "Ankl" != 1 goto ManageState if OpponentRange > 2.5 goto ApproachOpponent } Actions { FaceOpponent "0.1" Setstate "Think" } } state AttackOpp { Conditions { if LevelValue "Ankl" != 1 goto ManageState if Timer > 1.0 goto Wait } Actions { if LevelValue "Ankl" != 1 goto ManageState ResetTimer FaceOpponent "faceoffset 1.0f" "0.2" EngageOpponent "goalrange engagedist" "firerange shootrange" "instant" "exit" "noface" Delay 0.65 } } state CirclePlayerClockwise { Conditions { if LevelValue "Ankl" != 1 goto ManageState if GotOpponent == 0 goto Patrol if OpponentRange > 2.5 goto ApproachOpponent if CircleClockwise "1024" == 0 goto Think } Actions { CircleOpponent "1.6" "walk" "facing" "CLOCKWISE" } } state CirclePlayerAntiClockwise { Conditions { if LevelValue "Ankl" != 1 goto ManageState if GotOpponent == 0 goto Patrol if OpponentRange > 2.5 goto ApproachOpponent if CircleAntiClockwise "1024" == 0 goto Think } Actions { CircleOpponent "1.6" "walk" "facing" "ANTICLOCKWISE" } } state RespawnOff { Conditions { if LevelValue "Ankl" != 1 goto ManageState } Actions { Respawnable "false" NoAttack KillMe } } state ManageState { Conditions { if LevelValue "Ankl" == 0 goto Base if LevelValue "Ankl" == 2 goto RespawnOff } Actions { } } state Killed { COnditions { } Actions { SetLevelValue "type Ankl" "value 0" } }