Esempio n. 1
0
        void fire()
        {
            if (fireCooldown <= 0f)
            {
                float dam = damage.get();

                Buff b = null;

                if (fireAblazeUnlock)
                {
                    b = new AblazeBuff(this.gameObject, ablazeDuration, fireDOT.get(), fireDotTickInterval, fireAblazePctHealth, ablazeEffect);
                }

                bool toExplode = false;

                if (fireR3Unlock)
                {
                    foreach (Buff buff in targetMinion.buffs)
                    {
                        if (buff is AblazeBuff)
                        {
                            toExplode = true;
                        }
                    }
                }

                shootTargetProjectile(fireballPrefab, dam, toExplode ? fireExplosionRadius : 0, b);
                fireCooldown = 1f / fireRate.get();
            }
        }
Esempio n. 2
0
        public override void activate(Player player)
        {
            Vector3 pos = Input.mousePosition;

            pos.z = player.getCameraHeightOffset();
            pos   = Camera.main.ScreenToWorldPoint(pos);
            Vector3         dir        = (pos - player.transform.position).normalized;
            GameObject      proj       = (GameObject)Instantiate(bullet, player.transform.position, Quaternion.identity);
            SkillshotBullet projScript = proj.GetComponent <SkillshotBullet>();

            projScript.setSource(player.gameObject);
            projScript.seek(dir);
            projScript.setDamage(damage);
            projScript.setRange(range);
            projScript.setTargetTag(player.targetTag);
            projScript.setIgnoreArmor(level == 3);
            if (level == 3)
            {
                projScript.setFireball(true);
                proj.GetComponent <Renderer>().enabled = false;
                AblazeBuff ab = new AblazeBuff(player.gameObject, 2f, damage / 8f, .25f, 0, ablazeEffect);
                projScript.setBuffToApply(ab);
            }
            projScript.setPlayerShot(true);
            nextFire = Time.time + cooldown;
        }
Esempio n. 3
0
 void fireR4Check()
 {
     if (fireR4Unlock)
     {
         Collider[] cols = Physics.OverlapSphere(this.transform.position, fireR4rad);
         foreach (Collider col in cols)
         {
             if (col.tag.Equals(targetTag))
             {
                 Minion m = col.GetComponent <Minion>();
                 m.takeDamage(fireR4dps * 0.5f, this.gameObject, true);
                 if (fireAblazeUnlock)
                 {
                     AblazeBuff buff = new AblazeBuff(this.gameObject, ablazeDuration, fireDOT.get(), fireDotTickInterval, fireAblazePctHealth, ablazeEffect);
                     buff.apply(col.transform);
                 }
             }
         }
     }
 }
Esempio n. 4
0
        public void apply(Component target)
        {
            startTime = lastDotTick = Time.time;
            minion    = target.GetComponent <Minion>();

            List <Buff> buffsToRemove = new List <Buff>();

            foreach (Buff b in minion.buffs)
            {
                if (b is AblazeBuff)
                {
                    AblazeBuff ab = (AblazeBuff)b;
                    if (getActualDamage() / interval < ab.getActualDamage() / ab.interval)
                    {
                        return;
                    }
                    else
                    {
                        buffsToRemove.Add(ab);
                    }
                }
            }

            buffsToRemove.ForEach(buff => buff.finish());

            minion.addBuff(this);

            Transform[] ts = ablazeEffectsContainer.GetComponentsInChildren <Transform>();

            if (ts.Length < maxParticles)
            {
                ablazeEffectInstance = (GameObject)MonoBehaviour.Instantiate(ablazeEffect);
                ablazeEffectInstance.transform.SetParent(ablazeEffectsContainer.transform);
                MonoBehaviour.Destroy(ablazeEffectInstance, duration);
            }
        }