Пример #1
0
        protected void AwakeDynamic()
        {
            Settings s = Settings.Instance;

            StartPenalties = new Dictionary <GameDifficulty, PenaltyInfo>()
            {
                { GameDifficulty.EASY, new PenaltyInfo(HealthyEye,
                                                       s.easyStartTransparency,
                                                       s.easyStartEyePatch) },
                { GameDifficulty.MEDIUM, new PenaltyInfo(HealthyEye,
                                                         s.medStartTrasparency,
                                                         s.medStartEyePatch) },
                { GameDifficulty.HARD, new PenaltyInfo(HealthyEye,
                                                       s.hardStartTrasparency,
                                                       s.hardStartEyePatch) }
            };

            EndPenalties = new Dictionary <GameDifficulty, PenaltyInfo>
            {
                { GameDifficulty.EASY, new PenaltyInfo(HealthyEye,
                                                       s.easyEndTransparency,
                                                       s.easyEndEyePatch) },
                { GameDifficulty.MEDIUM, new PenaltyInfo(HealthyEye,
                                                         s.medEndTransparency,
                                                         s.medEndEyePatch) },
                { GameDifficulty.HARD, new PenaltyInfo(HealthyEye,
                                                       s.hardEndTransparency,
                                                       s.hardEndEyePatch) },
            };

            PenaltyInfoNow = new PenaltyInfo(GetStartPenalty());
        }
Пример #2
0
        public void ResetPenalty()
        {
            switch (PolicyResetOnDeath)
            {
            case (GamePolicy.IncreaseResetOnDeath.TO_ZERO):
            {
                ResetPenaltyToZero();
                break;
            }

            case (GamePolicy.IncreaseResetOnDeath.LAST):
            {
                ResetPenaltyNowTo(PenaltyInfoLast);
                break;
            }

            case (GamePolicy.IncreaseResetOnDeath.NO_RESET):
            {
                break;
            }
            }
            Debug.Log("Penalty reset to " + PenaltyInfoNow);
            PenaltyInfoLast = new PenaltyInfo(PenaltyInfoNow);
            Debug.Log("PenaltyInfoLast: " + PenaltyInfoLast);
        }
Пример #3
0
        public void IncreasePenaltyNow()
        {
            PenaltyInfoLast = new PenaltyInfo(PenaltyInfoNow);
            //Debug.Log("PenaltyInfoLast: " + PenaltyInfoLast.ToString());
            switch (PolicyIncreasePenalty)
            {
            case GamePolicy.IncreasePenalty.BY_STEPS: IncreasePenaltyNowBySteps(); break;

            case GamePolicy.IncreasePenalty.MANUAL: IncreasePenaltyNowManual(); break;
            }
        }
Пример #4
0
 /// <summary>
 /// This resets the penalty now to the value passed as parameter
 /// </summary>
 /// <param name="reset"></param>
 protected void ResetPenaltyNowTo(PenaltyInfo reset)
 {
     PenaltyInfoNow = new PenaltyInfo(reset);
     CheckAcceptableValues();
 }
Пример #5
0
 /// <summary>
 ///
 /// </summary>
 /// <remarks>This can't go below zero (if it does it's set to 0)</remarks>
 /// <param name="subbed">This PenaltyInfo contains values subbed to the PenaltyInfoNow</param>
 public void SubPenaltyNow(PenaltyInfo subbed)
 {
     PenaltyInfoNow.PenaltyTransparency -= subbed.PenaltyTransparency;
     PenaltyInfoNow.PenaltyEyePatch     -= subbed.PenaltyEyePatch;
     CheckAcceptableValues();
 }
Пример #6
0
 /// <summary>
 /// This manually increase the PenaltyInfoNow without regards of
 /// start and end penalty
 /// </summary>
 /// <remarks>Use this only if you don't want to increase of a fixed amount
 /// every step (you should use this always after you used this once)</remarks>
 /// <param name="added">This PenaltyInfo contains values added to the PenaltyInfoNow</param>
 public void IncreasePenaltyNow(PenaltyInfo added)
 {
     PenaltyInfoNow.PenaltyTransparency += added.PenaltyTransparency;
     PenaltyInfoNow.PenaltyEyePatch     += added.PenaltyEyePatch;
     CheckAcceptableValues();
 }
Пример #7
0
 protected void AwakeStatic()
 {
     PenaltyInfoNow = new PenaltyInfo(HealthyEye, StaticTrasp, StaticEyePatch);
 }
Пример #8
0
 public PenaltyInfo(PenaltyInfo o)
 {
     this.PenaltyTransparency = o.PenaltyTransparency;
     this.PenaltyEyePatch     = o.PenaltyEyePatch;
     this.PenaltyEye          = o.PenaltyEye;
 }