Files
David Kalatzis 9297c6f2bb Minor update
2023-01-23 18:31:58 +02:00

39 lines
1.3 KiB
C#

using UnityEngine;
public class GrabbedState : State
{
public override void UpdateLogic(PlayerNetwork player)
{
if (!player.enter)
{
if (player.otherPlayer.state == "Arcana")
{
EnterState(player.otherPlayer, "ArcanaEnd");
}
else
{
EnterState(player.otherPlayer, "Throw");
}
player.enter = true;
player.animationFrames = 0;
player.player.StopShakeCoroutine();
}
player.velocity = DemonicsVector2.Zero;
player.animation = "HurtAir";
player.animationFrames++;
ThrowBreak(player);
}
private void ThrowBreak(PlayerNetwork player)
{
if (player.inputBuffer.CurrentInput().pressed && player.inputBuffer.CurrentInput().inputEnum == InputEnum.Throw)
{
if (player.otherPlayer.state != "Arcana" && player.animationFrames <= 6)
{
player.SetEffect("Impact", new DemonicsVector2((player.position.x + player.otherPlayer.position.x) / 2, player.position.y + (player.pushbox.size.y / 2)));
EnterState(player, "Knockback");
EnterState(player.otherPlayer, "Knockback");
}
}
}
}