Skip to content
This repository has been archived by the owner on Jan 9, 2025. It is now read-only.

Commit

Permalink
更新狒狒属性计算器
Browse files Browse the repository at this point in the history
  • Loading branch information
BAKAOLC committed Dec 14, 2024
1 parent dc64579 commit 3d64064
Show file tree
Hide file tree
Showing 21 changed files with 810 additions and 817 deletions.
12 changes: 0 additions & 12 deletions Ritsukage-Core.sln
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GifCompress", "GifCompress\
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Acquisition", "Acquisition\Acquisition.csproj", "{998A5D83-C3F0-4C61-A788-BD65AAF83DEF}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SteamAuth", "SteamAuth\SteamAuth\SteamAuth.csproj", "{5AD0934E-F6C4-4AE5-83AF-C788313B2A87}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SimpleWatchDog", "SimpleWatchDog\SimpleWatchDog.csproj", "{175CCACB-B5D6-4669-AACC-98AC858D7AC9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -49,14 +45,6 @@ Global
{998A5D83-C3F0-4C61-A788-BD65AAF83DEF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{998A5D83-C3F0-4C61-A788-BD65AAF83DEF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{998A5D83-C3F0-4C61-A788-BD65AAF83DEF}.Release|Any CPU.Build.0 = Release|Any CPU
{5AD0934E-F6C4-4AE5-83AF-C788313B2A87}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5AD0934E-F6C4-4AE5-83AF-C788313B2A87}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5AD0934E-F6C4-4AE5-83AF-C788313B2A87}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5AD0934E-F6C4-4AE5-83AF-C788313B2A87}.Release|Any CPU.Build.0 = Release|Any CPU
{175CCACB-B5D6-4669-AACC-98AC858D7AC9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{175CCACB-B5D6-4669-AACC-98AC858D7AC9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{175CCACB-B5D6-4669-AACC-98AC858D7AC9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{175CCACB-B5D6-4669-AACC-98AC858D7AC9}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
160 changes: 160 additions & 0 deletions Ritsukage-Core/Library/FFXIV/CharacterPanel/LevelModifiers.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
using System;
using System.Collections.Generic;

namespace Ritsukage.Library.FFXIV.CharacterPanel
{
public static class LevelModifiers
{
public const string Version = "7.0";

public static readonly Dictionary<int, Modifier> LevelTable = new()
{
[1] = new(20, 56, 56),
[2] = new(21, 57, 57),
[3] = new(22, 60, 60),
[4] = new(24, 62, 62),
[5] = new(26, 65, 65),
[6] = new(27, 68, 68),
[7] = new(29, 70, 70),
[8] = new(31, 73, 73),
[9] = new(33, 76, 76),
[10] = new(35, 78, 78),
[11] = new(36, 82, 82),
[12] = new(38, 85, 85),
[13] = new(41, 89, 89),
[14] = new(44, 93, 93),
[15] = new(46, 96, 96),
[16] = new(49, 100, 100),
[17] = new(52, 104, 104),
[18] = new(54, 109, 109),
[19] = new(57, 113, 113),
[20] = new(60, 116, 116),
[21] = new(63, 122, 122),
[22] = new(67, 127, 127),
[23] = new(71, 133, 133),
[24] = new(74, 138, 138),
[25] = new(78, 144, 144),
[26] = new(81, 150, 150),
[27] = new(85, 155, 155),
[28] = new(89, 162, 162),
[29] = new(92, 168, 168),
[30] = new(97, 173, 173),
[31] = new(101, 181, 181),
[32] = new(106, 188, 188),
[33] = new(110, 194, 194),
[34] = new(115, 202, 202),
[35] = new(119, 209, 209),
[36] = new(124, 215, 215),
[37] = new(128, 223, 223),
[38] = new(134, 229, 229),
[39] = new(139, 236, 236),
[40] = new(144, 244, 244),
[41] = new(150, 253, 253),
[42] = new(155, 263, 263),
[43] = new(161, 272, 272),
[44] = new(166, 283, 283),
[45] = new(171, 292, 292),
[46] = new(177, 302, 302),
[47] = new(183, 311, 311),
[48] = new(189, 322, 322),
[49] = new(196, 331, 331),
[50] = new(202, 341, 341),
[51] = new(204, 342, 366),
[52] = new(205, 344, 392),
[53] = new(207, 345, 418),
[54] = new(209, 346, 444),
[55] = new(210, 347, 470),
[56] = new(212, 349, 496),
[57] = new(214, 350, 522),
[58] = new(215, 351, 548),
[59] = new(217, 352, 574),
[60] = new(218, 354, 600),
[61] = new(224, 355, 630),
[62] = new(228, 356, 660),
[63] = new(236, 357, 690),
[64] = new(244, 358, 720),
[65] = new(252, 359, 750),
[66] = new(260, 360, 780),
[67] = new(268, 361, 810),
[68] = new(276, 362, 840),
[69] = new(284, 363, 870),
[70] = new(292, 364, 900),
[71] = new(296, 365, 940),
[72] = new(300, 366, 980),
[73] = new(305, 367, 1020),
[74] = new(310, 368, 1060),
[75] = new(315, 370, 1100),
[76] = new(320, 372, 1140),
[77] = new(325, 374, 1180),
[78] = new(330, 376, 1220),
[79] = new(335, 378, 1260),
[80] = new(340, 380, 1300),
[81] = new(345, 382, 1360),
[82] = new(350, 384, 1420),
[83] = new(355, 386, 1480),
[84] = new(360, 388, 1540),
[85] = new(365, 390, 1600),
[86] = new(370, 392, 1660),
[87] = new(375, 394, 1720),
[88] = new(380, 396, 1780),
[89] = new(385, 398, 1840),
[90] = new(390, 400, 1900),
[91] = new(395, 402, 1988),
[92] = new(400, 404, 2076),
[93] = new(405, 406, 2164),
[94] = new(410, 408, 2252),
[95] = new(415, 410, 2340),
[96] = new(420, 412, 2428),
[97] = new(425, 414, 2516),
[98] = new(430, 416, 2604),
[99] = new(435, 418, 2692),
[100] = new(440, 420, 2780),
};

// this seems to be the modifiers after some testing..
public static double AttackModifier(int level)
{
return level switch
{
<= 50 => 75,
<= 70 => (level - 50) * 2.5 + 75,
<= 80 => (level - 70) * 4 + 125,
<= 90 => (level - 80) * 3 + 165,
_ => (level - 90) * 4.2 + 195,
};
}

public static double HealModifier(int level)
{
return level switch
{
< 60 => level * 1.5 + 10,
< 70 => (level - 60) * 2 + 100,
< 80 => 120,
_ => (level - 80) * 2.5 + 120.8,
};
}

public static double TankAttackModifier(int level)
{
return level switch
{
<= 80 => level + 35,
<= 90 => (level - 80) * 4.1 + 115,
_ => (level - 90) * 3.4 + 156,
};
}

public static double HpModifier(int level)
{
return Math.Floor(5.71 * level - 270) / 10;
}

public static double TankHpModifier(int level)
{
return Math.Floor(8.31 * level - 401) / 10;
}

public record Modifier(int Main, int Sub, int Div);
}
}
74 changes: 74 additions & 0 deletions Ritsukage-Core/Library/FFXIV/CharacterPanel/Structs/CriticalHit.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
using System;
using System.Text;

namespace Ritsukage.Library.FFXIV.CharacterPanel.Structs
{
public readonly struct CriticalHit
{
private const int Fn = 200;

public int Level { get; }

public int Value { get; }

private int Sub { get; }

private int Div { get; }

private double CalcValue { get; }

public double Rate { get; }

public double Bonus { get; }

public double Expected { get; }

public int PrevValue { get; }

public int NextValue { get; }

public CriticalHit(int level, int value)
{
Level = level;
Value = value;
if (!LevelModifiers.LevelTable.TryGetValue(level, out var modifier))
throw new ArgumentOutOfRangeException(nameof(level), @"Invalid level");
Sub = modifier.Sub;
Div = modifier.Div;

CalcValue = Math.Floor(Fn * ((double)Value - Sub) / Div);
Rate = (50 + CalcValue) / 10;
Bonus = (1400 + CalcValue) / 10;
Expected = Rate * (Bonus - 100);
PrevValue = (int)Math.Ceiling(Sub + Div * CalcValue / Fn);
NextValue = (int)Math.Ceiling(Sub + Div * (1 + CalcValue) / Fn);
}

public static CriticalHit FromRate(int level, double value)
{
if (!LevelModifiers.LevelTable.TryGetValue(level, out var modifier))
throw new ArgumentOutOfRangeException(nameof(level), @"Invalid level");
return new(level, (int)Math.Ceiling((value * 10 - 50) * modifier.Div / Fn + modifier.Sub));
}

public static CriticalHit FromBonus(int level, double value)
{
if (!LevelModifiers.LevelTable.TryGetValue(level, out var modifier))
throw new ArgumentOutOfRangeException(nameof(level), @"Invalid level");
return new(level, (int)Math.Ceiling((value * 10 - 1400) * modifier.Div / Fn + modifier.Sub));
}

public override string ToString()
{
return new StringBuilder()
.AppendLine($"版本 {LevelModifiers.Version} Lv{Level} 等级基数: {Div}")
.AppendLine($"暴击 {Value} (基数: {Sub})")
.AppendLine($"暴击率    {Rate}%")
.AppendLine($"暴击伤害   {Bonus}%")
.AppendLine($"预期收益   {Expected}%")
.AppendLine($"上一临界点  {PrevValue}")
.Append($"下一临界点  {NextValue}")
.ToString();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
using System;
using System.Text;

namespace Ritsukage.Library.FFXIV.CharacterPanel.Structs
{
public readonly struct Determination
{
private const int Fn = 140;

public int Level { get; }

public int Value { get; }

private int Main { get; }

private int Div { get; }

private double CalcValue { get; }

public double Bonus { get; }

public int PrevValue { get; }

public int NextValue { get; }

public Determination(int level, int value)
{
Level = level;
Value = value;
if (!LevelModifiers.LevelTable.TryGetValue(level, out var modifier))
throw new ArgumentOutOfRangeException(nameof(level), @"Invalid level");
Main = modifier.Main;
Div = modifier.Div;

CalcValue = Math.Floor(Fn * ((double)Value - Main) / Div);
Bonus = (1000 + CalcValue) / 1000;
PrevValue = (int)Math.Ceiling(Main + Div * CalcValue / Fn);
NextValue = (int)Math.Ceiling(Main + Div * (1 + CalcValue) / Fn);
}

public static Determination FromBonus(int level, double rate)
{
if (!LevelModifiers.LevelTable.TryGetValue(level, out var modifier))
throw new ArgumentOutOfRangeException(nameof(level), @"Invalid level");
return new(level, (int)Math.Ceiling((rate * 1000 - 1000) * modifier.Div / Fn + modifier.Main));
}

public override string ToString()
{
return new StringBuilder()
.AppendLine($"版本 {LevelModifiers.Version} Lv{Level} 等级基数: {Div}")
.AppendLine($"信念 {Value} (基数: {Main})")
.AppendLine($"伤害增幅   {Bonus}倍")
.AppendLine($"上一临界点  {PrevValue}")
.Append($"下一临界点  {NextValue}")
.ToString();
}
}
}
66 changes: 66 additions & 0 deletions Ritsukage-Core/Library/FFXIV/CharacterPanel/Structs/DirectHit.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
using System;
using System.Text;

namespace Ritsukage.Library.FFXIV.CharacterPanel.Structs
{
public readonly struct DirectHit
{
private const int Fn = 550;

public int Level { get; }

public int Value { get; }

private int Sub { get; }

private int Div { get; }

private double CalcValue { get; }

public double Rate { get; }

public double Bonus { get; }

public double Expected { get; }

public int PrevValue { get; }

public int NextValue { get; }

public DirectHit(int level, int value)
{
Level = level;
Value = value;
if (!LevelModifiers.LevelTable.TryGetValue(level, out var modifier))
throw new ArgumentOutOfRangeException(nameof(level), @"Invalid level");
Sub = modifier.Sub;
Div = modifier.Div;

CalcValue = Math.Floor(Fn * ((double)Value - Sub) / Div);
Rate = CalcValue / 10;
Bonus = 125;
Expected = Rate * 25;
PrevValue = (int)Math.Floor(Sub + Div * CalcValue / Fn);
NextValue = (int)Math.Ceiling(Sub + Div * (1 + CalcValue) / Fn);
}

public static DirectHit FromRate(int level, double value)
{
if (!LevelModifiers.LevelTable.TryGetValue(level, out var modifier))
throw new ArgumentOutOfRangeException(nameof(level), @"Invalid level");
return new(level, (int)Math.Ceiling(value * 10 * modifier.Div / Fn + modifier.Sub));
}

public override string ToString()
{
return new StringBuilder()
.AppendLine($"版本 {LevelModifiers.Version} Lv{Level} 等级基数: {Div}")
.AppendLine($"直击 {Value} (基数: {Sub})")
.AppendLine($"直击率    {Rate}%")
.AppendLine($"直击伤害   {Bonus}%")
.AppendLine($"预期收益   {Expected}%")
.Append($"下一临界点  {NextValue}")
.ToString();
}
}
}
Loading

0 comments on commit 3d64064

Please sign in to comment.