9919 子 [BT0.1][主干]仙宝寻主修改 / 9918 [BT0.1][主干]仙宝寻主修改
| | |
| | | WorldBossModel worldBossModel { get { return ModelCenter.Instance.GetModel<WorldBossModel>(); } }
|
| | | BossHomeModel bossHomeModel { get { return ModelCenter.Instance.GetModel<BossHomeModel>(); } }
|
| | | CrossServerBossModel crossServerBossModel { get { return ModelCenter.Instance.GetModel<CrossServerBossModel>(); } }
|
| | |
|
| | | FindPreciousModel findPreciousModel { get { return ModelCenter.Instance.GetModel<FindPreciousModel>(); } }
|
| | | public override void Done(GameNetPackBasic vNetPack)
|
| | | {
|
| | | base.Done(vNetPack);
|
| | |
| | | crossServerBossModel.buyCnt = (int)info.BuyCnt;
|
| | | break;
|
| | | }
|
| | | findPreciousModel.totalKillCountDict[info.BossType] = (int)info.KillCnt;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | return TryGetEquipGems(packIndex, out gems);
|
| | | }
|
| | |
|
| | | //获取某阶的装备宝石总等级
|
| | | public int GetGemLevelByEquipLevel(int level, int placeCount = 12)
|
| | | {
|
| | | int findCount = 0;
|
| | | for (int i = 1; i <= placeCount; i++)
|
| | | {
|
| | | int[] gems;
|
| | | if (TryGetEquipGems(level, i, out gems))
|
| | | {
|
| | | foreach (var equipGem in gems)
|
| | | {
|
| | | if (equipGem == 0)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | findCount += GetGemLevel(equipGem);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | return findCount;
|
| | | }
|
| | |
|
| | | public bool TryGetEquipGem(int level, int place, int hole, out int equipGem)
|
| | | {
|
| | | equipGem = 0;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | //boss类型:累计击杀次数
|
| | | public Dictionary<int, int> totalKillCountDict = new Dictionary<int, int>();
|
| | |
|
| | | public List<DropRecord> bossDropRecords = new List<DropRecord>();
|
| | | Dictionary<int, BossSubscribe> bossSubscribes = new Dictionary<int, BossSubscribe>();
|
| | | bool serverInited = false;
|
| | |
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | serverInited = false;
|
| | | totalKillCountDict.Clear();
|
| | | }
|
| | |
|
| | | public void OnAfterPlayerDataInitialize()
|
| | |
| | | m_EquipName.text = itemConfig.ItemName;
|
| | | m_EquipName.color = UIHelper.GetUIColor(itemConfig.ItemColor, true);
|
| | |
|
| | | var isView = (PlayerDatas.Instance.baseData.LV < GeneralDefine.BlueEquipJumpLevel && itemConfig.ItemColor >= 2)
|
| | | || itemConfig.ItemColor >= 3;
|
| | | var isView = betterModel.isAuction;
|
| | | m_FunctionTitle.text = Language.Get(isView ? "GoodEquip_See" : "GoodEquip_FitUp");
|
| | |
|
| | | m_EquipBehaviour.button.SetListener(() => { ItemTipUtility.Show(betterModel.guid, false); });
|
| | |
| | | public class ReciveConditionCell : CellView
|
| | | {
|
| | | [SerializeField] Text conditionText;
|
| | | [SerializeField] GameObject adviceText;
|
| | | [SerializeField] Button receiveBtn;
|
| | | [SerializeField] Text btnText;
|
| | | [SerializeField] UIEffect receiveEffect;
|
| | |
| | | [SerializeField] Image rewardBg;
|
| | | [SerializeField] Text rewardCntTex;
|
| | | [SerializeField] Button rewardBtn;
|
| | |
|
| | | [SerializeField] List<CommonItemBaisc> itemlist = new List<CommonItemBaisc>();
|
| | |
|
| | | TreasureFindHostModel hostModel { get { return ModelCenter.Instance.GetModel<TreasureFindHostModel>(); } }
|
| | | EquipModel equipModel { get { return ModelCenter.Instance.GetModel<EquipModel>(); } }
|
| | |
| | | }
|
| | |
|
| | | findId = findHosts.id;
|
| | |
|
| | | bool isReach = hostModel.IsReachCondition(findHosts);
|
| | | int process;
|
| | | bool isReach = hostModel.IsReachCondition(findHosts, out process);
|
| | |
|
| | | SetReceiveAwardInfo(findHosts);
|
| | |
|
| | | EquipSet equipSet;
|
| | | switch (findHosts.type)
|
| | | {
|
| | | case 1:
|
| | |
| | | {
|
| | | sb.Append(Language.Get("FindHostEquip_2"));
|
| | | }
|
| | | var equipSet = equipModel.GetEquipSet(findHostEquip.level);
|
| | | equipSet = equipModel.GetEquipSet(findHostEquip.level);
|
| | | var realmConfig = RealmConfig.Get(equipSet.realm);
|
| | | sb.Append(UIHelper.GetRealmName(equipSet.realm, true));
|
| | | sb.Append(UIHelper.AppendColor(findHostEquip.itemColor,
|
| | |
| | | }
|
| | | sb.Append(UIHelper.GetEquipPlaceName(findHostEquip.place));
|
| | | index++;
|
| | | conditionText.text = StringUtility.Contact(sb.ToString(), "\n", GetFindProgressStr(findHosts, isReach, process));
|
| | | }
|
| | | conditionText.text = StringUtility.Contact(sb.ToString(), "\n", GetFindProgressStr(findHosts));
|
| | | break;
|
| | | case 2:
|
| | | equipSet = equipModel.GetEquipSet(findHosts.conditions[0]);
|
| | | if (equipSet != null)
|
| | | { |
| | | var equipName = UIHelper.GetRealmName(equipSet.realm, true);
|
| | | var colorName = UIHelper.AppendColor(findHosts.conditions[1], UIHelper.GetColorNameByItemColor(findHosts.conditions[1]), true);
|
| | | conditionText.text = StringUtility.Contact(Language.Get("xbxztype2", findHosts.targetNum, colorName, equipName), "\n", GetFindProgressStr(findHosts, isReach, process));
|
| | | }
|
| | | break;
|
| | | case 3:
|
| | | case 4:
|
| | | case 5:
|
| | | case 6:
|
| | | equipSet = equipModel.GetEquipSet(findHosts.conditions[0]);
|
| | | if (equipSet != null)
|
| | | {
|
| | | var equipName = UIHelper.GetRealmName(equipSet.realm, true);
|
| | | conditionText.text = StringUtility.Contact(Language.Get("xbxztype" + findHosts.type, equipName, findHosts.targetNum), "\n", GetFindProgressStr(findHosts, isReach, process));
|
| | | }
|
| | | break;
|
| | | case 7:
|
| | | case 8:
|
| | | case 9:
|
| | | conditionText.text = StringUtility.Contact(Language.Get("xbxztype" + findHosts.type, findHosts.targetNum), "\n", GetFindProgressStr(findHosts, isReach, process));
|
| | | break;
|
| | | case 10:
|
| | | conditionText.text = StringUtility.Contact(Language.Get("xbxztype10", findHosts.targetNum, RichTextMsgReplaceConfig.GetRichReplace("BossTpye", findHosts.conditions[0])), "\n", GetFindProgressStr(findHosts, isReach, process));
|
| | | break;
|
| | | case 11:
|
| | | conditionText.text = StringUtility.Contact(Language.Get("xbxztype11", Language.Get("L" + (1125 + findHosts.conditions[0])), findHosts.targetNum), "\n", GetFindProgressStr(findHosts, isReach, process));
|
| | | break;
|
| | | case 12:
|
| | | conditionText.text = StringUtility.Contact(Language.Get("xbxztype12", findHosts.targetNum), "\n", GetFindProgressStr(findHosts, isReach, process));
|
| | | break;
|
| | | case 13:
|
| | | conditionText.text = StringUtility.Contact(Language.Get("xbxztype13", TreasureConfig.Get(findHosts.conditions[0]).Name), "\n", GetFindProgressStr(findHosts, isReach, process));
|
| | | break;
|
| | | case 14:
|
| | | conditionText.text = StringUtility.Contact(Language.Get("xbxztype14", RealmConfig.Get(findHosts.targetNum).Name), "\n", GetFindProgressStr(findHosts, isReach, process));
|
| | | break;
|
| | | }
|
| | |
|
| | | List<int> adviceIdlist = findHosts.findRecommandItems[PlayerDatas.Instance.baseData.Job];
|
| | | |
| | | receiveBtn.RemoveAllListeners();
|
| | | if (findHosts.IsCompleted)
|
| | | {
|
| | |
| | | receivedImg.SetActive(false);
|
| | | receiveBtn.AddListener(() =>
|
| | | {
|
| | | hostModel.SetAdviceIdlist(adviceIdlist);
|
| | | ItemTipUtility.Show(adviceIdlist[0]);
|
| | | if (findHosts.type == 1)
|
| | | {
|
| | | List<int> adviceIdlist = findHosts.findRecommandItems[PlayerDatas.Instance.baseData.Job];
|
| | | hostModel.SetAdviceIdlist(adviceIdlist);
|
| | | ItemTipUtility.Show(adviceIdlist[0]);
|
| | | }
|
| | | else
|
| | | {
|
| | | WindowJumpMgr.Instance.WindowJumpTo((JumpUIType)findHosts.recommendJumpID);
|
| | | }
|
| | | });
|
| | | }
|
| | | }
|
| | |
|
| | | adviceText.SetActive(false);
|
| | | }
|
| | |
|
| | | public void SetReceiveAwardInfo(FindTreasureInfo findHost)
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public string GetFindProgressStr(FindTreasureInfo info)
|
| | | public string GetFindProgressStr(FindTreasureInfo info, bool isReach, int process)
|
| | | {
|
| | | if (info.IsCompleted)
|
| | | {
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | if (!hostModel.IsReachCondition(info))
|
| | | if (!isReach)
|
| | | {
|
| | | return UIHelper.AppendColor(TextColType.Red, StringUtility.Contact(0, "/", info.targetNum), true);
|
| | | return UIHelper.AppendColor(TextColType.Red, StringUtility.Contact(process, "/", info.targetNum), true);
|
| | | }
|
| | | else
|
| | | {
|
| | | return UIHelper.AppendColor(TextColType.Green, StringUtility.Contact(1, "/", info.targetNum), true);
|
| | | return UIHelper.AppendColor(TextColType.Green, StringUtility.Contact(info.targetNum, "/", info.targetNum), true);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | using System.Collections.Generic;
|
| | | using System;
|
| | | using System.Linq;
|
| | | using System.Runtime.InteropServices;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
| | | return findTreasures;
|
| | | }
|
| | |
|
| | | public bool IsReachCondition(FindTreasureInfo treasureInfo)
|
| | |
|
| | | //条件类型 类型说明 数量 条件
|
| | | //1 穿戴X件X价X品质X套装X部位装备 件数[[阶, 品质, 是否套装, 部位]]
|
| | | //2 穿戴X件X价X品质装备 件数[x阶, x品质]
|
| | | //3 X阶装备总强化等级 强化等级[x阶]
|
| | | //4 X阶装备总升星等级 升星等级[x阶]
|
| | | //5 X阶装备总洗炼等级 洗炼等级[x阶]
|
| | | //6 X阶装备总宝石等级 宝石等级[x阶]
|
| | | //7 坐骑达到X阶 阶 无
|
| | | //8 天星塔达到X层 层 无
|
| | | //9 符印塔达到X层 层 无
|
| | | //10 击杀X只BOSS 只数[boss归类索引]
|
| | | //11 神兵达到X级 等级[x类型]
|
| | | //12 玩家等级达到X级 等级 无
|
| | | //13 获得法宝XXX 个数[法宝ID]
|
| | | //14 境界达到XXX 境界 无
|
| | |
|
| | | public bool IsReachCondition(FindTreasureInfo treasureInfo, out int findCount)
|
| | | {
|
| | | findCount = 0;
|
| | | if (treasureInfo == null)
|
| | | {
|
| | | return false;
|
| | | }
|
| | |
|
| | | switch(treasureInfo.type)
|
| | | switch (treasureInfo.type)
|
| | | {
|
| | | case 1:
|
| | | return CheckType1IsReachCondition(treasureInfo);
|
| | | if (CheckType1IsReachCondition(treasureInfo))
|
| | | {
|
| | | findCount = 1;
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | case 2:
|
| | | for (int i = 0; i <= 12; i++)
|
| | | {
|
| | | var equipIndex = EquipSet.ClientPlaceToServerPlace(new Int2(treasureInfo.conditions[0], i));
|
| | | var itemModel = packModel.GetItemByIndex(PackType.Equip, equipIndex);
|
| | | if (itemModel != null && itemModel.config.ItemColor >= treasureInfo.conditions[1])
|
| | | {
|
| | | findCount++;
|
| | | if (findCount >= treasureInfo.targetNum)
|
| | | return true;
|
| | | }
|
| | | }
|
| | | return false;
|
| | | case 3:
|
| | | findCount = 0;
|
| | | for (int i = 1; i <= 12; i++)
|
| | | { |
| | | findCount += ModelCenter.Instance.GetModel<EquipStrengthModel>().GetStrengthLevel(treasureInfo.conditions[0], i);
|
| | | if (findCount >= treasureInfo.targetNum)
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | case 4:
|
| | | findCount = ModelCenter.Instance.GetModel<EquipStarModel>().GetTotalStarLevel(treasureInfo.conditions[0]);
|
| | | if (findCount >= treasureInfo.targetNum)
|
| | | return true;
|
| | | return false;
|
| | | case 5:
|
| | | findCount = 0;
|
| | | for (int i = 1; i <= 12; i++)
|
| | | {
|
| | | findCount += ModelCenter.Instance.GetModel<EquipTrainModel>().GetTrainLevelEx(new Int2(treasureInfo.conditions[0], i));
|
| | | if (findCount >= treasureInfo.targetNum)
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | case 6:
|
| | | findCount = ModelCenter.Instance.GetModel<EquipGemModel>().GetGemLevelByEquipLevel(treasureInfo.conditions[0]);
|
| | | if (findCount >= treasureInfo.targetNum)
|
| | | return true;
|
| | | return false;
|
| | | case 7:
|
| | | findCount = ModelCenter.Instance.GetModel<MountModel>().HorseLV;
|
| | | if (findCount >= treasureInfo.targetNum)
|
| | | return true;
|
| | | return false;
|
| | | case 8:
|
| | | findCount = ModelCenter.Instance.GetModel<SkyTowerModel>().highestPassFloor;
|
| | | if (findCount >= treasureInfo.targetNum)
|
| | | return true;
|
| | | return false;
|
| | | case 9:
|
| | | findCount = ModelCenter.Instance.GetModel<RuneModel>().passRuneTowerFloor;
|
| | | if (findCount >= treasureInfo.targetNum)
|
| | | return true;
|
| | | return false;
|
| | | case 10:
|
| | | if (ModelCenter.Instance.GetModel<FindPreciousModel>().totalKillCountDict.ContainsKey(treasureInfo.conditions[0]))
|
| | | { |
| | | findCount = ModelCenter.Instance.GetModel<FindPreciousModel>().totalKillCountDict[treasureInfo.conditions[0]];
|
| | | if (findCount >= treasureInfo.targetNum)
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | case 11:
|
| | | var godWeaponInfo = ModelCenter.Instance.GetModel<MagicianModel>().GetGodWeaponInfo(treasureInfo.conditions[0]);
|
| | | if (godWeaponInfo != null)
|
| | | {
|
| | | findCount = godWeaponInfo.level;
|
| | | if (findCount >= treasureInfo.targetNum)
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | case 12:
|
| | | findCount = PlayerDatas.Instance.baseData.LV;
|
| | | if (findCount >= treasureInfo.targetNum)
|
| | | return true;
|
| | | return false;
|
| | | case 13:
|
| | | Treasure treasure = null;
|
| | | if (treasureModel.TryGetTreasure(treasureInfo.conditions[0], out treasure))
|
| | | {
|
| | | if (treasure.state == TreasureState.Collected)
|
| | | {
|
| | | findCount = 1;
|
| | | return true;
|
| | | }
|
| | | }
|
| | | return false;
|
| | | case 14:
|
| | | findCount = PlayerDatas.Instance.baseData.realmLevel;
|
| | | if (findCount >= treasureInfo.targetNum)
|
| | | return true;
|
| | | return false;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | public bool TryGetFindTreasureInfo(int findId,out FindTreasureInfo info)
|
| | | {
|
| | |
| | | List<FindTreasureInfo> list = findTreasures[treasureId];
|
| | | for (int i = 0; i < list.Count; i++)
|
| | | {
|
| | | bool isReach = IsReachCondition(list[i]);
|
| | | int process;
|
| | | bool isReach = IsReachCondition(list[i], out process);
|
| | | if(!list[i].IsCompleted && isReach)
|
| | | {
|
| | | treasureCellRedDict[treasureId].state = RedPointState.Simple;
|
| | |
| | | public readonly int treasureId;
|
| | | public readonly int type;
|
| | | public readonly int targetNum;
|
| | | public readonly int jumpId;
|
| | | public readonly int jumpId; //跳转最终法宝
|
| | | public readonly int recommendJumpID; //推荐跳转ID 和 findRecommandItems同字段来源
|
| | |
|
| | | public List<FindHostEquip> findHostEquips { get; private set; }
|
| | | public List<Item> findHostItems = new List<Item>();
|
| | | public List<FindHostEquip> findHostEquips { get; private set; } //需要满足的装备条件
|
| | | public List<Item> findHostItems = new List<Item>(); // 货币和奖励2选1显示
|
| | | public List<FindHostMoney> findHostMoneys = new List<FindHostMoney>();
|
| | | public Dictionary<int, List<int>> findRecommandItems = new Dictionary<int, List<int>>();
|
| | | public List<int> conditions = new List<int>(); //原类型1的装备存findHostEquips
|
| | |
|
| | | public bool IsCompleted;
|
| | |
|
| | |
| | | });
|
| | | }
|
| | | break;
|
| | | default:
|
| | | conditions = JsonMapper.ToObject<int[]>(config.Condition).ToList();
|
| | | break;
|
| | | }
|
| | |
|
| | | var itemArray = JsonMapper.ToObject<int[][]>(config.AwardItemList);
|
| | |
| | | count = itemArray[i][1],
|
| | | });
|
| | | }
|
| | |
|
| | | var moneyArray = JsonMapper.ToObject<int[][]>(config.Money);
|
| | | for (int i = 0; i < moneyArray.Length; i++)
|
| | | {
|
| | |
| | | });
|
| | | }
|
| | |
|
| | | var recommandJson = JsonMapper.ToObject(config.AdviceIds);
|
| | | foreach (var jobKey in recommandJson.Keys)
|
| | | //如果是纯数字就是跳转,否则是推荐装备
|
| | | if (!int.TryParse(config.AdviceIds, out recommendJumpID))
|
| | | {
|
| | | var items = new List<int>();
|
| | | findRecommandItems.Add(int.Parse(jobKey), items);
|
| | | var array = LitJson.JsonMapper.ToObject<int[]>(recommandJson[jobKey].ToJson());
|
| | | for (int i = 0; i < array.Length; i++)
|
| | | recommendJumpID = 0;
|
| | | var recommandJson = JsonMapper.ToObject(config.AdviceIds);
|
| | | foreach (var jobKey in recommandJson.Keys)
|
| | | {
|
| | | items.Add(array[i]);
|
| | | findRecommandItems.Add(int.Parse(jobKey), JsonMapper.ToObject<int[]>(recommandJson[jobKey].ToJson()).ToList());
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | if (hostModel.IsReachCondition(info))
|
| | | int process;
|
| | | if (hostModel.IsReachCondition(info, out process))
|
| | | {
|
| | | return true;
|
| | | }
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | if (hostModel.IsReachCondition(info))
|
| | | int process;
|
| | | if (hostModel.IsReachCondition(info, out process))
|
| | | {
|
| | | return false;
|
| | | }
|
| | |
| | | return model;
|
| | | }
|
| | |
|
| | | // 此处加try的原因是 遇不报错的情况
|
| | | void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | #if UNITY_EDITOR
|
| | | try
|
| | | {
|
| | | #endif
|
| | | foreach (var model in models.Values)
|
| | | {
|
| | | var beforePlayerDataInitialize = model as IBeforePlayerDataInitialize;
|
| | |
| | | beforePlayerDataInitialize.OnBeforePlayerDataInitialize();
|
| | | }
|
| | | }
|
| | | #if UNITY_EDITOR
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | | Debug.LogError(e);
|
| | | }
|
| | | #endif
|
| | | }
|
| | |
|
| | | void OnAfterPlayerDataInitialize()
|
| | | {
|
| | | #if UNITY_EDITOR
|
| | | try
|
| | | {
|
| | | #endif
|
| | | foreach (var model in models.Values)
|
| | | {
|
| | | var afterPlayerDataInitialize = model as IAfterPlayerDataInitialize;
|
| | |
| | | afterPlayerDataInitialize.OnAfterPlayerDataInitialize();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | void OnPlayerLoginOk()
|
| | | #if UNITY_EDITOR
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | | Debug.LogError(e);
|
| | | }
|
| | | #endif
|
| | | }
|
| | |
|
| | | void OnPlayerLoginOk()
|
| | | {
|
| | | #if UNITY_EDITOR
|
| | | try
|
| | | { |
| | | #endif
|
| | | foreach (var model in models.Values)
|
| | | {
|
| | | var playerLoginOk = model as IPlayerLoginOk;
|
| | | if (playerLoginOk != null)
|
| | | {
|
| | | playerLoginOk.OnPlayerLoginOk();
|
| | | }
|
| | | if (playerLoginOk != null)
|
| | | {
|
| | | playerLoginOk.OnPlayerLoginOk();
|
| | | }
|
| | | }
|
| | | #if UNITY_EDITOR
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | | Debug.LogError(e);
|
| | | }
|
| | | #endif
|
| | | }
|
| | |
|
| | | void OnMapInitOk()
|
| | | {
|
| | | #if UNITY_EDITOR
|
| | | try
|
| | | {
|
| | | #endif
|
| | | foreach (var model in models.Values)
|
| | | {
|
| | | var mapInitOk = model as IMapInitOk;
|
| | |
| | | mapInitOk.OnMapInitOk();
|
| | | }
|
| | | }
|
| | | #if UNITY_EDITOR
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | | Debug.LogError(e);
|
| | | }
|
| | | #endif
|
| | | }
|
| | |
|
| | | void OnAccountSwitch()
|
| | | {
|
| | | #if UNITY_EDITOR
|
| | | try
|
| | | {
|
| | | #endif
|
| | | foreach (var model in models.Values)
|
| | | {
|
| | | var switchAccount = model as ISwitchAccount;
|
| | |
| | | switchAccount.OnSwitchAccount();
|
| | | }
|
| | | }
|
| | | #if UNITY_EDITOR
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | | Debug.LogError(e);
|
| | | }
|
| | | #endif
|
| | | }
|
| | |
|
| | | }
|