public void AddDamage(PSO2DamageInstance instance) { totalHitCount++; if (instance.IsCrit) { critHitCount++; } if (!PSO2AttackNameHelper.IsIgnoredAttackForJA(instance.AttackId)) { if (instance.IsJustAttack) { jaHitCount++; } totalJAHitCount++; JAPercent = (float)jaHitCount * 100f / (float)totalJAHitCount; } CritPercent = (float)critHitCount * 100f / (float)totalHitCount; }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); VersionString = Assembly.GetExecutingAssembly().GetName().Version.ToString(); CrashHandler.Initialize(); PSO2AttackNameHelper.Initialize(true); //force download every time, small file anyways. UpgradeSettings(); ParseArgs(e.Args); AccentColorUtility.ReloadActiveColor(); RenderOptions.ProcessRenderMode = Settings.Default.SoftwareRenderingEnabled ? System.Windows.Interop.RenderMode.SoftwareOnly : System.Windows.Interop.RenderMode.Default; //set this before creating any windows var window = new MainWindow(); App.Current.MainWindow = window; window.ViewModel = new MainWindowViewModel(); window.Show(); }
public PSO2DamageInstance(string[] parts) { if (parts[0] == "timestamp") { BuildInvalidInstance(); return; } try { Timestamp = FromUnixTime(long.Parse(parts[0])); InstanceId = long.Parse(parts[1]); SourceId = long.Parse(parts[2]); SourceName = parts[3]; TargetId = long.Parse(parts[4]); TargetName = parts[5]; AttackId = long.Parse(parts[6]); Damage = long.Parse(parts[7]); //i legit cannot believe bool.Parse doesn't consider 1/0 to be true/false. IsJustAttack = int.Parse(parts[8]) == 1; IsCrit = int.Parse(parts[9]) == 1; IsMultiHit = int.Parse(parts[10]) == 1; IsMisc = int.Parse(parts[11]) == 1; IsMisc2 = int.Parse(parts[12]) == 1; } catch { //Potentially not the best way to do this, but it should prevent crashes on improperly formatted lines BuildInvalidInstance(); return; } IsZanverseDamage = AttackId == 2106601422; IsAISDamage = PSO2AttackNameHelper.IsAisAttack(AttackId); IsDarkBlastDamage = PSO2AttackNameHelper.IsDarkBlastAttack(AttackId); AttackName = PSO2AttackNameHelper.GetAttackName(AttackId); IsHeroFinishDamage = PSO2AttackNameHelper.IsHeroFinishAttack(AttackId); IsPhotonDamage = PSO2AttackNameHelper.IsPhotonAttack(AttackId); IsRideroidDamage = PSO2AttackNameHelper.IsRideroidAttack(AttackId); IsLaconiumDamage = PSO2AttackNameHelper.IsRideroidAttack(AttackId); IsStatusDamage = PSO2AttackNameHelper.IsStatusAttack(AttackId); }