Ver código fonte

领取主线宝箱

zhaoyang 3 anos atrás
pai
commit
f7ff2a7024

+ 1 - 1
GameClient/Assets/Game/CSShare

@@ -1 +1 @@
-Subproject commit 7602c99cbcdf9fb220b2220ed8b696dd2a2e0ce0
+Subproject commit 8b0e7e07cab6f80b40555d6de6a560cf1613faaf

+ 2 - 0
GameClient/Assets/Game/HotUpdate/Constant/ConstMessage.cs

@@ -36,5 +36,7 @@ namespace GFGGame
         public const string BUY_STUDIO_PLAY_TIMES = "BUY_STUDIO_PLAY_TIMES";
         public const string NOTICE_STUDIO_PLAY_TIMES = "NOTICE_STUDIO_PLAY_TIMES";
 
+        public const string NOTICE_MAINSTORY_BOXBONUS_STATE = "NOTICE_MAINSTORY_BOXBONUS_STATE";
+
     }
 }

+ 1 - 3
GameClient/Assets/Game/HotUpdate/Data/ScoreSystemData.cs

@@ -153,12 +153,10 @@ namespace GFGGame
         {
             skillScore = 0;
             showCard = false;
-            if (InstanceZonesDataManager.currentCardId <= 0)
+            if (!SkillDataManager.Instance.dicPassivitySkill.TryGetValue(InstanceZonesDataManager.currentCardId, out Dictionary<int, List<PassivitySkillCfg>> cfgs))
             {
                 return;
             }
-            Dictionary<int, List<PassivitySkillCfg>> cfgs = SkillDataManager.Instance.dicPassivitySkill[InstanceZonesDataManager.currentCardId];
-
 
             foreach (int key in cfgs.Keys)
             {

+ 14 - 0
GameClient/Assets/Game/HotUpdate/DressUp/DressUpObjDataCache.cs

@@ -103,6 +103,20 @@ namespace GFGGame
                 _autoPlay = value;
             }
         }
+        public int maxFightSpeed = 8;
+        private int _fightSpeed = 1;
+        public int fightSpeed
+        {
+            get
+            {
+                return _fightSpeed;
+            }
+            set
+            {
+
+                _fightSpeed = value;
+            }
+        }
         public void Dispose()
         {
             _sceneObj = null;

+ 17 - 0
GameClient/Assets/Game/HotUpdate/ServerProxy/MainStorySProxy.cs

@@ -14,6 +14,7 @@ namespace ET
         {
             var levelCfg = StoryLevelCfgArray.Instance.GetCfg(message.LevelCfgId);
             MainStoryDataManager.UpdateBoxBonusStates(levelCfg.chapterId, message.BoxStates);
+            EventAgent.DispatchEvent(ConstMessage.NOTICE_MAINSTORY_BOXBONUS_STATE);
             await ETTask.CompletedTask;
         }
     }
@@ -37,5 +38,21 @@ namespace GFGGame
             }
         }
 
+        //请求剧情关卡数据
+        public static async ETTask<bool> GetMainStoryBoxBonus(int chapterId, int index)
+        {
+            M2C_GetMainStoryBoxBonus response = null;
+            response = (M2C_GetMainStoryBoxBonus)await MessageHelper.SendToServer(new C2M_GetMainStoryBoxBonus() { ChapterId = chapterId, Index = index });
+            if (response != null)
+            {
+                if (response.Error == ErrorCode.ERR_Success)
+                {
+                    MainStoryDataManager.UpdateBoxBonusStates(response.ChapterId, response.BoxStates);
+                    return true;
+                }
+            }
+            return false;
+        }
+
     }
 }

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/DressUp/DressUpFightView.cs

@@ -107,7 +107,7 @@ namespace GFGGame
             _ui.m_txtRecommendCount.SetVar("v1", "" + GameGlobal.myNumericComponent.GetAsInt(ET.NumericType.RecommendCount)).FlushVars();
             _ui.m_btnRecommend.enabled = GameGlobal.myNumericComponent.GetAsInt(ET.NumericType.RecommendCount) > 0;
             _scoreIndex = _ui.m_partsList.m_comboBoxRarity.selectedIndex;
-            _ui.m_btnAutoPlay.visible = FunctionOpenDataManager.Instance.CheckIsFunOpenById(ConstFunctionId.FUNCTION_AUTOPLAY_FIGHT, false);
+            // _ui.m_btnAutoPlay.visible = FunctionOpenDataManager.Instance.CheckIsFunOpenById(ConstFunctionId.FUNCTION_AUTOPLAY_FIGHT, false);
             _levelID = (int)viewData;
             _levelCfg = StoryLevelCfgArray.Instance.GetCfg(_levelID);
             _fightCfg = StoryFightCfgArray.Instance.GetCfg(_levelCfg.fightID);

+ 21 - 11
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryChapterView.cs

@@ -57,6 +57,8 @@ namespace GFGGame
             {
                 OnClickBonusBox(_ui.m_bonusBox3, 2);
             });
+            EventAgent.AddEventListener(ConstMessage.NOTICE_MAINSTORY_BOXBONUS_STATE, UpdateBonusBox);
+
         }
 
         protected override void OnShown()
@@ -79,6 +81,8 @@ namespace GFGGame
             _endLevelItem = null;
             _ui.m_chapter.RemoveChildren(0, 0, true);
             _valueBarController.OnHide();
+            EventAgent.RemoveEventListener(ConstMessage.NOTICE_MAINSTORY_BOXBONUS_STATE, UpdateBonusBox);
+
         }
 
         private void OnClickBtnBack()
@@ -100,9 +104,8 @@ namespace GFGGame
             UpdateBonusBoxName(_ui.m_bonusBox1, "" + chapterCfg.bonusStar1);
             UpdateBonusBoxName(_ui.m_bonusBox2, "" + chapterCfg.bonusStar2);
             UpdateBonusBoxName(_ui.m_bonusBox3, "" + chapterCfg.bonusStar3);
-            UpdateBonusBoxStatus(_ui.m_bonusBox1, 0);
-            UpdateBonusBoxStatus(_ui.m_bonusBox2, 1);
-            UpdateBonusBoxStatus(_ui.m_bonusBox3, 2);
+            UpdateBonusBox();
+
             var list = StoryLevelCfgArray.Instance.GetCfgs(chapterCfg.type, chapterCfg.subType, chapterCfg.id);
             int endLevel = 0;
             for (int i = 0; i < list.Length; i++)
@@ -192,7 +195,12 @@ namespace GFGGame
         {
             bonusBox.m_txtName.text = name;
         }
-
+        private void UpdateBonusBox()
+        {
+            UpdateBonusBoxStatus(_ui.m_bonusBox1, 0);
+            UpdateBonusBoxStatus(_ui.m_bonusBox2, 1);
+            UpdateBonusBoxStatus(_ui.m_bonusBox3, 2);
+        }
         private void UpdateBonusBoxStatus(UI_CompBonusBox bonusBox, int index)
         {
             int status = MainStoryDataManager.GetChapterBonusStatus(MainStoryDataManager.currentChapterCfgId, index);
@@ -208,19 +216,21 @@ namespace GFGGame
             bonusBox.target.data = status;
         }
 
-        private void OnClickBonusBox(UI_CompBonusBox bonusBox, int index)
+        private async void OnClickBonusBox(UI_CompBonusBox bonusBox, int index)
         {
             int status = (int)bonusBox.target.data;
             if (status == ConstBonusStatus.CAN_GET)
             {
-                List<ItemData> bonusList = MainStoryDataManager.GetChapterBonus(MainStoryDataManager.currentChapterCfgId, index);
-                if (bonusList != null && bonusList.Count > 0)
+                bool got = await MainStorySProxy.GetMainStoryBoxBonus(MainStoryDataManager.currentChapterCfgId, index);
+                if (got)
                 {
-                    // ViewManager.Show(ViewName.GET_BONUS_VIEW, bonusList);
-                    ViewManager.Show<RewardView>(bonusList);
-
+                    List<ItemData> bonusList = MainStoryDataManager.GetChapterBonus(MainStoryDataManager.currentChapterCfgId, index);
+                    if (bonusList != null && bonusList.Count > 0)
+                    {
+                        ViewManager.Show<RewardView>(bonusList);
+                    }
+                    UpdateBonusBoxStatus(bonusBox, index);
                 }
-                UpdateBonusBoxStatus(bonusBox, index);
             }
             else if (status == ConstBonusStatus.GOT)
             {

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

@@ -20,7 +20,6 @@ namespace GFGGame
         private const int _range = 100;//圆圈随机范围
         private float _time = 0;// 登峰造极按住的时间
 
-        private float _speed = 1;
         protected override void OnInit()
         {
             base.OnInit();
@@ -46,6 +45,8 @@ namespace GFGGame
             _ui.m_comAllCircle.target.onTouchEnd.Add(AllCircleScoreStart);
             _ui.m_comAllCircle.target.visible = false;
             _ui.m_btnSpeedUp.visible = EquipDataCache.cacher.autoPlay;
+            _ui.m_btnSpeedUp.title = "x" + EquipDataCache.cacher.fightSpeed;
+
             _ui.m_comClickCircle.target.touchable = !EquipDataCache.cacher.autoPlay;
             _ui.m_comAllCircle.target.touchable = !EquipDataCache.cacher.autoPlay;
 
@@ -57,7 +58,6 @@ namespace GFGGame
             _ui.m_proScore.target.value = 0;
             _ui.m_proScore.m_imgFirstScore.x = (((float)fightCfg.score1 / (float)fightCfg.score3)) * _ui.m_proScore.target.width;
 
-            _speed = 1;
             _index = 0;
             _score = 0;
             _prefectCount = 0;
@@ -109,7 +109,7 @@ namespace GFGGame
             else
             {
                 _ui.m_comClickCircle.m_t0.ignoreEngineTimeScale = false;
-                _ui.m_comClickCircle.m_t0.timeScale = _speed;// (1 / _speed);
+                _ui.m_comClickCircle.m_t0.timeScale = EquipDataCache.cacher.fightSpeed;// (1 / _speed);
                 _ui.m_comClickCircle.m_t0.Play(CircleScoreEnd);
             }
 
@@ -124,7 +124,7 @@ namespace GFGGame
             UpdateCircleResult(clickState);
 
             _ui.m_comClickCircle.m_t1.ignoreEngineTimeScale = false;
-            _ui.m_comClickCircle.m_t1.timeScale = _speed;// 1 / _speed;
+            _ui.m_comClickCircle.m_t1.timeScale = EquipDataCache.cacher.fightSpeed;// 1 / _speed;
             _ui.m_comClickCircle.m_t1.Play(() =>
             {
                 CircleResuleEnd();
@@ -164,14 +164,14 @@ namespace GFGGame
                 }
                 else
                 {
-                    Timers.inst.Add(0.5f / _speed, 1, Skip);//评分结束
+                    Timers.inst.Add(0.5f / EquipDataCache.cacher.fightSpeed, 1, Skip);//评分结束
                 }
             }
             else
             {
 
                 _ui.m_comClickCircle.m_loaCircle.onClick.Add(CircleScoreEnd);
-                Timers.inst.Add(ConstScoreSystem.REFRESH_CIRCLE_WITE_TIME / _speed, 1, SkillScoreStart);//下个部分评分
+                Timers.inst.Add(ConstScoreSystem.REFRESH_CIRCLE_WITE_TIME / EquipDataCache.cacher.fightSpeed, 1, SkillScoreStart);//下个部分评分
             }
         }
 
@@ -180,7 +180,7 @@ namespace GFGGame
             //登峰造极评分开始
             _ui.m_comAllCircle.target.visible = true;
             _ui.m_comAllCircle.m_t0.ignoreEngineTimeScale = false;
-            _ui.m_comAllCircle.m_t0.timeScale = _speed;// 1 / _speed;
+            _ui.m_comAllCircle.m_t0.timeScale = EquipDataCache.cacher.fightSpeed;// 1 / _speed;
             _ui.m_comAllCircle.m_t0.Play(() =>
             {
                 AllCircleScoreStart();
@@ -222,7 +222,7 @@ namespace GFGGame
             _score += allCircleScore;
             SetScoreUI();
             _ui.m_comAllCircle.m_t1.ignoreEngineTimeScale = false;
-            _ui.m_comAllCircle.m_t1.timeScale = _speed;// 1 / _speed;
+            _ui.m_comAllCircle.m_t1.timeScale = EquipDataCache.cacher.fightSpeed;// 1 / _speed;
             _ui.m_comAllCircle.m_t1.Play(() =>
             {
                 Timers.inst.Add(1f, 1, Skip);
@@ -239,8 +239,8 @@ namespace GFGGame
         }
         private void OnBtnSpeedUp()
         {
-            _speed = _speed == 1 ? 2 : 1;
-            _ui.m_btnSpeedUp.title = "x" + _speed;
+            EquipDataCache.cacher.fightSpeed = EquipDataCache.cacher.fightSpeed == 1 ? EquipDataCache.cacher.maxFightSpeed : 1;
+            _ui.m_btnSpeedUp.title = "x" + EquipDataCache.cacher.fightSpeed;
         }
 
         private void Skip(object param = null)

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

@@ -23,7 +23,7 @@ namespace GFGGame
         private double _targetMainScore;//战斗目标总主属性分
         private const int _range = 30;//圆圈随机范围
 
-        private float _speed = 1;
+        // private float _speed = 1;
         private bool isAutoPlay = false;
 
         private GameObject _gameObject0;
@@ -115,8 +115,8 @@ namespace GFGGame
             _ui.m_selfName.m_txtName.text = RoleDataManager.roleName;
             _ui.m_targetName.m_txtName.text = fightCfg.targetName;
             _ui.m_btnSpeedUp.visible = EquipDataCache.cacher.autoPlay;
+            _ui.m_btnSpeedUp.title = "x" + EquipDataCache.cacher.fightSpeed;
 
-            _speed = 1;
             UpdateNormal();
             AddEffect();
 
@@ -132,7 +132,7 @@ namespace GFGGame
             {
                 _ui.m_btnSkill0.target.touchable = false;
             }
-            Timers.inst.Add(0.5f / _speed, 1, CircleScoreStart);//评分开始
+            Timers.inst.Add(0.5f / EquipDataCache.cacher.fightSpeed, 1, CircleScoreStart);//评分开始
 
         }
         private void UpdateNormal()
@@ -242,10 +242,10 @@ namespace GFGGame
                 return;
             }
             _ui.m_comMineCircle.m_t0.ignoreEngineTimeScale = false;
-            _ui.m_comMineCircle.m_t0.timeScale = _speed;
+            _ui.m_comMineCircle.m_t0.timeScale = EquipDataCache.cacher.fightSpeed;
             _ui.m_comMineCircle.m_t0.Play(CircleScoreEnd);
             _ui.m_comTargetCircle.m_t0.ignoreEngineTimeScale = false;
-            _ui.m_comTargetCircle.m_t0.timeScale = _speed;
+            _ui.m_comTargetCircle.m_t0.timeScale = EquipDataCache.cacher.fightSpeed;
             _ui.m_comTargetCircle.m_t0.Play();
 
         }
@@ -261,7 +261,7 @@ namespace GFGGame
             {
                 _ui.m_comTargetCircle.target.visible = false;
                 _ui.m_comMineCircle.target.visible = false;
-                Timers.inst.Add(0.5f / _speed, 1, CircleScoreStart);//评分结束
+                Timers.inst.Add(0.5f / EquipDataCache.cacher.fightSpeed, 1, CircleScoreStart);//评分结束
             }
         }
 
@@ -286,7 +286,7 @@ namespace GFGGame
             GProgressBar bar = item.m_proCD;
             bar.visible = true;
             bar.value = 100;
-            bar.TweenValue(0, time / _speed).OnComplete((GTweener tweener) =>
+            bar.TweenValue(0, time / EquipDataCache.cacher.fightSpeed).OnComplete((GTweener tweener) =>
               {
                   GProgressBar bar1 = (GProgressBar)tweener.target;
                   UI_ComBtnSkill item1 = UI_ComBtnSkill.Proxy(bar1.parent);
@@ -341,7 +341,7 @@ namespace GFGGame
             // comRoleSkillScore.m_comRoleSkill.m_c1.selectedIndex = 0;
             comRoleSkillScore.m_txtScore.SetVar("count", score.ToString()).FlushVars();
             comRoleSkillScore.m_t0.ignoreEngineTimeScale = false;
-            comRoleSkillScore.m_t0.timeScale = _speed;
+            comRoleSkillScore.m_t0.timeScale = EquipDataCache.cacher.fightSpeed;
             comRoleSkillScore.m_t0.Play(() =>
                 {
                     comRoleSkillScore.target.visible = false;
@@ -359,7 +359,7 @@ namespace GFGGame
 
             comSkillMinus.visible = true;
             comSkillMinus.value = 0;
-            comSkillMinus.TweenValue(100, 2f / _speed).OnComplete(() =>
+            comSkillMinus.TweenValue(100, 2f / EquipDataCache.cacher.fightSpeed).OnComplete(() =>
               {
                   comSkillMinus.visible = false;
 
@@ -391,7 +391,7 @@ namespace GFGGame
                   if (role == SkillDataManager.MINE)
                   {
                       comRoleSkillScore.m_t0.ignoreEngineTimeScale = false;
-                      comRoleSkillScore.m_t0.timeScale = _speed;
+                      comRoleSkillScore.m_t0.timeScale = EquipDataCache.cacher.fightSpeed;
                       comRoleSkillScore.m_t0.Play(() =>
                       {
                           comRoleSkillScore.target.visible = false;
@@ -400,7 +400,7 @@ namespace GFGGame
                   else
                   {
                       comRoleSkillScore.m_t0.ignoreEngineTimeScale = false;
-                      comRoleSkillScore.m_t0.timeScale = _speed;
+                      comRoleSkillScore.m_t0.timeScale = EquipDataCache.cacher.fightSpeed;
                       comRoleSkillScore.m_t1.Play(() =>
                   {
                       comRoleSkillScore.target.visible = false;
@@ -431,7 +431,7 @@ namespace GFGGame
             comSkillShield.m_holder.visible = true;
             comSkillShield.m_holder1.visible = false;
 
-            Timers.inst.Add(cfg.duration / _speed, 1, (param) =>
+            Timers.inst.Add(cfg.duration / EquipDataCache.cacher.fightSpeed, 1, (param) =>
               {
                   // comSkillShield.target.visible = false;
                   comSkillShield.m_holder.visible = false;
@@ -440,8 +440,8 @@ namespace GFGGame
         }
         private void OnBtnSpeedUp()
         {
-            _speed = _speed == 1 ? 2 : 1;
-            _ui.m_btnSpeedUp.title = "x" + _speed;
+            EquipDataCache.cacher.fightSpeed = EquipDataCache.cacher.fightSpeed == 1 ? EquipDataCache.cacher.maxFightSpeed : 1;
+            _ui.m_btnSpeedUp.title = "x" + EquipDataCache.cacher.fightSpeed;
         }
 
         private void OnBtnBackClick()