コード例 #1
0
ファイル: DayOneMorning.cs プロジェクト: callumlawson/Sellout
        public static void Start(List <Entity> matchingEntities)
        {
            Analytics.CustomEvent("Day Three Started");

            var mcGraw = EntityQueries.GetEntityWithName(matchingEntities, NPCS.McGraw.Name);
            var player = EntityQueries.GetEntityWithName(matchingEntities, NPCName.You);

            //McGraw
            var mcGrawSequence = new ActionSequence("McGrawTutorial");

            if (!GameSettings.DisableTutorial)
            {
                mcGrawSequence.Add(new TeleportAction(Locations.OutsideDoorLocation()));
                mcGrawSequence.Add(new GetWaypointAction(Goal.PayFor));
                mcGrawSequence.Add(new GoToWaypointAction());
                mcGrawSequence.Add(new ConversationAction(new TutorialIntroDiaglogue()));
                mcGrawSequence.Add(new DialogueBranchAction(new Dictionary <DialogueOutcome, Action>
                {
                    {
                        DialogueOutcome.Nice, () =>
                        {
                            ActionManagerSystem.Instance.AddActionToFrontOfQueueForEntity(mcGraw,
                                                                                          new UpdateMoodAction(Mood.Happy));
                            StaticStates.Get <OutcomeTrackerState>().AddOutcome("You made a good impression on McGraw.");
                        }
                    },
                    {
                        DialogueOutcome.Mean, () =>
                        {
                            ActionManagerSystem.Instance.AddActionToFrontOfQueueForEntity(mcGraw,
                                                                                          new UpdateMoodAction(Mood.Angry));
                            StaticStates.Get <OutcomeTrackerState>().AddOutcome("You and McGraw haven't got off to the best start.");
                        }
                    }
                }));
                mcGrawSequence.Add(CommonActions.QueueForDrinkOrder(mcGraw, 10, 20));
                const string drinkName   = "Mind Meld";
                var          drinkRecipe = DrinkRecipes.GetDrinkRecipe(drinkName);

                var orderSequence = new ConditionalActionSequence("Drink order", false);
                var drinkOrder    = new DrinkOrders.ExactDrinkorder(drinkRecipe, mcGraw.GetState <NameState>().Name);
                orderSequence.Add(new StartDrinkOrderAction(drinkOrder));
                mcGrawSequence.Add(orderSequence);
                orderSequence.Add(CommonActions.WaitForDrink(mcGraw, drinkName, drinkOrder, 90, true, new DrinkSucsessDialogue()));
                mcGrawSequence.Add(new RemoveTutorialControlLockAction());
                mcGrawSequence.Add(new FadeToBlackAction(6.5f, "First day. Just open the bar then serve the right drinks, Easy?"));
                mcGrawSequence.Add(new PauseAction(3.0f));
                mcGrawSequence.Add(new CallbackAction(() =>
                {
                    EventSystem.EndDrinkMakingEvent.Invoke();
                    ActionManagerSystem.Instance.AddActionToFrontOfQueueForEntity(player,
                                                                                  new TeleportAction(Locations.CenterOfBar()));
                })); //This is kind of dirty - but demo!
                mcGrawSequence.Add(new DestoryEntityInInventoryAction());
                mcGrawSequence.Add(new TeleportAction(Locations.SitDownPoint3()));
                mcGrawSequence.Add(new SetReactiveConversationAction(new McGrawMorningOne(), mcGraw));
                mcGrawSequence.Add(CommonActions.SitDownLoop());
                ActionManagerSystem.Instance.QueueAction(mcGraw, mcGrawSequence);

                //Player
                var playerSequence = new ActionSequence("PlayerTutorial");
                playerSequence.Add(new TeleportAction(Locations.OutsideDoorLocation()));
                playerSequence.Add(new GetWaypointAction(Goal.RingUp));
                playerSequence.Add(new GoToWaypointAction());
                ActionManagerSystem.Instance.QueueAction(player, playerSequence);
            }
            else
            {
                mcGrawSequence.Add(new TeleportAction(Locations.SitDownPoint3()));
                mcGrawSequence.Add(new SetReactiveConversationAction(new McGrawMorningOne()));
                mcGrawSequence.Add(CommonActions.SitDownLoop());
                ActionManagerSystem.Instance.QueueAction(mcGraw, mcGrawSequence);
            }

            var loveStoryActions = LoveStory.DayOneMorning();

            foreach (var actionPair in loveStoryActions)
            {
                var entity = actionPair.GetEntity();
                var action = actionPair.GetGameAction();
                ActionManagerSystem.Instance.QueueAction(entity, action);
            }
        }
コード例 #2
0
ファイル: DayTwoMorning.cs プロジェクト: callumlawson/Sellout
        public static void Start(List <Entity> matchingEntities)
        {
            Analytics.CustomEvent("Day Two Started");

            var mcGraw = EntityQueries.GetEntityWithName(matchingEntities, NPCS.McGraw.Name);
            var player = EntityQueries.GetEntityWithName(matchingEntities, NPCName.You);

            var loveStoryActions = LoveStory.DayTwoMorning();

            foreach (var actionPair in loveStoryActions)
            {
                var entity = actionPair.GetEntity();
                var action = actionPair.GetGameAction();
                ActionManagerSystem.Instance.QueueAction(entity, action);
            }

            //McGraw
            var mcGrawSequence = new ActionSequence("McGraw Day Two Morning");

            mcGrawSequence.Add(new CallbackAction(() =>
            {
                EventSystem.EndDrinkMakingEvent.Invoke();
                ActionManagerSystem.Instance.AddActionToFrontOfQueueForEntity(player,
                                                                              new TeleportAction(Locations.CenterOfBar()));
            }));                                       //This is kind of dirty - but demo!
            mcGrawSequence.Add(new PauseAction(2.0f)); //WORKAROUND FOR SYNC ACTION BUG
            mcGrawSequence.Add(DrugStory.InspectorQuestions(mcGraw));
            ActionManagerSystem.Instance.QueueAction(mcGraw, mcGrawSequence);
        }
コード例 #3
0
        public static void Start(List <Entity> matchingEntities)
        {
            var loveStoryActions = LoveStory.DayTwoNight();

            foreach (var actionPair in loveStoryActions)
            {
                var entity = actionPair.GetEntity();
                var action = actionPair.GetGameAction();
                ActionManagerSystem.Instance.QueueAction(entity, action);
            }

            var mcGraw = EntityQueries.GetEntityWithName(matchingEntities, NPCS.McGraw.Name);
            var jannet = EntityQueries.GetEntityWithName(matchingEntities, NPCS.Jannet.Name);
            var q      = EntityQueries.GetEntityWithName(matchingEntities, NPCS.Q.Name);
            var player = EntityQueries.GetEntityWithName(matchingEntities, NPCName.You);

            //Jannet
            var jannetSequence = new ActionSequence("Jannet night");

            jannetSequence.Add(new CallbackAction(() =>
            {
                EventSystem.EndDrinkMakingEvent.Invoke();
                ActionManagerSystem.Instance.AddActionToFrontOfQueueForEntity(player,
                                                                              new TeleportAction(Locations.CenterOfBar()));
            }));                                       //This is kind of dirty - but demo!
            jannetSequence.Add(new PauseAction(0.1f)); //WORKAROUND FOR SYNC ACTION BUG
            jannetSequence.Add(new TeleportAction(Locations.SitDownPoint1()));
            jannetSequence.Add(new SetReactiveConversationAction(new JannetNightTwo(), jannet));
            jannetSequence.Add(CommonActions.SitDownLoop());
            ActionManagerSystem.Instance.QueueAction(jannet, jannetSequence);

            //McGraw and Q
            DrugStory.DrugPusherInspectorShowdown(mcGraw, q, Locations.SitDownPoint2());
        }
コード例 #4
0
        public static void Start(List <Entity> matchingEntities)
        {
            var seats       = EntityStateSystem.Instance.GetEntitiesWithState <GoalSatisfierState>().Where(entity => entity.GetState <GoalSatisfierState>().SatisfiedGoals.Contains(Goal.Sit));
            var chosenSeats = seats.PickRandom(4).ToArray();

            var loveStoryActions = LoveStory.DayOneNight(chosenSeats);

            foreach (var actionPair in loveStoryActions)
            {
                var entity = actionPair.GetEntity();
                var action = actionPair.GetGameAction();
                ActionManagerSystem.Instance.QueueAction(entity, action);
            }

            var jannet = EntityQueries.GetEntityWithName(matchingEntities, NPCS.Jannet.Name);
            var q      = EntityQueries.GetEntityWithName(matchingEntities, NPCS.Q.Name);

            var player = EntityQueries.GetEntityWithName(matchingEntities, NPCName.You);

            //Jannet
            var jannetSequence = new ActionSequence("Jannet night");

            jannetSequence.Add(new CallbackAction(() =>
            {
                EventSystem.EndDrinkMakingEvent.Invoke();
                ActionManagerSystem.Instance.AddActionToFrontOfQueueForEntity(player,
                                                                              new TeleportAction(Locations.CenterOfBar()));
            })); //This is kind of dirty - but demo!
            jannetSequence.Add(new TeleportAction(chosenSeats[0].GameObject.transform));
            jannetSequence.Add(new SetReactiveConversationAction(new JannetNightOne(), jannet));
            jannetSequence.Add(CommonActions.SitDownLoop());
            ActionManagerSystem.Instance.QueueAction(jannet, jannetSequence);

            //Q
            var qSequence = new ActionSequence("Q night");

            qSequence.Add(new PauseAction(2.0f)); //WORKAROUND FOR SYNC ACTION BUG
            if (StaticStates.Get <PlayerDecisionsState>().AcceptedDrugPushersOffer)
            {
                qSequence.Add(DrugPusherPaysYou());
            }
            else
            {
                qSequence.Add(new TeleportAction(chosenSeats[3].GameObject.transform));
                qSequence.Add(new SetReactiveConversationAction(new QNightOneRefused(), q));
                qSequence.Add(CommonActions.SitDownLoop());
            }
            ActionManagerSystem.Instance.QueueAction(q, qSequence);
        }