using CombatLibrary.CombatLibrary.CombatCore.CustomizeTimeLogic.FxLogic;
using Core.Utility;
using Fort23.Core;
using GameLogic.Combat.CombatTool;
using GameLogic.Combat.Hero;
using GameLogic.Combat.Hero.SubStatus;
using UnityEngine;
using UTool.CustomizeTimeLogic.FxLogic.TimeLineEventinterface;
namespace GameLogic.Combat.Skill
{
///
/// 狼boss 第3个技能,跳跃攻击范围那的敌人
///
public class S140003 : SkillBasic
{
private float _harm;
private Parabola3DPath parabolaPath;
protected float _currTime;
protected float _addTime;
protected override void ProInitSkillConfig()
{
_harm = SelfSkillConfig.effectValue[0];
_addTime=1.0f/0.37f;
}
protected override void ProUseSkill()
{
ActivationTimeLineData("sk3");
}
protected override void ProDefaultTimeLineTrigger(string groupName, CombatHeroHitPoint targetEntity,
ITimelineFxLogic timelineFxLogic,
TriggerData triggerData)
{
_currTime = 0;
parabolaPath = CObjectPool.Instance.Fetch();
parabolaPath.addY += 3;
Vector3 startPos = CombatHeroEntity.dotPos;
Vector3 targetPos = startPos + CombatHeroEntity.faceDir * 4 ;
parabolaPath.SetPos(startPos, targetPos);
}
protected override void ProSkillPlayFinish()
{
CObjectPool.Instance.Recycle(parabolaPath);
parabolaPath = null;
}
protected override void ProCombatUpdate(float time)
{
if (parabolaPath != null)
{
_currTime += time*_addTime;
Vector3 pos = parabolaPath.GetPositionAtTime(_currTime);
CombatHeroEntity.combatHeroGameObject.SetPosition(pos);
if (_currTime >= 1)
{
CObjectPool.Instance.Recycle(parabolaPath);
parabolaPath = null;
long v = CombatCalculateTool.Instance.GetVlaueRatioForLong(
CombatHeroEntity.CurrCombatHeroInfo.attack.Value,
_harm);
for (int i = 0; i < _enterAlertTarget.Count; i++)
{
CombatHeroHitPoint combatHeroHitPoint = _enterAlertTarget[i].GetMainHotPoin();
HarmReturnInfo harmReturnInfo = Harm(CombatHeroEntity, combatHeroHitPoint,
v, AttType.Skill, triggerData);
RepelledStatusState repelledStatusState = new RepelledStatusState(_enterAlertTarget[i].faceDir*-1, 2, 10, null);
_enterAlertTarget[i].CombatAIBasic.AddSubStatus(repelledStatusState);
}
}
}
}
}
}