private IEnumerator CryoblastMain()
        {
            active = false;

            GameObject projectile =
                Instantiate(Resources.Load("Projectiles/Potion/Potion"), origin, Quaternion.identity) as GameObject;

            Debug.Log("FREEZE!!");
            yield return(null);

            if (targetBC != attackerBC)
            {
                Debug.Log(targetBC == attackerBC);
                while ((projectile.transform.position - destination).magnitude >= 0.005f)
                {
                    projectile.transform.position =
                        Vector3.MoveTowards(projectile.transform.position, destination, 10 * Time.deltaTime);
                    yield return(null);
                }
            }

            targetBC.DeltaHP(-20);
            Destroy(projectile);

            FrozenEffect frozenEffect = new FrozenEffect(targetBC);

            targetBC.TryAddEffect(frozenEffect, targetBC.characterDataComponent.effects);

            // StartCoroutine(stimulatorEffect.ApplyEffect(targetBC.characterDataComponent.effects));

            Debug.Log(description);

            EndEvent(out battleManager.busy);
        }
Esempio n. 2
0
        private IEnumerator SniperShotMain()
        {
            active = false;

            GameObject projectile =
                Instantiate(Resources.Load("Projectiles/Potion/Potion"), origin, Quaternion.identity) as GameObject;

            Debug.Log("Snipe!!");
            yield return(null);

            if (targetBC != attackerBC)
            {
                Debug.Log(targetBC == attackerBC);
                while ((projectile.transform.position - destination).magnitude >= 0.005f)
                {
                    projectile.transform.position =
                        Vector3.MoveTowards(projectile.transform.position, destination, 30 * Time.deltaTime);
                    yield return(null);
                }
            }


            targetBC.DeltaHP(-(attackerBC.characterDataComponent.baseDamage + Convert.ToInt32((destination - origin).magnitude) * 3));
            Destroy(projectile);

            Debug.Log(Convert.ToInt32((destination - origin).magnitude));

            EndEvent(out battleManager.busy);
        }
Esempio n. 3
0
        IEnumerator Placeholder()
        {
            GameObject projectile =
                Instantiate(Resources.Load("Projectiles/Potion/Potion"), origin, Quaternion.identity) as GameObject;

            Debug.Log("DAMAGE!");
            yield return(null);

            while ((projectile.transform.position - destination).magnitude >= 0.005f)
            {
                projectile.transform.position =
                    Vector3.MoveTowards(projectile.transform.position, destination, 10 * Time.deltaTime);
                yield return(null);
            }

            targetBC.DeltaHP(-(Convert.ToInt32(attackerBC.characterDataComponent.baseDamage * attackerBC.characterDataComponent.damageMultModifier) + attackerBC.characterDataComponent.damageAddModifier));
            Destroy(projectile);

            EndEvent(out battleManager.busy);
        }