#--------------------------------------------- # Start state #--------------------------------------------- state Base { Conditions { if LevelValue "Stat" != 0 goto Control } Actions { NoRingSeg Disable DontPush } } #--------------------------------------------- # Activates the character & chooses the state #--------------------------------------------- state Control { Conditions { if LevelValue "Stat" == 0 goto Base if LevelValue "Stat" == 1 goto FindOpponent if LevelValue "Stat" == 2 goto GetToVantagePoint if LevelValue "Stat" == 3 goto Vulnerable if LevelValue "Stat" == 4 goto Vulnerable2 if LevelValue "Stat" == 5 goto CounterAttack if LevelValue "Stat" == 6 goto ForceVulnerableRestart } Actions { Enable SetLevelValue "type AttC" "value 0.0" SetLevelValue "type DJNo" "value 1.0" } } #--------------------------------------------- # Runs towards the player until got an opponent #--------------------------------------------- state FindOpponent { Conditions { if LevelValue "Stat" != 1 goto Control if GotOpponent == 1 goto Think } Actions { FollowPlayer "RUN" } } #--------------------------------------------- # Decides how to attack the opponenet #--------------------------------------------- state Think { Conditions { if LevelValue "Stat" != 1 goto Control if LevelValue "Bloc" == 1 goto Attack if GotOpponent == 0.0 goto Wander if LevelValue "Bund" < 3.24 goto SlamAttack if BossOpponentRange > 4.0 goto MoveToOpponenet if BossOpponentRange < 3.0 goto Attack if Random < 0.2 goto CircleClockwise if PreviousResult < 0.4 goto CircleAntiClockwise if PreviousResult < 1.0 goto Attack } Actions { ResetTimer FaceOpponent "120.0" } } #--------------------------------------------- # Moves towards the opponent #--------------------------------------------- state MoveToOpponenet { Conditions { if LevelValue "Stat" != 1 goto Control if LevelValue "Bund" < 3.24 goto SlamAttack if BossOpponentRange < 3.0 goto Attack if GotOpponent == 0.0 goto Wander } Actions { FollowOpponent "RUN" } } #--------------------------------------------- # Chooses the attack #--------------------------------------------- state Attack { Conditions { if LevelValue "Stat" != 1 goto Control if Random < 0.25 goto SlamAttack if PreviousResult < 0.5 goto Attack1 if PreviousResult < 0.75 goto Attack2 if PreviousResult < 1.1 goto Attack3 } Actions { } } #--------------------------------------------- # Performs the first attack #--------------------------------------------- state Attack1 { Conditions { if LevelValue "Stat" != 1 goto Control } Actions { SetActionValue "value 1" "waitcontextfree" SetState "AttackEnd" } } #--------------------------------------------- # Performs the second attack #--------------------------------------------- state Attack2 { Conditions { if LevelValue "Stat" != 1 goto Control } Actions { SetActionValue "value 2" "waitcontextfree" SetState "AttackEnd" } } #--------------------------------------------- # Performs the third attack #--------------------------------------------- state Attack3 { Conditions { if LevelValue "Stat" != 1 goto Control } Actions { SetActionValue "value 3" "waitcontextfree" SetState "AttackEnd" } } #--------------------------------------------- # Performs the slam attack #--------------------------------------------- state SlamAttack { Conditions { if LevelValue "Stat" != 1 goto Control if LevelValue "Wand" == 1 goto Attack1 } Actions { Idle "mintime 0.1" "maxtime "0.1" SetActionValue "value 4" "waitcontextfree" SetState "AttackEnd" } } #--------------------------------------------- # Ends the attack #--------------------------------------------- state AttackEnd { Conditions { if LevelValue "Stat" != 1 goto Control } Actions { WaitActionFinished SetLevelValue "type AttW" "value 0.0" SetLevelValue "type AttC" "value 1.0" SetState "Think" } } #--------------------------------------------- # Cicles around the opponenet clockwise #--------------------------------------------- state CircleClockwise { Conditions { if LevelValue "Stat" != 1 goto Control if Timer > 1.0 goto Think } Actions { ResetTimer CircleOpponent "1.6" "walk" "facing" "CLOCKWISE" } } #--------------------------------------------- # Cicles around the opponenet anticlockwise #--------------------------------------------- state CircleAntiClockwise { Conditions { if LevelValue "Stat" != 1 goto Control if Timer > 1.0 goto Think } Actions { ResetTimer CircleOpponent "1.6" "walk" "facing" "ANTICLOCKWISE" } } #--------------------------------------------- # Walks along the path looking for an opponenet #--------------------------------------------- state Wander { Conditions { if LevelValue "Stat" != 1 goto Control if GotOpponent == 1.0 goto Think } Actions { FollowPath "WALK" } } #--------------------------------------------- # Makes the character go back to the vantage point #--------------------------------------------- state GetToVantagePoint { Conditions { if LevelValue "Stat" != 2 goto Control } Actions { SetLevelValue "type DJNo" "value 0.0" SetLevelValue "type Some" "value 2.0" SetLevelValue "type Send" "value 0.0" SetState "AtVantagePoint" } } #--------------------------------------------- # Controls the character at the vantage point #--------------------------------------------- state AtVantagePoint { Conditions { if LevelValue "Stat" != 2 goto Control if Timer > 5.0 goto VPThink } Actions { ResetTimer SetLevelValue "type DJNo" "value 0.0" FacePlayer "62899200.0" } } #--------------------------------------------- # Controls the character at the vantage point #--------------------------------------------- state VPThink { Conditions { if LevelValue "Stat" != 2 goto Control if Random < 0.334 goto Taunt if LevelValue "DDir" < 0.0 goto VPStrafeClockwise if PreviousResult > 0.0 goto VPStrafeAntiClockwise } Actions { FacePlayer "62899200.0" } } #--------------------------------------------- # Strafes clockwise while at the vantage point #--------------------------------------------- state VPStrafeClockwise { Conditions { if LevelValue "Stat" != 2 goto Control if Timer > 0.5 goto AtVantagePoint } Actions { ResetTimer CirclePlayer "CLOCKWISE" } } #--------------------------------------------- # Strafes anticlockwise while at the vantage point #--------------------------------------------- state VPStrafeAntiClockwise { Conditions { if LevelValue "Stat" != 2 goto Control if Timer > 0.5 goto AtVantagePoint } Actions { ResetTimer CirclePlayer "ANTICLOCKWISE" } } #--------------------------------------------- # Makes the character do a taunt #--------------------------------------------- state Taunt { Conditions { if LevelValue "Stat" != 2 goto Control if Random < 0.5 goto Taunt1 if PreviousResult < 1.1 goto Taunt2 } Actions { } } #--------------------------------------------- # Makes the character do a taunt #--------------------------------------------- state Taunt1 { Conditions { if LevelValue "Stat" != 2 goto Control } Actions { SetActionValue "value 5" "waitcontextfree" SetState "AtVantagePoint" } } #--------------------------------------------- # Makes the character do a taunt #--------------------------------------------- state Taunt2 { Conditions { if LevelValue "Stat" != 2 goto Control } Actions { SetActionValue "value 6" "waitcontextfree" SetState "AtVantagePoint" } } #--------------------------------------------- # Makes the character go to the vantage point #--------------------------------------------- state SetVantagePoint { Conditions { if LevelValue "Stat" != 3 goto Control } Actions { SetLevelValue "type Stat" "value 2.0" SetCharacterFlagOff "2" } } #--------------------------------------------- # Performs a counter attack #--------------------------------------------- state CounterAttack { Conditions { } Actions { SetCharacterFlagOff "3" SetLevelValue "type VulT" "value -1.0" SetLevelValue "type Stat" "value 1.0" SetState "Attack" } } #--------------------------------------------- # The character can be hit while in this state #--------------------------------------------- state Vulnerable { Conditions { if LevelValue "Stat" != 3 goto VulnerableEnd } Actions { SetLevelValue "type Some" "value 1.0" SetLevelValue "type VulT" "value 10.0" SetCharacterFlagOn "3" } } #--------------------------------------------- # The character can be hit while in this state #--------------------------------------------- state Vulnerable2 { Conditions { if LevelValue "Stat" != 4 goto VulnerableEnd } Actions { SetLevelValue "type VulT" "value 5.0" SetCharacterFlagOn "3" } } #--------------------------------------------- # Ends the vulnerablitity of the character #--------------------------------------------- state VulnerableEnd { Conditions { } Actions { SetCharacterFlagOff "3" SetState "Control" } } #--------------------------------------------- # Fprces the character to become vulnerable # even if they already are #--------------------------------------------- state ForceVulnerableRestart { Conditions { } Actions { SetLevelValue "type Stat" "value 3.0" SetState "Vulnerable" } }