hch
10 天以前 9a279f036ab7480f5ecd1a4e46b5a8af2d4f890d
64 【命格】自动推演问题
10个文件已修改
143 ■■■■■ 已修改文件
Main/System/Equip/EquipExchangeCell.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Equip/EquipExchangeWin.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Equip/EquipModel.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Main/AutoFightModel.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Mingge/MinggeAutoSetWin.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Mingge/MinggeEquipChangeCell.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Mingge/MinggeEquipWin.cs 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Mingge/MinggeManager.cs 88 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Mingge/MinggeWin.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Utility/EnumHelper.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Equip/EquipExchangeCell.cs
@@ -110,7 +110,7 @@
            long showFightPower = FightPowerManager.Instance.GetFightPowerChange(EquipModel.Instance.selectFloorEquip);
            if (showFightPower < 0)
            if (showFightPower <= 0)
            {
                fightPowerNum.text = UIHelper.AppendColor(TextColType.Red, $"-{UIHelper.ReplaceLargeNum(Math.Abs(showFightPower))}", false);
                cmpResult = 2;
Main/System/Equip/EquipExchangeWin.cs
@@ -45,7 +45,7 @@
            if (oldEquip.guid == EquipModel.Instance.selectFloorEquip.guid)
            {
                Debug.LogError("Display: 新旧装备相同GUID 客户端主动删除背包物品索引=" + EquipModel.Instance.selectFloorEquip.gridIndex);
                PackManager.Instance.GetSinglePack(PackType.DropItem).RemoveItem(EquipModel.Instance.selectFloorEquip.gridIndex);
                // PackManager.Instance.GetSinglePack(PackType.DropItem).RemoveItem(EquipModel.Instance.selectFloorEquip.gridIndex);
                CloseWindow();
                return;
            }
Main/System/Equip/EquipModel.cs
@@ -275,7 +275,7 @@
    /// <summary>
    /// 装备操作, // 0 - 拾取非装备物品;1 - 分解;2 - 穿戴/替换
    /// </summary>
    /// <param name="itemIndexList"></param>
    /// <param name="itemIndexList"> 暂定都是单件处理如果要批量处理 注意战力的计算消耗</param>
    /// <param name="opType"></param>
    /// <param name="autoDecompose"></param>
    public void SendEquipOP(ushort[] itemIndexList, byte opType, bool autoDecompose = false)
Main/System/Main/AutoFightModel.cs
@@ -380,7 +380,7 @@
        long showFightPower = FightPowerManager.Instance.GetFightPowerChange(item);
        if (showFightPower < 0)
        if (showFightPower <= 0)
        {
            EquipModel.Instance.SendEquipOP(new ushort[] { (ushort)item.gridIndex }, 1);
            return true;
Main/System/Mingge/MinggeAutoSetWin.cs
@@ -239,6 +239,7 @@
        itemNameText.text = ItemConfig.Get(MinggeManager.Instance.tyItemID).ItemName;
        cancelBtn.SetActive(MinggeManager.Instance.isStartAuto);
        startBtn.SetActive(!MinggeManager.Instance.isStartAuto);
        speedUPToggle.SetIsOnWithoutNotify(MinggeManager.Instance.autoSpeedUP);
    }
    public void DisplayPresetBtns()
Main/System/Mingge/MinggeEquipChangeCell.cs
@@ -28,7 +28,7 @@
    [SerializeField] UIEffectPlayer uieffect;
    int cmpResult = 0;  // 装备对比结果 0相同 1更强 2更弱
    bool isToggle = true;
    int selectMinggePresetID = 0;
    void Start()
@@ -48,7 +48,7 @@
        decomposeCheck.onValueChanged.RemoveAllListeners();
        decomposeCheck.onValueChanged.AddListener((bool isOn) =>
        {
            isToggle = !isToggle;
            MinggeManager.Instance.isMGEquipUIDecomposeToggle = !MinggeManager.Instance.isMGEquipUIDecomposeToggle;
        });
    }
@@ -89,7 +89,7 @@
            {
                presetGO.SetActive(false);
            }
            decomposeCheck.isOn = isToggle;
            decomposeCheck.isOn = MinggeManager.Instance.isMGEquipUIDecomposeToggle;
            if (oldEquip == null)
            {
@@ -109,7 +109,7 @@
            long showFightPower = FightPowerManager.Instance.GetFightPowerMinggeChange(MinggeManager.Instance.selectFloorEquip, selectPresetID);
            if (showFightPower < 0)
            if (showFightPower <= 0)
            {
                fightPowerNum.text = UIHelper.AppendColor(TextColType.Red, $"-{UIHelper.ReplaceLargeNum(Math.Abs(showFightPower))}", false);
                cmpResult = 2;
@@ -230,6 +230,7 @@
            else
            {
                Debug.LogError("命格掉落物品已被删除" + MinggeManager.Instance.selectFloorEquip.gridIndex);
                UIManager.Instance.CloseWindow<MinggeEquipWin>();
            }
        }
    }
Main/System/Mingge/MinggeEquipWin.cs
@@ -12,7 +12,7 @@
    List<Text> presetNameTexts = new List<Text>();
    int selectPresetID = 0;
    int lastDropIndex = -1;
    // int lastDropIndex = -1;
    protected override void InitComponent()
    {
        presetNameTexts.Clear();
@@ -31,15 +31,19 @@
    protected override void OnPreOpen()
    {
        selectPresetID = MinggeManager.Instance.equipShowPresetID;
        lastDropIndex = MinggeManager.Instance.selectFloorEquip.gridIndex;
        PackManager.Instance.RefreshItemEvent += RefreshItemEvent;
        // lastDropIndex = MinggeManager.Instance.selectFloorEquip.gridIndex;
        // PackManager.Instance.RefreshItemEvent += RefreshItemEvent;
        if (MinggeManager.Instance.isStartAuto)
        {
            MinggeManager.Instance.isPauseAuto = true;
        }
        Display();
    }
    protected override void OnPreClose()
    {
        PackManager.Instance.RefreshItemEvent -= RefreshItemEvent;
        // PackManager.Instance.RefreshItemEvent -= RefreshItemEvent;
        MinggeManager.Instance.equipShowPresetID = 0;
        MinggeManager.Instance.selectFloorEquip = null;
@@ -51,13 +55,19 @@
    }
    void RefreshItemEvent(PackType packType, int index, int itemID)
    // void RefreshItemEvent(PackType packType, int index, int itemID)
    // {
    //     if (packType == PackType.Mingge)
    //     {
    //         MinggeManager.Instance.selectFloorEquip = PackManager.Instance.GetItemByIndex(PackType.MinggeDrop, lastDropIndex);
    //         Display();
    //     }
    // }
    public void RefreshUI()
    {
        if (packType == PackType.Mingge)
        {
            MinggeManager.Instance.selectFloorEquip = PackManager.Instance.GetItemByIndex(PackType.MinggeDrop, lastDropIndex);
            Display();
        }
        selectPresetID = MinggeManager.Instance.equipShowPresetID;
        Display();
    }
    void Display()
@@ -109,7 +119,7 @@
            if (oldEquip.guid == MinggeManager.Instance.selectFloorEquip.guid)
            {
                Debug.LogError("Display: 新旧命格相同GUID 客户端主动删除背包物品索引=" + MinggeManager.Instance.selectFloorEquip.gridIndex);
                PackManager.Instance.GetSinglePack(PackType.MinggeDrop).RemoveItem(MinggeManager.Instance.selectFloorEquip.gridIndex);
                // PackManager.Instance.GetSinglePack(PackType.MinggeDrop).RemoveItem(MinggeManager.Instance.selectFloorEquip.gridIndex);
                CloseWindow();
                return;
            }
Main/System/Mingge/MinggeManager.cs
@@ -110,21 +110,25 @@
    private void OnEquipResult(HA814_tagMCMakeItemAnswer info)
    {
        if (info.MakeType != (int)MakeType.MinggeTY)
            return;
        OnOPCallbackEvent?.Invoke(0);
        if (info.MakeType == (int)MakeType.MinggeTY)
        {
            waitTYOPPack = false;
            autoTYTime = Time.time;
            CalcEquip();
            OnOPCallbackEvent?.Invoke(0);
        }
        else if (info.MakeType == (int)MakeType.MinggeEquip)
        {
            waitTYOPPack = false;
            autoTYTime = Time.time;
            CalcEquip();
            OnOPCallbackEvent?.Invoke(1);
        }
    }
    void RefreshItemEvent(PackType type, int index, int itemID)
    {
        if (type == PackType.MinggeDrop)
        {
            waitTYOPPack = false;
            CalcEquip();
        }
        if (type == PackType.Item && (itemID == tyItemID || itemID == qlItemID))
        {
            UpdateRedPoint();
@@ -135,7 +139,6 @@
    public bool CalcEquip()
    {
        var items = PackManager.Instance.GetItems(PackType.MinggeDrop);
        Debug.Log("命格掉落背包中的物品数量:" + items.Count);
        if (items.IsNullOrEmpty())
        {
            if (UIManager.Instance.IsOpened<MinggeEquipWin>())
@@ -144,6 +147,7 @@
            }
            return false;
        }
        Debug.Log("命格掉落背包中的物品数量:" + items.Count);
        foreach (var item in items)
        {
@@ -244,7 +248,6 @@
            return false;
        }
        //非自动情况下,默认当前方案
        if (autoPreseetID == 0)
@@ -266,6 +269,12 @@
            if (!UIManager.Instance.IsOpened<MinggeEquipWin>())
            {
                UIManager.Instance.OpenWindow<MinggeEquipWin>();
            }
            else
            {
                //刷新界面
                var win = UIManager.Instance.GetUI<MinggeEquipWin>();
                win.RefreshUI();
            }
        }
        else
@@ -307,22 +316,7 @@
        var pack = new CB250_tagCSMinggeTuiyan();
        pack.Count = (byte)count;
        GameNetSystem.Instance.SendInfo(pack);
        if (isStartAuto && UIManager.Instance.IsOpened<MinggeWin>())
        {
            //显示特效
            var ui = UIManager.Instance.GetUI<MinggeWin>();
            ui.tyEffect.onComplete = null;
            ui.tyEffect.Play();
            if (autoSpeedUP)
            {
                ui.tyEffect.speedRate = autoTYCDs[0] / autoTYCDs[1];
            }
            else
            {
                ui.tyEffect.speedRate = 1;
            }
        }
    }
    public void SendChangeMingge(int selectMinggePresetID, int dropIndex, bool autodec)
@@ -332,6 +326,8 @@
        pack.Index = (byte)dropIndex;
        pack.AutoDec = (byte)(autodec ? 1 : 0);
        GameNetSystem.Instance.SendInfo(pack);
        autoTYTime = Time.time;
        waitTYOPPack = true;
    }
    public void SendDecompose(byte[] itemIndexList)
@@ -340,6 +336,8 @@
        pack.IndexList = itemIndexList;
        pack.Count = (byte)itemIndexList.Length;
        GameNetSystem.Instance.SendInfo(pack);
        autoTYTime = Time.time;
        waitTYOPPack = true;
    }
@@ -467,6 +465,8 @@
    public float autoTYTime;
    public int needOfficialRank;
    public bool isMGEquipUIDecomposeToggle; //装备对比界面 是否勾选了分解
    //公共部分
    public bool autoCostToggle
    {
@@ -483,6 +483,10 @@
    {
        get
        {
            if (!autoCostToggle)
            {
                return 1;
            }
            return LocalSave.GetInt($"MGCostCnt_{PlayerDatas.Instance.baseData.PlayerID}", 1);
        }
        set
@@ -619,6 +623,11 @@
        if (!isStartAuto)
            return true;
        if (!isMGEquipUIDecomposeToggle)
        {
            //玩家没有勾选装备对比界面的分解, 那么自动不可处理分解
            return true;
        }
        //优先判断当前方案命格
        var curPresetID = FuncPresetManager.Instance.GetFuncPresetID((int)FuncPresetType.Mingge);
@@ -781,7 +790,7 @@
    bool IsFightPowerOK(ItemModel mgEquip, MinggeAutoSet autoSet)
    {
        long showFightPower = FightPowerManager.Instance.GetFightPowerMinggeChange(mgEquip, autoSet.presetID);
        if (showFightPower >= 0)
        if (showFightPower > 0)
        {
            return true;
        }
@@ -813,8 +822,10 @@
            SysNotifyMgr.Instance.ShowTip("MinggeAuto1");
            return;
        }
        SendTY(autoCostCount);
        autoTYTime = Time.time;
        SendTY(autoCostCount);
    }
    void OnMSEvent()
@@ -829,6 +840,25 @@
        }
        if (Time.time - autoTYTime < autoTYCDs[autoSpeedUP ? 1 : 0])
        {
            if (!waitTYOPPack)
            {
                //显示特效
                var ui = UIManager.Instance.GetUI<MinggeWin>();
                if (!ui.tyEffect.isPlaying)
                {
                    ui.tyEffect.onComplete = null;
                    if (autoSpeedUP)
                    {
                        ui.tyEffect.speedRate = autoTYCDs[0] / autoTYCDs[1];
                    }
                    else
                    {
                        ui.tyEffect.speedRate = 1;
                    }
                    ui.tyEffect.Play();
                }
            }
            return;
        }
Main/System/Mingge/MinggeWin.cs
@@ -369,7 +369,7 @@
        }
        else
        {
            SysNotifyMgr.Instance.ShowTip("MinggeAuto6", RealmConfig.Get(PlayerDatas.Instance.baseData.realmLevel).Name);
            SysNotifyMgr.Instance.ShowTip("MinggeAuto6", RealmConfig.Get(MinggeManager.Instance.needOfficialRank).Name);
            UIManager.Instance.OpenWindow<PrivilegeCardWin>();
        }
    }
Main/Utility/EnumHelper.cs
@@ -790,7 +790,8 @@
    GatherSoulCompound = 23,//聚魂合成
    GatherSoulDecompose = 24,//聚魂分解
    EquipOP = 25,   // 25 主界面装备分解/替换回复 对应 B4 15 主线掉落物品操作 #tagCSMainDropItemOP
    MinggeTY = 26,
    MinggeTY = 26,  // 推演
    MinggeEquip = 27,  // 命格装备操作
}