Aura.Channel.Skills.Combat.SupportShot.OnCreatureAttacks C# (CSharp) Метод

OnCreatureAttacks() приватный Метод

Handles the skill training.
private OnCreatureAttacks ( TargetAction tAction ) : void
tAction TargetAction
Результат void
		private void OnCreatureAttacks(TargetAction tAction)
		{
			if (tAction.AttackerSkillId != SkillId.SupportShot)
				return;

			var skill = tAction.Attacker.Skills.Get(SkillId.SupportShot);
			if (skill == null)
				return;

			var powerRating = tAction.Attacker.GetPowerRating(tAction.Creature);

			if (skill.Info.Rank >= SkillRank.RF && skill.Info.Rank <= SkillRank.RA)
			{
				skill.Train(1); // Successfully use the skill.

				if (!tAction.IsKnockBack)
					skill.Train(2); // Successfully use Support Shot without knocking down the enemy.

				if (tAction.Has(TargetOptions.Critical))
					skill.Train(3); // Succeed in a Critical Hit with Support Shot.
			}
			else if (skill.Info.Rank == SkillRank.R9)
			{
				if (powerRating == PowerRating.Normal)
					skill.Train(1); // Successfully use the skill on a similarly ranked enemy.

				if (powerRating == PowerRating.Strong)
					skill.Train(2); // Successfully use the skill on a strong enemy.

				if (!tAction.IsKnockBack)
					skill.Train(3); // Successfully use Support Shot without knocking down the enemy.

				if (tAction.Has(TargetOptions.Critical))
					skill.Train(4); // Succeed in a Critical Hit with Support Shot.
			}
			else if (skill.Info.Rank == SkillRank.R8)
			{
				if (powerRating == PowerRating.Normal)
					skill.Train(1); // Successfully use the skill on a similarly ranked enemy.

				if (powerRating == PowerRating.Strong)
				{
					skill.Train(2); // Successfully use the skill on a Strong enemy.

					if (tAction.Has(TargetOptions.Critical))
						skill.Train(4); // Succeed in a Critical Hit against a Strong enemy.
				}

				if (!tAction.IsKnockBack)
					skill.Train(3); // Successfully use Support Shot without knocking down the enemy.
			}
			else if (skill.Info.Rank >= SkillRank.R7 && skill.Info.Rank <= SkillRank.R6)
			{
				if (powerRating == PowerRating.Strong)
				{
					skill.Train(1); // Successfully use the skill on a Strong enemy.

					if (tAction.Has(TargetOptions.Critical))
						skill.Train(4); // Succeed in a Critical Hit against a Strong enemy.
				}

				if (powerRating == PowerRating.Awful)
					skill.Train(2); // Successfully use the skill on an Awful enemy.

				if (!tAction.IsKnockBack)
					skill.Train(3); // Successfully use Support Shot without knocking down the enemy.
			}
			else if (skill.Info.Rank >= SkillRank.R5 && skill.Info.Rank <= SkillRank.R4)
			{
				if (powerRating == PowerRating.Strong)
					skill.Train(1); // Successfully use the skill on a Strong enemy.

				if (powerRating == PowerRating.Awful)
				{
					skill.Train(2); // Successfully use the skill on an Awful enemy.

					if (tAction.Has(TargetOptions.Critical))
						skill.Train(4); // Succeed in a Critical Hit against an Awful enemy.
				}

				if (!tAction.IsKnockBack)
					skill.Train(3); // Successfully use Support Shot without knocking down the enemy.
			}
			else if (skill.Info.Rank >= SkillRank.R3 && skill.Info.Rank <= SkillRank.R1)
			{
				if (powerRating == PowerRating.Awful)
					skill.Train(1); // Successfully use the skill on an Awful enemy.

				if (powerRating == PowerRating.Boss)
				{
					skill.Train(2); // Successfully use the skill on a Boss-level enemy.

					if (tAction.Has(TargetOptions.Critical))
						skill.Train(4); // Succeed in a Critical Hit against a Boss-level enemy.
				}

				if (!tAction.IsKnockBack)
					skill.Train(3); // Successfully use Support Shot without knocking down the enemy.
			}
		}
	}