ybx_Gdn 1 жил өмнө
parent
commit
8574305112

+ 47 - 17
Assets/Lua/Managers/LuaBattleMgr.lua

@@ -81,6 +81,7 @@ function LuaBattleMgr:SetBattleMode(mode)
     self.lastMapMode = self.difficulty
     self.difficulty  = mode
 end
+
 function LuaBattleMgr:GetBattleMode()
     return self.difficulty 
 end
@@ -471,10 +472,10 @@ function LuaBattleMgr:OnChangeMapLevelTypeAct(data)
         mapMode = self.LevelChangeType
         self.LevelChangeType = nil
     end
-
+    self.NeedChangeMapMode = mapMode
     --local mapMode = ManagerContainer.LuaBattleMgr:GetBattleMode() == Enum.MapModeType.Difficulty and Enum.MapModeType.Simple or Enum.MapModeType.Difficulty
-    self:SetBattleMode(mapMode)
-    ManagerContainer.LuaEventMgr:Dispatch(UIEventNames.MAP_MODE_CHANGE,mapMode)
+    --self:SetBattleMode(mapMode)
+   -- ManagerContainer.LuaEventMgr:Dispatch(UIEventNames.MAP_MODE_CHANGE,mapMode)
       
 end
 
@@ -562,11 +563,21 @@ function LuaBattleMgr:OnBossRewardAck(playerBossRewardAck)
 end
 
 function LuaBattleMgr:OnBattleDataChangeNtf(data)
-    local isshow = self.difficulty ~= self.lastMapMode
-    if isshow then
-        LogError("-----------切换模式--------")
-        self.lastMapMode = self.difficulty
+
+    local curlevelMode = data.map_mode
+    local isshow = false
+    if curlevelMode ~= nil then
+        isshow = self.difficulty ~= curlevelMode
+        if isshow then
+            LogError("-----------切换模式--------")
+            self.difficulty = curlevelMode
+            self.lastMapMode = self.difficulty
+        end
     end
+
+
+    --isshow = self.difficulty ~= self.lastMapMode
+   
     self:OnBattleDataChange(data,isshow)
 end
 
@@ -634,17 +645,31 @@ function LuaBattleMgr:SetBattleData(data,first,IsShowEnterNextMap)
     self.lastInComeTime = data.last_income_time
     self.curMapId = data.map_id
     self.curLevelId = data.map_level
-    if self.difficulty == 0 then
-        self.simpleLvData[1] =  data.map_id
-        self.simpleLvData[2] =  data.map_level
-    elseif self.difficulty == 1 then
-        self.difficultyLvData[1] =  data.map_id
-        self.difficultyLvData[2] =  data.map_level
+    
+    if data.map_mode ~=nil then
+        if self.difficulty == 0 then
+            self.simpleLvData[1] =  data.map_id
+            self.simpleLvData[2] =  data.map_level
+        elseif self.difficulty == 1 then
+            self.difficultyLvData[1] =  data.map_id
+            self.difficultyLvData[2] =  data.map_level
+        else
+            self.difficulty_S_LvData[1] =  data.map_id
+            self.difficulty_S_LvData[2] =  data.map_level
+        end
     else
-        self.difficulty_S_LvData[1] =  data.map_id
-        self.difficulty_S_LvData[2] =  data.map_level
+            self.simpleLvData[1] =  data.map_id
+            self.simpleLvData[2] =  data.map_level
+      
+            self.difficultyLvData[1] =  data.hard_map_id
+            self.difficultyLvData[2] =  data.hard_map_level
+       
+            self.difficulty_S_LvData[1] =  data.hard_s_map_id
+            self.difficulty_S_LvData[2] =  data.hard_s_map_level     
     end
 
+   
+
     if first then
         CompetitionRefreshLevelLimit = GlobalConfig.Instance:GetConfigIntValue(248)
         ManagerContainer.UIFuncUnlockMgr:SetLoggedinLevelId(self:GetCurLevelUniqueId())
@@ -1486,8 +1511,11 @@ end
 
 function LuaBattleMgr:CurLevelName()
     local lvname =  LuaBattleBridge.GetCurLevelName() --DifLvName
-    if self.IsShowDiffTxt then   
-        lvname = I18N.T(self:CurLevelQianZhuiKey())..lvname         
+    if self.IsShowDiffTxt then
+        local key = self:CurLevelQianZhuiKey()
+        if key ~= "" then
+            lvname = I18N.T(key)..lvname         
+        end       
     end
     return lvname
 end
@@ -1497,6 +1525,8 @@ function LuaBattleMgr:CurLevelQianZhuiKey()
         return "DifLvName"
     elseif self.difficulty == 2 then
         return "Dif_S_LvName"
+    else
+        return ""    
     end
 end
 

+ 8 - 1
Assets/Lua/UI/UIBattle/UIBattleView.lua

@@ -448,7 +448,14 @@ end
 function UIBattleView:RefMapModeBtn()
 	local curMode = ManagerContainer.LuaBattleMgr:GetBattleMode()
 
-	local AllMode = {0,1,2}
+	local AllMode = {0,1}
+
+	local emUnlockLevel = GlobalConfig.Instance:GetConfigIntValue(365)
+	local curLevel = ManagerContainer.LuaBattleMgr:GetCurDiffLvID()
+	if(curLevel >= emUnlockLevel)then
+		table.insert(AllMode,2)
+	end	
+
 
 	local needShowModeBtn = {}
 

+ 6 - 0
Assets/Lua/UI/UITask/UIDiffTaskView.lua

@@ -35,6 +35,12 @@ function UIDiffTaskView:Init()
 	self.lBtntxt.text.text = I18N.T("TaskUI_1")
 	self.rBtntxt.text.text = I18N.T("TaskUI_2")
 	self:ShowChangeModeBtn()
+	local emUnlockLevel = GlobalConfig.Instance:GetConfigIntValue(365)
+	local curLevel = ManagerContainer.LuaBattleMgr:GetCurDiffLvID()
+	if(curLevel < emUnlockLevel)then
+		self:ShowModeBtn()
+	end	
+
 	--self:ShowModeBtn()
 	self:SetItems()
 	--self:SetGroupReward({{100,100},{110,50},{47,1000000},{529,5}})

+ 3 - 3
Assets/Src/GameLogic/Battle/BattleFlyWord/FighterHPBar.cs

@@ -1,4 +1,4 @@
-using UnityEngine;
+using UnityEngine;
 using System.Collections;
 using UnityEngine.UI;
 
@@ -132,7 +132,7 @@ public class FighterHPBar
         }
     }
 
-    public void OnLifeChanged(int life, int maxLife)
+    public void OnLifeChanged(long life, long maxLife)
     {
         if (life < maxLife)
             setHudLogicVisible(true);
@@ -264,7 +264,7 @@ public class FighterHPBar
     ///-------------------------------------------------
     /// 更新血条值
     ///-------------------------------------------------
-    private void UpdateBloodBar(int curValue, int maxValue)
+    private void UpdateBloodBar(long curValue, long maxValue)
     {
         if (mHud != null && maxValue != 0)
         {

+ 10 - 10
Assets/Src/GameLogic/Battle/FighterManager/Fighter.cs

@@ -445,17 +445,17 @@ public class Fighter : LogicTransform
     #endregion
 
     #region battle_attr
-    public SInt MaxLife { get; set; }
+    public SLong MaxLife { get; set; }
 
     public SInt MaxSp { get; private set; }
 
-    public SInt Life {
+    public SLong Life {
         get
         {
             return mStateData.Life; 
         }
         set {
-            mStateData.Life = Mathf.Min(value, MaxLife);
+            mStateData.Life = System.Math.Min(value, MaxLife);
             EventMgr.DispatchEvent<Fighter>(new CoreEvent<Fighter>(ECoreEventType.EID_Fighter_HP_Lower, this));
         }
     }
@@ -2048,7 +2048,7 @@ public class Fighter : LogicTransform
         if (StateData.IsInvincible)//无敌
             return;
 
-        SInt lifeBefore = Life;
+        //SInt lifeBefore = Life;
         bool isAliveBefore = IsAlive;
         SInt oldDamage = Mathf.CeilToInt(damage);
 
@@ -2334,7 +2334,7 @@ public class Fighter : LogicTransform
         if (!IsAlive)
             return false;
 
-        SInt lifeBefore = Life;
+        //SInt lifeBefore = Life;
         bool isAliveBefore = IsAlive;
 
         if (hitInfo.Damage > 0)
@@ -2345,7 +2345,7 @@ public class Fighter : LogicTransform
             {
                 Life -= (int)hitInfo.Damage;
             }
-            hitInfo.Absorb = oldDamage - hitInfo.Damage;
+            hitInfo.Absorb = (float)oldDamage - hitInfo.Damage;
         }
 
         string skillName = null;
@@ -2859,15 +2859,15 @@ public class Fighter : LogicTransform
             case ActorData.Attr_Life:
                 {
                     mActorBattleAttr.life = Actor.Life;// * lifeRatio * (1 + hpFactor * 0.01f);
-                    if (mActorBattleAttr.life > int.MaxValue)
+                    if (mActorBattleAttr.life > long.MaxValue)
                     {
-                        MaxLife = int.MaxValue;
+                        MaxLife = long.MaxValue;
                     }
                     else
                     {
-                        MaxLife = Mathf.RoundToInt(mActorBattleAttr.life);
+                        MaxLife = System.Convert.ToInt64(Actor.Life);
                     }
-
+                    
                    
                     Life = MaxLife;
                     Debug.Log($"---------Life = {Life}-- Actor.Life = {Actor.Life}------");

+ 5 - 5
Assets/Src/GameLogic/Battle/FighterManager/FighterStateData.cs

@@ -1,10 +1,10 @@
-using UnityEngine;
+using UnityEngine;
 using System;
 
 public class FighterStateData
 {
 	Fighter mFighter;
-	SInt mLife;
+    SLong mLife;
     SInt mMana;
     SInt mRage;
     Fix64 mStarkTime;
@@ -60,13 +60,13 @@ public class FighterStateData
 
     public float AnimSpeed { get { return mAnimSpeed; } }
 
-    public SInt Life {
+    public SLong Life {
 		get { return mLife; }
 		set {
 			if (IsFixLife)
 				return;
-			
-			SInt v = Mathf.Max (value, 0);
+
+            SLong v = System.Math.Max (value, 0);
 			if (mLife != v) {
 				mLife = v;
                 if (mFighter != null && mFighter.Ctrl != null)

+ 2 - 2
Assets/Src/GameLogic/Battle/FunEvents/Duration/ChangeMaxHpPercent.cs

@@ -1,4 +1,4 @@
-using UnityEngine;
+using UnityEngine;
 using System.Collections;
 
 public class ChangeMaxHpPercent : DurationFunctionEvent
@@ -13,7 +13,7 @@ public class ChangeMaxHpPercent : DurationFunctionEvent
         mType = Buff_Function_Type.Change_MaxHP_Percent;
     }
 
-    SInt maxLife = 0;
+    SLong maxLife = 0;
     public override void Enter(Fighter fighter)
     {
         base.Enter(fighter);

+ 2 - 2
Assets/Src/GameLogic/Battle/FunEvents/Duration/ChangeMaxHpValue.cs

@@ -1,4 +1,4 @@
-using UnityEngine;
+using UnityEngine;
 using System.Collections;
 
 public class ChangeMaxHpValue : DurationFunctionEvent
@@ -13,7 +13,7 @@ public class ChangeMaxHpValue : DurationFunctionEvent
         mType = Buff_Function_Type.Change_MaxHP_Value;
     }
 
-    SInt maxLife = 0;
+    SLong maxLife = 0;
     public override void Enter(Fighter fighter)
     {
         base.Enter(fighter);

+ 8 - 8
Assets/Src/GameLogic/Battle/Recorder/BattleRecorder.cs

@@ -1,4 +1,4 @@
-using UnityEngine;
+using UnityEngine;
 using System.Collections;
 using System.Collections.Generic;
 using System.IO;
@@ -377,7 +377,7 @@ public class BattleRecorder
 
     public bool ResultCode { get; private set; }
 
-	public int ReplayResultCode { get; private set; }
+	public long ReplayResultCode { get; private set; }
 
 	public int Seed { get; set; }
 
@@ -713,10 +713,10 @@ public class BattleRecorder
 	{
 		List<Fighter> allFigher = mBattle.FighterMgr.AllFighters;
 
-		int leftLifeTotal = 0;
-		int rightLifeTotal = 0;
+		long leftLifeTotal = 0;
+		long rightLifeTotal = 0;
 
-		int[] lifeArray = new int[mLeftActors.Count + mRightActors.Count];
+		long[] lifeArray = new long[mLeftActors.Count + mRightActors.Count];
 		for (int i = 0; i < mLeftActors.Count; i++)
 		{
 			Fighter fighter = allFigher.Find(a => a.Actor == mLeftActors[i]);
@@ -1012,10 +1012,10 @@ public class BattleRecorder
 	public void CalculateReplayResult()
 	{
 		List<Fighter> allFigher = mBattle.FighterMgr.AllFighters;
-		int leftLifeTotal = 0;
-		int rightLifeTotal = 0;
+		long leftLifeTotal = 0;
+		long rightLifeTotal = 0;
 
-		int[] lifeArray = new int[mLeftActors.Count + mRightActors.Count];
+		long[] lifeArray = new long[mLeftActors.Count + mRightActors.Count];
 		for (int i = 0; i < mLeftActors.Count; i++)
 		{
 			Fighter fighter = allFigher.Find(a => a.Actor == mLeftActors[i]);

+ 9 - 1
Assets/Src/SecureDetector/Type/SFloat.cs

@@ -1,4 +1,4 @@
-using System;
+using System;
 using UnityEngine;
 using System.Runtime.InteropServices;
 
@@ -128,6 +128,14 @@ public struct SFloat : IEquatable<SFloat>, IFormattable
         return value.InternalDecrypt();
     }
 
+    //public static implicit operator long(SFloat value)
+    //{
+    //    return System.Convert.ToInt64(value.InternalDecrypt());
+    //}
+    //public static implicit operator SLong(SFloat value)
+    //{
+    //    return System.Convert.ToInt64(value.InternalDecrypt());
+    //}
     public static SFloat operator ++(SFloat input)
     {
         int decrypt = 0;

+ 13 - 1
Assets/Src/SecureDetector/Type/SLong.cs

@@ -1,4 +1,4 @@
-using System;
+using System;
 using UnityEngine;
 
 [Serializable]
@@ -69,6 +69,18 @@ public struct SLong : IEquatable<SLong>, IFormattable
     {
         return value.InternalDecrypt();
     }
+    public static implicit operator SFloat(SLong value)
+    {
+        return (float)value.InternalDecrypt();
+    }
+    public static implicit operator SDouble(SLong value)
+    {
+        return (double)value.InternalDecrypt();
+    }
+    public static implicit operator float(SLong value)
+    {
+        return (float)value.InternalDecrypt();
+    }
 
     public static SLong operator ++(SLong input)
     {

+ 3 - 3
Assets/Src/Triggers/GlobalTrigger.cs

@@ -1,4 +1,4 @@
-using UnityEngine;
+using UnityEngine;
 using System;
 using System.Collections;
 using System.Collections.Generic;
@@ -110,7 +110,7 @@ public struct STriggerCondition
         return true;
     }
 
-    private bool FilterMatchDamage(int curHp,int maxLife)
+    private bool FilterMatchDamage(long curHp,long maxLife)
     {
         int percentRevised = Percent;
         if (percentRevised < 0)
@@ -121,7 +121,7 @@ public struct STriggerCondition
         {
             percentRevised = 100;
         }
-        int hpThreshold = maxLife * percentRevised / 100;
+        long hpThreshold = maxLife * percentRevised / 100;
 
         if (curHp <= hpThreshold)
         {

+ 2 - 2
Assets/Src/UI/3DUI/HudComponent3D.cs

@@ -1,4 +1,4 @@
-using UnityEngine;
+using UnityEngine;
 using System.Collections;
 using System.Collections.Generic;
 
@@ -252,7 +252,7 @@ public class HudComponent3D
     ///-------------------------------------------------
     /// 更新血条值
     ///-------------------------------------------------
-    private void UpdateBloodBar(int curValue, int maxValue)
+    private void UpdateBloodBar(long curValue, long maxValue)
     {
         if (mHud != null && maxValue != 0)
         {