Răsfoiți Sursa

对战修改敌方随机技能规则

zhaoyang 2 ani în urmă
părinte
comite
5d1caddbc3

+ 14 - 14
GameClient/Assets/Game/HotUpdate/Data/SkillDataManager.cs

@@ -36,20 +36,20 @@ namespace GFGGame
             this.skillData[cardId][skillId] = skillLv;
         }
 
-        //获取npc释放技能顺序
-        public Dictionary<int, RoleSkillCfg> GetNpcSkill()
-        {
-            Dictionary<int, RoleSkillCfg> npcSkillDic = new Dictionary<int, RoleSkillCfg>();
-            RoleSkillCfg[] roleSkillCfgs = RoleSkillCfgArray.Instance.dataArray;
-            List<int> arr = new List<int> { 0, 1, 2, 3, 4, 5, 6, 7 };
-            for (int i = 0; i < roleSkillCfgs.Length; i++)
-            {
-                int partIndex = Random.Range(0, arr.Count);
-                npcSkillDic.Add(arr[partIndex], roleSkillCfgs[i]);
-                arr.RemoveAt(partIndex);
-            }
-            return npcSkillDic;
-        }
+        // //获取npc释放技能顺序
+        // public Dictionary<int, RoleSkillCfg> GetNpcSkill()
+        // {
+        //     Dictionary<int, RoleSkillCfg> npcSkillDic = new Dictionary<int, RoleSkillCfg>();
+        //     RoleSkillCfg[] roleSkillCfgs = RoleSkillCfgArray.Instance.dataArray;
+        //     List<int> arr = new List<int> { 0, 1, 2, 3, 4, 5, 6, 7 };
+        //     for (int i = 0; i < roleSkillCfgs.Length; i++)
+        //     {
+        //         int partIndex = Random.Range(0, arr.Count);
+        //         npcSkillDic.Add(arr[partIndex], roleSkillCfgs[i]);
+        //         arr.RemoveAt(partIndex);
+        //     }
+        //     return npcSkillDic;
+        // }
 
         public int GetSkillLv(int cardId, int skillId)
         {

+ 10 - 11
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryFightTargetScoreView.cs

@@ -87,7 +87,7 @@ namespace GFGGame
         private List<GameObject> _gameObjects = new List<GameObject>();
         private List<GoWrapper> _wrappers = new List<GoWrapper>();
         // private GoWrapper _wrapper5;
-        private Dictionary<int, RoleSkillCfg> _npcSkillDic;
+        // private Dictionary<int, RoleSkillCfg> _npcSkillDic;
 
         private bool playStop = false;
 
@@ -252,8 +252,6 @@ namespace GFGGame
             StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(_levelCfg.fightID);
             SceneController.UpdateFightTarget(fightCfg.targetRes, _sceneObject);
 
-            // _ui.m_selfName.m_txtName.text = RoleDataManager.roleName;
-            // _ui.m_targetName.m_txtName.text = fightCfg.targetName;
             _ui.m_proScore.m_txtNpcScore.text = fightCfg.targetName + " 0";
             _ui.m_proScore.m_txtMineScore.text = RoleDataManager.roleName + " 0";
             _ui.m_btnBack.visible = true;
@@ -268,7 +266,7 @@ namespace GFGGame
 
 
             ScoreSystemData.Instance.SetEquipDicWithType();
-            _npcSkillDic = SkillDataManager.Instance.GetNpcSkill();
+            // _npcSkillDic = SkillDataManager.Instance.GetNpcSkill();
             _index = 0;
             _score = 0;
             _targetScore = 0;
@@ -345,15 +343,11 @@ namespace GFGGame
             double partScore = ScoreSystemData.Instance.GetPartItemScore(partId);
             _ui.m_comMineCircle.m_txtCount.text = ((int)Math.Round(partScore)).ToString();
             _score += (int)Math.Round((partScore + _skillScore)); ;
-            // Debug.Log("zoya: " + "partScore:" + partScore + "_skillScore: " + _skillScore + " _score:" + _score);
-            // Debug.Log("zoya: " + (int)Math.Round(_score));
             EquipDataCache.cacher.totalScore = (int)Math.Round(_score);
-            // Debug.Log("zoya: " + EquipDataCache.cacher.totalScore);
 
 
             StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(_levelCfg.fightID);
             double targetScore = fightCfg.targetPartsScoreArr[_index] * ConstScoreSystem.PART_SCORE;
-            // Debug.Log("targetScore:" + targetScore);
             _ui.m_comTargetCircle.m_txtCount.text = ((int)Math.Round(targetScore)).ToString();
             _targetScore += targetScore;
             EquipDataCache.cacher.npcTotalScore = (int)Math.Round(_targetScore);
@@ -382,11 +376,16 @@ namespace GFGGame
         //释放NPC技能
         private void ReleaseNpcSkill()
         {
-            if (_npcSkillDic.ContainsKey(_index))
+            StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(_levelCfg.fightID);
+
+            if (fightCfg.targerSkillArr.Length > _index)
             {
-                SetSkillValue(_npcSkillDic[_index], SkillDataManager.NPC);
+                RoleSkillCfg cfg = RoleSkillCfgArray.Instance.GetCfg(fightCfg.targerSkillArr[_index]);
+                if (cfg == null) return;
+                SetSkillValue(cfg, SkillDataManager.NPC);
             }
         }
+
         private void PlayScoreAni()
         {
             _ui.m_comMineCircle.target.visible = true;
@@ -687,7 +686,7 @@ namespace GFGGame
                 GameObject.Destroy(_sceneObject);
                 _sceneObject = null;
             }
-            _npcSkillDic.Clear();
+            // _npcSkillDic.Clear();
 
             Timers.inst.Remove(CheckGuide);
         }

BIN
GameClient/Assets/ResIn/Config/excelConfig.sqlite.bytes