Example #1
0
 private void FillBaseStats(StatValueSet baseStats)
 {
     spinner_BaseHP.SetValueAndDefault(baseStats.HP, baseStats.HP, toolTip);
     spinner_BaseMP.SetValueAndDefault(baseStats.MP, baseStats.MP, toolTip);
     spinner_BaseSP.SetValueAndDefault(baseStats.SP, baseStats.SP, toolTip);
     spinner_BasePA.SetValueAndDefault(baseStats.PA, baseStats.PA, toolTip);
     spinner_BaseMA.SetValueAndDefault(baseStats.MA, baseStats.MA, toolTip);
 }
Example #2
0
        private void UpdateGrid()
        {
            dgv_Stats.Rows.Clear();

            StatValueSet stats = new StatValueSet()
            {
                HP = (int)(spinner_BaseHP.Value),
                MP = (int)(spinner_BaseMP.Value),
                SP = (int)(spinner_BaseSP.Value),
                PA = (int)(spinner_BasePA.Value),
                MA = (int)(spinner_BaseMA.Value)
            };

            StatValueSet growths = new StatValueSet()
            {
                HP = (int)(spinner_GrowthHP.Value),
                MP = (int)(spinner_GrowthMP.Value),
                SP = (int)(spinner_GrowthSP.Value),
                PA = (int)(spinner_GrowthPA.Value),
                MA = (int)(spinner_GrowthMA.Value)
            };

            StatValueSet multipliers = new StatValueSet()
            {
                HP = (int)(spinner_MultHP.Value),
                MP = (int)(spinner_MultMP.Value),
                SP = (int)(spinner_MultSP.Value),
                PA = (int)(spinner_MultPA.Value),
                MA = (int)(spinner_MultMA.Value)
            };

            for (int level = 1; level <= 99; level++)
            {
                StatValueSet multStats = new StatValueSet()
                {
                    HP = (stats.HP * multipliers.HP / 100),
                    MP = (stats.MP * multipliers.MP / 100),
                    SP = (stats.SP * multipliers.SP / 100),
                    PA = (stats.PA * multipliers.PA / 100),
                    MA = (stats.MA * multipliers.MA / 100)
                };

                StatValueSet <decimal> decimalStats = new StatValueSet <decimal>()
                {
                    HP = (multStats.HP / 16384.0M),
                    MP = (multStats.MP / 16384.0M),
                    SP = (multStats.SP / 16384.0M),
                    PA = (multStats.PA / 16384.0M),
                    MA = (multStats.MA / 16384.0M)
                };

                StatValueSet <decimal> displayStats = new StatValueSet <decimal>()
                {
                    HP = Math.Truncate(decimalStats.HP * 100.0M) / 100.0M,
                    MP = Math.Truncate(decimalStats.MP * 100.0M) / 100.0M,
                    SP = Math.Truncate(decimalStats.SP * 100.0M) / 100.0M,
                    PA = Math.Truncate(decimalStats.PA * 100.0M) / 100.0M,
                    MA = Math.Truncate(decimalStats.MA * 100.0M) / 100.0M
                };

                dgv_Stats.Rows.Add(level, displayStats.HP, displayStats.MP, displayStats.SP, displayStats.PA, displayStats.MA);

                stats.HP += (stats.HP / (growths.HP + level));
                stats.MP += (stats.MP / (growths.MP + level));
                stats.SP += (stats.SP / (growths.SP + level));
                stats.PA += (stats.PA / (growths.PA + level));
                stats.MA += (stats.MA / (growths.MA + level));
            }
        }