|
|
@@ -41,8 +41,6 @@ public class MoveCharacter : Character
|
|
|
[HideInInspector]
|
|
|
public float newTotalWeakTime;
|
|
|
public float weakHitRate = 2;
|
|
|
- [HideInInspector]
|
|
|
- public Vector3 weakForce;
|
|
|
|
|
|
[Header("易伤减伤")]
|
|
|
public float easyToGetHit = 0.2f;
|
|
|
@@ -354,29 +352,9 @@ public class MoveCharacter : Character
|
|
|
canNotChangeHurt = false;
|
|
|
}
|
|
|
|
|
|
- public override void BeHit(int damage, Vector3 force, bool changeHurt, float repelValue)
|
|
|
+ //仅造成伤害
|
|
|
+ public override void BeHit(int damage)
|
|
|
{
|
|
|
- if (isInvisible)
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
- if (invincibleTime > 0)
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- //漂浮易伤
|
|
|
- if (isFloat)
|
|
|
- {
|
|
|
- damage = (int)((1 + easyToGetHit) * damage);
|
|
|
- }
|
|
|
-
|
|
|
- //伤害减免
|
|
|
- if (isDamageReduction)
|
|
|
- {
|
|
|
- damage = (int)((1 - reductionDegree) * damage);
|
|
|
- }
|
|
|
-
|
|
|
hp -= damage;
|
|
|
|
|
|
//伤害跳字
|
|
|
@@ -401,41 +379,8 @@ public class MoveCharacter : Character
|
|
|
if (hp <= 0)
|
|
|
{
|
|
|
ChangeState(CharacterState.Die);
|
|
|
- if (!canNotAddForce)
|
|
|
- {
|
|
|
- weakForce = force;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- weakForce = Vector3.zero;
|
|
|
- }
|
|
|
return;
|
|
|
}
|
|
|
- if (canNotChangeHurt)
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- if (changeHurt)
|
|
|
- {
|
|
|
- beRepelValue -= repelValue;
|
|
|
- //if (state == CharacterState.Weak)
|
|
|
- //{
|
|
|
- // if (!canNotAddForce)
|
|
|
- // {
|
|
|
- // rb.AddForce(force * weakHitRate);
|
|
|
- // ChangeState(CharacterState.Weak);
|
|
|
- // }
|
|
|
- //}
|
|
|
- //else if (beRepelValue <= 0)
|
|
|
- //{
|
|
|
- // if (!canNotAddForce)
|
|
|
- // {
|
|
|
- // rb.AddForce(force);
|
|
|
- // }
|
|
|
- // ChangeState(CharacterState.Weak);
|
|
|
- //}
|
|
|
- }
|
|
|
|
|
|
if (gameObject.layer == 6) //屏幕红闪+抖动
|
|
|
{
|
|
|
@@ -451,6 +396,7 @@ public class MoveCharacter : Character
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //造成伤害附加其他效果
|
|
|
public override void BeHit(AttackInfo attackInfo, float dir)
|
|
|
{
|
|
|
if (attackInfo.attackEffect.Length > 0)
|
|
|
@@ -512,41 +458,8 @@ public class MoveCharacter : Character
|
|
|
if (hp <= 0)
|
|
|
{
|
|
|
ChangeState(CharacterState.Die);
|
|
|
- if (!canNotAddForce)
|
|
|
- {
|
|
|
- weakForce = attackInfo.attackDir * attackInfo.force;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- weakForce = Vector3.zero;
|
|
|
- }
|
|
|
return;
|
|
|
}
|
|
|
- if (canNotChangeHurt)
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- //if (changeHurt)
|
|
|
- //{
|
|
|
- // beRepelValue -= repelValue;
|
|
|
- // //if (state == CharacterState.Weak)
|
|
|
- // //{
|
|
|
- // // if (!canNotAddForce)
|
|
|
- // // {
|
|
|
- // // rb.AddForce(force * weakHitRate);
|
|
|
- // // ChangeState(CharacterState.Weak);
|
|
|
- // // }
|
|
|
- // //}
|
|
|
- // //else if (beRepelValue <= 0)
|
|
|
- // //{
|
|
|
- // // if (!canNotAddForce)
|
|
|
- // // {
|
|
|
- // // rb.AddForce(force);
|
|
|
- // // }
|
|
|
- // // ChangeState(CharacterState.Weak);
|
|
|
- // //}
|
|
|
- //}
|
|
|
|
|
|
if (gameObject.layer == 6) //屏幕红闪+抖动
|
|
|
{
|
|
|
@@ -569,7 +482,7 @@ public class MoveCharacter : Character
|
|
|
if(sustainedInjuryTime >= sustainedInjury_IntervalTime)
|
|
|
{
|
|
|
sustainedInjuryTime = 0;
|
|
|
- BeHit(sustainedInjury_damage, Vector3.zero,false,0);
|
|
|
+ BeHit(sustainedInjury_damage);
|
|
|
}
|
|
|
}
|
|
|
|