using Fort23.Core;
using GameLogic.Combat.Buff;
using GameLogic.Combat.CombatTool;
using GameLogic.Combat.Hero;
using UnityEngine;
using UTool.CustomizeTimeLogic.FxLogic.TimeLineEventinterface;
namespace GameLogic.Combat.Skill.MagicSkill
{
///
/// 对敌人照成伤害,使敌人五行混乱。敌人的功法每次使用功法都将使用最低灵根属性作为伤害计算,持续{0}秒
/// 使敌人的所有灵根降低10%持续5秒
///
public class S3101 : MagicSkillBasic
{
private CombatHeroEntity target;
protected override void ProMagicUseSkill()
{
// StraightLineShow straightLineShow = new StraightLineShow();
// straightLineShow.Init(this);
CombatHeroEntity[] allHero =
CombatController.currActiveCombat.CombatHeroController.GetHero(!CombatHeroEntity.IsEnemy);
if (allHero == null || allHero.Length <= 0)
{
SkillPlayFinish();
return;
}
target = allHero[0];
MagicAttShowBasic magicAttShowBasic = InitMagicAttShowBasic(allHero[0], Finish);
SetMagicAttShowBasic(magicAttShowBasic);
}
protected override ILifetCycleHitPoint[] ProGetTineLineTargetEntity(
TimeLineEventLogicBasic timeLineEventLogicBasic)
{
ILifetCycleHitPoint[] lifetCycleHitPoints = new ILifetCycleHitPoint[1];
lifetCycleHitPoints[0] = target.GetMainHotPoin();
return lifetCycleHitPoints;
}
private void Finish()
{
BuffInfo buffInfo = BuffInfo.GetBuffInfo(10091, effectValue[0], 1);
BuffBasic buffBasic = target.BuffControl.AddBuff(CombatHeroEntity, buffInfo);
if (buffBasic != null && SelfSkillConfig.level > 5)
{
float v = effectValue[0];
target.CurrCombatHeroInfo.Metal -= v;
target.CurrCombatHeroInfo.Wood -= v;
target.CurrCombatHeroInfo.Water -= v;
target.CurrCombatHeroInfo.Fire -= v;
target.CurrCombatHeroInfo.Earth -= v;
buffBasic.buffFinish=delegate ()
{
target.CurrCombatHeroInfo.Metal += v;
target.CurrCombatHeroInfo.Wood += v;
target.CurrCombatHeroInfo.Water += v;
target.CurrCombatHeroInfo.Fire += v;
target.CurrCombatHeroInfo.Earth += v;
};
}
SkillPlayFinish();
// Debug.Log("法宝对敌人照成伤害");
// ILifetCycleHitPoint lifetCycleHitPoint = target.GetMainHotPoin();
// if (lifetCycleHitPoint == null)
// {
// return;
// }
//
// BetterList cBetterList = new BetterList(1);
// cBetterList.Add(lifetCycleHitPoint);
// ActivationTimeLineData("gongji", currTarget: cBetterList);
// SkillPlayFinish();
//
// HarmReturnInfo harmReturnInfo = CObjectPool.Instance.Fetch();
// harmReturnInfo.source = CombatHeroEntity;
// harmReturnInfo.target = target.GetMainHotPoin();
// harmReturnInfo.att = 200;
// harmReturnInfo.attType = AttType.Normal;
// harmReturnInfo.harmType = HarmType.Default;
// harmReturnInfo.triggerData = triggerData;
// target.HeroHurt(harmReturnInfo);
// CombatCalculateTool.Instance.Harm(CombatHeroEntity, lifetCycleHitPoint as CombatHeroHitPoint, 200, AttType.Normal, triggerData,
// HarmType.Default);
}
}
}