Files

43 lines
1.5 KiB
C#
Raw Normal View History

2022-12-28 14:10:45 +02:00
using UnityEngine;
public class WallSplatState : State
{
public override void UpdateLogic(PlayerNetwork player)
{
CheckFlip(player);
if (!player.enter)
{
player.player.PlayerUI.DisplayNotification(NotificationTypeEnum.WallSplat);
2023-04-14 16:18:53 +03:00
CameraShake.Instance.Zoom(-4, 0.2f);
if (player.CurrentState != this)
player.comboLocked = true;
2023-01-07 23:17:55 +02:00
player.wasWallSplatted = true;
2023-07-02 23:17:37 +03:00
DemonVector2 effectPosition = new DemonVector2(player.position.x + ((DemonFloat)2.25 * player.flip), player.position.y);
2022-12-28 14:10:45 +02:00
if (player.flip == 1)
2023-07-03 20:04:17 +03:00
player.SetParticle("WallSplat", effectPosition);
2022-12-28 14:10:45 +02:00
else
2023-07-03 20:04:17 +03:00
player.SetParticle("WallSplat", effectPosition);
2022-12-28 14:10:45 +02:00
player.sound = "WallSplat";
player.enter = true;
player.animationFrames = 0;
2023-02-15 18:01:29 +02:00
player.attackHurtNetwork.knockbackArc = 35;
player.attackHurtNetwork.knockbackDuration = 27;
return;
2022-12-28 14:10:45 +02:00
}
player.animationFrames++;
2023-07-02 23:17:37 +03:00
player.velocity = DemonVector2.Zero;
2022-12-28 14:10:45 +02:00
player.hurtbox.active = false;
player.animation = "Wallsplat";
ToAirborneState(player);
}
private void ToAirborneState(PlayerNetwork player)
{
2023-04-14 16:18:53 +03:00
if (player.animationFrames >= 20)
2022-12-28 14:10:45 +02:00
{
2023-04-14 16:18:53 +03:00
CameraShake.Instance.ZoomDefault(0.1f);
2023-01-07 23:17:55 +02:00
player.flip *= -1;
2022-12-28 14:10:45 +02:00
player.hurtbox.active = true;
2023-01-23 18:31:58 +02:00
EnterState(player, "Airborne");
2022-12-28 14:10:45 +02:00
}
}
}