Example #1
0
        // SolventMix is a mix of Weed-leaves and chemical(s).
        public SolventMix(IChronic chronic, IChemical chemical) : base(chronic.Name + " " + chemical.Name, chronic.Description + " " + chemical.Description, chronic.Weight + chemical.Weight, chronic.Value)
        {
            Type = ItemType.SolventMix;

            _extractedOils = new Random().NextDouble() * (0.85 - 0.75) + 0.75;
            Chronic        = chronic;
            Chemical       = chemical;
            Solvent        = new Solvent(Chronic, Chemical);
        }
Example #2
0
        // SolventMix is a mix of Weed-leaves and chemical(s).
        public SolventMix(IChronic chronic, IChemical chemical)
            : base(chronic.Name + " " + chemical.Name, chronic.Description + " " + chemical.Description, chronic.Weight + chemical.Weight, chronic.Value)
        {
            Type = ItemType.SolventMix;

            _extractedOils = new Random().NextDouble() * (0.85 - 0.75) + 0.75;
            Chronic = chronic;
            Chemical = chemical;
            Solvent = new Solvent(Chronic, Chemical);
        }
Example #3
0
 // Solvent is a mix of THC (from Chronic) and Chemicals
 public Solvent(IChronic chronic, IChemical chemical)
 {
     Contents    = chemical.Contents;
     Age         = 0;
     THC         = 0;
     CBD         = 0;
     Yield       = 0;
     Quality     = chronic.Quality;
     Name        = chronic.Name + chemical.Name;
     Description = chemical.Description;
 }
Example #4
0
        // Add two Chronic type's together into one.
        public IChronic Add(ref IChronic toAdd)
        {
            THC = ((THC * Yield) + (toAdd.THC * toAdd.Yield)) / (Yield + toAdd.Yield);
            CBD = ((CBD * Yield) + (toAdd.CBD * toAdd.Yield)) / (Yield + toAdd.Yield);

            Yield += toAdd.Yield;

            toAdd.ImproveYield(0);
            toAdd.ImproveTHC(0);
            toAdd.ImproveCBD(0);
            toAdd.SetStage(Stage.Dead);

            return(this);
        }
        public void StorageAndItem_GrowAndSellToShop_ShopItemAmountIncrease()
        {
            IContainer FirstTrousers = new Trousers();
            IChronic   GanjaTest     = new MasterKush();
            IContainer MasonJar      = new SmallMasonJar();

            for (int i = 0; i < GanjaTest.SeedingAge; i++)
            {
                GanjaTest.Grow(Water.Low, Light.None, Food.None);
            }

            for (int i = 0; i < GanjaTest.FloweringAge; i++)
            {
                GanjaTest.Grow(Water.Low, Light.Spring, Food.None);
            }

            for (int i = 0; i < 20; i++)
            {
                GanjaTest.Grow(Water.Medium, Light.Summer, Food.None);
            }

            IChronic SellTest = GanjaTest.Harvest().Harvest;

            for (int i = 0; i < SellTest.DryingAge; i++)
            {
                SellTest.Dry();
            }

            SellTest.Weck();
            for (int i = 0; i < 14; i++)
            {
                SellTest.Cure(MasonJar);
            }

            SellTest.Finish();
            FirstTrousers.Add((IItem)SellTest);

            IShop shop = new Shop();

            shop.Sell((IItem)SellTest);

            Assert.IsTrue(shop.ItemAmount == 1);
        }
Example #6
0
 public FilterResult(IChronic chronic, ISolvent solvent)
 {
     Chronic = chronic;
     Solvent = solvent;
 }
        // What to do when harvesting the plant.
        public HarvestResult Harvest()
        {
            IChronic harvest   = null;
            IChronic trimmings = null;

            if (Stage == Stage.Flowering)
            {
                if (Age >= (FloweringAge - 5) && Age <= FloweringAge + 5)
                {
                    // Check if plant has reached optimal flowering age.
                    if (Age == FloweringAge)
                    {
                        Yield *= 1.05;
                    }
                    // Check the health of the plant and give bonus accordingly.
                    else if (Health >= 0 && Health <= 50)
                    {
                        Yield *= 1.01;
                    }
                    else if (Health > 50 && Health <= 90)
                    {
                        Yield *= 1.02;
                    }
                    else if (Health > 90 && Health <= 100)
                    {
                        Yield *= 1.05;
                    }
                }

                // Causes a lot of stress for the plant.
                // Also since we cut the plant, set height to 10 cm.
                Health = 0;
                Age    = 0;
                Height = 0;

                trimmings = (IChronic)Clone();
                trimmings.SetStage(Stage.Harvesting);
                // Trimmings has lower THC % compared to the real harvest.
                trimmings.ImproveTHC(0.2);
                // Trimmings has lower CBD % compared to the real harvest.
                trimmings.ImproveCBD(0.2);
                // Trimmings yield is higher, with a far lower THC percentage.
                trimmings.ImproveYield(3);

                // Actually harvest the buds, without yield modifier.
                harvest = (IChronic)Clone();
                // Different stage and height for the harvest.
                harvest.SetStage(Stage.Harvesting);

                // After cloning reduce the yield and trimmings.
                Yield = 0;

                // Cutting does not kill, set to clone stage.
                SetStage(Stage.Clone);
                // The plant that has been cut no longer has a THC or Yield.
                THC = 0;
                CBD = 0;
                // The regrowable clone wasn't destroyed, so add some height.
                Height = 10;
            }

            return(new HarvestResult(harvest, trimmings));
        }
        // Add two Chronic type's together into one.
        public IChronic Add(ref IChronic toAdd)
        {
            THC = ((THC * Yield) + (toAdd.THC * toAdd.Yield)) / (Yield + toAdd.Yield);
            CBD = ((CBD * Yield) + (toAdd.CBD * toAdd.Yield)) / (Yield + toAdd.Yield);

            Yield += toAdd.Yield;

            toAdd.ImproveYield(0);
            toAdd.ImproveTHC(0);
            toAdd.ImproveCBD(0);
            toAdd.SetStage(Stage.Dead);

            return this;
        }
Example #9
0
 public HarvestResult(IChronic harvest, IChronic trimmings)
 {
     Harvest   = harvest;
     Trimmings = trimmings;
 }
Example #10
0
 public HarvestResult(IChronic harvest, IChronic trimmings)
 {
     Harvest = harvest;
     Trimmings = trimmings;
 }