|
@@ -25,7 +25,7 @@ public class AttributeStatus : MonoBehaviour
|
|
|
|
|
|
|
|
//behit参数
|
|
//behit参数
|
|
|
[DisplayOnly] public SpecialState curSpecialStates = SpecialState.Null;
|
|
[DisplayOnly] public SpecialState curSpecialStates = SpecialState.Null;
|
|
|
- public AttackInfo attackInfo;
|
|
|
|
|
|
|
+ public AttackController.AttackMethod attackMethod;
|
|
|
|
|
|
|
|
[LabelText("控制时间")] [DisplayOnly] public float attributeTime;
|
|
[LabelText("控制时间")] [DisplayOnly] public float attributeTime;
|
|
|
|
|
|
|
@@ -125,14 +125,14 @@ public class AttributeStatus : MonoBehaviour
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public void AddSpecialState(AttackInfo attackInfo, Character attackFrom)
|
|
|
|
|
|
|
+ public void AddSpecialState(AttackController.AttackMethod attackMethod, Character attackFrom)
|
|
|
{
|
|
{
|
|
|
- if (attackInfo.attackEffect != null && attackInfo.attackEffect.Length > 0)
|
|
|
|
|
|
|
+ if (attackMethod.attackInfo.attackEffect != null && attackMethod.attackInfo.attackEffect.Length > 0)
|
|
|
{
|
|
{
|
|
|
AttackEffect attackEffect = AttackEffect.Null;
|
|
AttackEffect attackEffect = AttackEffect.Null;
|
|
|
- foreach (AttackEffect ae in attackInfo.attackEffect)
|
|
|
|
|
|
|
+ foreach (AttackEffect ae in attackMethod.attackInfo.attackEffect)
|
|
|
{
|
|
{
|
|
|
- switch (attackInfo.attackEffect[0])
|
|
|
|
|
|
|
+ switch (attackMethod.attackInfo.attackEffect[0])
|
|
|
{
|
|
{
|
|
|
/*控制*/
|
|
/*控制*/
|
|
|
//漂浮
|
|
//漂浮
|
|
@@ -141,7 +141,7 @@ public class AttributeStatus : MonoBehaviour
|
|
|
{
|
|
{
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
- if (PriorityOrder(SpecialState.FloatState, attackInfo.floatState.ControlOrder))
|
|
|
|
|
|
|
+ if (PriorityOrder(SpecialState.FloatState, attackMethod.attackInfo.floatState.ControlOrder))
|
|
|
{
|
|
{
|
|
|
attackEffect = AttackEffect.FloatState;
|
|
attackEffect = AttackEffect.FloatState;
|
|
|
}
|
|
}
|
|
@@ -154,7 +154,7 @@ public class AttributeStatus : MonoBehaviour
|
|
|
}
|
|
}
|
|
|
if (!character.nowCanFly)
|
|
if (!character.nowCanFly)
|
|
|
{
|
|
{
|
|
|
- if (PriorityOrder(SpecialState.BlownUp, attackInfo.blowUp.ControlOrder))
|
|
|
|
|
|
|
+ if (PriorityOrder(SpecialState.BlownUp,attackMethod.attackInfo.blowUp.ControlOrder))
|
|
|
{
|
|
{
|
|
|
attackEffect = AttackEffect.BlowUp;
|
|
attackEffect = AttackEffect.BlowUp;
|
|
|
}
|
|
}
|
|
@@ -168,7 +168,7 @@ public class AttributeStatus : MonoBehaviour
|
|
|
}
|
|
}
|
|
|
if (character.nowCanFly || !character.canNotShotDown)
|
|
if (character.nowCanFly || !character.canNotShotDown)
|
|
|
{
|
|
{
|
|
|
- if (PriorityOrder(SpecialState.ShotDown, attackInfo.shotDown.ControlOrder))
|
|
|
|
|
|
|
+ if (PriorityOrder(SpecialState.ShotDown,attackMethod.attackInfo.shotDown.ControlOrder))
|
|
|
{
|
|
{
|
|
|
attackEffect = AttackEffect.ShotDown;
|
|
attackEffect = AttackEffect.ShotDown;
|
|
|
}
|
|
}
|
|
@@ -180,7 +180,7 @@ public class AttributeStatus : MonoBehaviour
|
|
|
{
|
|
{
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
- if (PriorityOrder(SpecialState.Weak, attackInfo.weak.ControlOrder))
|
|
|
|
|
|
|
+ if (PriorityOrder(SpecialState.Weak,attackMethod.attackInfo.weak.ControlOrder))
|
|
|
{
|
|
{
|
|
|
attackEffect = AttackEffect.Weak;
|
|
attackEffect = AttackEffect.Weak;
|
|
|
}
|
|
}
|
|
@@ -195,29 +195,29 @@ public class AttributeStatus : MonoBehaviour
|
|
|
/*控制*/
|
|
/*控制*/
|
|
|
//漂浮
|
|
//漂浮
|
|
|
case AttackEffect.FloatState:
|
|
case AttackEffect.FloatState:
|
|
|
- AddFloat(attackInfo);
|
|
|
|
|
|
|
+ AddFloat(attackMethod);
|
|
|
break;
|
|
break;
|
|
|
//击飞
|
|
//击飞
|
|
|
case AttackEffect.BlowUp:
|
|
case AttackEffect.BlowUp:
|
|
|
- AddBlowUp(attackInfo, attackFrom.bodyTrans);
|
|
|
|
|
|
|
+ AddBlowUp(attackMethod, attackFrom.bodyTrans);
|
|
|
character.bodyCollider.layer = LayerMask.NameToLayer("BodyToPlatformCollider");
|
|
character.bodyCollider.layer = LayerMask.NameToLayer("BodyToPlatformCollider");
|
|
|
- if (attackInfo.blowUp.haveLandingDamage)
|
|
|
|
|
|
|
+ if (attackMethod.attackInfo.blowUp.haveLandingDamage)
|
|
|
{
|
|
{
|
|
|
landingDamageFrom = attackFrom;
|
|
landingDamageFrom = attackFrom;
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
|
//击落
|
|
//击落
|
|
|
case AttackEffect.ShotDown:
|
|
case AttackEffect.ShotDown:
|
|
|
- AddShotDown(attackInfo, attackFrom.bodyTrans);
|
|
|
|
|
|
|
+ AddShotDown(attackMethod, attackFrom.bodyTrans);
|
|
|
character.bodyCollider.layer = LayerMask.NameToLayer("BodyToPlatformCollider");
|
|
character.bodyCollider.layer = LayerMask.NameToLayer("BodyToPlatformCollider");
|
|
|
- if (attackInfo.shotDown.haveLandingDamage)
|
|
|
|
|
|
|
+ if (attackMethod.attackInfo.shotDown.haveLandingDamage)
|
|
|
{
|
|
{
|
|
|
landingDamageFrom = attackFrom;
|
|
landingDamageFrom = attackFrom;
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
|
//击晕
|
|
//击晕
|
|
|
case AttackEffect.Weak:
|
|
case AttackEffect.Weak:
|
|
|
- AddWeak(attackInfo);
|
|
|
|
|
|
|
+ AddWeak(attackMethod);
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
return;
|
|
return;
|
|
@@ -320,21 +320,21 @@ public class AttributeStatus : MonoBehaviour
|
|
|
int landingDamage;
|
|
int landingDamage;
|
|
|
if (specialState == SpecialState.BlownUp)
|
|
if (specialState == SpecialState.BlownUp)
|
|
|
{
|
|
{
|
|
|
- if (attackInfo.blowUp.haveLandingDamage)
|
|
|
|
|
|
|
+ if (attackMethod.attackInfo.blowUp.haveLandingDamage)
|
|
|
{
|
|
{
|
|
|
- landingDamage = (int)(Mathf.Abs(transform.position.x - startFlyPos.x) * attackInfo.blowUp.landingDamageRate);
|
|
|
|
|
|
|
+ landingDamage = (int)(Mathf.Abs(transform.position.x - startFlyPos.x) * attackMethod.attackInfo.blowUp.landingDamageRate);
|
|
|
if (landingDamage > 0)
|
|
if (landingDamage > 0)
|
|
|
{
|
|
{
|
|
|
- character.BeHit(attackInfo, landingDamageFrom, landingDamage);
|
|
|
|
|
|
|
+ character.BeHit(attackMethod, landingDamageFrom, landingDamage);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- if (attackInfo.shotDown.haveLandingDamage)
|
|
|
|
|
|
|
+ if (attackMethod.attackInfo.shotDown.haveLandingDamage)
|
|
|
{
|
|
{
|
|
|
- landingDamage = attackInfo.shotDown.landingDamage;
|
|
|
|
|
- character.BeHit(attackInfo, landingDamageFrom, landingDamage);
|
|
|
|
|
|
|
+ landingDamage = attackMethod.attackInfo.shotDown.landingDamage;
|
|
|
|
|
+ character.BeHit(attackMethod, landingDamageFrom, landingDamage);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
BounceEffect();
|
|
BounceEffect();
|
|
@@ -450,14 +450,14 @@ public class AttributeStatus : MonoBehaviour
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//受到漂浮
|
|
//受到漂浮
|
|
|
- public void AddFloat(AttackInfo attackInfo)
|
|
|
|
|
|
|
+ public void AddFloat(AttackController.AttackMethod attackMethod)
|
|
|
{
|
|
{
|
|
|
if (resistances.Float == 1)
|
|
if (resistances.Float == 1)
|
|
|
{
|
|
{
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- this.attackInfo = attackInfo;
|
|
|
|
|
- AttackInfo.FloatState floatState = attackInfo.floatState;
|
|
|
|
|
|
|
+ this.attackMethod = attackMethod;
|
|
|
|
|
+ AttackInfo.FloatState floatState = attackMethod.attackInfo.floatState;
|
|
|
rb.isKinematic = false;
|
|
rb.isKinematic = false;
|
|
|
rb.useGravity = false;
|
|
rb.useGravity = false;
|
|
|
floatingState = 1;
|
|
floatingState = 1;
|
|
@@ -478,14 +478,14 @@ public class AttributeStatus : MonoBehaviour
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//受到击飞
|
|
//受到击飞
|
|
|
- public void AddBlowUp(AttackInfo attackInfo, Transform attackFrom)
|
|
|
|
|
|
|
+ public void AddBlowUp(AttackController.AttackMethod attackMethod, Transform attackFrom)
|
|
|
{
|
|
{
|
|
|
if (resistances.BlowUp == 1)
|
|
if (resistances.BlowUp == 1)
|
|
|
{
|
|
{
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- this.attackInfo = attackInfo;
|
|
|
|
|
- AttackInfo.BlowUp blowUp = attackInfo.blowUp;
|
|
|
|
|
|
|
+ this.attackMethod = attackMethod;
|
|
|
|
|
+ AttackInfo.BlowUp blowUp = attackMethod.attackInfo.blowUp;
|
|
|
attributeTime = blowUp.time * (1 - resistances.BlowUp);
|
|
attributeTime = blowUp.time * (1 - resistances.BlowUp);
|
|
|
Vector3 vec3 = new Vector3(
|
|
Vector3 vec3 = new Vector3(
|
|
|
blowUp.dir.x + UnityEngine.Random.Range(-blowUp.dirRandom.x / 2f, blowUp.dirRandom.x / 2f),
|
|
blowUp.dir.x + UnityEngine.Random.Range(-blowUp.dirRandom.x / 2f, blowUp.dirRandom.x / 2f),
|
|
@@ -526,14 +526,14 @@ public class AttributeStatus : MonoBehaviour
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//受到击落
|
|
//受到击落
|
|
|
- public void AddShotDown(AttackInfo attackInfo, Transform attackFrom)
|
|
|
|
|
|
|
+ public void AddShotDown(AttackController.AttackMethod attackMethod, Transform attackFrom)
|
|
|
{
|
|
{
|
|
|
if (resistances.ShotDown == 1)
|
|
if (resistances.ShotDown == 1)
|
|
|
{
|
|
{
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- this.attackInfo = attackInfo;
|
|
|
|
|
- AttackInfo.ShotDown shotDown = attackInfo.shotDown;
|
|
|
|
|
|
|
+ this.attackMethod = attackMethod;
|
|
|
|
|
+ AttackInfo.ShotDown shotDown = attackMethod.attackInfo.shotDown;
|
|
|
attributeTime = shotDown.time * (1 - resistances.ShotDown);
|
|
attributeTime = shotDown.time * (1 - resistances.ShotDown);
|
|
|
Vector3 vec3 = new Vector3(
|
|
Vector3 vec3 = new Vector3(
|
|
|
shotDown.dir.x + UnityEngine.Random.Range(-shotDown.dirRandom.x / 2f, shotDown.dirRandom.x / 2f),
|
|
shotDown.dir.x + UnityEngine.Random.Range(-shotDown.dirRandom.x / 2f, shotDown.dirRandom.x / 2f),
|
|
@@ -568,14 +568,14 @@ public class AttributeStatus : MonoBehaviour
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//受到击晕
|
|
//受到击晕
|
|
|
- public void AddWeak(AttackInfo attackInfo)
|
|
|
|
|
|
|
+ public void AddWeak(AttackController.AttackMethod attackMethod)
|
|
|
{
|
|
{
|
|
|
if (resistances.Weak == 1)
|
|
if (resistances.Weak == 1)
|
|
|
{
|
|
{
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- this.attackInfo = attackInfo;
|
|
|
|
|
- AttackInfo.Weak weak = attackInfo.weak;
|
|
|
|
|
|
|
+ this.attackMethod = attackMethod;
|
|
|
|
|
+ AttackInfo.Weak weak = attackMethod.attackInfo.weak;
|
|
|
attributeTime = weak.time * (1 - resistances.Weak);
|
|
attributeTime = weak.time * (1 - resistances.Weak);
|
|
|
character.ani.Play("weak", 0, 0);
|
|
character.ani.Play("weak", 0, 0);
|
|
|
character.ChangeState(CharacterState.SpecialStatus_Weak);
|
|
character.ChangeState(CharacterState.SpecialStatus_Weak);
|
|
@@ -583,10 +583,10 @@ public class AttributeStatus : MonoBehaviour
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//受到穿甲
|
|
//受到穿甲
|
|
|
- public int AddArmorPiercing(AttackInfo attackInfo)
|
|
|
|
|
|
|
+ public int AddArmorPiercing(AttackController.AttackMethod attackMethod)
|
|
|
{
|
|
{
|
|
|
- this.attackInfo = attackInfo;
|
|
|
|
|
- AttackInfo.ArmorPiercing armor = attackInfo.armorPiercing;
|
|
|
|
|
|
|
+ this.attackMethod = attackMethod;
|
|
|
|
|
+ AttackInfo.ArmorPiercing armor = attackMethod.attackInfo.armorPiercing;
|
|
|
//计算护甲减免
|
|
//计算护甲减免
|
|
|
int am = resistances.armor;
|
|
int am = resistances.armor;
|
|
|
if (am > 0)
|
|
if (am > 0)
|
|
@@ -601,19 +601,19 @@ public class AttributeStatus : MonoBehaviour
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//受到易伤
|
|
//受到易伤
|
|
|
- public void AddVulnerable(AttackInfo attackInfo)
|
|
|
|
|
|
|
+ public void AddVulnerable(AttackController.AttackMethod attackMethod)
|
|
|
{
|
|
{
|
|
|
- this.attackInfo = attackInfo;
|
|
|
|
|
- AttackInfo.Vulnerable vulnerable = attackInfo.vulnerable;
|
|
|
|
|
|
|
+ this.attackMethod = attackMethod;
|
|
|
|
|
+ AttackInfo.Vulnerable vulnerable = attackMethod.attackInfo.vulnerable;
|
|
|
vulnerableTime = vulnerable.time;
|
|
vulnerableTime = vulnerable.time;
|
|
|
haveVulnerable = true;
|
|
haveVulnerable = true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//受到累伤
|
|
//受到累伤
|
|
|
- public void AddStackingWouds(AttackInfo attackInfo)
|
|
|
|
|
|
|
+ public void AddStackingWouds(AttackController.AttackMethod attackMethod)
|
|
|
{
|
|
{
|
|
|
- this.attackInfo = attackInfo;
|
|
|
|
|
- AttackInfo.StackingWounds stackingWounds = attackInfo.stackingWounds;
|
|
|
|
|
|
|
+ this.attackMethod = attackMethod;
|
|
|
|
|
+ AttackInfo.StackingWounds stackingWounds = attackMethod.attackInfo.stackingWounds;
|
|
|
stackingWoudsTime = stackingWounds.time;
|
|
stackingWoudsTime = stackingWounds.time;
|
|
|
stackingWordsNum++;
|
|
stackingWordsNum++;
|
|
|
}
|
|
}
|