コード例 #1
0
		public Attack(AbsorbEventArgs e)
		{
			Timestamp = e.Timestamp;
			Attacker = e.Attacker;
			Target = e.Target;
			AttackType = !String.IsNullOrEmpty(e.AttackType) ? e.AttackType : e.BarrierType;
			Damage = e.Damage;
			DamageType = String.Empty;
			Critical = false;
			Penetrated = false;
			Glancing = false;
			Blocked = false;
			Absorbed = true;
			Evaded = false;
		}
コード例 #2
0
		void OnOtherAbsorbed(DateTime timestamp, Match m)
		{
			// "(.+) absorbs (\d+) damage of your (.)+\."

			if (Absorb != null)
			{
				AbsorbEventArgs absorb = new AbsorbEventArgs();
				absorb.Timestamp = timestamp;
				absorb.Attacker = "You";
				absorb.Target = m.Groups[1].Value;
				absorb.BarrierType = m.Groups[3].Value;
				absorb.AttackType = absorb.BarrierType; // Currently there's no indication of the attack which caused the absorbed damage

				uint damage;
				if (uint.TryParse(m.Groups[2].Value, out damage))
					absorb.Damage = damage;
				else
					absorb.Damage = 0;

				Absorb(null, absorb);
			}
		}
コード例 #3
0
		void OnYouAbsorbed(DateTime timestamp, Match m)
		{
			if (Absorb != null)
			{
				AbsorbEventArgs absorb = new AbsorbEventArgs();
				absorb.Timestamp = timestamp;
				absorb.Attacker = m.Groups[3].Value;
				absorb.Target = "You";
				absorb.BarrierType = m.Groups[1].Value;
				absorb.AttackType = m.Groups[4].Value;

				uint damage;
				if (uint.TryParse(m.Groups[2].Value, out damage))
					absorb.Damage = damage;
				else
					absorb.Damage = 0;

				Absorb(null, absorb);
			}
		}
コード例 #4
0
		private void combatParser_Absorb(object sender, AbsorbEventArgs 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);
		}