|
|
@@ -54,6 +54,8 @@ public class AttributeStatus : MonoBehaviour
|
|
|
[Serializable]
|
|
|
public struct Resistances
|
|
|
{
|
|
|
+ public int controlOrder;
|
|
|
+
|
|
|
//控制效果抗性
|
|
|
[Range(0, 1)]
|
|
|
[LabelText("漂浮抗性")]
|
|
|
@@ -108,7 +110,7 @@ public class AttributeStatus : MonoBehaviour
|
|
|
{
|
|
|
break;
|
|
|
}
|
|
|
- if (PriorityOrder(SpecialState.FloatState))
|
|
|
+ if (PriorityOrder(SpecialState.FloatState, attackInfo.floatState.ControlOrder))
|
|
|
{
|
|
|
attackEffect = AttackEffect.FloatState;
|
|
|
}
|
|
|
@@ -119,9 +121,9 @@ public class AttributeStatus : MonoBehaviour
|
|
|
{
|
|
|
break;
|
|
|
}
|
|
|
- if (rb.useGravity)
|
|
|
+ if (!character.canFly)
|
|
|
{
|
|
|
- if (PriorityOrder(SpecialState.BlownUp))
|
|
|
+ if (PriorityOrder(SpecialState.BlownUp, attackInfo.blowUp.ControlOrder))
|
|
|
{
|
|
|
attackEffect = AttackEffect.BlowUp;
|
|
|
}
|
|
|
@@ -133,9 +135,9 @@ public class AttributeStatus : MonoBehaviour
|
|
|
{
|
|
|
break;
|
|
|
}
|
|
|
- if (!rb.useGravity)
|
|
|
+ if (character.canFly)
|
|
|
{
|
|
|
- if (PriorityOrder(SpecialState.ShotDown))
|
|
|
+ if (PriorityOrder(SpecialState.ShotDown, attackInfo.shotDown.ControlOrder))
|
|
|
{
|
|
|
attackEffect = AttackEffect.ShotDown;
|
|
|
}
|
|
|
@@ -147,7 +149,7 @@ public class AttributeStatus : MonoBehaviour
|
|
|
{
|
|
|
break;
|
|
|
}
|
|
|
- if (PriorityOrder(SpecialState.Weak))
|
|
|
+ if (PriorityOrder(SpecialState.Weak, attackInfo.weak.ControlOrder))
|
|
|
{
|
|
|
attackEffect = AttackEffect.Weak;
|
|
|
}
|
|
|
@@ -167,14 +169,10 @@ public class AttributeStatus : MonoBehaviour
|
|
|
//击飞
|
|
|
case AttackEffect.BlowUp:
|
|
|
AddBlowUp(attackInfo.blowUp, attackFrom.bodyTrans);
|
|
|
- //虾兵特殊攻击先留着
|
|
|
- //AddBlowUp(attackInfo.blowUp, attackFrom.transform.position.x < character.transform.position.x ? -1 : 1);
|
|
|
break;
|
|
|
//击落
|
|
|
case AttackEffect.ShotDown:
|
|
|
AddShotDown(attackInfo.shotDown, attackFrom.bodyTrans);
|
|
|
- //虾兵特殊攻击先留着
|
|
|
- //AddShotDown(attackInfo.shotDown, attackFrom.transform.position.x < character.transform.position.x ? -1 : 1);
|
|
|
break;
|
|
|
//击晕
|
|
|
case AttackEffect.Weak:
|
|
|
@@ -258,6 +256,8 @@ public class AttributeStatus : MonoBehaviour
|
|
|
case SpecialState.ShotDown:
|
|
|
switch (hitState)
|
|
|
{
|
|
|
+ case -1:
|
|
|
+ break;
|
|
|
case 0:
|
|
|
Vector3 vel = rb.velocity;
|
|
|
if (isFly && foot.TrigGround && vel.y <= 0.01f)
|
|
|
@@ -322,8 +322,14 @@ public class AttributeStatus : MonoBehaviour
|
|
|
}
|
|
|
|
|
|
//判断优先级,ture为优先级高于当前控制
|
|
|
- public bool PriorityOrder(SpecialState specialState)
|
|
|
+ public bool PriorityOrder(SpecialState specialState, int controlOrder)
|
|
|
{
|
|
|
+ //控制层级小于控制抗性层级,该控制效果无效
|
|
|
+ if(controlOrder < resistances.controlOrder)
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
if (curSpecialStates == SpecialState.Null)
|
|
|
{
|
|
|
curSpecialStates = specialState;
|
|
|
@@ -380,15 +386,16 @@ public class AttributeStatus : MonoBehaviour
|
|
|
{
|
|
|
vec3.x = -vec3.x;
|
|
|
}
|
|
|
+ hitState = -1;
|
|
|
+ character.ChangeState(CharacterState.SpecialStatus_BlowUp);
|
|
|
+ character.ChangeStateText(CharacterState.SpecialStatus_BlowUp);
|
|
|
rb.useGravity = true;
|
|
|
rb.constraints = RigidbodyConstraints.FreezeRotation | RigidbodyConstraints.FreezePositionZ;
|
|
|
rb.velocity = Vector3.zero;
|
|
|
rb.AddForce(vec3 * blowUp.force * (1 - resistances.BlowUp), ForceMode.Impulse);
|
|
|
- character.ani.Play("hitted", 0, 0);
|
|
|
hitState = 0;
|
|
|
+ character.ani.Play("hitted", 0, 0);
|
|
|
isFly = false;
|
|
|
- character.ChangeState(CharacterState.SpecialStatus_BlowUp);
|
|
|
- character.ChangeStateText(CharacterState.SpecialStatus_BlowUp);
|
|
|
}
|
|
|
|
|
|
//受到击落
|