public TargetAction(CombatActionType type, Creature creature, Creature attacker, SkillId attackerSkillId)
{
this.Flags = type;
this.Creature = creature;
this.Attacker = attacker;
this.AttackerSkillId = attackerSkillId;
// The target's skill id is 'CombatMastery' if no skill is loaded,
// 'None' if a skill is currently being loaded, and equal to the
// loaded skill if it's ready.
var activeSkill = creature.Skills.ActiveSkill;
if (activeSkill == null)
this.SkillId = SkillId.CombatMastery;
else if (activeSkill.State != SkillState.Ready)
this.SkillId = SkillId.None;
else
this.SkillId = activeSkill.Info.Id;
}