/// <summary>
        ///     Gets the storage loot percentage.
        /// </summary>
        public int GetStorageLootPercentage(LogicResourceData data)
        {
            if (LogicDataTables.GetDarkElixirData() == data)
            {
                return(this.DarkElixirStorageLootPercentage);
            }

            return(this.ResourceStorageLootPercentage);
        }
Esempio n. 2
0
        /// <summary>
        ///     Gets the resource production loot percentage.
        /// </summary>
        public int GetResourceProductionLootPercentage(LogicResourceData data)
        {
            if (LogicDataTables.GetDarkElixirData() == data)
            {
                return(this._darkElixirProductionLootPercentage);
            }

            return(this._resourceProductionLootPercentage);
        }
        /// <summary>
        ///     Gets the cart loot cap.
        /// </summary>
        public int GetCartLootCap(LogicResourceData data)
        {
            if (data == null || data.PremiumCurrency)
            {
                return(0);
            }

            if (LogicDataTables.GetDarkElixirData() == data)
            {
                return(this.CartLootCapDarkElixir);
            }

            return(this.CartLootCapResource);
        }
        /// <summary>
        ///     Gets the storage loot cap.
        /// </summary>
        public int GetStorageLootCap(LogicResourceData data)
        {
            if (data == null || data.PremiumCurrency)
            {
                return(0);
            }

            if (LogicDataTables.GetDarkElixirData() == data)
            {
                return(this.DarkElixirStorageLootCap);
            }

            return(this.ResourceStorageLootCap);
        }
Esempio n. 5
0
        /// <summary>
        ///     Gets the resource diamond cost.
        /// </summary>
        public int GetResourceDiamondCost(int count, LogicResourceData data)
        {
            if (LogicDataTables.GetDarkElixirData() != data)
            {
                int resourceDiamondCost100;
                int resourceDiamondCost1000;
                int resourceDiamondCost10000;
                int resourceDiamondCost100000;
                int resourceDiamondCost1000000;
                int resourceDiamondCost10000000;

                if (data.GetVillageType() == 1)
                {
                    resourceDiamondCost100      = this._village2ResourceDiamondCost100;
                    resourceDiamondCost1000     = this._village2ResourceDiamondCost1000;
                    resourceDiamondCost10000    = this._village2ResourceDiamondCost10000;
                    resourceDiamondCost100000   = this._village2resourceDiamondCost100000;
                    resourceDiamondCost1000000  = this._village2resourceDiamondCost1000000;
                    resourceDiamondCost10000000 = this._village2ResourceDiamondCost10000000;
                }
                else
                {
                    resourceDiamondCost100      = this._resourceDiamondCost100;
                    resourceDiamondCost1000     = this._resourceDiamondCost1000;
                    resourceDiamondCost10000    = this._resourceDiamondCost10000;
                    resourceDiamondCost100000   = this._resourceDiamondCost100000;
                    resourceDiamondCost1000000  = this._resourceDiamondCost1000000;
                    resourceDiamondCost10000000 = this._resourceDiamondCost10000000;
                }

                if (count >= 1)
                {
                    if (count >= 100)
                    {
                        if (count >= 1000)
                        {
                            if (count >= 10000)
                            {
                                if (count >= 100000)
                                {
                                    if (count >= 1000000)
                                    {
                                        return(resourceDiamondCost1000000 + ((resourceDiamondCost10000000 - resourceDiamondCost1000000) * (count / 1000 - 1000) + 4500) / 9000);
                                    }

                                    return(resourceDiamondCost100000 + ((resourceDiamondCost1000000 - resourceDiamondCost100000) * (count / 100 - 1000) + 4500) / 9000);
                                }

                                return(resourceDiamondCost10000 + ((resourceDiamondCost100000 - resourceDiamondCost10000) * (count / 10 - 1000) + 4500) / 9000);
                            }

                            return(resourceDiamondCost1000 + ((resourceDiamondCost10000 - resourceDiamondCost1000) * (count - 1000) + 4500) / 9000);
                        }

                        return(resourceDiamondCost100 + ((resourceDiamondCost1000 - resourceDiamondCost100) * (count - 100) + 450) / 900);
                    }

                    return(resourceDiamondCost100);
                }

                return(0);
            }
            else
            {
                return(this.GetDarkElixirDiamondCost(count));
            }
        }