示例#1
0
        // Update is called once per frame
        void Update()
        {
            Reset();
            //cheatcode of leveling up
            if (Input.GetKey(KeyCode.L) && !levelUpPressed)
            {
                decay          = 1f;
                levelUpPressed = true;

                Debug.Log("Level up cheatcode entered");
                if (levelController.CurrentLevel == 1)
                {
                    var card = CardManager.Instance.SetLevelTwo();
                    levelProgressScript.UpdateValue((PlotCard)card);
                }
                else if (levelController.CurrentLevel == 2)
                {
                    var card = CardManager.Instance.SetLevelThree();
                    levelProgressScript.UpdateValue((PlotCard)card);
                }
            }

            //cheatcode for maxing out metrics
            if (Input.GetKey(KeyCode.M))
            {
                Debug.Log("Metrics boost cheatcode entered");
                new MetricsModifier(95, 95, 95).Modify();
                MetricManager.Instance.RenderMetrics();
            }

            // Cheat code for getting metrics to low, useful for viewing natural disasters
            if (Input.GetKey(KeyCode.N))
            {
                Debug.Log("Metrics lower cheatcode entered");
                new MetricsModifier(95, 95, 95).Modify();
                new MetricsModifier(-70, -70, -75).Modify();
                MetricManager.Instance.RenderMetrics();
            }

            // Cheat code for killing the player, setting all metrics to zero.
            if (Input.GetKey(KeyCode.K))
            {
                Debug.Log("Metrics lower cheatcode entered");
                new MetricsModifier(-95, -95, -95).Modify();
                MetricManager.Instance.RenderMetrics();
            }
        }
示例#2
0
        /// <summary>
        /// Handles when a user makes a decision for a card
        /// </summary>
        /// <param name="decisionValue">The value chosen by the user</param>
        private void HandleOptionPressed(int decisionValue)
        {
            if (!(currentCard is SliderCard) && PastTokens.ContainsKey(currentCard.Options[decisionValue].AdditionalState))
            {
                Debug.Log("addition state added: " + PastTokens[currentCard.Options[decisionValue].AdditionalState]);
                currentCard.HandleDecision(decisionValue, PastTokens[currentCard.Options[decisionValue].AdditionalState]);
            }
            else
            {
                currentCard.HandleDecision(decisionValue);
            }

            storyCardsTravelled.Add(currentCard);

            if (!(currentCard is SliderCard))
            {
                string key   = currentCard.Options[decisionValue].TokenKey;
                string value = currentCard.Options[decisionValue].TokenValue;
                if (!key.Equals(""))
                {
                    PastTokens.Add(key, value);
                }
            }

            if (IsFinalCard(currentCard))
            {
                GameWon = true;
                waitingForEventsDuration = 0f;
            }

            if (currentCard.ShouldAnimate)
            {
                waitingForFeedbackDuration = 3f;
                dialogueManager.ShowAnimationProgress(waitingForFeedbackDuration);
                animationHandler.PlayAnimation(currentCard.BuildingName, waitingForFeedbackDuration);
                SFXAudioManager.Instance.PlayConstructionSound();
            }
            else
            {
                waitingForFeedbackDuration = WAITING_FOR_FEEDBACK_DURATION;
            }

            if (currentCard is PlotCard)
            {
                levelProgress.UpdateValue((PlotCard)currentCard);
            }
            MoveToNextState();
        }