コード例 #1
0
ファイル: MiniGame.cs プロジェクト: MakerDev/GongmongUs
 public void OnEnable()
 {
     OnStartMiniGame?.Invoke();
     MiniGameResult = new MiniGameResult();
     StartMiniGame();
     GameManager.Instance?.DisablePlayerControl();
 }
コード例 #2
0
    private void FinalTimerBeforeResult(MiniGameResult result)
    {
        if (!enterOnce)
        {
            //deactivate things
            enterOnce   = true;
            startofGame = false;
            Canvas.transform.GetChild(0).gameObject.SetActive(false);

            if (result == MiniGameResult.WIN)
            {
                timer = 10;
                CenterPointRotator.transform.rotation = Quaternion.Euler(CenterPointRotator.GetComponent <CameraOrbitation>().EulerInitRotation);
            }
            else if (result == MiniGameResult.LOSE)
            {
                timer = 2;
            }
        }

        if (result == MiniGameResult.WIN)
        {
            CenterPointRotator.transform.Rotate(0, 20 * Time.deltaTime, 0);
        }
        timer -= Time.deltaTime;
        if (timer <= 0)
        {
            gameManagerInstance.EndGame(result);
        }
    }
コード例 #3
0
    /// <summary>
    /// Отображает окно с результатами игры
    /// </summary>
    public void ShowResults(MiniGameResult result, MonoBehaviour manager, float TimeGame, string GameName, string Description)
    {
        _currentManager = manager;
        _time = TimeGame;

        if (spriteResults != null)
            spriteResults.gameObject.SetActive(true);
        if (spriteGoldMedal != null)
            spriteGoldMedal.gameObject.SetActive(result == MiniGameResult.Gold);
        if (spriteSilverMedal != null)
            spriteSilverMedal.gameObject.SetActive(result == MiniGameResult.Silver);
        if (spriteBronzeMedal != null)
            spriteBronzeMedal.gameObject.SetActive(result == MiniGameResult.Bronze);

        if (labelMimiGameName != null)
            labelMimiGameName.text = GameName;
        if (labelDescription != null)
            labelDescription.text = Description;

        if (labelMedalName != null)
            switch (result)
            {
                case MiniGameResult.Gold:
                    labelMedalName.text = "Золото";
                    break;

                case MiniGameResult.Silver:
                    labelMedalName.text = "Серебро";
                    break;

                case MiniGameResult.Bronze:
                    labelMedalName.text = "Бронза";
                    break;
            }
    }
コード例 #4
0
        private async Task <MiniGameResult> StopAtLocation(int location)
        {
            if (!AgentOutOnLimb.Instance.IsReadyBotanist)
            {
                await Coroutine.Wait(5000, () => AgentOutOnLimb.Instance.IsReadyBotanist);
            }

            if (!MiniGameBotanist.Instance.IsOpen || !AgentOutOnLimb.Instance.IsReadyBotanist || MiniGameBotanist.Instance.GetNumberOfTriesLeft < 1)
            {
                return(MiniGameResult.Error);
            }

            if (!AgentOutOnLimb.Instance.CursorLocked)
            {
                Logger.Info("Lock Cursor");
                MiniGameBotanist.Instance.PauseCursor();
                await Coroutine.Sleep(200);
            }

            AgentOutOnLimb.Instance.CursorLocation = location;

            GamelogManager.MessageRecevied += GamelogManagerOnMessageRecevied;
            HitResult = MiniGameResult.None;
            await Coroutine.Sleep(250);

            MiniGameBotanist.Instance.PressButton();
            var timeleft = MiniGameBotanist.Instance.GetTimeLeft * 1000;
            await Coroutine.Wait(timeleft, () => HitResult != MiniGameResult.None || SelectYesno.IsOpen);

            return(SelectYesno.IsOpen ? MiniGameResult.DoubleDown : HitResult);
        }
コード例 #5
0
ファイル: Player.cs プロジェクト: MakerDev/GongmongUs
 public void OnCompleteMission(MiniGameResult miniGameResult)
 {
     if (miniGameResult.Passed)
     {
         MissionsLeft -= 1;
         UpdatePlayerMissionProgress();
         CmdReportMissionComplete(MissionsLeft);
     }
 }
コード例 #6
0
 /// <summary>
 /// Отображает окно с результатами игры
 /// </summary>
 public void ShowResults(MiniGameResult result)
 {
     if (spriteResults != null)
         spriteResults.gameObject.SetActive(true);
     if (spriteGoldMedal != null)
         spriteGoldMedal.gameObject.SetActive(result == MiniGameResult.Gold);
     if (spriteSilverMedal != null)
         spriteSilverMedal.gameObject.SetActive(result == MiniGameResult.Silver);
     if (spriteBronzeMedal != null)
         spriteBronzeMedal.gameObject.SetActive(result == MiniGameResult.Bronze);
     if (labelTimeIsOut != null)
         labelTimeIsOut.gameObject.SetActive(result == MiniGameResult.TimeOut);
 }
コード例 #7
0
ファイル: MiniGame.cs プロジェクト: MakerDev/GongmongUs
    public void CompleteMiniGame(MiniGameResult miniGameResult)
    {
        MiniGameResult = miniGameResult;
        TurnOffGame();

        if (MiniGameResult.Passed)
        {
            AssignedPlayer.OnCompleteMission(miniGameResult);
            IsCompleted = true;

            if (_outline != null)
            {
                _outline.enabled = false;
            }
        }
    }
コード例 #8
0
        private void GamelogManagerOnMessageRecevied(object sender, ChatEventArgs e)
        {
            if (e.ChatLogEntry.MessageType == MessageType.SystemMessages)
            {
                if (e.ChatLogEntry.FullLine.IndexOf("hatchet", StringComparison.OrdinalIgnoreCase) >= 0)
                {
                    Logger.Info("Ready");
                    Logger.Info(e.ChatLogEntry.FullLine);
                }
            }

            //Hatchet Ready
            if (e.ChatLogEntry.MessageType == (MessageType)2105)
            {
                if (e.ChatLogEntry.FullLine.IndexOf("nothing", StringComparison.OrdinalIgnoreCase) >= 0)
                {
                    //Logger.Info("Not Close");
                    HitResult = MiniGameResult.NotClose;
                    GamelogManager.MessageRecevied -= GamelogManagerOnMessageRecevied;
                }
                else if (e.ChatLogEntry.FullLine.IndexOf("something close", StringComparison.OrdinalIgnoreCase) >= 0)
                {
                    //Logger.Info("Close");
                    HitResult = MiniGameResult.Close;
                    GamelogManager.MessageRecevied -= GamelogManagerOnMessageRecevied;
                }
                else if (e.ChatLogEntry.FullLine.IndexOf("very", StringComparison.OrdinalIgnoreCase) >= 0)
                {
                    //Logger.Info("Very Close");
                    HitResult = MiniGameResult.VeryClose;
                    GamelogManager.MessageRecevied -= GamelogManagerOnMessageRecevied;
                }
                else if (e.ChatLogEntry.FullLine.IndexOf("right on", StringComparison.OrdinalIgnoreCase) >= 0)
                {
                    //Logger.Info("On Top");
                    HitResult = MiniGameResult.OnTop;
                    GamelogManager.MessageRecevied -= GamelogManagerOnMessageRecevied;
                }
            }
        }