Jelajahi Sumber

修改红点显示

lzx 1 Minggu lalu
induk
melakukan
22f32803a9

+ 76 - 8
Assets/Scripts/GameLogic/RedDot/RedDotData.cs

@@ -44,16 +44,16 @@ namespace Fort23.Mono
         {
             switch (GroupId)
             {
+                //上阵的功法可以升级显示红点
                 case 1:
                     isEnable = false;
-                    switch (EnableId) //具体出现条件
+                    switch (EnableId) 
                     {
                         case 0: //没有自己的红点逻辑根据下层红点来决定
                             isEnable = RedDotManager.Instance.AllRedDotGroupData[GroupId].TargetLayerIsEnable(Layer);
                             break;
                         case 1:
-                            var _skillPowerupConfigs = ConfigComponent.Instance.GetAll<SkillPowerupConfig>();
-                            foreach (var _skillInfo in PlayerManager.Instance.GongFaControl.allSkill)
+                            foreach (var _skillInfo in PlayerManager.Instance.GongFaControl.allUseSkill)
                             {
                                 if (RedDotManager.Instance.isSkillUpgrade(_skillInfo))
                                 {
@@ -66,14 +66,16 @@ namespace Fort23.Mono
                     }
 
                     break;
-                case 5: //具体组
+                //境界升级
+                case 5: 
                     isEnable = false;
-                    switch (EnableId) //具体出现条件
+                    switch (EnableId) 
                     {
                         case 0: //没有自己的红点逻辑根据下层红点来决定
                             isEnable = RedDotManager.Instance.AllRedDotGroupData[GroupId].TargetLayerIsEnable(Layer);
                             break;
                         case 1:
+
                             int currentMiao =
                                 (int)((TimeHelper.ClientNow() - PlayerManager.Instance.myHero.heroData.upTime) /
                                       1000);
@@ -86,12 +88,78 @@ namespace Fort23.Mono
                                 return;
                             }
 
+                            int redDotID = 5;
+                            AccountFileInfo.RedDot redDot = RedDotManager.Instance.GetRedDot(redDotID);
+
+                            HeroInfo heroInfo = PlayerManager.Instance.myHero.CopyHero();
+                            heroInfo.InitHero(PlayerManager.Instance.myHero.heroData.heroModelId,
+                                PlayerManager.Instance.myHero.heroData.heroPowerId + 1);
+
+                            if (PlayerManager.Instance.myHero.powerUpConfig.jingjie1 == heroInfo.powerUpConfig.jingjie1)
+                            {
+                                //小突破
+                                if (PlayerManager.Instance.myHero.powerUpConfig.jingjie2 ==
+                                    heroInfo.powerUpConfig.jingjie2)
+                                {
+                                    isEnable = true;
+                                    return;
+                                }
+                                //大突破
+                                else
+                                {
+                                    for (var i = 0;
+                                         i < PlayerManager.Instance.myHero.powerUpConfig.DujieMustItemIDs.Length;
+                                         i++)
+                                    {
+                                        if (!PlayerManager.Instance.BagController.IsEnough(
+                                                PlayerManager.Instance.myHero.powerUpConfig.DujieMustItemIDs[i], 1))
+                                        {
+                                            isEnable = false;
+                                            return;
+                                        }
+                                    }
+
+                                    //当前升级已经查看了也不显示红点
+                                    if (redDot != null &&
+                                        redDot.Params.Contains(
+                                            PlayerManager.Instance.myHero.powerUpConfig.ID.ToString()))
+                                    {
+                                        isEnable = false;
+                                        return;
+                                    }
+                                }
+                            }
+                            //渡劫
+                            else
+                            {
+                                for (var i = 0;
+                                     i < PlayerManager.Instance.myHero.powerUpConfig.DujieMustItemIDs.Length;
+                                     i++)
+                                {
+                                    if (!PlayerManager.Instance.BagController.IsEnough(
+                                            PlayerManager.Instance.myHero.powerUpConfig.DujieMustItemIDs[i], 1))
+                                    {
+                                        isEnable = false;
+                                        return;
+                                    }
+                                }
+
+                                //当前升级已经查看了也不显示红点
+                                if (redDot != null &&
+                                    redDot.Params.Contains(PlayerManager.Instance.myHero.powerUpConfig.ID.ToString()))
+                                {
+                                    isEnable = false;
+                                    return;
+                                }
+                            }
+
+
                             isEnable = true;
                             break;
                     }
 
                     break;
-                case 7: //具体组
+                case 7: //具上的代金卷可以免费抽
                     isEnable = false;
                     switch (EnableId) //具体出现条件
                     {
@@ -116,7 +184,7 @@ namespace Fort23.Mono
 
                     break;
 
-                case 8: //具体组
+                case 8: //法宝可以升级或者有新槽位
                     isEnable = false;
                     switch (EnableId) //具体出现条件
                     {
@@ -139,7 +207,7 @@ namespace Fort23.Mono
 
                     break;
 
-                case 11: //具体组
+                case 11: //挂机奖励大于300分钟
                     isEnable = false;
                     switch (EnableId) //具体出现条件
                     {

+ 66 - 7
Assets/Scripts/GameUI/UI/HeroInformationPanel/HeroInformationPanel.cs

@@ -92,7 +92,7 @@ namespace Fort23.Mono
             });
 
 
-            Btn_TuPo.onClick.AddListener(async() =>
+            Btn_TuPo.onClick.AddListener(async () =>
             {
                 if (PlayerManager.Instance.myHero.powerUpConfig.jingjie1 == heroInfo.powerUpConfig.jingjie1)
                 {
@@ -153,6 +153,64 @@ namespace Fort23.Mono
             heroInfo.InitHero(PlayerManager.Instance.myHero.heroData.heroModelId,
                 PlayerManager.Instance.myHero.heroData.heroPowerId + 1);
 
+
+            int currentMiao = (int)((TimeHelper.ClientNow() - PlayerManager.Instance.myHero.heroData.upTime) /
+                                    1000);
+
+            float allexp = currentMiao * PlayerManager.Instance.myHero.powerUpConfig.AutoXiuwei;
+            int redDotID = 5;
+            AccountFileInfo.RedDot redDot = RedDotManager.Instance.GetRedDot(redDotID);
+            if (redDot == null)
+            {
+                redDot = new AccountFileInfo.RedDot();
+                redDot.id = redDotID;
+            }
+
+
+            if (PlayerManager.Instance.myHero.powerUpConfig.jingjie1 == heroInfo.powerUpConfig.jingjie1)
+            {
+                //大突破
+                if (PlayerManager.Instance.myHero.powerUpConfig.jingjie2 != heroInfo.powerUpConfig.jingjie2)
+                {
+                    for (var i = 0;
+                         i < PlayerManager.Instance.myHero.powerUpConfig.DujieMustItemIDs.Length;
+                         i++)
+                    {
+                        if (!PlayerManager.Instance.BagController.IsEnough(
+                                PlayerManager.Instance.myHero.powerUpConfig.DujieMustItemIDs[i], 1))
+                        {
+                            break;
+                        }
+                    }
+
+                    if (!redDot.Params.Contains(PlayerManager.Instance.myHero.powerUpConfig.ID.ToString()))
+                    {
+                        redDot.Params.Add(PlayerManager.Instance.myHero.powerUpConfig.ID.ToString());
+                        RedDotManager.Instance.AddRedDot(redDot);
+                    }
+                }
+            }
+            else
+            {
+                for (var i = 0;
+                     i < PlayerManager.Instance.myHero.powerUpConfig.DujieMustItemIDs.Length;
+                     i++)
+                {
+                    if (!PlayerManager.Instance.BagController.IsEnough(
+                            PlayerManager.Instance.myHero.powerUpConfig.DujieMustItemIDs[i], 1))
+                    {
+                        break;
+                    }
+                }
+
+                if (!redDot.Params.Contains(PlayerManager.Instance.myHero.powerUpConfig.ID.ToString()))
+                {
+                    redDot.Params.Add(PlayerManager.Instance.myHero.powerUpConfig.ID.ToString());
+                    RedDotManager.Instance.AddRedDot(redDot);
+                }
+            }
+
+
             HeroAttributeWidget heroAttributeWidget =
                 await UIManager.Instance.CreateGComponent<HeroAttributeWidget>(null, AttributeRoot);
             heroAttributeWidget.CustomInit(new HeroAttributeData("生命",
@@ -160,13 +218,15 @@ namespace Fort23.Mono
                 "+" + (heroInfo.hp.Value - PlayerManager.Instance.myHero.hp.Value).ToString()));
             HeroAttributeWidgets.Add(heroAttributeWidget);
 
-            heroAttributeWidget = await UIManager.Instance.CreateGComponent<HeroAttributeWidget>(null, AttributeRoot);
+            heroAttributeWidget =
+                await UIManager.Instance.CreateGComponent<HeroAttributeWidget>(null, AttributeRoot);
             heroAttributeWidget.CustomInit(new HeroAttributeData("攻击",
                 PlayerManager.Instance.myHero.attack.Value.ToString(),
                 "+" + (heroInfo.attack.Value - PlayerManager.Instance.myHero.attack.Value).ToString()));
             HeroAttributeWidgets.Add(heroAttributeWidget);
 
-            heroAttributeWidget = await UIManager.Instance.CreateGComponent<HeroAttributeWidget>(null, AttributeRoot);
+            heroAttributeWidget =
+                await UIManager.Instance.CreateGComponent<HeroAttributeWidget>(null, AttributeRoot);
             heroAttributeWidget.CustomInit(new HeroAttributeData("防御",
                 PlayerManager.Instance.myHero.defense.Value.ToString(),
                 "+" + (heroInfo.defense.Value - PlayerManager.Instance.myHero.defense.Value).ToString()));
@@ -201,9 +261,7 @@ namespace Fort23.Mono
             }
 
             Text_Level.text = $"LV{PlayerManager.Instance.myHero.level}";
-            int currentMiao = (int)((TimeHelper.ClientNow() - PlayerManager.Instance.myHero.heroData.upTime) / 1000);
 
-            float allexp = currentMiao * PlayerManager.Instance.myHero.powerUpConfig.AutoXiuwei;
 
             int miao = (int)((PlayerManager.Instance.myHero.powerUpConfig.levelUpExp -
                               (PlayerManager.Instance.myHero.heroData.exp + allexp)) /
@@ -236,7 +294,8 @@ namespace Fort23.Mono
         [CustomMethod(CustomMethodType.Update)]
         public void Update()
         {
-            int currentMiao = (int)((TimeHelper.ClientNow() - PlayerManager.Instance.myHero.heroData.upTime) / 1000);
+            int currentMiao =
+                (int)((TimeHelper.ClientNow() - PlayerManager.Instance.myHero.heroData.upTime) / 1000);
 
             float allexp = currentMiao * PlayerManager.Instance.myHero.powerUpConfig.AutoXiuwei;
 
@@ -381,7 +440,7 @@ namespace Fort23.Mono
                 AudioManager.Instance.PlayAudio("dujie_pizhong.wav");
                 await TimerComponent.Instance.WaitAsync(200);
                 showTextWidgets[i].ShowUI(hpPos.transform.position, -h, HarmType.Default, false);
-     
+
                 hp -= h;
                 hp = hp < 0 ? 0 : hp;
                 Slider_Hp.value = hp;