Merge branch 'master' into ViewOtherPlayer
| | |
| | | needEmpty = true,
|
| | | needLoadResource = true,
|
| | | serverType = ServerType.CrossSever,
|
| | | isClientLoadMap = true
|
| | | isClientLoadMap = true,
|
| | | refreshPlayerDatas = true
|
| | | });
|
| | | }
|
| | | }
|
| New file |
| | |
| | | public class PN_PlayEffect : ProcessNode |
| | | { |
| | | public PN_PlayEffect(GA_NpcClientFightNorm npc, int effectID) |
| | | { |
| | | m_Target = npc; |
| | | param = effectID; |
| | | } |
| | | |
| | | public sealed override void Init() |
| | | { |
| | | #if UNITY_EDITOR |
| | | UnityEngine.Debug.LogFormat("进入播放特效: {0} 节点", param); |
| | | #endif |
| | | m_Target.ProcessEffectDict[param] = SFXPlayUtility.Instance.PlayBattleEffect(param, m_Target); |
| | | } |
| | | |
| | | public sealed override bool IsOver() |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | public sealed override void UnInit() |
| | | { |
| | | #if UNITY_EDITOR |
| | | UnityEngine.Debug.LogFormat("{0} 特效播放结束", param); |
| | | #endif |
| | | } |
| | | |
| | | public sealed override void Update() |
| | | { |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 4d0e6d13d15d331489320b866adbc64f |
| | | timeCreated: 1556259744 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | using System; |
| | | using Snxxz.UI; |
| | | |
| | | public class PN_ShowMotion : ProcessNode |
| | | { |
| | | private bool m_BossShowFinished = false; |
| | | |
| | | public PN_ShowMotion(GA_NpcClientFightNorm npc, int id) |
| | | { |
| | | m_Target = npc; |
| | |
| | | |
| | | public override void Init() |
| | | { |
| | | m_BossShowFinished = false; |
| | | m_Target.IdleImmediate(); |
| | | |
| | | GA_Hero _hero = PlayerDatas.Instance.hero; |
| | |
| | | UnityEngine.Debug.LogFormat("开始播放动画: {0}", param); |
| | | #endif |
| | | |
| | | var _actorShow = ActorShowConfig.Get(param); |
| | | BossShowModel.Instance.Start(PlayerDatas.Instance.baseData.MapID, _actorShow.NpcID); |
| | | BossShowModel.Instance.bossShowCompletedEvent += CompeleteEvent; |
| | | m_Target.isTalking = true; |
| | | } |
| | | |
| | | private void CompeleteEvent() |
| | | { |
| | | m_BossShowFinished = true; |
| | | } |
| | | |
| | | public override bool IsOver() |
| | | { |
| | | return true; |
| | | return m_BossShowFinished; |
| | | } |
| | | |
| | | public override void UnInit() |
| New file |
| | |
| | | public class PN_StartPlayerAI : ProcessNode |
| | | { |
| | | public sealed override void Init() |
| | | { |
| | | #if UNITY_EDITOR |
| | | UnityEngine.Debug.LogFormat("恢复自动AI状态"); |
| | | #endif |
| | | |
| | | GA_Hero _hero = PlayerDatas.Instance.hero; |
| | | if (_hero != null) |
| | | { |
| | | _hero.Behaviour.StartHandupAI(); |
| | | } |
| | | } |
| | | |
| | | public sealed override bool IsOver() |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | public sealed override void UnInit() |
| | | { |
| | | } |
| | | |
| | | public sealed override void Update() |
| | | { |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 9fffea103d73be04180589050fb008e4 |
| | | timeCreated: 1556285864 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | public class PN_StopEffect : ProcessNode |
| | | { |
| | | public PN_StopEffect(GA_NpcClientFightNorm npc, int effectID) |
| | | { |
| | | m_Target = npc; |
| | | param = effectID; |
| | | } |
| | | |
| | | public sealed override void Init() |
| | | { |
| | | SFXController _sfx; |
| | | if (m_Target.ProcessEffectDict.TryGetValue(param, out _sfx)) |
| | | { |
| | | SFXPlayUtility.Instance.Release(_sfx); |
| | | m_Target.ProcessEffectDict.Remove(param); |
| | | #if UNITY_EDITOR |
| | | UnityEngine.Debug.LogFormat("进入停止特效: {0} 节点", param); |
| | | #endif |
| | | } |
| | | } |
| | | |
| | | public sealed override bool IsOver() |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | public sealed override void UnInit() |
| | | { |
| | | #if UNITY_EDITOR |
| | | UnityEngine.Debug.LogFormat("{0} 特效停止结束", param); |
| | | #endif |
| | | } |
| | | |
| | | public sealed override void Update() |
| | | { |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 3862ee948299a1e4eac6ebda910c9497 |
| | | timeCreated: 1556267161 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | case ProcessNode.E_ProcessType.StopAI: |
| | | m_NodeQueue.Enqueue(new PN_StopAI(npc, _node.param)); |
| | | break; |
| | | case ProcessNode.E_ProcessType.PlayEffect: |
| | | m_NodeQueue.Enqueue(new PN_PlayEffect(npc, _node.param)); |
| | | break; |
| | | case ProcessNode.E_ProcessType.StopEffect: |
| | | m_NodeQueue.Enqueue(new PN_StopEffect(npc, _node.param)); |
| | | break; |
| | | case ProcessNode.E_ProcessType.StartPlayerAI: |
| | | m_NodeQueue.Enqueue(new PN_StartPlayerAI()); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | |
| | | ShowMotion, |
| | | WaitTime, |
| | | StopAI, |
| | | PlayEffect, |
| | | StopEffect, |
| | | StartPlayerAI, |
| | | } |
| | | |
| | | public int param; |
| | |
| | | { |
| | | _Item(ref _node, "停止AI"); |
| | | } |
| | | else if (_node.nodeType == ProcessNode.E_ProcessType.PlayEffect) |
| | | { |
| | | _Item(ref _node, "播放特效"); |
| | | } |
| | | else if (_node.nodeType == ProcessNode.E_ProcessType.StopEffect) |
| | | { |
| | | _Item(ref _node, "停止特效"); |
| | | } |
| | | else if (_node.nodeType == ProcessNode.E_ProcessType.StartPlayerAI) |
| | | { |
| | | } |
| | | EditorGUILayout.EndVertical(); |
| | | EditorGUILayout.BeginVertical(); |
| | | if (GUILayout.Button("删除", GUILayout.Height(20))) |
| | |
| | |
|
| | | skill.hurtClntFightNpcList.Add(_hurtObject);
|
| | |
|
| | | if (_target.ActorInfo.RealHp <= _hurtValue)
|
| | | if (_target.ActorInfo.RealHp <= _hurtValue && (_clientNpc == null || _clientNpc.lockHp <= 0))
|
| | | {
|
| | | if (_clientNpc.NpcConfig.AIType != 198)
|
| | | {
|
| | |
| | | target.KillerPos = attacker.Pos;
|
| | | }
|
| | | }
|
| | |
|
| | | if (canDie && target.ActorInfo.RealHp == 0)
|
| | | if (canDie
|
| | | && target.ActorInfo.RealHp == 0
|
| | | && !(StageLoad.Instance.currentStage is ClientHazyDemonKingStage))
|
| | | {
|
| | | target.Die(attacker.ServerInstID, soConfig.deadFlyId, (byte)attackType);
|
| | | }
|
| | |
| | | using Snxxz.UI; |
| | | using UnityEngine; |
| | | using System.Collections.Generic; |
| | | |
| | | public class GA_NpcClientFightNorm : GActorNpcFight |
| | | { |
| | |
| | | |
| | | public bool lockCommonAtk = false; |
| | | public int lockSkillID = -1; |
| | | |
| | | public Dictionary<int, SFXController> ProcessEffectDict = new Dictionary<int, SFXController>(); |
| | | |
| | | public void AutoAI() |
| | | { |
| | |
| | | HeroRoundGird.Instance.Release(posIndex); |
| | | posIndex = -1; |
| | | } |
| | | |
| | | foreach (var _sfx in ProcessEffectDict.Values) |
| | | { |
| | | SFXPlayUtility.Instance.Release(_sfx); |
| | | } |
| | | ProcessEffectDict.Clear(); |
| | | |
| | | base.OnUnit(); |
| | | } |
| | | |
| | |
| | | var _animNodde = m_AppearEffect.GetComponent<Animator>("Animation");
|
| | | if (_animNodde)
|
| | | {
|
| | | _animNodde.Play(GAStaticDefine.State_DeadHash);
|
| | | if (_animNodde.HasState(0, GAStaticDefine.State_DeadHash))
|
| | | {
|
| | | _animNodde.Play(GAStaticDefine.State_DeadHash);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | if (m_Animator)
|
| | | {
|
| | | m_Animator.Play(stateNameHash, 0, normalizeTime);
|
| | | if (m_Animator.HasState(0, stateNameHash))
|
| | | {
|
| | | m_Animator.Play(stateNameHash, 0, normalizeTime);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | WindowCenter.Instance.Open<ElderGodAngerWin>();
|
| | | }
|
| | | break;
|
| | | case ClientTreasureDungeon.Client_DataMap:
|
| | | case TreasureModel.TREASURE_MAPID:
|
| | | WindowCenter.Instance.Open<TreasureDungeonMissionHintWin>();
|
| | | break;
|
| | |
| | | static int _g_get_operateItemGuid(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | Snxxz.UI.ItemOperateUtility gen_to_be_invoked = (Snxxz.UI.ItemOperateUtility)translator.FastGetCSObj(L, 1); |
| | | LuaAPI.lua_pushstring(L, gen_to_be_invoked.operateItemGuid); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | |
| | | void DisplayAlchemyCount()
|
| | | {
|
| | | AlchemyCount alchemyCount;
|
| | | if (model.TryGetAlchemyCount(model.selectAlchemy, out alchemyCount))
|
| | | if (model.TryGetAlchemyCount(model.selectAlchemy, PlayerDatas.Instance.extersion.luckValue, out alchemyCount))
|
| | | {
|
| | | if (alchemyCount.min == alchemyCount.max)
|
| | | {
|
| | |
| | | if (model.TryGetAlchemyUseLimit(drugId, out drugUseLimit))
|
| | | {
|
| | | var itemConfig = ItemConfig.Get(drugUseLimit.addItem.id);
|
| | | m_Now.text = Language.Get("AlchemyAddLimit_1", drugUseLimit.GetUseLimit(),
|
| | | var drugConfig = ItemConfig.Get(drugId);
|
| | | m_Now.text = Language.Get("AlchemyAddLimit_1", drugUseLimit.GetUseLimit(), drugConfig.ItemName,
|
| | | itemConfig.ItemName);
|
| | | m_Next.text = Language.Get("AlchemyAddLimit_2", drugUseLimit.addItem.count, itemConfig.ItemName,
|
| | | drugUseLimit.addLimitPerTimes);
|
| | |
| | | AlchemyDrugUseLimit drugUseLimit;
|
| | | if (model.TryGetAlchemyUseLimit(drugId, out drugUseLimit))
|
| | | {
|
| | | m_Now.text = Language.Get("AlchemyAddLimit_3", drugUseLimit.GetUseLimit());
|
| | | var drugConfig = ItemConfig.Get(drugId);
|
| | | m_Now.text = Language.Get("AlchemyAddLimit_3", drugUseLimit.GetUseLimit(), drugConfig.ItemName);
|
| | | var realmLevel = drugUseLimit.GetNextUpgradeRealm();
|
| | | var realmConfig = RealmConfig.Get(realmLevel);
|
| | | var upgrade = drugUseLimit.GetRealmLimit(realmLevel) -
|
| | |
| | | public class AlchemyModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
|
| | | {
|
| | | Dictionary<int, uint> m_AlchemyTimes = new Dictionary<int, uint>();
|
| | | Dictionary<int, AlchemyCount> m_AlchemyCounts = new Dictionary<int, AlchemyCount>();
|
| | | Dictionary<int, Dictionary<int, AlchemyCount>> m_AlchemyCounts = new Dictionary<int, Dictionary<int, AlchemyCount>>();
|
| | | Dictionary<int, int> m_AlchemyQualityLucks = new Dictionary<int, int>();
|
| | | Dictionary<int, List<Item>> m_AlchemyMaterials = new Dictionary<int, List<Item>>();
|
| | | Dictionary<int, AlchemyDrugUseLimit> m_AlchemyDrugUseLimits = new Dictionary<int, AlchemyDrugUseLimit>();
|
| | |
| | | var intArray = LitJson.JsonMapper.ToObject<int[][]>(config.CntRateList);
|
| | | var min = intArray[0][1];
|
| | | var max = intArray[intArray.Length - 1][1];
|
| | | if (m_AlchemyCounts.ContainsKey(config.AlchemyQuality))
|
| | | if (!m_AlchemyCounts.ContainsKey(config.AlchemyQuality))
|
| | | {
|
| | | var alchemyCount = m_AlchemyCounts[config.AlchemyQuality];
|
| | | if (min < alchemyCount.min)
|
| | | {
|
| | | alchemyCount.min = min;
|
| | | m_AlchemyCounts[config.AlchemyQuality] = alchemyCount;
|
| | | }
|
| | | if (max > alchemyCount.max)
|
| | | {
|
| | | alchemyCount.max = max;
|
| | | m_AlchemyCounts[config.AlchemyQuality] = alchemyCount;
|
| | | }
|
| | | m_AlchemyCounts[config.AlchemyQuality] = new Dictionary<int, AlchemyCount>();
|
| | | }
|
| | | else
|
| | | m_AlchemyCounts[config.AlchemyQuality].Add(config.LuckValue, new AlchemyCount()
|
| | | {
|
| | | m_AlchemyCounts[config.AlchemyQuality] = new AlchemyCount()
|
| | | {
|
| | | min = min,
|
| | | max = max,
|
| | | };
|
| | | }
|
| | | min = min,
|
| | | max = max,
|
| | | });
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | return m_AlchemyTimes.TryGetValue(alchemyId, out tick);
|
| | | }
|
| | |
|
| | | public bool TryGetAlchemyCount(int alchemyId, out AlchemyCount alchemyCount)
|
| | | public bool TryGetAlchemyCount(int alchemyId, int luckValue, out AlchemyCount alchemyCount)
|
| | | {
|
| | | var config = AlchemyConfig.Get(alchemyId);
|
| | | alchemyCount = default(AlchemyCount);
|
| | | if (config == null)
|
| | | {
|
| | | alchemyCount = default(AlchemyCount);
|
| | | return false;
|
| | | }
|
| | | if (config.AlchemType == (int)AlchemyType.Fairy)
|
| | |
| | | alchemyCount = AlchemyCount.one;
|
| | | return true;
|
| | | }
|
| | | return m_AlchemyCounts.TryGetValue(config.AlchemyQuality, out alchemyCount);
|
| | | var dict = m_AlchemyCounts[config.AlchemyQuality];
|
| | | foreach (var _luckValue in dict.Keys)
|
| | | {
|
| | | if (luckValue >= _luckValue)
|
| | | {
|
| | | alchemyCount = dict[_luckValue];
|
| | | }
|
| | | }
|
| | | return alchemyCount.Equals(default(AlchemyCount));
|
| | | }
|
| | |
|
| | | public bool TryGetAlchemyMaterials(int alchemyId, out List<Item> items)
|
| | |
| | | [SerializeField] Text m_StoveLevel;
|
| | | [SerializeField] Text m_StoveExp;
|
| | | [SerializeField] Slider m_StoveExpSlider;
|
| | | [SerializeField] Image m_ViewSlider;
|
| | | [SerializeField] float m_SliderLength;
|
| | |
|
| | | [SerializeField] Text m_LuckValue;
|
| | | [SerializeField] Transform m_ContainerGrasp;
|
| | |
| | | break;
|
| | | }
|
| | |
|
| | | DisplayViewLength();
|
| | |
|
| | | var grasp = model.IsGraspRecipe(model.selectAlchemy);
|
| | | m_ContainerGrasp.gameObject.SetActive(grasp);
|
| | | m_ContainerUnGrasp.gameObject.SetActive(!grasp);
|
| | |
| | | void DisplayLuckValue()
|
| | | {
|
| | | m_LuckValue.text = PlayerDatas.Instance.extersion.luckValue.ToString();
|
| | | }
|
| | |
|
| | | void DisplayViewLength()
|
| | | {
|
| | | var isMax = !RefineStoveConfig.Has(model.stoveLevel + 1);
|
| | | m_ViewSlider.gameObject.SetActive(!isMax);
|
| | | if (!isMax)
|
| | | {
|
| | | var stoveConfig = RefineStoveConfig.Get(model.stoveLevel);
|
| | | var config = AlchemyConfig.Get(model.selectAlchemy);
|
| | | var exp = config.AlchemyExp + model.stoveExp;
|
| | | var progress = Mathf.Clamp01((float)exp / stoveConfig.Exp);
|
| | | m_ViewSlider.rectTransform.sizeDelta = m_ViewSlider.rectTransform.sizeDelta.SetX(progress * m_SliderLength);
|
| | | }
|
| | | }
|
| | |
|
| | | private void SelectAlchemyRefresh()
|
| | |
| | | return;
|
| | | }
|
| | | break;
|
| | | case 1:
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("StopAlchemyDrugRemind"), (bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | SendAlchemyPackage();
|
| | | }
|
| | | });
|
| | | return;
|
| | | }
|
| | |
|
| | | SendAlchemyPackage();
|
| | |
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | m_Controller.lockType = EnhanceLockType.KeepVertical;
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | |
| | |
|
| | | void DisplayDrugs()
|
| | | {
|
| | | m_Controller.Refresh();
|
| | | var lastCount = displayItems.Count;
|
| | |
|
| | | displayItems.Clear();
|
| | |
|
| | | var items = model.GetAlchemyDrugs();
|
| | |
| | |
|
| | | displayItems.Sort(Compare);
|
| | |
|
| | | for (int i = 0; i < displayItems.Count; i++)
|
| | | if (lastCount != displayItems.Count)
|
| | | {
|
| | | m_Controller.AddCell(ScrollerDataType.Header, displayItems[i]);
|
| | | m_Controller.Refresh();
|
| | | for (int i = 0; i < displayItems.Count; i++)
|
| | | {
|
| | | m_Controller.AddCell(ScrollerDataType.Header, i);
|
| | | }
|
| | | m_Controller.Restart();
|
| | | }
|
| | |
|
| | | m_Controller.Restart();
|
| | | else
|
| | | {
|
| | | m_Controller.m_Scorller.RefreshActiveCellViews();
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnSortRefresh()
|
| | |
| | | private void OnRefreshCell(ScrollerDataType type, CellView cell)
|
| | | {
|
| | | var useDrugCell = cell as AlchemyUseDrugCell;
|
| | | useDrugCell.Display(cell.index);
|
| | | useDrugCell.Display(displayItems[cell.index]);
|
| | | }
|
| | |
|
| | | private void RefreshItemCountEvent(PackType packType, int arg2, int itemId)
|
| | |
| | | BossShowModel.Instance.bossShowCompletedEvent += BossShowCompletedEvent;
|
| | | model.demonDungeonChallengeNext += ChallengeNextEvent;
|
| | |
|
| | | var allConfigs = TreasureConfig.GetValues();
|
| | | foreach (var value in allConfigs)
|
| | | if (ClientDungeonStageUtility.isClientDungeon
|
| | | && ClientDungeonStageUtility.clientMapId == ClientTreasureDungeon.Client_DataMap)
|
| | | {
|
| | | if (value.MapId == PlayerDatas.Instance.baseData.MapID && value.LineId == PlayerDatas.Instance.baseData.dungeonLineId)
|
| | | treasureId = ClientTreasureDungeon.challengeTreasureId;
|
| | | }
|
| | | else
|
| | | {
|
| | | var allConfigs = TreasureConfig.GetValues();
|
| | | foreach (var value in allConfigs)
|
| | | {
|
| | | treasureId = value.ID;
|
| | | break;
|
| | | if (value.MapId == PlayerDatas.Instance.baseData.MapID && value.LineId == PlayerDatas.Instance.baseData.dungeonLineId)
|
| | | {
|
| | | treasureId = value.ID;
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | void DisplayNormalTreasureDungeon()
|
| | | {
|
| | | var config = TreasureConfig.Get(treasureId);
|
| | | var dungeonId = dungeonModel.GetDungeonId(config.MapId, config.LineId);
|
| | | var dungeonId = 0;
|
| | | if (ClientDungeonStageUtility.isClientDungeon)
|
| | | {
|
| | | dungeonId = dungeonModel.GetDungeonId(ClientTreasureDungeon.Client_DataMap, 0);
|
| | | }
|
| | | else
|
| | | {
|
| | | dungeonId = dungeonModel.GetDungeonId(config.MapId, config.LineId);
|
| | | }
|
| | | var dungeonConfig = DungeonConfig.Get(dungeonId);
|
| | | m_Title.text = dungeonConfig.FBName;
|
| | | m_Description.text = dungeonConfig.Description;
|
| | |
| | |
|
| | | readonly List<int> m_GemHoleItemIds = new List<int> { 0, 0, 0, 0 };
|
| | |
|
| | | public readonly Redpoint redpoint = new Redpoint(106, 10609);
|
| | | public readonly Redpoint redpoint = new Redpoint(106, 10602);
|
| | |
|
| | | public const int EQUIPGEM_HOLE_COUNT = 4;
|
| | | public static int REDPOINTBASE = 106090000;
|
| | | public static int REDPOINTBASE = 106020000;
|
| | |
|
| | | int m_SelectLevel = 0;
|
| | | public int selectLevel
|
| | |
| | | foreach (var level in totalEquipLevels)
|
| | | {
|
| | | var equipSetRedpointBase = REDPOINTBASE++;
|
| | | m_EquipSetRedpoints[level] = new Redpoint(10609, equipSetRedpointBase);
|
| | | m_EquipSetRedpoints[level] = new Redpoint(redpoint.id, equipSetRedpointBase);
|
| | | foreach (var place in m_EquipPlaces)
|
| | | {
|
| | | var packIndex = EquipPlaceMapConfig.GetServerPlace(level, place);
|
| | | if (!m_EquipGemRedpoints.ContainsKey(packIndex))
|
| | | {
|
| | | EquipGemRedpoint redpoint = new EquipGemRedpoint(equipSetRedpointBase);
|
| | | m_EquipGemRedpoints.Add(packIndex, redpoint);
|
| | | EquipGemRedpoint _redpoint = new EquipGemRedpoint(equipSetRedpointBase);
|
| | | m_EquipGemRedpoints.Add(packIndex, _redpoint);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | return m_GemTypes.TryGetValue(type, out gemType);
|
| | | }
|
| | |
|
| | | public bool TryGetRedpoint(int level, int place, out EquipGemRedpoint redpoint)
|
| | | public bool TryGetRedpoint(int level, int place, out EquipGemRedpoint _redpoint)
|
| | | {
|
| | | var packIndex = EquipPlaceMapConfig.GetServerPlace(level, place);
|
| | | return m_EquipGemRedpoints.TryGetValue(packIndex, out redpoint);
|
| | | return m_EquipGemRedpoints.TryGetValue(packIndex, out _redpoint);
|
| | | }
|
| | |
|
| | | public bool TryGetRedpoint(int level, out Redpoint redpoint)
|
| | | public bool TryGetRedpoint(int level, out Redpoint _redpoint)
|
| | | {
|
| | | return m_EquipSetRedpoints.TryGetValue(level, out redpoint);
|
| | | return m_EquipSetRedpoints.TryGetValue(level, out _redpoint);
|
| | | }
|
| | |
|
| | | public Int2 TryGotoUseGem(int itemId)
|
| | |
| | | return level;
|
| | | }
|
| | |
|
| | | public int GetEmptyGemHoleCount(int level, int place)
|
| | | {
|
| | | var count = 0;
|
| | | for (int i = 0; i < EQUIPGEM_HOLE_COUNT; i++)
|
| | | {
|
| | | var itemId = 0;
|
| | | if (IsEquipGemHoleOpen(level, place, i)
|
| | | && !TryGetEquipGem(level, place, i, out itemId))
|
| | | {
|
| | | count++;
|
| | | }
|
| | | }
|
| | | return count;
|
| | | }
|
| | |
|
| | | public int GetGemLevel(int itemId)
|
| | | {
|
| | | var config = ItemConfig.Get(itemId);
|
| | | return config == null ? 0 : config.EffectValueB1;
|
| | | }
|
| | |
|
| | | public int Compare(string lhs, string rhs)
|
| | | {
|
| | | var lhsItem = packModel.GetItemByGuid(lhs);
|
| | |
| | | return m_CacheEquipSets;
|
| | | }
|
| | | }
|
| | | List<int> cacheInlayGemTypes = new List<int>();
|
| | | List<int> cacheComposeGemTypes = new List<int>();
|
| | | Dictionary<int, List<bool>> inlayAbles = new Dictionary<int, List<bool>>();
|
| | | Dictionary<int, List<bool>> composeAbles = new Dictionary<int, List<bool>>();
|
| | |
|
| | | void RefreshRedpoint()
|
| | | {
|
| | | cacheInlayGemTypes.Clear();
|
| | |
|
| | | foreach (var level in cacheEquipSets)
|
| | | {
|
| | | foreach (var place in m_EquipPlaces)
|
| | | {
|
| | | var packIndex = EquipPlaceMapConfig.GetServerPlace(level, place);
|
| | | if (!inlayAbles.ContainsKey(packIndex))
|
| | | {
|
| | | inlayAbles[packIndex] = new List<bool>(EQUIPGEM_HOLE_COUNT) { false, false, false, false };
|
| | | }
|
| | | if (!composeAbles.ContainsKey(packIndex))
|
| | | {
|
| | | composeAbles[packIndex] = new List<bool>(EQUIPGEM_HOLE_COUNT) { false, false, false, false };
|
| | | }
|
| | | for (int i = 0; i < EQUIPGEM_HOLE_COUNT; i++)
|
| | | {
|
| | | inlayAbles[packIndex][i] = false;
|
| | | composeAbles[packIndex][i] = false;
|
| | | }
|
| | | }
|
| | | }
|
| | | List<int> places = new List<int>(m_EquipPlaces);
|
| | |
|
| | | #region 检查空的孔位
|
| | | places.Sort((int x, int y) =>
|
| | | {
|
| | | List<int> x_types;
|
| | | List<int> y_types;
|
| | | if (TryGetGemTypes(x, out x_types)
|
| | | && TryGetGemTypes(y, out y_types))
|
| | | {
|
| | | if (x_types[0] != y_types[0])
|
| | | {
|
| | | return -x_types[0].CompareTo(y_types[0]);
|
| | | }
|
| | | }
|
| | | return x.CompareTo(y);
|
| | | });
|
| | |
|
| | | foreach (var level in cacheEquipSets)
|
| | | {
|
| | | foreach (var place in m_EquipPlaces)
|
| | | foreach (var place in places)
|
| | | {
|
| | | EquipGemRedpoint equipGemRedpoint;
|
| | | TryGetRedpoint(level, place, out equipGemRedpoint);
|
| | | for (int i = 0; i < EQUIPGEM_HOLE_COUNT; i++)
|
| | | {
|
| | | int equipGem;
|
| | |
| | | {
|
| | | if (SatisfyInlayBetterGem(level, place, i))
|
| | | {
|
| | | var packIndex = EquipPlaceMapConfig.GetServerPlace(level, place);
|
| | | inlayAbles[packIndex][i] = true;
|
| | | cacheInlayGemTypes.AddRange(m_EquipGemTypes[place]);
|
| | | break;
|
| | | SetRedpoint(new Int2(level, place), i, 1);
|
| | | return;
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | #region 检查所有孔位
|
| | | foreach (var level in cacheEquipSets)
|
| | | {
|
| | | foreach (var place in m_EquipPlaces)
|
| | | foreach (var place in places)
|
| | | {
|
| | | EquipGemRedpoint equipGemRedpoint;
|
| | | TryGetRedpoint(level, place, out equipGemRedpoint);
|
| | | for (int i = 0; i < EQUIPGEM_HOLE_COUNT; i++)
|
| | | {
|
| | | if (SatisfyInlayBetterGem(level, place, i))
|
| | | {
|
| | | var packIndex = EquipPlaceMapConfig.GetServerPlace(level, place);
|
| | | inlayAbles[packIndex][i] = true;
|
| | | cacheInlayGemTypes.AddRange(m_EquipGemTypes[place]);
|
| | | break;
|
| | | SetRedpoint(new Int2(level, place), i, 1);
|
| | | return;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | #endregion
|
| | |
|
| | | cacheComposeGemTypes.Clear();
|
| | | #region 检查非空孔位
|
| | | int cacheLevel = 0;
|
| | | Int2 position = Int2.zero;
|
| | | int hole = 0;
|
| | | int type = 0;
|
| | | foreach (var level in cacheEquipSets)
|
| | | {
|
| | | foreach (var place in m_EquipPlaces)
|
| | | foreach (var place in places)
|
| | | {
|
| | | EquipGemRedpoint equipGemRedpoint;
|
| | | TryGetRedpoint(level, place, out equipGemRedpoint);
|
| | | for (int i = 0; i < EQUIPGEM_HOLE_COUNT; i++)
|
| | | {
|
| | | int equipGem;
|
| | |
| | | {
|
| | | if (SatisfyComposeGem(level, place, i))
|
| | | {
|
| | | var packIndex = EquipPlaceMapConfig.GetServerPlace(level, place);
|
| | | composeAbles[packIndex][i] = true;
|
| | | var config = ItemConfig.Get(equipGem);
|
| | | var type = config.EffectValueA1;
|
| | | cacheComposeGemTypes.Add(type);
|
| | | if (cacheLevel == 0 || cacheLevel > GetGemLevel(equipGem))
|
| | | {
|
| | | cacheLevel = GetGemLevel(equipGem);
|
| | | position.x = level;
|
| | | position.y = place;
|
| | | hole = i;
|
| | | type = 2;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | | #endregion
|
| | |
|
| | | SetRedpoint(position, hole, type);
|
| | | }
|
| | |
|
| | | void SetRedpoint(Int2 position, int hole, int type)
|
| | | {
|
| | | foreach (var level in cacheEquipSets)
|
| | | {
|
| | | foreach (var place in m_EquipPlaces)
|
| | |
| | | TryGetRedpoint(level, place, out equipGemRedpoint);
|
| | | for (int i = 0; i < EQUIPGEM_HOLE_COUNT; i++)
|
| | | {
|
| | | equipGemRedpoint.SetInlayRedpoint(i, inlayAbles[packIndex][i]);
|
| | | equipGemRedpoint.SetComposeRedpoint(i, composeAbles[packIndex][i]);
|
| | | var inlayAble = position.x == level && position.y == place && hole == i && type == 1;
|
| | | var composeAble = position.x == level && position.y == place && hole == i && type == 2;
|
| | | equipGemRedpoint.SetInlayRedpoint(i, inlayAble);
|
| | | equipGemRedpoint.SetComposeRedpoint(i, composeAble);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | List<int> gemTypes = m_EquipGemTypes[place];
|
| | | foreach (var type in gemTypes)
|
| | | {
|
| | | if (cacheInlayGemTypes.Contains(type))
|
| | | {
|
| | | continue;
|
| | | }
|
| | | var count = GetBetterGemCount(type, equipGemLevel);
|
| | | if (count > 0)
|
| | | {
|
| | |
| | | }
|
| | | var config = ItemConfig.Get(equipGem);
|
| | | var type = config.EffectValueA1;
|
| | | if (cacheComposeGemTypes.Contains(type))
|
| | | {
|
| | | return false;
|
| | | }
|
| | | var emptyHoleCount = GetSameTypeEmptyUnlockHole(cacheEquipSets, type);
|
| | | var sameLevelCount = GetSameLevelGemCount(type, config.EffectValueB1);
|
| | | sameLevelCount -= emptyHoleCount;
|
| | |
| | | [SerializeField] ItemCell m_EquipItem;
|
| | | [SerializeField] Text m_EquipStar;
|
| | | [SerializeField] EquipGemHoleBehaviour[] m_GemHoles;
|
| | |
|
| | | List<int> m_Sorts = new List<int>();
|
| | | |
| | | EquipGemModel model
|
| | | {
|
| | |
| | |
|
| | | if (level == 0)
|
| | | {
|
| | | level = equipModel.GetLastestUnLockEquipSet();
|
| | | var equipSets = equipModel.GetAllEquipSets();
|
| | | level = equipSets[0];
|
| | | foreach (var equipSet in equipSets)
|
| | | {
|
| | | equipModel.GetEquipSet(equipSet);
|
| | | bool existAnyEquip = false;
|
| | | foreach (var place in model.GetMosaicEquipPlaces())
|
| | | {
|
| | | if (!string.IsNullOrEmpty(equipModel.GetEquip(new Int2(equipSet, place))))
|
| | | {
|
| | | level = equipSet;
|
| | | existAnyEquip = true;
|
| | | break;
|
| | | }
|
| | | }
|
| | | if (existAnyEquip)
|
| | | {
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | var slotCount = model.GetUnlockEquipSlotCount(level);
|
| | | if (slotCount > 0)
|
| | | {
|
| | | model.selectLevel = level;
|
| | | var equipSet = equipModel.GetEquipSet(level);
|
| | | foreach (var place in model.GetMosaicEquipPlaces())
|
| | | {
|
| | | if (equipSet.IsSlotUnLocked(place))
|
| | | {
|
| | | model.selectEquipPlace = place;
|
| | | break;
|
| | | }
|
| | | }
|
| | | var places = new List<int>(model.GetMosaicEquipPlaces());
|
| | | places.Sort(EquipCompare);
|
| | | model.selectEquipPlace = places[0];
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
| | | jumpIndex++;
|
| | | if (model.selectLevel == level)
|
| | | {
|
| | | var places = model.GetMosaicEquipPlaces();
|
| | | foreach (var place in places)
|
| | | foreach (var place in m_Sorts)
|
| | | {
|
| | | if (equipSet.IsSlotUnLocked(place))
|
| | | {
|
| | |
| | | var slotCount = model.GetUnlockEquipSlotCount(level);
|
| | | if (slotCount > 0)
|
| | | {
|
| | | m_Sorts.Clear();
|
| | | m_Controller.AddCell(ScrollerDataType.Header, level);
|
| | | if (model.selectLevel == level)
|
| | | {
|
| | | var places = model.GetMosaicEquipPlaces();
|
| | | foreach (var place in places)
|
| | | m_Sorts.AddRange(model.GetMosaicEquipPlaces());
|
| | | m_Sorts.Sort(EquipCompare);
|
| | | foreach (var place in m_Sorts)
|
| | | {
|
| | | if (equipSet.IsSlotUnLocked(place))
|
| | | {
|
| | |
| | | m_Controller.Restart();
|
| | | }
|
| | |
|
| | | private int EquipCompare(int x, int y)
|
| | | {
|
| | | var x_equipGuid = equipModel.GetEquip(new Int2(model.selectLevel, x));
|
| | | var y_equipGuid = equipModel.GetEquip(new Int2(model.selectLevel, y));
|
| | | var x_hasEquip = !string.IsNullOrEmpty(x_equipGuid);
|
| | | var y_hasEquip = !string.IsNullOrEmpty(y_equipGuid);
|
| | | if (x_hasEquip != y_hasEquip)
|
| | | {
|
| | | return -x_hasEquip.CompareTo(y_hasEquip);
|
| | | }
|
| | | var x_emptyCount = model.GetEmptyGemHoleCount(model.selectLevel, x);
|
| | | var y_emptyCount = model.GetEmptyGemHoleCount(model.selectLevel, y);
|
| | | if (x_emptyCount != y_emptyCount)
|
| | | {
|
| | | return -x_emptyCount.CompareTo(y_emptyCount);
|
| | | }
|
| | | return x.CompareTo(y);
|
| | | }
|
| | |
|
| | | void DisplayGems()
|
| | | {
|
| | | if (model.selectLevel == -1)
|
| | |
| | | [SerializeField] Button m_Buy;
|
| | |
|
| | | [SerializeField] Transform m_ContainerUseItem;
|
| | | [SerializeField] Text m_UseItemTitle;
|
| | | [SerializeField] Text m_UseItemTimes;
|
| | | [SerializeField] ItemBehaviour m_Item;
|
| | | [SerializeField] Button m_Use;
|
| | |
| | |
|
| | | if (dailyQuestOpenTime.DayItemID != 0)
|
| | | {
|
| | | var itemConfig = ItemConfig.Get(dailyQuestOpenTime.DayItemID);
|
| | | m_UseItemTitle.text = Language.Get("HazyRegionUseItemTitle", itemConfig.ItemName);
|
| | | times = Mathf.Clamp(dailyQuestOpenTime.DayItemAddTimes - dayUseItemTimes, 0, dailyQuestOpenTime.DayItemAddTimes);
|
| | | label = UIHelper.AppendColor(times == 0 ? TextColType.Red : TextColType.Green, times.ToString(), true);
|
| | |
|
| | |
| | | var dailyQuestOpenTime = DailyQuestOpenTimeConfig.Get(config.RelatedID);
|
| | | if (dayUseItemTimes >= dailyQuestOpenTime.DayItemAddTimes)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("OpenHazyAddTimesError_3");
|
| | | return;
|
| | | }
|
| | |
|
| | | if (!model.TryAddTimes())
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("OpenHazyAddTimesError_1");
|
| | | return;
|
| | | }
|
| | |
|
| | |
| | | var dailyQuestOpenTime = DailyQuestOpenTimeConfig.Get(config.RelatedID);
|
| | | if (dayBuyTimes >= dailyQuestOpenTime.DayBuyTimes)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("OpenHazyAddTimesError_2");
|
| | | return;
|
| | | }
|
| | |
|
| | | if (!model.TryAddTimes())
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("OpenHazyAddTimesError_1");
|
| | | return;
|
| | | }
|
| | |
|
| | |
| | | switch (m_ItemId) |
| | | { |
| | | case 2105: |
| | | WindowCenter.Instance.Open<RechargeTipWin>(); |
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.VipRechargeFunc1); |
| | | break; |
| | | default: |
| | | ModelCenter.Instance.GetModel<GetWayModel>().itemId = m_ItemId; |
| | |
| | | |
| | | public class ItemTipUtility |
| | | { |
| | | public enum TipType
|
| | | {
|
| | | Item,
|
| | | Equip,
|
| | | Dogz,
|
| | | GatherSoul,
|
| | | KingTreasure,
|
| | | PetMount,
|
| | | Wing,
|
| | | Guard,
|
| | | } |
| | | |
| | | public class TipData |
| | | { |
| | |
| | | public List<int> ways; |
| | | } |
| | | |
| | | public struct BuyInfo |
| | | { |
| | | |
| | | } |
| | | |
| | | public struct GatherSoulInfo
|
| | | {
|
| | | public PackType packType;
|
| | |
| | | Debug.LogFormat("你查看的物品是:itemId->{0}", itemId); |
| | | Debug.LogFormat("你查看的物品是:name->{0}", config.ItemName); |
| | | #endif |
| | | |
| | | var isEquip = ItemLogicUtility.Instance.IsEquip(itemId); |
| | | if (isEquip) |
| | | { |
| | | mainTipData = CreateNormalEquipData(itemId); |
| | | } |
| | | else |
| | | { |
| | | mainTipData = CreateItemData(itemId); |
| | | } |
| | | |
| | | if (isEquip) |
| | | { |
| | | WindowCenter.Instance.Open<EquipTipWin>(); |
| | | } |
| | | else |
| | | { |
| | | switch (config.Type) |
| | | { |
| | | case 61: |
| | | case 62: |
| | | case 63: |
| | | ShowGatherSoul(itemId, 0); |
| | | break; |
| | | case 53: |
| | | var kingTreasureShow = ModelCenter.Instance.GetModel<KingTreasureShowModel>(); |
| | | kingTreasureShow.SetInitData(itemId); |
| | | break; |
| | | case 26: |
| | | case 41: |
| | | case 42: |
| | | WindowCenter.Instance.Open<PetMountTipWin>(); |
| | | break; |
| | | case 113: |
| | | WindowCenter.Instance.Open<WingTipWin>(); |
| | | break; |
| | | case 114: |
| | | WindowCenter.Instance.Open<GuardTipWin>(); |
| | | break; |
| | | default: |
| | | WindowCenter.Instance.Open<ItemTipWin>(); |
| | | break; |
| | | } |
| | | var tipType = GetTipType(itemId); |
| | | switch (tipType)
|
| | | {
|
| | | case TipType.Equip:
|
| | | mainTipData = CreateNormalEquipData(itemId);
|
| | | break;
|
| | | case TipType.Dogz:
|
| | | mainTipData = CreateDogzEquipData(itemId);
|
| | | break;
|
| | | default:
|
| | | mainTipData = CreateItemData(itemId);
|
| | | break;
|
| | | }
|
| | |
|
| | | switch (tipType)
|
| | | {
|
| | | case TipType.Equip:
|
| | | WindowCenter.Instance.Open<EquipTipWin>();
|
| | | break;
|
| | | case TipType.Dogz:
|
| | | WindowCenter.Instance.Open<EquipTipWin>();
|
| | | break;
|
| | | case TipType.GatherSoul:
|
| | | ShowGatherSoul(itemId, 0);
|
| | | break;
|
| | | case TipType.KingTreasure:
|
| | | var kingTreasureShow = ModelCenter.Instance.GetModel<KingTreasureShowModel>();
|
| | | kingTreasureShow.SetInitData(itemId);
|
| | | break;
|
| | | case TipType.PetMount:
|
| | | WindowCenter.Instance.Open<PetMountTipWin>();
|
| | | break;
|
| | | case TipType.Wing:
|
| | | WindowCenter.Instance.Open<WingTipWin>();
|
| | | break;
|
| | | case TipType.Guard:
|
| | | WindowCenter.Instance.Open<GuardTipWin>();
|
| | | break;
|
| | | default:
|
| | | WindowCenter.Instance.Open<ItemTipWin>();
|
| | | break;
|
| | | } |
| | | } |
| | | |
| | |
| | | Debug.LogFormat("你查看的物品是:name->{0}", item.config.ItemName); |
| | | #endif |
| | | |
| | | secondaryData = null; |
| | | var packType = item.packType; |
| | | var isEquip = ItemLogicUtility.Instance.IsEquip(item.itemId); |
| | | switch (packType) |
| | | { |
| | | case PackType.Equip: |
| | | mainTipData = CreateNormalEquipData(guid); |
| | | break; |
| | | default: |
| | | if (isEquip) |
| | | { |
| | | if (item.isAuction) |
| | | { |
| | | mainTipData = CreateEquipAuctionData(guid); |
| | | } |
| | | else |
| | | { |
| | | mainTipData = CreateNormalEquipData(guid); |
| | | var equipedGuid = equipModel.GetEquip(new Int2(item.config.LV, item.config.EquipPlace)); |
| | | if (equipedGuid != guid) |
| | | { |
| | | secondaryData = CreateNormalEquipData(equipedGuid); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | mainTipData = CreateItemData(guid); |
| | | } |
| | | break; |
| | | } |
| | | |
| | | if (isEquip) |
| | | { |
| | | WindowCenter.Instance.Open<EquipTipWin>(); |
| | | } |
| | | else |
| | | { |
| | | switch (item.config.Type) |
| | | { |
| | | case 61: |
| | | case 62: |
| | | case 63: |
| | | break; |
| | | case 26: |
| | | case 41: |
| | | case 42: |
| | | WindowCenter.Instance.Open<PetMountTipWin>(); |
| | | break; |
| | | case 113: |
| | | WindowCenter.Instance.Open<WingTipWin>(); |
| | | break; |
| | | case 114: |
| | | WindowCenter.Instance.Open<GuardTipWin>(); |
| | | break; |
| | | default: |
| | | WindowCenter.Instance.Open<ItemTipWin>(); |
| | | break; |
| | | } |
| | | } |
| | | secondaryData = null;
|
| | | var tipType = GetTipType(item.itemId);
|
| | | switch (tipType)
|
| | | {
|
| | | case TipType.Equip:
|
| | | var packType = item.packType;
|
| | | switch (packType)
|
| | | {
|
| | | case PackType.Equip:
|
| | | mainTipData = CreateNormalEquipData(guid);
|
| | | break;
|
| | | default:
|
| | | if (item.isAuction)
|
| | | {
|
| | | mainTipData = CreateEquipAuctionData(guid);
|
| | | }
|
| | | else
|
| | | {
|
| | | mainTipData = CreateNormalEquipData(guid);
|
| | | var equipedGuid = equipModel.GetEquip(new Int2(item.config.LV, item.config.EquipPlace));
|
| | | if (equipedGuid != guid)
|
| | | {
|
| | | secondaryData = CreateNormalEquipData(equipedGuid);
|
| | | }
|
| | | }
|
| | | break;
|
| | | }
|
| | | break;
|
| | | case TipType.Dogz:
|
| | | mainTipData = CreateDogzEquipData(guid);
|
| | | break;
|
| | | default:
|
| | | mainTipData = CreateItemData(guid);
|
| | | break;
|
| | | }
|
| | |
|
| | | switch (tipType)
|
| | | {
|
| | | case TipType.Equip:
|
| | | WindowCenter.Instance.Open<EquipTipWin>();
|
| | | break;
|
| | | case TipType.Dogz:
|
| | | WindowCenter.Instance.Open<EquipTipWin>();
|
| | | break;
|
| | | case TipType.GatherSoul:
|
| | | ShowGatherSoul(item.itemId, 0);
|
| | | break;
|
| | | case TipType.KingTreasure:
|
| | | var kingTreasureShow = ModelCenter.Instance.GetModel<KingTreasureShowModel>();
|
| | | kingTreasureShow.SetInitData(item.itemId);
|
| | | break;
|
| | | case TipType.PetMount:
|
| | | WindowCenter.Instance.Open<PetMountTipWin>();
|
| | | break;
|
| | | case TipType.Wing:
|
| | | WindowCenter.Instance.Open<WingTipWin>();
|
| | | break;
|
| | | case TipType.Guard:
|
| | | WindowCenter.Instance.Open<GuardTipWin>();
|
| | | break;
|
| | | default:
|
| | | WindowCenter.Instance.Open<ItemTipWin>();
|
| | | break;
|
| | | }
|
| | |
|
| | | } |
| | | |
| | | public static void ShowGood(int goodId, int itemId) |
| | |
| | | suitInfo = GetSuitInfo(itemId), |
| | | gemInfo = GetGemInfo(itemId), |
| | | starInfo = GetStarInfo(itemId), |
| | | getWay = GetGetWay(itemId) |
| | | }; |
| | | }
|
| | |
|
| | | static TipData CreateDogzEquipData(string guid) |
| | | { |
| | | var item = packModel.GetItemByGuid(guid); |
| | | if (item == null) |
| | | { |
| | | return default(TipData); |
| | | } |
| | | |
| | | return new TipData() |
| | | { |
| | | itemId = item.itemId, |
| | | guid = guid, |
| | | |
| | | baseInfo = GetBaseInfo(guid), |
| | | baseProperty = GetBaseProperty(guid), |
| | | legendProperty = GetLegendProperty(guid), |
| | | }; |
| | | } |
| | | |
| | | static TipData CreateDogzEquipData(int itemId) |
| | | { |
| | | return new TipData() |
| | | { |
| | | itemId = itemId, |
| | | guid = string.Empty, |
| | | |
| | | baseInfo = GetBaseInfo(itemId), |
| | | baseProperty = GetBaseProperty(itemId), |
| | | legendProperty = GetLegendProperty(itemId), |
| | | getWay = GetGetWay(itemId) |
| | | }; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | break;
|
| | | case 119:
|
| | | case 120:
|
| | | case 121:
|
| | | case 122:
|
| | | case 123:
|
| | | data.trueCount = LegendPropertyUtility.GetDogzPropertyCount(config.ItemColor, config.StarLevel, LegendAttrType.Normal);
|
| | | data.properties = new List<Int2>(); |
| | | var keys = LegendPropertyUtility.GetDogzPlaceProperties(config.EquipPlace);
|
| | | foreach (var key in keys)
|
| | | {
|
| | | var value = LegendPropertyUtility.GetDogzQualityPropertyValue(key, config.ItemColor);
|
| | | data.properties.Add(new Int2(key, value));
|
| | | } |
| | | break; |
| | | default: |
| | | data.trueCount = LegendPropertyUtility.GetEquipPropertyCount(itemId); |
| | |
| | | return true; |
| | | } |
| | | |
| | | private static TipType GetTipType(int itemId)
|
| | | {
|
| | | var config = ItemConfig.Get(itemId);
|
| | |
|
| | | switch (config.Type)
|
| | | {
|
| | | case 101:
|
| | | case 102:
|
| | | case 103:
|
| | | case 104:
|
| | | case 105:
|
| | | case 106:
|
| | | case 107:
|
| | | case 108:
|
| | | case 109:
|
| | | case 110:
|
| | | case 111:
|
| | | case 112:
|
| | | return TipType.Equip;
|
| | | case 119:
|
| | | case 120:
|
| | | case 121:
|
| | | case 122:
|
| | | case 123:
|
| | | return TipType.Dogz;
|
| | | case 61:
|
| | | case 62:
|
| | | case 63:
|
| | | return TipType.GatherSoul;
|
| | | case 53:
|
| | | return TipType.KingTreasure;
|
| | | case 26:
|
| | | case 41:
|
| | | case 42:
|
| | | return TipType.PetMount;
|
| | | case 113:
|
| | | return TipType.Wing;
|
| | | case 114:
|
| | | return TipType.Guard;
|
| | | default:
|
| | | return TipType.Item;
|
| | | }
|
| | |
|
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | if (baseInfo.score != 0) |
| | | { |
| | | if (baseInfo.isEquiped) |
| | | if (!baseInfo.isPreview && !baseInfo.isAuction) |
| | | { |
| | | m_ScoreOrType.text = Language.Get("EquipWin_EquipPointText_1") + baseInfo.score; |
| | | } |
| | |
| | | for (int i = 0; i < count; i++) |
| | | { |
| | | var property = data.properties[i]; |
| | | var quality = LegendPropertyConfig.Get(property.x).quality; |
| | | var config = LegendPropertyConfig.Get(property.x); |
| | | var quality = config != null ? config.quality : 0; |
| | | |
| | | if (data.isPreview) |
| | | { |
| | | lines.Add(UIHelper.AppendColor(quality, string.Format("【推荐】{0}", PlayerPropertyConfig.GetFullDescription( property.x,property.y)))); |
| | | lines.Add(UIHelper.AppendColor(quality, string.Format("【推荐】{0}", PlayerPropertyConfig.GetFullDescription(property.x, property.y)))); |
| | | } |
| | | else |
| | | { |
| | |
| | | |
| | | #region 装备 |
| | | |
| | | public string operateItemGuid { get; private set; } |
| | | |
| | | public void PutOnItem(string guid) |
| | | { |
| | | this.operateItemGuid = guid; |
| | | var selectedItem = packModel.GetItemByGuid(guid); |
| | | if (selectedItem == null) |
| | | var item = packModel.GetItemByGuid(guid); |
| | | if (item == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | var itemId = selectedItem.itemId; |
| | | if (!ItemLogicUtility.Instance.IsJobCompatibleItem(selectedItem.itemId)) |
| | | var itemId = item.itemId; |
| | | if (!ItemLogicUtility.Instance.IsJobCompatibleItem(item.itemId)) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("GeRen_lhs_31379"); |
| | | return; |
| | | } |
| | | |
| | | var putOnLimits = selectedItem.GetUseData((int)ItemUseDataKey.cancelUseLimit); |
| | | var putOnLimits = item.GetUseData((int)ItemUseDataKey.cancelUseLimit); |
| | | if (putOnLimits != null && putOnLimits[0] == 1) |
| | | { |
| | | PutOnEquip(selectedItem.equipPlace, selectedItem.guid); |
| | | PutOnEquip(item.equipPlace, item.guid); |
| | | return; |
| | | } |
| | | |
| | | var wearable = IsWearable(itemId); |
| | | if (wearable) |
| | | { |
| | | PutOnEquip(selectedItem.equipPlace, selectedItem.guid); |
| | | PutOnEquip(item.equipPlace, item.guid); |
| | | } |
| | | } |
| | | |
| | |
| | | /// </summary> |
| | | private void EquipAttrShift(int equipPlace, ItemModel item) |
| | | { |
| | | var packType = GeneralDefine.GetPackTypeByItemType(item.config.Type); |
| | | var putOnModel = packModel.GetItemByIndex(PackType.Equip, equipPlace); |
| | | |
| | | if (putOnModel == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | //var equipStrengthDic = strengthModel._EqInfo; |
| | | //var isPrompt = strengthModel.TheRatingPrompt(item.itemId); |
| | | //if (isPrompt && !PlayerPrefs.HasKey(PackModel.StrengthAttrShift_RecordKey)) |
| | | //{ |
| | | // LocalSave.SetBool(PackModel.StrengthAttrShift_RecordKey, true); |
| | | // ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("SwitchEquip_Strengthen")); |
| | | //} |
| | | |
| | | //if (equipStrengthDic.ContainsKey(equipPlace)) |
| | | //{ |
| | | // if (equipStrengthDic[equipPlace].EquipPartStarLV >= 1) |
| | | // { |
| | | // SysNotifyMgr.Instance.ShowTip("SwitchEquip_Strengthen2"); |
| | | // } |
| | | //} |
| | | |
| | | int[] stones = null; |
| | | equipGemModel.TryGetEquipGems(equipPlace, out stones); |
| | |
| | | Dictionary<int, int> m_ReikiRootPoints = new Dictionary<int, int>();
|
| | | Dictionary<int, int> m_ReikiRootFreePoints = new Dictionary<int, int>();
|
| | | Dictionary<int, List<int>> m_RecommendReikiRoots = new Dictionary<int, List<int>>();
|
| | | Dictionary<int, Dictionary<int, float>> m_RecommendProportion = new Dictionary<int, Dictionary<int, float>>();
|
| | | Dictionary<int, int> m_MainReikiRoots = new Dictionary<int, int>();
|
| | | Dictionary<int, int> m_ReikiQualityMapColors;
|
| | | Dictionary<int, int> m_CacheReikiRootPoints = new Dictionary<int, int>();
|
| | | Dictionary<int, Dictionary<int, int[]>> m_PromotePropertyValues = new Dictionary<int, Dictionary<int, int[]>>();
|
| | |
| | | onCacheFreePointRefresh();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public int mainReikiRoot
|
| | | {
|
| | | get
|
| | | {
|
| | | var job = PlayerDatas.Instance.baseData.Job;
|
| | | return m_MainReikiRoots[job];
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | foreach (var jobKey in json.Keys)
|
| | | {
|
| | | var job = int.Parse(jobKey);
|
| | | var _mainReikiRoot = 0;
|
| | | var _proportion = 0f;
|
| | | m_RecommendProportion.Add(job, new Dictionary<int, float>());
|
| | | foreach (var idKey in json[jobKey].Keys)
|
| | | {
|
| | | var id = int.Parse(idKey);
|
| | | var proportion = int.Parse(json[jobKey][idKey].ToString()) / 100f;
|
| | | if (proportion > _proportion)
|
| | | {
|
| | | _mainReikiRoot = id;
|
| | | _proportion = proportion;
|
| | | }
|
| | | m_RecommendProportion[job].Add(id, proportion);
|
| | | }
|
| | | m_MainReikiRoots.Add(job, _mainReikiRoot);
|
| | | m_RecommendReikiRoots.Add(job, new List<int>(m_RecommendProportion[job].Keys));
|
| | | m_RecommendReikiRoots.Add(job, new List<int>(LitJson.JsonMapper.ToObject<int[]>(json[jobKey].ToJson())));
|
| | | }
|
| | |
|
| | | var config = ReikiRootConfig.GetValues()[0];
|
| | |
| | | return null;
|
| | | }
|
| | |
|
| | | //m_CacheReikiRootPoints.Clear();
|
| | | //foreach (var id in m_ReikiRootPoints.Keys)
|
| | | //{
|
| | | // m_CacheReikiRootPoints[id] = m_ReikiRootPoints[id];
|
| | | //}
|
| | | m_CacheReikiRootPoints.Clear();
|
| | | foreach (var id in m_ReikiRootPoints.Keys)
|
| | | {
|
| | | m_CacheReikiRootPoints[id] = m_ReikiRootPoints[id];
|
| | | }
|
| | |
|
| | | var recommends = new List<ReikiRootRecommend>();
|
| | | var job = PlayerDatas.Instance.baseData.Job;
|
| | |
|
| | | if (m_RecommendProportion.ContainsKey(job))
|
| | | if (m_RecommendReikiRoots.ContainsKey(job))
|
| | | {
|
| | | var proportions = m_RecommendProportion[job];
|
| | | var index = 0;
|
| | | var reikis = m_RecommendReikiRoots[job];
|
| | | var surplusPoint = point;
|
| | | foreach (var id in proportions.Keys)
|
| | | while (surplusPoint > 0)
|
| | | {
|
| | | var recommendPoint = Mathf.Min(surplusPoint, (int)(point * proportions[id]));
|
| | | if (index == proportions.Keys.Count - 1)
|
| | | reikis.Sort((int x, int y) =>
|
| | | {
|
| | | recommendPoint = surplusPoint;
|
| | | }
|
| | | recommends.Add(new ReikiRootRecommend()
|
| | | {
|
| | | id = id,
|
| | | value = recommendPoint,
|
| | | var x_point = GetReikiRootCachePoint(x);
|
| | | var y_point = GetReikiRootCachePoint(y);
|
| | | if (x_point != y_point)
|
| | | {
|
| | | return x_point.CompareTo(y_point);
|
| | | }
|
| | | return x.CompareTo(y);
|
| | | });
|
| | | surplusPoint -= recommendPoint;
|
| | | index++;
|
| | |
|
| | | var minpoint = GetReikiRootCachePoint(reikis[0]);
|
| | | var samepointIds = reikis.FindAll((x) =>
|
| | | {
|
| | | return GetReikiRootCachePoint(x) == minpoint;
|
| | | });
|
| | |
|
| | | var recommendPoint = 0;
|
| | |
|
| | | if (samepointIds.Count != reikis.Count)
|
| | | {
|
| | | var secondpointId = reikis.Find((x) =>
|
| | | {
|
| | | return GetReikiRootCachePoint(x) > minpoint;
|
| | | });
|
| | | var secondpoint = GetReikiRootCachePoint(secondpointId);
|
| | | recommendPoint = Mathf.Min((secondpoint - minpoint) * samepointIds.Count, surplusPoint) / samepointIds.Count;
|
| | | }
|
| | | else
|
| | | {
|
| | | recommendPoint = surplusPoint / samepointIds.Count;
|
| | | }
|
| | |
|
| | | if (recommendPoint > 0)
|
| | | {
|
| | | foreach (var id in samepointIds)
|
| | | {
|
| | | recommends.Add(new ReikiRootRecommend()
|
| | | {
|
| | | id = id,
|
| | | value = recommendPoint,
|
| | | });
|
| | | surplusPoint -= recommendPoint;
|
| | | m_CacheReikiRootPoints[id] += recommendPoint;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | var id = samepointIds[0];
|
| | | recommends.Add(new ReikiRootRecommend()
|
| | | {
|
| | | id = id,
|
| | | value = 1,
|
| | | });
|
| | | surplusPoint -= 1;
|
| | | m_CacheReikiRootPoints[id] += 1;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | //var remainPoint = point;
|
| | | //var currentMaxQuality = 1;
|
| | |
|
| | | //foreach (var id in reikiRoots)
|
| | | //{
|
| | | // var quality = GetReikiRootQuality(id);
|
| | | // if (quality >= currentMaxQuality)
|
| | | // {
|
| | | // currentMaxQuality = quality;
|
| | | // }
|
| | | //}
|
| | | //
|
| | | //if (m_RecommendReikiRoots.ContainsKey(job))
|
| | | //{
|
| | | // var reikiRoots = m_RecommendReikiRoots[job];
|
| | | // while (remainPoint > 0)
|
| | | // {
|
| | | // reikiRoots.Sort(QualityCompare);
|
| | | // var id = reikiRoots[0];
|
| | | // var quality = GetReikiRootQuality(id, m_CacheReikiRootPoints[id]);
|
| | | // var addpoint = 0;
|
| | | // if (quality >= maxQuality)
|
| | | // {
|
| | | // var proportions = m_RecommendProportion[job];
|
| | | // foreach (var key in proportions.Keys)
|
| | | // {
|
| | | // addpoint = Mathf.RoundToInt(remainPoint * proportions[key]);
|
| | | // recommends.Add(new ReikiRootRecommend()
|
| | | // {
|
| | | // id = key,
|
| | | // value = addpoint,
|
| | | // });
|
| | | // if (!m_CacheReikiRootPoints.ContainsKey(key))
|
| | | // {
|
| | | // m_CacheReikiRootPoints.Add(key, 0);
|
| | | // }
|
| | | // m_CacheReikiRootPoints[key] += addpoint;
|
| | | // }
|
| | | // remainPoint = 0;
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // addpoint = Mathf.Min(remainPoint, GetCacheQualityRequrePoint(id,
|
| | | // quality < currentMaxQuality ? currentMaxQuality : quality + 1));
|
| | | // remainPoint -= addpoint;
|
| | | // recommends.Add(new ReikiRootRecommend()
|
| | | // {
|
| | | // id = id,
|
| | | // value = addpoint,
|
| | | // });
|
| | | // if (!m_CacheReikiRootPoints.ContainsKey(id))
|
| | | // {
|
| | | // m_CacheReikiRootPoints.Add(id, 0);
|
| | | // }
|
| | | // m_CacheReikiRootPoints[id] += addpoint;
|
| | | // }
|
| | | // }
|
| | | //}
|
| | | return recommends;
|
| | | }
|
| | |
|
| | |
| | | pak.PointValueList = pointValues;
|
| | | pak.PointAttrIDCount = (byte)points.Length;
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | }
|
| | |
|
| | | int QualityCompare(int lhs, int rhs)
|
| | | {
|
| | | var lhsQuality = GetReikiRootQuality(lhs, GetReikiRootCachePoint(lhs));
|
| | | var rhsQuality = GetReikiRootQuality(rhs, GetReikiRootCachePoint(rhs));
|
| | | if (lhs != rhs)
|
| | | {
|
| | | if (mainReikiRoot == lhs || mainReikiRoot == rhs)
|
| | | {
|
| | | if (lhsQuality == rhsQuality)
|
| | | {
|
| | | return mainReikiRoot == lhs ? -1 : 1;
|
| | | }
|
| | | }
|
| | | }
|
| | | return lhsQuality.CompareTo(rhsQuality);
|
| | | }
|
| | |
|
| | | private void PlayerDataRefreshEvent(PlayerDataType dataType)
|
| | |
| | | timer += Time.deltaTime;
|
| | | if (timer >= autoSeconds)
|
| | | {
|
| | | timer = 0f;
|
| | | OnClickEmpty();
|
| | | }
|
| | |
|
| | |
| | |
|
| | | private void DisplayDialogue()
|
| | | {
|
| | | timer = 0f;
|
| | | DisplayTime();
|
| | |
|
| | | if (speakTypes == null || dialogues == null)
|
| | | {
|
| | | return;
|