|
|
@@ -20,6 +20,7 @@ public class AttributeStatus : MonoBehaviour
|
|
|
private MoveCharacter character;
|
|
|
private Rigidbody rb;
|
|
|
private Foot foot;
|
|
|
+ private HitFeedbackSystem hitFeedbackSystem;
|
|
|
|
|
|
//behit参数
|
|
|
[HideInInspector] public bool haveNewSpecialStates;
|
|
|
@@ -81,6 +82,7 @@ public class AttributeStatus : MonoBehaviour
|
|
|
character = GetComponentInParent<MoveCharacter>();
|
|
|
rb = character.rb;
|
|
|
foot = character.foot;
|
|
|
+ hitFeedbackSystem = GetComponent<HitFeedbackSystem>();
|
|
|
}
|
|
|
|
|
|
public void Update()
|
|
|
@@ -97,8 +99,10 @@ public class AttributeStatus : MonoBehaviour
|
|
|
{
|
|
|
if (!haveNewSpecialStates)
|
|
|
{
|
|
|
+ hitFeedbackSystem.EnterHitStun();
|
|
|
return;
|
|
|
}
|
|
|
+ hitFeedbackSystem.canHitStun = false;
|
|
|
haveNewSpecialStates = false;
|
|
|
switch (curSpecialStates)
|
|
|
{
|
|
|
@@ -186,31 +190,22 @@ public class AttributeStatus : MonoBehaviour
|
|
|
case SpecialState.BlownUp:
|
|
|
//击落
|
|
|
case SpecialState.ShotDown:
|
|
|
- switch (hitState)
|
|
|
+ switch (hitState)
|
|
|
{
|
|
|
case 0:
|
|
|
- if(rb.velocity.magnitude >= 0)
|
|
|
+ Vector3 vel = rb.velocity;
|
|
|
+ if (foot.TrigGround && vel.y <= 0.01f)
|
|
|
{
|
|
|
- Vector3 vel = rb.velocity;
|
|
|
- if (foot.TrigGround && vel.y <= 0.01f)
|
|
|
- {
|
|
|
- vel = Vector3.zero;
|
|
|
- character.ani.Play("weak", 0, 0);
|
|
|
- hitState = 1;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- vel.x -= decelerationRatioX * Time.deltaTime;
|
|
|
- vel.y -= decelerationRatioY * Time.deltaTime;
|
|
|
- }
|
|
|
- rb.velocity = vel;
|
|
|
+ vel = Vector3.zero;
|
|
|
+ character.ani.Play("weak", 0, 0);
|
|
|
+ hitState = 1;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- rb.velocity = Vector3.zero;
|
|
|
- character.ani.Play("weak", 0, 0);
|
|
|
- hitState = 1;
|
|
|
+ vel.x -= decelerationRatioX * Time.deltaTime;
|
|
|
+ vel.y -= decelerationRatioY * Time.deltaTime;
|
|
|
}
|
|
|
+ rb.velocity = vel;
|
|
|
break;
|
|
|
case 1:
|
|
|
//眩晕状态
|
|
|
@@ -260,7 +255,7 @@ public class AttributeStatus : MonoBehaviour
|
|
|
}
|
|
|
|
|
|
//判断优先级,ture为优先级高于当前控制
|
|
|
- public bool PriorityOrder(SpecialState specialState,AttackInfo attackInfo,Character attackFrom)
|
|
|
+ public bool PriorityOrder(SpecialState specialState, AttackInfo attackInfo, Character attackFrom)
|
|
|
{
|
|
|
if (curSpecialStates != SpecialState.Null && curSpecialStates >= specialState)
|
|
|
{
|
|
|
@@ -270,7 +265,7 @@ public class AttributeStatus : MonoBehaviour
|
|
|
haveNewSpecialStates = true;
|
|
|
return true;
|
|
|
}
|
|
|
- if(curSpecialStates == SpecialState.Null)
|
|
|
+ if (curSpecialStates == SpecialState.Null)
|
|
|
{
|
|
|
curSpecialStates = specialState;
|
|
|
this.attackInfo = attackInfo;
|
|
|
@@ -313,7 +308,7 @@ public class AttributeStatus : MonoBehaviour
|
|
|
vec3.x = -vec3.x;
|
|
|
}
|
|
|
rb.AddForce(vec3 * blowUp.force * (1 - resistances.BlowUp), ForceMode.Impulse);
|
|
|
- character.ani.Play("hitted",0,0);
|
|
|
+ character.ani.Play("hitted", 0, 0);
|
|
|
hitState = 0;
|
|
|
character.ChangeState(CharacterState.SpecialStatus_BlowUp);
|
|
|
character.ChangeStateText(CharacterState.SpecialStatus_BlowUp);
|
|
|
@@ -347,7 +342,7 @@ public class AttributeStatus : MonoBehaviour
|
|
|
}
|
|
|
|
|
|
//受到穿甲
|
|
|
- public int AddArmor(AttackInfo.Armor armor,int damage)
|
|
|
+ public int AddArmor(AttackInfo.Armor armor, int damage)
|
|
|
{
|
|
|
//计算护甲减免
|
|
|
int am = resistances.armor;
|
|
|
@@ -373,4 +368,4 @@ public class AttributeStatus : MonoBehaviour
|
|
|
}
|
|
|
|
|
|
|
|
|
-}
|
|
|
+}
|