Esempio n. 1
0
        /// <summary>
        /// Set a species to display the stats of the current top levels. This can help in determine if a new creature is good.
        /// </summary>
        /// <param name="species"></param>
        /// <param name="highLevels"></param>
        public void SetSpecies(Species species, int[] highLevels, int[] lowLevels)
        {
            if (species == null)
            {
                LbHeader.Text       = "no species selected";
                LbStatNames.Text    = string.Empty;
                LbStatValues.Text   = string.Empty;
                LbStatLevels.Text   = string.Empty;
                LbLowestValues.Text = string.Empty;
                LbLowestLevels.Text = string.Empty;
                return;
            }

            if (highLevels == null)
            {
                highLevels = new int[Values.STATS_COUNT];
            }
            if (lowLevels == null)
            {
                lowLevels = new int[Values.STATS_COUNT];
            }

            LbHeader.Text = $"Best stat values for bred creatures without imprinting of the species {species.DescriptiveNameAndMod} in this library.";
            string sbNames        = null;
            string sbValues       = null;
            string sbLevels       = null;
            string sbLowestValues = null;
            string sbLowestLevels = null;

            foreach (var si in Values.statsDisplayOrder)
            {
                if (!species.UsesStat(si))
                {
                    continue;
                }

                var precision          = Utils.Precision(si);
                var statValue          = StatValueCalculation.CalculateValue(species, si, highLevels[si], 0, true, 1, 0);
                var statRepresentation = precision == 3 ? $"{statValue * 100:0.0} %" : $"{statValue:0.0}    ";

                sbNames  += $"{Utils.StatName(si, customStatNames: species.statNames)}\n";
                sbValues += statRepresentation + "\n";
                sbLevels += highLevels[si] + "\n";

                statValue          = StatValueCalculation.CalculateValue(species, si, lowLevels[si], 0, true, 1, 0);
                statRepresentation = precision == 3 ? $"{statValue * 100:0.0} %" : $"{statValue:0.0}    ";

                sbLowestValues += statRepresentation + "\n";
                sbLowestLevels += lowLevels[si] + "\n";
            }

            LbStatNames.Text    = sbNames;
            LbStatValues.Text   = sbValues;
            LbStatLevels.Text   = sbLevels;
            LbLowestValues.Text = sbLowestValues;
            LbLowestLevels.Text = sbLowestLevels;
        }
Esempio n. 2
0
 public void setGraph(Species species, int statIndex, int wildLevels, int domLevels, bool tamed, double TE, double imprinting)
 {
     if (species != null && statIndex >= 0 && statIndex < 12)
     {
         CreatureStat stat = species.stats[statIndex];
         serie.Points.Clear();
         serie.Points.AddXY("Base", stat.BaseValue);
         serie.Points.AddXY("Wild", StatValueCalculation.CalculateValue(species, statIndex, wildLevels, 0, false, 0, 0));
         serie.Points.AddXY("Tamed", StatValueCalculation.CalculateValue(species, statIndex, wildLevels, 0, true, TE, 0));
         serie.Points.AddXY("Dom", StatValueCalculation.CalculateValue(species, statIndex, wildLevels, domLevels, true, TE, 0));
         serie.Points.AddXY("Impr", StatValueCalculation.CalculateValue(species, statIndex, wildLevels, domLevels, true, TE, imprinting));
     }
 }
Esempio n. 3
0
 public void SetLevel(Species species, int wildLevel)
 {
     if (levelGraphMax > 0)
     {
         SuspendLayout();
         labelWildLevels.Width    = 60 + 68 * (wildLevel > levelGraphMax ? levelGraphMax : wildLevel) / levelGraphMax;
         labelImprinting.Width    = 60;
         labelDomLevels.Width     = 60;
         labelImprinting.Location = new Point(33 + labelWildLevels.Width, 0);
         labelDomLevels.Location  = new Point(35 + labelWildLevels.Width + labelImprinting.Width, 0);
         labelWildLevels.Text     = (StatValueCalculation.CalculateValue(species, statIndex, wildLevel, 0, true, 1, 0) * (percent ? 100 : 1)).ToString() + (percent ? "%" : "");
         labelImprinting.Text     = (StatValueCalculation.CalculateValue(species, statIndex, wildLevel, 0, true, 1, 1) * (percent ? 100 : 1)).ToString() + (percent ? "%" : "");
         labelDomLevels.Text      = (StatValueCalculation.CalculateValue(species, statIndex, wildLevel, maxDomLevel, true, 1, 1) * (percent ? 100 : 1)).ToString() + (percent ? "%" : "");
         ResumeLayout();
     }
 }