#PARAM 1 shootrange 1.5 #PARAM 2 engagedist 1.5 PARAM 0 visibility 20 PARAM 1 shootrange 3.5 PARAM 2 engagedist 2.0 #start state state Base { Conditions { #if Message "FUR2DONE" == 1 goto RespawnOff if GotTriggerArea == 1 goto Idle if PreviousResult == 0 goto Idle } Actions { NoAttack NoLosCheck IgnoreWallSplines DontPush #Respawnable "origin" } } #CheckLevelFlag #waiting for attack state Idle { Conditions { #if Message "FUR2DONE" == 1 goto RespawnOff if Message "NEARFUR2" == 1 goto Patrol #if PlayerRangeP1 < 9.0 goto Patrol #if PlayerRangeP2 < 9.0 goto Patrol # if GotOpponent == 1 and # if Message "FUR1DONE" == 1 goto ApproachOpponent #if PathBlocked == 1 goto NewAction } Actions { } } #now normal patrol state Patrol { Conditions { if GotOpponent == 1 goto ApproachOpponent } Actions { NoAttack false FollowPath } } #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 > 3.5 goto ApproachOpponent if TurnAngAbs > 300.0 goto BackupTurn if Random < 0.7 goto AttackOpp if PreviousResult > 0.0 goto Wait } Actions { FaceOpponent "0.4" } } state Wait { Conditions { if OpponentRange > 3.5 goto ApproachOpponent if TurnAngAbs > 300.0 goto BackupTurn } Actions { FaceOpponent "0.4" Setstate "Think" } } state AttackOpp { Conditions { if TurnAngAbs > 300.0 goto BackupTurn if Timer > 1.0 goto Wait } Actions { ResetTimer EngageOpponent "goalrange engagedist" "firerange shootrange" } } state BackupTurn { Conditions { if GotOpponent == 0 goto Patrol if OpponentRange > 3.5 goto ApproachOpponent if TurnAngAbs < 256.0 goto Think } Actions { BackupTurn "goalrange 5.0f" } } state RespawnOff { Conditions { } Actions { #Respawnable "false" #NoAttack #KillMe } }