private void JumpOrNot() { if (!_jumpIt) { _jumpIt = true; _currMove = GhostKingMoves.JumpAttack; } else { _attacking = false; _jumpIt = false; } }
private void HandAttack() { if (!_invokeAllowed) { _invokeAllowed = MoveToCenterRoom(transform, roomCenterOffSet); } else { print("entered"); if (_timeHandAttack <= 0) { if (!_attackingHand) { //animations things; ghostKingAnimator.SetBool("isInvoking", true); ghostKingAnimator.SetBool("isIdle", false); // thrown in the cyclop's throw frame InvokeMonsters(); _attackingHand = true; _timeHandAttack = timeHandAttack; } else { ghostKingAnimator.SetBool("isInvoking", false); ghostKingAnimator.SetBool("isIdle", true); _attackingHand = false; _invokeAllowed = false; _recoverLife = true; _currMove = GhostKingMoves.Heal; } } else { _timeHandAttack -= Time.deltaTime; } } }
public override void Attack() { if (stateHasChanged) { StopMovement(); } if (!_attacking) { _currMove = ChooseAttack(); _attacking = true; } else { switch (_currMove) { case GhostKingMoves.HandAttack: HandAttack(); break; case GhostKingMoves.JumpAttack: JumpAttack(); break; case GhostKingMoves.SwordAttack: SwordAttack(); break; case GhostKingMoves.BreathAttack: BreathAttack(); break; case GhostKingMoves.Heal: Heal(); break; } } }