少年修仙传客户端代码仓库
client_linchunjie
2019-01-19 b3048a98f1989534114e10d617849ee05ad76ee4
JadeDynastyBoss
2个文件已添加
10个文件已修改
340 ■■■■■ 已修改文件
System/DailyQuest/DailyQuestWin.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Dungeon/DungeonFightWin.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Dungeon/DungeonInspireBehaviour.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Dungeon/DungeonModel.cs 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Dungeon/DungeonRankBehaviour.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Dungeon/TargetBriefInfoWin.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/JadeDynastyBoss/JadeDynastyBossBehaviour.cs 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/JadeDynastyBoss/JadeDynastyBossModel.cs 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/JadeDynastyBoss/JadeDynastyBossVictoryWin.cs 232 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/JadeDynastyBoss/JadeDynastyBossVictoryWin.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/JadeDynastyBoss/JadeDynastyBossWin.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Utility/EnumHelper.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/DailyQuest/DailyQuestWin.cs
@@ -315,6 +315,10 @@
                    WindowCenter.Instance.CloseImmediately<DailyQuestWin>();
                    WindowCenter.Instance.Open<CrossServerWin>();
                    break;
                case DailyQuestType.JadeDynastyBoss:
                    WindowCenter.Instance.CloseImmediately<DailyQuestWin>();
                    WindowCenter.Instance.Open<LootPreciousFrameWin>(false, 3);
                    break;
                default:
                    CSharpCallLua.GotoLuaDailyQuest(_id);
                    break;
System/Dungeon/DungeonFightWin.cs
@@ -106,6 +106,9 @@
                case GatherSoulDungeonModel.DUNGEON_MAPID:
                    m_GatherSoulDungeonBehaviour.Display(this);
                    break;
                case JadeDynastyBossModel.JADEDYNASTY_MAP:
                    m_Inspire.gameObject.SetActive(true);
                    break;
                default:
                    break;
            }
System/Dungeon/DungeonInspireBehaviour.cs
@@ -53,7 +53,7 @@
            }
            switch (mapId)
            {
                case 52010:
                case DemonJarModel.DEMONJAR_MAPID:
                    m_Icon.SetSprite("W_XYGuwu_a2");
                    break;
                default:
System/Dungeon/DungeonModel.cs
@@ -840,12 +840,12 @@
                        WindowCenter.Instance.Open<DemonJarDamageRankWin>();
                    }
                    break;
                //case JadeDynastyBossModel.JADEDYNASTY_MAP:
                //    if (!WindowCenter.Instance.IsOpen<JadeDynastyDamageRankWin>())
                //    {
                //        WindowCenter.Instance.Open<JadeDynastyDamageRankWin>();
                //    }
                //    break;
                case JadeDynastyBossModel.JADEDYNASTY_MAP:
                    if (!WindowCenter.Instance.IsOpen<JadeDynastyDamageRankWin>())
                    {
                        WindowCenter.Instance.Open<JadeDynastyDamageRankWin>();
                    }
                    break;
                case TreasureModel.TREASURE_MAPID:
                    break;
                case HeavenBattleModel.HEAVEBATTLE_MAPID:
@@ -906,6 +906,12 @@
                    if (!WindowCenter.Instance.IsOpen<DemonJarDamageRankWin>())
                    {
                        WindowCenter.Instance.Open<DemonJarDamageRankWin>();
                    }
                    break;
                case JadeDynastyBossModel.JADEDYNASTY_MAP:
                    if (!WindowCenter.Instance.IsOpen<JadeDynastyDamageRankWin>())
                    {
                        WindowCenter.Instance.Open<JadeDynastyDamageRankWin>();
                    }
                    break;
            }
@@ -996,6 +1002,9 @@
                                demonJarModel.autoChallengeBoss = 0;
                            }
                            break;
                        case JadeDynastyBossModel.JADEDYNASTY_MAP:
                            WindowCenter.Instance.Open<JadeDynastyBossVictoryWin>();
                            break;
                        case FairyLeagueModel.FAIRY_LEAGUE_DUNGEON:
                        case 31160:
                            break;
System/Dungeon/DungeonRankBehaviour.cs
@@ -39,8 +39,8 @@
            switch (currentDugeonId)
            {
                case 31170:
                //case JadeDynastyBossModel.JADEDYNASTY_MAP:
                case DemonJarModel.DEMONJAR_MAPID:
                case JadeDynastyBossModel.JADEDYNASTY_MAP:
                    {
                        if (model.mission.hurtInfo != null && model.mission.hurtInfo.Length > 0)
                        {
System/Dungeon/TargetBriefInfoWin.cs
@@ -34,7 +34,8 @@
        var mapId = PlayerDatas.Instance.baseData.MapID;
        var dataMapId = ModelCenter.Instance.GetModel<DungeonModel>().GetDataMapIdByMapId(mapId);
        if (dataMapId == DemonJarModel.DEMONJAR_MAPID)
        if (dataMapId == DemonJarModel.DEMONJAR_MAPID
            || dataMapId == JadeDynastyBossModel.JADEDYNASTY_MAP)
        {
            if (_show)
            {
@@ -77,7 +78,8 @@
        var mapId = PlayerDatas.Instance.baseData.MapID;
        var dataMapId = ModelCenter.Instance.GetModel<DungeonModel>().GetDataMapIdByMapId(mapId);
        if (dataMapId == DemonJarModel.DEMONJAR_MAPID)
        if (dataMapId == DemonJarModel.DEMONJAR_MAPID
            || dataMapId == JadeDynastyBossModel.JADEDYNASTY_MAP)
        {
            DemonJarBossLifeBarWin win;
            if (!WindowCenter.Instance.IsOpen<DemonJarBossLifeBarWin>())
System/JadeDynastyBoss/JadeDynastyBossBehaviour.cs
@@ -137,17 +137,24 @@
        {
            m_ContainerUnChanllgeable.gameObject.SetActive(!isUnLocked);
            m_ContainerChallengeable.gameObject.SetActive(isUnLocked);
            var condition = 0;
            var conditionCode = 0;
            JadeDynastyBossCondition condition;
            m_ChallengeCondition.text = string.Empty;
            if (!model.IsBossUnLocked(bossId, out condition))
            if (!model.IsBossUnLocked(bossId, out conditionCode)
                && model.TryGetCondition(bossId, out condition))
            {
                switch (condition)
                switch (conditionCode)
                {
                    case 1:
                        m_ChallengeCondition.text = Language.Get("JadeDynastyBossCondition1", condition.level);
                        break;
                    case 2:
                        m_ChallengeCondition.text = Language.Get("JadeDynastyBossCondition2",
                            UIHelper.GetRealmName(condition.realmLevel, true));
                        break;
                    case 3:
                        m_ChallengeCondition.text = Language.Get("JadeDynastyBossCondition3",
                            UIHelper.ReplaceLargeNum(condition.score));
                        break;
                }
            }
System/JadeDynastyBoss/JadeDynastyBossModel.cs
@@ -12,7 +12,7 @@
        Dictionary<int, int> jadeDynastyBossParticipantDict = new Dictionary<int, int>();
        Dictionary<int, List<Item>> dropItemDict = new Dictionary<int, List<Item>>();
        public const int JADEDYNASTY_MAP = 52010;
        public const int JADEDYNASTY_MAP = 31380;
        public const int FUNCTIONID = 163;
        public const int JADEDYNASTY_REDPOINTID = 77003;
@@ -209,6 +209,20 @@
            return dropItemDict.TryGetValue(bossId, out dropItems);
        }
        public bool TryGetCondition(int bossId, out JadeDynastyBossCondition condition)
        {
            var index = jadeDynastyBosses.FindIndex((x) =>
            {
                return x.bossNpcId == bossId;
            });
            condition = default(JadeDynastyBossCondition);
            if (index != -1)
            {
                condition = jadeDynastyBosses[index].challengeCondition;
            }
            return index != -1;
        }
        public bool TryEnterDungeon(int bossId,out int error)
        {
            var condition = 0;
@@ -232,7 +246,7 @@
            var totalTimes = dungeonModel.GetTotalTimes(JADEDYNASTY_MAP);
            var enterTimes = dungeonModel.GetEnterTimes(JADEDYNASTY_MAP);
            if (enterTimes >= totalTimes)
            if (enterTimes >= totalTimes && assistTimes <= 0)
            {
                error = 4;
                return false;
@@ -254,7 +268,27 @@
        public void DisplayErrorTip(int error)
        {
            switch (error)
            {
                case 1:
                    SysNotifyMgr.Instance.ShowTip("TryEnterJadeDynastyBossError_1");
                    break;
                case 2:
                    SysNotifyMgr.Instance.ShowTip("TryEnterJadeDynastyBossError_2");
                    break;
                case 3:
                    SysNotifyMgr.Instance.ShowTip("TryEnterJadeDynastyBossError_3");
                    break;
                case 4:
                    SysNotifyMgr.Instance.ShowTip("TryEnterJadeDynastyBossError_4");
                    break;
                case 5:
                    SysNotifyMgr.Instance.ShowTip("TryEnterJadeDynastyBossError_5");
                    break;
                case 6:
                    SysNotifyMgr.Instance.ShowTip("CrossMap10");
                    break;
            }
        }
        private void MapLinesUpdateEvent(int mapId)
System/JadeDynastyBoss/JadeDynastyBossVictoryWin.cs
New file
@@ -0,0 +1,232 @@
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Saturday, January 19, 2019
//--------------------------------------------------------
using System;
using System.Collections;
using System.Collections.Generic;
using TableConfig;
using UnityEngine;
using UnityEngine.UI;
namespace Snxxz.UI
{
    public class JadeDynastyBossVictoryWin : Window
    {
        [SerializeField] Transform m_ContainerPoivt;
        [SerializeField] ScrollRect m_RewardsScroll;
        [SerializeField] Text m_ExitTimer;
        [SerializeField] HorizontalLayoutGroup m_RewardLayout;
        [SerializeField] ButtonEx m_Exit;
        float timer = 0f;
        List<DemonJarRewardBehaviour> rewardBehaviours = new List<DemonJarRewardBehaviour>();
        DungeonModel model { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
        JadeDynastyBossModel jadeDynastyModel { get { return ModelCenter.Instance.GetModel<JadeDynastyBossModel>(); } }
        #region Built-in
        protected override void BindController()
        {
        }
        protected override void AddListeners()
        {
            m_Exit.AddListener(ExitDungeon);
        }
        protected override void OnPreOpen()
        {
            timer = 0f;
            m_ContainerPoivt.gameObject.SetActive(false);
        }
        protected override void OnActived()
        {
            base.OnActived();
            var config = Config.Instance.Get<DungeonOpenTimeConfig>(model.dungeonResult.dataMapID);
            StartCoroutine(Co_DelayDisplay(config.DelayTime * 0.001f));
        }
        protected override void OnAfterOpen()
        {
        }
        protected override void OnPreClose()
        {
        }
        protected override void OnAfterClose()
        {
        }
        protected override void LateUpdate()
        {
            base.LateUpdate();
            var endTime = model.GetCoolDownEndTime(DungeonCoolDownType.LeaveMap);
            if (endTime > TimeUtility.ServerNow)
            {
                timer -= Time.deltaTime;
                if (timer < 0f)
                {
                    timer = 1f;
                    var seconds = (endTime - TimeUtility.ServerNow).TotalSeconds;
                    m_ExitTimer.text = Language.Get("DungeonVictoryWin_Btn_Exit_1", Mathf.Clamp((int)seconds, 0, int.MaxValue));
                }
                if (!m_ExitTimer.gameObject.activeInHierarchy)
                {
                    m_ExitTimer.gameObject.SetActive(true);
                }
            }
            else
            {
                if (m_ExitTimer.gameObject.activeInHierarchy)
                {
                    m_ExitTimer.gameObject.SetActive(false);
                }
            }
        }
        #endregion
        IEnumerator Co_DelayDisplay(float _delay)
        {
            yield return new WaitForSeconds(_delay);
            var endTime = model.GetCoolDownEndTime(DungeonCoolDownType.LeaveMap);
            var seconds = (endTime - TimeUtility.ServerNow).TotalSeconds;
            timer = 0f;
            m_ExitTimer.text = Language.Get("DungeonVictoryWin_Btn_Exit_1", Mathf.Clamp((int)seconds, 0, int.MaxValue));
            m_ExitTimer.gameObject.SetActive(true);
            m_ContainerPoivt.gameObject.SetActive(true);
            var serverItems = model.dungeonResult.itemInfo;
            var items = new List<Item>();
            if (serverItems != null)
            {
                for (int i = 0; i < serverItems.Length; i++)
                {
                    items.Add(new Item(serverItems[i].ItemID, serverItems[i].Count));
                }
            }
            items.Sort(RewardSort);
            GenerateRewardBehaviour(m_RewardsScroll.content, items.Count);
            if (items.Count < 6)
            {
                m_RewardLayout.childAlignment = TextAnchor.MiddleCenter;
                (m_RewardLayout.transform as RectTransform).pivot = new Vector2(0.5f, 0.5f);
            }
            else
            {
                m_RewardLayout.childAlignment = TextAnchor.MiddleLeft;
                (m_RewardLayout.transform as RectTransform).pivot = new Vector2(0, 0.5f);
            }
            for (int i = 0; i < rewardBehaviours.Count; i++)
            {
                var behaviour = rewardBehaviours[i];
                if (i < items.Count)
                {
                    behaviour.gameObject.SetActive(true);
                    behaviour.Display(items[i]);
                }
                else
                {
                    behaviour.gameObject.SetActive(false);
                }
            }
        }
        private void ExitDungeon()
        {
            model.ExitCurrentDungeon();
        }
        private int RewardSort(Item _lhs, Item _rhs)
        {
            var config1 = Config.Instance.Get<ItemConfig>(_lhs.id);
            var config2 = Config.Instance.Get<ItemConfig>(_rhs.id);
            var isEquip1 = config1.EquipPlace != 0;
            var isEquip2 = config2.EquipPlace != 0;
            if (!isEquip1 && isEquip2)
            {
                return -1;
            }
            else if (isEquip1 && !isEquip2)
            {
                return 1;
            }
            else if (!isEquip1 && !isEquip2)
            {
                if (config1.Type == 13 && config2.Type != 13)
                {
                    return -1;
                }
                else if (config1.Type != 13 && config2.Type == 13)
                {
                    return 1;
                }
                else
                {
                    return config1.ItemColor > config2.ItemColor ? -1 : 1;
                }
            }
            else
            {
                if ((config1.Type == 108 || config1.Type == 109) && (config2.Type != 108 && config2.Type != 109))
                {
                    return -1;
                }
                else if ((config1.Type != 108 && config1.Type == 109) && (config2.Type == 108 || config2.Type == 109))
                {
                    return 1;
                }
                else
                {
                    if (config1.ItemColor != config2.ItemColor)
                    {
                        return config2.ItemColor.CompareTo(config1.ItemColor);
                    }
                    else if (config1.StarLevel != config2.StarLevel)
                    {
                        return config2.StarLevel.CompareTo(config1.StarLevel);
                    }
                    else
                    {
                        return config2.LV.CompareTo(config1.LV);
                    }
                }
            }
        }
        private void GenerateRewardBehaviour(RectTransform _parent, int _needCount)
        {
            var nowCount = rewardBehaviours.Count;
            var dif = _needCount - nowCount;
            if (dif > 0)
            {
                for (int i = 0; i < dif; i++)
                {
                    var instance = UIUtility.CreateWidget("DemonJarRewardBehaviour", "DemonJarRewardBehaviour");
                    var behaviour = instance.GetComponent<DemonJarRewardBehaviour>();
                    rewardBehaviours.Add(behaviour);
                    instance.transform.SetParentEx(_parent, Vector3.zero, Vector3.zero, Vector3.one);
                }
            }
        }
    }
}
System/JadeDynastyBoss/JadeDynastyBossVictoryWin.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 89694d5b27c7f1c429cd3c2a2cd449c1
timeCreated: 1547865026
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
System/JadeDynastyBoss/JadeDynastyBossWin.cs
@@ -159,7 +159,7 @@
        public void DisplayAssistTimes()
        {
            m_AssistTimes.text = Language.Get("", model.assistTimes);
            m_AssistTimes.text = model.assistTimes.ToString();
        }
        void DisplayDropItems()
@@ -238,7 +238,7 @@
        private void DisplayJadeDynastyScore()
        {
            m_JadeDynastyScore.text = Language.Get("", model.jadeDynastyScore);
            m_JadeDynastyScore.text = Language.Get("JadeDynastyBossWin_Score", UIHelper.ReplaceLargeNum(model.jadeDynastyScore));
        }
        private void SelectBossRefresh(int bossId)
Utility/EnumHelper.cs
@@ -326,6 +326,7 @@
    DungeonAssist = 29,
    GatherSoulDungeon = 30,
    CrossServerPk = 31,
    JadeDynastyBoss = 32,
}
public enum ActivityPrepareType