PARAM 0 visibility 10 PARAM 1 shootrange 3.5 PARAM 2 engagedist 2.0 #start state state Base { Conditions { if Message "WAVE1KILLED" == 1 and if Message "WAVE2KILLCOUNT" < 1 goto RespawnOff if LevelValue "Boar" != 0 goto Patrol # if Message "WAVE1KILLED" == 1 goto Patrol } Actions { Disable DontPush IgnoreWallSplines CheckWallSplines Respawnable "origin" NoAttack } } state Patrol { Conditions { if GotOpponent == 1 goto StartFight } Actions { Enable NoAttack "false" BlockAttacks FollowPath } } #get to the main path state StartFight { Conditions { if Message "WAVE2KILLALL" == 1 goto RespawnOff if GotOpponent == 0 goto Patrol } Actions { GoToLevelPath SetState "ApproachOpponent" } } #follow the opponent till we get in range state ApproachAttack { Conditions { if Message "WAVE2KILLALL" == 1 goto RespawnOff if GotOpponent == 0 goto Patrol if Timer > 0.5 goto Think } Actions { ResetTimer FollowAttack } } state ApproachOpponent { Conditions { if Message "WAVE2KILLALL" == 1 goto RespawnOff if GotOpponent == 0 goto Patrol if OpponentRange < 3.0 goto AttackOpp } Actions { SetActionValue "value 0" FollowAttack } } state Think { Conditions { if Message "WAVE2KILLALL" == 1 goto RespawnOff if GotOpponent == 0 goto Patrol if OpponentRange > 3.0 goto ApproachOpponent if Random < 0.1 goto JumpLeft if PreviousResult < 0.2 goto JumpRight if PreviousResult < 0.5 goto AttackOppSpecial if PreviousResult < 0.6 goto AttackOppSpecial2 if PreviousResult < 0.7 goto Taunt if PreviousResult > 0.0 goto AttackOpp } Actions { FaceOpponent "1.0" } } state AttackOpp { Conditions { if Message "WAVE2KILLALL" == 1 goto RespawnOff } Actions { EngageOpponent "goalrange engagedist" "firerange shootrange" "instant" "exit" "noface" BlockAttacks "false" FaceOpponent "mintime 0.0" "maxtime 0.15" Setstate "Think" } } state JumpLeft { Conditions { if Message "WAVE2KILLALL" == 1 goto RespawnOff if GotOpponent == 0 goto Patrol if OpponentRange > 3.0 goto ApproachOpponent } Actions { FaceOpponent SetActionValue "value 1" "waitcontextfree" WaitActionFinished SetState "Think" } } state JumpRight { Conditions { if Message "WAVE2KILLALL" == 1 goto RespawnOff if GotOpponent == 0 goto Patrol if OpponentRange > 3.0 goto ApproachOpponent } Actions { FaceOpponent SetActionValue "value 2" "waitcontextfree" WaitActionFinished SetState "Think" } } state AttackOppSpecial { Conditions { if Message "WAVE2KILLALL" == 1 goto RespawnOff } Actions { FaceOpponent "0.2" SetActionValue "value 3" "waitcontextfree" WaitActionFinished BlockAttacks "false" SetState "Think" } } state AttackOppSpecial2 { Conditions { if Message "WAVE2KILLALL" == 1 goto RespawnOff } Actions { FaceOpponent "0.2" SetActionValue "value 4" "waitcontextfree" WaitActionFinished BlockAttacks "false" SetState "Think" } } state Taunt { Conditions { if Message "WAVE2KILLALL" == 1 goto RespawnOff } Actions { FaceOpponent "0.2" SetActionValue "value 5" "waitcontextfree" WaitActionFinished SetState "Think" } } state AttackOppSpecial3 { Conditions { if Message "WAVE2KILLALL" == 1 goto RespawnOff } Actions { FaceOpponent "0.2" SetActionValue "value 6" "waitcontextfree" WaitActionFinished BlockAttacks "false" SetState "Think" } } state TakenHit { Conditions { if LevelValue "Boar" == 0 goto Base if Message "WAVE2KILLALL" == 1 goto RespawnOff if Random < 0.4 goto SetBlock if Timer > 1.5 and if GotOpponent == 0 goto Patrol if Timer > 1.5 and if GotOpponent == 1 goto StartFight } Actions { ResetTimer FaceOpponent "1.0" } } state SetBlock { Conditions { if Message "WAVE2KILLALL" == 1 goto RespawnOff if Timer > 1.5 and if GotOpponent == 0 goto Patrol if Timer > 1.5 and if GotOpponent == 1 goto StartFight } Actions { BlockAttacks FaceOpponent "1.0" } } state Blocking { Conditions { if Message "WAVE2KILLALL" == 1 goto RespawnOff if GotOpponent == 0 goto Patrol if Timer > 1.0 goto AttackOpp } Actions { ResetTimer FaceOpponent "1.0" } } state Killed { Conditions { } Actions { SetLevelValue "type Boar" "value 0" SetMessage "name WAVE2KILLCOUNT" "decrement 1" } } state RespawnOff { Conditions { } Actions { Respawnable "false" NoAttack KillMe } }