private void combatParser_Hit(object sender, HitEventArgs e) { UpdateEncounter(e.Timestamp); Attack attack = new Attack(e); currentEncounter.AddAttack(attack); Character attacker = FindCharacter(e.Attacker); attacker.AddOffensiveHit(attack); Character target = FindCharacter(e.Target); target.AddDefensiveHit(attack); }
public Attack(HitEventArgs e) { Timestamp = e.Timestamp; Attacker = e.Attacker; Target = e.Target; AttackType = e.AttackType; Damage = e.Damage; DamageType = e.Type; Critical = e.Critical; Glancing = e.Glancing; Blocked = e.Blocked; Penetrated = e.Penetrated; Absorbed = false; Evaded = false; }
private void OnOtherHitOther(DateTime timestamp, Match m) { if (Hit != null) { HitEventArgs hit = new HitEventArgs(); hit.Timestamp = timestamp; hit.Attacker = m.Groups[2].Value; hit.Target = m.Groups[5].Value; hit.AttackType = m.Groups[3].Value; hit.Type = m.Groups[7].Value; uint damage; if (uint.TryParse(m.Groups[6].Value, out damage)) hit.Damage = damage; else hit.Damage = 0; string critical = m.Groups[1].Value; if (!String.IsNullOrEmpty(critical) && critical.Equals("Critical")) hit.Critical = true; else hit.Critical = false; string glancing = m.Groups[4].Value; if (!String.IsNullOrEmpty(glancing) && glancing.Equals("Glancing")) hit.Glancing = true; else hit.Glancing = false; string blocked = m.Groups[8].Value; if (!String.IsNullOrEmpty(blocked)) { hit.Blocked = blocked.Equals("Blocked"); hit.Penetrated = blocked.Equals("Penetrated"); } Hit(null, hit); } }