public virtual void AttemptToConsumeItem(PlayerAnimatorManager playerAnimatorManager, WeaponSlotManager weaponSlotManager, PlayerFXManager playerFXManager) { if (currentAmount > 0) { playerAnimatorManager.PlayTargetAnimation(consumeAnimation, isInteracting, true); } else { playerAnimatorManager.PlayTargetAnimation("Potion Empty", true); } }
public override void AttemptToCastSpell( PlayerAnimatorManager animationHandler, PlayerStats playerStats, WeaponSlotManager weaponSlotManager) { base.AttemptToCastSpell(animationHandler, playerStats, weaponSlotManager); GameObject instantiatedWarmUpSpellFX = Instantiate(spellWarmUpFX, animationHandler.transform); animationHandler.PlayTargetAnimation(spellAnimation, true); Debug.Log("Casting Spell"); Destroy(instantiatedWarmUpSpellFX, 2); }
public override void TakeDamage(int damage, string damageAnimation = "Damage_01") { if (playerManager.isInvulnerable) { return; } base.TakeDamage(damage, damageAnimation = "Damage_01"); healthBar.SetCurrentHealth(CurrentHealth); animatorHandler.PlayTargetAnimation(damageAnimation, true); if (CurrentHealth <= 0) { CurrentHealth = 0; isDead = true; animatorHandler.PlayTargetAnimation("Death_01", true); //Handle respawn gameManager.Respawn(); } }
public void HandleRollingAndSprinting(float delta) { if (animatorHandler.anim.GetBool("isInteracting")) { return; } //Stamina dependency if (playerStats.CurrentStamina <= 0) { return; } if (inputHandler.isRolling) { moveDirection = cameraObject.forward * inputHandler.vertical; moveDirection += cameraObject.right * inputHandler.horizontal; if (inputHandler.moveAmount > 0) { animatorHandler.PlayTargetAnimation("Rolling", true); moveDirection.y = 0; Quaternion rollRotation = Quaternion.LookRotation(moveDirection); myTransform.rotation = rollRotation; playerStats.TakeStamina(rollStaminaCost); } else { animatorHandler.PlayTargetAnimation("Backstep", true); playerStats.TakeStamina(backStepStaminaCost); } } }
public override void AttemptToCastSpell( PlayerAnimatorManager animationHandler, PlayerStats playerStats, WeaponSlotManager weaponSlotManager) { base.AttemptToCastSpell(animationHandler, playerStats, weaponSlotManager); //instantiate the spell in the player's hand GameObject instantiatedWarmUpSpellFX = Instantiate(spellWarmUpFX, weaponSlotManager.rightHandSlot.transform); //The scale changes depends on preference instantiatedWarmUpSpellFX.gameObject.transform.localScale = new Vector3(1, 1, 1); //play animation animationHandler.PlayTargetAnimation(spellAnimation, true); }
public void OpenChestInteraction(Transform playerPosition) { playerLocomotion.rigidbody.velocity = Vector3.zero; transform.position = playerPosition.transform.position; playerAnimatorManager.PlayTargetAnimation("Open Chest", true); }
public void HandleWeaponCombo(Weapon weapon) { //Stamina dependency if (playerStats.CurrentStamina <= 0) { return; } if (inputHandler.comboFlag) { animatorHandler.anim.SetBool("canDoCombo", false); if (lastAttack == weapon.OH_Light_Attack_1) { animatorHandler.PlayTargetAnimation(weapon.OH_Light_Attack_2, true); } else if (lastAttack == weapon.TH_Light_Attack_1) { animatorHandler.PlayTargetAnimation(weapon.TH_Light_Attack_2, true); } } }