125 战斗 修复 combine skill第一个为非skill包的问题 增加技能配置错误容错(技能帧配置太长导致动作结束 事件没结束) 调整技能代码 删除多余字段
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | // 嵌套包内的包合并 |
| | | foreach (var combinePack in combineDict.Values) |
| | | { |
| | |
| | | { |
| | | if (indexDict.TryGetValue(i, out var pack)) |
| | | { |
| | | indexDict.Remove(i); |
| | | combinePack.AddPack(pack); |
| | | if (pack is CustomHB426CombinePack) |
| | | { |
| | | // 如果是嵌套的包 加入之后 调整i |
| | | combinePack.AddPack(pack); |
| | | i = (pack as CustomHB426CombinePack).toIndex; |
| | | } |
| | | else |
| | | { |
| | | combinePack.AddPack(pack); |
| | | indexDict.Remove(i); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | private bool isCast = false; |
| | | |
| | | public int fromSkillId = 0; |
| | | |
| | | public SkillRecordAction(BattleField _battleField, BattleObject _caster, HB427_tagSCUseSkill vNetData, List<GameNetPackBasic> packList) |
| | | : base(RecordActionType.Skill, _battleField, _caster) |
| | | { |
| | |
| | | return; |
| | | } |
| | | |
| | | if (!skillBase.IsFinished()) |
| | | if (isCast && !skillBase.IsFinished()) |
| | | { |
| | | skillBase.Run(); |
| | | } |
| | |
| | | if (isCast) |
| | | return; |
| | | |
| | | if (fromSkillId > 0) |
| | | { |
| | | BattleDebug.LogError("cast skill from skill : " + fromSkillId); |
| | | } |
| | | |
| | | |
| | | skillBase.fromSkillId = fromSkillId; |
| | | |
| | | skillBase.Cast(); |
| | | |
| | | isCast = true; |
| | |
| | | // 动画帧更新处理 |
| | | int triggerMFEndCount = 0; |
| | | Action updateLocalHandler = null; |
| | | |
| | | int failCallbackTimes = 0; |
| | | |
| | | updateLocalHandler = () => |
| | | { |
| | | if (isFinish) return; |
| | | |
| | | float frame = (skillTrackEntry.TrackTime * (float)BattleConst.skillMotionFps); |
| | | float frame = (skillTrackEntry.TrackTime * skillTrackEntry.TimeScale * (float)BattleConst.skillMotionFps); |
| | | |
| | | if (skillTrackEntry.TrackTime == 0) |
| | | { |
| | | failCallbackTimes++; |
| | | } |
| | | |
| | | if (failCallbackTimes > 100) |
| | | { |
| | | Debug.LogError("技能动画播放失败,回调异常,强制结束 " + skillConfig.SkillID + " 导致错误的原因是技能帧配置得太久导致技能动作结束了事件还没结束"); |
| | | skillBase.ForceFinished(); |
| | | RemoveRunAction(updateLocalHandler); |
| | | isFinish = true; |
| | | return; |
| | | } |
| | | |
| | | // 前摇结束(只触发一次) |
| | | if (!beginPhaseTriggered && frame >= skillConfig.StartupFrames && curLoop == 0) |
| | |
| | | |
| | | public void PlayRecord(RecordAction recordAction) |
| | | { |
| | | // BattleDebug.LogError("Enqueue record action " + recordAction.GetType()); |
| | | BattleDebug.LogError("Enqueue record action " + recordAction.GetType()); |
| | | recordActionQueue.Enqueue(recordAction); |
| | | } |
| | | |
| | |
| | | |
| | | public void InsertRecord(RecordAction recordAction) |
| | | { |
| | | // BattleDebug.LogError("Insert record action " + recordAction.GetType()); |
| | | BattleDebug.LogError("Insert record action " + recordAction.GetType()); |
| | | if (currentRecordAction != null) |
| | | { |
| | | Queue<RecordAction> tempQueue = new Queue<RecordAction>(); |
| | |
| | | |
| | | if (currentRecordAction != null && currentRecordAction.IsFinished()) |
| | | { |
| | | // BattleDebug.LogError("record action " + currentRecordAction.GetType() + " play finished"); |
| | | BattleDebug.LogError("record action " + currentRecordAction.GetType() + " play finished"); |
| | | currentRecordAction = null; |
| | | isWaitingNextAction = true; |
| | | waitTimer = 0f; |
| | |
| | | if (recordActionQueue.Count > 0) |
| | | { |
| | | currentRecordAction = recordActionQueue.Dequeue(); |
| | | // BattleDebug.LogError("play record action " + currentRecordAction.GetType()); |
| | | BattleDebug.LogError("play record action " + currentRecordAction.GetType()); |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using System; |
| | | using System.Linq; |
| | | |
| | | public class MountBuffSkill : SkillBase |
| | | { |
| | | |
| | | public MountBuffSkill(BattleObject _caster, SkillConfig _skillCfg, |
| | | HB427_tagSCUseSkill _vNetData, List<GameNetPackBasic> _packList, BattleField _battleField) |
| | | : base(_caster, _skillCfg, _vNetData, _packList, _battleField) |
| | | { |
| | | |
| | | } |
| | | |
| | | |
| | | protected override void OnHitTargets(int _hitIndex, List<HB427_tagSCUseSkill.tagSCUseSkillHurt> hitList) |
| | | { |
| | | base.OnHitTargets(_hitIndex, hitList); |
| | | } |
| | | |
| | | protected override void OnAllAttackMoveFinished() |
| | | { |
| | | base.OnAllAttackMoveFinished(); |
| | | |
| | | OnSkillFinished(); |
| | | } |
| | | |
| | | protected override void OnHitEachTarget(int _hitIndex, BattleObject target, HB427_tagSCUseSkill.tagSCUseSkillHurt hurt) |
| | | { |
| | | // 什么都不做 只等buff |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 82b8f2f1107f8cc43957452aaa48844a |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | |
| | | protected BattleObject caster = null; // 施法者 |
| | | |
| | | protected bool startCounting = false; |
| | | |
| | | protected bool pauseState = false; |
| | | |
| | | protected int curFrame = 0; |
| | | |
| | | protected List<GameNetPackBasic> packList; |
| | | |
| | | protected SkillRecordAction otherSkillAction; |
| | |
| | | protected List<HB405_tagMCAddExp> expPackList = new List<HB405_tagMCAddExp>(); |
| | | |
| | | protected bool moveFinished = false; |
| | | |
| | | public int fromSkillId; |
| | | |
| | | public SkillBase(BattleObject _caster, SkillConfig _skillCfg, HB427_tagSCUseSkill vNetData, List<GameNetPackBasic> _packList, BattleField _battleField = null) |
| | | { |
| | |
| | | |
| | | public virtual void Run() |
| | | { |
| | | if (startCounting) |
| | | { |
| | | curFrame++; |
| | | } |
| | | |
| | | if (null != skillEffect) |
| | | { |
| | | if (skillEffect.IsFinished()) |
| | | { |
| | | skillEffect = null; |
| | | OnSkillFinished(); |
| | | } |
| | | else |
| | | { |
| | | skillEffect.Run(); |
| | | } |
| | | } |
| | | |
| | | if (otherSkillAction != null) |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | public void Pause() |
| | | { |
| | | pauseState = startCounting; |
| | | startCounting = false; |
| | | } |
| | | |
| | | public void Resume() |
| | | { |
| | | startCounting = pauseState; |
| | | } |
| | | |
| | | |
| | | // 0·移动到距离目标n码,的距离释放(可配置,9999即原地释放,负数则是移动到人物背面,人物要转身) |
| | | // 1·移动到距离阵容位置n码的距离(如2号位,5号位)释放(即战场中央此类) |
| | |
| | | /// <param name="times"></param> |
| | | public virtual void OnMiddleFrameStart(int times) |
| | | { |
| | | |
| | | // if (skillEffect != null) |
| | | { |
| | | skillEffect.OnMiddleFrameStart(times); |
| | |
| | | |
| | | public virtual void OnMiddleFrameEnd(int times, int hitIndex) |
| | | { |
| | | |
| | | // if (skillEffect != null) |
| | | { |
| | | skillEffect.OnMiddleFrameEnd(times, hitIndex); |
| | |
| | | /// </summary> |
| | | public virtual void OnFinalFrameStart() |
| | | { |
| | | |
| | | // if (skillEffect != null) |
| | | { |
| | | skillEffect.OnFinalFrameStart(); |
| | |
| | | { |
| | | return false; |
| | | } |
| | | else |
| | | } |
| | | |
| | | if (otherSkillAction != null) |
| | | { |
| | | OnSkillFinished(); |
| | | skillEffect = null; |
| | | if (!otherSkillAction.IsFinished()) |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | |
| | | bo.heroInfoBar.SetActive(true); |
| | | } |
| | | battleField.battleRootNode.skillMaskNode.SetActive(false); |
| | | |
| | | |
| | | |
| | | |
| | | return true; |
| | | } |
| | |
| | | { |
| | | BattleDebug.LogError("other skill casting " + combinePack.startTag.Tag); |
| | | otherSkillAction = combinePack.CreateSkillAction(); |
| | | otherSkillAction.fromSkillId = skillConfig.SkillID; |
| | | return; |
| | | } |
| | | } |
| | |
| | | case 2: |
| | | skill = new DirectlyHealSkill(_caster, skillConfig, vNetData, packList, battleField); |
| | | break; |
| | | // case 3: |
| | | // case 4: |
| | | // case 5: |
| | | // case 6: |
| | | // case 14: |
| | | // // skill = new MountBuffSkill(_caster, skillConfig, vNetData, packList, battleField); |
| | | // break; |
| | | case 3: |
| | | case 4: |
| | | case 5: |
| | | case 6: |
| | | case 14: |
| | | skill = new MountBuffSkill(_caster, skillConfig, vNetData, packList, battleField); |
| | | break; |
| | | default: |
| | | Debug.LogError("超出了技能类型范围 请检查配置, 目前暂时只支持攻击类型的技能"); |
| | | break; |
| | | } |
| | | |
| | | // skill 挂载buff |
| | | // skill 1 2 3 4技能 |
| | | // skill头 B428 尾 |
| | | |
| | | return skill; |
| | | } |
| | | } |