//CloudCityTrap_B //VaderPhaseB //BlowUpWindow == 1 blow up window state Base { Conditions { } Actions { AlertCreatures "character=player" SetInvulnerable SetBoss DontPush PrefersPlayers CanDefend SetMessage "name=ShowHearts" "value=0" SetMessage "name=VaderForce" "value=0" SetHitPoints "4" //Might need to unlock this door??? CloseDoor "door_to_a" LockDoor "door_to_a" ;Idle "3" ;SetMessage "name=VaderPhaseB" "value=2" SetState "ChoosePhase" } } //Phase 1 = Stormtroopers //Phase 2 = Force //Phase 2.5 = Fight //Phase 3 = Stormtroopers //Phase 4 = Force //Phase 4.5 = Fight //Phase 5 = Stormtroopers //Phase 6 = Force //Phase 7 = Flee //Phase 8 onwards are fighting in the second section. state ChoosePhase { Conditions { if Message "VaderPhaseB" == 0 goto Phase1_Start if Message "VaderPhaseB" == 1 goto Phase1_Start if Message "VaderPhaseB" == 2 goto Phase2_Start if Message "VaderPhaseB" == 2.5 goto Phase2_5_Start if Message "VaderPhaseB" == 3 goto Phase3_Start if Message "VaderPhaseB" == 4 goto Phase4_Start if Message "VaderPhaseB" == 4.5 goto Phase4_5_Start if Message "VaderPhaseB" == 5 goto Phase5_Start if Message "VaderPhaseB" == 6 goto Phase6_Start if Message "VaderPhaseB" > 6 goto Phase7_Start ;if Message "VaderPhaseB" == 7 goto Phase7_Start } Actions { SetMessage "name=VaderForce" "value=0" } } ///Phase 1 state Phase1_Start { Conditions { } Actions { SetMessage "name=VaderPhaseB" "value=1" SetHitPoints "4" "dont_set_max" Idle "2" CameraCut "use_current_campos" "tgt_character=myself" "FollowTgt" "blend_in_time=0.5" "blend_out_time=0.5" "end_time=3" "no_borders" SetState "Start_StormtrooperPhase" } } ///Phase 2 state Phase2_Start { Conditions { } Actions { SetHitPoints "4" "dont_set_max" SetState "Start_ForcePhase" } } ///Phase 2_5 state Phase2_5_Start { Conditions { } Actions { SetHitPoints "4" "dont_set_max" SetState "Start_FightPhase" } } ///Phase 3 state Phase3_Start { Conditions { } Actions { SetHitPoints "2" "dont_set_max" SetState "Start_StormtrooperPhase" } } ///Phase 4 state Phase4_Start { Conditions { } Actions { SetHitPoints "2" "dont_set_max" SetState "Start_ForcePhase" } } ///Phase 4_5 state Phase4_5_Start { Conditions { } Actions { SetHitPoints "2" "dont_set_max" SetState "Start_FightPhase" } } ///Phase 5 state Phase5_Start { Conditions { } Actions { SetHitPoints "0" "dont_set_max" SetState "Start_StormtrooperPhase" } } ///Phase 6 state Phase6_Start { Conditions { } Actions { SetHitPoints "0" "dont_set_max" SetState "Start_ForcePhase" } } /// state Start_StormtrooperPhase { Conditions { } Actions { CloseDoor "lift_stop1" LockDoor "lift_stop1" CloseDoor "lift_stop2" LockDoor "lift_stop2" SetInvulnerable SetMessage "name=ShowHearts" "value=0" SetMessage "name=TrooperLiftOn" "value=1" SetState "Update_StormtrooperPhase" } } state Update_StormtrooperPhase { Conditions { if ObstacleFinished "lift_stop1" == 1 and if ObstacleFinished "lift_stop2" == 1 and if NumInSetAlive "1" == 0 and if NumInSetAlive "2" == 0 goto Finished_StormtrooperPhase if OpponentInTriggerArea "Vader" == 1 goto Phase7_Start } Actions { } } state Finished_StormtrooperPhase { Conditions { } Actions { SetMessage "name=VaderPhaseB" "increment=1" SetState "ChoosePhase" } } /// state Start_ForcePhase { Conditions { if BeenHit == 1 goto Finished_ForcePhase } Actions { SetInvulnerable SetMessage "name=ShowHearts" "value=0" SetMessage "name=VaderForce" "value=1" SetState "Think_ForcePhase" } } state Think_ForcePhase { Conditions { if BeenHit == 1 goto Finished_ForcePhase if OpponentInTriggerArea "Vader" == 1 goto Phase7_Start if ObstacleChainPhase "throw1" == 1 and if ObstacleChainPhase "throw2" == 1 and if ObstacleChainPhase "throw3" == 1 and if ObstacleChainPhase "throw4" == 1 goto BigJump_ForcePhase if AlwaysTrue == 1 goto Throw_ForcePhase } Actions { FaceCamera } } state BigJump_ForcePhase { Conditions { if BeenHit == 1 goto Finished_ForcePhase } Actions { //First time starting force phase BigJump "jump_factor=0.6" PlayObstacle "name=throw1" PlayObstacle "name=throw2" PlayObstacle "name=throw3" PlayObstacle "name=throw4" Idle "1" SetState "Think_ForcePhase" } } state Throw_ForcePhase { Conditions { if BeenHit == 1 goto Finished_ForcePhase if OpponentInTriggerArea "Vader" == 1 goto Phase7_Start } Actions { UseForce "throwable" "name=deb_throw_1" "name=deb_throw_2" "name=deb_throw_3" "name=deb_throw_4" FacePlayer "3" SetState "Think_ForcePhase" } } state Finished_ForcePhase { Conditions { } Actions { SetMessage "name=VaderForce" "value=0" SetInvulnerable SetMessage "name=VaderPhaseB" "increment=0.5" ;FaceCamera "1" SetState "ChoosePhase" } } /// state Start_FightPhase { Conditions { if OpponentInTriggerArea "Vader" == 1 goto Phase7_Start if Message "VaderPhaseB" == 2.5 and if HitPoints == 2 goto Finished_FightPhase if Message "VaderPhaseB" == 4.5 and if HitPoints == 0 goto Finished_FightPhase } Actions { SetMessage "name=ShowHearts" "value=1" SetInvulnerable "FALSE" DontPush "FALSE" SetDoomedEscapeLocator "name=Vader_2" SetLocator "name=Vader_2" BigJumpToLocator AttackOpponent "range 0.5" } } state Finished_FightPhase { Conditions { } Actions { SetInvulnerable SetMessage "name=VaderPhaseB" "increment=0.5" SetDoomedEscapeLocator "name=Vader_1" SetLocator "name=Vader_1" BigJumpToLocator FaceCamera "1" SetState "ChoosePhase" } } ///Phase 7 state Phase7_Start { Conditions { } Actions { SetMessage "name=VaderForce" "value=0" SetInvulnerable ImmuneToKillTerrain SetDoomedEscapeLocator "reset" SetMessage "name=VaderPhaseB" "value=7" SetMessage "name=BlowUpWindow" "value=1" BigJump "x=10" "y=-1" "z=1.66" "jump_factor=0.7" SetMessage "name=ShowHearts" "value=0" UnLockDoor "door_to_a" OpenDoor "door_to_a" SetState "Phase8_Start" } } ///Phase 8 state Phase8_Start { Conditions { if EitherPlayerInTriggerArea "Vader_1" == 1 goto Phase8_Wait } Actions { SetHitPoints "10" SetMessage "name=TrapBEndFight" "value=1" SetDoomedEscapeLocator "name=vader8_1" SetLocator "name=vader8_1" SnapToLocator Idle "0.1" SetInvulnerable "FALSE" ImmuneToKillTerrain "FALSE" DontPush "FALSE" } } state Phase8_Wait { Conditions { if EitherPlayerInTriggerArea "Vader_2" == 1 goto Phase9_Start if HitPoints < 9 goto Phase9_Start if OpponentToLocatorXZ < 1.55 goto Phase8_WaitStartFight } Actions { SetMessage "name=ShowHearts" "value=1" GoToLocator FaceOpponent } } state Phase8_WaitStartFight { Conditions { if BeenHit == 1 goto Phase8_Fight } Actions { FacePlayer "2" SetState "Phase8_Fight" } } state Phase8_Fight { Conditions { if EitherPlayerInTriggerArea "Vader_2" == 1 goto Phase9_Start if HitPoints < 9 goto Phase9_Start if OpponentToLocatorXZ > 1.65 goto Phase8_Wait } Actions { AttackOpponent "range 0.5" } } /////// state Phase9_Start { Conditions { } Actions { SetDoomedEscapeLocator "name=vader8_2" SetLocator "name=vader8_2" BigJumpToLocator SetState "Phase9_Wait" } } state Phase9_Wait { Conditions { if EitherPlayerInTriggerArea "Vader_3" == 1 goto Phase10_Start if HitPoints < 7 goto Phase10_Start if OpponentToLocatorXZ < 0.9 goto Phase9_Fight } Actions { SetMessage "name=ShowHearts" "value=1" GoToLocator FaceOpponent } } state Phase9_Fight { Conditions { if EitherPlayerInTriggerArea "Vader_3" == 1 goto Phase10_Start if HitPoints < 7 goto Phase10_Start if OpponentToLocatorXZ > 1.0 goto Phase9_Wait } Actions { AttackOpponent "range 0.5" } } /////// state Phase10_Start { Conditions { } Actions { SetDoomedEscapeLocator "name=vader8_3" SetLocator "name=vader8_3" BigJumpToLocator SetState "Phase10_Wait" } } state Phase10_Wait { Conditions { if EitherPlayerInTriggerArea "Vader_4" == 1 goto Phase11_Start if HitPoints < 5 goto Phase11_Start if OpponentToLocatorXZ < 1.25 goto Phase10_Fight } Actions { SetMessage "name=ShowHearts" "value=1" GoToLocator FaceOpponent } } state Phase10_Fight { Conditions { if EitherPlayerInTriggerArea "Vader_4" == 1 goto Phase11_Start if HitPoints < 5 goto Phase11_Start if OpponentToLocatorXZ > 1.35 goto Phase10_Wait } Actions { AttackOpponent "range 0.5" } } /////// state Phase11_Start { Conditions { } Actions { SetDoomedEscapeLocator "name=vader8_4" SetLocator "name=vader8_4" BigJumpToLocator SetState "Phase11_Wait" } } state Phase11_Wait { Conditions { if OpponentToLocatorXZ < 1.9 goto Phase11_Fight } Actions { SetMessage "name=ShowHearts" "value=1" GoToLocator FaceOpponent } } state Phase11_Fight { Conditions { if OpponentToLocatorXZ > 2.0 goto Phase11_Wait } Actions { AttackOpponent "range 0.5" } }