public int Compare(SkillInfo x, SkillInfo y) { SkillName a = (SkillName)x.Skill; SkillName b = (SkillName)y.Skill; return(a.CompareTo(b)); }
/// <summary> /// 发动技能 /// </summary> /// <param name="harm">伤害设置</param> /// <param name="attacker">攻击者</param> /// <param name="defencer">防御者</param> /// <param name="messageQueue">消息队列,用于输出技能释放消息</param> /// <returns>表示是否发动成功</returns> public virtual bool Onset(ref int harm, IFighter attacker, IFighter defencer, Queue <string> messageQueue) { IsValid = true; CurFrame = 0; TimeCount = 0; SetFace(attacker, defencer); //输出技能释放消息 if (SkillName.CompareTo(string.Empty) != 0) { if (messageQueue.Count > 5) { messageQueue.Clear(); } string desc; if (IsAttackSkill) { desc = attacker.Name + "使出【" + SkillName + "】"; } else { desc = defencer.Name + "使出【" + SkillName + "】"; } messageQueue.Enqueue(desc); } //更新攻击者的攻击音效 if (this.AttackSound != SoundType.NULL) { attacker.AttackSound = this.AttackSound; } //根据魔法提升技能伤害 if (MagicAble) { harm = (int)(harm * (1 + 0.0001 * attacker.Magic)); } return(true); }