#PARAM 1 shootrange 1.5 #PARAM 2 engagedist 1.5 PARAM 0 visibility 20 PARAM 1 shootrange 10.5 PARAM 2 engagedist 2.0 #--------------------------------------------- # Start state #--------------------------------------------- state Base { Conditions { #if LevelValue "Wolf" == 1 goto Enable if LevelValue "Beav" == 1 goto Enable } Actions { Disable NoAttack NoLosCheck #IgnoreWallSplines #CheckWallSplines SetSpawnCount "0.0" #Idle "mintime 1.5" "maxtime 4.0" #Respawnable "origin" #MessageWait "WOLFATTACK" "1.0" #SetState "Enable" } } #--------------------------------------------- # Enables the character #--------------------------------------------- state Enable { Conditions { if LevelValue "Beav" == 0 goto Base } Actions { DontPush Enable SetState "Patrol" } } #now normal patrol state Patrol { Conditions { if LevelValue "Beav" == 0 goto Base if GotOpponent == 1 goto ApproachOpponent if PlayerRangep1 > 7.0 and if PlayerRangeP2 > 7.0 and if Timer > 2.0 goto Patrol2 } Actions { ResetTimer NoAttack false FollowPath } } state Patrol2 { Conditions { if LevelValue "Beav" == 0 goto Base if GotOpponent == 1 goto ApproachOpponent if PlayerRangeP1 < 6.0 goto Patrol if PlayerRangeP2 < 6.0 goto Patrol } Actions { NoAttack false FollowPlayer } } #follow the opponent till we get in range state ApproachAttack { Conditions { if LevelValue "Beav" == 0 goto Base if GotOpponent == 0 goto Patrol if Timer > 0.5 goto Think } Actions { ResetTimer FollowAttack } } state ApproachOpponent { Conditions { if LevelValue "Beav" == 0 goto Base if GotOpponent == 0 goto Patrol if OpponentRange < 3.0 goto AttackOpp } Actions { FollowAttack } } state Think { Conditions { if LevelValue "Beav" == 0 goto Base 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 LevelValue "Beav" == 0 goto Base if OpponentRange > 3.5 goto ApproachOpponent if TurnAngAbs > 300.0 goto BackupTurn } Actions { FaceOpponent "0.4" Setstate "Think" } } state AttackOpp { Conditions { if LevelValue "Beav" == 0 goto Base if TurnAngAbs > 300.0 goto BackupTurn if Timer > 1.0 goto Wait } Actions { ResetTimer EngageOpponent "goalrange engagedist" "firerange shootrange" } } state BackupTurn { Conditions { if LevelValue "Beav" == 0 goto Base if GotOpponent == 0 goto Patrol if OpponentRange > 3.5 goto ApproachOpponent if TurnAngAbs < 256.0 and if Timer > 0.2 goto Think } Actions { ResetTimer #BackupTurn "goalrange 5.0f" BackupTurn "goalrange 2.5f" } } state Killed { Conditions { } Actions { #SetLevelValue "type Wolf" "value 0" } }