using UnityEngine; public class GroundParentState : State { public override void UpdateLogic(PlayerNetwork player) { base.UpdateLogic(player); player.canDoubleJump = true; player.canDash = true; player.hasJumped = false; player.canJump = true; ToHurtState(player); } public override bool ToBlueFrenzyState(PlayerNetwork player) { player.enter = false; player.state = "BlueFrenzy"; return true; } public override bool ToRedFrenzyState(PlayerNetwork player) { player.enter = false; player.state = "RedFrenzy"; return true; } private void ToHurtState(PlayerNetwork player) { if (!player.otherPlayer.canChainAttack && DemonicsCollider.Colliding(player.otherPlayer.hitbox, player.hurtbox)) { player.enter = false; player.attackHurtNetwork = player.otherPlayer.attackNetwork; if (IsBlocking(player)) { if (player.direction.y < 0) { player.state = "BlockLow"; } else { player.state = "Block"; } } else { if (player.attackHurtNetwork.hardKnockdown) { player.state = "Airborne"; } else { if (player.attackHurtNetwork.knockbackArc == 0 || player.attackHurtNetwork.softKnockdown) { player.state = "Hurt"; } else { player.state = "HurtAir"; } } } } } public override bool ToBlockState(PlayerNetwork player, AttackSO attack) { player.enter = false; if (player.direction.y < 0) { player.state = "BlockLow"; } else { player.state = "Block"; } return true; } }