public IEnumerator AbilityCoroutine(float abilityDuration) { playerController.stateMachine.currentPlayerState = PlayerState.ability; if (currentAbility.name == "PlaceBomb") { currentAbility.Ability(playerController.PlayerRigidbody.position); } else { currentAbility.Ability(); } yield return(new WaitForSeconds(abilityDuration)); playerController.stateMachine.currentPlayerState = PlayerState.idle; }
public IEnumerator AbilityCo(float abilityDuration) { currentState = PlayerState.ability; currentAbility.Ability(transform.position, facingDirection, animator, myRigidbody); yield return(new WaitForSeconds(abilityDuration)); currentState = PlayerState.idle; }
public IEnumerator PhaseCo(float abilityDuration) { //TODO **NEEDS ANIMATIONS, NEEDS SCREEN EFFECTS, NEEDS BALANCING** RECALL EFFECT? hasPhased = true; hurtBox.enabled = false; mySprite.color = Color.black; currentPhase.Ability(transform.position, facingDirection, anim.anim, myRigidbody); yield return(new WaitForSeconds(abilityDuration)); mySprite.color = Color.white; hurtBox.enabled = true; StartCoroutine(HasPhasedCo()); }
// public IEnumerator DashCo(float abilityDuration) { //TODO **NEEDS ANIMATIONS** checks Dash cooldown, if not on CD, changes color, disables player Hurtbox, //changes state, Dashes, waits for Duration, resets state, enables Hurtbox, returns color, begins hasDashCo. hasDashed = true; hurtBox.enabled = false; mySprite.color = Color.black; myState.ChangeState(GenericState.ability); currentAbility.Ability(transform.position, facingDirection, anim.anim, myRigidbody); yield return(new WaitForSeconds(abilityDuration)); myState.ChangeState(GenericState.idle); mySprite.color = Color.white; hurtBox.enabled = true; StartCoroutine(HasDashedCo()); }
private IEnumerator AttackCo(float abilityDuration) { anim.SetBool("IsAttacking", true); currentState = PlayerState.attack; yield return(null); currentAbility.Ability(transform.position, facingDirection, anim, myRigidbody2D); anim.SetBool("IsAttacking", false); yield return(new WaitForSeconds(abilityDuration)); if (currentState != PlayerState.interact) { currentState = PlayerState.walk; } }