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)
|
|
|
|
|
{
|
2023-01-16 13:26:54 +02:00
|
|
|
player.comboLocked = true;
|
2023-01-07 23:17:55 +02:00
|
|
|
player.wasWallSplatted = true;
|
2022-12-31 20:46:52 +02:00
|
|
|
DemonicsVector2 effectPosition = new DemonicsVector2(player.position.x + ((DemonicsFloat)2.25 * player.flip), player.position.y);
|
2022-12-28 14:10:45 +02:00
|
|
|
if (player.flip == 1)
|
|
|
|
|
{
|
|
|
|
|
player.SetEffect("WallSplat", effectPosition, true);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
player.SetEffect("WallSplat", effectPosition, false);
|
|
|
|
|
}
|
|
|
|
|
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;
|
2022-12-28 14:10:45 +02:00
|
|
|
}
|
2022-12-31 20:46:52 +02:00
|
|
|
player.velocity = DemonicsVector2.Zero;
|
2022-12-28 14:10:45 +02:00
|
|
|
player.hurtbox.active = false;
|
|
|
|
|
player.animation = "Wallsplat";
|
|
|
|
|
player.animationFrames++;
|
|
|
|
|
ToAirborneState(player);
|
|
|
|
|
}
|
|
|
|
|
private void ToAirborneState(PlayerNetwork player)
|
|
|
|
|
{
|
|
|
|
|
if (player.animationFrames >= 10)
|
|
|
|
|
{
|
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
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|