Skip to content

Commit

Permalink
feat(bingo): update bingo window layout
Browse files Browse the repository at this point in the history
  • Loading branch information
DorielRivalet committed Aug 17, 2023
1 parent d89d9f7 commit ccf7a19
Show file tree
Hide file tree
Showing 9 changed files with 350 additions and 92 deletions.
20 changes: 10 additions & 10 deletions MHFZ_Overlay/Models/Collections/BingoUpgradeCostProgressions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,47 +30,47 @@ public static class BingoUpgradeCostProgressions
},
{
BingoUpgradeType.BaseScoreMultiplier,
new LevelProgressionExponential { InitialValue = 50, ValueIncreaseFactor = 1.8 }
new LevelProgressionExponential { InitialValue = 50, ValueIncreaseFactor = 1.8M }
},
{
BingoUpgradeType.WeaponMultiplier,
new LevelProgressionExponential { InitialValue = 500, ValueIncreaseFactor = 1.4 }
new LevelProgressionExponential { InitialValue = 500, ValueIncreaseFactor = 1.4M }
},
{
BingoUpgradeType.CartsScore,
new LevelProgressionExponential { InitialValue = 250, ValueIncreaseFactor = 1.6 }
new LevelProgressionExponential { InitialValue = 250, ValueIncreaseFactor = 1.6M }
},
{
BingoUpgradeType.BonusScore,
new LevelProgressionExponential { InitialValue = 1200, ValueIncreaseFactor = 1.2 }
new LevelProgressionExponential { InitialValue = 1200, ValueIncreaseFactor = 1.2M }
},
{
BingoUpgradeType.MiddleSquareMultiplier,
new LevelProgressionExponential { InitialValue = 2500, ValueIncreaseFactor = 1.1 }
new LevelProgressionExponential { InitialValue = 2500, ValueIncreaseFactor = 1.1M }
},
{
BingoUpgradeType.ExtraCarts,
new LevelProgressionExponential { InitialValue = 1000, ValueIncreaseFactor = 2 }
},
{
BingoUpgradeType.StartingCostReduction,
new LevelProgressionExponential { InitialValue = 800, ValueIncreaseFactor = 1.5 }
new LevelProgressionExponential { InitialValue = 800, ValueIncreaseFactor = 1.5M }
},
{
BingoUpgradeType.BurningFreezingElzelionRerolls,
new LevelProgressionExponential { InitialValue = 500, ValueIncreaseFactor = 1.4 }
new LevelProgressionExponential { InitialValue = 500, ValueIncreaseFactor = 1.4M }
},
{
BingoUpgradeType.BurningFreezingElzelionRerollChance,
new LevelProgressionExponential { InitialValue = 500, ValueIncreaseFactor = 1.4 }
new LevelProgressionExponential { InitialValue = 500, ValueIncreaseFactor = 1.4M }
},
{
BingoUpgradeType.AchievementMultiplier,
new LevelProgressionExponential { InitialValue = 500, ValueIncreaseFactor = 1.4 }
new LevelProgressionExponential { InitialValue = 500, ValueIncreaseFactor = 1.4M }
},
{
BingoUpgradeType.SecretAchievementMultiplier,
new LevelProgressionExponential { InitialValue = 500, ValueIncreaseFactor = 1.4 }
new LevelProgressionExponential { InitialValue = 500, ValueIncreaseFactor = 1.4M }
},
});
}
16 changes: 8 additions & 8 deletions MHFZ_Overlay/Models/Collections/BingoUpgradeValueProgressions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public static class BingoUpgradeValueProgressions
{
{
BingoUpgradeType.BaseScoreMultiplier,
new LevelProgressionLinear { InitialValue = 1.1, ValueIncreasePerLevel = 0.1 }
new LevelProgressionLinear { InitialValue = 1.1M, ValueIncreasePerLevel = 0.1M }
},
{
BingoUpgradeType.BaseScoreFlatIncrease,
Expand All @@ -34,43 +34,43 @@ public static class BingoUpgradeValueProgressions
},
{
BingoUpgradeType.MiddleSquareMultiplier,
new LevelProgressionLinear { InitialValue = 1.05, ValueIncreasePerLevel = 0.05 }
new LevelProgressionLinear { InitialValue = 1.05M, ValueIncreasePerLevel = 0.05M }
},
{
BingoUpgradeType.WeaponMultiplier,
new LevelProgressionLinear { InitialValue = 1.02, ValueIncreasePerLevel = 0.02 }
new LevelProgressionLinear { InitialValue = 1.02M, ValueIncreasePerLevel = 0.02M }
},
{
BingoUpgradeType.ExtraCarts,
new LevelProgressionLinear { InitialValue = 0, ValueIncreasePerLevel = 1 }
},
{
BingoUpgradeType.StartingCostReduction,
new LevelProgressionLinear { InitialValue = 0.05, ValueIncreasePerLevel = 0.05 }
new LevelProgressionLinear { InitialValue = 0.05M, ValueIncreasePerLevel = 0.05M }
},
{
BingoUpgradeType.MiddleSquareRerollChance,
new LevelProgressionLinear { InitialValue = 0.0001, ValueIncreasePerLevel = 0.0001 }
new LevelProgressionLinear { InitialValue = 0.0001M, ValueIncreasePerLevel = 0.0001M }
},
{
BingoUpgradeType.BurningFreezingElzelionRerolls,
new LevelProgressionLinear { InitialValue = 1, ValueIncreasePerLevel = 1 }
},
{
BingoUpgradeType.BurningFreezingElzelionRerollChance,
new LevelProgressionLinear { InitialValue = 0.01, ValueIncreasePerLevel = 0.01 }
new LevelProgressionLinear { InitialValue = 0.01M, ValueIncreasePerLevel = 0.01M }
},
{
BingoUpgradeType.AchievementMultiplier,
new LevelProgressionLinear { InitialValue = 0.001, ValueIncreasePerLevel = 0.001 }
new LevelProgressionLinear { InitialValue = 0.001M, ValueIncreasePerLevel = 0.001M }
},
{
BingoUpgradeType.SecretAchievementMultiplier,
new LevelProgressionLinear { InitialValue = 1, ValueIncreasePerLevel = 1 }
},
{
BingoUpgradeType.BingoCompletionsMultiplier,
new LevelProgressionLinear { InitialValue = 1.1, ValueIncreasePerLevel = 0.1 }
new LevelProgressionLinear { InitialValue = 1.1M, ValueIncreasePerLevel = 0.1M }
},
});
}
12 changes: 6 additions & 6 deletions MHFZ_Overlay/Models/LevelProgressionExponential.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,31 @@ public sealed class LevelProgressionExponential
/// <summary>
/// The initial value of the first level.
/// </summary>
public int InitialValue { get; set; }
public decimal InitialValue { get; set; }

/// <summary>
/// The exponential increase of the value. This factor determines how much the value increases with each level. For example, if ValueIncreaseFactor is 1.5, then the value will increase by 50% with each level.
/// </summary>
public double ValueIncreaseFactor { get; set; }
public decimal ValueIncreaseFactor { get; set; }

/// <summary>
/// Calculates the value for that particular level.
/// </summary>
/// <param name="level"></param>
/// <returns>The calculated value.</returns>
public int CalculateExponentialValueForLevel(int level)
public decimal CalculateExponentialValueForLevel(int level)
{
return (int)Math.Ceiling(InitialValue * Math.Pow(ValueIncreaseFactor, level - 1));
return (decimal)Math.Ceiling(InitialValue * (decimal)Math.Pow((double)ValueIncreaseFactor, level - 1));
}

/// <summary>
/// Assumes the initial level starts at 1.
/// </summary>
/// <param name="maxLevel"></param>
/// <returns>The cumulative value at max level.</returns>
public int CalculateCumulativeValueForMaxLevel(int maxLevel)
public decimal CalculateCumulativeValueForMaxLevel(int maxLevel)
{
var cumulativeValue = 0;
var cumulativeValue = 0M;
for (int level = 1; level <= maxLevel; level++)
{
cumulativeValue += CalculateExponentialValueForLevel(level);
Expand Down
10 changes: 5 additions & 5 deletions MHFZ_Overlay/Models/LevelProgressionLinear.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ public sealed class LevelProgressionLinear
/// <summary>
/// The initial value of the first level.
/// </summary>
public double InitialValue { get; set; }
public decimal InitialValue { get; set; }

/// <summary>
/// The linear increase of the values. This factor determines how much the value increases with each level. For example, if ValueIncreasePerLevel is 10, then the value will increase by 10 with each level.
/// </summary>
public double ValueIncreasePerLevel { get; set; }
public decimal ValueIncreasePerLevel { get; set; }

/// <summary>
/// Calculate the value based on the level.
/// </summary>
/// <param name="level"></param>
/// <returns></returns>
public double CalculateLinearValueForLevel(int level)
public decimal CalculateLinearValueForLevel(int level)
{
return InitialValue + (ValueIncreasePerLevel * (level - 1));
}
Expand All @@ -34,9 +34,9 @@ public double CalculateLinearValueForLevel(int level)
/// </summary>
/// <param name="maxLevel"></param>
/// <returns>The cumulative value at max level.</returns>
public double CalculateCumulativeValueForMaxLevel(int maxLevel)
public decimal CalculateCumulativeValueForMaxLevel(int maxLevel)
{
var cumulativeValue = 0.0;
var cumulativeValue = 0M;
for (int level = 1; level <= maxLevel; level++)
{
cumulativeValue += CalculateLinearValueForLevel(level);
Expand Down
12 changes: 6 additions & 6 deletions MHFZ_Overlay/Models/LevelProgressionPower.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,31 @@ public sealed class LevelProgressionPower
/// <summary>
/// The initial value of the first level.
/// </summary>
public int InitialValue { get; set; }
public decimal InitialValue { get; set; }

/// <summary>
/// The exponent that determines the rate of change. This factor determines how the value changes with each level. For example, if Exponent is 2, then the value will increase squared with each level.
/// </summary>
public double Exponent { get; set; }
public decimal Exponent { get; set; }

/// <summary>
/// Calculate the value based on the level.
/// </summary>
/// <param name="level"></param>
/// <returns>The calculated value.</returns>
public int CalculatePowerValueForLevel(int level)
public decimal CalculatePowerValueForLevel(int level)
{
return (int)Math.Ceiling(InitialValue * Math.Pow(level, Exponent));
return (decimal)Math.Ceiling(InitialValue * (decimal)Math.Pow(level, (double)Exponent));
}

/// <summary>
/// Assumes the initial level starts at 1.
/// </summary>
/// <param name="maxLevel"></param>
/// <returns>The cumulative value at max level.</returns>
public int CalculateCumulativeValueForMaxLevel(int maxLevel)
public decimal CalculateCumulativeValueForMaxLevel(int maxLevel)
{
var cumulativeValue = 0;
var cumulativeValue = 0M;
for (int level = 1; level <= maxLevel; level++)
{
cumulativeValue += CalculatePowerValueForLevel(level);
Expand Down
Loading

0 comments on commit ccf7a19

Please sign in to comment.