示例#1
0
 public virtual void AttemptToCastSpell(
     PlayerAnimatorManager animationHandler,
     PlayerStats playerStats,
     WeaponSlotManager weaponSlotManager)
 {
     Debug.Log("Casting Spell");
 }
        public override void SuccessfullyCastSpell(
            PlayerAnimatorManager animationHandler,
            PlayerStats playerStats,
            CameraHandler cameraHandler,
            WeaponSlotManager weaponSlotManager)
        {
            base.SuccessfullyCastSpell(animationHandler, playerStats, cameraHandler, weaponSlotManager);

            GameObject instantiatedSpellFX = Instantiate(spellCastFX, weaponSlotManager.rightHandSlot.transform.position,
                                                         cameraHandler.cameraPivotTransform.rotation);

            rigidbody = instantiatedSpellFX.GetComponent <Rigidbody>();
            // spell dmg collider
            //spellDamageCollider = instatiatedSpellFX.GetComponent<SpellDamageCollider>();


            //aiming spell angle w/ or w/o lock on
            if (cameraHandler.currentLockOnTarget != null)
            {
                instantiatedSpellFX.transform.LookAt(cameraHandler.currentLockOnTarget.transform);
            }
            else
            {
                instantiatedSpellFX.transform.rotation = Quaternion.Euler(cameraHandler.cameraPivotTransform.eulerAngles.x, playerStats.transform.eulerAngles.y, 0);
            }

            rigidbody.AddForce(instantiatedSpellFX.transform.forward * projectileForwardVelocity);
            rigidbody.AddForce(instantiatedSpellFX.transform.up * projectileUpwardVelocity);
            rigidbody.useGravity = isEffectedByGravity;
            rigidbody.mass       = projectileMass;
            instantiatedSpellFX.transform.parent = null;
        }
示例#3
0
 public virtual void SuccessfullyCastSpell(
     PlayerAnimatorManager animationHandler,
     PlayerStats playerStats,
     CameraHandler cameraHandler,
     WeaponSlotManager weaponSlotManager)
 {
     Debug.Log("Casting Spell successful");
     playerStats.DeductFocusPoints(focusPointCost);
 }
示例#4
0
 private void Awake()
 {
     playerManager   = GetComponent <PlayerManager>();
     healthBar       = FindObjectOfType <HealthBar>();
     staminaBar      = FindObjectOfType <StaminaBar>();
     manaBar         = FindObjectOfType <MPBar>();
     gameManager     = FindObjectOfType <GameManager>();
     animatorHandler = GetComponentInChildren <PlayerAnimatorManager>();
 }
示例#5
0
 private void Awake()
 {
     cameraHandler   = FindObjectOfType <CameraHandler>();
     rigidbody       = GetComponent <Rigidbody>();
     inputHandler    = GetComponent <InputHandler>();
     playerManager   = GetComponent <PlayerManager>();
     playerStats     = GetComponent <PlayerStats>();
     animatorHandler = GetComponentInChildren <PlayerAnimatorManager>();
 }
示例#6
0
 private void Awake()
 {
     cameraHandler          = FindObjectOfType <CameraHandler>();
     animatorHandler        = GetComponent <PlayerAnimatorManager>();
     playerEquipmentManager = GetComponent <PlayerEquipmentManager>();
     playerManager          = GetComponentInParent <PlayerManager>();
     playerStats            = GetComponentInParent <PlayerStats>();
     playerInventory        = GetComponentInParent <PlayerInventory>();
     weaponSlotManager      = GetComponent <WeaponSlotManager>();
     inputHandler           = GetComponentInParent <InputHandler>();
 }
 public virtual void AttemptToConsumeItem(PlayerAnimatorManager playerAnimatorManager, WeaponSlotManager weaponSlotManager, PlayerFXManager playerFXManager)
 {
     if (currentAmount > 0)
     {
         playerAnimatorManager.PlayTargetAnimation(consumeAnimation, isInteracting, true);
     }
     else
     {
         playerAnimatorManager.PlayTargetAnimation("Potion Empty", true);
     }
 }
示例#8
0
        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);
        }
示例#9
0
 private void Awake()
 {
     playerAttacking       = GetComponentInChildren <PlayerAttacking>();
     playerInventory       = GetComponent <PlayerInventory>();
     playerManager         = GetComponent <PlayerManager>();
     playerStats           = GetComponent <PlayerStats>();
     uiManager             = FindObjectOfType <UIManager>();
     cameraHandler         = FindObjectOfType <CameraHandler>();
     weaponSlotManager     = GetComponentInChildren <WeaponSlotManager>();
     playerAnimatorManager = GetComponentInChildren <PlayerAnimatorManager>();
     playerFXManager       = GetComponentInChildren <PlayerFXManager>();
     blockingCollider      = GetComponentInChildren <BlockingCollider>();
 }
        private void Awake()
        {
            cameraHandler         = FindObjectOfType <CameraHandler>();
            backStabCollider      = GetComponentInChildren <DeathblowsCollider>();
            inputHandler          = GetComponent <InputHandler>();
            playerAnimatorManager = GetComponentInChildren <PlayerAnimatorManager>();
            anim             = GetComponentInChildren <Animator>();
            playerLocomotion = GetComponent <PlayerLocomotion>();
            playerStats      = GetComponent <PlayerStats>();
            interactableUI   = FindObjectOfType <InteractableUI>();

            //climbingLogic = GetComponent<ClimbingLogic>();
        }
示例#11
0
        public override void SuccessfullyCastSpell(
            PlayerAnimatorManager animationHandler,
            PlayerStats playerStats,
            CameraHandler cameraHandler,
            WeaponSlotManager weaponSlotManager)
        {
            //whenever we use the successfully cast spell it will also fire this function from the class it derives from on Spell_Item
            base.SuccessfullyCastSpell(animationHandler, playerStats, cameraHandler, weaponSlotManager);
            GameObject instantiatedSpellFX = Instantiate(spellCastFX, animationHandler.transform);

            playerStats.RestoreHP(healAmount);
            Destroy(instantiatedSpellFX, 2);
            Debug.Log("Spell Cast Successful");
        }
示例#12
0
        public override void AttemptToConsumeItem(PlayerAnimatorManager playerAnimatorManager, WeaponSlotManager weaponSlotManager, PlayerFXManager playerFXManager)
        {
            base.AttemptToConsumeItem(playerAnimatorManager, weaponSlotManager, playerFXManager);
            //spawn item model
            GameObject potionModel = Instantiate(itemModel, weaponSlotManager.leftHandSlot.transform);

            playerFXManager.currentFX           = recoveryFX;
            playerFXManager.amountToBeHealed    = hpRestoredAmount;
            playerFXManager.instantiatedFXModel = potionModel;
            // disable weapon model

            weaponSlotManager.rightHandSlot.UnloadWeapon();
            weaponSlotManager.leftHandSlot.UnloadWeapon();
        }
        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);
        }