Exemplo n.º 1
0
    private void CalculateTrophiesMultiplier(int tier)
    {
        BigDouble bigDouble  = new BigDouble(1.0);
        BigDouble bigDouble2 = new BigDouble(1.0);
        BigDouble bigDouble3 = new BigDouble(1.0);

        for (int i = 1; i <= tier; i++)
        {
            TournamentTierConfig tournamentTierConfig = Singleton <EconomyHelpers> .Instance.GetTournamentTierConfig(i);

            Func <BigDouble, float, BigDouble> func = BonusTypeHelper.CreateBigDoubleFunction(tournamentTierConfig.Bonus.BonusType);
            switch (tournamentTierConfig.Bonus.BonusType)
            {
            case BonusTypeEnum.TapDamage:
                bigDouble = func(bigDouble, tournamentTierConfig.Bonus.Amount);
                break;

            case BonusTypeEnum.AllCompanionDamage:
                bigDouble2 = func(bigDouble2, tournamentTierConfig.Bonus.Amount);
                break;

            case BonusTypeEnum.AllDamage:
                bigDouble3 = func(bigDouble3, tournamentTierConfig.Bonus.Amount);
                break;
            }
        }
        TrophyHeroDamageMultiplier.Value      = bigDouble;
        TrophyCompanionDamageMultiplier.Value = bigDouble2;
        TrophyAllDamageMultiplier.Value       = bigDouble3;
    }
Exemplo n.º 2
0
    private void OnEnable()
    {
        m_ttc = Singleton <EconomyHelpers> .Instance.GetTournamentTierConfig(PlayerData.Instance.Trophies.Value + 1);

        if (m_ttc != null)
        {
            StartCoroutine(TrophyProgressSequence());
        }
        else
        {
            base.gameObject.SetActive(value: false);
        }
    }
Exemplo n.º 3
0
    private void OnEnable()
    {
        TournamentTierConfig tournamentTierConfig = Singleton <EconomyHelpers> .Instance.GetTournamentTierConfig(PlayerData.Instance.Trophies.Value + 1);

        m_progressMedalsText.text = PlayerData.Instance.Medals.Value + "/" + tournamentTierConfig.Requirement;
        float num = (float)PlayerData.Instance.Medals.Value / (float)tournamentTierConfig.Requirement;

        m_progressSlider.value = num;
        int num2 = Mathf.Min(Mathf.FloorToInt(num / 0.25f), m_steps.Length);

        for (int i = 0; i < num2; i++)
        {
            m_steps[i].SetActive(value: true);
        }
    }
Exemplo n.º 4
0
    public void TryToBuyTrophy(bool showUnlocking = true)
    {
        TournamentTierConfig tournamentTierConfig = Singleton <EconomyHelpers> .Instance.GetTournamentTierConfig(PlayerData.Instance.Trophies.Value + 1);

        if (tournamentTierConfig != null && tournamentTierConfig.Requirement <= PlayerData.Instance.Medals.Value)
        {
            PlayerData.Instance.Trophies.Value = (int)tournamentTierConfig.Tier;
            Singleton <FundRunner> .Instance.RemoveMedals(tournamentTierConfig.Requirement);

            if (showUnlocking)
            {
                BindingManager.Instance.TournamentTrophyUnlockedParent.ShowInfo();
            }
        }
    }
Exemplo n.º 5
0
    private void OnEnable()
    {
        Text           component = base.gameObject.GetComponent <Text>();
        TournamentTier tier      = m_tier;

        if (m_tier == TournamentTier.Invalid)
        {
            tier = (TournamentTier)PlayerData.Instance.Trophies.Value;
        }
        if (m_placement == Placement.Title)
        {
            component.text = PersistentSingleton <LocalizationService> .Instance.Text("UI.Tournament.Trophies." + tier.ToString());

            return;
        }
        TournamentTierConfig tournamentTierConfig = Singleton <EconomyHelpers> .Instance.GetTournamentTierConfig((int)tier);

        component.text = BonusTypeHelper.GetAttributeText(tournamentTierConfig.Bonus.BonusType, tournamentTierConfig.Bonus.Amount);
    }