using Common.Utility.CombatEvent; using Fort23.Core; using GameLogic.Combat.Buff; using GameLogic.Combat.CombatTool; using GameLogic.Combat.Hero; namespace GameLogic.Combat.Skill { /// /// 血祭神通 /// 所有流血状态照成的伤害会转换成充能值,2圈后对全体敌人造成{0}%充能值的伤害 /// public class S2011 : SkillBasic { private long addHarm; protected override void ProUseSkill() { } protected override void ProActiveSkill() { CombatEventManager.Instance.AddEventListener(CombatEventType.HeroInjured, HeroInjured); CombatEventManager.Instance.AddEventListener(CombatEventType.TriggerSkillSlots, TriggerSkillSlots); } protected override void ProDispose() { CombatEventManager.Instance.RemoveEventListener(CombatEventType.HeroInjured, HeroInjured); CombatEventManager.Instance.RemoveEventListener(CombatEventType.TriggerSkillSlots, TriggerSkillSlots); } private void TriggerSkillSlots(IEventData ieventData) { TriggerSkillSlotsEventData triggerSkillSlotsEventData = ieventData as TriggerSkillSlotsEventData; if (triggerSkillSlotsEventData.SkillBasic == this && addHarm > 0) { long v = CombatCalculateTool.Instance.GetVlaueRatioForLong(addHarm, effectValue[0]); if (v > 0) { CombatHeroEntity[] allHero = CombatController.currActiveCombat.CombatHeroController.GetHero(!CombatHeroEntity.IsEnemy); for (int i = 0; i < allHero.Length; i++) { HarmReturnInfo harmReturnInfo = CombatCalculateTool.Instance.Harm(CombatHeroEntity, allHero[i], v, AttType.Skill, triggerData, wuXingType, null, HarmType.Default); } } addHarm = 0; } } private void HeroInjured(IEventData ieventData) { HeroInjuredEventData heroInjuredEventData = ieventData as HeroInjuredEventData; b_1011 b1011 = heroInjuredEventData.HarmReturnInfo.triggerData.Source as b_1011; if (b1011 == null || b1011.Source != CombatHeroEntity) { return; } long harm = heroInjuredEventData.HarmReturnInfo.att; addHarm += harm; } } }