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-04-06 15:16:02 +03:00
|
|
|
player.animation = "HurtAir";
|
2023-01-09 18:16:00 +02:00
|
|
|
player.enter = true;
|
|
|
|
|
player.animationFrames = 0;
|
|
|
|
|
player.player.StopShakeCoroutine();
|
2023-04-04 21:43:30 +03:00
|
|
|
return;
|
2023-01-09 18:16:00 +02:00
|
|
|
}
|
2023-04-04 21:43:30 +03:00
|
|
|
player.animationFrames++;
|
2023-07-02 23:17:37 +03:00
|
|
|
player.velocity = DemonVector2.Zero;
|
2023-01-10 20:10:11 +02:00
|
|
|
ThrowBreak(player);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void ThrowBreak(PlayerNetwork player)
|
|
|
|
|
{
|
2023-07-01 23:48:47 +03:00
|
|
|
if (player.inputBuffer.CurrentTrigger().pressed && player.inputBuffer.CurrentTrigger().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)
|
|
|
|
|
{
|
2023-10-16 12:29:07 +03:00
|
|
|
player.SetParticle("ThrowTech", new DemonVector2((player.position.x + player.otherPlayer.position.x) / 2, player.position.y + (player.pushbox.size.y / 2)));
|
2023-05-05 13:51:37 +03:00
|
|
|
player.player.PlayerUI.DisplayNotification(NotificationTypeEnum.ThrowBreak);
|
2023-03-06 14:01:30 +02:00
|
|
|
player.sound = "ParryStart";
|
2023-05-18 01:00:00 +03:00
|
|
|
// 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
|
|
|
}
|
|
|
|
|
}
|