Пример #1
0
    void SongPlayed(Player.Song song)
    {
        MessageController.SetLookTarget(transform);
        if (song == Player.Song.SadShanty)
        {
            MessageController.AddMessage("Ahhhhhh....");
            MessageController.AddMessage("That tune....");
            MessageController.AddMessage("...");
            MessageController.AddMessage("It's so sad, but the singer sails on...");
            MessageController.AddMessage("Just like I must...");
            MessageController.AddMessage("Thank ye, friend. My crew may be gone, but I must go on.");
            MessageController.AddMessage("Let me tell ye about the legend of this land and sea...");

            MessageController.AddMessage("Year by year, we worship the fire mountain.");
            MessageController.AddMessage("Praying she not end us all.");
            MessageController.AddMessage("She acts up, but always calms down.");
            MessageController.AddMessage("This year though...");
            MessageController.AddMessage("She be looking redder than usual.");
            MessageController.AddMessage("And legend has it, every 1000 years...");
            MessageController.AddMessage("Well, the horror is...");
            MessageController.AddMessage("...");
            MessageController.AddMessage("... hopefully not this year.");
            GameOrchestrator.Instance.SadGuyHealed = true;
        }
        else if (song == Player.Song.HappyJig)
        {
            MessageController.AddMessage("Ahhhhhh....");
            MessageController.AddMessage("That tune....");
            MessageController.AddMessage("Reminds me of the good times with me old crew...");
        }
    }
Пример #2
0
 void Update()
 {
     if (Input.GetKey(KeyCode.LeftShift))
     {
         if (Input.GetKeyDown(KeyCode.PageDown))
         {
             ScreenFader.FadeOutThen(() => {
                 NextPhase();
                 MessageController.AddMessage("CHEAT: Next Phase");
                 ScreenFader.FadeIn();
             });
         }
         if (Input.GetKeyDown(KeyCode.Home))
         {
             MessageController.AddMessage("CHEAT: Clear Save");
             PlayerPrefs.DeleteAll();
         }
         if (Input.GetKeyDown(KeyCode.Escape))
         {
             Application.Quit();
         }
         if (Input.GetKeyDown(KeyCode.End))
         {
             SceneManager.LoadScene("game");
         }
     }
 }
Пример #3
0
 void TalkToPlayer()
 {
     MessageController.SetLookTarget(transform);
     if (!GameOrchestrator.Instance.SavedSailor)
     {
         MessageController.AddMessage("Well hello there, darling.");
         MessageController.AddMessage("You look mighty fine out there.");
         MessageController.AddMessage("My husband has been out on the sea all day...");
         MessageController.AddMessage("*wink");
     }
     else if (!GameOrchestrator.Instance.DeliveredSailor)
     {
         MessageController.AddMessage("HUGH! Where is our ship?!?!");
         MessageController.AddMessage("SHARKS!?!?!");
         MessageController.AddMessage("hmph.. well at least you're all right.");
         MessageController.AddMessage("Young sailor, thank you for bringing my husband home.");
         MessageController.AddMessage("That ship had been in our family for generations...");
         MessageController.AddMessage("Let me sing you a song that my grandmother taught me. It is an old ballad that we would sing when ships didn't come home.");
         MessageController.AddMessage("You learned the SAD SHANTY! It's a song about loss on the high seas.");
         GameOrchestrator.Instance.HasSadShanty    = true;
         GameOrchestrator.Instance.DeliveredSailor = true;
     }
     else
     {
         MessageController.AddMessage("There once was a ship, that could not be sunken -- at least so long the crew wern't drunken...");
     }
 }
Пример #4
0
        public async Task AddMessageOkStatus()
        {
            //Arrange
            var  nick = "nick";
            User user = new User {
                Nickname = nick, Id = 1
            };
            Message message = new Message {
                MessageId = 1
            };

            wrapperMock.Setup(u => u.UserRepository.GetUserByNick(nick)).Returns(Task.Run(() =>
                                                                                          { return(user); }));

            mapperMock.Setup(m => m.Map <Message>(It.IsAny <MessageForAdd>())).Returns(message);

            wrapperMock.Setup(m => m.MessageRepository.Add(message)).Verifiable();

            wrapperMock.Setup(m => m.SaveAll()).Returns(Task.Run(() => { return(true); }));

            MessageController controller = new MessageController(wrapperMock.Object, mapperMock.Object);

            //Act
            var action = await controller.AddMessage(1, nick, It.IsAny <MessageForAdd>()) as OkResult;;

            //Assert
            Assert.Equal(200, action.StatusCode);
        }
Пример #5
0
    void SongPlayed(Player.Song song)
    {
        MessageController.SetLookTarget(transform);
        if (song == Player.Song.HappyJig)
        {
            MessageController.AddMessage("Ahhhhhh....");
            MessageController.AddMessage("That tune....");
            MessageController.AddMessage("YEAAHHHHHH BOIIIIIII!");
            MessageController.AddMessage("That'll be stuck in my head until the festival! I love it!");

            MessageController.AddMessage("Let me tell you a story. I'm in such a good mood!");
            MessageController.AddMessage("The world is going to end!");
            MessageController.AddMessage(":D");
            MessageController.AddMessage("They say there's a creature that can help us, though.");
            MessageController.AddMessage("Or maybe it's a being. Or an entity.");
            MessageController.AddMessage("Or maybe, nothing at all.");
            MessageController.AddMessage("Anyway, there's a relic in the north, and a relic in the south.");
            MessageController.AddMessage("They say if someone finds them, they'll learn how to summon her.");
            GameOrchestrator.Instance.BoredGuyHealed = true;
        }
        else if (song == Player.Song.SadShanty)
        {
            MessageController.AddMessage("Ah....");
            MessageController.AddMessage("That tune....");
            MessageController.AddMessage("It's so sad. Beautiful, but depressing!");
        }
    }
Пример #6
0
 public static void PlayerKilled()
 {
     MessageController.AddMessage("You have fed Mr. Biscuits the ultimate meal", true);
     MessageController.AddMessage("Game over");
     MessageController.AddMessage("Time portal opening..");
     _instance.StartCoroutine(_instance.RestartGame());
 }
        public void GetMessagesMassageLengthTest()
        {
            var mockService = new MockTwitterService();
            var controller  = new MessageController(mockService);

            var m = new MesageSubmitModel
            {
                //257 symbols, allowed 256
                Message  = "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has surv",
                UserName = "******"
            };

            controller.Configuration = new HttpConfiguration();
            controller.Validate(m);
            var result = controller.AddMessage(m);

            Assert.IsInstanceOfType(result, typeof(InvalidModelStateResult));

            var item = ((InvalidModelStateResult)result).ModelState;

            // Assert
            Assert.IsNotNull(item);
            Assert.IsNotNull(item["Message"]);
            Assert.IsTrue(item["Message"].Errors.Count > 0);
        }
Пример #8
0
    void TalkToPlayer()
    {
        MessageController.SetLookTarget(transform);
        if (!GameOrchestrator.Instance.HasLoveLetter && !GameOrchestrator.Instance.DeliveredLoveLetter)
        {
            MessageController.AddMessage("Great day for a sail, innit?");
            MessageController.AddMessage("Lookin' forward to the fire festival?");
        }
        else if (GameOrchestrator.Instance.HasLoveLetter)
        {
            GameOrchestrator.Instance.HasLoveLetter       = false;
            GameOrchestrator.Instance.DeliveredLoveLetter = true;
            MessageController.AddMessage("Oh, this is from that lass over on the shoreline?");
            MessageController.AddMessage("...");
            MessageController.AddMessage("Y'know, I have eyes for her too! Mate, this is great news!");
            MessageController.AddMessage("It makes me so happy, I wanna do a jig!");

            MessageController.AddMessage("You learned the HAPPY JIG! Share the excitement!");
            GameOrchestrator.Instance.HasHappyJig = true;
        }
        else
        {
            MessageController.AddMessage("Yo ho, YOLO a pirate's life for me.");
        }
    }
Пример #9
0
 void ItemActivate()
 {
     Player.Instance.MaxSpeed = NewMaxSpeed;
     MessageController.AddMessage("You found a BOAT! Now you don't have to worry about drowning!");
     GameOrchestrator.Instance.HasBoat = true;
     Destroy(gameObject);
 }
Пример #10
0
        public void AddMessageTest()
        {
            messageController.AddMessage("Cranberry", true, "High-pri message.");

            // Tests to see if the message was added by checking the end of the list
            Assert.Equal("Cranberry", fakeMessageRepo.MessageList[fakeMessageRepo.MessageList.Count() - 1].From);
        }
Пример #11
0
    void Start()
    {
        myStart    = transform.position;
        otherStart = helpfulBartender.transform.position + Vector3.down * 10;
        otherEnd   = helpfulBartender.transform.position;
        helpfulBartender.transform.position = otherStart;

        GameConductor.AddScheduleCallback((int hour, int min) =>
        {
            if (hour == 11 && min == 0)
            {
                ResetState();
            }
            else if (hour == 12 && min == 50 && GameConductor.IsMaidAQuitter)
            {
                HelpDrunk();
            }
            else if (hour == 2 && min == 0 && !GameConductor.IsOblexRevealed)
            {
                GameConductor.FreezePlayer();
                MessageController.AddMessage("(you hear the bartender's voice)");
                MessageController.AddMessage("Oy! Last call for drinks! The show's over!");
                MessageController.AddMessage("Nothing more to see!", postAction: () => GameConductor.UnfreezePlayer());
            }
        });
    }
Пример #12
0
 public static void MrBiscuitsKilled()
 {
     MessageController.AddMessage("Mr. Biscuits has fed them", true);
     MessageController.AddMessage("Game over");
     MessageController.AddMessage("Time portal opening..");
     _instance.StartCoroutine(_instance.RestartGame());
 }
Пример #13
0
        public async Task AddMessageBadRequestStatus()
        {
            //Arrange
            var  nick = "nick";
            User user = new User {
                Nickname = nick, Id = 1
            };
            Message message = new Message {
                MessageId = 1
            };

            wrapperMock.Setup(u => u.UserRepository.GetUserByNick(nick)).Returns(Task.FromResult(user));

            mapperMock.Setup(m => m.Map <Message>(It.IsAny <MessageForAdd>())).Returns(message);

            wrapperMock.Setup(m => m.MessageRepository.Add(message));

            wrapperMock.Setup(m => m.SaveAll()).Returns(Task.Run(() => { return(false); }));

            MessageController controller = new MessageController(wrapperMock.Object, mapperMock.Object);

            //Act
            var action = await controller.AddMessage(1, nick, It.IsAny <MessageForAdd>()) as BadRequestObjectResult;;

            //Assert
            Assert.Equal(400, action.StatusCode);
            Assert.NotNull(action.Value);
        }
Пример #14
0
 void TalkToPlayer()
 {
     MessageController.SetLookTarget(transform);
     MessageController.AddMessage("*glurb* help!");
     if (GameOrchestrator.Instance.HasBoat)
     {
         if (GameOrchestrator.Instance.SharksKilled < 1)
         {
             MessageController.AddMessage("Mate, I have a *glrpble* wife!");
             MessageController.AddMessage("You have to help meee*blbbblblblbb*!");
             MessageController.AddMessage("That boat *glrp* looks like a good rammer -- ram the sharks!");
         }
         else if (GameOrchestrator.Instance.SharksKilled < 4)
         {
             MessageController.AddMessage("There are still some left!");
             MessageController.AddMessage("*glrhprh*");
         }
         else
         {
             MessageController.AddMessage("Phew. You showed them sharks.");
             MessageController.AddMessage("Hope you don't mind if I hop on board!");
             MessageController.AddMessage("Me wife lives on the heart-shaped island. She'll be so happy to see me, she'll give ye something good!");
             GameOrchestrator.Instance.SavedSailor = true;
             Destroy(gameObject);
         }
     }
     else
     {
         MessageController.AddMessage("*blurbl* actually ...");
         MessageController.AddMessage("You're in the *blbblb* same boat as me!");
         MessageController.AddMessage("Same *blibble* lack of boat, that is...");
     }
 }
Пример #15
0
    public IEnumerator OnUpdate()
    {
        yield return(new WaitForSeconds(1));

        bool isFinished = false;

        ScreenFader.FadeInThen(() =>
        {
            Juicer.ShakeCamera(0.5f);
            MessageController.AddMessage("yo.");
            MessageController.AddMessage("this is game peanutbutters.");
            MessageController.AddMessage("it goes great with game jams.");
            MessageController.AddMessage("you may have noticed the camera and music change. very easy to do with cinemachine and the juicer.", postAction: () =>
            {
                GameConductor.CameraStateTrigger("NextState");
            });
            MessageController.AddMessage("these bois are moving with the simplemover script. it's an easy way to get some nice motion with little effort. useful for pickups, simple enemies, etc.", postAction: () =>
            {
                GameConductor.CameraStateTrigger("NextState");
            });
            MessageController.AddMessage("this is a fun script called textjacker. it jacks up text.", postAction: () =>
            {
                GameConductor.CameraStateTrigger("NextState");
            });
            MessageController.AddMessage("after this message finishes, the game will transition to the next game state. a basic player object will be created.", postAction: () => isFinished = true);
        });
        do
        {
            yield return(new WaitForSeconds(1));
        } while (!isFinished);
    }
Пример #16
0
    public IEnumerator OnUpdate()
    {
        GameConductor.ResetPlayer();
        GameConductor.UnfreezePlayer();
        GameConductor.PerformScheduleCallbacks(11, 0);
        _daycard.SetActive(true);
        _daycard.GetComponentInChildren <Text>().text = DataDump.Get <string>("Day") + " evening";
        yield return(new WaitForSeconds(4));

        _daycard.SetActive(false);
        bool isFinished = false;

        ScreenFader.FadeInThen(() =>
        {
            GameConductor.FreezePlayer();
            MessageController.AddMessage("Hmm. Haven't seen you around before.", postAction: () => GameConductor.CameraStateTrigger("NextState"));
            MessageController.AddMessage("Welcome to The Deja Brew.");
            MessageController.AddMessage("... oh? You need a place to stay?");
            MessageController.AddMessage("We got a room in the back when you're ready to hit the hay.");
            MessageController.AddMessage("Literally -- it's all we got.", postAction: () =>
            {
                GameConductor.CameraStateTrigger("FocusPlayer");
                GameConductor.UnfreezePlayer();
                isFinished = true;
            });
            MessageController.AddMessage("Enjoy the band and meet some of the regulars. We usually get a few characters in here.");
        });
        do
        {
            yield return(new WaitForSeconds(1));
        } while (!isFinished);
    }
Пример #17
0
    public void Attack(int attackIndex)
    {
        Messages.AddMessage(AttackMessage(Pokemon.Attacks[attackIndex].AttackName));

        if (YourPokemon)
        {
            StartCoroutine(EnemyWaitToAttack(0.5f));
        }

        if (Pokemon.Attacks[attackIndex].AttackSound != null)
        {
            audioPlayer.clip = Pokemon.Attacks[attackIndex].AttackSound;
            audioPlayer.Play();
        }

        Enemy.Damage(Pokemon.Attacks[attackIndex].AttackPower);
    }
Пример #18
0
    private IEnumerator Grow()
    {
        Juicer.ShakeCamera(0.5f);
        MessageController.AddMessage("it's growing!!");
        ImpulseMover.GoHomeHack();
        yield return(new WaitForSeconds(3));

        DataDump.Set("LocalPetGrowthStage", 3);
        Juicer.ShakeCamera(3);
    }
Пример #19
0
    public void OnSendButtonPressed()
    {
        var message = new MessageDTO
        {
            AuthorId  = _sessionUser,
            ProjectId = _project.Id,
            Text      = _messageField.text
        };

        MessageController.AddMessage(message);
        SceneManager.LoadScene("MessagesView");
    }
Пример #20
0
        public void AddMessageTest()
        {
            // Arrange
            var repo = new FakeMessageRepository();
            var messageController = new MessageController(repo);
            var beforeCount       = repo.Messages.Count;

            // Act
            messageController.AddMessage("Cora", "Molitor",
                                         "*****@*****.**", "Let's Plan Thanksgiving");

            // Assert
            Assert.Equal(beforeCount + 1, repo.Messages.Count);
        }
Пример #21
0
    private IEnumerator Die()
    {
        CloseFoodMenu();
        Juicer.ShakeCamera(1);
        MessageController.AddMessage("oh no...");
        ImpulseMover.GoHomeHack();
        yield return(new WaitForSeconds(3));

        int nextGrowthTime = CurrentTime + (MinutesSpentDead * 60);

        DataDump.Set("LocalPetNextGrowthTime", nextGrowthTime);
        DataDump.Set("LocalPetGrowthStage", (int)GrowthStage.Dead);
        Juicer.ShakeCamera(3);
    }
Пример #22
0
        public async Task AddMessageNotFoundStatus()
        {
            //Arrange
            wrapperMock.Setup(w => w.UserRepository.GetUserByNick("test")).Returns(Task.FromResult((User)null));

            MessageController controller = new MessageController(wrapperMock.Object, mapperMock.Object);

            //Act
            var action = await controller.AddMessage(1, It.IsAny <string>(), It.IsAny <MessageForAdd>()) as NotFoundObjectResult;

            //Assert
            Assert.Equal(404, action.StatusCode);
            Assert.NotNull(action.Value);
        }
Пример #23
0
    public void OnInteract()
    {
        Juicer.PlaySound(2);
        GameConductor.FreezePlayer();
        List <string> selectedTexts = used
            ? secondaryTexts
            : texts;

        if (!used)
        {
            GameConductor.EnqueueReset(() =>
            {
                used    = false;
                cleared = false;
            });
        }
        for (int i = 0; i < selectedTexts.Count; ++i)
        {
            if (!string.IsNullOrWhiteSpace(cameraTrigger))
            {
                GameConductor.CameraStateTrigger(cameraTrigger);
            }
            if (i < selectedTexts.Count - 1)
            {
                MessageController.AddMessage(selectedTexts[i]);
            }
            else
            {
                MessageController.AddMessage(selectedTexts[i], postAction: () =>
                {
                    GameConductor.UnfreezePlayer();
                    if (!string.IsNullOrWhiteSpace(cameraTrigger))
                    {
                        GameConductor.CameraStateTrigger("FocusPlayer");
                    }
                    if (used)
                    {
                        OnSecondaryActionFinished();
                        cleared = true;
                    }
                    else
                    {
                        OnPrimaryActionFinished();
                        used = true;
                    }
                    Player.DeselectInteractable();
                });
            }
        }
    }
Пример #24
0
 void TalkToPlayer()
 {
     MessageController.SetLookTarget(transform);
     MessageController.AddMessage("IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII");
     if (IsNorth)
     {
         GameOrchestrator.Instance.HasNorthEldritch = true;
     }
     else
     {
         GameOrchestrator.Instance.HasSouthEldritch = true;
     }
     Destroy(gameObject);
 }
Пример #25
0
 void TalkToPlayer()
 {
     MessageController.SetLookTarget(transform);
     if (!GameOrchestrator.Instance.SadGuyHealed)
     {
         MessageController.AddMessage("... *sigh*...");
         MessageController.AddMessage("The life of a sailor is a dangerous one, that's fer sure.");
         MessageController.AddMessage("Sometimes it feels like there is no way to heal the heart...");
     }
     else
     {
         MessageController.AddMessage("The sailor's life is a hard one, and sometimes a short one.");
         MessageController.AddMessage("But life does go on. Thank ye, mate.");
     }
 }
Пример #26
0
 void TalkToPlayer()
 {
     MessageController.SetLookTarget(transform);
     if (!GameOrchestrator.Instance.BoredGuyHealed)
     {
         MessageController.AddMessage("... *sigh*...");
         MessageController.AddMessage("So.");
         MessageController.AddMessage("Bored.");
     }
     else
     {
         MessageController.AddMessage("Hey, ha! Hey, ha!");
         MessageController.AddMessage("Island life is good, mate!");
     }
 }
Пример #27
0
 void AwareOfPlayer()
 {
     MessageController.SetLookTarget(transform);
     if (!GameOrchestrator.Instance.SavedSailor)
     {
         MessageController.AddMessage("yoo hoo!");
     }
     else if (!GameOrchestrator.Instance.DeliveredSailor)
     {
         MessageController.AddMessage("WHAT'S THIS?!");
     }
     else
     {
         MessageController.AddMessage("hmph.");
     }
 }
Пример #28
0
    public void TimeStep()
    {
        GrowthStage stage = (GrowthStage)DataDump.Get <int>("LocalPetGrowthStage");

        switch (stage)
        {
        case GrowthStage.Baby:
        case GrowthStage.Juvi:
            int fullness = DataDump.Get <int>("LocalPetFullness") - 1;
            if (fullness <= 0)
            {
                // go to the die
                StartCoroutine(Die());
                MessageController.AddMessage("oof");
                MessageController.AddMessage("it starved to death");
                MessageController.AddMessage("gather the food that's laying around");
                MessageController.AddMessage("make sure to click the pet");
                MessageController.AddMessage("and then the type of food");
                MessageController.AddMessage("it will be dead for a minute..");
                MessageController.AddMessage("but it always comes back");
                return;
            }
            if (fullness == FullnessTolerance / 2)
            {
                // go to the complain
                MessageController.AddMessage("it's getting hungry..");
            }
            if (fullness == 3)
            {
                // go to the complain
                MessageController.AddMessage("it's about to starve!");
            }
            DataDump.Set("LocalPetFullness", fullness);
            break;
        }

        if (stage == GrowthStage.Baby && DataDump.Get <int>("LocalPetNextGrowthTime") < CurrentTime)
        {
            // go to the grow
            StartCoroutine(Grow());
        }

        if (stage == GrowthStage.Dead && DataDump.Get <int>("LocalPetNextGrowthTime") < CurrentTime)
        {
            StartCoroutine(Sprout());
        }
    }
Пример #29
0
    public IEnumerator OnUpdate()
    {
        do
        {
            int currentHP = DataDump.Get <int>("HP") - 1;
            DataDump.Set("HP", currentHP);
            DataDump.Set("ScaledHP", (float)currentHP / maxHP);
            yield return(new WaitForSeconds(1));
        } while (DataDump.Get <int>("HP") > 0);
        Juicer.CreateFx(0, player.transform.position);
        GameObject.Destroy(player);
        Juicer.ShakeCamera(1.5f);
        bool readyToMoveOn = false;

        MessageController.AddMessage("butterboi is dead now.", postAction: () => readyToMoveOn = true);
        while (!readyToMoveOn)
        {
            yield return(null);
        }
    }
Пример #30
0
 void TalkToPlayer()
 {
     MessageController.SetLookTarget(transform);
     if (!GameOrchestrator.Instance.HasLoveLetter && !GameOrchestrator.Instance.DeliveredLoveLetter)
     {
         MessageController.AddMessage("You look like you might be able to help me!");
         MessageController.AddMessage("There's... someone out on the water who sails by here in his ship...");
         MessageController.AddMessage("Could you give him this for me?");
         MessageController.AddMessage("You got the LOVE LETTER!");
         GameOrchestrator.Instance.HasLoveLetter = true;
     }
     else if (GameOrchestrator.Instance.HasLoveLetter)
     {
         MessageController.AddMessage("Did you find him yet?");
     }
     else
     {
         MessageController.AddMessage("It's such a nice day for a swim!");
     }
 }