ybx_Gdn 1 an în urmă
părinte
comite
812b167a46

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

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

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

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

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

@@ -1,10 +1,10 @@
-using UnityEngine;
+using UnityEngine;
 using System;
 using System;
 
 
 public class FighterStateData
 public class FighterStateData
 {
 {
 	Fighter mFighter;
 	Fighter mFighter;
-    SLong mLife;
+	SInt mLife;
     SInt mMana;
     SInt mMana;
     SInt mRage;
     SInt mRage;
     Fix64 mStarkTime;
     Fix64 mStarkTime;
@@ -60,13 +60,13 @@ public class FighterStateData
 
 
     public float AnimSpeed { get { return mAnimSpeed; } }
     public float AnimSpeed { get { return mAnimSpeed; } }
 
 
-    public SLong Life {
+    public SInt Life {
 		get { return mLife; }
 		get { return mLife; }
 		set {
 		set {
 			if (IsFixLife)
 			if (IsFixLife)
 				return;
 				return;
-
-            SLong v = System.Math.Max (value, 0);
+			
+			SInt v = Mathf.Max (value, 0);
 			if (mLife != v) {
 			if (mLife != v) {
 				mLife = v;
 				mLife = v;
                 if (mFighter != null && mFighter.Ctrl != null)
                 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;
 using System.Collections;
 
 
 public class ChangeMaxHpPercent : DurationFunctionEvent
 public class ChangeMaxHpPercent : DurationFunctionEvent
@@ -13,7 +13,7 @@ public class ChangeMaxHpPercent : DurationFunctionEvent
         mType = Buff_Function_Type.Change_MaxHP_Percent;
         mType = Buff_Function_Type.Change_MaxHP_Percent;
     }
     }
 
 
-    SLong maxLife = 0;
+    SInt maxLife = 0;
     public override void Enter(Fighter fighter)
     public override void Enter(Fighter fighter)
     {
     {
         base.Enter(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;
 using System.Collections;
 
 
 public class ChangeMaxHpValue : DurationFunctionEvent
 public class ChangeMaxHpValue : DurationFunctionEvent
@@ -13,7 +13,7 @@ public class ChangeMaxHpValue : DurationFunctionEvent
         mType = Buff_Function_Type.Change_MaxHP_Value;
         mType = Buff_Function_Type.Change_MaxHP_Value;
     }
     }
 
 
-    SLong maxLife = 0;
+    SInt maxLife = 0;
     public override void Enter(Fighter fighter)
     public override void Enter(Fighter fighter)
     {
     {
         base.Enter(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;
 using System.Collections.Generic;
 using System.Collections.Generic;
 using System.IO;
 using System.IO;
@@ -377,7 +377,7 @@ public class BattleRecorder
 
 
     public bool ResultCode { get; private set; }
     public bool ResultCode { get; private set; }
 
 
-	public long ReplayResultCode { get; private set; }
+	public int ReplayResultCode { get; private set; }
 
 
 	public int Seed { get; set; }
 	public int Seed { get; set; }
 
 
@@ -713,10 +713,10 @@ public class BattleRecorder
 	{
 	{
 		List<Fighter> allFigher = mBattle.FighterMgr.AllFighters;
 		List<Fighter> allFigher = mBattle.FighterMgr.AllFighters;
 
 
-		long leftLifeTotal = 0;
-		long rightLifeTotal = 0;
+		int leftLifeTotal = 0;
+		int rightLifeTotal = 0;
 
 
-		long[] lifeArray = new long[mLeftActors.Count + mRightActors.Count];
+		int[] lifeArray = new int[mLeftActors.Count + mRightActors.Count];
 		for (int i = 0; i < mLeftActors.Count; i++)
 		for (int i = 0; i < mLeftActors.Count; i++)
 		{
 		{
 			Fighter fighter = allFigher.Find(a => a.Actor == mLeftActors[i]);
 			Fighter fighter = allFigher.Find(a => a.Actor == mLeftActors[i]);
@@ -1012,10 +1012,10 @@ public class BattleRecorder
 	public void CalculateReplayResult()
 	public void CalculateReplayResult()
 	{
 	{
 		List<Fighter> allFigher = mBattle.FighterMgr.AllFighters;
 		List<Fighter> allFigher = mBattle.FighterMgr.AllFighters;
-		long leftLifeTotal = 0;
-		long rightLifeTotal = 0;
+		int leftLifeTotal = 0;
+		int rightLifeTotal = 0;
 
 
-		long[] lifeArray = new long[mLeftActors.Count + mRightActors.Count];
+		int[] lifeArray = new int[mLeftActors.Count + mRightActors.Count];
 		for (int i = 0; i < mLeftActors.Count; i++)
 		for (int i = 0; i < mLeftActors.Count; i++)
 		{
 		{
 			Fighter fighter = allFigher.Find(a => a.Actor == mLeftActors[i]);
 			Fighter fighter = allFigher.Find(a => a.Actor == mLeftActors[i]);

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

@@ -1,4 +1,4 @@
-using UnityEngine;
+using UnityEngine;
 using System;
 using System;
 using System.Collections;
 using System.Collections;
 using System.Collections.Generic;
 using System.Collections.Generic;
@@ -110,7 +110,7 @@ public struct STriggerCondition
         return true;
         return true;
     }
     }
 
 
-    private bool FilterMatchDamage(long curHp,long maxLife)
+    private bool FilterMatchDamage(int curHp,int maxLife)
     {
     {
         int percentRevised = Percent;
         int percentRevised = Percent;
         if (percentRevised < 0)
         if (percentRevised < 0)
@@ -121,7 +121,7 @@ public struct STriggerCondition
         {
         {
             percentRevised = 100;
             percentRevised = 100;
         }
         }
-        long hpThreshold = maxLife * percentRevised / 100;
+        int hpThreshold = maxLife * percentRevised / 100;
 
 
         if (curHp <= hpThreshold)
         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;
 using System.Collections.Generic;
 using System.Collections.Generic;
 
 
@@ -252,7 +252,7 @@ public class HudComponent3D
     ///-------------------------------------------------
     ///-------------------------------------------------
     /// 更新血条值
     /// 更新血条值
     ///-------------------------------------------------
     ///-------------------------------------------------
-    private void UpdateBloodBar(long curValue, long maxValue)
+    private void UpdateBloodBar(int curValue, int maxValue)
     {
     {
         if (mHud != null && maxValue != 0)
         if (mHud != null && maxValue != 0)
         {
         {