FANDOM


If you have Visual Studio (any version), you can plug this into your C# Program, and it will calculate all of the values for drop chance, and simulate drops.

Here's how you can implement this processor. First, in Visual Studio (at least 2010), you will need to create a New Command Line Project. This will create a Project with "Program.cs." Before we mess with the program, you will need to create the main project.

First, create a new Class called "InflationDropChance.cs." This will create a blank file in Visual Studio, and you will be able to edit it. Then, you need to drop this class into the file (in between the namespace brackets). So, for example, it should look like this:

using System;
using System.Collections.Generic;
namespace Inflation
{
   public class InflationDropChance
   {
     <LOTS OF CODE>
   }
}

Want this huge amount of code? Here it is. Drop this where you see <LOTS OF CODE>:

       public double EnemyHP { get; set; }
       public double EnemyATK { get; set; }
       public double EnemyXP { get; set; }
       public double EnemyGold { get; set; }
       public double StageValue { get; set; }
       public double? Item1DropRate { get; set; }
       public double? Item2DropRate { get; set; }
       public double? Item3DropRate { get; set; }
       public double BaseHP { get; set; }
       public double BaseATK { get; set; }
       public double BaseDEF { get; set; }
       public double BaseSPD { get; set; }
       public double BaseLUK { get; set; }
       public double AdditiveHP { get; set; }
       public double AdditiveATK { get; set; }
       public double AdditiveDEF { get; set; }
       public double AdditiveSPD { get; set; }
       public double AdditiveLUK { get; set; }
       public double HPMultiplier { get; set; }
       public double ATKMultiplier { get; set; }
       public double DEFMultiplier { get; set; }
       public double SPDMultiplier { get; set; }
       public double LUKMultiplier { get; set; }
       public double HPKP { get; set; }
       public double ATKKP { get; set; }
       public double DEFKP { get; set; }
       public double SPDKP { get; set; }
       public double LUKKP { get; set; }
       public double PlayerLevel { get; set; }
       public double CharacterLevel { get; set; }
       public double GameOverCount { get; set; }
       public double FinalEnemyPointValue
       {
           get
           {
               double points = EnemyStageValue;
               if (StageValue >= 20000)
                   points *= 1.05;
               if (Item1DropRate != null)
                   points += 5;
               if (Item2DropRate != null)
                   points += 10;
               if (Item3DropRate != null)
                   points += 15;
               if (Item1DropRate != null)
                   points *= 1.05;
               if (Item2DropRate != null)
                   points *= 1.075;
               if (Item3DropRate != null)
                   points *= 1.1;
               return points;
           }
       }
       public double BaseEnemyPointValue
       {
           get { return EnemyHP / 15 + EnemyATK / 2 + EnemyXP / 475000 + EnemyGold / 50; }
       }
       public double EnemyStageValue
       {
           get { return (BaseEnemyPointValue*2 + StageValue*3)/5; }
       }
       public double BaseEnemyItemTranslation
       {
           get
           {
               double finalEnemyPointValue = FinalEnemyPointValue;
               if (finalEnemyPointValue <= 500) return (finalEnemyPointValue*4 + 1000)/6;
               if (finalEnemyPointValue <= 1000) return (finalEnemyPointValue*4 + 2000)/6;
               if (finalEnemyPointValue <= 2000) return (finalEnemyPointValue*4 + 4000)/6;
               return (finalEnemyPointValue*3 + 4000)/5;
           }
       }
       public double BaseComparisonItemTranslation
       {
           get { return FinalLUK/BaseEnemyItemTranslation*0.5 + 0.28; }
       }
       public double HPModifier
       {
           get { return HPMultiplier + HPKP*PlayerLevelModifier*0.06; }
       }
       public double ATKModifier
       {
           get { return ATKMultiplier + ATKKP*PlayerLevelModifier*0.07; }
       }
       public double DEFModifier
       {
           get { return DEFMultiplier + DEFKP*PlayerLevelModifier*0.07; }
       }
       public double SPDModifier
       {
           get { return SPDMultiplier + SPDKP*PlayerLevelModifier*0.075; }
       }
       public double LUKModifier
       {
           get { return LUKMultiplier + LUKKP*PlayerLevelModifier*0.08; }
       }
       public double HPModifierValue
       {
           get { return AdditiveHP + (AdditiveHP + BaseHP)*HPModifier; }
       }
       public double ATKModifierValue
       {
           get { return AdditiveATK + (AdditiveATK + BaseATK)*ATKModifier; }
       }
       public double DEFModifierValue
       {
           get { return AdditiveDEF + (AdditiveDEF + BaseDEF)*DEFModifier; }
       }
       public double SPDModifierValue
       {
           get { return AdditiveSPD + (AdditiveSPD + BaseSPD)*SPDModifier; }
       }
       public double LUKModifierValue
       {
           get { return AdditiveLUK + (AdditiveLUK + BaseLUK)*LUKModifier; }
       }
       public double FinalHP
       {
           get { return HPModifierValue + BaseHP; }
       }
       public double FinalATK
       {
           get { return ATKModifierValue + BaseATK; }
       }
       public double FinalDEF
       {
           get { return DEFModifierValue + BaseDEF; }
       }
       public double FinalSPD
       {
           get { return SPDModifierValue + BaseSPD; }
       }
       public double FinalLUK
       {
           get { return LUKModifierValue + BaseLUK; }
       }
       public double PlayerLevelModifier
       {
           get { return (PlayerLevel + CharacterLevel)*0.25 + 0.75; }
       }
       public double GameOverModifier
       {
           get
           {
               double gameOverModifier = GameOverCount;
               if (gameOverModifier < 6000) gameOverModifier /= 9000;
               else gameOverModifier /= 24000;
               if (GameOverCount%3 == 0) gameOverModifier += 0.05;
               if (GameOverCount%8 == 0 || GameOverCount%5 == 0) gameOverModifier += 0.1;
               if (GameOverCount%11 == 0) gameOverModifier += 0.05;
               gameOverModifier = Math.Min(0.6, gameOverModifier);
               int[] divisibleModifiers = {7, 13, 23, 5, 1, 59, 68, 89, 111, 171, 131, 143, 121, 123};
               foreach (var m in divisibleModifiers)
                   if (GameOverCount%m == 0)
                       gameOverModifier += 0.05;
               return Math.Min(0.8, gameOverModifier);
           }
       }
       public double LukWariai
       {
           get { return FinalLUK/(FinalHP + FinalATK + FinalDEF + FinalSPD + FinalLUK); }
       }
       public double LuckBasedTranslationValue
       {
           get { return BaseComparisonItemTranslation + LukWariai*(1.6 - GameOverModifier); }
       }
       public double CappedLuckBonus
       {
           get
           {
               var luckBasedTranslationValue = LuckBasedTranslationValue;
               luckBasedTranslationValue += Math.Min(0.1, FinalLUK/2000*0.1);
               luckBasedTranslationValue += Math.Min(0.15, FinalLUK/25000*0.15);
               luckBasedTranslationValue += Math.Min(0.3, FinalLUK/300000*0.3);
               luckBasedTranslationValue += Math.Min(0.1, FinalLUK/500000*0.1);
               return luckBasedTranslationValue;
           }
       }
       public double FinalLuckValue
       {
           get
           {
               var cappedLuckBonus = CappedLuckBonus;
               if (cappedLuckBonus > 1) cappedLuckBonus = (cappedLuckBonus + 2)/3;
               if (cappedLuckBonus > 2) cappedLuckBonus = (cappedLuckBonus + 4)/3;
               if (cappedLuckBonus > 2.5) cappedLuckBonus = (cappedLuckBonus + 7.5)/4;
               return Math.Min(3, cappedLuckBonus);
           }
       }
       public Dictionary<int, long> TestDropRates(int numberOfTimes)
       {
           int numberOfItems = Item3DropRate != null ? 3 : (Item2DropRate != null ? 2 : 1);
           var dropRates = new Dictionary<int, long>();
           for (int i = 1; i <= numberOfItems; i++)
               dropRates.Add(i, 0);
           var r = new Random(int.Parse(DateTime.Now.ToString("hmmss")));
           for (int i = 0; i < numberOfTimes; i++)
           {
               var dropTest = r.NextDouble()*numberOfItems*0.85*(FinalLuckValue + 1)/2 + 1;
               int dropItem = (int)Math.Round(dropTest, 0);
               if (dropItem > numberOfItems) dropItem = numberOfItems;
               if (dropItem == 1 && r.NextDouble() < Item1DropRate) dropRates[1]++;
               if (dropItem == 2 && r.NextDouble() < Item2DropRate) dropRates[2]++;
               if (dropItem == 3 && r.NextDouble() < Item3DropRate) dropRates[3]++;
           }
           return dropRates;
       }

Now, you should have InflationDropChance.cs finished. Now, we get to edit Program.cs. Inside program.cs, there should already be static void Main(string[] args) {}. Inside the brackets, you will want to invoke the InflationDropChance class and execute the "TestDropRates" method. Then, you'll need to output what goes on. Here's how I setup my program:

   class Program
   {
       static void Main(string[] args)
       {
           var inflationDropChance = new InflationDropChance()
           {
               EnemyHP = 700000,
               EnemyATK = 6800,
               EnemyXP = 25000000,
               EnemyGold = 1000,
               StageValue = 80,
               BaseATK = 30000,
               BaseDEF = 45000,
               BaseSPD = 2000,
               BaseHP =  35000,
               BaseLUK = 1000,
               GameOverCount = 100,
               PlayerLevel = 6,
               CharacterLevel = 3,
               ATKKP = 1,
               HPKP = 1,
               LUKKP = 2,
               ATKMultiplier = 1.25,
               DEFMultiplier = 1.8,
               AdditiveATK = 4000,
               AdditiveDEF = 5,
               AdditiveLUK = 1000,
               Item1DropRate = 0.3,
               Item2DropRate = 0.18,
               Item3DropRate = 0.06
           };
           int baseLUK = 5000;
           int maxLUK = 80000;
           for (int luk = baseLUK; luk <= maxLUK; luk += 5000)
           {
               inflationDropChance.BaseLUK = luk;
               var dropChance = inflationDropChance.TestDropRates(10000);
               long noDrop = 10000 - dropChance.Sum(s => s.Value);
               string noDrops = string.Format("No: {0} ({1}%)", noDrop, Math.Round((((double)noDrop) / 10000) * 100, 3));
               string drop1 = string.Format("1: {0} ({1}%)", dropChance[1], Math.Round((((double)dropChance[1]) / 10000) * 100, 3));
               string drop2 = string.Format("2: {0} ({1}%)", dropChance[2], Math.Round((((double)dropChance[2]) / 10000) * 100, 3));
               string drop3 = string.Format("3: {0} ({1}%)", dropChance[3], Math.Round((((double)dropChance[3]) / 10000) * 100, 3));
               Console.WriteLine("BaseLUK {0} (LukWarai {1}): {2}, {3}, {4}, {5}", luk, inflationDropChance.FinalLuckValue, noDrops, drop1, drop2, drop3);
           }
           Console.WriteLine("Ending...");
       }

I put a breakpoint on "Console.WriteLine("Ending..."); which allows me to look at the console window and see the output. But, you can probably code what output you want. Look up some coding tutorials and experiment!

Enjoy!

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.