Exemple #1
0
 public static void ReturnBeeCraftingQuest(BeeSpecies primaryBeeSpecies)
 {
     if (currentQuests.ContainsKey($"BeeCrafted: {primaryBeeSpecies}"))
     {
         UnlockQuests($"BeeCrafted: {primaryBeeSpecies}");
     }
 }
Exemple #2
0
 public static void ReturnPureBreadBeeCraftingQuest(BeeSpecies primaryBeeSpecies, BeeSpecies secondaryBeeSpecies)
 {
     if (currentQuests.ContainsKey($"PureBredBee: {primaryBeeSpecies} {secondaryBeeSpecies}"))
     {
         UnlockQuests($"PureBredBee: {primaryBeeSpecies} {secondaryBeeSpecies}");
     }
 }
Exemple #3
0
        /// <summary>
        /// Make a bee with given stats
        /// </summary>
        /// <param name="beeType"><see cref="BeeType"/></param>
        /// <param name="species"><see cref="BeeSpecies"/></param>
        /// <param name="lifespan"><see cref="BeeLifeSpan"/></param>
        /// <param name="fertility">1 or greater</param>
        /// <param name="effect"><see cref="BeeEffect"/></param>
        /// <param name="prodSpeed"><see cref="BeeProductionSpeed"/></param>
        /// <returns>A <see cref="Bee"/> with the given stats</returns>
        public Bee MakeBeeWithStats(BeeType beeType = BeeType.DRONE, BeeSpecies species = BeeSpecies.FOREST, BeeLifeSpan lifespan = BeeLifeSpan.NORMAL, uint fertility = 2, BeeEffect effect = BeeEffect.NONE, BeeProductionSpeed prodSpeed = BeeProductionSpeed.NORMAL)
        {
            NormalBee normBee = new NormalBee()
            {
                pSpecies   = species,
                pLifespan  = lifespan,
                pFertility = fertility,
                pProdSpeed = prodSpeed,
                pEffect    = effect,
                sEffect    = effect,
                sFertility = fertility,
                sLifespan  = lifespan,
                sProdSpeed = prodSpeed,
                sSpecies   = species
            };

            switch (beeType)
            {
            case BeeType.QUEEN:
                return(new Bee(beeType, new QueenBee(normBee, normBee)));

            default:
                return(new Bee(beeType, normBee));
            }
        }
Exemple #4
0
        public static BeeSpecies[] GetCombinations(BeeSpecies s1, BeeSpecies s2)
        {
            var beeSpecies = new BeeSpecies[2] {
                s1, s2
            };
            var returnBeeList = new List <BeeSpecies>();

            var keys     = beeCombinations.Keys.ToArray();
            var comparor = new BeeCombinationDictionaryEqualityComparer();

            for (int i = 0; i < keys.Length; i++)
            {
                if (comparor.Equals(keys[i], beeSpecies))
                {
                    var temp = beeCombinations[keys[i]];

                    for (int j = 0; j < temp.Length; j++)
                    {
                        returnBeeList.Add(temp[i]);
                    }
                }
            }

            returnBeeList.Add(s1);
            returnBeeList.Add(s2);

            return(returnBeeList.ToArray());
        }
Exemple #5
0
        public static Items.Item[] GetBeeProduce(BeeSpecies species)
        {
            beeProduce.TryGetValue(species, out Items.Item[] produce);

            //* if the produce can't be found, then return a honey comb as it is probably a bug
            return(produce ?? new Items.Item[1] {
                new Items.HoneyComb(HoneyCombType.HONEY)
            });
        }
Exemple #6
0
        /// <summary>
        /// Returns a <see cref="BeeSpecies"/> depending on the given <see cref="BeeSpecies"/>
        /// </summary>
        /// <param name="s1">First <see cref="BeeSpecies"/></param>
        /// <param name="s2">Second <see cref="BeeSpecies"/></param>
        /// <returns>A new <see cref="BeeSpecies"/></returns>
        private BeeSpecies CombineSpecies(BeeSpecies s1, BeeSpecies s2)
        {
            BeeSpecies[] possibleSpecies = BeeDictionaries.GetCombinations(s1, s2);
            float[]      weights         = possibleSpecies.Length > 2 ? BeeDictionaries.GetWeights(possibleSpecies) : new float[] { 0.5f, 0.5f };

            var randomNum  = Rand(weights);
            var weightsSum = 0f;

            //* when the number generated is less than the current sum of the weights return that bee
            for (int i = 0; i < weights.Length; i++)
            {
                if (randomNum <= weightsSum)
                {
                    return(possibleSpecies[i]);
                }

                weightsSum += weights[i];
            }

            //* if for some reason the weights cannot work return the first bee in the combination list
            return(possibleSpecies[0]);
        }
Exemple #7
0
        public NormalBee(BeeSpecies species)
        {
            sSpecies = pSpecies = species;

            RandomizeStats();
        }
Exemple #8
0
 public static void CallPureBeeCraftedEvent(BeeSpecies species1, BeeSpecies species2)
 {
     pureBeeCraftedEvent(species1, species2);
 }
Exemple #9
0
 public static void CallBeeCraftedEvent(BeeSpecies species)
 {
     beeCraftedEvent(species);
 }
Exemple #10
0
        public static Color GetBeeColour(BeeSpecies species)
        {
            beeColour.TryGetValue(species, out Color colour);

            return(colour != null ? colour : new Color());
        }