Merge branch 'master' into 3687天赋功能
Conflicts:
System/WindowBase/ModelCenter.cs
| | |
| | | Register(typeof(HA814_tagMCMakeItemAnswer), typeof(DTCA814_tagMCMakeItemAnswer)); //得到合成结果回应
|
| | | Register(typeof(HA317_tagMCAllEquipAttrActiveInfo), typeof(DTCA317_tagMCAllEquipAttrActiveInfo)); //得到激活全身星级和全身强化的信息
|
| | | Register(typeof(HA321_tagMCPrayElixirResult), typeof(DTCA321_tagMCPrayElixirResult)); //祈福丹药结果
|
| | |
|
| | | Register(typeof(HA921_tagUpdatePlayerNameResult), typeof(DTCA921_tagUpdatePlayerNameResult)); //玩家改名
|
| | | #region 背包
|
| | | Register(typeof(H0724_tagRolePackCanUseCount), typeof(DTC0724_tagRolePackCanUseCount));
|
| | | Register(typeof(H0704_tagRolePackRefresh), typeof(DTC0704_tagRolePackRefresh));
|
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Saturday, January 06, 2018 |
| | | // [ Date ]: Thursday, September 27, 2018 |
| | | //-------------------------------------------------------- |
| | | |
| | | using UnityEngine; |
| | |
| | | fileFormatVersion: 2 |
| | | guid: fe03774548a971a4186f518d32a9833c |
| | | timeCreated: 1515213454 |
| | | licenseType: Pro |
| | | timeCreated: 1538035356 |
| | | licenseType: Free |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | |
| | | bool isPlaying = true;
|
| | |
|
| | | bool m_Inited = false;
|
| | | public bool inited
|
| | | {
|
| | | public bool inited {
|
| | | get { return m_Inited; }
|
| | | private set { m_Inited = value; }
|
| | | }
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | path = StringUtility.Contact(ResourcesPath.Instance.ExternalStorePath, "config/", fileName, ".txt");
|
| | | path = AssetVersionUtility.GetAssetFilePath(StringUtility.Contact("config/", fileName, ".txt"));
|
| | | }
|
| | |
|
| | | var task = new ConfigTask(typeof(T), AssetSource.refdataFromEditor ? AssetPath.ResourceOut : AssetPath.External, path);
|
| | |
| | | public partial class BossInfoConfig : ConfigBase, IConfigPostProcess
|
| | | { |
| | | private static Dictionary<int, BossInfoConfig> bossInfoDict = new Dictionary<int, BossInfoConfig>(); |
| | | private static List<int> stoneIds = new List<int>(); |
| | | |
| | | public void OnConfigParseCompleted()
|
| | | {
|
| | | if (!bossInfoDict.ContainsKey(StoneNPCID))
|
| | | {
|
| | | bossInfoDict.Add(StoneNPCID, this);
|
| | | }
|
| | |
|
| | | if (!stoneIds.Contains(StoneNPCID)) |
| | | { |
| | | stoneIds.Add(StoneNPCID); |
| | | }
|
| | | }
|
| | |
|
| | |
| | | return null;
|
| | | }
|
| | |
|
| | | public static bool IsStone(int npcId)
|
| | | {
|
| | | return stoneIds.Contains(npcId);
|
| | | }
|
| | |
|
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 07973e7d7a8d7dc499729078a1b20c19 |
| | | folderAsset: yes |
| | | timeCreated: 1538027291 |
| | | licenseType: Pro |
| | | DefaultImporter: |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | //A1 22 角色改名 #tagUpdatePlayerName
|
| | |
|
| | | public class CA122_tagUpdatePlayerName : GameNetPackBasic {
|
| | | public byte NewNameLen;
|
| | | public string NewName;
|
| | | public byte ItemIndex; //改名物品在背包中的位置
|
| | | public uint ServerID;
|
| | |
|
| | | public CA122_tagUpdatePlayerName () {
|
| | | combineCmd = (ushort)0x03FE;
|
| | | _cmd = (ushort)0xA122;
|
| | | }
|
| | |
|
| | | public override void WriteToBytes () {
|
| | | WriteBytes (NewNameLen, NetDataType.BYTE);
|
| | | WriteBytes (NewName, NetDataType.Chars, NewNameLen);
|
| | | WriteBytes (ItemIndex, NetDataType.BYTE);
|
| | | WriteBytes (ServerID, NetDataType.DWORD);
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: f1760446cb920c8429e4e5a021a6452b |
| | | timeCreated: 1538027291 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // A5 17 绑玉转盘开始 #tagCMStartBindJadeWheel
|
| | |
|
| | | public class CA517_tagCMStartBindJadeWheel : GameNetPackBasic {
|
| | |
|
| | | public CA517_tagCMStartBindJadeWheel () {
|
| | | combineCmd = (ushort)0x03FE;
|
| | | _cmd = (ushort)0xA517;
|
| | | }
|
| | |
|
| | | public override void WriteToBytes () {
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 7c268dd5f343f6c49b4c2621de591e6f |
| | | timeCreated: 1538032691 |
| | | licenseType: Free |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | DEBUG_STEP = 0;
|
| | | DTC0403_tagPlayerLoginLoadOK.neverLoginOk = true;
|
| | |
|
| | | MapTransferUtility.Instance.lastMoveToWorldBossTime = float.MinValue;
|
| | | MapTransferUtility.Instance.lastMoveToWorldBossNpcID = 0;
|
| | |
|
| | | if (beforePlayerDataInitializeEvent != null)
|
| | | {
|
| | | beforePlayerDataInitializeEvent();
|
| | |
| | | {
|
| | | Debug.LogError(ex);
|
| | | }
|
| | |
|
| | |
|
| | | if (vNetData.LV == 1)
|
| | | {
|
| | |
| | | {
|
| | | _hero.StopAll();
|
| | | _hero.InitBornPos(vNetData.PosX, vNetData.PosY);
|
| | | _hero.RequestName();
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | case 31230: |
| | | |
| | | break; |
| | | case 31160: |
| | | BattleHint.Instance.UpdateDungeonHelp(); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | |
| | | return;
|
| | | }
|
| | |
|
| | | if (BossInfoConfig.IsStone((int)vNetData.NPCID))
|
| | | {
|
| | | BossFakeLineUtility.Instance.RecordSawStone((int)vNetData.NPCID, PlayerDatas.Instance.baseData.FBID);
|
| | | }
|
| | |
|
| | | if (GA_PlayerXMZZ.xmzzDict.ContainsKey(vNetData.NPCID))
|
| | | {
|
| | | _actor = GAMgr.Instance.RequestPlayer<GA_PlayerXMZZ>(vNetData.ObjID, E_ActorGroup.Player, vNetData);
|
| | |
| | |
|
| | | 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.inMistakeForBossAliveOverTime = Time.realtimeSinceStartup + 61;
|
| | | BossFakeLineUtility.Instance.lastBossNpcID = vNetData.NPCID;
|
| | | 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);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | GActorPlayerBase _player = GAMgr.Instance.GetBySID(vNetData.PlayerID) as GActorPlayerBase; |
| | | if (_player != null) |
| | | { |
| | | _player.SwitchTitle(vNetData.GradID); |
| | | var titleId = PlayerDatas.Instance.baseData.MapID == 31160 ? 0 : vNetData.GradID;//上古战场不显示称号
|
| | | _player.SwitchTitle(titleId);
|
| | | } |
| | | } |
| | | |
| | |
| | | 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)
|
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | | using Snxxz.UI;
|
| | |
|
| | | // A3 24 通知绑玉转盘结果 #tagMCBindJadeWheelResult
|
| | |
|
| | |
|
| | |
|
| | | public class DTCA324_tagMCBindJadeWheelResult : DtcBasic {
|
| | |
|
| | | WheelOfFortuneModel wheelOfFortuneModel { get { return ModelCenter.Instance.GetModel<WheelOfFortuneModel>(); } }
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | base.Done(vNetPack);
|
| | | HA324_tagMCBindJadeWheelResult vNetData = vNetPack as HA324_tagMCBindJadeWheelResult;
if (vNetData == null)
|
| | | {
|
| | | return;
|
| | | }
wheelOfFortuneModel.BindJadeWheelResult(vNetData);
|
| | | }
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: a0cbd69e7afc2474c8fd98b86348e72f |
| | | timeCreated: 1538032691 |
| | | licenseType: Free |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | | using Snxxz.UI;
|
| | | //A9 21 角色改名结果 #tagUpdatePlayerNameResult
|
| | |
|
| | |
|
| | |
|
| | | public class DTCA921_tagUpdatePlayerNameResult : DtcBasic {
|
| | |
|
| | | RoleModel roleModel { get { return ModelCenter.Instance.GetModel<RoleModel>(); } }
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | |
|
| | | base.Done(vNetPack);
|
| | |
|
| | | HA921_tagUpdatePlayerNameResult vNetData = vNetPack as HA921_tagUpdatePlayerNameResult;
|
| | | roleModel.ServerRenameResult(vNetData);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 104734d3ab0b9eb4282d52f46be5f76c |
| | | timeCreated: 1538027291 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // A3 24 通知绑玉转盘结果 #tagMCBindJadeWheelResult
|
| | |
|
| | | public class HA324_tagMCBindJadeWheelResult : GameNetPackBasic {
|
| | | public byte Index; // 格子
|
| | | public byte Cnt; //今日已转次数
|
| | |
|
| | | public HA324_tagMCBindJadeWheelResult () {
|
| | | _cmd = (ushort)0xA324;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out Index, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out Cnt, vBytes, NetDataType.BYTE);
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: d6ba1d40695294e48abc2835e49bc818 |
| | | timeCreated: 1538032691 |
| | | licenseType: Free |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | //A9 21 角色改名结果 #tagUpdatePlayerNameResult
|
| | |
|
| | | public class HA921_tagUpdatePlayerNameResult : GameNetPackBasic {
|
| | | public byte Result; //角色改名结果
|
| | |
|
| | | public HA921_tagUpdatePlayerNameResult () {
|
| | | _cmd = (ushort)0xA921;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out Result, vBytes, NetDataType.BYTE);
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 658f4d57fa7989c47ab85b6bdaf40211 |
| | | timeCreated: 1538027291 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | DTC0102_tagCDBPlayer.switchAccountEvent += OnAccountSwitch; |
| | | } |
| | | |
| | | //这个值在初见boss和最后看见boss的时候记录,其值为time.time+1分钟,这段时间内告诉玩家其所在分线的boss的死亡情况,否则告诉玩家公共boss的死亡情况。 |
| | | public uint lastBossNpcID; |
| | | public float inMistakeForBossAliveOverTime = 0f; |
| | | public int recordBossId { get { return bossSawRecorder.npcId; } } |
| | | NpcSawRecorder bossSawRecorder = new NpcSawRecorder(); |
| | | NpcSawRecorder stoneSawRecorder = new NpcSawRecorder(); |
| | | |
| | | public bool IsShuntBoss(int _bossId) |
| | | { |
| | |
| | | var tombstoneId = bossInfoConfig.StoneNPCID; |
| | | return GAMgr.Instance.GetCloserNPC(PlayerDatas.Instance.hero.Pos, tombstoneId) != null; |
| | | } |
| | | } |
| | | |
| | | 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) |
| | | { |
| | | return stoneSawRecorder.HasSawRecently(config.StoneNPCID, lineId, 60); |
| | | } |
| | | else |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | public void ClearStoneRecord() |
| | | { |
| | | stoneSawRecorder.Clear(); |
| | | } |
| | | |
| | | public void RecordSawBoss(int bossId, int lineId) |
| | | { |
| | | bossSawRecorder.Record(bossId, lineId, Time.realtimeSinceStartup); |
| | | } |
| | | |
| | | public bool HasSawBossRecently(int bossId) |
| | | { |
| | | return stoneSawRecorder.HasSawRecently(bossId, 60); |
| | | } |
| | | |
| | | public bool HasSawLineBossRecently(int bossId, int lineId) |
| | | { |
| | | return bossSawRecorder.HasSawRecently(bossId, lineId, 60); |
| | | } |
| | | |
| | | 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
|
| | |
| | | var titleModel = ModelCenter.Instance.GetModel<TitleModel>();
|
| | | var _title = titleModel.GetTitleEquip();
|
| | | uint _titleID = 0;
|
| | | if (_title != null && titleModel.IsTitleGain(_title.id))
|
| | | if (_title != null && titleModel.IsTitleGain(_title.id)
|
| | | && PlayerDatas.Instance.baseData.MapID != 31160)//上古战场不显示称号
|
| | | {
|
| | | _titleID = (uint)_title.id;
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | base.SetFairyLeagueHeadUp(PlayerDatas.Instance.baseData.MapID == FairyLeagueModel.FAIRY_LEAGUE_DUNGEON);
|
| | | CheckAncientHeadUp();
|
| | | }
|
| | |
|
| | | public sealed override void SwitchRedName(bool on)
|
| | |
| | | {
|
| | | 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
|
| | | {
|
| | |
| | | m_HeadUpName = HeadUpName.RequireHeadUpName(HeadUpName.Pattern.Player, MP_Name, 0, CameraController.Instance.CameraObject);
|
| | | }
|
| | |
|
| | | m_HeadUpName.SetPlayerInfo((int)ActorInfo.realm, ActorInfo.titleID, ActorInfo.PlayerName, ActorInfo.familyName, m_H0434.State == 1);
|
| | | var titleId = PlayerDatas.Instance.baseData.MapID == 31160 ? 0 : ActorInfo.titleID;
|
| | | m_HeadUpName.SetPlayerInfo((int)ActorInfo.realm, titleId, ActorInfo.PlayerName, ActorInfo.familyName, m_H0434.State == 1);
|
| | |
|
| | | if (StatusMgr.Instance.IsExist(ServerInstID, StatusMgr.Instance.bossBelongBuffID))
|
| | | {
|
| | |
| | | }
|
| | |
|
| | | base.SetFairyLeagueHeadUp(PlayerDatas.Instance.baseData.MapID == FairyLeagueModel.FAIRY_LEAGUE_DUNGEON);
|
| | | CheckAncientHeadUp();
|
| | | }
|
| | |
|
| | | public sealed override void SwitchRedName(bool on)
|
| | |
| | |
|
| | | public JobSetupConfig JobSetup { get; protected set; }
|
| | |
|
| | | DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | |
|
| | | public override int NextAction
|
| | | {
|
| | | get
|
| | |
| | | MovingState = E_MovingState.Normal;
|
| | |
|
| | | SystemSetting.Instance.qualityLevelChangeEvent += OnGameQualityChange;
|
| | | dungeonModel.updateMissionEvent += CheckAncientHeadUp;
|
| | | base.OnInit(package);
|
| | | }
|
| | |
|
| | |
| | | JobSetup = null;
|
| | |
|
| | | SystemSetting.Instance.qualityLevelChangeEvent -= OnGameQualityChange;
|
| | | dungeonModel.updateMissionEvent -= CheckAncientHeadUp;
|
| | |
|
| | | base.OnUnit();
|
| | | }
|
| | |
| | | protected override void OnLateUpdate()
|
| | | {
|
| | | UpdateRush();
|
| | | }
|
| | |
|
| | | public void CheckAncientHeadUp()
|
| | | {
|
| | | if (PlayerDatas.Instance.baseData.MapID == 31160)
|
| | | {
|
| | | var help = dungeonModel.mission;
|
| | | SwitchAncientKing(help.topPlayerID == ServerInstID);
|
| | | SwitchAncientEnemy(help.enemyID == ServerInstID && ServerInstID != PlayerDatas.Instance.baseData.PlayerID);
|
| | | }
|
| | | else
|
| | | {
|
| | | SwitchAncientKing(false);
|
| | | SwitchAncientEnemy(false);
|
| | | }
|
| | | }
|
| | |
|
| | | #region 装备穿戴相关
|
| | |
| | | m_HeadUpName.SetFairyLeague(on, ActorInfo.faction);
|
| | | }
|
| | |
|
| | | public void SwitchAncientKing(bool on)
|
| | | {
|
| | | if (m_HeadUpName == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | m_HeadUpName.SetAncientKing(on);
|
| | | }
|
| | |
|
| | | public void SwitchAncientEnemy(bool on)
|
| | | {
|
| | | if (m_HeadUpName == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | m_HeadUpName.SetAncientEnemy(on);
|
| | | }
|
| | |
|
| | | public virtual void SwitchYellowName(bool on)
|
| | | {
|
| | | if (m_HeadUpName == null)
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public void MoveToNPC(int npcID)
|
| | | 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
|
| | | {
|
| | | //Debug.LogFormat(" |-- 在本地图");
|
| | | if (PlayerDatas.Instance.baseData.FBID != 0)
|
| | | {
|
| | | if (BossFakeLineUtility.Instance.IsShuntBoss(npcID))
|
| | | {
|
| | | //Debug.LogFormat(" |-- BossFakeLineUtility.Instance.makeFakeLineTimes = 1");
|
| | | BossFakeLineUtility.Instance.makeFakeLineTimes = 1;
|
| | | }
|
| | | }
|
| | | // Debug.LogFormat("lastMoveToWorldBossNpcID: {0}, Time: {1}, FBID: {2}, showFakeLine: {3}, FairyBoss: {4}",
|
| | | // lastMoveToWorldBossNpcID,
|
| | | // Time.realtimeSinceStartup - lastMoveToWorldBossTime,
|
| | | // PlayerDatas.Instance.baseData.FBID,
|
| | | // BossFakeLineUtility.Instance.showFakeLine,
|
| | | // _fairyBossModel.bosses != null
|
| | | // && _fairyBossModel.bosses.Contains(npcID));
|
| | |
|
| | | if (((lastMoveToWorldBossNpcID == npcID
|
| | | && Time.realtimeSinceStartup - lastMoveToWorldBossTime < 60)
|
| | |
| | | else
|
| | | {
|
| | | // 处于相同地图
|
| | | if (BossFakeLineUtility.Instance.lastBossNpcID != npcID
|
| | | || Time.realtimeSinceStartup - BossFakeLineUtility.Instance.inMistakeForBossAliveOverTime > 60)
|
| | | if (!BossFakeLineUtility.Instance.HasSawBossRecently(npcID))
|
| | | {
|
| | | if (BossFakeLineUtility.Instance.IsShuntBoss(npcID))
|
| | | {
|
| | | //Debug.LogFormat(" |-- BossFakeLineUtility.Instance.makeFakeLineTimes = 1");
|
| | | BossFakeLineUtility.Instance.makeFakeLineTimes = 1;
|
| | | }
|
| | |
|
| | | //Debug.LogFormat(" |-- 非想去的boss记录,或则见到boss时差超过60秒");
|
| | | Send_WorldTransfer(_npcLocation.mapId, new Vector3(_hero.Pos.x * 2, 0, _hero.Pos.z * 2), MapTransferType.WorldTransport, 0, npcID);
|
| | | }
|
| | |
| | | {
|
| | | _npc = GAMgr.Instance.GetCloserNPC(_hero.Pos, npcID);
|
| | |
|
| | | MoveToExistNpc(npcID, _npc);
|
| | | }
|
| | | }
|
| | |
|
| | | private void MoveToExistNpc(int npcID, GActor npc)
|
| | | {
|
| | | GA_Hero _hero = PlayerDatas.Instance.hero;
|
| | |
|
| | | NPCConfig _config = Config.Instance.Get<NPCConfig>(npcID);
|
| | |
|
| | | // 目标点, 默认为主角坐标, 找不到任务终点的时候不移动
|
| | | Vector3 _destPos = _hero.Pos;
|
| | |
|
| | | // 计算当前坐标与目标角色的坐标差
|
| | | //GActor _npc = GAMgr.Instance.GetCloserNPC(_hero.Pos, npcID);
|
| | | //// 如果在当前地图找得到已创建出来最近的目标
|
| | | //if (_npc != null)
|
| | | //{
|
| | | // _destPos = _npc.Pos;
|
| | | //}
|
| | | //else
|
| | | //{
|
| | | // 获取NPC位置数据
|
| | | GAStaticDefine.NPCLocation _npcLocation;
|
| | | var _findLocation = GAStaticDefine.TryGetMapNPCLocation(npcID, out _npcLocation);
|
| | |
|
| | | Vector2 _calculPos = _destPos;
|
| | | if (_findLocation)
|
| | | {
|
| | |
| | | }
|
| | |
|
| | | // 针对挖洞对象保持距离为0
|
| | | if (_npc != null && _config.Dig == 1)
|
| | | if (npc != null && _config.Dig == 1)
|
| | | {
|
| | | _chkDist = 0;
|
| | | }
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | if (_npc != null)
|
| | | if (npc != null)
|
| | | {
|
| | | _destPos = _npc.Pos;
|
| | | _destPos = npc.Pos;
|
| | | }
|
| | |
|
| | | _hero.MoveToPosition(_destPos, _chkDist);
|
| | |
| | | }
|
| | | else if (_config.NPCType == (int)E_NpcType.Collect)
|
| | | {
|
| | | GA_NpcCollect _collect = _npc as GA_NpcCollect;
|
| | | GA_NpcCollect _collect = npc as GA_NpcCollect;
|
| | | if (_collect != null)
|
| | | {
|
| | | _collect.Arrive();
|
| | |
| | | {
|
| | | // 如果目标已经在之前搜索中确定了
|
| | | // 没确定其实在这里应该是异常情况
|
| | | if (_npc != null)
|
| | | if (npc != null)
|
| | | {
|
| | | _hero.LockTarget = _npc;
|
| | | _hero.SelectTarget = _npc;
|
| | | _hero.LockTarget = npc;
|
| | | _hero.SelectTarget = npc;
|
| | |
|
| | | NPCInteractProcessor.InvokeEvent((E_NpcType)_config.NPCType, npcID, _npc.ServerInstID);
|
| | | NPCInteractProcessor.InvokeEvent((E_NpcType)_config.NPCType, npcID, npc.ServerInstID);
|
| | |
|
| | | Vector3 _npc2heroDir = MathUtility.ForwardXZ(_npc.Pos, _hero.Pos);
|
| | | Vector3 _npc2heroDir = MathUtility.ForwardXZ(npc.Pos, _hero.Pos);
|
| | |
|
| | | if (_config.AutomaticFace == 1)
|
| | | {
|
| | | _npc.Forward = -_npc2heroDir;
|
| | | 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
|
| | | {
|
| | |
| | | _hero.IdleImmediate();
|
| | |
|
| | | _hero.SetFairyLeagueHeadUp(PlayerDatas.Instance.baseData.MapID == FairyLeagueModel.FAIRY_LEAGUE_DUNGEON);
|
| | | _hero.CheckAncientHeadUp();
|
| | | var titleId = 0;
|
| | | if (PlayerDatas.Instance.baseData.MapID != 31160)
|
| | | {
|
| | | var titelModel = ModelCenter.Instance.GetModel<TitleModel>();
|
| | | var title = titelModel.GetTitleEquip();
|
| | | titleId = title != null && titelModel.IsTitleGain(title.id) ? title.id : 0;
|
| | | }
|
| | | _hero.SwitchTitle((uint)titleId);
|
| | |
|
| | | // 判断buff
|
| | | if (StatusMgr.Instance.IsExist(PlayerDatas.Instance.PlayerId, StatusMgr.Instance.redNameBuffID))
|
| | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | namespace Snxxz.UI { |
| | | namespace Snxxz.UI
|
| | | {
|
| | | |
| | | |
| | | public class ActivitySettleWin : Window |
| | |
| | | [SerializeField] Button rewardGetBtn; |
| | | |
| | | DungeonModel m_DungeonModel; |
| | | DungeonModel dungeonModel { |
| | | get { |
| | | DungeonModel dungeonModel
|
| | | {
|
| | | get
|
| | | {
|
| | | return m_DungeonModel ?? (m_DungeonModel = ModelCenter.Instance.GetModel<DungeonModel>()); |
| | | } |
| | | } |
| | |
| | | |
| | | void ShowActivityReward() |
| | | { |
| | | foreach (var item in achieveItemCells) { |
| | | foreach (var item in achieveItemCells)
|
| | | {
|
| | | item.gameObject.SetActive(false); |
| | | } |
| | | foreach (var item in activityItemCells) { |
| | | foreach (var item in activityItemCells)
|
| | | {
|
| | | item.gameObject.SetActive(false); |
| | | } |
| | | var actiivityItems = dungeonModel.dungeonResult.itemInfo; |
| | | bool hasReward = actiivityItems != null && actiivityItems.Length > 0; |
| | | container_ActivityReward.gameObject.SetActive(hasReward); |
| | | activityNullReawrd.SetActive(!hasReward); |
| | | if (hasReward) { |
| | | for (int i = 0; i < actiivityItems.Length; i++) { |
| | | if (hasReward)
|
| | | {
|
| | | for (int i = 0; i < actiivityItems.Length; i++)
|
| | | {
|
| | | if (i < activityItemCells.Count)
|
| | | {
|
| | | activityItemCells[i].gameObject.SetActive(true); |
| | | ItemCell itemCell = activityItemCells[i]; |
| | | ServerItem serverItem = actiivityItems[i]; |
| | |
| | | ,"",PackType.rptDeleted,false,ConfigParse.Analysis(serverItem.UserData)); |
| | | itemCell.Init(cellModel); |
| | | itemCell.cellBtn.RemoveAllListeners(); |
| | | itemCell.cellBtn.AddListener(() => { |
| | | itemCell.cellBtn.AddListener(() =>
|
| | | {
|
| | | ShowItemDetails(serverItem); |
| | | }); |
| | | }
|
| | | } |
| | | } |
| | | |
| | |
| | | hasReward = achieveItems != null && achieveItems.Length > 0; |
| | | container_AchieveReward.gameObject.SetActive(hasReward); |
| | | achieveNullReawrd.SetActive(!hasReward); |
| | | if (hasReward) { |
| | | for (int i = 0; i < achieveItems.Length; i++) { |
| | | if (hasReward)
|
| | | {
|
| | | for (int i = 0; i < achieveItems.Length; i++)
|
| | | {
|
| | | if (i < achieveItemCells.Count)
|
| | | {
|
| | | achieveItemCells[i].gameObject.SetActive(true); |
| | | ItemCell itemCell = achieveItemCells[i]; |
| | | ServerItem serverItem = achieveItems[i]; |
| | |
| | | ,"" ,PackType.rptDeleted,false,ConfigParse.Analysis(serverItem.UserData)); |
| | | itemCell.Init(cellModel); |
| | | itemCell.cellBtn.RemoveAllListeners(); |
| | | itemCell.cellBtn.AddListener(() => { |
| | | itemCell.cellBtn.AddListener(() =>
|
| | | {
|
| | | ShowItemDetails(serverItem); |
| | | }); |
| | | }
|
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | private void ShowItemDetails(ServerItem serverItem) |
| | | { |
| | | //ItemWinModel itemWinModel = ItemCommonCtrl.Instance.OnSingleClickItemCell(serverItem.ItemID); |
| | | //itemWinModel.itemCount = serverItem.ItemCount; |
| | | //itemWinModel.isSuite = serverItem.IsSuite; |
| | | //itemWinModel.isBind = serverItem.IsBind; |
| | | //itemWinModel.userDataDict = serverItem.UserData == null ? null : ConfigParse.Analysis(serverItem.UserData); |
| | | //ItemPopModel.Instance.SetDefaultShowUIDict(itemWinModel, false); |
| | | //itemWinModel.SetShowWin(itemWinModel); |
| | | ItemAttrData attrData = new ItemAttrData(serverItem.ItemID,false, (ulong)serverItem.Count,-1,serverItem.IsBind |
| | | ,false,PackType.rptDeleted,"", ConfigParse.Analysis(serverItem.UserData)); |
| | | itemTipsModel.SetItemTipsModel(attrData); |
| | |
| | | {
|
| | | isDirty = DirtyWordConfig.IsDirtWord(msg);
|
| | | msg = DirtyWordConfig.IsDirtWord(msg, '*');
|
| | | var length = msg.Length;
|
| | | var length = GetChatMessageLength(msg);
|
| | | if (length > CHAT_INFO_CNT)
|
| | | {
|
| | | MessageWin.Inst.ShowFixedTip(Language.Get("L1014"));
|
| | |
| | | });
|
| | | }
|
| | |
|
| | | int GetChatMessageLength(string message)
|
| | | {
|
| | | message = WordAnalysis.Color_Start_Regex.Replace(message, string.Empty);
|
| | | message = WordAnalysis.Color_End_Regex.Replace(message, string.Empty);
|
| | | return message.Length;
|
| | | }
|
| | |
|
| | | bool CheckEmptyChat(string msg)
|
| | | {
|
| | | if (string.IsNullOrEmpty(msg.Replace(" ", string.Empty)))
|
| | |
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | WindowCenter.Instance.jumpWindowCloseEvent += CloseJumpWindow;
|
| | | |
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | |
| | | protected override void OnPreOpen()
|
| | | {
|
| | | ComposeModel.ResetModel();
|
| | | if(WindowJumpMgr.Instance.IsJumpState)
|
| | |
|
| | | if (WindowJumpMgr.Instance.IsJumpState && ComposeModel.secondType == 0)
|
| | | {
|
| | | if(ComposeModel.CurComposeModel != null)
|
| | | {
|
| | |
| | | {
|
| | | if (!WindowJumpMgr.Instance.IsJumpState)
|
| | | {
|
| | | WindowCenter.Instance.Open<MainInterfaceWin>();
|
| | | |
| | | }
|
| | | }
|
| | |
|
| | | private void CloseJumpWindow(Window win)
|
| | | {
|
| | | if(win as ComposeWin)
|
| | | {
|
| | | if (WindowJumpMgr.Instance.jumpPhase <= 1)
|
| | | {
|
| | | ComposeModel.SetCurComposeModel(null);
|
| | | }
|
| | | WindowCenter.Instance.Open<MainInterfaceWin>();
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | m_Controller.Restart();
|
| | | }
|
| | | int jumpIndex = model.presentSelectDogz - 1 > 0 ? model.presentSelectDogz - 1 : 0;
|
| | | int jumpIndex = model.presentSelectDogz - 2 > 0 ? model.presentSelectDogz - 2 : 0;
|
| | | m_Controller.JumpIndex(jumpIndex);
|
| | | }
|
| | |
|
| | |
| | | private void UpdateDogzAssistCnt()
|
| | | {
|
| | | m_Controller.m_Scorller.RefreshActiveCellViews();
|
| | | m_DogzAssistCnt.text = Language.Get("TreasurePrivilege_Dogz_1", StringUtility.Contact(model.GetAssistDogzCount(), "/", model.DogzAssistDefaultCnt));
|
| | | m_DogzAssistCnt.text = Language.Get("TreasurePrivilege_Dogz_1", StringUtility.Contact(model.GetAssistDogzCount(), "/", model.curSumAssistNum));
|
| | | UpdateDogzBtn();
|
| | | UpdateDogzProperty();
|
| | | UpdateDogzEquip();
|
| | |
| | |
|
| | | private void AddAssist()
|
| | | {
|
| | | if(model.IsAddMaxAssist())
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("DogzNumLimit");
|
| | | return;
|
| | | }
|
| | |
|
| | | var _itemConfig = Config.Instance.Get<ItemConfig>(model.AddAssistItem);
|
| | | ConfirmCancel.ShowItemConfirm(Language.Get("DogzFunc102", _itemConfig.ItemName, model.GetAssistItemCnt()),
|
| | | model.AddAssistItem, model.GetAssistItemCnt(), () =>
|
| | | {
|
| | | model.SendBuyAssistCnt();
|
| | | if (model.curSumAssistNum + 1 >= model.DogzAssistMaxCnt)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("DogzNumLimit");
|
| | | }
|
| | | });
|
| | | }
|
| | | private void TakeOffEquip()
|
| | |
| | | {
|
| | | if(!model.TryGetAssistDogzState(model.presentSelectDogz))
|
| | | {
|
| | | if(model.GetAssistDogzCount() < model.DogzAssistDefaultCnt)
|
| | | if(model.GetAssistDogzCount() < model.curSumAssistNum)
|
| | | {
|
| | | assistEffect.Play();
|
| | | assistTextEffect.Play();
|
| | |
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | curSumAssistNum = DogzAssistDefaultCnt;
|
| | | addAssistCnt = 0;
|
| | | SelectDogzItemQuality = 0;
|
| | | SelectDogzItemStart = 0;
|
| | |
| | |
|
| | | #region 配置
|
| | | private Dictionary<int, Dictionary<int, int>> m_DogzEquipLimit = new Dictionary<int, Dictionary<int, int>>(); //装备位 品质限制
|
| | | public int DogzAssistDefaultCnt { get; private set; } //助战神兽总数
|
| | | public int DogzAssistDefaultCnt { get; private set; } //助战神兽默认数量
|
| | | public int DogzAssistMaxCnt { get; private set; }//助战神兽最大数
|
| | | public int AddAssistItem { get; private set; } //增加助战神兽总数的物品Id
|
| | | public int DogzPackGridCnt { get; private set; } //神兽物品背包格子数
|
| | |
| | |
|
| | | public int GetAssistItemCnt()
|
| | | {
|
| | | if(!IsAddMaxAssist())
|
| | | {
|
| | | return AddAssistItemCnt[addAssistCnt];
|
| | | }
|
| | | else
|
| | | {
|
| | |
|
| | | return AddAssistItemCnt[AddAssistItemCnt.Length - 1];
|
| | | }
|
| | | }
|
| | |
|
| | | public bool IsAddMaxAssist()
|
| | | {
|
| | | if (curSumAssistNum < DogzAssistMaxCnt)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | else
|
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | |
|
| | | public int presentSelectDogz { get; set; } //当前选中的神兽id
|
| | |
| | | #region 协议
|
| | |
|
| | | public int addAssistCnt { get; private set; } //额外购买的助战数
|
| | | public int curSumAssistNum { get; private set; } //当前可以助战的神兽数量
|
| | | public void SetServerAddAssistDogzCnt(HA3C0_tagMCDogzInfo info)
|
| | | {
|
| | | addAssistCnt = info.BuyHelpbattleCount;
|
| | | DogzAssistDefaultCnt += addAssistCnt;
|
| | | curSumAssistNum = DogzAssistDefaultCnt + addAssistCnt;
|
| | | if (UpdateAssistDogzEvent != null)
|
| | | {
|
| | | UpdateAssistDogzEvent();
|
| | |
| | | {
|
| | | var configs = Config.Instance.GetAllValues<DogzConfig>();
|
| | | presentSelectDogz = configs[0].ID;
|
| | | if(dogzFuncRedpoint.state == RedPointState.Simple)
|
| | | {
|
| | | foreach (var key in m_DogzEquipLimit.Keys)
|
| | | {
|
| | | Redpoint redpoint = GetSingleDogzRedpointById(key);
|
| | |
| | | {
|
| | | presentSelectDogz = key;
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | foreach(var key in dogzAssistStateDict.Keys)
|
| | | {
|
| | | if(TryGetAssistDogzState(key))
|
| | | {
|
| | | presentSelectDogz = presentSelectDogz > key ? presentSelectDogz : key;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | value.state = RedPointState.None;
|
| | | }
|
| | | bool isMaxAssistNum = GetAssistDogzCount() >= DogzAssistDefaultCnt ? true : false;
|
| | | if (!isMaxAssistNum)
|
| | | {
|
| | | bool isMaxAssistNum = GetAssistDogzCount() >= curSumAssistNum ? true : false;
|
| | | int minAlreadyAssistId = 0;
|
| | | foreach (var dogzId in m_DogzEquipLimit.Keys)
|
| | | {
|
| | | if (TryGetAssistDogzState(dogzId)
|
| | | && ((minAlreadyAssistId < dogzId && minAlreadyAssistId != 0) || minAlreadyAssistId == 0))
|
| | | && ((minAlreadyAssistId > dogzId && minAlreadyAssistId != 0) || minAlreadyAssistId == 0))
|
| | | {
|
| | | minAlreadyAssistId = dogzId;
|
| | | }
|
| | | }
|
| | |
|
| | | if (!isMaxAssistNum)
|
| | | {
|
| | | int maxDogzId = 0;
|
| | | foreach(var dogzId in m_DogzEquipLimit.Keys)
|
| | | {
|
| | |
| | | {
|
| | | var equips = GetDogzEquips(dogzId);
|
| | | int equipNum = equips == null ? 0 : equips.Count;
|
| | | if(!TryGetAssistDogzState(dogzId) && equipNum == 5)
|
| | | if(!TryGetAssistDogzState(dogzId) && equipNum == 5
|
| | | && ((minAlreadyAssistId != 0 && dogzId > minAlreadyAssistId) || minAlreadyAssistId == 0))
|
| | | {
|
| | | Redpoint assistRedpoint = GetDogzAssistRedpointById(dogzId);
|
| | | if (assistRedpoint.state == RedPointState.None)
|
| | |
| | | return;
|
| | | }
|
| | | }
|
| | | bool isMaxAssistNum = GetAssistDogzCount() >= DogzAssistDefaultCnt ? true : false;
|
| | | bool isMaxAssistNum = GetAssistDogzCount() >= curSumAssistNum ? true : false;
|
| | | if (!isMaxAssistNum)
|
| | | {
|
| | | int maxEquipNum = 0;
|
| | |
| | | foreach (var dogzId in m_DogzEquipLimit.Keys)
|
| | | {
|
| | | if(TryGetAssistDogzState(dogzId)
|
| | | && ((minAlreadyAssistId < dogzId && minAlreadyAssistId != 0) || minAlreadyAssistId == 0))
|
| | | && ((minAlreadyAssistId > dogzId && minAlreadyAssistId != 0) || minAlreadyAssistId == 0))
|
| | | {
|
| | | minAlreadyAssistId = dogzId;
|
| | | }
|
| | |
| | |
|
| | | public void UpdateAssistNumRed()
|
| | | {
|
| | | if(CheckIsAddAssistNum())
|
| | | if(CheckIsAddAssistNum() && !IsAddMaxAssist())
|
| | | {
|
| | | if(addAssistDogzRedpoint.state == RedPointState.None)
|
| | | {
|
| | |
| | | [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()
|
| | | {
|
| | |
| | | protected override void OnPreOpen()
|
| | | {
|
| | | dogzModel.OpenFuncEvent += OnOpenFuncEvent;
|
| | | if(!WindowJumpMgr.Instance.IsJumpState)
|
| | | {
|
| | | 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>();
|
| | | }
|
| | |
|
| | |
| | | public override void Init() |
| | | { |
| | | ParseConfig(); |
| | | FuncOpen.Instance.OnFuncStateChangeEvent += OnFunctionStateChange; |
| | | } |
| | | |
| | | public override void UnInit() |
| | | { |
| | | FuncOpen.Instance.OnFuncStateChangeEvent -= OnFunctionStateChange; |
| | | } |
| | | |
| | | public bool TryGetBossData(int _bossId, out DogzDungeonBossData _data) |
| | |
| | | return; |
| | | } |
| | | |
| | | var updatedBox = false; |
| | | var updatedBigBox = false; |
| | | var updatedSmallBox = false; |
| | | var updatedElite = false; |
| | | var updatedEliteNpcIds = new List<int>(); |
| | | |
| | | for (int i = 0; i < _npcInfoes.NPCInfoList.Length; i++) |
| | | { |
| | | var npcInfo = _npcInfoes.NPCInfoList[i]; |
| | | if (npcInfo.NPCID == bigBoxNpcId) |
| | | { |
| | | dogzDungeonBox.bigBoxSurplus = (int)npcInfo.Cnt; |
| | | updatedBox = true; |
| | | updatedBigBox = true; |
| | | } |
| | | |
| | | if (npcInfo.NPCID == smallBoxNpcId) |
| | | { |
| | | dogzDungeonBox.smallBoxSurplus = (int)npcInfo.Cnt; |
| | | updatedBox = true; |
| | | updatedSmallBox = true; |
| | | } |
| | | |
| | | if (eliteMonsters.Contains((int)npcInfo.NPCID)) |
| | | { |
| | | dogzDungeonElite.UpdateEliteInfo((int)npcInfo.NPCID, (int)npcInfo.Cnt); |
| | | updatedEliteNpcIds.Add((int)npcInfo.NPCID); |
| | | updatedElite = true; |
| | | } |
| | | } |
| | | |
| | | if (updatedBox) |
| | | if (!updatedBigBox) |
| | | { |
| | | dogzDungeonBox.bigBoxSurplus = 0; |
| | | } |
| | | |
| | | if (!updatedSmallBox) |
| | | { |
| | | dogzDungeonBox.smallBoxSurplus = 0; |
| | | } |
| | | |
| | | if (boxSurplusChangeEvent != null) |
| | | { |
| | | boxSurplusChangeEvent(); |
| | | } |
| | | |
| | | foreach (var item in eliteMonsters) |
| | | { |
| | | if (!updatedEliteNpcIds.Contains(item)) |
| | | { |
| | | dogzDungeonElite.UpdateEliteInfo(item, 0); |
| | | } |
| | | } |
| | | |
| | | if (updatedElite) |
| | | { |
| | | if (eliteSurplusChangeEvent != null) |
| | | { |
| | | eliteSurplusChangeEvent(); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | public void UpdateBoxOrEliteRefreshTime(HA904_tagGCDogzNPCRefreshTime _refreshTimes) |
| | |
| | | UpdateRedpoint(); |
| | | } |
| | | |
| | | private void OnFunctionStateChange(int id) |
| | | { |
| | | if (id == 138) |
| | | { |
| | | UpdateRedpoint(); |
| | | } |
| | | } |
| | | |
| | | private void UpdateRedpoint() |
| | | { |
| | | if (!FuncOpen.Instance.IsFuncOpen(138)) |
| | | { |
| | | redpoint.count = 0; |
| | | } |
| | | else |
| | | { |
| | | var wearyValueLimit = GeneralConfig.Instance.bossWearyValues[2]; |
| | | redpoint.count = wearyValueLimit - wearyValue; |
| | | } |
| | | |
| | | redpoint.state = redpoint.count > 0 ? RedPointState.Quantity : RedPointState.None; |
| | | } |
| | |
| | | var config = Config.Instance.Get<NPCConfig>(model.eliteMonsters[0]); |
| | | UI3DModelExhibition.Instance.ShowNPC(model.eliteMonsters[0], config.UIModeLOffset, config.UIModelRotation, m_RawImage); |
| | | DisplayGuardSurplusInfo(); |
| | | model.boxSurplusChangeEvent += OnGuardInfoUpdate; |
| | | model.eliteSurplusChangeEvent += OnGuardInfoUpdate; |
| | | } |
| | | |
| | | public void Dispose() |
| | | { |
| | | model.boxSurplusChangeEvent -= OnGuardInfoUpdate; |
| | | model.eliteSurplusChangeEvent -= OnGuardInfoUpdate; |
| | | UI3DModelExhibition.Instance.StopShow(); |
| | | } |
| | | |
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Thursday, September 27, 2018
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI {
|
| | |
|
| | | public class DungeonAncientKingWin : Window
|
| | | {
|
| | | [SerializeField] Text m_AncientKingName;
|
| | | [SerializeField] Text m_AncientKingPoint;
|
| | | [SerializeField] ItemCell[] m_Items;
|
| | | [SerializeField] Button m_Close;
|
| | |
|
| | | DungeonModel m_Model;
|
| | | DungeonModel model
|
| | | {
|
| | | get { return m_Model ?? (m_Model = ModelCenter.Instance.GetModel<DungeonModel>()); }
|
| | | }
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | m_Close.onClick.AddListener(CloseClick);
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | model.updateMissionEvent -= UpdateTargets;
|
| | | UpdateTargets();
|
| | | DisplayAward();
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | model.updateMissionEvent -= UpdateTargets;
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | }
|
| | | #endregion
|
| | | private void UpdateTargets()
|
| | | {
|
| | | var _help = model.mission;
|
| | | m_AncientKingName.text = _help.topName;
|
| | | m_AncientKingPoint.text = UIHelper.ReplaceLargeNum(_help.topScore);
|
| | | }
|
| | |
|
| | | private void DisplayAward()
|
| | | {
|
| | | var awards = GeneralConfig.Instance.ancientKingAwards;
|
| | | for (int i = 0; i < m_Items.Length; i++)
|
| | | {
|
| | | m_Items[i].cellBtn.RemoveAllListeners();
|
| | | if (i < awards.Count)
|
| | | {
|
| | | var award = awards[i];
|
| | | m_Items[i].gameObject.SetActive(true);
|
| | | ItemCellModel itemCellModel = new ItemCellModel(award.id, true, (ulong)award.count, award.bind ? 1 : 0);
|
| | | m_Items[i].Init(itemCellModel);
|
| | | m_Items[i].cellBtn.AddListener(() =>
|
| | | {
|
| | | ItemAttrData itemAttrData = new ItemAttrData(award.id, true, (ulong)award.count, -1, award.bind ? 1 : 0);
|
| | | ModelCenter.Instance.GetModel<ItemTipsModel>().SetItemTipsModel(itemAttrData);
|
| | | });
|
| | | }
|
| | | else
|
| | | {
|
| | | m_Items[i].gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 174d70b8ee292354fb10efc54511ffb9 |
| | | timeCreated: 1538034810 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | { |
| | | public class DungeonAncientTargetWin : Window |
| | | { |
| | | [SerializeField] List<Text> m_DungeonTargets; |
| | | [SerializeField] Text m_DungeonName;
|
| | | [SerializeField] DungeonTargetBehaviour m_DungeonTargetBehaviour; |
| | | |
| | | DungeonModel m_Model; |
| | |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | model.updateMissionEvent -= UpdateTargets; |
| | | //model.updateMissionEvent -= UpdateTargets;
|
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | model.updateMissionEvent += UpdateTargets; |
| | | //model.updateMissionEvent += UpdateTargets;
|
| | | var line = PlayerDatas.Instance.baseData.FBID + 1;
|
| | | m_DungeonName.text = StringUtility.Contact(Language.Get("AncientBattle"), "(", Language.Get("FBLine", line), ")");
|
| | | m_DungeonTargetBehaviour.Init(31160); |
| | | UpdateTargets(); |
| | | //UpdateTargets();
|
| | | } |
| | | |
| | | private void UpdateTargets() |
| | | { |
| | | var _help = model.mission; |
| | | m_DungeonTargets[0].text = _help.topName; |
| | | m_DungeonTargets[1].text = UIHelper.ReplaceLargeNum(_help.topScore); |
| | | //var _help = model.mission;
|
| | | //m_DungeonTargets[0].text = _help.topName;
|
| | | //m_DungeonTargets[1].text = UIHelper.ReplaceLargeNum(_help.topScore);
|
| | | } |
| | | } |
| | | } |
| | |
| | | public int leaderID;
|
| | | public FairyFeastRank[] familyPartyRank;
|
| | | public FairyFeastTop familyPartyTop;
|
| | | public int topPlayerID;
|
| | | public int enemyID;
|
| | |
|
| | | public long totalExp
|
| | | {
|
| | |
| | | [SerializeField] RectTransform m_ContainerResPoint;
|
| | | [SerializeField] RectTransform m_ContainerAncient;
|
| | | [SerializeField] Button m_AncientBtn;
|
| | | [SerializeField] Button m_AncientKing;
|
| | | [SerializeField] DungeonItemCollect m_ItemCollect;
|
| | | [SerializeField] DungeonGuardSkyBehaviour m_GuardSky;
|
| | | [SerializeField] DungeonBossBriefInfoContainer m_BossInfosContainer;
|
| | |
| | | {
|
| | | m_ExitDungeon.AddListener(ExitDungeon);
|
| | | m_AncientBtn.onClick.AddListener(OnAncientBtn);
|
| | | m_AncientKing.onClick.AddListener(AncientKing);
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private void AncientKing()
|
| | | {
|
| | | if (WindowCenter.Instance.IsOpen<DungeonAncientKingWin>())
|
| | | {
|
| | | WindowCenter.Instance.CloseImmediately<DungeonAncientKingWin>();
|
| | | }
|
| | | else
|
| | | {
|
| | | WindowCenter.Instance.Open<DungeonAncientKingWin>();
|
| | | }
|
| | | }
|
| | |
|
| | | private void UpdateDungeonExitTime()
|
| | | {
|
| | | if (existSurplusTime > 0f)
|
| | |
| | |
|
| | | if (PlayerDatas.Instance.baseData.LV == GeneralConfig.Instance.demonJarRedPoint)
|
| | | {
|
| | | var count = dungeonModel.GetTotalTimes(DEMONJAR_MAPID) - dungeonModel.GetEnterTimes(DEMONJAR_MAPID);
|
| | | redpoint.state = count > 0 ? RedPointState.Quantity : RedPointState.None;
|
| | | redpoint.count = count;
|
| | | UpdateRedpoint();
|
| | | }
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | private void UpdateRedpoint()
|
| | | {
|
| | | if (FuncOpen.Instance.IsFuncOpen(76))
|
| | | {
|
| | | var count = dungeonModel.GetTotalTimes(DEMONJAR_MAPID) - dungeonModel.GetEnterTimes(DEMONJAR_MAPID);
|
| | | redpoint.count = count;
|
| | | }
|
| | | else
|
| | | {
|
| | | redpoint.count = 0;
|
| | | }
|
| | |
|
| | | redpoint.state = redpoint.count > 0 ? RedPointState.Quantity : RedPointState.None;
|
| | | }
|
| | |
|
| | | private void OnMapLineUpdateEvent(int _mapId)
|
| | |
| | | {
|
| | | if (DEMONJAR_MAPID == _dataMapId && PlayerDatas.Instance.baseData.LV >= GeneralConfig.Instance.demonJarRedPoint)
|
| | | {
|
| | | var count = dungeonModel.GetTotalTimes(_dataMapId) - dungeonModel.GetEnterTimes(_dataMapId);
|
| | | redpoint.state = count > 0 ? RedPointState.Quantity : RedPointState.None;
|
| | | redpoint.count = count;
|
| | | UpdateRedpoint();
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | if (PlayerDatas.Instance.baseData.LV >= GeneralConfig.Instance.demonJarRedPoint)
|
| | | {
|
| | | var count = dungeonModel.GetTotalTimes(DEMONJAR_MAPID) - dungeonModel.GetEnterTimes(DEMONJAR_MAPID);
|
| | | redpoint.state = count > 0 ? RedPointState.Quantity : RedPointState.None;
|
| | | redpoint.count = count;
|
| | | UpdateRedpoint();
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | private void AutoSubscribeLastUnLockBoss(int _bossId)
|
| | |
| | | Dictionary<int, BossSubscribe> bossSubscribes = new Dictionary<int, BossSubscribe>();
|
| | | bool serverInited = false;
|
| | |
|
| | | public event Action<int> bossInfoUpdateEvent;
|
| | | public event Action<int> bossSubscribeChangeEvent;
|
| | | public event Action preciousDropRecordUpdateEvent;
|
| | | public event Action<int> bossInfoUpdateEvent;
|
| | | public event Action bossRebornNotifyChangeEvent;
|
| | |
|
| | | DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | |
| | | {
|
| | | return false;
|
| | | }
|
| | | else
|
| | | {
|
| | | var isMistakeBoss = BossFakeLineUtility.Instance.lastBossNpcID == bossId
|
| | | && Time.realtimeSinceStartup < BossFakeLineUtility.Instance.inMistakeForBossAliveOverTime;
|
| | | var isLineBossAlive = IsLineBossAlive(PlayerDatas.Instance.baseData.FBID);
|
| | |
|
| | | if (isMistakeBoss && isLineBossAlive)
|
| | | else if (BossFakeLineUtility.Instance.HasSawLineBossRecently(bossId, PlayerDatas.Instance.baseData.FBID))
|
| | | {
|
| | | return true;
|
| | | }
|
| | | else if (BossFakeLineUtility.Instance.HasSawLineStoneRecently(bossId, PlayerDatas.Instance.baseData.FBID))
|
| | | {
|
| | | return false;
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | |
|
| | | if (currentNeutralMap)
|
| | | {
|
| | | return isLineBossAlive;
|
| | | return IsLineBossAlive(PlayerDatas.Instance.baseData.FBID);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | else
|
| | | {
|
| | | return IsAnyLineBossAlive();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | public static int Compare2(DropRecord _lhs, DropRecord _rhs)
|
| | | {
|
| | |
| | | private void RefreshKillOtherPlayer(uint id, string name)
|
| | | {
|
| | | if (id == PlayerDatas.Instance.baseData.PlayerID || IsDungeon()) return;
|
| | |
|
| | | ChatCtrl.Inst.PteChatID = (int)id;
|
| | | ChatCtrl.Inst.PteChatName = name;
|
| | | LanguageVerify.toPlayerLevel = 0;
|
| | | MapConfig mapConfig = Config.Instance.Get<MapConfig>(PlayerDatas.Instance.baseData.MapID);
|
| | | string msg = StringUtility.Contact(Language.Get("KillOthersDes", mapConfig.Name,StringUtility.Contact("<color=#FF0101FF>", UIHelper.ServerStringTrim(PlayerDatas.Instance.baseData.PlayerName), "</color>")),ChatCtrl.KILL_IDENTIFY);
|
| | | ChatCtrl.Inst.SendChatInfo(ChatInfoType.Friend,msg);
|
| | | SendChatInfoToPlayer((int)id,name,0,msg);
|
| | | }
|
| | |
|
| | | private bool IsDungeon()
|
| | |
| | | return mapConfig != null && mapConfig.MapFBType != 0;
|
| | | }
|
| | |
|
| | | public void SendChatInfoByGroup(GroupType groupType,string info)
|
| | | {
|
| | | if(_groupDict.ContainsKey((byte)groupType))
|
| | | {
|
| | | foreach(var value in _groupDict[(byte)groupType].Values)
|
| | | {
|
| | | if (_socialPlayerDict.ContainsKey(value.PlayerID))
|
| | | {
|
| | | FriendPlayer friendPlayer = _socialPlayerDict[value.PlayerID];
|
| | | SendChatInfoToPlayer((int)friendPlayer.PlayerID, UIHelper.ServerStringTrim(friendPlayer.PlayerName), friendPlayer.LV, info);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public void SendChatInfoToPlayer(int id,string name,int lv,string info)
|
| | | {
|
| | | ChatCtrl.Inst.PteChatID = id;
|
| | | ChatCtrl.Inst.PteChatName = name;
|
| | | LanguageVerify.toPlayerLevel = lv;
|
| | | ChatCtrl.Inst.SendChatInfo(ChatInfoType.Friend,info);
|
| | | }
|
| | |
|
| | | //刷新好友列表信息
|
| | | public void ReFreshFriendlist(HB304_tagGCSocialPlayers friendInfo)
|
| | |
| | | using System;
|
| | | using System.Text.RegularExpressions;
|
| | | using System.Linq;
|
| | | using Snxxz.UI;
|
| | |
|
| | | public class GeneralConfig : Singleton<GeneralConfig>
|
| | | {
|
| | |
| | |
|
| | | public string teamWorldCall;
|
| | | public int teamWorldCallInviteCount;
|
| | |
|
| | | public List<Item> ancientKingAwards = new List<Item>();
|
| | |
|
| | | public void Init()
|
| | | {
|
| | |
| | |
|
| | | teamWorldCall = GetInputString("TeamWorldCall");
|
| | | teamWorldCallInviteCount = GetInt("TeamWorldCall", 2);
|
| | |
|
| | | var ancientKingAwradConfig = Config.Instance.Get<FuncConfigConfig>("ElderBattlefieldTopAward");
|
| | | if (ancientKingAwradConfig != null)
|
| | | {
|
| | | var itemArray = LitJson.JsonMapper.ToObject<int[][]>(ancientKingAwradConfig.Numerical1);
|
| | | for (int k = 0; k < itemArray.Length; k++)
|
| | | {
|
| | | ancientKingAwards.Add(new Item()
|
| | | {
|
| | | id = itemArray[k][0],
|
| | | count = itemArray[k][1],
|
| | | bind = itemArray[k][2] == 1,
|
| | | });
|
| | | }
|
| | | }
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | |
| | | {
|
| | | 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
|
| | | {
|
| | |
| | | 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;
|
| | |
| | | SendMakeUseQuest(itemModel.itemInfo.ItemPlace);
|
| | | }
|
| | | break;
|
| | | case RoleRenameWin.renameToolId:
|
| | | WindowCenter.Instance.Open<RoleRenameWin>();
|
| | | break;
|
| | | default:
|
| | | ItemCDCool cool = KnapsackTimeCDMgr.Instance.GetItemCoolById(itemModel.itemInfo.ItemGUID);
|
| | | if (cool == null || cool.GetRemainTime() <= 0)
|
| | |
| | |
|
| | | #region 角色红点
|
| | | public Redpoint roleRedpoint = new Redpoint(RedPoint_key, 101);
|
| | | public Redpoint roleTagRedpoint = new Redpoint(101, 10101);
|
| | | #endregion
|
| | |
|
| | | #region 邮件红点
|
| | |
| | | {
|
| | | public class BattleHint : Singleton<BattleHint>
|
| | | {
|
| | | DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | |
|
| | | public BattleHint()
|
| | | {
|
| | | StageManager.Instance.onStageLoadFinish += OnStageLoadFinish;
|
| | | SysNotifyMgr.Instance.OnSystemNotifyEvent += OnSystemNotifyEvent;
|
| | | }
|
| | |
|
| | | private void OnStageLoadFinish()
|
| | | public void OnStageLoadFinish()
|
| | | {
|
| | | Clear();
|
| | | var mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | if (cacheMapId != 0 && cacheMapId != 31160
|
| | | && mapId == 31160)
|
| | | {
|
| | | SnxxzGame.Instance.StartCoroutine(Co_LoadFinish());
|
| | | }
|
| | | var help = dungeonModel.mission;
|
| | | ancientKing = mapId != 31160 ? 0 : help.topPlayerID;
|
| | | cacheMapId = PlayerDatas.Instance.baseData.MapID;
|
| | | }
|
| | |
|
| | | public event Action battleHintUpdate;
|
| | | public event Action evenKillUpdate;
|
| | |
|
| | | Queue<string> battleHints = new Queue<string>();
|
| | | Queue<int> battleHints = new Queue<int>();
|
| | | Queue<string> evenKills = new Queue<string>();
|
| | |
|
| | | public void Receive(string msg)
|
| | | int ancientKing = 0;
|
| | | int cacheMapId = 0;
|
| | |
|
| | | IEnumerator Co_LoadFinish()
|
| | | {
|
| | | if (!(StageManager.Instance.CurrentStage is DungeonStage))
|
| | | yield return WaitingForSecondConst.WaitMS300;
|
| | | var mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | if (mapId == 31160)
|
| | | {
|
| | | Receive(3);
|
| | | }
|
| | | }
|
| | |
|
| | | public void UpdateDungeonHelp()
|
| | | {
|
| | | var help = dungeonModel.mission;
|
| | | if (DTC0403_tagPlayerLoginLoadOK.finishedLogin)
|
| | | {
|
| | | if (PlayerDatas.Instance.baseData.MapID == 31160
|
| | | && help.topPlayerID == PlayerDatas.Instance.baseData.PlayerID
|
| | | && ancientKing != help.topPlayerID)
|
| | | {
|
| | | ancientKing = help.topPlayerID;
|
| | | Receive(1);
|
| | | }
|
| | | }
|
| | | ancientKing = help.topPlayerID;
|
| | | }
|
| | |
|
| | | private void OnSystemNotifyEvent(string msg)
|
| | | {
|
| | | if (!(StageManager.Instance.CurrentStage is DungeonStage)
|
| | | || StageManager.Instance.isLoading)
|
| | | {
|
| | | return;
|
| | | }
|
| | | battleHints.Enqueue(msg);
|
| | | if (StageManager.Instance.isLoading)
|
| | | if (msg.Equals("AncientBattlefield_8"))
|
| | | {
|
| | | return;
|
| | | Receive(2);
|
| | | }
|
| | | }
|
| | |
|
| | | public void Receive(int ancientType)
|
| | | {
|
| | | battleHints.Enqueue(ancientType);
|
| | | if (!WindowCenter.Instance.IsOpen<BattleHintWin>())
|
| | | {
|
| | | WindowCenter.Instance.Open<BattleHintWin>();
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public bool TryGetBattleHint(out string msg)
|
| | | public void ReceiveEvenKill(string message, ArrayList list)
|
| | | {
|
| | | msg = string.Empty;
|
| | | if (PlayerDatas.Instance.baseData.MapID != 31160
|
| | | || !(StageManager.Instance.CurrentStage is DungeonStage)
|
| | | || StageManager.Instance.isLoading)
|
| | | {
|
| | | return;
|
| | | }
|
| | | var evenKillCount = 0;
|
| | | if (list != null && list.Count > 0)
|
| | | {
|
| | | int.TryParse(list[0].ToString(), out evenKillCount);
|
| | | }
|
| | | if (evenKillCount == 0)
|
| | | {
|
| | | return;
|
| | | }
|
| | | message = message.Replace("%s0", evenKillCount.ToString());
|
| | | evenKills.Enqueue(message);
|
| | | if (!WindowCenter.Instance.IsOpen<BattleHintWin>())
|
| | | {
|
| | | WindowCenter.Instance.Open<BattleHintWin>();
|
| | | }
|
| | | else
|
| | | {
|
| | | if (evenKillUpdate != null)
|
| | | {
|
| | | evenKillUpdate();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public bool TryGetBattleHint(out int ancientType)
|
| | | {
|
| | | ancientType = 0;
|
| | | if (battleHints.Count > 0)
|
| | | {
|
| | | msg = battleHints.Dequeue();
|
| | | ancientType = battleHints.Dequeue();
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public bool TryGetEvenKill(out string message)
|
| | | {
|
| | | message = string.Empty;
|
| | | if (evenKills.Count > 0)
|
| | | {
|
| | | message = evenKills.Dequeue();
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | |
| | | public void Clear()
|
| | | {
|
| | | battleHints.Clear();
|
| | | evenKills.Clear();
|
| | | }
|
| | | }
|
| | | } |
| | |
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using TableConfig;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | |
| | |
|
| | | public class BattleHintWin : Window
|
| | | {
|
| | | [SerializeField] Image m_BattleHint;
|
| | | [SerializeField] RectTransform m_ContainerBattleHint;
|
| | | [SerializeField] RectTransform m_ContainerKing;
|
| | | [SerializeField] RectTransform m_ContainerEnemy;
|
| | | [SerializeField] RectTransform m_ContainerAncientRemind;
|
| | | [SerializeField] ScaleTween m_BattleHintTween;
|
| | | [SerializeField, Header("保留时间")] float m_KeepTime = 2f;
|
| | |
|
| | | bool inBattleHint = false;
|
| | | [SerializeField] RectTransform m_ContainerEvenKill;
|
| | | [SerializeField] ScaleTween m_EvenKillTween;
|
| | | [SerializeField] Text m_EvenKill;
|
| | | [SerializeField, Header("保留时间")] float m_EvenKillTime = 2f;
|
| | |
|
| | | bool isBattleHint = false;
|
| | | bool isEvenKill = false;
|
| | |
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | |
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | inBattleHint = false;
|
| | | m_BattleHintTween.gameObject.SetActive(false);
|
| | | m_ContainerBattleHint.gameObject.SetActive(false);
|
| | | m_ContainerEvenKill.gameObject.SetActive(false);
|
| | | isBattleHint = false;
|
| | | isEvenKill = false;
|
| | | }
|
| | |
|
| | | protected override void OnActived()
|
| | | {
|
| | | base.OnActived();
|
| | | DisplayBattleHint();
|
| | | DisplayEvenKill();
|
| | | BattleHint.Instance.battleHintUpdate += BattleHintUpdate;
|
| | | BattleHint.Instance.evenKillUpdate += EvenKillUpdate;
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | |
| | | protected override void OnPreClose()
|
| | | {
|
| | | BattleHint.Instance.battleHintUpdate -= BattleHintUpdate;
|
| | | BattleHint.Instance.evenKillUpdate -= EvenKillUpdate;
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | |
| | |
|
| | | private void BattleHintUpdate()
|
| | | {
|
| | | if (!inBattleHint)
|
| | | if (!isBattleHint)
|
| | | {
|
| | | DisplayBattleHint();
|
| | | }
|
| | |
| | |
|
| | | void DisplayBattleHint()
|
| | | {
|
| | | string iconKey = string.Empty;
|
| | | if (BattleHint.Instance.TryGetBattleHint(out iconKey))
|
| | | var ancientType = 0;
|
| | | if (BattleHint.Instance.TryGetBattleHint(out ancientType))
|
| | | {
|
| | | inBattleHint = true;
|
| | | m_BattleHint.SetSprite(iconKey);
|
| | | m_BattleHint.SetNativeSize();
|
| | | m_BattleHintTween.gameObject.SetActive(true);
|
| | | isBattleHint = true;
|
| | | m_ContainerKing.gameObject.SetActive(false);
|
| | | m_ContainerEnemy.gameObject.SetActive(false);
|
| | | m_ContainerAncientRemind.gameObject.SetActive(false);
|
| | | switch (ancientType)
|
| | | {
|
| | | case 1:
|
| | | m_ContainerKing.gameObject.SetActive(true);
|
| | | break;
|
| | | case 2:
|
| | | m_ContainerEnemy.gameObject.SetActive(true);
|
| | | break;
|
| | | case 3:
|
| | | m_ContainerAncientRemind.gameObject.SetActive(true);
|
| | | break;
|
| | | }
|
| | | m_ContainerBattleHint.gameObject.SetActive(true);
|
| | | m_BattleHintTween.SetStartState();
|
| | | m_BattleHintTween.Play(OnBattleHintTweenComplete);
|
| | | }
|
| | |
| | | StartCoroutine(Co_Complete());
|
| | | }
|
| | |
|
| | | private void EvenKillUpdate()
|
| | | {
|
| | | if (!isEvenKill)
|
| | | {
|
| | | DisplayEvenKill();
|
| | | }
|
| | | }
|
| | |
|
| | | void DisplayEvenKill()
|
| | | {
|
| | | string evenKill = string.Empty;
|
| | | if (BattleHint.Instance.TryGetEvenKill(out evenKill))
|
| | | {
|
| | | isEvenKill = true;
|
| | | m_EvenKill.text= evenKill;
|
| | | m_ContainerEvenKill.gameObject.SetActive(true);
|
| | | m_EvenKillTween.SetStartState();
|
| | | m_EvenKillTween.Play(OnEvenKillComplete);
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnEvenKillComplete()
|
| | | {
|
| | | StartCoroutine(Co_EvenKill());
|
| | | }
|
| | |
|
| | | IEnumerator Co_Complete()
|
| | | {
|
| | | yield return WaitingForSecondConst.GetWaitForSeconds(m_KeepTime);
|
| | | inBattleHint = false;
|
| | | m_BattleHintTween.gameObject.SetActive(false);
|
| | | isBattleHint = false;
|
| | | m_ContainerBattleHint.gameObject.SetActive(false);
|
| | | DisplayBattleHint();
|
| | | }
|
| | |
|
| | | IEnumerator Co_EvenKill()
|
| | | {
|
| | | yield return WaitingForSecondConst.GetWaitForSeconds(m_EvenKillTime);
|
| | | isEvenKill = false;
|
| | | m_ContainerEvenKill.gameObject.SetActive(false);
|
| | | DisplayEvenKill();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += BeforePlayerDataInitializeEvent;
|
| | | StageManager.Instance.onStageLoadFinish += OnStageLoadFinish;
|
| | | StartCoroutine(Co_Instance());
|
| | | }
|
| | |
|
| | | IEnumerator Co_Instance()
|
| | | {
|
| | | yield return null;
|
| | | var instance = BattleHint.Instance;
|
| | | }
|
| | |
|
| | | protected override void OnDestroy()
|
| | |
| | | private void OnStageLoadFinish()
|
| | | {
|
| | | ServerTipDetails.OnStageLoadFinish();
|
| | | BattleHint.Instance.OnStageLoadFinish();
|
| | | }
|
| | |
|
| | | private void BeforePlayerDataInitializeEvent()
|
| | |
| | | OnSysTipEvent(type[i], msg, tipInfoList);
|
| | | }
|
| | | break;
|
| | | case SysNotifyType.SysBattleHint:
|
| | | BattleHint.Instance.Receive(msg);
|
| | | case SysNotifyType.SysEvenKill:
|
| | | BattleHint.Instance.ReceiveEvenKill(msg, tipInfoList);
|
| | | break;
|
| | | }
|
| | | }
|
| | |
| | | SysTeamTip = 41,//队伍频道提示
|
| | | SysRealmTip = 100,//境界提示
|
| | | SysFixedTip1 = 11,//固定提示2
|
| | | SysBattleHint = 6,//上古战场提示
|
| | | SysEvenKill = 7,//上古战场连杀提示
|
| | | }
|
| | |
|
| | | public int Compare(SystemHintData x, SystemHintData y)
|
| | |
| | | {
|
| | | public class RoleModel : Model,IBeforePlayerDataInitialize,IAfterPlayerDataInitialize,IPlayerLoginOk
|
| | | {
|
| | | FriendsModel friendsModel { get { return ModelCenter.Instance.GetModel<FriendsModel>(); } }
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | | }
|
| | |
| | | {
|
| | | }
|
| | |
|
| | | public string playerRename { get; private set; }
|
| | | public void SetRename(string rename)
|
| | | {
|
| | | playerRename = rename;
|
| | | }
|
| | | #region 协议
|
| | | public void ServerRenameResult(HA921_tagUpdatePlayerNameResult renameResult)
|
| | | {
|
| | | switch ((RoleRenameResult)renameResult.Result)
|
| | | {
|
| | | case RoleRenameResult.MoneyErr:
|
| | | SysNotifyMgr.Instance.ShowTip("GoldErr");
|
| | | break;
|
| | | case RoleRenameResult.NameRuleErr:
|
| | | MessageWin.Inst.ShowFixedTip(Language.Get("L1007"));
|
| | | break;
|
| | | case RoleRenameResult.NameLengErr:
|
| | | break;
|
| | | case RoleRenameResult.NameRepeatErr:
|
| | | SysNotifyMgr.Instance.ShowTip("RepeatName");
|
| | | break;
|
| | | case RoleRenameResult.RenameFailErr:
|
| | | break;
|
| | | case RoleRenameResult.RenameSuccess:
|
| | | string info = Language.Get("RenameText_02", UIHelper.ServerStringTrim(PlayerDatas.Instance.baseData.PlayerName), playerRename);
|
| | | friendsModel.SendChatInfoByGroup(GroupType.Friend,info);
|
| | | SysNotifyMgr.Instance.ShowTip("RenameSuccess01", playerRename);
|
| | | if(WindowCenter.Instance.IsOpen<RoleRenameWin>())
|
| | | {
|
| | | WindowCenter.Instance.CloseImmediately<RoleRenameWin>();
|
| | | }
|
| | | GameNetSystem.Instance.Reconnect();
|
| | | break;
|
| | | }
|
| | | }
|
| | | #endregion
|
| | | }
|
| | | }
|
| | |
|
| New file |
| | |
| | | using System.Collections.Generic;
|
| | | using System.Text;
|
| | | using System.Text.RegularExpressions;
|
| | | using TableConfig;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class RoleRenameWin : Window
|
| | | {
|
| | | [SerializeField] InputField renameInput;
|
| | | [SerializeField] Button sureBtn;
|
| | | [SerializeField] Button closeBtn;
|
| | | [SerializeField] ItemCell itemCell;
|
| | | PlayerPackModel playerPack { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
|
| | | ItemTipsModel tipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
|
| | | RoleModel roleModel { get { return ModelCenter.Instance.GetModel<RoleModel>(); } }
|
| | | GetItemPathModel pathModel { get { return ModelCenter.Instance.GetModel<GetItemPathModel>(); } }
|
| | | public const int renameToolId = 953;
|
| | | protected override void BindController()
|
| | | {
|
| | |
|
| | | }
|
| | | protected override void AddListeners()
|
| | | {
|
| | | sureBtn.AddListener(ClickRenameBtn);
|
| | | closeBtn.AddListener(CloseClick);
|
| | | }
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | OnDisplay();
|
| | | }
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | |
| | | }
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | |
| | | }
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | |
|
| | | }
|
| | |
|
| | | private void OnDisplay()
|
| | | {
|
| | | ItemConfig itemConfig = Config.Instance.Get<ItemConfig>(renameToolId);
|
| | | if (itemConfig == null) return;
|
| | | ItemCellModel cellModel = new ItemCellModel(renameToolId, false,(ulong)GetRenameToolNum());
|
| | | itemCell.Init(cellModel);
|
| | | if(GetRenameToolNum() > 0)
|
| | | {
|
| | | itemCell.countText.text = StringUtility.Contact(UIHelper.GetTextColorByItemColor(TextColType.Green,GetRenameToolNum().ToString()),
|
| | | "/",1);
|
| | | }
|
| | | else
|
| | | {
|
| | | itemCell.countText.text = StringUtility.Contact(UIHelper.GetTextColorByItemColor(TextColType.Red,0.ToString()),
|
| | | "/", 1);
|
| | | }
|
| | | itemCell.cellBtn.RemoveAllListeners();
|
| | | itemCell.cellBtn.AddListener(()=>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(renameToolId);
|
| | | tipsModel.SetItemTipsModel(attrData);
|
| | | });
|
| | | }
|
| | |
|
| | | private int GetRenameToolNum()
|
| | | {
|
| | | return playerPack.GetItemCountByID(PackType.rptItem, renameToolId);
|
| | | }
|
| | |
|
| | | private int GetRenameToolIndex()
|
| | | {
|
| | | SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptItem);
|
| | | if (singlePack == null) return 0;
|
| | |
|
| | | List<int> indexlist = singlePack.ItemIndexlist(renameToolId, 1);
|
| | | if(indexlist.Count > 0)
|
| | | {
|
| | | return indexlist[0] + 1;
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | private void ClickRenameBtn()
|
| | | {
|
| | | if (renameInput.text.Equals(string.Empty))
|
| | | {
|
| | | MessageWin.Inst.ShowFixedTip(Language.Get("CreateRole_NameNull"));
|
| | | return;
|
| | | }
|
| | | if(GetRenameToolNum() < 1)
|
| | | {
|
| | | pathModel.SetChinItemModel(renameToolId);
|
| | | return;
|
| | | }
|
| | |
|
| | | if (Encoding.UTF8.GetBytes(renameInput.text).Length < 6)
|
| | | {
|
| | | MessageWin.Inst.ShowFixedTip(Language.Get("CreateRole_NameShort"));
|
| | | return;
|
| | | }
|
| | | if (!CheckNameLengthLimit(renameInput.text))
|
| | | {
|
| | | MessageWin.Inst.ShowFixedTip(Language.Get("CreateRole_NameLimit"));
|
| | | return;
|
| | | }
|
| | | if (DirtyWordConfig.IsDirtWord(renameInput.text) || UIHelper.HasSpecialCharac(renameInput.text)
|
| | | || DirtyNameConfig.IsDirtName(renameInput.text))
|
| | | {
|
| | | MessageWin.Inst.ShowFixedTip(Language.Get("L1007"));
|
| | | return;
|
| | | }
|
| | |
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"),Language.Get("RenameText_01", renameInput.text), (bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | LanguageVerify.Instance.VerifyPlayerName(renameInput.text, 0,
|
| | | UIHelper.ServerStringTrim(PlayerDatas.Instance.baseData.PlayerName), PlayerDatas.Instance.baseData.LV,
|
| | | PlayerDatas.Instance.baseData.VIPLv, (bool ok, string name) =>
|
| | | {
|
| | | if (ok)
|
| | | {
|
| | | roleModel.SetRename(name);
|
| | | CA122_tagUpdatePlayerName renamePlayerName = new CA122_tagUpdatePlayerName();
|
| | | renamePlayerName.NewNameLen = (byte)ChatCtrl.GetUTF8InfoLen(name);
|
| | | renamePlayerName.NewName = name;
|
| | | renamePlayerName.ItemIndex = (byte)GetRenameToolIndex();
|
| | | renamePlayerName.ServerID = (uint)ServerListCenter.Instance.currentServer.region_flag;
|
| | | GameNetSystem.Instance.SendInfo(renamePlayerName);
|
| | | }
|
| | |
|
| | | });
|
| | | }
|
| | | });
|
| | | |
| | | }
|
| | |
|
| | | private bool CheckNameLengthLimit(string _value)
|
| | | {
|
| | | var _chs = Regex.Replace(_value, "[^\u4e00-\u9fa5]", string.Empty);
|
| | | if (_chs.Length > GeneralConfig.Instance.playerNameLength / 3)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | if (_value.Length > 6)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | return true;
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 267817e3e5c4b0e44b2b6c98eca954bc |
| | | timeCreated: 1538028978 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | public Dictionary<int, int> wingLv2GenerDict = new Dictionary<int, int>();
|
| | | public Dictionary<int, List<RoleStrongerConfig>> roleStrongerDic = new Dictionary<int, List<RoleStrongerConfig>>();
|
| | | List<int> promotePercents = new List<int>();
|
| | | public List<int> fightPowerPercents = new List<int>();
|
| | | void ParseConfig()
|
| | | {
|
| | | var dict = Config.Instance.GetAllValues<RoleStrongerConfig>();
|
| | |
| | | }
|
| | | funcConfig = Config.Instance.Get<FuncConfigConfig>("FightpowerUp");
|
| | | promotePercents.AddRange(ConfigParse.GetMultipleStr<int>(funcConfig.Numerical1));
|
| | | fightPowerPercents.AddRange(ConfigParse.GetMultipleStr<int>(funcConfig.Numerical2));
|
| | | }
|
| | |
|
| | | public List<RoleStrongerConfig> GetStrongerConfigs(int funcType)
|
| | |
| | | {
|
| | | var _playerLvCfg = Config.Instance.Get<PlayerLVConfig>(PlayerDatas.Instance.baseData.LV);
|
| | | var _rate = (float)PlayerDatas.Instance.baseData.FightPoint / _playerLvCfg.fightPower;
|
| | | var _grade = GetGrade(_rate);
|
| | | m_PresentGradeImgs[1].gameObject.SetActive(_rate > 1.2f);
|
| | | m_PresentGradeImgs[2].gameObject.SetActive(_rate > 1.2f);
|
| | | var index = 0;
|
| | | var iconKey = GetGrade(_rate, out index);
|
| | | m_PresentGradeImgs[1].gameObject.SetActive(index > 4);
|
| | | m_PresentGradeImgs[2].gameObject.SetActive(index > 5);
|
| | | for (int i = 0; i < m_PresentGradeImgs.Count; i++)
|
| | | {
|
| | | if (_rate <= 1.2f && i > 0)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | m_PresentGradeImgs[i].SetSprite(GetGrade(_rate));
|
| | | m_PresentGradeImgs[i].SetSprite(iconKey);
|
| | | }
|
| | | }
|
| | |
|
| | | private string GetGrade(float _rate)
|
| | | private string GetGrade(float _rate,out int index)
|
| | | {
|
| | | if (_rate <= 0.6)
|
| | | index = 0;
|
| | | for (int i = 0; i < model.fightPowerPercents.Count; i++)
|
| | | {
|
| | | if ((int)(_rate * 100) <= model.fightPowerPercents[i])
|
| | | {
|
| | | index = i;
|
| | | break;
|
| | | }
|
| | | index++;
|
| | | }
|
| | | switch (index)
|
| | | {
|
| | | case 0:
|
| | | return "Remark_D";
|
| | | case 1:
|
| | | return "Remark_C";
|
| | | case 2:
|
| | | return "Remark_B";
|
| | | case 3:
|
| | | return "Remark_A";
|
| | | case 4://s
|
| | | case 5://ss
|
| | | case 6://sss
|
| | | return "Remark_S";
|
| | | default:
|
| | | return "Remark_D";
|
| | | }
|
| | | if (_rate <= 0.75)
|
| | | {
|
| | | return "Remark_C";
|
| | | }
|
| | | if (_rate <= 0.85)
|
| | | {
|
| | | return "Remark_B";
|
| | | }
|
| | | if (_rate <= 1)
|
| | | {
|
| | | return "Remark_A";
|
| | | }
|
| | | if (_rate <= 1.2)
|
| | | {
|
| | | return "Remark_S";
|
| | | }
|
| | | if (_rate <= 1.5)
|
| | | {
|
| | | return "Remark_S";
|
| | | }
|
| | | return "Remark_S";
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | 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)//双倍强化
|
| | | {
|
| | | DoubleStrength(ListIndex, ListCount); |
| | | }
|
| | | else//单倍强化
|
| | | {
|
| | | SingleStrength(ListIndex, ListCount);//单倍强化
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | private void SingleStrength(List<int> ListIndex, List<int> ListCount)//单倍强化
|
| | | {
|
| | | if (ListIndex.Count <= 0)
|
| | | {
|
| | | return;
|
| | | }
|
| | | if (NeedFairyJade <= 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);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | 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)
|
| | |
| | | }
|
| | | });
|
| | | }
|
| | | }
|
| | | else//单倍强化
|
| | | {
|
| | | if (ListIndex.Count <= 0)
|
| | | {
|
| | | return;
|
| | | }
|
| | | dogz_model.SendDogzEquipStrength(m_DogZItemModel.itemInfo.ItemPlace, ListIndex, ListCount, 0);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | |
| | | }
|
| | | private void ChooseToModify(int locationMarker)
|
| | | {
|
| | | GetGodBeastLocationMarker(locationMarker);
|
| | |
| | | m_ExpSlider.ResetStage();
|
| | | m_ExpSlider.value = 1;
|
| | | m_Slider.gameObject.SetActive(false);
|
| | | int NeedExp = DogzEquipConfig.upExpTotal;
|
| | | int NeedExp =0;
|
| | | if (DogZLv > 0)
|
| | | {
|
| | | var Dogz_EquipConfig = DogzEquipPlusConfig.GetEquipplaceAndLevel(GodBeastPart, DogZLv - 1);
|
| | | NeedExp -= Dogz_EquipConfig.upExpTotal;
|
| | | var Dogz_EquipConfig_1 = DogzEquipPlusConfig.GetEquipplaceAndLevel(GodBeastPart, DogZLv - 1);
|
| | | var Dogz_EquipConfig_2 = DogzEquipPlusConfig.GetEquipplaceAndLevel(GodBeastPart, DogZLv - 2);
|
| | | NeedExp = Dogz_EquipConfig_1.upExpTotal- Dogz_EquipConfig_2.upExpTotal;
|
| | | }
|
| | | m_ExpNum.text = NeedExp + "/" + NeedExp;
|
| | | }
|
| | |
| | | if (IudetDogzEquipPlus != null)
|
| | | {
|
| | | SingleProficiency += IudetDogzEquipPlus[1];
|
| | | DoubleProficiency += itemModel.chinItemModel.EffectValueA1;
|
| | | DoubleProficiency += IudetDogzEquipPlus[1]+ itemModel.chinItemModel.EffectValueA1;
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | }
|
| | | int lv = godBeastModel.QualityLimit[m_DogZItemModel.chinItemModel.ItemColor];
|
| | | var IudetDogzEquipPlus = m_DogZItemModel.GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus);
|
| | | if (IudetDogzEquipPlus != null)
|
| | | if (IudetDogzEquipPlus != null && IudetDogzEquipPlus.Count>1)
|
| | | {
|
| | | ToExpTotal += IudetDogzEquipPlus[1];
|
| | | }
|
| | |
| | | }
|
| | | m_DogZItemModel = ItemModel;
|
| | | var IudetDogzEquipPlus = ItemModel.GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus);
|
| | | if (IudetDogzEquipPlus != null)
|
| | | if (IudetDogzEquipPlus != null && IudetDogzEquipPlus.Count>1)
|
| | | {
|
| | | DogZLv = IudetDogzEquipPlus[0];
|
| | | if (DogZLv > 0)
|
| | |
| | | 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;//未满
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | _ItemColor = itemModelBack.chinItemModel.ItemColor;
|
| | | }
|
| | | }
|
| | | if (Type >= dogz_model.DogzAssistDefaultCnt && ItemColor> _ItemColor)//出战神兽已满,且神兽背包有品质低于已助战神兽品质颜色时
|
| | | if (Type >= dogz_model.curSumAssistNum && ItemColor> _ItemColor)//出战神兽已满,且神兽背包有品质低于已助战神兽品质颜色时
|
| | | {
|
| | | redPointStre1.state = RedPointState.Simple;
|
| | | return;
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | 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;
|
| | | }
|
| | | } |
| | | |
| | | |
| | |
| | | {
|
| | | JumpIndex = 0;
|
| | | godBeastModel.ItemPlace = -1;
|
| | | // godBeastModel.Absorption_Dic.Clear();
|
| | | playerPack.RefreshItemCountAct -= RefreshItemCountAct;
|
| | | m_ScrollerController.OnRefreshCell -= OnRefreshGridCell;
|
| | | DTC0721_tagMakeItemAnswer.MakeItemAnswerEvent -= MakeItemAnswerEvent; |
| | |
| | | {
|
| | | if (arg1 == PackType.rptDogzEquip)
|
| | | {
|
| | | //OnCreateGridLineCell(m_ScrollerController);
|
| | | m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
|
| | | m_GodBeastSlidingList.Init();
|
| | | m_GodBeastAttributes.Init();
|
| | |
| | | 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();//刷新可见
|
| | | });
|
| | |
| | | } |
| | | private void OnEnable()
|
| | | {
|
| | | playerPack.RefreshItemCountAct += RefreshItemCountAct;
|
| | | playerPack.ItemCntReduceAct += ItemCntReduceAct;
|
| | | DTC0721_tagMakeItemAnswer.MakeItemAnswerEvent += MakeItemAnswerEvent;
|
| | | godBeastModel.AbsorbEvent += AbsorbEvent;
|
| | | playerPack.ItemCntAddAct += RefreshItemCountAct;
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | private void OnDisable()
|
| | | {
|
| | | playerPack.RefreshItemCountAct -= RefreshItemCountAct;
|
| | | playerPack.ItemCntReduceAct -= ItemCntReduceAct;
|
| | | DTC0721_tagMakeItemAnswer.MakeItemAnswerEvent -= MakeItemAnswerEvent;
|
| | | godBeastModel.AbsorbEvent -= AbsorbEvent;
|
| | | playerPack.ItemCntAddAct -= RefreshItemCountAct;
|
| | | }
|
| | |
|
| | |
|
| | |
| | | {
|
| | | m_ScrollerController.OnRefreshCell -= OnRefreshGridCell;
|
| | | }
|
| | | private void ItemCntReduceAct(PackType arg1, int arg2, int arg3)
|
| | | private void MakeItemAnswerEvent(H0721_tagMakeItemAnswer obj)
|
| | | {
|
| | | if (arg1 == PackType.rptDogzItem)
|
| | | if ((int)obj.MakeType == (int)MakeType.Def_mitDogzEquipPlus)
|
| | | {
|
| | | if (m_ToggleAll.isOn)
|
| | | {
|
| | | m_ToggleAll.isOn = false;
|
| | | }
|
| | | GetGodBeastBag();
|
| | | FilterQuality();
|
| | | godBeastModel.AbsorbEventUpdate();
|
| | | m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | | private void RefreshItemCountAct(PackType arg1, int arg2, int arg3)
|
| | | {
|
| | | if (arg1 == PackType.rptDogzItem)
|
| | |
| | | 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++)
|
| | | {
|
| | | 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;
|
| | | } |
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | public void RequestHighestEffect()
|
| | | {
|
| | | RecycleHighestEffect();
|
| | | Treasure _treasure;
|
| | | if (category == TreasureCategory.Human &&
|
| | | model.TryGetTreasure(treasureId, out _treasure) && _treasure.IsHighestStage
|
| | | && !model.GetTreasureFinishAnim(treasureId))
|
| | | {
|
| | | highestSfx = SFXPlayUtility.Instance.Play(5198, root);
|
| | | if (highestSfx != null)
|
| | | {
|
| | | highestSfx.duration = 0;
|
| | | LayerUtility.SetLayer(highestSfx.gameObject, LayerUtility.UILayer, true);
|
| | | highestSfx.transform.localPosition = Vector3.zero;
|
| | | highestSfx.transform.LookAt(UI3DTreasureSelectStage.Instance.center);
|
| | | }
|
| | | }
|
| | | //Treasure _treasure;
|
| | | //if (category == TreasureCategory.Human &&
|
| | | // model.TryGetTreasure(treasureId, out _treasure) && _treasure.IsHighestStage
|
| | | // && !model.GetTreasureFinishAnim(treasureId))
|
| | | //{
|
| | | // highestSfx = SFXPlayUtility.Instance.Play(5198, root);
|
| | | // if (highestSfx != null)
|
| | | // {
|
| | | // highestSfx.duration = 0;
|
| | | // LayerUtility.SetLayer(highestSfx.gameObject, LayerUtility.UILayer, true);
|
| | | // highestSfx.transform.localPosition = Vector3.zero;
|
| | | // highestSfx.transform.LookAt(UI3DTreasureSelectStage.Instance.center);
|
| | | // }
|
| | | //}
|
| | | }
|
| | |
|
| | | public void RecycleHighestEffect()
|
| | |
| | |
|
| | | public bool GetTreasureFinishAnim(int _treasureId)
|
| | | {
|
| | | if (_treasureId == 101)
|
| | | {
|
| | | //if (_treasureId == 101)
|
| | | //{
|
| | | return false;
|
| | | }
|
| | | var list = GetTreasureCategory(TreasureCategory.Human);
|
| | | var index = list.IndexOf(_treasureId);
|
| | | if (index == -1)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | uint value = 0;
|
| | | uint.TryParse(QuickSetting.Instance.GetQuickSetting(QuickSetting.QuickSettingType.TreasureHighestAnim, 0), out value);
|
| | | return MathUtility.GetBitValue(value, (ushort)index);
|
| | | //}
|
| | | //var list = GetTreasureCategory(TreasureCategory.Human);
|
| | | //var index = list.IndexOf(_treasureId);
|
| | | //if (index == -1)
|
| | | //{
|
| | | // return false;
|
| | | //}
|
| | | //uint value = 0;
|
| | | //uint.TryParse(QuickSetting.Instance.GetQuickSetting(QuickSetting.QuickSettingType.TreasureHighestAnim, 0), out value);
|
| | | //return MathUtility.GetBitValue(value, (ushort)index);
|
| | | }
|
| | |
|
| | | public void SetTreasureFinishAnim(int _treasureId, bool anim = true)
|
| | | {
|
| | | var list = GetTreasureCategory(TreasureCategory.Human);
|
| | | var index = list.IndexOf(_treasureId);
|
| | | if (index == -1)
|
| | | {
|
| | | return;
|
| | | }
|
| | | uint value = 0;
|
| | | uint.TryParse(QuickSetting.Instance.GetQuickSetting(QuickSetting.QuickSettingType.TreasureHighestAnim, 0), out value);
|
| | | int bitValue = MathUtility.SetBitValue((int)value, (ushort)index, anim);
|
| | | QuickSetting.Instance.SetQuickSetting(QuickSetting.QuickSettingType.TreasureHighestAnim, bitValue);
|
| | | QuickSetting.Instance.SendPackage();
|
| | | //var list = GetTreasureCategory(TreasureCategory.Human);
|
| | | //var index = list.IndexOf(_treasureId);
|
| | | //if (index == -1)
|
| | | //{
|
| | | // return;
|
| | | //}
|
| | | //uint value = 0;
|
| | | //uint.TryParse(QuickSetting.Instance.GetQuickSetting(QuickSetting.QuickSettingType.TreasureHighestAnim, 0), out value);
|
| | | //int bitValue = MathUtility.SetBitValue((int)value, (ushort)index, anim);
|
| | | //QuickSetting.Instance.SetQuickSetting(QuickSetting.QuickSettingType.TreasureHighestAnim, bitValue);
|
| | | //QuickSetting.Instance.SendPackage();
|
| | | }
|
| | |
|
| | | public bool TryGetUnlockShowTreasure(out int _id)
|
| | |
| | | _isRotate = true;
|
| | | }
|
| | | //外部调用,设置停止角度
|
| | | public void SetAngle(float angle)
|
| | | {
|
| | | Angle = angle;
|
| | | } |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Thursday, September 27, 2018 |
| | | //-------------------------------------------------------- |
| | |
|
| | | using LitJson;
|
| | | using System;
|
| | | using System.Collections.Generic;
|
| | | using TableConfig; |
| | | using UnityEngine;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | { |
| | | |
| | | public class WheelOfFortuneModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
|
| | | {
|
| | | public class AngleClass
|
| | | {
|
| | | public float AngleStart;
|
| | | public float AngleEnd;
|
| | | }
|
| | |
|
| | | public int Lattice = -1;//格子
|
| | | public int Number = 0;//次数
|
| | | public int NeedJade = 0;//需要仙玉
|
| | | public float AngleSave = 0f;//角度记录
|
| | | public Dictionary<int, AngleClass> AngleDic = new Dictionary<int, AngleClass>();
|
| | | private int[][] AngleList;
|
| | | public event Action<float> WheelOfFortuneUpdate;
|
| | |
|
| | | private string StrKey = string.Empty;
|
| | | private bool IsOk = false;
|
| | | public override void Init()
|
| | | {
|
| | | var BindJadewheel = Config.Instance.Get<FuncConfigConfig>("BindJadeWheelCfg");
|
| | | NeedJade = int.Parse(BindJadewheel.Numerical1);
|
| | | AngleList = JsonMapper.ToObject<int[][]>(BindJadewheel.Numerical5);
|
| | | for (int i = 0; i < AngleList.Length; i++)
|
| | | {
|
| | | if (AngleDic.Count <= 0)
|
| | | {
|
| | | int Type = i + 1;
|
| | | AngleClass angleClass = new AngleClass();
|
| | | angleClass.AngleStart = AngleList[i][0];
|
| | | angleClass.AngleEnd = AngleList[i][1];
|
| | | AngleDic.Add(Type, angleClass);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | | {
|
| | |
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | IsOk = false;
|
| | | |
| | | }
|
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | IsOk = true;
|
| | | StrKey = "IsOpenFiaryJadeRedPoint" + PlayerDatas.Instance.baseData.PlayerID;
|
| | | AngleSave = LocalSave.GetFloat(StrKey);
|
| | | }
|
| | |
|
| | | public void BindJadeWheelResult(HA324_tagMCBindJadeWheelResult Info)
|
| | | {
|
| | | Lattice = Info.Index;
|
| | | Number = Info.Cnt;
|
| | | if (IsOk)
|
| | | {
|
| | | if (AngleDic.ContainsKey(Lattice))
|
| | | {
|
| | |
|
| | | float flo = UnityEngine.Random.Range(AngleDic[Lattice].AngleStart + 0.05f, AngleDic[Lattice].AngleEnd - 0.05f);
|
| | | LocalSave.SetFloat(StrKey, flo);
|
| | | AngleSave = LocalSave.GetFloat(StrKey);
|
| | | }
|
| | | if (WheelOfFortuneUpdate != null)
|
| | | {
|
| | | WheelOfFortuneUpdate(AngleSave);
|
| | | }
|
| | | }
|
| | | |
| | | }
|
| | | public void StartTheDraw()//开始抽奖
|
| | | {
|
| | | CA517_tagCMStartBindJadeWheel _tagC517 = new CA517_tagCMStartBindJadeWheel();
|
| | | GameNetSystem.Instance.SendInfo(_tagC517);
|
| | | }
|
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 7a605a41a6e674a43b7394d602e4c929 |
| | | timeCreated: 1538032790 |
| | | licenseType: Free |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | [SerializeField] RotatePointer m_RotatePointer; |
| | | [SerializeField] Toggle m_Toggle; |
| | | [SerializeField] Button m_CloseBtn; |
| | | VipModel m_Vipmodel;
|
| | | VipModel vipmodel { get { return m_Vipmodel ?? (m_Vipmodel = ModelCenter.Instance.GetModel<VipModel>()); } } |
| | | WheelOfFortuneModel wheelOfFortuneModel { get { return ModelCenter.Instance.GetModel<WheelOfFortuneModel>(); } }
|
| | | private int remainingTimes = 0;//剩余次数 |
| | | #region Built-in |
| | | protected override void BindController() |
| | | { |
| | |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | IsLottery();//判断是否拥有次数 |
| | | } |
| | | |
| | | protected override void OnAfterOpen() |
| | | { |
| | | wheelOfFortuneModel.WheelOfFortuneUpdate += WheelOfFortuneUpdate; |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | wheelOfFortuneModel.WheelOfFortuneUpdate -= WheelOfFortuneUpdate; |
| | | }
|
| | |
|
| | | private void WheelOfFortuneUpdate(float Angel)
|
| | | {
|
| | | IsLottery();
|
| | | } |
| | | |
| | | protected override void OnAfterClose() |
| | |
| | | |
| | | private void OnClickButton()
|
| | | {
|
| | | wheelOfFortuneModel.StartTheDraw();//开始抽奖
|
| | | m_RotatePointer.SetTime();
|
| | | } |
| | | private void OnClickToggle(bool _bool)
|
| | |
| | | if (_bool)
|
| | | {
|
| | | m_RotatePointer._isRotate = false;
|
| | | m_RotatePointer.SetAngle(m_RotatePointer.Angle);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | }
|
| | |
|
| | | } |
| | | |
| | | private void IsLottery()
|
| | | {
|
| | | int LotteryNumber = vipmodel.GetVipPrivilegeCnt(VipPrivilegeType.BindJadeWheel);
|
| | | if (LotteryNumber > wheelOfFortuneModel.Number)
|
| | | {
|
| | | remainingTimes = LotteryNumber - wheelOfFortuneModel.Number;
|
| | | m_LotteryBtn.interactable = true;
|
| | | }
|
| | | else
|
| | | {
|
| | | m_LotteryBtn.interactable = false;
|
| | | }
|
| | | } |
| | | #endregion |
| | | |
| | | } |
| | |
| | | RegisterModel<PrayForDurgModel>();
|
| | | RegisterModel<FeatureNoticeModel>();
|
| | | RegisterModel<AwardExchangeModel>();
|
| | | RegisterModel<WheelOfFortuneModel>();
|
| | | RegisterModel<TalentModel>();
|
| | | inited = true;
|
| | | }
|
| | |
| | | private WindowSearchConfig _tagWinSearchModel;
|
| | | private FuncOpenLVConfig _tagOpenLvModel;
|
| | | private Dictionary<int, List<string>> openWindows = new Dictionary<int, List<string>>();
|
| | | private Dictionary<int, string> jumpWinNameDict = new Dictionary<int, string>();
|
| | | public Dictionary<int, string> jumpWinNameDict = new Dictionary<int, string>();
|
| | | PlayerPetDatas m_petModel;
|
| | | PlayerPetDatas petmodel
|
| | | {
|
| | |
| | | private void SetJumpLogic<T>(int _functionalOrder = 0, bool _forceSync = true) where T : Window
|
| | | {
|
| | | string curOpenWin = typeof(T).Name;
|
| | | if(jumpWinNameDict.ContainsKey(jumpPhase - 1))
|
| | | {
|
| | | if(jumpWinNameDict[jumpPhase - 1] != curOpenWin)
|
| | | {
|
| | | jumpWinNameDict.Add(jumpPhase, curOpenWin);
|
| | | }
|
| | | else
|
| | | {
|
| | | openWindows[jumpPhase].Clear();
|
| | | jumpPhase -= 1;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | jumpWinNameDict.Add(jumpPhase, curOpenWin);
|
| | | }
|
| | | |
| | | jumpType = _tagWinSearchModel.Type;
|
| | | switch (_tagWinSearchModel.Type)
|
| | | {
|
| | |
| | | [SerializeField] TextImage m_AllianceName;
|
| | | [SerializeField] TextImage m_FairyTitle;
|
| | | [SerializeField] TextImage m_FairyFlag;
|
| | | [SerializeField] TextImage m_AncientKing;
|
| | | [SerializeField] TextImage m_AncientEnemy;
|
| | | [SerializeField] ElderGodAngerBehaviour m_ElderAnger;
|
| | | [SerializeField] IceCrystalScoreBehaviour m_IceCrystalScore;
|
| | | [SerializeField] Transform m_BossDropout;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public void SetAncientKing(bool isAncientKing)
|
| | | {
|
| | | if (m_AncientKing == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | | m_AncientKing.gameObject.SetActive(isAncientKing);
|
| | | if (isAncientKing)
|
| | | {
|
| | | m_AncientKing.SetSprite("IntegralKing");
|
| | | m_AncientKing.SetNativeSize();
|
| | | }
|
| | | }
|
| | |
|
| | | public void SetAncientEnemy(bool isAncientEnemy)
|
| | | {
|
| | | if (m_AncientEnemy == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | | m_AncientEnemy.gameObject.SetActive(isAncientEnemy);
|
| | | if (isAncientEnemy)
|
| | | {
|
| | | m_AncientEnemy.SetSprite("Enemy");
|
| | | m_AncientEnemy.SetNativeSize();
|
| | | }
|
| | | }
|
| | |
|
| | | public void SetAlliance(string _alliance)
|
| | | {
|
| | | if (string.IsNullOrEmpty(_alliance) || _alliance.Length == 0 || _alliance == "")
|
| | |
| | | Hostile,
|
| | | }
|
| | |
|
| | | public enum RoleRenameResult
|
| | | {
|
| | | MoneyErr = 0, //金钱不足
|
| | | NameRuleErr = 1, //名字不合法
|
| | | NameLengErr = 2, //名字长度错误
|
| | | NameRepeatErr = 3, //重名
|
| | | RenameFailErr = 4, //改名失败
|
| | | RenameSuccess = 5, //成功
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// <para>无意义 0</para>
|
| | | /// <para>自己 1</para>
|
| | |
| | | DemonJar = 25,
|
| | | BossHomeAwardLimit = 27,
|
| | | DemonJarDouble = 28,
|
| | | BindJadeWheel=30,
|
| | | }
|
| | |
|
| | |
|