예제 #1
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());
            }
        });
    }
예제 #2
0
    private void TryMoveForDrink()
    {
        if (!GameConductor.IsMaidAQuitter || GameConductor.IsBarflyHelping)
        {
            transform.parent.SetPositionAndRotation(TargetDrinkLocation.position, TargetDrinkLocation.rotation);
            switch (CrowdN)
            {
            case 1:
                GameConductor.IsCrowd1Drinking = true;
                GameConductor.EnqueueReset(() => GameConductor.IsCrowd1Drinking = false);
                break;

            case 2:
                GameConductor.IsCrowd2Drinking = true;
                GameConductor.EnqueueReset(() => GameConductor.IsCrowd2Drinking = false);
                break;

            case 3:
                GameConductor.IsCrowd3Drinking = true;
                GameConductor.EnqueueReset(() => GameConductor.IsCrowd3Drinking = false);
                break;
            }
            GameConductor.EnqueueReset(() => transform.parent.SetPositionAndRotation(startLocation, startRotation));
        }
    }
예제 #3
0
 public IEnumerator OnUpdate()
 {
     while (!GameConductor.IsOblexTriggered && !GameConductor.IsSleeping)
     {
         time += 1;
         if (time >= 5 && niceHour != 2)
         {
             time        = 0;
             niceMinute += 10;
             if (niceMinute == 60)
             {
                 niceMinute = 0;
                 niceHour  += 1;
                 if (niceHour == 13)
                 {
                     niceHour = 1;
                 }
             }
             SetTime();
         }
         yield return(new WaitForSeconds(1));
     }
     GameConductor.SetShowHud(false);
     yield return(new WaitForSeconds(1));
 }
예제 #4
0
    private void SetTime()
    {
        string minutePrefix = niceMinute < 10 ? "0" : "";

        DataDump.Set("Time", $"{niceHour}:{minutePrefix}{niceMinute}");
        GameConductor.PerformScheduleCallbacks(niceHour, niceMinute);
    }
예제 #5
0
 public override void OnPrimaryActionFinished()
 {
     Juicer.ShakeCamera(0.5f);
     Juicer.PlaySound(1);
     GameConductor.KillNPC();
     transform.parent.parent.Translate(0, -10, 0);
 }
예제 #6
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);
    }
예제 #7
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);
    }
예제 #8
0
 public void OnEnter()
 {
     ScreenFader.FadeOut();
     GameConductor.FreezePlayer();
     MusicBox.ChangeMusic((int)Song.Final);
     MusicBox.Instance.FadeInTrack(1);
     CreditRoller.RollCredits();
 }
예제 #9
0
 public void OnEnter()
 {
     MusicBox.ChangeMusic(Song.Game.ToInt());
     GameConductor.SetShowHud(true);
     time       = 0;
     niceHour   = 11;
     niceMinute = 0;
     SetTime();
 }
예제 #10
0
 void Start()
 {
     score     = GameObject.Find("Scoring").GetComponent <Scoring>();
     player    = GameObject.Find("PlayerBoi").GetComponent <Player>();
     conductor = GameObject.Find("GameConductor").GetComponentInChildren <GameConductor>();
     for (int i = 0; i < statTexts.Length; i++)
     {
         statTexts[i].text = statNames[i] + ": " + statNums[i];
     }
 }
예제 #11
0
 public void StartGame(List <string> connectionIdsAtTable)
 {
     this._connectionIdsAtTable = connectionIdsAtTable;
     this._gameConductorThread  = new Thread(async() =>
     {
         var gameConductor = new GameConductor(this);
         await gameConductor.ConductGame();
     });
     this._gameConductorThread.Start();
 }
예제 #12
0
 public void OnEnter()
 {
     GameConductor.CameraStateTrigger("Initialize");
     MusicBox.ChangeMusic(Song.Game.ToInt());
     DataDump.Set("Berries", 0);
     DataDump.Set("BerriesDiscovered", false);
     DataDump.Set("Cookies", 0);
     DataDump.Set("CookiesDiscovered", false);
     DataDump.Set("Fish", 0);
     DataDump.Set("FishDiscovered", false);
     GameConductor.SetShowHud(true);
 }
예제 #13
0
 public override void OnPrimaryActionFinished()
 {
     GameConductor.IsPlayerAWarrior = true;
     Juicer.PlaySound(1);
     playerSword.SetActive(true);
     GameConductor.EnqueueReset(() =>
     {
         playerSword.SetActive(false);
         GameConductor.IsPlayerAWarrior = false;
         transform.parent.Translate(0, 10, 0);
     });
     transform.parent.Translate(0, -10, 0);
 }
예제 #14
0
 public void OnExit()
 {
     if (GameConductor.IsSleeping)
     {
         MusicBox.ChangeMusic(Song.Intro.ToInt());
         ScreenFader.FadeOut();
         NextState = new IntroState(GameConductor.GetDayCard());
         GameConductor.IsSleeping = false;
     }
     else
     {
         NextState = new OblexState();
     }
 }
예제 #15
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();
                });
            }
        }
    }
예제 #16
0
    IEnumerator DrunkSequence()
    {
        GameConductor.CameraStateTrigger("drunk");
        GameConductor.FreezePlayer();
        yield return(new WaitForSeconds(2));

        Juicer.ShakeCamera(0.3f);
        Juicer.PlaySound(0);
        passedOutGuy.transform.position = transform.position;
        transform.parent.position       = otherStart;
        yield return(new WaitForSeconds(2));

        GameConductor.UnfreezePlayer();
        GameConductor.CameraStateTrigger("FocusPlayer");
    }
예제 #17
0
    public void OnEnter()
    {
        player = GameObject.Instantiate(PlayerPrototype);
        player.transform.position = PlayerSpawnLocation;
        Juicer.CreateFx(0, PlayerSpawnLocation);
        Juicer.ShakeCamera(0.5f);
        MusicBox.ChangeMusic((int)Song.Boss);
        DataDump.Set("HP", maxHP);
        DataDump.Set("ScaledHP", 1.0f);
        var cam = GameObject.Find("CinemachineStateCamera/GameCam").GetComponent <CinemachineVirtualCamera>();

        cam.Follow = player.transform;
        cam.LookAt = player.transform;
        GameConductor.SetShowHud(true);
    }
예제 #18
0
 // Use this for initialization
 private void Awake()
 {
     DontDestroyOnLoad(this);
     if (instance == null)
     {
         score     = GameObject.Find("Scoring").GetComponent <Scoring>();
         player    = GameObject.Find("PlayerBoi").GetComponent <Player>();
         conductor = GameObject.Find("GameConductor").GetComponentInChildren <GameConductor>();
         instance  = this;
     }
     else
     {
         instance.Start();
         Destroy(this.gameObject);
     }
 }
예제 #19
0
    void Start()
    {
        myStart    = transform.position;
        otherStart = passedOutGuy.transform.position;

        GameConductor.AddScheduleCallback((int hour, int min) =>
        {
            if (hour == 11 && min == 0)
            {
                ResetState();
            }
            else if (hour == 12 && min == 30)
            {
                PassOut();
            }
        });
    }
예제 #20
0
    void Start()
    {
        myStart    = transform.position;
        otherStart = helpfulBarmaid.transform.position + Vector3.down * 10;
        otherEnd   = helpfulBarmaid.transform.position;
        helpfulBarmaid.transform.position = otherStart;

        GameConductor.AddScheduleCallback((int hour, int min) =>
        {
            if (hour == 11 && min == 0)
            {
                ResetState();
            }
            else if (hour == 12 && min == 40 && !GameConductor.IsMaidAQuitter)
            {
                HelpDrunk();
            }
        });
    }
예제 #21
0
    public IEnumerator OnUpdate()
    {
        GameConductor.FreezePlayer();
        GameConductor.CameraStateTrigger("OblexCam");
        yield return(new WaitForSeconds(2));

        // todo: shwink sound and animations
        GameConductor.GetGate.transform.Translate(0, -10, 0);
        Juicer.PlaySound(1);
        Juicer.ShakeCamera(0.1f);
        yield return(new WaitForSeconds(1));

        GameConductor.CameraStateTrigger("NextState");
        yield return(new WaitForSeconds(1));

        Juicer.PlaySound(0);
        Juicer.ShakeCamera(1);
        yield return(new WaitForSeconds(1));

        Juicer.PlaySound(1);
        Juicer.PlaySound(0);
        GameConductor.GetCurtain.transform.Translate(0, -10, 0);
        foreach (var npc in GameConductor.GetBandNPCs)
        {
            npc.transform.Translate(0, -10, 0);
        }
        GameConductor.GetOblexBody.SetActive(true);
        foreach (var npc in GameConductor.GetNPCs)
        {
            npc.GetComponentInChildren <OblexNPC>()?.Activate();
        }
        // todo: disable doors
        GameConductor.IsOblexRevealed = true;
        yield return(new WaitForSeconds(3));

        GameConductor.UnfreezePlayer();
        GameConductor.CameraStateTrigger("FocusPlayer");
        while (GameConductor.NPCsKilled < 11)
        {
            yield return(null);
        }
    }
예제 #22
0
 private void Start()
 {
     conductor = gameObject.GetComponent <GameConductor>();
 }
예제 #23
0
 public void OnExit()
 {
     GameConductor.SetShowHud(false);
     ScreenFader.FadeOut();
     NextState = new CreditsState();
 }
예제 #24
0
 public override void OnSecondaryActionFinished()
 {
     GameConductor.IsSleeping = true;
     GameConductor.FreezePlayer();
     // todo: play sound
 }
 public TwoPlayersModeConsoleGame()
 {
     SetUsers();
     _gameConductor = new GameConductor();
     _moveResult    = _gameConductor.Start();
 }
예제 #26
0
 public override void OnPrimaryActionFinished()
 {
     GameConductor.IsMaidAQuitter = true;
     GameConductor.EnqueueReset(() => GameConductor.IsMaidAQuitter = false);
     transform.parent.position = TargetQuitLocation.position;
 }
 public TwoPlayersModeConsoleGame(ChessGameState state)
 {
     _players       = state.Players;
     _gameConductor = new GameConductor(state);
     _moveResult    = state.LastGameMoveResult;
 }
예제 #28
0
 public void OnExit()
 {
     // MainGameState is implemented as a scriptableobject, so get it from GameConductor
     NextState = GameConductor.GetScriptableGameStateOfType <MainGameState>();
 }
예제 #29
0
 public void OnEnter()
 {
     GameConductor.CameraStateTrigger("Initialize");
     GameConductor.ResetStates();
     GameConductor.AdvanceDay();
 }
예제 #30
0
 public void OnEnter()
 {
     GameConductor.CameraStateTrigger("Initialize");
     MusicBox.ChangeMusic(Song.Game.ToInt());
 }