Exemple #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;
    }
Exemple #2
0
    private UniRx.IObservable <BigDouble> CreateCombinedObservable(int typeIndex)
    {
        Func <BigDouble, float, BigDouble> func = BonusTypeHelper.CreateBigDoubleFunction((BonusTypeEnum)typeIndex);

        return(from bonus in Singleton <PerkMilestoneRunner> .Instance.BonusMult[typeIndex].CombineLatest(Singleton <GearBoostRunner> .Instance.BonusMult[typeIndex], (BigDouble bonus, float mult) => func(bonus, mult)).CombineLatest(Singleton <GearSetCollectionRunner> .Instance.BonusMult[typeIndex], (BigDouble bonus, float mult) => func(bonus, mult))
               select(!(bonus >= BigDouble.ZERO)) ? BigDouble.ZERO : bonus);
    }