|
|
@@ -10,6 +10,10 @@ public class TornadoFan : AttackTrigger
|
|
|
[LabelText("相对于轴心旋转范围")] public Vector2 rotationRangeX;
|
|
|
[LabelText("Y轴差值范围")] public Vector2 rotationRangeY;
|
|
|
[LabelText("重新判定距离")] public float distance;
|
|
|
+ [LabelText("落地伤害倍率")] public float landingDamageRate;
|
|
|
+ [LabelText("结束击飞力的斜率")] public float forceRate;
|
|
|
+ [LabelText("结束击飞力最大值")] public float forceMax;
|
|
|
+ [LabelText("落地后眩晕时间")] public float weakTime;
|
|
|
public float lerpValue;
|
|
|
[DisplayOnly] public int damage;
|
|
|
[DisplayOnly] public float totalTime;
|
|
|
@@ -28,10 +32,29 @@ public class TornadoFan : AttackTrigger
|
|
|
MoveCharacter moveCharacter = beHitTrigger.owner as MoveCharacter;
|
|
|
if (moveCharacter != null)
|
|
|
{
|
|
|
- moveCharacter.ChangeState(CharacterState.Idle);
|
|
|
- bool canfly = moveCharacter.canFly;
|
|
|
- moveCharacter.rb.useGravity = !canfly;
|
|
|
- moveCharacter.nowCanFly = canfly;
|
|
|
+ AttackController.AttackMethod attackMethod = new AttackController.AttackMethod();
|
|
|
+ attackMethod.attackInfo = new AttackInfo();
|
|
|
+ attackMethod.attackInfo.attackEffect = new List<AttackEffect>();
|
|
|
+ attackMethod.attackInfo.attackEffect.Add(AttackEffect.BlowUp);
|
|
|
+ AttackInfo.BlowUp blowUp = attackMethod.attackInfo.blowUp;
|
|
|
+ float dir = moveCharacter.transform.position.x - transform.position.x;
|
|
|
+ if (dir >= 0)
|
|
|
+ {
|
|
|
+ blowUp.dir = new Vector3(1, 0.5f, 0);
|
|
|
+ blowUp.force = -forceRate * dir + forceMax;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ blowUp.dir = new Vector3(-1, 0.5f, 0);
|
|
|
+ blowUp.force = forceRate * dir + forceMax;
|
|
|
+ }
|
|
|
+ blowUp.time = weakTime;
|
|
|
+ blowUp.haveLandingDamage = true;
|
|
|
+ blowUp.landingDamageRate = landingDamageRate;
|
|
|
+ attackMethod.attackInfo.blowUp = blowUp;
|
|
|
+ moveCharacter.attributeStatus.AddBlowUp(attackMethod, owner.bodyTrans);
|
|
|
+ moveCharacter.bodyCollider.layer = LayerMask.NameToLayer("BodyToPlatformCollider");
|
|
|
+ moveCharacter.attributeStatus.landingDamageFrom = owner;
|
|
|
}
|
|
|
}
|
|
|
gameObject.SetActive(false);
|
|
|
@@ -43,7 +66,7 @@ public class TornadoFan : AttackTrigger
|
|
|
{
|
|
|
for (int i = 0; i < trigedLen - targetLen; i++)
|
|
|
{
|
|
|
- targetPoss.Add(CalculateTargetPos(trigedObjs[trigedLen - i - 1].owner.transform.position));
|
|
|
+ targetPoss.Add(CalculateTargetPos(trigedObjs[targetLen + i].owner.transform.position));
|
|
|
}
|
|
|
}
|
|
|
else if (targetLen > trigedLen)
|
|
|
@@ -63,6 +86,7 @@ public class TornadoFan : AttackTrigger
|
|
|
if (moveCharacter.state != CharacterState.Another && moveCharacter.state != CharacterState.Die)
|
|
|
{
|
|
|
moveCharacter.ChangeState(CharacterState.Another);
|
|
|
+ moveCharacter.ani.Play(AnimatorHash.ANIMATOR_weak, 0, 0);
|
|
|
if (moveCharacter.nowCanFly == false)
|
|
|
{
|
|
|
moveCharacter.rb.useGravity = false;
|
|
|
@@ -106,7 +130,7 @@ public class TornadoFan : AttackTrigger
|
|
|
float dir = originalPos.x < transform.position.x ? 1 : -1;
|
|
|
Vector3 targetPos = transform.position;
|
|
|
targetPos.x += dir * Random.Range(rotationRangeX.x,rotationRangeX.y);
|
|
|
- Vector2 rangeY = new Vector2(targetPos.y + rotationRangeY.x, targetPos.y + rotationRangeY.y);
|
|
|
+ Vector2 rangeY = new Vector2(originalPos.y + rotationRangeY.x, originalPos.y + rotationRangeY.y);
|
|
|
if(rangeY.x < 0)
|
|
|
{
|
|
|
rangeY.x = 0;
|