Exemplo n.º 1
0
        protected override void SetupObjectives()
        {
            objectives.Clear();

            objectives.Add(new CustomObjective(Game, this, ObjectiveDescriptions[0],
                                               new EventTextCapsule(GetEvent((int)EventID.OutsideFortrun), null, EventTextCanvas.MessageBox, PortraitID.Sair),
                                               delegate { },
                                               delegate { },
                                               delegate { return(GameStateManager.currentState.ToLower().Equals("overworldstate")); },
                                               delegate { return(false); }));

            objectives.Add(new TimedMessageObjective(Game, this, ObjectiveDescriptions[0],
                                                     3000, 6000, PortraitID.Sair, GetEvent((int)EventID.ToMeetingPoint).Text));

            objectives.Add(new CloseInOnLocationObjective(Game, this, ObjectiveDescriptions[0],
                                                          300, new EventTextCapsule(GetEvent((int)EventID.AtMeeting), null, EventTextCanvas.MessageBox, PortraitID.Rok)));

            TimedMessageObjective objective4 = new TimedMessageObjective(Game, this, ObjectiveDescriptions[1],
                                                                         3000, 5000, PortraitID.Sair, GetEvent((int)EventID.AfterMeeting1).Text);

            objective4.SetEventText(new EventTextCapsule(GetEvent((int)EventID.AfterMeeting2), null, EventTextCanvas.MessageBox, PortraitID.Ai));
            objectives.Add(objective4);

            objectives.Add(new TimedMessageObjective(Game, this, ObjectiveDescriptions[1],
                                                     3000, 5000, PortraitID.Sair, GetEvent((int)EventID.ToLavis).Text));

            objectives.Add(new CloseInOnLocationObjective(Game, this, ObjectiveDescriptions[1],
                                                          300, new EventTextCapsule(GetEvent((int)EventID.Level1Begins), null, EventTextCanvas.MessageBox, PortraitID.AllianceCaptain)));

            objectives.Add(new ShootingLevelObjective(Game, this, ObjectiveDescriptions[1],
                                                      "Infiltration1", LevelStartCondition.TextCleared,
                                                      new EventTextCapsule(GetEvent((int)EventID.Level2Begins), null, EventTextCanvas.MessageBox,
                                                                           new List <PortraitID>()
            {
                PortraitID.AllianceCaptain, PortraitID.Rok, PortraitID.Sair
            }, new List <int>()
            {
                3, 4
            })));

            objectives.Add(new ShootingLevelObjective(Game, this, ObjectiveDescriptions[1],
                                                      "Infiltration2", LevelStartCondition.Immediately));

            objectives.Add(new CustomObjective(Game, this, ObjectiveDescriptions[2],
                                               new EventTextCapsule(GetEvent((int)EventID.AfterLevel2), null, EventTextCanvas.MessageBox, PortraitID.Rok),
                                               delegate
            {
                RemoveShips(allianceShips);
                AddShips(rebelShips2);
            },
                                               delegate { },
                                               delegate { return(true); },
                                               delegate { return(false); }));

            objectives.Add(new CustomObjective(Game, this, ObjectiveDescriptions[0],
                                               new EventTextCapsule(GetEvent((int)EventID.ToRebelBase), null, EventTextCanvas.MessageBox, PortraitID.Ai),
                                               delegate
            {
                time = StatsManager.PlayTime.GetFutureOverworldTime(2000);
            },
                                               delegate { },
                                               delegate { return(StatsManager.PlayTime.HasOverworldTimePassed(time)); },
                                               delegate { return(false); }));

            objectives.Add(new ArriveAtLocationObjective(Game, this, ObjectiveDescriptions[2]));
        }
Exemplo n.º 2
0
        protected override void SetupObjectives()
        {
            objectives.Clear();

            Objectives.Add(new CustomObjective(Game, this, ObjectiveDescriptions[0],
                                               new EventTextCapsule(GetEvent((int)EventID.ToMeetingPoint), null, EventTextCanvas.MessageBox, PortraitID.Ai),
                                               delegate { },
                                               delegate { },
                                               delegate { return(GameStateManager.currentState.ToLower().Equals("overworldstate")); },
                                               delegate { return(false); }));

            Objectives.Add(new CustomObjective(Game, this, ObjectiveDescriptions[0],
                                               delegate
            {
                foreach (OverworldShip ship in rebelShips)
                {
                    Game.stateManager.overworldState.AddOverworldObject(ship);
                }
            },
                                               delegate { },
                                               delegate { return(true); },
                                               delegate { return(false); }));

            Objectives.Add(new CloseInOnLocationObjective(Game, this, ObjectiveDescriptions[0], 400));

            Objectives.Add(new CustomObjective(Game, this, ObjectiveDescriptions[0],
                                               new EventTextCapsule(GetEvent((int)EventID.AtMeetingPoint1), null, EventTextCanvas.MessageBox, PortraitID.RebelPilot),
                                               delegate
            {
                OverworldShip.FollowPlayer = false;
                StartFreighter();
            },
                                               delegate
                                               { },
                                               delegate { return(true); },
                                               delegate { return(false); }));

            Objectives.Add(new TimedMessageObjective(Game, this, ObjectiveDescriptions[0],
                                                     3000, 10000, PortraitID.RebelPilot, GetEvent((int)EventID.AtMeetingPoint2).Text));

            TimedMessageObjective timedMessageObjective = new TimedMessageObjective(Game, this, ObjectiveDescriptions[0],
                                                                                    3000, 10000, PortraitID.RebelPilot, GetEvent((int)EventID.AtMeetingPoint3).Text);

            timedMessageObjective.SetEventText(
                new EventTextCapsule(GetEvent((int)EventID.AtMeetingPoint4), null, EventTextCanvas.MessageBox, PortraitID.RebelPilot));
            Objectives.Add(timedMessageObjective);

            Objectives.Add(new CustomObjective(Game, this, ObjectiveDescriptions[0],
                                               new EventTextCapsule(GetEvent((int)EventID.AttackFreighter), null, EventTextCanvas.MessageBox, PortraitID.RebelPilot),
                                               delegate { },
                                               delegate { },
                                               delegate
            {
                return(Vector2.Distance(rebelShips[0].position, freighter.position) < 500);
            },
                                               delegate { return(false); }));

            Objectives.Add(new CustomObjective(Game, this, ObjectiveDescriptions[0],
                                               delegate { },
                                               delegate { },
                                               delegate
            {
                return(CollisionDetection.IsRectInRect(rebelShips[0].Bounds, freighter.Bounds));
            },
                                               delegate { return(false); }));

            objectives.Add(new ShootingLevelObjective(Game, this, ObjectiveDescriptions[0],
                                                      "Retribution1", LevelStartCondition.Immediately,
                                                      new EventTextCapsule(GetEvent((int)EventID.AfterLevel), null, EventTextCanvas.MessageBox, PortraitID.RebelPilot)));

            objectives.Add(new CustomObjective(Game, this, ObjectiveDescriptions[1],
                                               delegate
            {
                freighter.Explode();
                freighter.Destroy();
                Game.stateManager.overworldState.GetSectorX.shipSpawner.AddOverworldShip(
                    alliance1, Game.player.position + new Vector2(-900, 0), "Retribution2", Game.player);
                OverworldShip.FollowPlayer = true;
            },
                                               delegate { }, delegate { return(true); }, delegate { return(false); }));

            CustomObjective chaseObjective = new CustomObjective(Game, this, ObjectiveDescriptions[1],
                                                                 delegate { },
                                                                 delegate { },
                                                                 delegate
            {
                if (Game.stateManager.shooterState.CurrentLevel != null &&
                    Game.stateManager.shooterState.CurrentLevel.Identifier.Equals("Retribution2"))
                {
                    return(Game.stateManager.shooterState.CurrentLevel.IsObjectiveCompleted &&
                           GameStateManager.currentState.Equals("OverworldState"));
                }

                return(Game.stateManager.overworldState.GetCurrentSpaceRegion is RebelOutpost);
            },
                                                                 delegate
            {
                if (Game.stateManager.shooterState.CurrentLevel != null &&
                    Game.stateManager.shooterState.CurrentLevel.Identifier.Equals("Retribution2"))
                {
                    return(Game.stateManager.shooterState.CurrentLevel.IsObjectiveFailed &&
                           GameStateManager.currentState.Equals("OverworldState"));
                }

                return(false);
            });

            chaseObjective.SetCompletedLogic(
                delegate
            {
                alliance1.AIManager = new PatrolAction(alliance1, Game.stateManager.overworldState.GetSectorX);
            });

            objectives.Add(chaseObjective);

            objectives.Add(new ArriveAtLocationObjective(Game, this, ObjectiveDescriptions[1]));
        }