Ejemplo n.º 1
0
        private void OnTriggerEnter(Collider other)
        {
            EnemyStates enemyStates = other.GetComponent <EnemyStates>();

            if (enemyStates != null)
            {
                enemyStates.health -= 40;
                enemyStates.DoDamage_();
                SpellEffectManager.Instance.UseSpellEffect("OnFire", null, enemyStates);
            }

            GameObject go = Instantiate(explosionPrefab, transform.position, transform.rotation) as GameObject;

            Destroy(this.gameObject);
        }
Ejemplo n.º 2
0
        public void Init(EnemyStates enemyStates)
        {
            eStates  = enemyStates;
            animator = eStates.animator;
            if (animator.isHuman == false)
            {
                return;
            }
            //If it is human, add al the bones as lock on target transforms
            else
            {
                for (int i = 0; i < humanoidBones.Count; i++)
                {
                    targets.Add(animator.GetBoneTransform(humanoidBones[i]));
                }
            }

            EnemyManager.Instance.enemyTargets.Add(this);
        }
        private void OnTriggerEnter(Collider other)
        {
            if (states)
            {
                EnemyStates enemyStates = other.transform.GetComponentInParent <EnemyStates>();
                if (enemyStates != null)
                {
                    enemyStates.DoDamage(states.currentAction,
                                         states.inventoryManager.GetCurrentWeapon(states.currentAction.mirror));;
                }

                return;
            }

            if (eStates)
            {
                StateManager player = other.transform.root.GetComponent <StateManager>();
                if (player != null)
                {
                    player.DoDamage(eStates.GetCurrentAttack());
                }
            }
        }
Ejemplo n.º 4
0
        public void UseSpellEffect(string spellEffectID, StateManager stateManager, EnemyStates enemy = null)
        {
            int index = GetEffect(spellEffectID);

            if (index == -1)
            {
                Debug.Log("Spell effect doesn't exist!!");
                return;
            }

            switch (index)
            {
            case 0:
                FireBreath(stateManager);
                break;

            case 1:
                DarkShield(stateManager);
                break;

            case 2:
                HealingSmall(stateManager);
                break;

            case 3:
                Fireball(stateManager);
                break;

            case 4:
                OnFire(stateManager, enemy);
                break;

            default:
                break;
            }
        }
 public void InitEnemy(EnemyStates enemy)
 {
     eStates          = enemy;
     gameObject.layer = LayerMask.NameToLayer("DamageColliders");
     gameObject.SetActive(false);
 }
Ejemplo n.º 6
0
 public void InitEnemy(EnemyStates eStates)
 {
     enemyState = eStates;
 }