|
@@ -19,7 +19,12 @@ public class AttributeStatus : MonoBehaviour
|
|
|
//组件
|
|
//组件
|
|
|
private MoveCharacter character;
|
|
private MoveCharacter character;
|
|
|
private Rigidbody rb;
|
|
private Rigidbody rb;
|
|
|
- private Foot foot;
|
|
|
|
|
|
|
+ private Foot foot;
|
|
|
|
|
+
|
|
|
|
|
+ //behit参数
|
|
|
|
|
+ [HideInInspector] public bool haveNewSpecialStates;
|
|
|
|
|
+ [HideInInspector] public AttackInfo attackInfo;
|
|
|
|
|
+ [HideInInspector] public Character attackFrom;
|
|
|
|
|
|
|
|
[DisplayOnly] public SpecialState curSpecialStates = SpecialState.Null;
|
|
[DisplayOnly] public SpecialState curSpecialStates = SpecialState.Null;
|
|
|
|
|
|
|
@@ -88,6 +93,36 @@ public class AttributeStatus : MonoBehaviour
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public void AddSpecialState()
|
|
|
|
|
+ {
|
|
|
|
|
+ if (!haveNewSpecialStates)
|
|
|
|
|
+ {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ haveNewSpecialStates = false;
|
|
|
|
|
+ switch (curSpecialStates)
|
|
|
|
|
+ {
|
|
|
|
|
+ case SpecialState.FloatState:
|
|
|
|
|
+ AddFloat(attackInfo.floatState);
|
|
|
|
|
+ break;
|
|
|
|
|
+ case SpecialState.BlownUp:
|
|
|
|
|
+ if (rb.useGravity)
|
|
|
|
|
+ {
|
|
|
|
|
+ AddBlowUp(attackInfo.blowUp, attackFrom.bodyTrans.localScale.x < 0 ? -1 : 1);
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+ case SpecialState.ShotDown:
|
|
|
|
|
+ if (!rb.useGravity)
|
|
|
|
|
+ {
|
|
|
|
|
+ AddShotDown(attackInfo.shotDown, attackFrom.bodyTrans.localScale.x < 0 ? -1 : 1);
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+ case SpecialState.Weak:
|
|
|
|
|
+ AddWeak(attackInfo.weak);
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
//CharacterState为SpecialStatus时调用此函数
|
|
//CharacterState为SpecialStatus时调用此函数
|
|
|
public void SpecialStateEffect(SpecialState specialState)
|
|
public void SpecialStateEffect(SpecialState specialState)
|
|
|
{
|
|
{
|
|
@@ -219,14 +254,22 @@ public class AttributeStatus : MonoBehaviour
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//判断优先级,ture为优先级高于当前控制
|
|
//判断优先级,ture为优先级高于当前控制
|
|
|
- public bool PriorityOrder(SpecialState specialState)
|
|
|
|
|
|
|
+ public bool PriorityOrder(SpecialState specialState,AttackInfo attackInfo,Character attackFrom)
|
|
|
{
|
|
{
|
|
|
if (curSpecialStates != SpecialState.Null && curSpecialStates <= specialState)
|
|
if (curSpecialStates != SpecialState.Null && curSpecialStates <= specialState)
|
|
|
{
|
|
{
|
|
|
|
|
+ curSpecialStates = specialState;
|
|
|
|
|
+ this.attackInfo = attackInfo;
|
|
|
|
|
+ this.attackFrom = attackFrom;
|
|
|
|
|
+ haveNewSpecialStates = true;
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
if(curSpecialStates == SpecialState.Null)
|
|
if(curSpecialStates == SpecialState.Null)
|
|
|
{
|
|
{
|
|
|
|
|
+ curSpecialStates = specialState;
|
|
|
|
|
+ this.attackInfo = attackInfo;
|
|
|
|
|
+ this.attackFrom = attackFrom;
|
|
|
|
|
+ haveNewSpecialStates = true;
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
return true;
|
|
return true;
|
|
@@ -235,11 +278,6 @@ public class AttributeStatus : MonoBehaviour
|
|
|
//受到漂浮
|
|
//受到漂浮
|
|
|
public void AddFloat(AttackInfo.FloatState floatState)
|
|
public void AddFloat(AttackInfo.FloatState floatState)
|
|
|
{
|
|
{
|
|
|
- if (!PriorityOrder(SpecialState.FloatState))
|
|
|
|
|
- {
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
rb.useGravity = false;
|
|
rb.useGravity = false;
|
|
|
floatingState = 1;
|
|
floatingState = 1;
|
|
|
origPos = character.transform.position;
|
|
origPos = character.transform.position;
|
|
@@ -262,14 +300,7 @@ public class AttributeStatus : MonoBehaviour
|
|
|
//受到击飞
|
|
//受到击飞
|
|
|
public void AddBlowUp(AttackInfo.BlowUp blowUp, float dir)
|
|
public void AddBlowUp(AttackInfo.BlowUp blowUp, float dir)
|
|
|
{
|
|
{
|
|
|
- if (!rb.useGravity)
|
|
|
|
|
- {
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- if (!PriorityOrder(SpecialState.BlownUp))
|
|
|
|
|
- {
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
attributeTime = blowUp.time * (1 - resistances.BlowUp);
|
|
attributeTime = blowUp.time * (1 - resistances.BlowUp);
|
|
|
Vector3 vec3 = blowUp.dir.normalized;
|
|
Vector3 vec3 = blowUp.dir.normalized;
|
|
|
if (dir < 0)
|
|
if (dir < 0)
|
|
@@ -290,10 +321,6 @@ public class AttributeStatus : MonoBehaviour
|
|
|
{
|
|
{
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- if (!PriorityOrder(SpecialState.ShotDown))
|
|
|
|
|
- {
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
attributeTime = shotDown.time * (1 - resistances.ShotDown);
|
|
attributeTime = shotDown.time * (1 - resistances.ShotDown);
|
|
|
Vector3 vec3 = shotDown.dir.normalized;
|
|
Vector3 vec3 = shotDown.dir.normalized;
|
|
|
if (dir < 0)
|
|
if (dir < 0)
|
|
@@ -312,10 +339,6 @@ public class AttributeStatus : MonoBehaviour
|
|
|
//受到击晕
|
|
//受到击晕
|
|
|
public void AddWeak(AttackInfo.Weak weak)
|
|
public void AddWeak(AttackInfo.Weak weak)
|
|
|
{
|
|
{
|
|
|
- if (!PriorityOrder(SpecialState.Weak))
|
|
|
|
|
- {
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
attributeTime = weak.time * (1 - resistances.Weak);
|
|
attributeTime = weak.time * (1 - resistances.Weak);
|
|
|
curSpecialStates = SpecialState.Weak;
|
|
curSpecialStates = SpecialState.Weak;
|
|
|
character.ani.Play("weak", 0, 0);
|
|
character.ani.Play("weak", 0, 0);
|