Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
| | |
| | |
|
| | | MapTransferUtility.Instance.lastMoveToWorldBossTime = float.MinValue;
|
| | | MapTransferUtility.Instance.lastMoveToWorldBossNpcID = 0;
|
| | | BossFakeLineUtility.Instance.inMistakeForBossAliveOverTime = float.MaxValue;
|
| | | BossFakeLineUtility.Instance.makeFakeLineTimes = 0;
|
| | | BossFakeLineUtility.Instance.showFakeLine = false;
|
| | |
|
| | | if (beforePlayerDataInitializeEvent != null)
|
| | | {
|
| | |
| | | {
|
| | | Debug.LogError(ex);
|
| | | }
|
| | |
|
| | |
|
| | | if (vNetData.LV == 1)
|
| | | {
|
| | |
| | |
|
| | | if (BossInfoConfig.IsStone((int)vNetData.NPCID))
|
| | | {
|
| | | BossFakeLineUtility.Instance.HasSawLineStoneRecently((int)vNetData.NPCID, PlayerDatas.Instance.baseData.FBID);
|
| | | BossFakeLineUtility.Instance.RecordSawStone((int)vNetData.NPCID, PlayerDatas.Instance.baseData.FBID);
|
| | | }
|
| | |
|
| | | if (GA_PlayerXMZZ.xmzzDict.ContainsKey(vNetData.NPCID))
|
| | |
| | |
|
| | | if (Config.Instance.ContainKey<WorldBossConfig>((int)vNetData.NPCID))
|
| | | {
|
| | | WorldBossConfig _worldBoss = Config.Instance.Get<WorldBossConfig>((int)vNetData.NPCID);
|
| | | if (vNetData.NPCID == MapTransferUtility.Instance.lastMoveToWorldBossNpcID)
|
| | | {
|
| | | MapTransferUtility.Instance.lastMoveToWorldBossTime = Time.realtimeSinceStartup;
|
| | | }
|
| | |
|
| | | BossFakeLineUtility.Instance.HasSawLineBossRecently((int)vNetData.NPCID, PlayerDatas.Instance.baseData.FBID);
|
| | | BossFakeLineUtility.Instance.RecordSawBoss((int)vNetData.NPCID, PlayerDatas.Instance.baseData.FBID);
|
| | | }
|
| | |
|
| | | if (_npcConfig == null)
|
| | |
| | |
|
| | | if (Config.Instance.ContainKey<WorldBossConfig>(_npcConfig.NPCID))
|
| | | {
|
| | | BossFakeLineUtility.Instance.inMistakeForBossAliveOverTime = Time.realtimeSinceStartup + 60;
|
| | | BossFakeLineUtility.Instance.lastBossNpcID = (uint)_npcConfig.NPCID;
|
| | | BossFakeLineUtility.Instance.RecordSawBoss(_npcConfig.NPCID,PlayerDatas.Instance.baseData.FBID);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | MapTransferUtility.Instance.lastMoveToWorldBossTime = Time.realtimeSinceStartup + 61;
|
| | | }
|
| | |
|
| | | if (BossFakeLineUtility.Instance.lastBossNpcID == _targetFight.NpcConfig.NPCID)
|
| | | if (BossFakeLineUtility.Instance.recordBossId == _targetFight.NpcConfig.NPCID)
|
| | | {
|
| | | BossFakeLineUtility.Instance.lastBossNpcID = 0;
|
| | | BossFakeLineUtility.Instance.inMistakeForBossAliveOverTime = Time.realtimeSinceStartup - 61;
|
| | | BossFakeLineUtility.Instance.ClearBossRecord();
|
| | | }
|
| | |
|
| | | if (_targetFight.NpcConfig.IsBoss > 1 && vNetData.KillerID == PlayerDatas.Instance.baseData.PlayerID)
|
| | |
| | | public class BossFakeLineUtility : Singleton<BossFakeLineUtility> |
| | | { |
| | | int m_MakeFakeLineTimes = 0; |
| | | public int makeFakeLineTimes |
| | | { |
| | | public int makeFakeLineTimes { |
| | | get { return m_MakeFakeLineTimes; } |
| | | set { m_MakeFakeLineTimes = Mathf.Clamp(value, 0, int.MaxValue); } |
| | | } |
| | | |
| | | bool m_ShowFakeLine = false; |
| | | public bool showFakeLine |
| | | { |
| | | public bool showFakeLine { |
| | | get { return m_ShowFakeLine; } |
| | | set { m_ShowFakeLine = value; } |
| | | } |
| | |
| | | DTC0102_tagCDBPlayer.switchAccountEvent += OnAccountSwitch; |
| | | } |
| | | |
| | | //这个值在初见boss和最后看见boss的时候记录,其值为time.time+1分钟,这段时间内告诉玩家其所在分线的boss的死亡情况,否则告诉玩家公共boss的死亡情况。 |
| | | public uint lastBossNpcID; |
| | | public float inMistakeForBossAliveOverTime = float.MaxValue; |
| | | public int recordBossId { get { return bossSawRecorder.npcId; } } |
| | | NpcSawRecorder bossSawRecorder = new NpcSawRecorder(); |
| | | NpcSawRecorder stoneSawRecorder = new NpcSawRecorder(); |
| | | |
| | | public bool IsShuntBoss(int _bossId) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | public void RecordSawStone(int npcId, int lineId) |
| | | { |
| | | stoneSawRecorder.Record(npcId, lineId, Time.realtimeSinceStartup); |
| | | } |
| | | |
| | | public bool HasSawLineStoneRecently(int bossId, int lineId) |
| | | { |
| | | var config = Config.Instance.Get<BossInfoConfig>(bossId); |
| | | if (config == null) |
| | | if (config != null) |
| | | { |
| | | return stoneSawRecorder.HasSawRecently(config.StoneNPCID, lineId, 60); |
| | | } |
| | | else |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | var stoneId = config.StoneNPCID; |
| | | public void ClearStoneRecord() |
| | | { |
| | | stoneSawRecorder.Clear(); |
| | | } |
| | | |
| | | //补充具体逻辑 |
| | | public void RecordSawBoss(int bossId, int lineId) |
| | | { |
| | | bossSawRecorder.Record(bossId, lineId, Time.realtimeSinceStartup); |
| | | } |
| | | |
| | | return false; |
| | | public bool HasSawBossRecently(int bossId) |
| | | { |
| | | return stoneSawRecorder.HasSawRecently(bossId, 60); |
| | | } |
| | | |
| | | public bool HasSawLineBossRecently(int bossId, int lineId) |
| | | { |
| | | var isMistakeBoss = lastBossNpcID == bossId && Time.realtimeSinceStartup < inMistakeForBossAliveOverTime; |
| | | return bossSawRecorder.HasSawRecently(bossId, lineId, 60); |
| | | } |
| | | |
| | | //补充具体逻辑 |
| | | inMistakeForBossAliveOverTime = Time.realtimeSinceStartup + 61; |
| | | lastBossNpcID = (uint)bossId; |
| | | |
| | | return false; |
| | | public void ClearBossRecord() |
| | | { |
| | | bossSawRecorder.Clear(); |
| | | } |
| | | |
| | | FindPreciousModel findPreciousModel { get { return ModelCenter.Instance.GetModel<FindPreciousModel>(); } } |
| | |
| | | |
| | | private void OnAccountSwitch() |
| | | { |
| | | m_MakeFakeLineTimes = 0; |
| | | bossKillTimes.Clear(); |
| | | ClearBossRecord(); |
| | | ClearStoneRecord(); |
| | | } |
| | | |
| | | class NpcSawRecorder |
| | | { |
| | | public int npcId { get; private set; } |
| | | |
| | | int m_LineId = -1; |
| | | public int lineId { |
| | | get { return m_LineId; } |
| | | private set { m_LineId = value; } |
| | | } |
| | | |
| | | float m_Time = -99999; |
| | | public float time { |
| | | get { return m_Time; } |
| | | private set { m_Time = value; } |
| | | } |
| | | |
| | | public void Record(int npcId, int lineId, float time) |
| | | { |
| | | this.npcId = npcId; |
| | | this.lineId = lineId; |
| | | this.time = time; |
| | | } |
| | | |
| | | public void Clear() |
| | | { |
| | | this.npcId = 0; |
| | | this.lineId = -1; |
| | | this.time = -99999; |
| | | } |
| | | |
| | | public bool HasSawRecently(int npcId, float second) |
| | | { |
| | | if (this.npcId != npcId) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | if (Time.realtimeSinceStartup - this.time > 60) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | |
| | | public bool HasSawRecently(int npcId, int lineId, float second) |
| | | { |
| | | if (this.npcId != npcId) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | if (this.lineId != lineId) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | if (Time.realtimeSinceStartup - this.time > 60) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | |
|
| | | public float forceAutoFightTime;
|
| | |
|
| | | private float m_ChkOpenAutoEscapeTime;
|
| | |
|
| | | private DungeonModel m_DungeonModel;
|
| | | public DungeonModel dungeonModel { get { return m_DungeonModel ?? (m_DungeonModel = ModelCenter.Instance.GetModel<DungeonModel>()); } }
|
| | |
|
| | | protected sealed override void OnUpdate()
|
| | | {
|
| | | base.OnUpdate();
|
| | |
|
| | | if (!forceAutoFight)
|
| | | {
|
| | | if (Time.realtimeSinceStartup - m_ChkOpenAutoEscapeTime > 2f)
|
| | | {
|
| | | int _dgDataID = dungeonModel.GetDataMapIdByMapId(PlayerDatas.Instance.baseData.MapID);
|
| | | var dungeonOpen = Config.Instance.Get<DungeonOpenTimeConfig>(_dgDataID);
|
| | |
|
| | | if (dungeonOpen != null)
|
| | | {
|
| | | if (dungeonOpen.DoFight == 1)
|
| | | {
|
| | | forceAutoFight = true;
|
| | | }
|
| | | }
|
| | |
|
| | | m_ChkOpenAutoEscapeTime = Time.realtimeSinceStartup;
|
| | | }
|
| | | }
|
| | |
|
| | | if (forceAutoFight
|
| | | #if UNITY_EDITOR
|
| | | && RuntimeLogUtility.s_forceAutoFight
|
| | |
| | | {
|
| | | PlayerTaskDatas _model = ModelCenter.Instance.GetModel<PlayerTaskDatas>();
|
| | | m_CanCollect = _model.IsGather(NpcConfig.NPCID);
|
| | | Debug.LogFormat("Npc: {0} 是否可以采集: {1}", NpcConfig.NPCID, m_CanCollect);
|
| | | }
|
| | |
|
| | | if (!m_CanCollect)
|
| | |
| | | float _distSqrt = MathUtility.DistanceSqrtXZ(_hero.Pos, Pos);
|
| | | if (_distSqrt > Mathf.Pow(GeneralConfig.Instance.CloseNpcDist + NpcConfig.ModelRadius + 0.4f, 2))
|
| | | {
|
| | | MapTransferUtility.Instance.MoveToNPC(NpcConfig.NPCID);
|
| | | MapTransferUtility.Instance.MoveToNPC(NpcConfig.NPCID, (int)ServerInstID);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | |
|
| | | public void MoveToNPC(int npcID, int sid = 0)
|
| | | {
|
| | | if (sid != 0)
|
| | | {
|
| | | GActor _actor = GAMgr.Instance.GetBySID((uint)sid);
|
| | | if (_actor != null)
|
| | | {
|
| | | NpcID = npcID;
|
| | | MapTransferDoType = E_MapTransferDoType.Npc;
|
| | |
|
| | | MoveToExistNpc(npcID, _actor);
|
| | |
|
| | | return;
|
| | | }
|
| | | }
|
| | |
|
| | | NPCConfig _config = Config.Instance.Get<NPCConfig>(npcID);
|
| | |
|
| | | if (_config == null)
|
| | |
| | | else
|
| | | {
|
| | | // 处于相同地图
|
| | | if (BossFakeLineUtility.Instance.lastBossNpcID != npcID
|
| | | || Time.realtimeSinceStartup - BossFakeLineUtility.Instance.inMistakeForBossAliveOverTime > 60)
|
| | | if (!BossFakeLineUtility.Instance.HasSawBossRecently(npcID))
|
| | | {
|
| | | if (BossFakeLineUtility.Instance.IsShuntBoss(npcID))
|
| | | {
|
| | |
| | | {
|
| | | _npc = GAMgr.Instance.GetCloserNPC(_hero.Pos, npcID);
|
| | |
|
| | | // 目标点, 默认为主角坐标, 找不到任务终点的时候不移动
|
| | | Vector3 _destPos = _hero.Pos;
|
| | | MoveToExistNpc(npcID, _npc);
|
| | | }
|
| | | }
|
| | |
|
| | | // 计算当前坐标与目标角色的坐标差
|
| | | //GActor _npc = GAMgr.Instance.GetCloserNPC(_hero.Pos, npcID);
|
| | | //// 如果在当前地图找得到已创建出来最近的目标
|
| | | //if (_npc != null)
|
| | | //{
|
| | | // _destPos = _npc.Pos;
|
| | | //}
|
| | | //else
|
| | | //{
|
| | | Vector2 _calculPos = _destPos;
|
| | | if (_findLocation)
|
| | | private void MoveToExistNpc(int npcID, GActor npc)
|
| | | {
|
| | | GA_Hero _hero = PlayerDatas.Instance.hero;
|
| | |
|
| | | NPCConfig _config = Config.Instance.Get<NPCConfig>(npcID);
|
| | |
|
| | | // 目标点, 默认为主角坐标, 找不到任务终点的时候不移动
|
| | | Vector3 _destPos = _hero.Pos;
|
| | |
|
| | | // 获取NPC位置数据
|
| | | GAStaticDefine.NPCLocation _npcLocation;
|
| | | var _findLocation = GAStaticDefine.TryGetMapNPCLocation(npcID, out _npcLocation);
|
| | |
|
| | | Vector2 _calculPos = _destPos;
|
| | | if (_findLocation)
|
| | | {
|
| | | _calculPos = _npcLocation.position;
|
| | | }
|
| | | _destPos = new Vector3(_calculPos.x, _hero.Pos.y, _calculPos.y);
|
| | | //}
|
| | |
|
| | | // 判断距离
|
| | | float _distSqrt = MathUtility.DistanceSqrtXZ(_hero.Pos, _destPos);
|
| | |
|
| | | // 判断是否需要骑马移动
|
| | | if (_distSqrt > Mathf.Pow(7, 2))
|
| | | {
|
| | | DTC0428_tagPlayerRideHorse.Send_tagPlayerRideHorse(true);
|
| | | }
|
| | |
|
| | | float _chkDist = Mathf.Max(GeneralConfig.Instance.CloseNpcDist + _config.ModelRadius - 0.3f, 0);
|
| | |
|
| | | if (_config.NPCType == (int)E_NpcType.OpenWorldMap)
|
| | | {
|
| | | _chkDist = 1;
|
| | | }
|
| | |
|
| | | // 针对挖洞对象保持距离为0
|
| | | if (npc != null && _config.Dig == 1)
|
| | | {
|
| | | _chkDist = 0;
|
| | | }
|
| | |
|
| | | // 大于配置的距离, 移动至
|
| | | if (_distSqrt > Mathf.Pow(_chkDist, 2))
|
| | | {
|
| | | if (_config.NPCType == (int)E_NpcType.Fight)
|
| | | {
|
| | | _calculPos = _npcLocation.position;
|
| | | _hero.MoveToPosition(_destPos, _npcLocation.scope);
|
| | | }
|
| | | _destPos = new Vector3(_calculPos.x, _hero.Pos.y, _calculPos.y);
|
| | | //}
|
| | |
|
| | | // 判断距离
|
| | | float _distSqrt = MathUtility.DistanceSqrtXZ(_hero.Pos, _destPos);
|
| | |
|
| | | // 判断是否需要骑马移动
|
| | | if (_distSqrt > Mathf.Pow(7, 2))
|
| | | else
|
| | | {
|
| | | DTC0428_tagPlayerRideHorse.Send_tagPlayerRideHorse(true);
|
| | | if (npc != null)
|
| | | {
|
| | | _destPos = npc.Pos;
|
| | | }
|
| | |
|
| | | _hero.MoveToPosition(_destPos, _chkDist);
|
| | | }
|
| | |
|
| | | float _chkDist = Mathf.Max(GeneralConfig.Instance.CloseNpcDist + _config.ModelRadius - 0.3f, 0);
|
| | |
|
| | | if (_config.NPCType == (int)E_NpcType.OpenWorldMap)
|
| | | if (s_OnHeroStartMoveToNPC != null)
|
| | | {
|
| | | _chkDist = 1;
|
| | | s_OnHeroStartMoveToNPC();
|
| | | }
|
| | |
|
| | | // 针对挖洞对象保持距离为0
|
| | | if (_npc != null && _config.Dig == 1)
|
| | | {
|
| | | _chkDist = 0;
|
| | | }
|
| | |
|
| | | // 大于配置的距离, 移动至
|
| | | if (_distSqrt > Mathf.Pow(_chkDist, 2))
|
| | | }
|
| | | // 小于距离则判断目标的类型,执行相应的逻辑
|
| | | else
|
| | | {
|
| | | if (_config != null)
|
| | | {
|
| | | if (_config.NPCType == (int)E_NpcType.Fight)
|
| | | {
|
| | | _hero.MoveToPosition(_destPos, _npcLocation.scope);
|
| | | _hero.Behaviour.StartHandupAI();
|
| | | }
|
| | | else if (_config.NPCType == (int)E_NpcType.Collect)
|
| | | {
|
| | | GA_NpcCollect _collect = npc as GA_NpcCollect;
|
| | | if (_collect != null)
|
| | | {
|
| | | _collect.Arrive();
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (_npc != null)
|
| | | // 如果目标已经在之前搜索中确定了
|
| | | // 没确定其实在这里应该是异常情况
|
| | | if (npc != null)
|
| | | {
|
| | | _destPos = _npc.Pos;
|
| | | }
|
| | | _hero.LockTarget = npc;
|
| | | _hero.SelectTarget = npc;
|
| | |
|
| | | _hero.MoveToPosition(_destPos, _chkDist);
|
| | | }
|
| | | NPCInteractProcessor.InvokeEvent((E_NpcType)_config.NPCType, npcID, npc.ServerInstID);
|
| | |
|
| | | if (s_OnHeroStartMoveToNPC != null)
|
| | | {
|
| | | s_OnHeroStartMoveToNPC();
|
| | | }
|
| | | }
|
| | | // 小于距离则判断目标的类型,执行相应的逻辑
|
| | | else
|
| | | {
|
| | | if (_config != null)
|
| | | {
|
| | | if (_config.NPCType == (int)E_NpcType.Fight)
|
| | | {
|
| | | _hero.Behaviour.StartHandupAI();
|
| | | }
|
| | | else if (_config.NPCType == (int)E_NpcType.Collect)
|
| | | {
|
| | | GA_NpcCollect _collect = _npc as GA_NpcCollect;
|
| | | if (_collect != null)
|
| | | Vector3 _npc2heroDir = MathUtility.ForwardXZ(npc.Pos, _hero.Pos);
|
| | |
|
| | | if (_config.AutomaticFace == 1)
|
| | | {
|
| | | _collect.Arrive();
|
| | | npc.Forward = -_npc2heroDir;
|
| | | }
|
| | | _hero.Forward = _npc2heroDir;
|
| | | }
|
| | | // 会有为空的时候, 例如是小飞鞋飞的情况, 这里直接判断与配置的坐标的距离
|
| | | else
|
| | | {
|
| | | // 如果目标已经在之前搜索中确定了
|
| | | // 没确定其实在这里应该是异常情况
|
| | | if (_npc != null)
|
| | | {
|
| | | _hero.LockTarget = _npc;
|
| | | _hero.SelectTarget = _npc;
|
| | |
|
| | | NPCInteractProcessor.InvokeEvent((E_NpcType)_config.NPCType, npcID, _npc.ServerInstID);
|
| | |
|
| | | Vector3 _npc2heroDir = MathUtility.ForwardXZ(_npc.Pos, _hero.Pos);
|
| | |
|
| | | if (_config.AutomaticFace == 1)
|
| | | {
|
| | | _npc.Forward = -_npc2heroDir;
|
| | | }
|
| | | _hero.Forward = _npc2heroDir;
|
| | | }
|
| | | // 会有为空的时候, 例如是小飞鞋飞的情况, 这里直接判断与配置的坐标的距离
|
| | | else
|
| | | {
|
| | |
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | | else if (_npcConfig.NPCType == (int)E_NpcType.Collect)
|
| | | {
|
| | | float _chkDist = GeneralConfig.Instance.CloseNpcDist + _npcConfig.ModelRadius + 0.3f;
|
| | | if (_chkDistSqrt <= Mathf.Pow(_chkDist, 2))
|
| | | {
|
| | | if (!UserInputHandler.isTouched
|
| | | && (_hero.SkillMgr.CurCastSkill == null || _hero.SkillMgr.CurCastSkill.SkillCompelete))
|
| | | {
|
| | | NPCInteractProcessor.InvokeEvent(E_NpcType.Func, NpcID, _npc.ServerInstID);
|
| | | }
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | [SerializeField] FunctionButton functionButtonStrengthen;
|
| | | [SerializeField] FunctionButtonGroup funcBtnGroup;
|
| | |
|
| | | GodBeastModel beastModel { get { return ModelCenter.Instance.GetModel<GodBeastModel>(); } }
|
| | | DogzModel dogzModel { get { return ModelCenter.Instance.GetModel<DogzModel>(); } }
|
| | | protected override void BindController()
|
| | | {
|
| | |
| | | {
|
| | | dogzModel.SetDefaultSelectDogz();
|
| | | }
|
| | | else
|
| | | {
|
| | | if(dogzModel.presentSelectDogz == 0)
|
| | | {
|
| | | dogzModel.SetDefaultSelectDogz();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | protected override void OnActived()
|
| | | {
|
| | | base.OnActived();
|
| | | if(!WindowJumpMgr.Instance.IsJumpState && functionOrder == 0)
|
| | | {
|
| | | if(dogzModel.dogzFuncRedpoint.state != RedPointState.None)
|
| | | {
|
| | | functionOrder = functionButtonDogz.order;
|
| | | }
|
| | | else if(beastModel.redPointStre1.state != RedPointState.None)
|
| | | {
|
| | | functionOrder = functionButtonStrengthen.order;
|
| | | }
|
| | | }
|
| | | funcBtnGroup.TriggerByOrder(functionOrder);
|
| | | }
|
| | |
|
| | |
| | | private void OnDogzStrengthen()
|
| | | {
|
| | | CloseChild();
|
| | | functionOrder = 1;
|
| | | functionOrder = functionButtonStrengthen.order;
|
| | | WindowCenter.Instance.Open<GodBeastReinforcementWin>();
|
| | | }
|
| | |
|
| | | private void OnDogz()
|
| | | {
|
| | | CloseChild();
|
| | | functionOrder = 0;
|
| | | functionOrder = functionButtonDogz.order;
|
| | | WindowCenter.Instance.Open<DogzActiveWin>();
|
| | | }
|
| | |
|
| | |
| | | |
| | | private void UpdateRedpoint() |
| | | { |
| | | if (FuncOpen.Instance.IsFuncOpen(138)) |
| | | if (!FuncOpen.Instance.IsFuncOpen(138)) |
| | | { |
| | | redpoint.count = 0; |
| | | } |
| | |
| | | if(itemTipsModel.curAttrData.itemConfig.MaxSkillCnt > 0)
|
| | | {
|
| | | promptText.gameObject.SetActive(true);
|
| | | promptText.text = Language.Get("BoxUseCntTip",StringUtility.Contact(useCnt, "/", itemTipsModel.curAttrData.itemConfig.MaxSkillCnt));
|
| | | promptText.text = Language.Get("BoxUseCntTip", StringUtility.Contact(useCnt, "/", itemTipsModel.curAttrData.itemConfig.MaxSkillCnt));
|
| | | if (useCnt < itemTipsModel.curAttrData.itemConfig.MaxSkillCnt)
|
| | | {
|
| | | promptText.color = UIHelper.s_DarkGreenColor;
|
| | | }
|
| | | else
|
| | | {
|
| | | promptText.color = UIHelper.s_DarkRedColor;
|
| | | }
|
| | | |
| | | }
|
| | | else
|
| | | {
|
| | |
| | | yield return null;
|
| | | //this.transform.localScale = Vector3.one;
|
| | | //itemTipsModel.SetCommonTipPos(bgObj);
|
| | | bottomPart.gameObject.SetActive(false);
|
| | | bottomPart.gameObject.SetActive(true);
|
| | | bgObj.localPosition = Vector3.zero;
|
| | | tipAlpha.alpha = 1;
|
| | | }
|
| | |
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | this.transform.SetAsLastSibling();
|
| | | |
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | |
| | | {
|
| | | promptText.gameObject.SetActive(true);
|
| | | promptText.text = Language.Get("BoxUseCntTip", StringUtility.Contact(useCnt, "/", itemTipsModel.curAttrData.itemConfig.MaxSkillCnt));
|
| | | if (useCnt < itemTipsModel.curAttrData.itemConfig.MaxSkillCnt)
|
| | | {
|
| | | promptText.color = UIHelper.s_DarkGreenColor;
|
| | | }
|
| | | else
|
| | | {
|
| | | promptText.color = UIHelper.s_DarkRedColor;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | IEnumerator SetPanelScale()
|
| | | {
|
| | | yield return null;
|
| | | bottomPart.gameObject.SetActive(false);
|
| | | bottomPart.gameObject.SetActive(true);
|
| | | //itemTipsModel.SetCommonTipPos(bgObj);
|
| | | //this.transform.localScale = Vector3.one;
|
| | | tipAlpha.alpha = 1;
|
| | |
| | | if (m_DoubleToggle.isOn)
|
| | | {
|
| | | m_DoubleToggle.isOn = false;
|
| | | godBeastModel.IsToggleBool = false;
|
| | | }
|
| | | GodBeastReinforcementWin.ChooseToModify += ChooseToModify;
|
| | | godBeastModel.AbsorbEvent += AbsorbEvent;
|
| | |
| | |
|
| | | private void OnClickToggle(bool Isbool)
|
| | | {
|
| | | godBeastModel.IsToggleBool = Isbool;
|
| | | if (GodBeastNumber != 0 && GodBeastPart != 0)
|
| | | {
|
| | | AttributeAssignment();
|
| | |
| | | }
|
| | | if (m_DoubleToggle.isOn)//双倍强化
|
| | | {
|
| | | if (ListIndex.Count <= 0)
|
| | | {
|
| | | return;
|
| | | }
|
| | | if (NeedFairyJade <= 0)
|
| | | {
|
| | | dogz_model.SendDogzEquipStrength(m_DogZItemModel.itemInfo.ItemPlace, ListIndex, ListCount, 0);
|
| | | }
|
| | | else
|
| | | {
|
| | | int Gold = (int)UIHelper.GetMoneyCnt(1);//仙玉
|
| | | string strNull = string.Format(Language.Get("DogzDoubleRemind"), NeedFairyJade);
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), strNull, (bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | if (Gold >= NeedFairyJade)
|
| | | {
|
| | | dogz_model.SendDogzEquipStrength(m_DogZItemModel.itemInfo.ItemPlace, ListIndex, ListCount, 1);
|
| | | }
|
| | | else
|
| | | {
|
| | | if (VersionConfig.Get().isBanShu)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("GoldErr");
|
| | | return;
|
| | | }
|
| | | WindowCenter.Instance.Open<RechargeTipWin>();
|
| | | }
|
| | | }
|
| | | });
|
| | | }
|
| | | DoubleStrength(ListIndex, ListCount); |
| | | }
|
| | | else//单倍强化
|
| | | {
|
| | | if (ListIndex.Count <= 0)
|
| | | {
|
| | | return;
|
| | | }
|
| | | dogz_model.SendDogzEquipStrength(m_DogZItemModel.itemInfo.ItemPlace, ListIndex, ListCount, 0);
|
| | | SingleStrength(ListIndex, ListCount);//单倍强化
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | private void SingleStrength(List<int> ListIndex, List<int> ListCount)//单倍强化
|
| | | {
|
| | | if (ListIndex.Count <= 0)
|
| | | {
|
| | | return;
|
| | | }
|
| | | if (godBeastModel.IsNeedEquipment())
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("DogzStrengConfirm"), (bool isOk) => |
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | dogz_model.SendDogzEquipStrength(m_DogZItemModel.itemInfo.ItemPlace, ListIndex, ListCount, 0);
|
| | | }
|
| | | });
|
| | | }
|
| | | else
|
| | | {
|
| | | dogz_model.SendDogzEquipStrength(m_DogZItemModel.itemInfo.ItemPlace, ListIndex, ListCount, 0);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | private void DoubleStrength(List<int> ListIndex, List<int> ListCount)//双倍强化
|
| | | {
|
| | | if (ListIndex.Count <= 0)
|
| | | {
|
| | | return;
|
| | | }
|
| | | if (NeedFairyJade <= 0)//所需仙玉为0时
|
| | | {
|
| | | if (godBeastModel.IsNeedEquipment())
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("DogzStrengConfirm"), (bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | dogz_model.SendDogzEquipStrength(m_DogZItemModel.itemInfo.ItemPlace, ListIndex, ListCount, 0);
|
| | | }
|
| | | });
|
| | | }
|
| | | else
|
| | | {
|
| | | dogz_model.SendDogzEquipStrength(m_DogZItemModel.itemInfo.ItemPlace, ListIndex, ListCount, 0);
|
| | | }
|
| | | }
|
| | | else//所需仙玉不为0时
|
| | | {
|
| | | int Gold = (int)UIHelper.GetMoneyCnt(1);//仙玉
|
| | | string strNull = string.Format(Language.Get("DogzDoubleRemind"), NeedFairyJade);
|
| | | if (godBeastModel.IsNeedEquipment())
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("DogzStrengConfirm"), (bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), strNull, (bool is_Ok) =>
|
| | | {
|
| | | if (is_Ok)
|
| | | {
|
| | | if (Gold >= NeedFairyJade)
|
| | | {
|
| | | dogz_model.SendDogzEquipStrength(m_DogZItemModel.itemInfo.ItemPlace, ListIndex, ListCount, 1);
|
| | | }
|
| | | else
|
| | | {
|
| | | if (VersionConfig.Get().isBanShu)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("GoldErr");
|
| | | return;
|
| | | }
|
| | | WindowCenter.Instance.Open<RechargeTipWin>();
|
| | | }
|
| | | }
|
| | | });
|
| | | }
|
| | | });
|
| | | }
|
| | | else
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), strNull, (bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | if (Gold >= NeedFairyJade)
|
| | | {
|
| | | dogz_model.SendDogzEquipStrength(m_DogZItemModel.itemInfo.ItemPlace, ListIndex, ListCount, 1);
|
| | | }
|
| | | else
|
| | | {
|
| | | if (VersionConfig.Get().isBanShu)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("GoldErr");
|
| | | return;
|
| | | }
|
| | | WindowCenter.Instance.Open<RechargeTipWin>();
|
| | | }
|
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | |
| | | }
|
| | | private void ChooseToModify(int locationMarker)
|
| | | {
|
| | | GetGodBeastLocationMarker(locationMarker);
|
| | |
| | | if (IudetDogzEquipPlus != null)
|
| | | {
|
| | | SingleProficiency += IudetDogzEquipPlus[1];
|
| | | DoubleProficiency += itemModel.chinItemModel.EffectValueA1;
|
| | | DoubleProficiency += IudetDogzEquipPlus[1]+ itemModel.chinItemModel.EffectValueA1;
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | return SiteEnhancementAttributeDic;
|
| | | }
|
| | |
|
| | | public int DogZBagIndex = 0;
|
| | | public int DogZBagIndex = 0;//当前强化的装备下标
|
| | | public bool IsToggleBool = false;
|
| | | public bool IsFullLevel()//是都满级能够继续吸收
|
| | | {
|
| | | bool IsBool = false;
|
| | | int DogZLV = 0;//获取当前神兽等级
|
| | | int DogProficiency = 0;//当前神兽的熟练度
|
| | | int SingleProficiency = 0;//单倍熟练度
|
| | |
| | | {
|
| | | return false;
|
| | | }
|
| | | int lv = QualityLimit[itemModel.chinItemModel.ItemColor];
|
| | | int lv = QualityLimit[itemModel.chinItemModel.ItemColor];//获取最大强化等级
|
| | | var DogzEquipMaxConfig = DogzEquipPlusConfig.GetEquipplaceAndLevel(itemModel.chinItemModel.EquipPlace, lv);
|
| | | var IudetDogzEquipPlus = itemModel.GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus);
|
| | |
|
| | |
| | | {
|
| | | DogZLV = IudetDogzEquipPlus[0];
|
| | | DogProficiency = IudetDogzEquipPlus[1];
|
| | | }
|
| | | if (DogZLV >= lv)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | foreach (var key in Absorption_Dic.Keys)
|
| | | {
|
| | |
| | | if (_IudetDogzEquipPlus != null)
|
| | | {
|
| | | SingleProficiency += _IudetDogzEquipPlus[1];
|
| | | DoubleProficiency += item_Model.chinItemModel.EffectValueA1;
|
| | | DoubleProficiency += item_Model.chinItemModel.EffectValueA1+ _IudetDogzEquipPlus[1];
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | if (true)
|
| | | if (IsToggleBool)//双倍熟练度
|
| | | {
|
| | | if (DogProficiency + DoubleProficiency >= DogzEquipMaxConfig.upExpTotal)
|
| | | {
|
| | | return true;
|
| | | return true;//已满
|
| | | }
|
| | | else
|
| | | {
|
| | | return false;
|
| | | return false;//未满
|
| | | }
|
| | | }
|
| | | else
|
| | | else//单倍熟练度
|
| | | {
|
| | | if (DogProficiency + SingleProficiency >= DogzEquipMaxConfig.upExpTotal)
|
| | | {
|
| | | return true;
|
| | | return true;//已满
|
| | | }
|
| | | else
|
| | | {
|
| | | return false;
|
| | | return false;//未满
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public bool IsNeedEquipment()//是否有极品装备需要弹框
|
| | | {
|
| | | bool IsBool = false;
|
| | | foreach (var key in Absorption_Dic.Keys)
|
| | | {
|
| | | ItemModel itemModel = playerPack.GetItemModelByIndex(PackType.rptDogzItem, key);
|
| | | if (itemModel != null)
|
| | | {
|
| | | if (itemModel.chinItemModel.EquipPlace > 0 && itemModel.chinItemModel.ItemColor >= 5)
|
| | | {
|
| | | IsBool = true;
|
| | | }
|
| | | }
|
| | | |
| | | }
|
| | | return IsBool;
|
| | | }
|
| | | } |
| | | |
| | | |
| | |
| | | public int Proficiency;//熟练度
|
| | | public int EquipScore;//装备评分
|
| | | public int Part;//装备位
|
| | | public int Count;//数量
|
| | | } |
| | | |
| | | public class GodBeastSlidingList : MonoBehaviour
|
| | |
| | | {
|
| | | m_ToggleAll.isOn = false;
|
| | | }
|
| | | GetGodBeastBag();
|
| | | FilterQuality();
|
| | | GetGodBeastBag();//获取神兽背包数据排序
|
| | | FilterQuality();//分类筛选
|
| | | godBeastModel.AbsorbEventUpdate();
|
| | | m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
|
| | | });
|
| | |
| | | {
|
| | | m_ToggleAll.isOn = false;
|
| | | }
|
| | | GetGodBeastBag();
|
| | | FilterQuality();
|
| | | GetGodBeastBag();//获取神兽背包数据排序
|
| | | FilterQuality();//分类筛选
|
| | | godBeastModel.AbsorbEventUpdate();
|
| | | m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
|
| | | });
|
| | |
| | | {
|
| | | m_ToggleAll.isOn = false;
|
| | | }
|
| | | GetGodBeastBag();
|
| | | FilterQuality();
|
| | | GetGodBeastBag();//获取神兽背包数据排序
|
| | | FilterQuality();//分类筛选
|
| | | godBeastModel.AbsorbEventUpdate();
|
| | | m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
|
| | | });
|
| | |
| | | {
|
| | | m_ToggleAll.isOn = false;
|
| | | }
|
| | | GetGodBeastBag();
|
| | | FilterQuality();
|
| | | GetGodBeastBag();//获取神兽背包数据排序
|
| | | FilterQuality();//分类筛选
|
| | | godBeastModel.AbsorbEventUpdate();
|
| | | m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
|
| | | });
|
| | |
| | | {
|
| | | m_ToggleAll.isOn = false;
|
| | | }
|
| | | GetGodBeastBag();
|
| | | FilterQuality();
|
| | | GetGodBeastBag();//获取神兽背包数据排序
|
| | | FilterQuality();//分类筛选
|
| | | godBeastModel.AbsorbEventUpdate();
|
| | | m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
|
| | | });
|
| | |
| | | playerPack.ItemCntAddAct += RefreshItemCountAct;
|
| | | }
|
| | |
|
| | | |
| | |
|
| | |
|
| | | private void OnDisable()
|
| | | {
|
| | |
| | | playerPack.ItemCntAddAct -= RefreshItemCountAct;
|
| | | }
|
| | |
|
| | | |
| | |
|
| | |
|
| | | public void Init()
|
| | | {
|
| | |
| | | {
|
| | | if ((int)obj.MakeType == (int)MakeType.Def_mitDogzEquipPlus)
|
| | | {
|
| | | |
| | |
|
| | | }
|
| | | }
|
| | | private void RefreshItemCountAct(PackType arg1, int arg2, int arg3)
|
| | |
| | | godBeastBagClass.Star = itemModel.chinItemModel.StarLevel;
|
| | | godBeastBagClass.EquipScore = itemModel.equipScore;
|
| | | godBeastBagClass.Part = itemModel.EquipPlace;
|
| | | godBeastBagClass.Count = itemModel.itemInfo.ItemCount;
|
| | | var IudetDogzEquipPlus = itemModel.GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus);// 神兽装备强化信息列表 [强化等级, 强化熟练度]
|
| | | if (IudetDogzEquipPlus == null)
|
| | | {
|
| | |
| | | {
|
| | | for (int k = 0; k < GodBeastBagList.Count; k++)
|
| | | {
|
| | | godBeastModel.Absorption_Dic.Add(GodBeastBagList[k].Index, 1);
|
| | | for (int j = 0; j < GodBeastBagList[k].Count; j++)
|
| | | {
|
| | | if (!godBeastModel.IsFullLevel())
|
| | | {
|
| | | if (!godBeastModel.Absorption_Dic.ContainsKey(GodBeastBagList[k].Index))
|
| | | {
|
| | | godBeastModel.Absorption_Dic.Add(GodBeastBagList[k].Index, 1);
|
| | | }
|
| | | else
|
| | | {
|
| | | int Type = j + 1;
|
| | | godBeastModel.Absorption_Dic[GodBeastBagList[k].Index] = Type;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | return;
|
| | | } |
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | | GodBeastChildNodes.GetGodBeastIndex(godBeastBagClass.Index);
|
| | | GodBeastChildNodes.ButtonDown.AddListener(() =>
|
| | | { |
| | | {
|
| | | if (itemModel.EquipPlace > 0)//选中的物品为装备
|
| | | {
|
| | | if (godBeastModel.Absorption_Dic.ContainsKey(godBeastBagClass.Index))
|