using System.Collections.Generic;
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}个格子流动{1}秒
///
public class S3203 : 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()
{
//
Debug.Log("法宝对敌人照成伤害");
ILifetCycleHitPoint lifetCycleHitPoint = target.GetMainHotPoin();
if (lifetCycleHitPoint == null)
{
SkillPlayFinish();
return;
}
BetterList cBetterList = new BetterList(1);
cBetterList.Add(lifetCycleHitPoint);
ActivationTimeLineData("gongji", currTarget: cBetterList);
SkillPlayFinish();
List buffId = new List() { 10191, 10201, 10211, 10221, 10231 };
for (int i = 0; i < effectValue[1]; i++)
{
int index = CombatCalculateTool.Instance.GetOdd(0, buffId.Count);
int id = buffId[index];
BuffInfo buffInfo = BuffInfo.GetBuffInfo(id, effectValue[2], 1);
BuffBasic buffBasic = target.BuffControl.AddBuff(CombatHeroEntity, buffInfo);
buffId.RemoveAt(index);
}
long att = CombatMagicWeaponEntity.RootMagicWeaponControl.combatHeroEntity.CurrCombatHeroInfo.attack.Value;
long harm = CombatCalculateTool.Instance.GetVlaueRatioForLong(att, effectValue[0]);
CombatCalculateTool.Instance.Harm(CombatMagicWeaponEntity.RootMagicWeaponControl.combatHeroEntity,
lifetCycleHitPoint as CombatHeroHitPoint, harm, AttType.FaBao, triggerData, wuXingType, null,
HarmType.Default);
}
}
}