Skip to content

Commit

Permalink
Merge pull request #5 from mysterious64/Fengest
Browse files Browse the repository at this point in the history
Added Status Ailment Damage Separation
  • Loading branch information
mysterious64 authored Sep 5, 2020
2 parents f0b1828 + 2515613 commit f6527f2
Show file tree
Hide file tree
Showing 8 changed files with 104 additions and 16 deletions.
3 changes: 3 additions & 0 deletions OverParse/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@
<setting name="skills_ja" serializeAs="String">
<value>True</value>
</setting>
<setting name="SeparateStatus" serializeAs="String">
<value>False</value>
</setting>
</OverParse.Properties.Settings>
</userSettings>
</configuration>
6 changes: 5 additions & 1 deletion OverParse/Click.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,11 @@ private void SeparateZanverse_Click(object sender, RoutedEventArgs e)
Properties.Settings.Default.SeparateZanverse = SeparateZanverse.IsChecked;
UpdateForm(null, null);
}

private void SeparateStatus_Click(object sender, RoutedEventArgs e)
{
Properties.Settings.Default.SeparateStatus = SeparateStatus.IsChecked;
UpdateForm(null, null);
}
private void SeparateFinish_Click(object sender, RoutedEventArgs e)
{
Properties.Settings.Default.SeparateFinish = SeparateFinish.IsChecked;
Expand Down
19 changes: 18 additions & 1 deletion OverParse/Combatant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,19 @@ public class Combatant
"2618804663" , // Buster Divide (Laconium Sword charged)
"2619614461" , // Laconium Sword step attack
"3607718359" }; // Laconium Sword slash

// Status Ailment IDs
public static string[] StatusAttackIDs = new string[] { "2505928570" , // Burn lvl1
"2505928505" , // Burn lvl2
"2505928696" , // Burn lvl3
"2505928584" , // Burn lvl4
"2505927753" , // Burn lvl5
"1739789695" , // Poison lvl1
"1739789694" , // Poison lvl2
"1739789665" , // Poison lvl3
"1739789664" , // Poison lvl4
"1739789667" }; // Poison lvl5

// List of the above attack IDs combined
public static string[] NonAllyAttackIDs = PhotonAttackIDs.Concat(AISAttackIDs).Concat(RideAttackIDs).Concat(DBAttackIDs).Concat(LaconiumAttackIDs).ToArray();

Expand Down Expand Up @@ -193,6 +206,7 @@ public Combatant(string id, string name, string temp)

public int Damaged; // Remon's fixes
public int ZvsDamage => GetDamageDealt(GetZanverseID()); // Zanverse total damage
public int DotDamage => GetDamageDealt(GetAttackID(StatusAttackIDs)); // Status ailment total damage
public int HTFDamage => GetDamageDealt(GetAttackID(FinishAttackIDs)); // Hero Time Finish total damage
public int PwpDamage => GetDamageDealt(GetAttackID(PhotonAttackIDs)); // PwP Total Damage
public int AisDamage => GetDamageDealt(GetAttackID(AISAttackIDs)); // AIS Total Damage
Expand Down Expand Up @@ -232,6 +246,7 @@ public Combatant(string id, string name, string temp)
public bool IsYou => CheckIsYou(); // Player-chan running
public bool IsAlly => CheckIsAlly(); // Other players running
public bool IsZanverse => CheckIsType("Zanverse"); // Zanverse being cast
public bool IsStatus => CheckIsType("Status Ailment"); // status occuring
public bool IsPwp => CheckIsType("Pwp"); // Photon weapons using
public bool IsAIS => CheckIsType("AIS"); // A.I.S. mode running
public bool IsRide => CheckIsType("Ride"); // Rideroid mode running
Expand Down Expand Up @@ -324,12 +339,14 @@ private int GetGeneralDamage()
// Returns the damage dealt that has been filtered
private int GetReadingDamage()
{
if (IsZanverse || IsFinish || IsAIS || IsPwp || IsDB || IsRide || IsLsw)
if (IsZanverse || IsStatus || IsFinish || IsAIS || IsPwp || IsDB || IsRide || IsLsw)
return Damage;

int temp = Damage;
if (Properties.Settings.Default.SeparateZanverse)
temp -= ZvsDamage;
if (Properties.Settings.Default.SeparateStatus)
temp -= DotDamage;
if (Properties.Settings.Default.SeparateFinish)
temp -= HTFDamage;
if (Properties.Settings.Default.SeparatePwp)
Expand Down
32 changes: 27 additions & 5 deletions OverParse/Log.cs
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,8 @@ public string WriteLog()
TimeSpan timespan = TimeSpan.FromSeconds(elapsed);

// Logging the total time occured through out the encounter
int totalDamage = combatants.Where(c => c.IsAlly || c.IsZanverse || c.IsFinish).Sum(x => x.Damage);
double totalDPS = combatants.Where(c => c.IsAlly || c.IsZanverse || c.IsFinish).Sum(x => x.DPS);
int totalDamage = combatants.Where(c => c.IsAlly || c.IsStatus || c.IsZanverse || c.IsFinish).Sum(x => x.Damage);
double totalDPS = combatants.Where(c => c.IsAlly || c.IsStatus || c.IsZanverse || c.IsFinish).Sum(x => x.DPS);

string timer = timespan.ToString(@"mm\:ss");
string log = DateTime.Now.ToString("F") + " | " + timer + " | Total Damage: " + totalDamage.ToString("N0") + " dmg" + " | " + "Total DPS: " + totalDPS.ToString("N0") + Environment.NewLine + Environment.NewLine;
Expand All @@ -283,7 +283,7 @@ public string WriteLog()

foreach (Combatant c in combatants)
{
if (c.IsAlly || c.IsZanverse || c.IsFinish)
if (c.IsAlly || c.IsStatus || c.IsZanverse || c.IsFinish)
{
log += Environment.NewLine + $"# {c.Name}"+ Environment.NewLine + $"# Contrib: {c.PercentReadDPSReadout}% | Dealt: {c.ReadDamage.ToString("N0")} dmg | Taken: {c.Damaged.ToString("N0")} dmgd | {c.DPS.ToString("N0")} DPS | JA: {c.WJAPercent}% | Critical: {c.WCRIPercent}% | Max: {c.MaxHitdmg} ({c.MaxHit})" + Environment.NewLine;
}
Expand All @@ -293,13 +293,15 @@ public string WriteLog()

foreach (Combatant c in combatants)
{
if (c.IsAlly || c.IsZanverse || c.IsFinish)
if (c.IsAlly || c.IsStatus || c.IsZanverse || c.IsFinish)
{
string header = $"[ {c.Name} - {c.PercentReadDPSReadout}% - {c.ReadDamage.ToString("N0")} dmg ]";
log += header + Environment.NewLine + Environment.NewLine;

List<string> attackNames = new List<string>();
List<string> finishNames = new List<string>();
List<string> statusNames = new List<string>();

List<Tuple<string, List<int>, List<int>, List<int>>> attackData = new List<Tuple<string, List<int>, List<int>, List<int>>>();

if (c.IsZanverse && Properties.Settings.Default.SeparateZanverse)
Expand Down Expand Up @@ -337,12 +339,32 @@ public string WriteLog()
attackData.Add(new Tuple<string, List<int>, List<int>, List<int>>(tCombatant.Name, fmatchingAttacks, jaPercents, criPercents));
}

}
else if (c.IsStatus && Properties.Settings.Default.SeparateStatus)
{
foreach (Combatant c4 in backupCombatants)
{
if (c4.DotDamage > 0)
statusNames.Add(c4.ID);
}

foreach (string dot in statusNames)
{
Combatant tCombatant = backupCombatants.First(x => x.ID == dot);
List<int> matchingAttacks = tCombatant.Attacks.Where(a => Combatant.StatusAttackIDs.Contains(a.ID)).Select(a => a.Damage).ToList();
List<int> jaPercents = c.Attacks.Where(a => Combatant.StatusAttackIDs.Contains(a.ID)).Select(a => a.JA).ToList();
List<int> criPercents = c.Attacks.Where(a => Combatant.StatusAttackIDs.Contains(a.ID)).Select(a => a.Cri).ToList();
attackData.Add(new Tuple<string, List<int>, List<int>, List<int>>(tCombatant.Name, matchingAttacks, jaPercents, criPercents));
}

}
else
{
foreach (Attack a in c.Attacks)
{
if ((a.ID == "2106601422" && Properties.Settings.Default.SeparateZanverse) || (Combatant.FinishAttackIDs.Contains(a.ID) && Properties.Settings.Default.SeparateFinish))
if ((a.ID == "2106601422" && Properties.Settings.Default.SeparateZanverse) ||
(Combatant.FinishAttackIDs.Contains(a.ID) && Properties.Settings.Default.SeparateFinish) ||
(Combatant.StatusAttackIDs.Contains(a.ID) && Properties.Settings.Default.SeparateStatus))
continue; // Don't do anything
if (MainWindow.skillDict.ContainsKey(a.ID))
a.ID = MainWindow.skillDict[a.ID]; // these are getting disposed anyway, no 1 cur
Expand Down
1 change: 1 addition & 0 deletions OverParse/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
<MenuItem Style="{StaticResource submenu}" Header="Hide Enemies/NPCs" IsCheckable="True" IsChecked="True" x:Name="FilterPlayers" Click="FilterPlayers_Click"/>
<MenuItem Style="{StaticResource submenu}" Header="Damage Separation">
<MenuItem Style="{StaticResource submenu}" Header="Separate Zanverse" x:Name="SeparateZanverse" IsCheckable="True" IsChecked="False" Click="SeparateZanverse_Click"/>
<MenuItem Style="{StaticResource submenu}" Header="Separate Status Ailment" x:Name="SeparateStatus" IsCheckable="True" IsChecked="False" Click="SeparateStatus_Click"/>
<MenuItem Style="{StaticResource submenu}" Header="Separate Hero Time Finish" x:Name="SeparateFinish" IsCheckable="True" IsChecked="False" Click="SeparateFinish_Click"/>
</MenuItem>
<MenuItem Style="{StaticResource submenu}" Header="Attack Mode Separation">
Expand Down
34 changes: 30 additions & 4 deletions OverParse/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ public MainWindow()
AutoEndEncounters.IsChecked = Properties.Settings.Default.AutoEndEncounters;
SetEncounterTimeout.IsEnabled = AutoEndEncounters.IsChecked;
SeparateZanverse.IsChecked = Properties.Settings.Default.SeparateZanverse;
SeparateStatus.IsChecked = Properties.Settings.Default.SeparateStatus;
SeparateFinish.IsChecked = Properties.Settings.Default.SeparateFinish;
SeparateAIS.IsChecked = Properties.Settings.Default.SeparateAIS;
SeparateDB.IsChecked = Properties.Settings.Default.SeparateDB;
Expand Down Expand Up @@ -678,7 +679,7 @@ public void UpdateForm(object sender, EventArgs e)
// make dummy zanverse combatant if necessary
int totalZanverse = workingList.Where(c => c.IsAlly == true).Sum(x => x.ZvsDamage);
int totalFinish = workingList.Where(c => c.IsAlly == true).Sum(x => x.HTFDamage);

int totalStatus = workingList.Where(c => c.IsAlly == true).Sum(x => x.DotDamage);
if (Properties.Settings.Default.SeparateFinish)
{
if (totalFinish > 0)
Expand Down Expand Up @@ -717,9 +718,28 @@ public void UpdateForm(object sender, EventArgs e)
}
}

if(Properties.Settings.Default.SeparateStatus)
{
if (totalStatus > 0)
{
Combatant statusHolder = new Combatant("99999999", "Status Ailment", "Status Ailment");
foreach (Combatant c in workingList)
{
if (c.IsAlly)
{
List<Attack> targetAttacks = c.Attacks.Where(a => Combatant.StatusAttackIDs.Contains(a.ID)).ToList();
statusHolder.Attacks.AddRange(targetAttacks);
c.Attacks = c.Attacks.Except(targetAttacks).ToList();
}
}
statusHolder.ActiveTime = elapsed;
workingList.Add(statusHolder);
}
}

// get group damage totals
int totalDamage = workingList.Sum(x => x.Damage);
int totalReadDamage = workingList.Where(c => c.IsAlly || c.IsZanverse || c.IsFinish).Sum(x => x.Damage);
int totalReadDamage = workingList.Where(c => c.IsAlly || c.IsZanverse || c.IsStatus || c.IsFinish).Sum(x => x.Damage);

// dps calcs!
foreach (Combatant c in workingList)
Expand All @@ -735,7 +755,11 @@ public void UpdateForm(object sender, EventArgs e)
Combatant.maxShare = c.ReadDamage;

bool filtered = true;
if (Properties.Settings.Default.SeparateAIS || Properties.Settings.Default.SeparateDB || Properties.Settings.Default.SeparateRide || Properties.Settings.Default.SeparatePwp || Properties.Settings.Default.SeparateLsw)
if (Properties.Settings.Default.SeparateAIS ||
Properties.Settings.Default.SeparateDB ||
Properties.Settings.Default.SeparateRide ||
Properties.Settings.Default.SeparatePwp ||
Properties.Settings.Default.SeparateLsw)
{
if (c.IsAlly && c.isTemporary == "no" && !HidePlayers.IsChecked)
filtered = false;
Expand All @@ -751,12 +775,14 @@ public void UpdateForm(object sender, EventArgs e)
filtered = false;
if (c.IsZanverse)
filtered = false;
if (c.IsStatus)
filtered = false;
if (c.IsFinish)
filtered = false;
}
else
{
if ((c.IsAlly || c.IsZanverse || c.IsFinish || !FilterPlayers.IsChecked) && (c.Damage > 0))
if ((c.IsAlly || c.IsZanverse || c.IsStatus || c.IsFinish || !FilterPlayers.IsChecked) && (c.Damage > 0))
filtered = false;
}

Expand Down
22 changes: 17 additions & 5 deletions OverParse/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions OverParse/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -185,5 +185,8 @@
<Setting Name="skills_ja" Type="System.String" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="SeparateStatus" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
</Settings>
</SettingsFile>

0 comments on commit f6527f2

Please sign in to comment.