void DisplayComboInformation(float amount) { if (state.GetState() == FighterState.hitstun) { comboDamage += (int)amount; comboHits++; } else { comboDamage = (int)amount; } UIMatch.ComboTextUpdate(comboDamage, comboHits, state.isPlayerOne()); }
void AdjustBar() { UIMatch.SuperbarUpdate((currentMeter / superMeterMaximum), state.isPlayerOne()); }
void HitstunUpdate() { if (state.GetState() == FighterState.hitstun) { // stun that the player is pushed back during if (stunMovementRemaining > 0) { if (transform.position.X >= Camera.GetBound() || transform.position.X <= Camera.GetBound(false) && !ignoreCornerPushback) { playerMovement.otherPlayerMovement.MoveTowards(movementStepSize); } else { playerMovement.MoveTowards(movementStepSize); } stunMovementRemaining--; } //regular hitstun if (hitstunRemaining <= 0) { UIMatch.HideComboText(state.isPlayerOne()); state.SetState(FighterState.neutral); } hitstunRemaining--; } else if (state.GetState() == FighterState.airHitstun) { if (stunMovementRemaining > 0) { playerMovement.MoveTowards(movementStepSize); stunMovementRemaining--; } else { playerMovement.MoveTowards(new Vector2(0, -10)); if (transform.position.Y <= playerMovement.groundBound) { // hitground groundRecoveryRemaining = 80; if (health.GetHealth() <= 0) { animator.PlayAnimation(FighterAnimations.deathKnockdown); } else { UIMatch.HideComboText(state.isPlayerOne()); animator.PlayAnimation(FighterAnimations.knockdown); } state.SetState(FighterState.invincible); } } } else if (state.GetState() == FighterState.blockstun) { if (stunMovementRemaining > 0) { playerMovement.MoveTowards(movementStepSize); stunMovementRemaining--; } if (blockstunRemaining <= 0) { state.SetState(FighterState.neutral); } blockstunRemaining--; } }