|
@@ -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;
|