Exemplo n.º 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;
        }
Exemplo n.º 3
0
 public virtual void SuccessfullyCastSpell(
     PlayerAnimatorManager animationHandler,
     PlayerStats playerStats,
     CameraHandler cameraHandler,
     WeaponSlotManager weaponSlotManager)
 {
     Debug.Log("Casting Spell successful");
     playerStats.DeductFocusPoints(focusPointCost);
 }
Exemplo n.º 4
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>();
 }
Exemplo n.º 5
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);
        }
Exemplo n.º 6
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>();
 }
Exemplo n.º 7
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");
        }
        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);
        }
 private void Awake()
 {
     playerInventory   = FindObjectOfType <PlayerInventory>();
     weaponSlotManager = FindObjectOfType <WeaponSlotManager>();
     uiManager         = FindObjectOfType <UIManager>();
 }
Exemplo n.º 10
0
 private void Awake()
 {
     enemyStats        = GetComponentInParent <EnemyStats>();
     enemyManager      = GetComponentInParent <EnemyManager>();
     weaponSlotManager = GetComponent <WeaponSlotManager>();
 }
 private void Awake()
 {
     quickSlotsUI      = FindObjectOfType <QuickSlotsUI>();
     weaponSlotManager = GetComponentInChildren <WeaponSlotManager>();
 }
 public virtual void AttemptToConsumeItem(PlayerAnimatorManager playerAnimatorManager, WeaponSlotManager weaponSlotManager, PlayerFXManager playerFXManager)
 {
     if (currentAmount > 0)
     {
         playerAnimatorManager.PlayTargetAnimation(consumeAnimation, isInteracting, true);
     }
     else
     {
         playerAnimatorManager.PlayTargetAnimation("Potion Empty", true);
     }
 }
 private void Awake()
 {
     playerStats       = GetComponentInParent <PlayerStats>();
     weaponSlotManager = GetComponent <WeaponSlotManager>();
 }
Exemplo n.º 14
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();
        }