using CombatLibrary.CombatLibrary.CombatCore.CustomizeTimeLogic.FxLogic;
using GameLogic.Combat.Buff;
using GameLogic.Combat.CombatTool;
using GameLogic.Combat.Hero;
using UTool.CustomizeTimeLogic.FxLogic.TimeLineEventinterface;
namespace GameLogic.Combat.Skill
{
    /// 
    /// 导电(被动)
    /// 每隔{0},敌人受到感电层数*{1}%的伤害
    /// 
    public class S9054 : SkillBasic
    {
        protected float _currTime;
        protected override void ProUseSkill()
        {
        }
        protected override void ProDefaultTimeLineTrigger(string groupName, CombatHeroHitPoint targetEntity,
            ITimelineFxLogic timelineFxLogic,
            TriggerData triggerData, ISkillFeatures skillFeatures)
        {
            float harmBl = 0;
            b_1018 b1018 = targetEntity.combatHeroEntity.BuffControl.GetBuffBasicForType();
            if (b1018 != null) //消耗一层感电,额外照成伤害
            {
                harmBl += b1018.buffCount * effectValue[1];
            }
            long v = CombatCalculateTool.Instance.GetVlaueRatioForLong(CombatHeroEntity.CurrCombatHeroInfo.attack.Value,
                harmBl);
            HarmReturnInfo harmReturnInfo = CombatCalculateTool.Instance.Harm(CombatHeroEntity, targetEntity, v,
                AttType.Skill, triggerData,
                wuXingType, skillFeatures,
                HarmType.Default);
        }
        protected override void ProCombatUpdate(float time)
        {
            _currTime += time;
            if (_currTime >= effectValue[0])
            {
                _currTime = 0;
            }
        }
    }
}