Ejemplo n.º 1
0
        private bool CanUpgrade(FirewallPortButtons option)
        {
            float rechargeBTCoinNeed = (this.BTCoinGain * RECHARGE_BTCOIN_MULT);
            float optionCost         = 0;

            switch (option)
            {
            case FirewallPortButtons.Charge:
                optionCost = this.Harvester.GetCost(FirewallPortButtons.Charge);
                break;

            case FirewallPortButtons.MaxCharge:
                optionCost = this.Harvester.GetCost(FirewallPortButtons.MaxCharge);
                break;

            case FirewallPortButtons.Difficulty:
                optionCost = this.Harvester.GetCost(FirewallPortButtons.Difficulty);
                break;

            case FirewallPortButtons.Regen:
                optionCost = this.Harvester.GetCost(FirewallPortButtons.Regen);
                break;
            }

            return((this.BTCoin - rechargeBTCoinNeed - optionCost) > (this.BTCoinGain * MIN_HACK_BTCOIN));
        }
        public float GetCost(FirewallPortButtons option)
        {
            string sCost = string.Empty;

            switch (option)
            {
            case FirewallPortButtons.Charge:
                sCost = this.References.WindowComputerRef.Shop.ChargeCost.InnerText;
                break;

            case FirewallPortButtons.MaxCharge:
                sCost = this.References.WindowComputerRef.Shop.MaxChargeCost.InnerText;
                break;

            case FirewallPortButtons.Difficulty:
                sCost = this.References.WindowComputerRef.Shop.DifficultyCost.InnerText;
                break;

            case FirewallPortButtons.Regen:
                sCost = this.References.WindowComputerRef.Shop.RegenCost.InnerText;
                break;
            }
            try {
                return(float.Parse(sCost.Replace('.', ',')));
            } catch {
                return(-1);
            }
        }
Ejemplo n.º 3
0
        private void AutoUpgrade(MyComputerPorts port)
        {
            if (!this.Auto_Upgrade)
            {
                return;
            }

            FirewallPortButtons priority = FirewallPortButtons.Charge;

            if (port == MyComputerPorts.PortA)
            {
                priority = portAInfo.GetPriority();
            }
            if (port == MyComputerPorts.PortB)
            {
                priority = portBInfo.GetPriority();
            }
            if (port == MyComputerPorts.PortC)
            {
                priority = portCInfo.GetPriority();
            }

            if (priority == FirewallPortButtons.Difficulty && this.CanUpgrade(FirewallPortButtons.Difficulty))
            {
                this.Harvester.RaiseDifficulty();
            }
            if (priority == FirewallPortButtons.Regen && this.CanUpgrade(FirewallPortButtons.Regen))
            {
                this.Harvester.RaiseRegen();
            }
            if (priority == FirewallPortButtons.MaxCharge && this.CanUpgrade(FirewallPortButtons.MaxCharge))
            {
                this.Harvester.RaiseMaxCharge();
            }
        }