Files

33 lines
1.1 KiB
C#
Raw Normal View History

2023-01-23 18:31:58 +02:00
using UnityEngine;
public class GiveUpState : State
{
public override void UpdateLogic(PlayerNetwork player)
{
if (!player.enter)
{
2023-01-28 03:45:14 +02:00
GameSimulation.Run = false;
GameSimulation.GlobalHitstop = 1;
player.velocity = DemonicsVector2.Zero;
2023-01-23 18:31:58 +02:00
player.enter = true;
2023-01-28 03:45:14 +02:00
player.animationFrames = 0;
player.player.StopShakeCoroutine();
GameplayManager.Instance.RoundOver(true);
player.healthRecoverable = 0;
player.player.PlayerUI.UpdateHealthDamaged(player.healthRecoverable);
ResetCombo(player);
return;
2023-01-28 03:45:14 +02:00
}
player.velocity = new DemonicsVector2(player.velocity.x, player.velocity.y - DemonicsPhysics.GRAVITY);
player.animation = "Death";
player.animationFrames++;
if (player.animationFrames >= 725)
{
GameSimulation.Timer = GameSimulation._timerMax;
2023-01-28 03:45:14 +02:00
ResetPlayer(player);
ResetPlayer(player.otherPlayer);
EnterState(player, "Taunt");
EnterState(player.otherPlayer, "Taunt");
2023-01-23 18:31:58 +02:00
}
}
}