From 7e9ae336dce92f0ed2abcf2d6eea2f205598407d Mon Sep 17 00:00:00 2001
From: QD_LCJ <461730578@qq.com>
Date: 星期四, 09 八月 2018 15:43:13 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts

---
 System/Welfare/MultipleRealmPointModel.cs.meta |   12 ++++
 System/Pet/PetAttributeMethods.cs              |    4 +
 System/Welfare/WelfareWin.cs                   |    2 
 System/WindowJump/WindowJumpMgr.cs             |    6 +-
 System/WorldMap/MapModel.cs                    |    8 +-
 System/Welfare/MultipleRealmPointModel.cs      |   96 ++++++++++++++++++++++++++++++++
 System/WindowBase/ModelCenter.cs               |    1 
 Fight/Stage/Dungeon/DungeonStage.cs            |    7 +
 Fight/Actor/AI/HeroAI_Auto.cs                  |    7 -
 9 files changed, 128 insertions(+), 15 deletions(-)

diff --git a/Fight/Actor/AI/HeroAI_Auto.cs b/Fight/Actor/AI/HeroAI_Auto.cs
index 78a0658..8d2945f 100644
--- a/Fight/Actor/AI/HeroAI_Auto.cs
+++ b/Fight/Actor/AI/HeroAI_Auto.cs
@@ -358,11 +358,13 @@
             {
                 _hero.Behaviour.DoCommonAttack();
                 m_DecideSkill = null;
+                m_UserClickSkillID = -1;
             }
             else
             {
                 _hero.Behaviour.DoAttack(_skill);
                 m_DecideSkill = null;
+                m_UserClickSkillID = -1;
             }
         }
 
@@ -402,12 +404,7 @@
         //}
         m_PauseStartTime = Time.realtimeSinceStartup;
         m_State = 1;
-        m_UserClickSkillID = -1;
         GA_Hero _hero = PlayerDatas.Instance.hero;
-        if (_hero != null)
-        {
-            _hero.StopRush();
-        }
         m_NeedMoveToPos = false;
     }
 
diff --git a/Fight/Stage/Dungeon/DungeonStage.cs b/Fight/Stage/Dungeon/DungeonStage.cs
index 29c1fa5..7b8c3a7 100644
--- a/Fight/Stage/Dungeon/DungeonStage.cs
+++ b/Fight/Stage/Dungeon/DungeonStage.cs
@@ -110,8 +110,11 @@
             s_MapAreaDict = null;
         }
 
-        PlayerDatas.Instance.hero.atkBossID = 0;
-        PlayerDatas.Instance.hero.currentBossArea = null;
+        if (PlayerDatas.Instance.hero != null)
+        {
+            PlayerDatas.Instance.hero.atkBossID = 0;
+            PlayerDatas.Instance.hero.currentBossArea = null;
+        }
 
         if (CameraController.Instance != null)
         {
diff --git a/System/Pet/PetAttributeMethods.cs b/System/Pet/PetAttributeMethods.cs
index 446cfbc..59b9568 100644
--- a/System/Pet/PetAttributeMethods.cs
+++ b/System/Pet/PetAttributeMethods.cs
@@ -73,6 +73,7 @@
         [SerializeField]
         GameObject Skillimage3;
 
+        [SerializeField] UIEffect m_UIeffect2;//缁忛獙鏉$壒鏁�
         private int typePetID = 0;
         private float timePlay = 0;//鐏靛疇鍔ㄤ綔鎾斁鏃堕棿
         PlayerPetDatas m_petModel;
@@ -327,7 +328,8 @@
         private void RefreshPetInfo()
         {
             if (petInfoConfig == null) return;
-
+            SoundPlayer.Instance.PlayUIAudio(19);
+            m_UIeffect2.Play();
             AllPetAttrCtrl();
             curPetSkillCtrl.m_Scorller.RefreshActiveCellViews();
             CreateAllPetSkill();
diff --git a/System/Welfare/MultipleRealmPointModel.cs b/System/Welfare/MultipleRealmPointModel.cs
new file mode 100644
index 0000000..f34af24
--- /dev/null
+++ b/System/Welfare/MultipleRealmPointModel.cs
@@ -0,0 +1,96 @@
+锘縰sing System;
+using UnityEngine;
+
+namespace Snxxz.UI
+{
+    public class MultipleRealmPointModel : Model,IBeforePlayerDataInitialize,IAfterPlayerDataInitialize,IPlayerLoginOk
+    {
+        public const int MULTIPLEREALM_KEY = 20109;
+        public Redpoint multipleRed = new Redpoint(201,MULTIPLEREALM_KEY);
+        public string LocalRecord_Key = "MultipleRealmRecord";
+        bool isNewDay = false;
+        public override void Init()
+        {
+          
+        }
+
+        public void OnBeforePlayerDataInitialize()
+        {
+            isNewDay = false;
+        }
+
+        public void OnAfterPlayerDataInitialize()
+        {
+
+        }
+
+        public void OnPlayerLoginOk()
+        {
+            LocalRecord_Key = StringUtility.Contact(LocalRecord_Key, PlayerDatas.Instance.baseData.PlayerID);
+            CheckShowRed();
+            OperationTimeHepler.Instance.operationStartEvent -= RefreshOperationState;
+            OperationTimeHepler.Instance.operationStartEvent += RefreshOperationState;
+            OperationTimeHepler.Instance.operationEndEvent -= RefreshOperationState;
+            OperationTimeHepler.Instance.operationEndEvent += RefreshOperationState;
+            OperationTimeHepler.Instance.operationServerCloseEvent -= RefreshOperationClose;
+            OperationTimeHepler.Instance.operationServerCloseEvent += RefreshOperationClose;
+        }
+
+        public override void UnInit()
+        {
+          
+        }
+
+        private void RefreshOperationClose(Operation type)
+        {
+            if (type != Operation.MultipRealmPoint) return;
+            CheckShowRed();
+        }
+
+        private void RefreshOperationState(Operation type, int arg2)
+        {
+            if (type != Operation.MultipRealmPoint) return;
+            CheckShowRed();
+        }
+
+        public void CheckShowRed(bool isClick = false)
+        {
+            bool isOpen = OperationTimeHepler.Instance.SatisfyOpenCondition(Operation.MultipRealmPoint);
+            if (!isOpen) return;
+
+            if(!isNewDay)
+            {
+                if (!PlayerPrefs.HasKey(LocalRecord_Key))
+                {
+                    LocalSave.SetInt(LocalRecord_Key, TimeUtility.ServerNow.Day);
+                    isNewDay = true;
+                }
+                else
+                {
+                    if (TimeUtility.ServerNow.Day != LocalSave.GetInt(LocalRecord_Key))
+                    {
+                        isNewDay = true;
+                        LocalSave.SetInt(LocalRecord_Key, TimeUtility.ServerNow.Day);
+                    }
+                }
+            }
+             
+            if(!isClick)
+            {
+                if (isOpen && isNewDay)
+                {
+                    multipleRed.state = RedPointState.Simple;
+                }
+                else
+                {
+                    multipleRed.state = RedPointState.None;
+                }
+            }
+            else
+            {
+                multipleRed.state = RedPointState.None;
+            }
+           
+        }
+    }
+}
diff --git a/System/Welfare/MultipleRealmPointModel.cs.meta b/System/Welfare/MultipleRealmPointModel.cs.meta
new file mode 100644
index 0000000..fed607b
--- /dev/null
+++ b/System/Welfare/MultipleRealmPointModel.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 7f0f944899a17f2458886aa5a15aac71
+timeCreated: 1533719778
+licenseType: Pro
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/System/Welfare/WelfareWin.cs b/System/Welfare/WelfareWin.cs
index 6e8d1a5..cccf8ac 100644
--- a/System/Welfare/WelfareWin.cs
+++ b/System/Welfare/WelfareWin.cs
@@ -30,6 +30,7 @@
         [SerializeField] Text m_MultipleRealmPointTitle;
 
         MultipleExpModel multipleExpModel { get { return ModelCenter.Instance.GetModel<MultipleExpModel>(); } }
+        MultipleRealmPointModel multipleRealmModel { get { return ModelCenter.Instance.GetModel<MultipleRealmPointModel>(); } }
         ConsumeRebateModel consumeRebateModel { get { return ModelCenter.Instance.GetModel<ConsumeRebateModel>(); } }
         InSevenDayModel m_InSevenDayModel;
         InSevenDayModel inSevenDay { get { return m_InSevenDayModel ?? (m_InSevenDayModel = ModelCenter.Instance.GetModel<InSevenDayModel>()); } }
@@ -152,6 +153,7 @@
             {
                 WindowCenter.Instance.Open<NPracticePointWin>();
             }
+            multipleRealmModel.CheckShowRed(true);
             functionOrder = 8;
         }
 
diff --git a/System/WindowBase/ModelCenter.cs b/System/WindowBase/ModelCenter.cs
index 124c7d4..3508ca7 100644
--- a/System/WindowBase/ModelCenter.cs
+++ b/System/WindowBase/ModelCenter.cs
@@ -186,6 +186,7 @@
             RegisterModel<FairylandCeremonyModel>();
             RegisterModel<TrialDungeonModel>();
             RegisterModel<ActivitiesPushMgr>();
+            RegisterModel<MultipleRealmPointModel>();
             inited = true;
         }
 
diff --git a/System/WindowJump/WindowJumpMgr.cs b/System/WindowJump/WindowJumpMgr.cs
index 836aa2b..e10eded 100644
--- a/System/WindowJump/WindowJumpMgr.cs
+++ b/System/WindowJump/WindowJumpMgr.cs
@@ -728,13 +728,13 @@
     {
         var config = ConfigManager.Instance.GetTemplate<DailyQuestConfig>(_dailyQuestId);
         dungeonModel.currentDungeon = new Dungeon(config.RelatedID, _lineId);
-        WindowCenter.Instance.Open<HeavenBattleWin>();
+        SetJumpLogic<HeavenBattleWin>();
     }
     private void GotoTrialDungeon(int _dailyQuestId, int _lineId = 0)
     {
         var config = ConfigManager.Instance.GetTemplate<DailyQuestConfig>(_dailyQuestId);
         dungeonModel.currentDungeon = new Dungeon(config.RelatedID, _lineId);
-        WindowCenter.Instance.Open<TrialDungeonSelectWin>();
+        SetJumpLogic<TrialDungeonSelectWin>();
     }
 
     private void GotoMultipleDifficultyDungeon(int _dailyQuestId)
@@ -742,7 +742,7 @@
         var config = ConfigManager.Instance.GetTemplate<DailyQuestConfig>(_dailyQuestId);
         dungeonModel.currentDungeon = new Dungeon(config.RelatedID, 0);
         dungeonModel.selectedKylinDungeon = default(Dungeon);
-        WindowCenter.Instance.Open<MultipleDifficultyDungeonWin>();
+        SetJumpLogic<MultipleDifficultyDungeonWin>();
     }
 
     private void SetJumpLogic<T>(int _functionalOrder = 0, bool _forceSync = true) where T : Window
diff --git a/System/WorldMap/MapModel.cs b/System/WorldMap/MapModel.cs
index dfd8847..64c6e41 100644
--- a/System/WorldMap/MapModel.cs
+++ b/System/WorldMap/MapModel.cs
@@ -348,8 +348,8 @@
             var recommendPoint = 0;
             if (eventPointsPool.Count > 0)
             {
-                recommendPoint = eventPointsPool[0];
-                for (int i = eventPointsPool.Count - 1; i >= 0; i--)
+                recommendPoint = eventPointsPool[eventPointsPool.Count - 1];
+                for (int i = 0; i < eventPointsPool.Count; i++)
                 {
                     var config = ConfigManager.Instance.GetTemplate<MapEventPointConfig>(eventPointsPool[i]);
                     if (PlayerDatas.Instance.extersion.DEF >= config.Defense)
@@ -416,8 +416,8 @@
             var recommendPoint = 0;
             if (eventPointsPool.Count > 0)
             {
-                recommendPoint = eventPointsPool[0];
-                for (int i = eventPointsPool.Count - 1; i >= 0; i--)
+                recommendPoint = eventPointsPool[eventPointsPool.Count - 1];
+                for (int i = 0; i < eventPointsPool.Count; i++)
                 {
                     var config = ConfigManager.Instance.GetTemplate<MapEventPointConfig>(eventPointsPool[i]);
                     if (PlayerDatas.Instance.extersion.DEF >= config.Defense)

--
Gitblit v1.8.0