using Common.Utility.CombatEvent;
using Fort23.Core;
using GameLogic.Combat.Buff;
namespace GameLogic.Combat.Skill
{
    /// 
    /// 毒瘴领域
    ///前方功法击中目标时额外施加一层毒,对流血中的敌人再额外施加一层
    /// 
    public class S2013 : SkillBasic
    {
        protected override void ProActiveSkill()
        {
            CombatEventManager.Instance.AddEventListener(CombatEventType.HeroInjured, HeroInjured);
        }
        protected override void ProDispose()
        {
            CombatEventManager.Instance.RemoveEventListener(CombatEventType.HeroInjured, HeroInjured);
        }
        private void HeroInjured(IEventData iEventData)
        {
            HeroInjuredEventData heroInjuredEventData = iEventData as HeroInjuredEventData;
            if (heroInjuredEventData.HarmReturnInfo.source == CombatHeroEntity &&
                heroInjuredEventData.HarmReturnInfo.isHitHero)
            {
                SkillBasic skillBasic = heroInjuredEventData.HarmReturnInfo.triggerData.Source as SkillBasic;
                if (skillBasic != null && IsPassiveActivateSkill(skillBasic))
                {
                    CombatHeroEntity target =
                        heroInjuredEventData.HarmReturnInfo.target.combatHeroEntity as CombatHeroEntity;
                    b_1011 b1011 = target.BuffControl.GetBuffBasicForType();
                    int buffCount = 1;
                    if (b1011 != null)
                    {
                        buffCount += 1;
                    }
                    BuffInfo buffInfo = BuffInfo.GetBuffInfo(10031, buffCount,skillBasic);
                    target.BuffControl.AddBuff(CombatHeroEntity,
                        buffInfo);
                }
            }
        }
        protected override void ProUseSkill()
        {
        }
    }
}