Files

43 lines
1.6 KiB
C#
Raw Normal View History

2023-01-16 13:26:54 +02:00
using UnityEngine;
2023-01-09 18:16:00 +02:00
public class GrabbedState : State
{
public override void UpdateLogic(PlayerNetwork player)
{
if (!player.enter)
{
2023-01-16 13:26:54 +02:00
if (player.otherPlayer.state == "Arcana")
{
2023-01-23 18:31:58 +02:00
EnterState(player.otherPlayer, "ArcanaEnd");
2023-01-16 13:26:54 +02:00
}
else
{
2023-01-23 18:31:58 +02:00
EnterState(player.otherPlayer, "Throw");
2023-01-16 13:26:54 +02:00
}
player.animation = "HurtAir";
2023-01-09 18:16:00 +02:00
player.enter = true;
player.animationFrames = 0;
player.player.StopShakeCoroutine();
return;
2023-01-09 18:16:00 +02:00
}
player.animationFrames++;
2023-01-10 18:39:07 +02:00
player.velocity = DemonicsVector2.Zero;
2023-01-10 20:10:11 +02:00
ThrowBreak(player);
}
private void ThrowBreak(PlayerNetwork player)
{
2023-01-23 18:31:58 +02:00
if (player.inputBuffer.CurrentInput().pressed && player.inputBuffer.CurrentInput().inputEnum == InputEnum.Throw)
2023-01-10 20:10:11 +02:00
{
2023-01-18 21:41:03 +02:00
if (player.otherPlayer.state != "Arcana" && player.animationFrames <= 6)
{
player.player.ThrowTechPrefab(new DemonicsVector2((player.position.x + player.otherPlayer.position.x) / 2, player.position.y + (player.pushbox.size.y / 2)));
player.player.PlayerUI.DisplayNotification(NotificationTypeEnum.ThrowBreak);
2023-03-06 14:01:30 +02:00
player.sound = "ParryStart";
// player.SetEffect("Impact", new DemonicsVector2((player.position.x + player.otherPlayer.position.x) / 2, player.position.y + (player.pushbox.size.y / 2)));
2023-01-23 18:31:58 +02:00
EnterState(player, "Knockback");
EnterState(player.otherPlayer, "Knockback");
2023-01-18 21:41:03 +02:00
}
2023-01-10 20:10:11 +02:00
}
2023-01-09 18:16:00 +02:00
}
}