Merge branch 'master' into SubWindow
| | |
| | |
|
| | | if (_fightNpc != null)
|
| | | {
|
| | | if (_fightNpc.Group != E_ActorGroup.Enemy
|
| | | || _fightNpc.NpcConfig.Country == 1)
|
| | | if (_fightNpc.NpcConfig.NPCType != (int)E_NpcType.PersonalEnemy)
|
| | | {
|
| | | return false;
|
| | | if (_fightNpc.Group != E_ActorGroup.Enemy
|
| | | || _fightNpc.NpcConfig.Country == 1)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | if (_distSqrt > Mathf.Pow(GeneralDefine.CloseNpcDist + NpcConfig.ModelRadius + 0.4f, 2))
|
| | | {
|
| | | MapTransferUtility.Instance.MoveToNPC(NpcConfig.NPCID, (int)ServerInstID);
|
| | | // MapTransferUtility.Instance.MoveToNPC(NpcConfig.NPCID, (int)ServerInstID);
|
| | | _hero.MoveToPosition(Pos, 1);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | public class GA_NpcSummonFight : GActorNpcFight
|
| | | {
|
| | | private H0408_tagPlayerSummonNPCAppear m_H0408;
|
| | | private HeadUpName m_HeadUpName;
|
| | |
|
| | | // 用于触发点击的组件
|
| | | private NPCInteractProcessor m_NPCInteractProcessor;
|
| | |
|
| | | protected override void OnInit(GameNetPackBasic package)
|
| | | {
|
| | |
| | | AdjustPos(m_H0408.PosX, m_H0408.PosY);
|
| | |
|
| | | base.OnInit(package);
|
| | |
|
| | | // 可选择对象创建碰撞区
|
| | | if (CanBeSelected())
|
| | | {
|
| | | m_NPCInteractProcessor = Root.AddMissingComponent<NPCInteractProcessor>();
|
| | | m_NPCInteractProcessor.npcIntergactEvent -= OnClick;
|
| | | m_NPCInteractProcessor.npcIntergactEvent += OnClick;
|
| | | }
|
| | |
|
| | | GActor _parent = GAMgr.Instance.GetBySID(m_H0408.PlayerID);
|
| | | if (_parent != null)
|
| | |
| | |
|
| | | public sealed override bool CanAtked()
|
| | | {
|
| | | return false;
|
| | | return NpcConfig.NPCType == (int)E_NpcType.PersonalEnemy;
|
| | | }
|
| | |
|
| | | public sealed override bool CanAtkedRotate()
|
| | |
| | |
|
| | | public sealed override bool CanBeSelected()
|
| | | {
|
| | | return false;
|
| | | return NpcConfig.NPCType == (int)E_NpcType.PersonalEnemy;
|
| | | }
|
| | | public sealed override void OnSelect()
|
| | | {
|
| | | if (NpcConfig.NPCType == (int)E_NpcType.PersonalEnemy)
|
| | | {
|
| | | SelectionManager.Request(SelectionManager.E_Type.Red, this, NpcConfig.ModelRadius * 2);
|
| | | }
|
| | | }
|
| | | public sealed override void OnUnSelect()
|
| | | {
|
| | | if (NpcConfig.NPCType == (int)E_NpcType.PersonalEnemy)
|
| | | {
|
| | | SelectionManager.Release(SelectionManager.E_Type.Red);
|
| | | }
|
| | | }
|
| | | public sealed override void OnClick()
|
| | | {
|
| | | if (ActorInfo.serverDie
|
| | | || BossShowModel.Instance.BossShowing
|
| | | || StatusMgr.Instance.IsInvisible(ServerInstID))
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | GA_Hero _hero = PlayerDatas.Instance.hero;
|
| | |
|
| | | // 当前锁定的目标已经是此对象
|
| | | if (_hero.LockTarget == this && CanAtked())
|
| | | {
|
| | | // 开启攻击至死AI
|
| | | _hero.Behaviour.StartKillUntilDieAI();
|
| | | }
|
| | | else
|
| | | {
|
| | | // 设置锁定目标为此对象
|
| | | _hero.LockTarget = this;
|
| | | _hero.SelectTarget = this;
|
| | | GA_Hero.CallLockTargetChanged(ServerInstID);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | private static Dictionary<int, UIEffect> dropEffectDict = new Dictionary<int, UIEffect>();
|
| | |
|
| | | static PackModel _playerPack;
|
| | | static PackModel playerPack {
|
| | | static PackModel playerPack
|
| | | {
|
| | | get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PackModel>()); }
|
| | | }
|
| | |
|
| | |
| | | #endif
|
| | | }
|
| | |
|
| | | if (m_CacheTipErrorDict.ContainsKey(dropId))
|
| | | {
|
| | | m_CacheTipErrorDict.Remove(dropId);
|
| | | }
|
| | |
|
| | | ReleaseClientID(dropId);
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | Release(m_MapItemIdList[i]);
|
| | | }
|
| | | m_CacheTipErrorDict.Clear();
|
| | | }
|
| | |
|
| | | public static void CheckPickupItem(Vector3 checkPosition)
|
| | |
| | |
|
| | | }
|
| | |
|
| | | private static Dictionary<int, float> m_CacheTipErrorDict = new Dictionary<int, float>();
|
| | | private static void TipOthersItem(int id)
|
| | | {
|
| | | if (m_CacheTipErrorDict.ContainsKey(id))
|
| | | {
|
| | | if (Time.realtimeSinceStartup - m_CacheTipErrorDict[id] > 1)
|
| | | {
|
| | | m_CacheTipErrorDict[id] = Time.realtimeSinceStartup;
|
| | | }
|
| | | else
|
| | | {
|
| | | return;
|
| | | }
|
| | | }
|
| | |
|
| | | SysNotifyMgr.Instance.ShowTip("OpenHazyRegionError_5");
|
| | | }
|
| | |
|
| | | private static bool CheckCanPickUp(DropObject dropObject)
|
| | | {
|
| | | if (dropObject.ownerType == 1)
|
| | | {
|
| | | if (dropObject.ownerID != PlayerDatas.Instance.PlayerId)
|
| | | {
|
| | | TipOthersItem(dropObject.dropID);
|
| | | return false;
|
| | | }
|
| | | }
|
| | |
| | | TeamModel _teamModel = ModelCenter.Instance.GetModel<TeamModel>();
|
| | | if (_teamModel.myTeam.teamId != dropObject.ownerID)
|
| | | {
|
| | | TipOthersItem(dropObject.dropID);
|
| | | return false;
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | if (PlayerDatas.Instance.baseData.faction != dropObject.ownerID)
|
| | | {
|
| | | TipOthersItem(dropObject.dropID);
|
| | | return false;
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | if (!_result)
|
| | | {
|
| | | TipOthersItem(dropObject.dropID);
|
| | | return false;
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | if (dropObject.ownerID != PlayerDatas.Instance.baseData.FamilyId)
|
| | | {
|
| | | TipOthersItem(dropObject.dropID);
|
| | | return false;
|
| | | }
|
| | | }
|
| | |
| | | private List<MapTrasfer> m_ChkedList = new List<MapTrasfer>(); |
| | | private List<MapTrasfer> m_ChkedList1 = new List<MapTrasfer>(); |
| | | private int count = 0; |
| | | // 是否已经找到了一个可以移动到目标的点 |
| | | // 因为可能存在多个, 这里加一个标识,可以在此路不通的时候另寻他路 |
| | | private bool hasFindWalkable = false; |
| | | private Vector3 m_DestPos; |
| | | public Vector3 GetTransPoint(Vector3 start, Vector3 next) |
| | | { |
| | | count = 0; |
| | | hasFindWalkable = false; |
| | | m_DestPos = next; |
| | | m_ChkedList.Clear(); |
| | | |
| | | return GetNext(start, next); |
| | |
| | | var _tp = _t.transferPoints[i]; |
| | | if (PathFinder.WalkAble(next, _tp.position)) |
| | | { |
| | | //Debug.Log("_tp.position : " + _tp.position); |
| | | if (i == 0) |
| | | { |
| | | _targetPos = _t.transferPoints[_t.transferPoints.Length - 1].position; |
| | |
| | | } |
| | | if (_targetPos != Vector3.zero) |
| | | { |
| | | hasFindWalkable = true; |
| | | break; |
| | | } |
| | | } |
| | |
| | | } |
| | | else |
| | | { |
| | | _targetPos = GetNext(start, _targetPos); |
| | | if (hasFindWalkable) |
| | | { |
| | | hasFindWalkable = false; |
| | | _targetPos = GetNext(start, m_DestPos); |
| | | } |
| | | else |
| | | { |
| | | _targetPos = GetNext(start, _targetPos); |
| | | } |
| | | } |
| | | //Debug.Log("_targetPos: " + _targetPos); |
| | | |
| | |
| | |
|
| | | private void AlchemyStateRefresh()
|
| | | {
|
| | | DisplayAlchmey();
|
| | |
|
| | | var lastGrasp = !m_AlchemyStudy.gameObject.activeSelf;
|
| | |
|
| | | if (model.isServerPrepare && !lastGrasp && model.IsGraspRecipe(model.selectAlchemy))
|
| | | {
|
| | | m_StudySuccEffect.Play();
|
| | | }
|
| | |
|
| | | DisplayAlchmey();
|
| | |
|
| | | }
|
| | |
|
| | | void DisplayAlchmey()
|
| | |
| | | }
|
| | |
|
| | | EquipGemModel equipGemModel { get { return ModelCenter.Instance.GetModel<EquipGemModel>(); } }
|
| | | EquipStrengthModel equipStrengthModel { get { return ModelCenter.Instance.GetModel<EquipStrengthModel>(); } }
|
| | | EquipStarModel equipStarModel { get { return ModelCenter.Instance.GetModel<EquipStarModel>(); } }
|
| | | EquipTrainModel equipTrainModel { get { return ModelCenter.Instance.GetModel<EquipTrainModel>(); } }
|
| | | EquipModel equipModel { get { return ModelCenter.Instance.GetModel<EquipModel>(); } }
|
| | | PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
|
| | |
|
| | | public Dictionary<ChatInfoType, List<string>> achievementRandoms = new Dictionary<ChatInfoType, List<string>>();
|
| | |
|
| | |
| | | data.richText.Append(content.Substring(index, matchArray[i].Index - index));
|
| | | index = matchArray[i].Index + matchArray[i].Length;
|
| | | string detail = matchArray[i].Groups[1].Value;
|
| | | var chatSendItem = LitJson.JsonMapper.ToObject<ChatSendItem>(detail);
|
| | | if (chatSendItem.itemId != 0)
|
| | | var itemplus = LitJson.JsonMapper.ToObject<ItemTipUtility.CustomItemPlus>(detail);
|
| | | if (itemplus.ItemID != 0)
|
| | | {
|
| | | ItemConfig itemConfig = ItemConfig.Get(chatSendItem.itemId);
|
| | | ItemConfig itemConfig = ItemConfig.Get(itemplus.ItemID);
|
| | | if (itemConfig != null)
|
| | | {
|
| | | try
|
| | | {
|
| | | string append = string.Format("<a><Word info=item id={0} chatsenditem={1} chatsend=1/>|showitem={0} chatsenditem={1}</a>",
|
| | | chatSendItem.itemId, detail);
|
| | | string append = string.Format("<a><Word info=item id={0} itemplus={1} chatsend=1/>|showitem={0} itemplus={1}</a>",
|
| | | itemplus.ItemID, detail);
|
| | | append = UIHelper.AppendColor(itemConfig.ItemColor, append);
|
| | | data.richText.Append(append);
|
| | | }
|
| | |
| | | var _length = _textBuilder.Length;
|
| | | if (i < itemPlaceList.Count)
|
| | | {
|
| | | ItemConfig cfg = ItemConfig.Get((int)itemPlaceList[i].itemId);
|
| | | if (cfg.ItemName == matchArray[i].Groups[1].Value)
|
| | | var itemConfig = ItemConfig.Get((int)itemPlaceList[i].itemId);
|
| | | if (itemConfig.ItemName == matchArray[i].Groups[1].Value)
|
| | | {
|
| | | bool equip = itemPlaceList[i].packType == PackType.Equip;
|
| | | int[] equipGems = null;
|
| | | var strengthLevel = 0;
|
| | | var evolveLevel = 0;
|
| | | var starLevel = 0;
|
| | | ItemTipUtility.CustomEquipWash equipWash = new ItemTipUtility.CustomEquipWash();
|
| | | List<int[]> equips = new List<int[]>();
|
| | |
|
| | | if (equip)
|
| | | {
|
| | | var position = new Int2(itemConfig.LV, itemConfig.EquipPlace);
|
| | | equipGemModel.TryGetEquipGems(itemPlaceList[i].gridIndex, out equipGems);
|
| | | strengthLevel = equipStrengthModel.GetStrengthLevel(itemConfig.LV, itemConfig.EquipPlace);
|
| | | starLevel = equipStarModel.GetEquipStarLevel(new Int2(itemConfig.LV, itemConfig.EquipPlace));
|
| | | evolveLevel = equipStrengthModel.GetStrengthEvolveLevel(position.x, position.y);
|
| | |
|
| | | equipWash.LV = equipTrainModel.GetTrainLevel(position);
|
| | | var property = equipTrainModel.GetTrainedProperties(position);
|
| | | equipWash.Value = new int[3] { property.x, property.y, property.z };
|
| | |
|
| | | for (int place = 1; place <= 12; place++)
|
| | | {
|
| | | var equipGuid = equipModel.GetEquip(new Int2(position.x, place));
|
| | | if (!string.IsNullOrEmpty(equipGuid))
|
| | | {
|
| | | var equipItem = packModel.GetItemByGuid(equipGuid);
|
| | | int[] array = new int[2];
|
| | | array[0] = equipItem.itemId;
|
| | | array[1] = equipStarModel.GetEquipStarLevel(new Int2(position.x, place));
|
| | | equips.Add(array);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | _textBuilder.Append("#item#");
|
| | | var chatSendItem = new ChatSendItem()
|
| | | var itemplus = new ItemTipUtility.CustomItemPlus()
|
| | | {
|
| | | itemId = (int)itemPlaceList[i].itemId,
|
| | | ItemID = (int)itemPlaceList[i].itemId,
|
| | | count = (int)itemPlaceList[i].count,
|
| | | equipGems = equipGems,
|
| | | useData = itemPlaceList[i].itemInfo.userData,
|
| | | Stone = equipGems,
|
| | | UserData = itemPlaceList[i].itemInfo.userData,
|
| | | PlusLV = strengthLevel,
|
| | | EvolveLV = evolveLevel,
|
| | | Star = starLevel,
|
| | | Wash = equipWash,
|
| | | Equips = equips.Count > 0 ? equips.ToArray() : null,
|
| | | };
|
| | | _textBuilder.Append(LitJson.JsonMapper.ToJson(chatSendItem));
|
| | | _textBuilder.Append(LitJson.JsonMapper.ToJson(itemplus));
|
| | | _textBuilder.Append("#item#");
|
| | | if (_recently != null)
|
| | | {
|
| | | _recently.Add(cfg.ItemName, _textBuilder.ToString().Substring(_length));
|
| | | _recently.Add(itemConfig.ItemName, _textBuilder.ToString().Substring(_length));
|
| | | }
|
| | | }
|
| | | else
|
| | |
| | | return RedPointState.None;
|
| | | }
|
| | | #endregion
|
| | |
|
| | | public struct ChatSendItem
|
| | | {
|
| | | public int itemId;
|
| | | public int count;
|
| | | public int[] equipGems;
|
| | | public string useData;
|
| | | }
|
| | | }
|
| | | public struct ChatExtraData
|
| | | {
|
| | |
| | | } |
| | | if (_targetValue > 0)
|
| | | { |
| | | m_TargetNums[_index].text = StringUtility.Contact(collectCount, "/", _targetValue); |
| | | var label = UIHelper.AppendColor(collectCount >= _targetValue ?
|
| | | TextColType.LightYellow : TextColType.Green |
| | | , collectCount.ToString()); |
| | | m_TargetNums[_index].text = StringUtility.Contact(label, "/", _targetValue); |
| | | break; |
| | | } |
| | | m_TargetNums[_index].text = collectCount.ToString(); |
| | |
| | | var attackCount = model.GetDungeonNpcAttackCount(npcId); |
| | | if (_targetValue > 0)
|
| | | { |
| | | m_TargetNums[_index].text = StringUtility.Contact(attackCount, "/", _targetValue); |
| | | var label = UIHelper.AppendColor(attackCount >= _targetValue ?
|
| | | TextColType.LightYellow : TextColType.Green |
| | | , attackCount.ToString()); |
| | | m_TargetNums[_index].text = StringUtility.Contact(label, "/", _targetValue); |
| | | break; |
| | | } |
| | | m_TargetNums[_index].text = attackCount.ToString(); |
| | |
| | | return true;
|
| | | }
|
| | |
|
| | | public bool IsGemHoleOpen(int hole, int starLevel)
|
| | | {
|
| | | GemHoleCondition condition;
|
| | | if (TryGetGemHoleCondition(hole, out condition))
|
| | | {
|
| | | if (starLevel < condition.equipStar)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | }
|
| | | return true;
|
| | | }
|
| | |
|
| | | public bool IsEquipGemHoleOpen(int packIndex, int hole)
|
| | | {
|
| | | var config = EquipPlaceMapConfig.Get(packIndex);
|
| | |
| | | {
|
| | | return false;
|
| | | }
|
| | | if (IsEquipGemMaxLevel(equipGem))
|
| | | {
|
| | | return false;
|
| | | }
|
| | | var config = ItemConfig.Get(equipGem);
|
| | | var type = config.EffectValueA1;
|
| | | var emptyHoleCount = GetSameTypeEmptyUnlockHole(cacheEquipSets, type);
|
| | |
| | | return lv;
|
| | | } |
| | | |
| | | public int GetStrengthEvolveLevel(int level, int equipPlace)
|
| | | {
|
| | | int lv = 0;
|
| | | int equipIndex = EquipPlaceMapConfig.GetServerPlace(level, equipPlace);
|
| | | if (EquipStrengthDic.ContainsKey(equipIndex))
|
| | | {
|
| | | lv = EquipStrengthDic[equipIndex].EvolveLV;
|
| | | }
|
| | | return lv;
|
| | | } |
| | | |
| | | public int GetEquipStrengthState(Int2 position)
|
| | | {
|
| | | var equipGuid = equipModel.GetEquip(position);
|
| | |
| | | Dictionary<int, EquipSetStar> equipStars = new Dictionary<int, EquipSetStar>(); |
| | | |
| | | |
| | | Redpoint redpoint = new Redpoint(1720000); |
| | | Redpoint redpoint = new Redpoint(106, 1720000); |
| | | bool redpointDirty = false; |
| | | LogicUpdate logicUpdate = new LogicUpdate(1); |
| | | |
| | |
| | | var upgradable = IsEquipPlaceUpgradable(equipGuid); |
| | | if (upgradable) |
| | | { |
| | | for (var i = 1; i <= 5; i++) |
| | | var currentStarLevel = GetEquipStarLevel(equipPosition); |
| | | var config = EquipStarConfig.Get(equipPosition.x, equipPosition.y, currentStarLevel); |
| | | if (config.CostEquipCnt == 0) |
| | | { |
| | | var itemGuid = GetMaterialLogicStringByIndex(i).value; |
| | | probability += GetMaterialSuccessRate(equipPosition, itemGuid); |
| | | if (config.CostItemDict.x > 0) |
| | | { |
| | | specialMaterial.value = Mathf.RoundToInt(packModel.GetItemCountByID(PackType.Item, config.CostItemDict.x) >= config.CostItemDict.y ? 1f : 0f * 100); |
| | | } |
| | | else |
| | | { |
| | | specialMaterial.value = 0; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | for (var i = 1; i <= 5; i++) |
| | | { |
| | | var itemGuid = GetMaterialLogicStringByIndex(i).value; |
| | | probability += GetMaterialSuccessRate(equipPosition, itemGuid); |
| | | } |
| | | |
| | | starUpgradeProbability.value = Mathf.RoundToInt(probability * 100); |
| | | starUpgradeProbability.value = Mathf.RoundToInt(probability * 100); |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | static Dictionary<int, int> trainTypes = new Dictionary<int, int>(); |
| | | Dictionary<int, EquipTrainSet> equipTrains = new Dictionary<int, EquipTrainSet>(); |
| | | |
| | | Redpoint redpoint = new Redpoint(910000); |
| | | Redpoint redpoint = new Redpoint(106,910000); |
| | | bool redpointDirty = false; |
| | | LogicUpdate logicUpdate = new LogicUpdate(1); |
| | | |
| | |
| | | InitializeNpc();
|
| | |
|
| | | initedFightNpc = true;
|
| | |
|
| | | model.dugeonTargetStateRefresh -= DugeonTargetStateRefresh;
|
| | | model.dugeonTargetStateRefresh += DugeonTargetStateRefresh;
|
| | | }
|
| | |
|
| | | protected override void OnUpdate()
|
| | |
| | | UnloadAllNpc();
|
| | |
|
| | | ClientCollectUtility.OnCollectFinished -= OnCollectFinished;
|
| | | model.dugeonTargetStateRefresh -= DugeonTargetStateRefresh;
|
| | | }
|
| | |
|
| | | private void DugeonTargetStateRefresh()
|
| | | {
|
| | | if (model.IsDungeonTargetDone)
|
| | | {
|
| | | if (!NewBieCenter.Instance.IsGuideCompleted(51))
|
| | | {
|
| | | NewBieCenter.Instance.StartNewBieGuide(51);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | int GetNpcRefreshCount(HazyGrassNpcInfo npcInfo)
|
| | |
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | |
|
| | | if (IsInDungeon)
|
| | | {
|
| | | var config = HazyRegionConfig.Get(hazyRegionModel.processingIncidentId);
|
| | | ClientDungeonStageUtility.RequestStartClientDungeon(config.dungeonId, config.lineId);
|
| | | }
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | |
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | if (IsInDungeon)
|
| | | {
|
| | | var config = HazyRegionConfig.Get(hazyRegionModel.processingIncidentId);
|
| | | ClientDungeonStageUtility.RequestStartClientDungeon(config.dungeonId, config.lineId);
|
| | | }
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | | m_MapNpcCount.Clear();
|
| | | for (int i = 0; i < package.NPCInfoCnt; i++)
|
| | | {
|
| | | var data = package.NPCInfoList[i];
|
| | |
| | | public Dictionary<int, int> gems;
|
| | | } |
| | | |
| | | public struct CustomItemPlus
|
| | | {
|
| | | public int ItemID;
|
| | | public int count;
|
| | | public int Star;
|
| | | public int PlusLV;
|
| | | public int EvolveLV;
|
| | | public string UserData;
|
| | | public int[] Stone;
|
| | | public CustomEquipWash Wash;
|
| | | public int[][] Equips;
|
| | | } |
| | | |
| | | public struct CustomEquipWash
|
| | | {
|
| | | public int LV;
|
| | | public int[] Value;
|
| | | } |
| | | |
| | | static PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } } |
| | | static EquipModel equipModel { get { return ModelCenter.Instance.GetModel<EquipModel>(); } } |
| | | static EquipStarModel starModel { get { return ModelCenter.Instance.GetModel<EquipStarModel>(); } } |
| | |
| | | { |
| | | secondaryData = null; |
| | | |
| | | var config = ItemConfig.Get(itemId); |
| | | #if UNITY_EDITOR |
| | | Debug.LogFormat("你查看的物品是:itemId->{0}", itemId); |
| | | Debug.LogFormat("你查看的物品是:name->{0}", config.ItemName); |
| | | #endif |
| | | var config = ItemConfig.Get(itemId);
|
| | | PrintItemBrief(itemId);
|
| | |
|
| | | var tipType = GetTipType(itemId); |
| | | switch (tipType)
|
| | | {
|
| | |
| | | if (item == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | #if UNITY_EDITOR |
| | | Debug.LogFormat("你查看的物品是:guid->{0}", string.IsNullOrEmpty(guid) ? "" : guid); |
| | | Debug.LogFormat("你查看的物品是:itemId->{0}", item.itemId); |
| | | Debug.LogFormat("你查看的物品是:name->{0}", item.config.ItemName); |
| | | #endif |
| | | |
| | | }
|
| | |
|
| | | PrintItemBrief(item.itemId, guid);
|
| | |
|
| | | secondaryData = null;
|
| | | var tipType = GetTipType(item.itemId);
|
| | | switch (tipType)
|
| | |
| | | star = info.starLevel,
|
| | | strengthenLevel = info.strengthenLevel,
|
| | | score = info.score,
|
| | | isEquiped=true,
|
| | | isEquiped = true,
|
| | | };
|
| | |
|
| | | var baseProperty = GetBaseProperty(info.itemId);
|
| | |
| | |
|
| | | } |
| | | |
| | | [System.Diagnostics.Conditional("UNITY_EDITOR")] |
| | | private static void PrintItemBrief(int itemId)
|
| | | {
|
| | | var config = ItemConfig.Get(itemId);
|
| | | Debug.LogFormat("你查看的物品是:itemId->{0}", itemId); |
| | | Debug.LogFormat("你查看的物品是:name->{0}", config.ItemName); |
| | | }
|
| | |
|
| | | [System.Diagnostics.Conditional("UNITY_EDITOR")] |
| | | private static void PrintItemBrief(int itemId, string guid)
|
| | | {
|
| | | var config = ItemConfig.Get(itemId);
|
| | | Debug.LogFormat("你查看的物品是:guid->{0}", string.IsNullOrEmpty(guid) ? "" : guid); |
| | | Debug.LogFormat("你查看的物品是:itemId->{0}", itemId); |
| | | Debug.LogFormat("你查看的物品是:name->{0}", config.ItemName); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | }
|
| | |
|
| | | public static Regex EquipRegex = new Regex(@"\[([\u4e00-\u9fa5a-zA-Z0-9\|'_\(\)()\. ::]+?)\]", RegexOptions.Singleline);
|
| | | public static Regex EquipDetailRegex = new Regex("#item#([\u4e00-\u9fa5a-zA-Z0-9\\|'_\\(\\)()\\. ::\\,\\[\\]a-zA-Z\"\\{\\}]+?)#item#", RegexOptions.Singleline);
|
| | | public static Regex EquipDetailRegex = new Regex("#item#([\u4e00-\u9fa5a-zA-Z0-9\\|'_\\(\\)()\\. ::\\,\\[\\]a-zA-Z\"\\{\\}-]+?)#item#", RegexOptions.Singleline);
|
| | |
|
| | | public bool ExcuteHrefEvent(string msg, int index = 0)
|
| | | {
|
| | |
| | | if (cfg != null)
|
| | | {
|
| | | var _itemColor = cfg.ItemColor;
|
| | | if (cfg.Type == 113)//翅膀
|
| | | if (ItemLogicUtility.Instance.IsWing(id))//翅膀
|
| | | {
|
| | | Dictionary<int, List<int>> userdatadic = null;
|
| | | if (_dict.ContainsKey("userdata"))
|
| | | if (_dict.ContainsKey("itemplus"))
|
| | | {
|
| | | string userdata = _dict["userdata"];
|
| | | userdatadic = ConfigParse.Analysis(userdata);
|
| | | var itemplus = LitJson.JsonMapper.ToObject<ItemTipUtility.CustomItemPlus>(_dict["itemplus"]);
|
| | | var userdatadic = ConfigParse.Analysis(itemplus.UserData);
|
| | | _itemColor = ItemLogicUtility.Instance.GetItemQuality(cfg.ID, userdatadic);
|
| | | }
|
| | | }
|
| | |
| | | return string.Empty;
|
| | | }
|
| | |
|
| | |
|
| | | EquipGemModel equipGemModel { get { return ModelCenter.Instance.GetModel<EquipGemModel>(); } }
|
| | | private void OnSingleClickItemCell(int itemId, RichTextMgr.HrefInfo hrefInfo)
|
| | | {
|
| | | int[] stone = null;
|
| | | if (hrefInfo.mSplits.ContainsKey("stone"))
|
| | | ItemTipUtility.CustomItemPlus itemplus = default(ItemTipUtility.CustomItemPlus);
|
| | | if (hrefInfo.mSplits.ContainsKey("itemplus"))
|
| | | {
|
| | | try
|
| | | {
|
| | | stone = LitJson.JsonMapper.ToObject<int[]>(hrefInfo.mSplits["stone"]);
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | | DebugEx.Log(e.Message);
|
| | | }
|
| | | }
|
| | | int itemCount = 0;
|
| | | if (hrefInfo.mSplits.ContainsKey("itemcnt"))
|
| | | {
|
| | | itemCount = int.Parse(hrefInfo.mSplits["itemcnt"]);
|
| | | }
|
| | | int isBind = 0;
|
| | | if (hrefInfo.mSplits.ContainsKey("isbind"))
|
| | | {
|
| | | isBind = int.Parse(hrefInfo.mSplits["isbind"]);
|
| | | }
|
| | | int strengthenLv = 0;
|
| | | if (hrefInfo.mSplits.ContainsKey("strengthenlv"))
|
| | | {
|
| | | strengthenLv = int.Parse(hrefInfo.mSplits["strengthenlv"]);
|
| | | }
|
| | | int index = 0;
|
| | | if (hrefInfo.mSplits.ContainsKey("place"))
|
| | | {
|
| | | index = int.Parse(hrefInfo.mSplits["place"]);
|
| | | itemplus = LitJson.JsonMapper.ToObject<ItemTipUtility.CustomItemPlus>(hrefInfo.mSplits["itemplus"]);
|
| | | }
|
| | |
|
| | | if (hrefInfo.mSplits.ContainsKey("equippartsuite")
|
| | | && hrefInfo.mSplits["equippartsuite"] != string.Empty)
|
| | | if (ItemLogicUtility.Instance.IsEquip(itemId))
|
| | | {
|
| | | LitJson.JsonData _json = null;
|
| | | try
|
| | | var itemConfig = ItemConfig.Get(itemId);
|
| | | Dictionary<int, int> gems = new Dictionary<int, int>();
|
| | | Dictionary<int, bool> gemHoleActiveStates = new Dictionary<int, bool>();
|
| | | if (itemplus.Stone != null)
|
| | | {
|
| | | _json = LitJson.JsonMapper.ToObject(hrefInfo.mSplits["equippartsuite"]);
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | | DebugEx.Log(e.Message);
|
| | | }
|
| | | }
|
| | |
|
| | | equipItems = null;
|
| | | if (hrefInfo.mSplits.ContainsKey("equipitems")
|
| | | && hrefInfo.mSplits["equipitems"] != string.Empty)
|
| | | {
|
| | | try
|
| | | {
|
| | | equipItems = LitJson.JsonMapper.ToObject<int[][]>(hrefInfo.mSplits["equipitems"]);
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | | DebugEx.Log(e.Message);
|
| | | }
|
| | | }
|
| | |
|
| | | RoleParticularModel.EquipWash _equipWash = default(RoleParticularModel.EquipWash);
|
| | | if (hrefInfo.mSplits.ContainsKey("equipwash")
|
| | | && hrefInfo.mSplits["equipwash"] != string.Empty)
|
| | | {
|
| | | try
|
| | | {
|
| | | _equipWash = LitJson.JsonMapper.ToObject<RoleParticularModel.EquipWash>(hrefInfo.mSplits["equipwash"]);
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | | DebugEx.Log(e.Message);
|
| | | }
|
| | | }
|
| | |
|
| | | Dictionary<int, List<int>> userdatadic = null;
|
| | | if (hrefInfo.mSplits.ContainsKey("userdata"))
|
| | | {
|
| | | string userdata = hrefInfo.mSplits["userdata"];
|
| | | userdatadic = ConfigParse.Analysis(userdata);
|
| | | }
|
| | | Dictionary<int, int> suitLvDict = null;
|
| | | if (hrefInfo.mSplits.ContainsKey("suitlv"))
|
| | | {
|
| | | suitLvDict = new Dictionary<int, int>();
|
| | | string suitLvData = hrefInfo.mSplits["suitlv"];
|
| | | string[] split_data = suitLvData.Split('\'');
|
| | | for (int i = 0; i < split_data.Length; i++)
|
| | | {
|
| | | string[] split_value = split_data[i].Split('_');
|
| | | if (split_value.Length == 2)
|
| | | for (int i = 0; i < itemplus.Stone.Length; i++)
|
| | | {
|
| | | int key = int.Parse(split_value[0]);
|
| | | suitLvDict.Add(key, int.Parse(split_value[1]));
|
| | | gems.Add(i, itemplus.Stone[i]);
|
| | | if (i == 3)
|
| | | {
|
| | | gemHoleActiveStates.Add(i, itemplus.Stone[i] != 0);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (hrefInfo.mSplits.ContainsKey("chatsenditem"))
|
| | | {
|
| | | var chatSendItem = LitJson.JsonMapper.ToObject<ChatCtrl.ChatSendItem>(hrefInfo.mSplits["chatsenditem"]);
|
| | | itemId = chatSendItem.itemId;
|
| | | itemCount = chatSendItem.count;
|
| | | stone = chatSendItem.equipGems;
|
| | | if (!string.IsNullOrEmpty(chatSendItem.useData))
|
| | | for (int i = 0; i < EquipGemModel.EQUIPGEM_HOLE_COUNT; i++)
|
| | | {
|
| | | userdatadic = ConfigParse.Analysis(chatSendItem.useData);
|
| | | if (i < 3)
|
| | | {
|
| | | gemHoleActiveStates.Add(i, equipGemModel.IsGemHoleOpen(i, itemplus.Star));
|
| | | }
|
| | | }
|
| | |
|
| | | var legendProperties = new List<Int2>();
|
| | | Dictionary<int, List<int>> useDataDict = null;
|
| | | if (!string.IsNullOrEmpty(itemplus.UserData))
|
| | | {
|
| | | useDataDict = ConfigParse.Analysis(itemplus.UserData);
|
| | | if (useDataDict != null)
|
| | | {
|
| | | foreach (var key in useDataDict.Keys)
|
| | | {
|
| | | var list = useDataDict[key];
|
| | | foreach (var value in list)
|
| | | {
|
| | | legendProperties.Add(new Int2(key, value)); |
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | List<Int2> trainProperties = new List<Int2>();
|
| | | if (!itemplus.Wash.Equals(default(ItemTipUtility.CustomEquipWash)))
|
| | | {
|
| | | var washType = EquipTrainModel.GetTrainType(itemConfig.EquipPlace);
|
| | | var trainConfig = EquipWashConfig.Get(washType, 1);
|
| | | for (int i = 0; i < itemplus.Wash.Value.Length; i++)
|
| | | {
|
| | | var propertyType = i == 0 ? trainConfig.config.attType1 : i == 1 ?
|
| | | trainConfig.config.attType2 : trainConfig.config.attType3;
|
| | | trainProperties.Add(new Int2(propertyType, itemplus.Wash.Value[i]));
|
| | | }
|
| | | }
|
| | |
|
| | | Dictionary<EquipSuitType, int> suitLevels = new Dictionary<EquipSuitType, int>();
|
| | | suitLevels.Add(EquipSuitType.TwoSuit, -1);
|
| | | suitLevels.Add(EquipSuitType.FiveSuit, -1);
|
| | | suitLevels.Add(EquipSuitType.EightSuit, -1);
|
| | |
|
| | | List<int> suitplaces = new List<int>();
|
| | |
|
| | | if (itemplus.Equips != null)
|
| | | {
|
| | | var stars = new List<int>();
|
| | | for (int i = 0; i < itemplus.Equips.Length; i++)
|
| | | {
|
| | | var array = itemplus.Equips[i];
|
| | | var config = ItemConfig.Get(array[0]);
|
| | | if (config.EquipPlace > 8)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | stars.Add(array[1]);
|
| | |
|
| | | if (config.SuiteiD > 0)
|
| | | {
|
| | | suitplaces.Add(config.EquipPlace);
|
| | | }
|
| | | }
|
| | |
|
| | | stars.Sort((int x, int y) => { return x.CompareTo(y); });
|
| | |
|
| | | var twoSuitLevel = stars.Count > 1 ? stars[1] : -1;
|
| | | var fiveSuitLevel = stars.Count > 4 ? stars[4] : -1;
|
| | | var eightSuitLevel = stars.Count > 7 ? stars[7] : -1;
|
| | |
|
| | | suitLevels[EquipSuitType.TwoSuit] = twoSuitLevel;
|
| | | suitLevels[EquipSuitType.FiveSuit] = fiveSuitLevel;
|
| | | suitLevels[EquipSuitType.EightSuit] = eightSuitLevel;
|
| | | }
|
| | |
|
| | | ItemTipUtility.ShowCustomEquip(new ItemTipUtility.CustomEquipInfo()
|
| | | {
|
| | | itemId = itemId,
|
| | | job = itemConfig.JobLimit,
|
| | | strengthenLevel = itemplus.PlusLV,
|
| | | starLevel = itemplus.Star,
|
| | | gems = gems,
|
| | | legendProperties = legendProperties,
|
| | | score = ItemLogicUtility.Instance.GetEquipScore(PackType.Item, itemId, useDataDict, true),
|
| | | gemHoleActiveStates = gemHoleActiveStates,
|
| | | suitLevels = suitLevels,
|
| | | suitPlaces = suitplaces,
|
| | | trainProperties = trainProperties,
|
| | | });
|
| | | }
|
| | |
|
| | | // ItemAttrData attrData = new ItemAttrData(itemId, true, (ulong)itemCount, -1, false, PackType.Deleted,
|
| | | // "", userdatadic);
|
| | | // attrData.SetGemModel(stone);
|
| | | // attrData.SetStrengthData(strengthenLv, GetStrengthenType(itemId));
|
| | | // itemTipsModel.SetItemTipsModel(attrData);
|
| | |
|
| | | ItemTipUtility.Show(itemId);
|
| | | else
|
| | | {
|
| | | ItemTipUtility.Show(itemId);
|
| | | }
|
| | | }
|
| | |
|
| | | List<RoleParticularModel.EquipSuit> equipSuitList = new List<RoleParticularModel.EquipSuit>();
|
| | |
| | | default:
|
| | | return Language.Get("EquipSuitWhite");
|
| | | }
|
| | | }
|
| | |
|
| | | public static int GetStrengthenType(int _id)
|
| | | {
|
| | | var _type = 1;
|
| | | return _type;
|
| | | }
|
| | |
|
| | | private static string GetTextColorByItemColor(string info, int _itemColor, Dictionary<string, string> dic)
|
| | |
| | | for (int i = 0; i < m_SkillExperts.Length; i++)
|
| | | {
|
| | | var potential = skill.potentials[i];
|
| | | m_SkillExperts[i].Display(potential.id, OnSelect);
|
| | | m_SkillExperts[i].Display(potential.id, skill.level >= potential.limitLevel, OnSelect);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | if (selectExpert != 0)
|
| | | {
|
| | | TreasureSkill skill;
|
| | | model.TryGetSkill(selectSkillId, out skill);
|
| | |
|
| | | var level = 0;
|
| | | TreasurePotential expert;
|
| | | if (model.TryGetPotential(selectExpert, out expert))
|
| | | {
|
| | | level = expert.level;
|
| | | }
|
| | |
|
| | | m_Select.gameObject.SetActive(skill.level >= expert.limitLevel);
|
| | |
|
| | | SkillConfig skillConfig;
|
| | | if (level == 0)
|
| | |
| | | [Serializable]
|
| | | public class SkillExpertWidget
|
| | | {
|
| | | [SerializeField] Image m_Icon;
|
| | | [SerializeField] ImageEx m_Bottom;
|
| | | [SerializeField] ImageEx m_Icon;
|
| | | [SerializeField] Text m_SkillName;
|
| | | [SerializeField] ImageEx m_ReikiBottom;
|
| | | [SerializeField] Text m_Reiki;
|
| | | [SerializeField] Transform m_ContainerSelect;
|
| | | [SerializeField] Text m_Use;
|
| | | [SerializeField] Text m_Limit;
|
| | | [SerializeField] Button m_Select;
|
| | |
|
| | | public int skillId { get; private set; }
|
| | |
|
| | | TreasureSkillModel model { get { return ModelCenter.Instance.GetModel<TreasureSkillModel>(); } }
|
| | |
|
| | | public void Display(int skillId, Action<int> func)
|
| | | public void Display(int skillId, bool unlock, Action<int> func)
|
| | | {
|
| | | this.skillId = skillId;
|
| | |
|
| | |
| | | var property = skillConfig.RequireProperty();
|
| | | var propertyConfig = PlayerPropertyConfig.Get(property);
|
| | | m_Reiki.text = propertyConfig.Name;
|
| | | m_Reiki.color = UIHelper.GetPropertyColor(property);
|
| | | m_Reiki.color = unlock ? UIHelper.GetPropertyColor(property) : UIHelper.s_Gray;
|
| | |
|
| | | var selectExpertSkill = 0;
|
| | | model.TryGetExpertSkill(ExpertSkillSelectWin.selectSkillId, out selectExpertSkill);
|
| | | m_Use.gameObject.SetActive(selectExpertSkill == skillId);
|
| | |
|
| | | TreasurePotential expert;
|
| | | model.TryGetPotential(skillId, out expert);
|
| | |
|
| | | m_Limit.text = string.Format("{0}级可使用", expert.limitLevel);
|
| | |
|
| | | m_Limit.gameObject.SetActive(!unlock);
|
| | | m_Bottom.gray = !unlock;
|
| | | m_Icon.gray = !unlock;
|
| | | m_ReikiBottom.gray = !unlock;
|
| | |
|
| | | m_Select.SetListener(() =>
|
| | | {
|
| | | if (func != null)
|
| | |
| | | treasureSkills.Add(config.limitSkillId, treasureSkill);
|
| | | index++;
|
| | | }
|
| | | treasureSkill.potentials.Add(new TreasurePotential(config.id, 0, treasureSkill.redpoint.id));
|
| | | treasureSkill.potentials.Add(new TreasurePotential(config.id, 0, config.limitLevel, treasureSkill.redpoint.id));
|
| | | var skillConfig = SkillConfig.Get(config.limitSkillId);
|
| | |
|
| | | List<int> skills;
|
| | |
| | | return false;
|
| | | }
|
| | |
|
| | | public bool ExistAnyUnlockPotential(int skillId)
|
| | | {
|
| | | TreasureSkill treasureSkill;
|
| | | if (TryGetSkill(skillId, out treasureSkill))
|
| | | {
|
| | | for (int i = 0; i < treasureSkill.potentials.Count; i++)
|
| | | {
|
| | | if (treasureSkill.level >= treasureSkill.potentials[i].limitLevel)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public void SetAlreadyRemind()
|
| | | {
|
| | | requireRemind = false;
|
| | |
| | | }
|
| | |
|
| | | var expertSkill = 0;
|
| | | if (skill.level > 0 && !TryGetExpertSkill(skill.skillId, out expertSkill))
|
| | | if (funcOpen && skill.level > 0
|
| | | && !TryGetExpertSkill(skill.skillId, out expertSkill)
|
| | | && ExistAnyUnlockPotential(skill.skillId))
|
| | | {
|
| | | skill.expertRedpoint.state = RedPointState.Simple;
|
| | | }
|
| | |
| | | {
|
| | | public readonly int id;
|
| | | public readonly int maxLevel;
|
| | | public readonly int limitLevel;
|
| | | public int level { get; private set; }
|
| | |
|
| | | public TreasurePotential(int id, int level, int redpointBase)
|
| | | public TreasurePotential(int id, int level,int limitLevel, int redpointBase)
|
| | | {
|
| | | this.id = id;
|
| | | this.level = level;
|
| | | this.limitLevel = limitLevel;
|
| | |
|
| | | var config = SkillConfig.Get(id);
|
| | | maxLevel = config.SkillMaxLV;
|
| | |
| | |
|
| | | PlayerDatas.Instance.baseData.mainServerMapIdRecord = PlayerDatas.Instance.baseData.MapID;
|
| | | PlayerDatas.Instance.baseData.MapID = (ushort)Client_DataMap;
|
| | |
|
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent -= PlayerLoginOk;
|
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += PlayerLoginOk;
|
| | | }
|
| | |
|
| | | private static void PlayerLoginOk()
|
| | | {
|
| | | var mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | if (mapId == Client_DataMap)
|
| | | {
|
| | | ClientDungeonStageUtility.RequestStartClientDungeon(0, 0);
|
| | | }
|
| | | }
|
| | |
|
| | | public static void RequestExit()
|
| | |
| | | PlayerDatas.Instance.extersion.pkState = 0;
|
| | | ModelCenter.Instance.GetModel<DungeonModel>().ResetBufData();
|
| | |
|
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent -= PlayerLoginOk;
|
| | | StageLoad.Instance.onStageLoadFinish -= OnStageLoadFinish;
|
| | | StageLoad.Instance.onStageLoadFinish += OnStageLoadFinish;
|
| | |
|
| | |
| | |
|
| | | private void TreasureCollectProgressRefresh(int id)
|
| | | {
|
| | | if (id == displayId)
|
| | | if (id == displayId && model.isServerReady)
|
| | | {
|
| | | m_ProgressEffect.Play();
|
| | | if (m_CacheCoroutine != null)
|