/// <summary> /// 技能正常结束之后. /// </summary> public static void OnSkillFinished(BattleUnit user, BattleUnitSkill skill) { // 只有非普通攻击, 才会触发攻击者的使用技能之后的随机事件. if (!skill.IsRegularAttack) { user.ApplyRandEvent(null, RandEventTriggerType.OnSkillFinished, new OnSkillFinishedEventArg(skill.skillRes)); } }
/// <summary> /// 检查并应用攻击者的随机事件. /// </summary> /// <param name="finalDamage">攻击者对目标造成的伤害值(正数)</param> private void applyAttackerRandEvent(int finalDamage, bool criticalStrike) { BattleUnit attacker = mAttackerAttr.CheckedAttackerObject(); // 如果攻击者, 通过随机事件对对方造成伤害, 那么不触发攻击者的随机事件. if (attacker != null && !mAttackerAttr.StructMadeByRandEvent) { AtkOthersEventArg argument = new AtkOthersEventArg(mOwner, finalDamage); attacker.ApplyRandEvent(mOwner, RandEventTriggerType.OnAtkOthers, argument); if (criticalStrike) { OnCriticalStrikeOthersEventArg criticalStrikeOthersEventArg = new OnCriticalStrikeOthersEventArg(); attacker.ApplyRandEvent(mOwner, RandEventTriggerType.OnCriticalStrikeOthers, criticalStrikeOthersEventArg); } } }