yyl
1 天以前 6faba902086330e9c2c49948b10e5aeecb893bcd
125 战斗 取消行动包的设定 修复行动莫名结束的bug
7个文件已修改
274 ■■■■ 已修改文件
Main/Core/NetworkPackage/CustomServerPack/CustomHB426CombinePack.cs 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/BattleField/RecordActions/DeathRecordAction.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/BattleManager.cs 149 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/BattleUtility.cs 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/RecordPlayer/RecordPlayer.cs 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/Skill/SkillBase.cs 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/UIComp/BasicHeroInfoContainer.cs 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Core/NetworkPackage/CustomServerPack/CustomHB426CombinePack.cs
@@ -31,6 +31,7 @@
        }
        endTag = _endTag;
        toIndex = _toIndex;
        PrintAllPack();
    }
@@ -43,6 +44,26 @@
        }
        fromIndex = _fromIndex;
        startTag = tag;
    }
    public void PrintAllPack()
    {
        string temp = "CustomHB426CombinePack startTag: " + (startTag != null ? startTag.Tag : "null") + " fromIndex: " + fromIndex + " toIndex: " + toIndex + "\n";
        for (int i = 0; i < packList.Count; i++)
        {
            var pack = packList[i];
            if (pack is CustomHB426CombinePack b426Pack)
            {
                temp += "  pack type is " + pack.GetType().Name + " tag is " + (b426Pack.startTag != null ? b426Pack.startTag.Tag : "null") + "\n";
            }
            else
            {
                temp += "  pack type is " + pack.GetType().Name + "\n";
            }
        }
        BattleDebug.LogError(temp);
    }
    public void AddPack(GameNetPackBasic pack)
Main/System/Battle/BattleField/RecordActions/DeathRecordAction.cs
@@ -42,10 +42,10 @@
                    if (isLastOne)
                    {
                        UniTaskExtension.DelayTime((GameObject)null, 0.3f / battleField.speedRatio, () =>
                        {
                        // UniTaskExtension.DelayTime((GameObject)null, 0.3f / battleField.speedRatio, () =>
                        // {
                            isFinish = true;
                        });
                        // });
                    }
                });
            }
Main/System/Battle/BattleManager.cs
@@ -126,6 +126,30 @@
        List<GameNetPackBasic> packQueueSnapshot = new List<GameNetPackBasic>(packQueue);
        List<GameNetPackBasic> newPackList = ParseBattlePackList(string.Empty, packQueueSnapshot);
        Action printNewPack = () =>
        {
            string temp = "After AnalysisPackQueueAndDistribute newPackList count: " + newPackList.Count + "\n";
            foreach (var pack in newPackList)
            {
                if (pack is CustomHB426CombinePack b426Pack)
                {
                    temp += "  pack type is " + pack.GetType().Name + " tag is " + (b426Pack.startTag != null ? b426Pack.startTag.Tag : "null") + "\n";
                }
                else if (pack is CustomB421ActionPack b421Pack)
                {
                    temp += "  pack type is " + pack.GetType().Name + " guid is " + b421Pack.guid + "\n";
                }
                else
                {
                    temp += "  pack type is " + pack.GetType().Name + "\n";
                }
            }
            Debug.LogWarning(temp);
        };
        printNewPack();
        // HashSet<int> skipIndexes = new HashSet<int>();
        // // 这里已经是按照Dequeue的顺序了
@@ -210,127 +234,15 @@
    public static List<GameNetPackBasic> ParseBattlePackList(string guid, List<GameNetPackBasic> packQueueSnapshot)
    {
        bool wrong = false;
        List<GameNetPackBasic> newPackList = new List<GameNetPackBasic>();
        HB421_tagMCTurnFightObjAction b421Pack = null;
        for (int i = 0; i < packQueueSnapshot.Count; i++)
        var list = CustomHB426CombinePack.CombineToSkillPackFromList(guid, packQueueSnapshot);
        string str = "ParseBattlePackList \n";
        for (int i = 0; i < list.Count; i++)
        {
            GameNetPackBasic pack = packQueueSnapshot[i];
            if (null == b421Pack)
            {
                if (pack is HB421_tagMCTurnFightObjAction _b421)
                {
                    b421Pack = _b421;
                }
                else
                {
                    newPackList.Add(pack);
                }
                continue;
            }
            else
            {
                List<GameNetPackBasic> b421List = new List<GameNetPackBasic>();
                bool find = false;
                for (int k = i; k < packQueueSnapshot.Count; k++/*, Debug.LogError(k + " : is plusing")*/)
                {
                    GameNetPackBasic maybeB426Pack = packQueueSnapshot[k];
                    if (maybeB426Pack is HB426_tagSCTurnFightTag b426Pack)
                    {
                        // Debug.LogError(k + " : find b426 " + maybeB426Pack.packUID + " sign " + b426Pack.Sign + " tag " + b426Pack.Tag);
                        if (b426Pack.Sign == 0)
                        {
                            find = true;
                            List<GameNetPackBasic> b426List = new List<GameNetPackBasic>();
                            b426List.Add(b426Pack);
                            for (int j = k + 1; j < packQueueSnapshot.Count; j++)
                            {
                                GameNetPackBasic maybeB426EndPack = packQueueSnapshot[j];
                                if (maybeB426EndPack is HB426_tagSCTurnFightTag b426EndPack)
                                {
                                    // Debug.LogError(j + " : find b426 end pack : " + b426EndPack.packUID + " sign " + b426EndPack.Sign + " tag " + b426EndPack.Tag);
                                    if (b426EndPack.Tag == b426Pack.Tag)
                                    {
                                        if (b426EndPack.Sign == 1)
                                        {
                                            b426List.Add(maybeB426EndPack);
                                            k = j;
                                            i = k;
                                            break;
                                        }
                                        else
                                        {
                                            Debug.LogError("错误的Sign == 1");
                                            continue;
                                        }
                                    }
                                    else
                                    {
                                        //  新的一对
                                    }
                                }
                                else
                                {
                                    b426List.Add(maybeB426EndPack);
                                    k = j;
                                    i = k;
                                }
                            }
                            //    这里面的b421还没处理
                            List<GameNetPackBasic> combinedList = CustomHB426CombinePack.CombineToSkillPackFromList(guid, b426List);
                            b421List.AddRange(combinedList);
                        }
                        else
                        {
                            wrong = true;
                            Debug.LogError("错误的b426 分析有问题 " + b426Pack.packUID);
                        }
                    }
                    else
                    {
                        if (!find)
                        {
                            newPackList.Add(maybeB426Pack);
                            i = k;
                        }
                        else
                        {
                            if (maybeB426Pack is HB421_tagMCTurnFightObjAction _b421)
                            {
                                i = k - 1;
                                break;
                            }
                            b421List.Add(maybeB426Pack);
                            i = k;
                        }
                    }
                }
                CustomB421ActionPack actionPack = CustomB421ActionPack.CreateB421ActionPack(guid, b421List);
                newPackList.Add(actionPack);
                b421Pack = null;
            }
            str += "  " + list[i].GetType().Name + "\n";
        }
        BattleDebug.LogError(str);
        return list;
        if (wrong)
        {
            string output = string.Empty;
            for (int f = 0; f < packQueueSnapshot.Count; f++)
            {
                output += (packQueueSnapshot[f].packUID  + "&" + packQueueSnapshot[f].GetType().ToString() + "|");
            }
            Debug.LogError(output);
        }
        return newPackList;
    }
    //  专属于主线战斗的派发
@@ -596,6 +508,7 @@
    // 4-继续战斗          -   玩家主线战斗中(包含主线小怪、主线boss),前端表现完后端同步的战斗片段后,可再回复该值,后端会根据战斗逻辑及流程自动回复下一段的战斗片段封包,一直循环
    public void MainFightRequest(byte reqType, uint reqValue = 0)
    {
        // Debug.LogError("MainFightRequest reqType " + reqType + " reqValue " + reqValue);
        CB413_tagCSMainFightReq req = new CB413_tagCSMainFightReq();
        req.ReqType = reqType;
        req.ReqValue = reqValue;
Main/System/Battle/BattleUtility.cs
@@ -306,47 +306,36 @@
        {
            var pack = packList[i];
            //    寻找死亡包 找到死亡包之后要找掉落包 不能超过技能包
            if (pack is HB422_tagMCTurnFightObjDead)
            if (pack is HB422_tagMCTurnFightObjDead deadPack)
            {
                var deadPack = pack as HB422_tagMCTurnFightObjDead;
                deadPacks.Add(deadPack);
            }
            else if (pack is CustomHB426CombinePack)
            {
                //    找死亡包不要越过技能包
                var combinePack = pack as CustomHB426CombinePack;
                if (combinePack.startTag.Tag.StartsWith("Skill_"))
                {
                    break;
                }
                break;
            }
        }
        // Debug.LogError("find dead pack " + deadPacks.Count);
        return deadPacks;
    }
    public static List<HB423_tagMCTurnFightObjReborn> FindRebornPack(List<GameNetPackBasic> packList)
    {
        List<HB423_tagMCTurnFightObjReborn> rebornPack = new List<HB423_tagMCTurnFightObjReborn>();
        List<HB423_tagMCTurnFightObjReborn> rebornPackList = new List<HB423_tagMCTurnFightObjReborn>();
        for (int i = 0; i < packList.Count; i++)
        {
            var pack = packList[i];
            //    寻找死亡包 找到死亡包之后要找掉落包 不能超过技能包
            if (pack is HB423_tagMCTurnFightObjReborn)
            if (pack is HB423_tagMCTurnFightObjReborn rebornPack)
            {
                var deadPack = pack as HB423_tagMCTurnFightObjReborn;
                rebornPack.Add(deadPack);
                rebornPackList.Add(rebornPack);
            }
            else if (pack is CustomHB426CombinePack)
            {
                //    找死亡包不要越过技能包
                var combinePack = pack as CustomHB426CombinePack;
                if (combinePack.startTag.Tag.StartsWith("Skill_"))
                {
                    break;
                }
                break;
            }
        }
        return rebornPack;
        return rebornPackList;
    }
}
Main/System/Battle/RecordPlayer/RecordPlayer.cs
@@ -25,7 +25,9 @@
    public bool IsPlaying()
    {
        return currentRecordAction != null || recordActionQueue.Count > 0 || immediatelyActionList.Count > 0;
        bool isPlaying = currentRecordAction != null || recordActionQueue.Count > 0 || immediatelyActionList.Count > 0;
        //BattleDebug.LogError("IsPlaying " + isPlaying + " currentRecordAction " + (currentRecordAction != null) + " recordActionQueue.Count " + recordActionQueue.Count + " immediatelyActionList.Count " + immediatelyActionList.Count);
        return isPlaying;
    }
    public void PlayRecord(RecordAction recordAction)
Main/System/Battle/Skill/SkillBase.cs
@@ -36,6 +36,8 @@
    public int fromSkillId;
    public bool isPlay = false;
    public SkillBase(BattleObject _caster, SkillConfig _skillCfg, HB427_tagSCUseSkill vNetData, List<GameNetPackBasic> _packList, BattleField _battleField = null)
    {
        caster = _caster;
@@ -48,13 +50,12 @@
        battleField = _battleField;
        packList = _packList;
    }
    public virtual void Run()
    {
        if (null != skillEffect)
        {
            if (skillEffect.IsFinished())
@@ -66,6 +67,7 @@
            {
                skillEffect.Run();
            }
            return;
        }
        if (otherSkillAction != null)
@@ -79,6 +81,7 @@
            {
                otherSkillAction.Run();
            }
            return;
        }
    }
@@ -289,6 +292,7 @@
        // OnMiddleFrameEnd 中摇结束
        // OnFinalFrameStart 后摇开始
        // OnFinalFrameEnd 后摇结束
        return caster.motionBase.PlaySkillAnimation(skillConfig, this, onComplete);
    }
@@ -302,6 +306,8 @@
            );
        skillEffect.Play(OnHitTargets);
        isPlay = true;
    }
    //    技能前摇帧结束
@@ -604,11 +610,22 @@
    }
    public virtual bool IsFinished()
    {
        if (!isPlay)
        {
            return false;
        }
        if (skillEffect != null)
        {
            if (!skillEffect.IsFinished())
            {
                return false;
            }
            else
            {
                skillEffect = null;
                OnSkillFinished();
                return false;
            }
        }
@@ -618,7 +635,14 @@
            {
                return false;
            }
            else
            {
                otherSkillAction = null;
                OnSkillFinished();
                return false;
            }
        }
        if (isFinished && moveFinished)
        {
@@ -632,7 +656,13 @@
            }
            battleField.battleRootNode.skillMaskNode.SetActive(false);
            return true;
            if (packList.Count > 0)
            {
                OnSkillFinished();
                return false;
            }
            return packList.Count <= 0;
        }
        else
        {
@@ -645,6 +675,7 @@
        skillEffect?.ForceFinished();
        isFinished = true;
        moveFinished = true;
        isPlay = true;
        while (packList.Count > 0)
        {
@@ -657,7 +688,7 @@
                {
                    BattleDebug.LogError("other skill casting " + combinePack.startTag.Tag);
                    otherSkillAction = combinePack.CreateSkillAction();
                    otherSkillAction.fromSkillId = skillConfig.SkillID;
                    //    强制结束其他技能
                    otherSkillAction.ForceFinish();
                    return;
@@ -666,7 +697,6 @@
            else if (pack is CustomB421ActionPack actionPack)
            {
                actionPack.Distribute();
                return;
            }
            PackageRegedit.Distribute(pack);
        }
@@ -679,6 +709,25 @@
            if (!skillEffect.IsFinished())
            {
                return;
            }
            else
            {
                skillEffect = null;
                OnSkillFinished();
            }
        }
        if (otherSkillAction != null)
        {
            if (!otherSkillAction.IsFinished())
            {
                return;
            }
            else
            {
                otherSkillAction = null;
                OnSkillFinished();
            }
        }
@@ -701,8 +750,9 @@
            else if (pack is CustomB421ActionPack actionPack)
            {
                actionPack.Distribute();
                return;
            }
            // Debug.LogError("Distribute pack " + pack.GetType().ToString());
            PackageRegedit.Distribute(pack);
        }
Main/System/Battle/UIComp/BasicHeroInfoContainer.cs
@@ -7,9 +7,12 @@
    public Image countryIcon;
    public Text txtLv;
    public void SetHeroInfo(TeamHero teamHero)
    {
        txtLvName.text = string.Format("Lv.{0} {1}", teamHero.level, teamHero.name);
        txtLvName.text = teamHero.name; //string.Format("{0}", teamHero.level, teamHero.name);
        countryIcon.SetSprite(HeroUIManager.Instance.GetCountryIconName((int)teamHero.Country));
        txtLv.text = string.Format("[{0}]", teamHero.level);
    }
}