1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- using CombatLibrary.CombatLibrary.CombatCore.CustomizeTimeLogic.FxLogic;
- using Common.Utility.CombatEvent;
- using Fort23.Core;
- using GameLogic.Combat.CombatTool;
- using GameLogic.Combat.Hero;
- using UnityEngine;
- using UTool.CustomizeTimeLogic.FxLogic.TimeLineEventinterface;
- namespace GameLogic.Combat.Skill
- {
- /// <summary>
- /// 玄甲护体(防御型技能)
- /// 从四周飞来类似龟甲的碎片,乌龟龟甲上形成一个新的龟甲,防御+{0}%,敌人对其照成伤害时会收到{1}%反伤,
- /// 反伤为真实伤害。持续{2}秒
- /// </summary>
- public class S9022 : SkillBasic
- {
- private long currAddV;
- private bool isUpdate;
- private float currTime;
- protected override void ProActiveSkill()
- {
- CombatEventManager.Instance.AddEventListener(CombatEventType.HeroInjured, HeroInjured);
- }
- private void HeroInjured(IEventData data)
- {
- if (!isUpdate)
- {
- return;
- }
- HeroInjuredEventData heroInjuredEventData = data as HeroInjuredEventData;
- if (heroInjuredEventData.HarmReturnInfo.target.combatHeroEntity == CombatHeroEntity)
- {
- long harm = heroInjuredEventData.HarmReturnInfo.att;
- long v = CombatCalculateTool.Instance.GetVlaueRatioForLong(harm, effectValue[1]);
- HarmReturnInfo harmReturnInfo = CombatCalculateTool.Instance.Harm(CombatHeroEntity,
- heroInjuredEventData.HarmReturnInfo.source, v,
- AttType.Skill | AttType.FanJi, triggerData,
- wuXingType, null,
- HarmType.Default);
- }
- }
- protected override void ProUseSkill()
- {
- }
- protected override void ProDefaultTimeLineTrigger(string groupName, CombatHeroHitPoint targetEntity,
- ITimelineFxLogic timelineFxLogic,
- TriggerData triggerData, ISkillFeatures skillFeatures)
- {
- long def = CombatHeroEntity.MaxCombatHeroInfo.defense.Value;
- currAddV = CombatCalculateTool.Instance.GetVlaueRatioForLong(def, effectValue[0]);
- CombatHeroEntity.CurrCombatHeroInfo.defense += currAddV;
- isUpdate = true;
- currTime = 0;
- // HarmReturnInfo harmReturnInfo = CObjectPool.Instance.Fetch<HarmReturnInfo>();
- // harmReturnInfo.ArmorPiercing = effectValue[2];
- // float harmBl = effectValue[1];
- // long v = CombatCalculateTool.Instance.GetVlaueRatioForLong(CombatHeroEntity.CurrCombatHeroInfo.attack.Value,
- // harmBl);
- //
- // harmReturnInfo = CombatCalculateTool.Instance.Harm(CombatHeroEntity, targetEntity, v,
- // AttType.Skill, triggerData,
- // wuXingType, skillFeatures,
- // HarmType.Default, harmReturnInfo: harmReturnInfo);
- }
- protected override void ProCombatUpdate(float time)
- {
- if (!isUpdate)
- {
- return;
- }
- currTime += time;
- if (currTime > effectValue[2])
- {
- isUpdate = false;
- }
- }
- protected override void ProDispose()
- {
- CombatEventManager.Instance.RemoveEventListener(CombatEventType.HeroInjured, HeroInjured);
- }
- }
- }
|