Core/GameEngine/DataToCtl/PackageRegedit.cs
@@ -11,6 +11,7 @@ public static void Init() { // 登记相应的数据体及对应的数据转逻辑类 Register(typeof(HA31E_tagMCGatherSoulHoleInfo), typeof(DTCA31E_tagMCGatherSoulHoleInfo)); Register(typeof(HAA1D_tagMCActTotalRechargeInfo), typeof(DTCAA1D_tagMCActTotalRechargeInfo)); Register(typeof(HAA1C_tagMCTotalRechargePlayerInfo), typeof(DTCAA1C_tagMCTotalRechargePlayerInfo)); Register(typeof(HA717_tagMCChatBubbleBoxState), typeof(DTCA717_tagMCChatBubbleBoxState)); Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA518_tagCMGatherSoulUp.cs
New file @@ -0,0 +1,20 @@ using UnityEngine; using System.Collections; // A5 18 聚魂升级 #tagCMGatherSoulUp public class CA518_tagCMGatherSoulUp : GameNetPackBasic { public byte PlaceType; // 位置类型;0-背包,1-孔 public ushort PlaceIndex; // 位置索引 public CA518_tagCMGatherSoulUp () { combineCmd = (ushort)0x03FE; _cmd = (ushort)0xA518; } public override void WriteToBytes () { WriteBytes (PlaceType, NetDataType.BYTE); WriteBytes (PlaceIndex, NetDataType.WORD); } } Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA518_tagCMGatherSoulUp.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: b6661ae74043bd047ac00848ec3e8475 timeCreated: 1545015576 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA519_tagCMGatherSoulDecompose.cs
New file @@ -0,0 +1,22 @@ using UnityEngine; using System.Collections; // A5 19 聚魂分解 #tagCMGatherSoulDecompose public class CA519_tagCMGatherSoulDecompose : GameNetPackBasic { public byte IsAuto; // 是否自动分解 public byte Count; // 指定批量分解数,最大不超过50个 public ushort[] PlaceIndexList; // 批量分解位置索引列表 public CA519_tagCMGatherSoulDecompose () { combineCmd = (ushort)0x03FE; _cmd = (ushort)0xA519; } public override void WriteToBytes () { WriteBytes (IsAuto, NetDataType.BYTE); WriteBytes (Count, NetDataType.BYTE); WriteBytes (PlaceIndexList, NetDataType.WORD, Count); } } Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA519_tagCMGatherSoulDecompose.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: 69b90cf6a5a092342b96386da8631a53 timeCreated: 1545015576 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA51C_tagCMGatherSoulCompound.cs
New file @@ -0,0 +1,24 @@ using UnityEngine; using System.Collections; // A5 1C 聚魂合成 #tagCMGatherSoulCompound public class CA51C_tagCMGatherSoulCompound : GameNetPackBasic { public byte Cnt; public byte[] PackList; //所在位置 0-背包 1-孔 public ushort[] IndexList; //物品索引 public uint TagItemID; //合成目标物品ID public CA51C_tagCMGatherSoulCompound () { combineCmd = (ushort)0x03FE; _cmd = (ushort)0xA51C; } public override void WriteToBytes () { WriteBytes (Cnt, NetDataType.BYTE); WriteBytes (PackList, NetDataType.BYTE, Cnt); WriteBytes (IndexList, NetDataType.WORD, Cnt); WriteBytes (TagItemID, NetDataType.DWORD); } } Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA51C_tagCMGatherSoulCompound.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: 7324300e72513334bb76a6c7b0e36bb2 timeCreated: 1545015576 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA31E_tagMCGatherSoulHoleInfo.cs
New file @@ -0,0 +1,26 @@ //-------------------------------------------------------- // [Author]: 第二世界 // [ Date ]: Monday, December 17, 2018 //-------------------------------------------------------- using Snxxz.UI; using System; using System.Collections; using System.Collections.Generic; public class DTCA31E_tagMCGatherSoulHoleInfo : DtcBasic { public override void Done(GameNetPackBasic vNetPack) { base.Done(vNetPack); var package = vNetPack as HA31E_tagMCGatherSoulHoleInfo; var model = ModelCenter.Instance.GetModel<GatheringSoulModel>(); model.OnReceiveServerPack(package); } } Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA31E_tagMCGatherSoulHoleInfo.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: 7ac2fb93687ddce4e99497d25fa0ffc0 timeCreated: 1545015653 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Core/NetworkPackage/ServerPack/HA3_Function/HA31E_tagMCGatherSoulHoleInfo.cs
New file @@ -0,0 +1,19 @@ using UnityEngine; using System.Collections; // A3 1E 玩家聚魂孔信息 #tagMCGatherSoulHoleInfo public class HA31E_tagMCGatherSoulHoleInfo : GameNetPackBasic { public byte Count; // 孔信息数 public uint[] GatherSoulDataList; // 孔数据信息, 数据与背包数据相同 public HA31E_tagMCGatherSoulHoleInfo () { _cmd = (ushort)0xA31E; } public override void ReadFromBytes (byte[] vBytes) { TransBytes (out Count, vBytes, NetDataType.BYTE); TransBytes (out GatherSoulDataList, vBytes, NetDataType.DWORD, Count); } } Core/NetworkPackage/ServerPack/HA3_Function/HA31E_tagMCGatherSoulHoleInfo.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: 81c8714d2fa24da4c967cfc831d4ae92 timeCreated: 1545015632 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: System/GatheringSoul/GatherSoulComposeWin.cs
@@ -50,7 +50,6 @@ Display(); model.onSelectComposeItemChange += OnSelectComposeItemChange; model.onSelectCategoryChange += OnSelectCategoryChange; soulModel.gatherSoulHoleRefresh += GatherSoulHoleRefresh; soulModel.gatherSoulPackRefresh += GatherSoulPackRefresh; } @@ -62,7 +61,6 @@ { model.onSelectComposeItemChange -= OnSelectComposeItemChange; model.onSelectCategoryChange -= OnSelectCategoryChange; soulModel.gatherSoulHoleRefresh -= GatherSoulHoleRefresh; soulModel.gatherSoulPackRefresh -= GatherSoulPackRefresh; } @@ -71,11 +69,6 @@ } #endregion private void GatherSoulPackRefresh() { DisplayCompose(); } private void GatherSoulHoleRefresh(int hole) { DisplayCompose(); } @@ -204,6 +197,36 @@ DisplayErrorTip(error); return; } else { GatherSoulComposeModel.Compose compose; if (model.TryGetCompose(model.selectItemId, out compose)) { byte[] packArray = new byte[compose.requireItems.Count]; ushort[] indexArray = new ushort[compose.requireItems.Count]; for (int i = 0; i < compose.requireItems.Count; i++) { GatherSoulItem item; if (soulModel.TryGetHighestLevelItem(compose.requireItems[i], out item)) { packArray[i] = (byte)item.placeType; indexArray[i] = (ushort)item.index; } else { return; } } CA51C_tagCMGatherSoulCompound pak = new CA51C_tagCMGatherSoulCompound(); pak.PackList = packArray; pak.IndexList = indexArray; pak.Cnt = (byte)compose.requireItems.Count; pak.TagItemID = (uint)model.selectItemId; GameNetSystem.Instance.SendInfo(pak); } } } bool TestCompose(out int error) System/GatheringSoul/GatherSoulHoleBehaviour.cs
@@ -14,6 +14,7 @@ [SerializeField] RectTransform m_ContainreItem; [SerializeField] RectTransform m_ContainerEquipSign; [SerializeField] RectTransform m_ContainerLock; [SerializeField] RectTransform m_ContaienrRedpoint; [SerializeField] Image m_Icon; [SerializeField] Text m_ItemName; [SerializeField] Text m_Level; @@ -40,7 +41,11 @@ model.gatherSoulHoleRefresh -= GatherSoulHoleRefresh; model.gatherSoulHoleRefresh += GatherSoulHoleRefresh; RedpointCenter.Instance.redpointValueChangeEvent -= RedpointValueChangeEvent; RedpointCenter.Instance.redpointValueChangeEvent += RedpointValueChangeEvent; DisplayBase(); DisplayRedpoint(); } void DisplayBase() @@ -118,6 +123,21 @@ } } private void RedpointValueChangeEvent(int id) { if (id == model.equipRedpoint.id || id == model.levelUpRedpoint.id) { DisplayRedpoint(); } } void DisplayRedpoint() { bool requireRedpoint = (model.equipRedpoint.state == RedPointState.Simple && model.equipRedpointHole == hole) || (model.levelUpRedpoint.state == RedPointState.Simple && model.levelUpRedpointHole == hole); m_ContaienrRedpoint.gameObject.SetActive(requireRedpoint); } private void OnTipFunc(ItemWinBtnType funcType, string arg2) { WindowCenter.Instance.CloseImmediately<GatherSoulTipWin>(); @@ -145,6 +165,7 @@ public void Dispose() { model.gatherSoulHoleRefresh -= GatherSoulHoleRefresh; RedpointCenter.Instance.redpointValueChangeEvent -= RedpointValueChangeEvent; } } } System/GatheringSoul/GatherSoulItemBehaviour.cs
@@ -17,6 +17,7 @@ [SerializeField] Text m_ItemName; [SerializeField] Text m_Count; [SerializeField] Button m_Func; [SerializeField] RectTransform m_Redpoint; VirtualPackModel model { @@ -33,7 +34,7 @@ get { return ModelCenter.Instance.GetModel<GatheringSoulModel>(); } } VirtualItem diplayItem; VirtualItem displayItem; private void Awake() { @@ -50,13 +51,13 @@ /// <param name="index"></param> public void Display(int index) { diplayItem = default(VirtualItem); displayItem = default(VirtualItem); GatherSoulItem item; bool exist = model.TryGetItem(PackType.rptGatherSoul, index, out item) && index != -1; m_ContainerItem.gameObject.SetActive(exist); if (exist) { diplayItem = new VirtualItem() displayItem = new VirtualItem() { packType = PackType.rptGatherSoul, index = index, @@ -74,7 +75,7 @@ m_ContainerItem.gameObject.SetActive(false); return; } diplayItem = new VirtualItem() displayItem = new VirtualItem() { packType = (PackType)0, itemId = id, @@ -86,13 +87,13 @@ void Display() { var config = Config.Instance.Get<ItemConfig>(diplayItem.itemId); var config = Config.Instance.Get<ItemConfig>(displayItem.itemId); if (config != null) { m_Icon.SetSprite(config.IconKey); if (m_Level != null) { m_Level.text = Language.Get("Z1024", diplayItem.level); m_Level.text = Language.Get("Z1024", displayItem.level); } if (m_ItemBottom != null) { @@ -103,6 +104,7 @@ m_ItemName.text = config.ItemName; } } DisplayRedpoint(); } public void DisplayCount(int count, int requireCount = 0) @@ -123,58 +125,71 @@ } } void DisplayRedpoint() { if (m_Redpoint != null) { m_Redpoint.gameObject.SetActive(displayItem.packType == PackType.rptGatherSoul && soulModel.replaceRedpoint.state == RedPointState.Simple && soulModel.replaceRedpointIndex == displayItem.index); } } void OnFunc() { var itemTipsModel = ModelCenter.Instance.GetModel<ItemTipsModel>(); if (diplayItem.packType == PackType.rptGatherSoul) if (displayItem.packType == PackType.rptGatherSoul) { GatherSoulItem item; if (model.TryGetItem(diplayItem.packType, diplayItem.index, out item)) if (model.TryGetItem(displayItem.packType, displayItem.index, out item)) { var data = new ItemAttrData(item.id); data.SetGatherSoul(item.level, -1); bool requireCompose = composeModel.ExistInComposeMat(item.id); if (requireCompose) data.SetGatherSoul(item.level, -1, PackType.rptGatherSoul, displayItem.index); if (item.itemType != GatheringSoulModel.GATHERSOUL_ESSENCE_TYPE) { data.SetTipsFuncBtn(ItemWinBtnType.compose, OnTipFunc); } if (!soulModel.IsSamePropertyCompareHoles(-1, item as GatherSoulItem)) { data.SetTipsFuncBtn(ItemWinBtnType.Wear, OnTipFunc); } else { data.SetTipsFuncBtn(ItemWinBtnType.Replace, OnTipFunc); } var propertyCount = soulModel.gatherSoulPropertys[item.id].Count; if (propertyCount == 1) { data.SetTipsFuncBtn(ItemWinBtnType.Resolve, OnTipFunc); } else { data.SetTipsFuncBtn(ItemWinBtnType.split, OnTipFunc); bool requireCompose = composeModel.ExistInComposeMat(item.id); if (requireCompose) { data.SetTipsFuncBtn(ItemWinBtnType.compose, OnTipFunc); } if (soulModel.IsSamePropertyCompareHoles(-1, item as GatherSoulItem) == -1) { data.SetTipsFuncBtn(ItemWinBtnType.Wear, OnTipFunc); } else { data.SetTipsFuncBtn(ItemWinBtnType.Replace, OnTipFunc); } var propertyCount = soulModel.gatherSoulPropertys[item.id].Count; if (propertyCount == 1) { data.SetTipsFuncBtn(ItemWinBtnType.Resolve, OnTipFunc); } else { data.SetTipsFuncBtn(ItemWinBtnType.split, OnTipFunc); } } itemTipsModel.SetItemTipsModel(data); } } else { var data = new ItemAttrData(diplayItem.itemId); data.SetGatherSoul(diplayItem.level, -1); var data = new ItemAttrData(displayItem.itemId); data.SetGatherSoul(displayItem.level, -1); itemTipsModel.SetItemTipsModel(data); } } private void OnTipFunc(ItemWinBtnType type, string arg2) { if (diplayItem.Equals(default(VirtualItem))) if (displayItem.Equals(default(VirtualItem))) { WindowCenter.Instance.Close<GatherSoulTipWin>(); return; } GatherSoulItem item; if (!model.TryGetItem(diplayItem.packType, diplayItem.index, out item)) if (!model.TryGetItem(displayItem.packType, displayItem.index, out item)) { WindowCenter.Instance.Close<GatherSoulTipWin>(); return; System/GatheringSoul/GatherSoulLevelUpWin.cs
@@ -161,7 +161,10 @@ } else { CA518_tagCMGatherSoulUp pak = new CA518_tagCMGatherSoulUp(); pak.PlaceType = (byte)item.placeType; pak.PlaceIndex = (ushort)item.index; GameNetSystem.Instance.SendInfo(pak); } } } System/GatheringSoul/GatherSoulResolveWin.cs
@@ -8,8 +8,10 @@ using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using System.Linq; namespace Snxxz.UI { namespace Snxxz.UI { public class GatherSoulResolveWin : Window { @@ -19,6 +21,7 @@ [SerializeField] Toggle m_AutoResolveToggle; [SerializeField] Button m_OpenQualitySort; [SerializeField] SortTable m_QualitySort; [SerializeField] Text m_Quality; [SerializeField] Text m_SoulDust; [SerializeField] Button m_Resolve; [SerializeField] Button m_Close; @@ -52,6 +55,10 @@ protected override void OnPreOpen() { model.resolveItems.Clear(); selectQuality = GetDefaultQuality(); m_Quality.text = Language.Get(StringUtility.Contact("GatherSoulResolve_", selectQuality)); Display(); PlayerDatas.Instance.PlayerDataRefreshInfoEvent += PlayerDataRefreshInfoEvent; model.gatherSoulPackRefresh += GatherSoulPackRefresh; @@ -67,6 +74,7 @@ protected override void OnPreClose() { model.autoResolve = m_AutoResolveToggle.isOn; model.resolveItems.Clear(); PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= PlayerDataRefreshInfoEvent; model.gatherSoulPackRefresh -= GatherSoulPackRefresh; @@ -79,6 +87,19 @@ } #endregion int GetDefaultQuality() { for (int i = 2; i < 5; i++) { model.GetResolveSouls(i, model.resolveItems); if (model.resolveItems.Count > 0) { return i; } } return 2; } private void PlayerDataRefreshInfoEvent(PlayerDataRefresh refreshType) { if (refreshType == PlayerDataRefresh.CDBPlayerRefresh_SoulDust) @@ -89,7 +110,8 @@ private void OnRefreshCell(ScrollerDataType type, CellView cell) { var resolveCell = cell as GatherSoulResolveCell; resolveCell.Display(cell.index); } private void OnSelectSort(SortType type, int sort) @@ -97,6 +119,7 @@ if (type == SortType.EquipQuality) { selectQuality = sort; Display(); } } @@ -170,7 +193,26 @@ private void Resolve() { if (model.resolveItems.Count == 0) { return; } List<ushort> list = new List<ushort>(); for (int i = 0; i < model.resolveItems.Count; i++) { if (model.CheckExist(model.resolveItems[i])) { list.Add((ushort)model.resolveItems[i].index); } } var page = Mathf.CeilToInt((float)list.Count / 50); for (int i = 0; i < page; i++) { ushort[] resolves = list.Skip(page * 50).Take((i < page - 1) ? 50 : (list.Count - page * 50)).ToArray(); model.SendResolvePack(resolves, false); } } } System/GatheringSoul/GatherSoulTipWin.cs
@@ -21,6 +21,7 @@ [SerializeField] RectTransform m_ContainerGetWay; [SerializeField] Button[] m_Funcs; [SerializeField] Text[] m_FuncBtnDisplays; [SerializeField] RectTransform[] m_Redpoints; [SerializeField] Text m_GetWay; [SerializeField] Button m_Close; @@ -28,6 +29,11 @@ ItemTipsModel itemTipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } } GatheringSoulModel model { get { return ModelCenter.Instance.GetModel<GatheringSoulModel>(); } } #region Built-in @@ -108,6 +114,18 @@ } }); m_FuncBtnDisplays[index].text = Language.Get(StringUtility.Contact("ItemHandle_", callBackType)); m_Redpoints[index].gameObject.SetActive(false); if (callBackType == ItemWinBtnType.LevelUp) { m_Redpoints[index].gameObject.SetActive(model.levelUpRedpoint.state == RedPointState.Simple && model.levelUpRedpointHole == itemTipsModel.curAttrData.equipHole); } else if (callBackType == ItemWinBtnType.Replace) { m_Redpoints[index].gameObject.SetActive(model.replaceRedpoint.state == RedPointState.Simple && itemTipsModel.curAttrData.index == model.replaceRedpointIndex); } } index++; } System/GatheringSoul/GatherSoulTotalPropertyWin.cs
@@ -38,7 +38,7 @@ protected override void OnPreOpen() { model.gatherSoulHoleRefresh += GatherSoulHoleRefresh; model.gatherSoulHolesRefresh += GatherSoulHoleRefresh; DisplayProperty(); } @@ -48,7 +48,7 @@ protected override void OnPreClose() { model.gatherSoulHoleRefresh -= GatherSoulHoleRefresh; model.gatherSoulHolesRefresh -= GatherSoulHoleRefresh; } protected override void OnAfterClose() @@ -135,7 +135,7 @@ return 0; } private void GatherSoulHoleRefresh(int hole) private void GatherSoulHoleRefresh() { DisplayProperty(); } System/GatheringSoul/GatheringSoulModel.cs
@@ -28,7 +28,18 @@ public bool autoResolve { get; set; get { return QuickSetting.Instance.GetQuickSettingBool(QuickSetting.QuickSettingType.GatherSoulAutoResolve, 0, false); } set { var now = QuickSetting.Instance.GetQuickSettingBool(QuickSetting.QuickSettingType.GatherSoulAutoResolve, 0, false); if (value != now) { QuickSetting.Instance.SetQuickSetting(QuickSetting.QuickSettingType.GatherSoulAutoResolve, value); } } } public int coreHole { get; private set; } @@ -36,6 +47,7 @@ public int autoResolveRemainCount { get; private set; } public event Action<int> gatherSoulHoleRefresh; public event Action gatherSoulHolesRefresh; public event Action gatherSoulPackRefresh; public const int GATHERSOUL_SOUL_TYPE = 0; @@ -50,11 +62,11 @@ const int GATHERSOUL_REDPOINT_DEEP = 1010200; static int redpointIndex = 0; readonly Redpoint redpoint = new Redpoint(101, GATHERSOUL_REDPOINT_BASE); readonly Redpoint equipRedpoint = new Redpoint(GATHERSOUL_REDPOINT_BASE, GATHERSOUL_REDPOINT_DEEP + redpointIndex++); readonly Redpoint replaceRedpoint = new Redpoint(GATHERSOUL_REDPOINT_BASE, GATHERSOUL_REDPOINT_DEEP + redpointIndex++); readonly Redpoint resolveRedpoint = new Redpoint(GATHERSOUL_REDPOINT_BASE, GATHERSOUL_REDPOINT_DEEP + redpointIndex++); readonly Redpoint levelUpRedpoint = new Redpoint(GATHERSOUL_REDPOINT_BASE, GATHERSOUL_REDPOINT_DEEP + redpointIndex++); public readonly Redpoint redpoint = new Redpoint(101, GATHERSOUL_REDPOINT_BASE); public readonly Redpoint equipRedpoint = new Redpoint(GATHERSOUL_REDPOINT_BASE, 1010201); public readonly Redpoint replaceRedpoint = new Redpoint(GATHERSOUL_REDPOINT_BASE, 1010202); public readonly Redpoint resolveRedpoint = new Redpoint(GATHERSOUL_REDPOINT_BASE, 1010203); public readonly Redpoint levelUpRedpoint = new Redpoint(GATHERSOUL_REDPOINT_BASE, 1010204); static readonly IComparer<int> soulPackSort = new GatherSoulPackSort(); static readonly IEqualityComparer<int> holeItemTypeDistinct = new HoleItemTypeDistinct(); @@ -321,14 +333,26 @@ return false; } public void OnReceiveServerPack() public void OnReceiveServerPack(HA31E_tagMCGatherSoulHoleInfo package) { gatherSoulHoleDict.Clear(); for (int i = 0; i < package.Count; i++) { var data = package.GatherSoulDataList[i]; var item = new GatherSoulItem(); item.ParseHoleItem(i, data, 1); gatherSoulHoleDict.Add(i, item); if (gatherSoulHoleRefresh != null) { gatherSoulHoleRefresh(i); } } if (gatherSoulHolesRefresh != null) { gatherSoulHolesRefresh(); } RefreshGatherSoulPack(); UpdateRedpoint(); if (gatherSoulHoleRefresh != null) { gatherSoulHoleRefresh(0); } } public bool ContainsEquipSoul(int hole) @@ -383,6 +407,10 @@ public bool SatisfyEquipSoul(GatherSoulItem item, int hole, out int error) { error = 0; if (item.placeType != 0) { return false; } var itemConfig = Config.Instance.Get<ItemConfig>(item.id); if (IsHoleUnlock(hole)) { @@ -397,7 +425,16 @@ return false; } } if (IsSamePropertyCompareHoles(hole, item)) bool samePropertyCompareHole = false; GatherSoulItem holeItem; if (TryGetItem(hole, out holeItem)) { if (item.ExistSameProperty(holeItem.id)) { samePropertyCompareHole = true; } } if (!samePropertyCompareHole && IsSamePropertyCompareHoles(hole, item) != -1) { error = 3; return false; @@ -466,20 +503,21 @@ } } public bool IsSamePropertyCompareHoles(int exclude, GatherSoulItem item) public int IsSamePropertyCompareHoles(int exclude, GatherSoulItem item) { foreach (var hole in gatherSoulHoleDict.Keys) var count = holeCount; for (int i = 0; i < count; i++) { if (hole == exclude) if (i == exclude) { continue; } if (IsSamePropertyCompareHole(hole, item)) if (IsSamePropertyCompareHole(i, item)) { return true; return i; } } return false; return -1; } public bool IsSamePropertyCompareHole(int hole, GatherSoulItem item) @@ -545,11 +583,7 @@ { switch (type) { case ItemWinBtnType.dismantle: break; case ItemWinBtnType.compose: break; case ItemWinBtnType.LevelUp: break; case ItemWinBtnType.split: case ItemWinBtnType.Resolve: @@ -569,8 +603,19 @@ } break; case ItemWinBtnType.Wear: WindowCenter.Instance.Close<GatherSoulTipWin>(); if (ExistEmptyHole()) { ExecuteEquipSoul(item); } else { SysNotifyMgr.Instance.ShowTip(""); } break; case ItemWinBtnType.Replace: WindowCenter.Instance.Close<GatherSoulTipWin>(); ExecuteReplaceSoul(item); break; } } @@ -595,7 +640,75 @@ { return; } SendResolvePack(new ushort[1] { (ushort)item.index }, false); } public void ExecuteEquipSoul(GatherSoulItem item) { var error = 0; List<int> list; if (ExistEmptyHole(out list)) { for (int i = 0; i < list.Count; i++) { if (SatisfyEquipSoul(item, list[i], out error)) { SendEquipPack((int)PackType.rptGatherSoul, item.index, (int)PackType.rptInterimPack, list[i]); return; } } } } public void ExecuteReplaceSoul(GatherSoulItem item) { var error = 0; var count = holeCount; var tryEquipHole = -1; for (int i = 0; i < count; i++) { if (SatisfyEquipSoul(item, i, out error)) { tryEquipHole = i; break; } } if (tryEquipHole != -1) { GatherSoulItem holeItem; if (TryGetItem(tryEquipHole, out holeItem)) { var sameHole = -1; if (gatherSoulPropertys[item.id].Count > gatherSoulPropertys[holeItem.id].Count) { sameHole = IsSamePropertyCompareHoles(tryEquipHole, item); } if (sameHole != -1) { SendEquipPack((int)PackType.rptInterimPack, sameHole, (int)PackType.rptGatherSoul, 0); } SendEquipPack((int)PackType.rptGatherSoul, item.index, (int)PackType.rptInterimPack, tryEquipHole); } } } public void SendResolvePack(ushort[] resolves, bool isAuto) { CA519_tagCMGatherSoulDecompose pak = new CA519_tagCMGatherSoulDecompose(); pak.IsAuto = isAuto ? (byte)1 : (byte)0; pak.PlaceIndexList = resolves; pak.Count = (byte)resolves.Length; GameNetSystem.Instance.SendInfo(pak); } void SendEquipPack(int srcpackType, int scrIndex, int destpackType, int destIndex) { C073D_tagCPackItemExchange pak = new C073D_tagCPackItemExchange(); pak.SrcBackpack = (byte)srcpackType; pak.SrcIndex = (ushort)scrIndex; pak.DesBackPack = (byte)destpackType; pak.DestIndex = (ushort)destIndex; GameNetSystem.Instance.SendInfo(pak); } public bool CheckExist(GatherSoulItem item) @@ -998,12 +1111,26 @@ } autoResolveList.Clear(); GetResolveSouls(int.MaxValue, autoResolveList); List<ushort> resolveList = new List<ushort>(); for (int i = 0; i < autoResolveList.Count; i++) { resolveList.Add((ushort)autoResolveList[i].index); } var page = Mathf.CeilToInt((float)resolveList.Count / 50); for (int i = 0; i < page; i++) { ushort[] resolves = resolveList.Skip(page * 50).Take((i < page - 1) ? 50 : (list.Count - page * 50)).ToArray(); SendResolvePack(resolves, false); } } } #endregion #region 红点 public int equipRedpointHole = 0; public int levelUpRedpointHole = 0; public int replaceRedpointIndex = 0; void UpdateRedpoint() { equipRedpoint.state = RedPointState.None; @@ -1025,6 +1152,7 @@ { if (SatisfyEquipSoul(item, holes[i], out error)) { equipRedpointHole = i; equipRedpoint.state = RedPointState.Simple; return; } @@ -1043,6 +1171,7 @@ { if (SatisfyReplace(i, item) && item.Compare(holeItem) == 1) { replaceRedpointIndex = item.index; replaceRedpoint.state = RedPointState.Simple; return; } System/KnapSack/Logic/ItemTipsModel.cs
@@ -2880,10 +2880,12 @@ tipsFuncBtnDic.Add(type,func); } public void SetGatherSoul(int level,int equipHole) public void SetGatherSoul(int level, int equipHole, PackType packType = PackType.rptDeleted, int index = -1) { this.level = level; this.equipHole = equipHole; this.packType = packType; this.index = index; } /// <summary> /// 设置该物品的弹框类型 System/Skill/QuickSetting.cs
@@ -18,6 +18,7 @@ quickSettingDic.Add(QuickSettingType.AutoUseXp, new QuickSettingRange(QuickSettingType.AutoUseXp, 1)); quickSettingDic.Add(QuickSettingType.SpAnim, new QuickSettingRange(QuickSettingType.SpAnim, 10)); quickSettingDic.Add(QuickSettingType.TreasureHighestAnim, new QuickSettingRange(QuickSettingType.TreasureHighestAnim, 10)); quickSettingDic.Add(QuickSettingType.GatherSoulAutoResolve, new QuickSettingRange(QuickSettingType.GatherSoulAutoResolve, 1)); setting = new string(UCharacter, 100); DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += BeforePlayerDataInitializeEvent; } @@ -121,7 +122,8 @@ FairyLeagueGuide, AutoUseXp, SpAnim, TreasureHighestAnim TreasureHighestAnim, GatherSoulAutoResolve } public struct QuickSettingRange {