Эх сурвалжийг харах

宝物刷新概率根据波次修改

WGL 1 сар өмнө
parent
commit
2475fd201e

+ 13 - 97
ActionTowerDefense/Assets/Scripts/Characters/PlayerController.cs

@@ -523,7 +523,10 @@ public class PlayerController : MoveCharacter
         {
         {
             return false;
             return false;
         }
         }
-        if (state != CharacterState.Conduct && nowConductButton != -1 && conductTime > totalCacheSummonTime)
+        if (state != CharacterState.Conduct 
+            && nowConductButton != -1 
+            && conductController.conductSkills[nowConductButton]!=ConductController.ConductSkills.Null 
+            && conductTime > totalCacheSummonTime)
         {
         {
             CheckTurn();
             CheckTurn();
             if (conductCanRelease[nowConductButton])
             if (conductCanRelease[nowConductButton])
@@ -554,7 +557,7 @@ public class PlayerController : MoveCharacter
 
 
     public bool CheckConduct()
     public bool CheckConduct()
     {
     {
-        if (isBtnEastUp || isBtnWestUp || isBtnSouthUp)
+        if (isBtnWestUp || isBtnSouthUp || isBtnEastUp)
         {
         {
             if (isReadyConduct)
             if (isReadyConduct)
             {
             {
@@ -636,96 +639,6 @@ public class PlayerController : MoveCharacter
         return false;
         return false;
     }
     }
 
 
-    public void Conduct()
-    {
-            //switch (conductSkills[cacheConductId])
-            //{
-            //    //¾ÞÈË
-            //    case ConductSkills.AddAttack:
-            //        List<Demonic> newGiants = new List<Demonic>();
-            //        foreach (Demonic d in demonicDic[cacheConductId])
-            //        {
-            //            if (!d.isDie)
-            //            {
-            //                newGiants.Add(d);
-            //                if (d.attackController.addAttackEffect == null)
-            //                {
-            //                    d.attackController.addAttackEffect = Instantiate(attackEffect, d.bodyTrans.position, new Quaternion(0, 0, 0, 0), d.bodyTrans);
-            //                }
-            //                d.attackController.addAttackEffect.transform.GetChild(0).gameObject.SetActive(true);
-            //            }
-            //        }
-            //        foreach (Demonic d in newGiants)
-            //        {
-            //            int damage = d.attackController.curDamage;
-            //            d.attackController.curDamage += (int)(addRate * boostNum * damage);
-            //        }
-            //        break;
-            //    //Æø¹¦Ê¦
-            //    case ConductSkills.Mountain:
-            //        conductCanRelease[cacheConductId] = false;
-            //        GameObject curMountain = Instantiate(mountain, null);
-            //        Vector3 moffset = mountainOffset;
-            //        Vector3 sc = curMountain.transform.localScale;
-            //        sc.x = largeX * dienum;
-            //        curMountain.transform.localScale = sc;
-            //        if (bodyTrans.localScale.x < 0)
-            //        {
-            //            moffset.x = mountainOffset.x + sc.x / 2;
-            //        }
-            //        else
-            //        {
-            //            moffset.x = -mountainOffset.x - sc.x / 2;
-            //        }
-            //        Mountain MT = curMountain.GetComponent<Mountain>();
-            //        curMountain.transform.position = transform.position + moffset;
-            //        MT.pc = this;
-            //        MT.id = cacheConductId;
-            //        MT.demonicNum = boostNum;
-            //        break;
-            //    case ConductSkills.WavePower:
-            //        rb.constraints = RigidbodyConstraints.FreezeAll;
-            //        rb.useGravity = false;
-            //        conductCanRelease[cacheConductId] = false;
-            //        obj = Instantiate(wavePowerObj, transform);
-            //        obj.transform.position = transform.position + Vector3.up;
-            //        WavePowerSkill wps = obj.GetComponent<WavePowerSkill>();
-            //        wps.continueTime = wps.singleTime * dienum;
-            //        wps.longFX = (int)bodyTrans.localScale.x;
-            //        wps.damage = wavePowerDamage * boostNum;
-            //        wps.cacheID = cacheConductId;
-            //        wps.pc = this;
-            //        break;
-            //    case ConductSkills.SwordsControl:
-            //        conductCanRelease[cacheConductId] = false;
-            //        obj = Instantiate(flyingSwordsObj, transform);
-            //        obj.transform.position = transform.position + Vector3.up;
-            //        SwordsControl swordsControl = obj.GetComponentInChildren<SwordsControl>();
-            //        swordsControl.owner = this;
-            //        swordsControl.conductId = cacheConductId;
-            //        swordsControl.boostNum = boostNum;
-            //        break;
-            //    //¹­¼ýÊÖ
-            //    case ConductSkills.AngryBullet:
-            //        conductCanRelease[cacheConductId] = false;
-            //        obj = Instantiate(angryBulletObj);
-            //        AngryBulletControl angryBulletControl = obj.GetComponent<AngryBulletControl>();
-            //        angryBulletControl.playerController = this;
-            //        angryBulletControl.cacheConductId = cacheConductId;
-            //        angryBulletControl.maxNum = boostNum * angryBulletNum;
-            //        break;
-            //    case ConductSkills.FlyingSwords:
-            //        obj = Instantiate(fanFlyingSwords);
-            //        FanFlyingSwords FFS = obj.GetComponent<FanFlyingSwords>();
-            //        FFS.owner = this;
-            //        FFS.angleRange = flyingSwordsAngleRange;
-            //        FFS.arrivalAngle = flyintSwordsArrivalAngle;
-            //        FFS.swordsNum = boostNum * flyingSwordsNum;
-            //        FFS.Biu();
-            //        break;
-            //}
-    }
-
     private int cannotConductfx;
     private int cannotConductfx;
     private void CannotConductFX(int id)
     private void CannotConductFX(int id)
     {
     {
@@ -1555,11 +1468,9 @@ public class PlayerController : MoveCharacter
 
 
     public void Summon(int id)
     public void Summon(int id)
     {
     {
-        GameObject prefab;
-        prefab = demonicPrefabs[id];
         ChangeState(CharacterState.Summon);
         ChangeState(CharacterState.Summon);
         summonTime = totalSummonTime;
         summonTime = totalSummonTime;
-        Demonic dem = prefab.GetComponent<Demonic>();
+        Demonic dem = demonicPrefabs[id].GetComponent<Demonic>();
         float costMp = dem.costMp;
         float costMp = dem.costMp;
         for (int i = 0; i < 3; i++)
         for (int i = 0; i < 3; i++)
         {
         {
@@ -1571,7 +1482,8 @@ public class PlayerController : MoveCharacter
         }
         }
         mp -= costMp;
         mp -= costMp;
         uiMp.Show(mp, totalMp);
         uiMp.Show(mp, totalMp);
-        GameObject demonicObj = PoolManager.Instantiate(prefab);
+        CreateDemonic(demonicPrefabs[id]);
+        GameObject demonicObj = PoolManager.Instantiate(demonicPrefabs[id]);
         Demonic demonic = demonicObj.GetComponent<Demonic>();
         Demonic demonic = demonicObj.GetComponent<Demonic>();
         slr.SoldierAddLevelBuff(demonic);
         slr.SoldierAddLevelBuff(demonic);
         GameManager gameManager = GameManager.instance;
         GameManager gameManager = GameManager.instance;
@@ -1632,7 +1544,7 @@ public class PlayerController : MoveCharacter
         }
         }
         demonic.player = this;
         demonic.player = this;
         demonic.Init();
         demonic.Init();
-        int order = prefab.GetComponent<Demonic>().baseSortingOrder + demonicDic[demonic.id].Count;
+        int order = demonicPrefabs[id].GetComponent<Demonic>().baseSortingOrder + demonicDic[demonic.id].Count;
         demonic.SetSortingOrder(order);
         demonic.SetSortingOrder(order);
 
 
         int attackSummonId = nowAttackSummonID;
         int attackSummonId = nowAttackSummonID;
@@ -1671,6 +1583,10 @@ public class PlayerController : MoveCharacter
         
         
     }
     }
 
 
+    public void CreateDemonic(GameObject prefab)
+    {
+        
+    }
     public void OnDemonicRecycle(Demonic demonic)
     public void OnDemonicRecycle(Demonic demonic)
     {
     {
         if (!demonicDic.ContainsKey(demonic.id))
         if (!demonicDic.ContainsKey(demonic.id))

+ 28 - 80
ActionTowerDefense/Assets/Scripts/Conduct/ConductController.cs

@@ -4,6 +4,18 @@ using System.Collections.Generic;
 using System;
 using System;
 using System.Linq;
 using System.Linq;
 
 
+public enum AttributeTag
+{
+    [LabelText("飞行")] Flying = 1,
+    [LabelText("风")] Wind = 2,
+    [LabelText("水")] Water = 3,
+    [LabelText("岩")] Earth = 4,
+    [LabelText("地面")] Ground = 5,
+    [LabelText("雷")] Lightning = 6,
+    [LabelText("火")] Fire = 7,
+    [LabelText("木")] Nature = 8,
+}
+
 public class ConductController : MonoBehaviour
 public class ConductController : MonoBehaviour
 {
 {
     //组件
     //组件
@@ -12,32 +24,29 @@ public class ConductController : MonoBehaviour
     //融魂技
     //融魂技
     public enum ConductSkills
     public enum ConductSkills
     {
     {
-        //弓箭手
-        //[LabelText("怨气弹")]
-        //AngryBullet,
+        Null,
+        [LabelText("冥火涅槃")] NetherfireRebirth,
         [LabelText("扇形飞剑")]
         [LabelText("扇形飞剑")]
         FlyingSwords,
         FlyingSwords,
-
-        //胖子
         [LabelText("合成大胖子")]
         [LabelText("合成大胖子")]
         Giant,
         Giant,
         [LabelText("光球")]
         [LabelText("光球")]
         Photon, 
         Photon, 
-        //[LabelText("增加攻击力")]
-        //AddAttack,
-
-        //棒子
-        //[LabelText("泰山压顶")]
-        //Mountain,
-        //[LabelText("气功波")]
-        //WavePower,
-        //[LabelText("御剑术")]
-        //SwordsControl,
     }
     }
 
 
-    [LabelText("转换率")] public float[] conversionRate;
+    [LabelText("品质")] public int[] rarity;
+    public int[] conversionRate;
     [LabelText("融魂技")] public ConductSkills[] conductSkills;
     [LabelText("融魂技")] public ConductSkills[] conductSkills;
 
 
+    //冥火涅槃
+    [Serializable] public struct NetherfireRebirth
+    {
+        [LabelText("标签")] public AttributeTag attributeTag;
+        [LabelText("献祭比例(%)")] public int[] sacrificeRatio;
+        [LabelText("效果规模")] public int[] power;
+    }
+    [LabelText("冥火涅槃")] public NetherfireRebirth netherfireRebirth;
+
     //扇形飞剑
     //扇形飞剑
     [Serializable]
     [Serializable]
     public struct FlyingSwords
     public struct FlyingSwords
@@ -120,6 +129,9 @@ public class ConductController : MonoBehaviour
             }
             }
             switch (conductSkills[demonicId])
             switch (conductSkills[demonicId])
             {
             {
+                case ConductSkills.NetherfireRebirth:
+
+                    break;
                 /*弓箭手*/
                 /*弓箭手*/
                 case ConductSkills.FlyingSwords:
                 case ConductSkills.FlyingSwords:
                     obj = PoolManager.Instantiate(flyingSwords.obj);
                     obj = PoolManager.Instantiate(flyingSwords.obj);
@@ -189,61 +201,6 @@ public class ConductController : MonoBehaviour
                     photon.photosphere = photosphere;
                     photon.photosphere = photosphere;
                     photon.havePhoton = true;
                     photon.havePhoton = true;
                     break;
                     break;
-                    //        case ConductSkills.AddAttack:
-                    //            List<Demonic> newGiants = new List<Demonic>();
-                    //            foreach (Demonic d in demonicDic[cacheConductId])
-                    //            {
-                    //                if (!d.isDie)
-                    //                {
-                    //                    newGiants.Add(d);
-                    //                    if (d.attackController.addAttackEffect == null)
-                    //                    {
-                    //                        d.attackController.addAttackEffect = Instantiate(attackEffect, d.bodyTrans.position, new Quaternion(0, 0, 0, 0), d.bodyTrans);
-                    //                    }
-                    //                    d.attackController.addAttackEffect.transform.GetChild(0).gameObject.SetActive(true);
-                    //                }
-                    //            }
-                    //            foreach (Demonic d in newGiants)
-                    //            {
-                    //                int damage = d.attackController.curDamage;
-                    //                d.attackController.curDamage += (int)(addRate * boostNum * damage);
-                    //            }
-                    //            break;
-                    //        //气功师
-                    //        case ConductSkills.Mountain:
-                    //            conductCanRelease[cacheConductId] = false;
-                    //            GameObject curMountain = Instantiate(mountain, null);
-                    //            Vector3 moffset = mountainOffset;
-                    //            Vector3 sc = curMountain.transform.localScale;
-                    //            sc.x = largeX * dienum;
-                    //            curMountain.transform.localScale = sc;
-                    //            if (bodyTrans.localScale.x < 0)
-                    //            {
-                    //                moffset.x = mountainOffset.x + sc.x / 2;
-                    //            }
-                    //            else
-                    //            {
-                    //                moffset.x = -mountainOffset.x - sc.x / 2;
-                    //            }
-                    //            Mountain MT = curMountain.GetComponent<Mountain>();
-                    //            curMountain.transform.position = transform.position + moffset;
-                    //            MT.pc = this;
-                    //            MT.id = cacheConductId;
-                    //            MT.demonicNum = boostNum;
-                    //            break;
-                    //        case ConductSkills.WavePower:
-                    //            rb.constraints = RigidbodyConstraints.FreezeAll;
-                    //            rb.useGravity = false;
-                    //            conductCanRelease[cacheConductId] = false;
-                    //            obj = Instantiate(wavePowerObj, transform);
-                    //            obj.transform.position = transform.position + Vector3.up;
-                    //            WavePowerSkill wps = obj.GetComponent<WavePowerSkill>();
-                    //            wps.continueTime = wps.singleTime * dienum;
-                    //            wps.longFX = (int)bodyTrans.localScale.x;
-                    //            wps.damage = wavePowerDamage * boostNum;
-                    //            wps.cacheID = cacheConductId;
-                    //            wps.pc = this;
-                    //            break;
                     //        case ConductSkills.SwordsControl:
                     //        case ConductSkills.SwordsControl:
                     //            conductCanRelease[cacheConductId] = false;
                     //            conductCanRelease[cacheConductId] = false;
                     //            obj = Instantiate(flyingSwordsObj, transform);
                     //            obj = Instantiate(flyingSwordsObj, transform);
@@ -253,15 +210,6 @@ public class ConductController : MonoBehaviour
                     //            swordsControl.conductId = cacheConductId;
                     //            swordsControl.conductId = cacheConductId;
                     //            swordsControl.boostNum = boostNum;
                     //            swordsControl.boostNum = boostNum;
                     //            break;
                     //            break;
-                    //        //弓箭手
-                    //        case ConductSkills.AngryBullet:
-                    //            conductCanRelease[cacheConductId] = false;
-                    //            obj = Instantiate(angryBulletObj);
-                    //            AngryBulletControl angryBulletControl = obj.GetComponent<AngryBulletControl>();
-                    //            angryBulletControl.playerController = this;
-                    //            angryBulletControl.cacheConductId = cacheConductId;
-                    //            angryBulletControl.maxNum = boostNum * angryBulletNum;
-                    //            break;
 
 
             }
             }
         }
         }

+ 66 - 14
ActionTowerDefense/Assets/Scripts/GameManager.cs

@@ -45,18 +45,27 @@ public class GameManager : MonoBehaviour
     [FoldoutGroup("金币结算")][LabelText("金币掉落特效")] public GameObject dropGoldFX;
     [FoldoutGroup("金币结算")][LabelText("金币掉落特效")] public GameObject dropGoldFX;
     [FoldoutGroup("金币结算")][LabelText("金币掉落字体")] public GameObject dropGoldText;
     [FoldoutGroup("金币结算")][LabelText("金币掉落字体")] public GameObject dropGoldText;
 
 
-    [FoldoutGroup("Rogue数值")] [LabelText("伤害")] public int damage;
-    [FoldoutGroup("Rogue数值")] [LabelText("暴击率")] public int criticalChance;
-    [FoldoutGroup("Rogue数值")] [LabelText("回血")] public int regeneration;
-    [FoldoutGroup("Rogue数值")] [LabelText("吸血")] public int lifesteal;
-    [FoldoutGroup("Rogue数值")] [LabelText("护甲")] public int armor;
-    [FoldoutGroup("Rogue数值")] [LabelText("闪避")] public int dodge;
-    [FoldoutGroup("Rogue数值")] [LabelText("血量上限")] public int totalHp;
-    [FoldoutGroup("Rogue数值")] [LabelText("金币获得增加")] public int increasedGoldGain;
-    [FoldoutGroup("Rogue数值")] [LabelText("经验获得增加")] public int increasedEXPGain;
-    [FoldoutGroup("Rogue数值")] [LabelText("冲刺次数")] public int dashCharges;
-    [FoldoutGroup("Rogue数值")] [LabelText("蓝量")] public int totalMp;
-    [FoldoutGroup("Rogue数值")] [LabelText("回蓝速度")] public int mpRegen;
+    [Header("商店刷新")]
+    [FoldoutGroup("Rogue")] [LabelText("第几关开始出现(%)")] public List<int> unlockLevel;
+    [FoldoutGroup("Rogue")] [LabelText("基础几率(%)")] public List<float> baseChance;
+    [FoldoutGroup("Rogue")] [LabelText("每关增加的几率(%)")] public List<float> chanceIncreasePerLevel;
+    [FoldoutGroup("Rogue")] [LabelText("最大几率(%)")] public List<float> maximumChance ;
+    [FoldoutGroup("Rogue")] public List<List<SingleTreasureConfig>> treasuresList;
+    [FoldoutGroup("Rogue")] [DisplayOnly] public List<float> trueRefreshChance;
+    [FoldoutGroup("Rogue")] [HideInInspector] public List<float> refreshChance;
+    [Header("数值加成")]
+    [FoldoutGroup("Rogue")] [LabelText("伤害")] public int damage;
+    [FoldoutGroup("Rogue")] [LabelText("暴击率")] public int criticalChance;
+    [FoldoutGroup("Rogue")] [LabelText("回血")] public int regeneration;
+    [FoldoutGroup("Rogue")] [LabelText("吸血")] public int lifesteal;
+    [FoldoutGroup("Rogue")] [LabelText("护甲")] public int armor;
+    [FoldoutGroup("Rogue")] [LabelText("闪避")] public int dodge;
+    [FoldoutGroup("Rogue")] [LabelText("血量上限")] public int totalHp;
+    [FoldoutGroup("Rogue")] [LabelText("金币获得增加")] public int increasedGoldGain;
+    [FoldoutGroup("Rogue")] [LabelText("经验获得增加")] public int increasedEXPGain;
+    [FoldoutGroup("Rogue")] [LabelText("冲刺次数")] public int dashCharges;
+    [FoldoutGroup("Rogue")] [LabelText("蓝量")] public int totalMp;
+    [FoldoutGroup("Rogue")] [LabelText("回蓝速度")] public int mpRegen;
 
 
     public LeveType leveType;
     public LeveType leveType;
     [LabelText("下一关倍率增幅")] public List<float> ratioIncrease = new List<float> { 0.4f, 1.6f, -0.8f };
     [LabelText("下一关倍率增幅")] public List<float> ratioIncrease = new List<float> { 0.4f, 1.6f, -0.8f };
@@ -113,6 +122,26 @@ public class GameManager : MonoBehaviour
         }
         }
         leveType = LeveType.Introduction;
         leveType = LeveType.Introduction;
         myTreasures = new List<Treasure>();
         myTreasures = new List<Treasure>();
+        treasuresList = new List<List<SingleTreasureConfig>>();
+        refreshChance = new List<float>();
+        for (int i = 0; i < 4; i++)
+        {
+            treasuresList.Add(new List<SingleTreasureConfig>());
+            refreshChance.Add(baseChance[i]);
+        }
+        trueRefreshChance = new List<float>();
+        for (int i = 0; i < 3; i++)
+        {
+            trueRefreshChance.Add(refreshChance[i] - refreshChance[i + 1]);
+        }
+        trueRefreshChance.Add(refreshChance[3]);
+        List<SingleTreasureConfig> cfgTreasureList = allCfgData.CfgTreasure.DataList;
+        for(int i = 0;i< cfgTreasureList.Count; i++)
+        {
+            SingleTreasureConfig singleTreasureConfig = cfgTreasureList[i];
+            treasuresList[singleTreasureConfig.Quality].Add(singleTreasureConfig);
+        }
+        nowLevel = 1;
     }
     }
 
 
     private void Start()
     private void Start()
@@ -180,7 +209,6 @@ public class GameManager : MonoBehaviour
     public void NextLevel()
     public void NextLevel()
     {
     {
         shopButton.SetActive(false);
         shopButton.SetActive(false);
-        nowLevel += 1;
         if(nowLevel - 1 < ratioIncrease.Count)
         if(nowLevel - 1 < ratioIncrease.Count)
         {
         {
             levelRatio += ratioIncrease[nowLevel - 1];
             levelRatio += ratioIncrease[nowLevel - 1];
@@ -215,6 +243,8 @@ public class GameManager : MonoBehaviour
         LevelSelect.instance.ChangeText();
         LevelSelect.instance.ChangeText();
         gameTime = 0;
         gameTime = 0;
         gameType = GameType.Gaming;
         gameType = GameType.Gaming;
+        nowLevel += 1;
+        ChangeRogueChance();
     }
     }
 
 
     public void ShowShop()
     public void ShowShop()
@@ -282,8 +312,30 @@ public class GameManager : MonoBehaviour
                     mpRegen += (int)data;
                     mpRegen += (int)data;
                     player.mpReplySpeed += (int)data;
                     player.mpReplySpeed += (int)data;
                     break;
                     break;
-                    
+                default:
+                    Debug.LogError($"宝物配置出错,不存在词条【{treasure.type[i]}】");
+                    break;
+            }
+        }
+    }
+
+    public void ChangeRogueChance()
+    {
+        for(int i = 0; i < 4; i++)
+        {
+            if(nowLevel >= unlockLevel[i])
+            {
+                refreshChance[i] += chanceIncreasePerLevel[i];
+                if(refreshChance[i] > maximumChance[i])
+                {
+                    refreshChance[i] = maximumChance[i];
+                }
             }
             }
         }
         }
+        for (int i = 0; i < 3; i++)
+        {
+            trueRefreshChance.Add(refreshChance[i] - refreshChance[i + 1]);
+        }
+        trueRefreshChance.Add(refreshChance[3]);
     }
     }
 }
 }

+ 17 - 34
ActionTowerDefense/Assets/Scripts/UI/ShopUI.cs

@@ -27,14 +27,11 @@ public class ShopUI : MonoBehaviour
     
     
     public void Init()
     public void Init()
     {
     {
+        GameManager gameManager = GameManager.instance;
         refreshPrice = refreshNum + 1;
         refreshPrice = refreshNum + 1;
 
 
-        moneyText.text = $"{GameManager.instance.money}";
+        moneyText.text = $"{gameManager.money}";
         refreshPriceText.text = $"-{refreshPrice}";
         refreshPriceText.text = $"-{refreshPrice}";
-
-        CfgTreasure cfgTreasure = GameManager.instance.allCfgData.CfgTreasure;
-        List<SingleTreasureConfig> singleTreasureConfigs = cfgTreasure.DataList;
-
         List<int> randomTreasure = new List<int>();
         List<int> randomTreasure = new List<int>();
         for(int i = 0; i < 5; i++)
         for(int i = 0; i < 5; i++)
         {
         {
@@ -49,39 +46,25 @@ public class ShopUI : MonoBehaviour
             {
             {
                 continue;
                 continue;
             }
             }
-            int randId = 0;
-            int x = Random.Range(0, 193);
-            int a = -1;
-            if (x < 100)
-            {
-                a = 0;
-            }
-            else if (x < 160)
+            int targetQualityID = -1;
+            float randomQuality = Random.Range(0f, 100f);
+            float refreshChance = 0;
+            for(int j = 0; j < 4; j++)
             {
             {
-                a = 1;
-            }
-            else if(x < 185)
-            {
-                a = 2;
-            }
-            else
-            {
-                a = 3;
-            }
-            int b = 0;
-            while (b < 10)
-            {
-                b++;
-                randId = Random.Range(0, singleTreasureConfigs.Count);
-                if (!randomTreasure.Exists(x => x == singleTreasureConfigs[randId].ID))
+                refreshChance += gameManager.trueRefreshChance[j];
+                if(randomQuality <= refreshChance)
                 {
                 {
-                    if(singleTreasureConfigs[randId].Quality == a)
-                    {
-                        break;
-                    }
+                    targetQualityID = j;
+                    break;
                 }
                 }
             }
             }
-            SingleTreasureConfig singleTreasureConfig = singleTreasureConfigs[randId];
+            int randId = Random.Range(0, gameManager.treasuresList[targetQualityID].Count);
+            SingleTreasureConfig singleTreasureConfig = gameManager.treasuresList[targetQualityID][randId];
+            while (randomTreasure.Exists(x => x == gameManager.treasuresList[targetQualityID][randId].ID))
+            {
+                randId = Random.Range(0, gameManager.treasuresList[targetQualityID].Count);
+                singleTreasureConfig = gameManager.treasuresList[targetQualityID][randId];
+            }
             Sprite sprite = Resources.Load<Sprite>($"Textures/UI/Treasure/{singleTreasureConfig.SpriteName}");
             Sprite sprite = Resources.Load<Sprite>($"Textures/UI/Treasure/{singleTreasureConfig.SpriteName}");
             List<Sprite> tags = new List<Sprite>();
             List<Sprite> tags = new List<Sprite>();
             for (int j = 0; j < singleTreasureConfig.Tag.Count; j++)
             for (int j = 0; j < singleTreasureConfig.Tag.Count; j++)