Beispiel #1
0
    public override void GiveImpactToEnemy(Enemy enemy)
    {
        switch (rank)
        {
        case ItemManager.Rank.Common: enemy.AddBuff(new Poison(4)); break;

        case ItemManager.Rank.Rare: enemy.AddBuff(new Poison(5)); break;

        case ItemManager.Rank.Legendary: enemy.AddBuff(new Poison(6)); break;

        default: break;
        }
    }
Beispiel #2
0
    public override void Use(int goalX, int goalY)
    {
        Act(goalX, goalY);
        Enemy enemy = GameManager.instance.map[goalX, goalY].GetComponent <Enemy>();

        enemy.AddBuff(new Buff_Ice(2, enemy));
    }
    public void Instantiate()
    {
        particleSystemGo = GetComponentInChildren <ParticleSystem>().gameObject;
        destroyTimer     = Time.time;
        gameObject.transform.localScale       *= sizeMultiplier;
        particleSystemGo.transform.localScale *= sizeMultiplier;


        Collider[] enemyHits = Physics.OverlapSphere(transform.position, sizeMultiplier, layersOfEffect);
        foreach (var hit in enemyHits)
        {
            Enemy enemy = hit.GetComponentInChildren <Enemy>();
            if (!enemy)
            {
                enemy = hit.GetComponentInParent <Enemy>();
            }
            enemy.AddBuff(iceBuff, stunBuff, buffTime);
            enemy.GetHit(damage);
        }
    }
Beispiel #4
0
 public override void GiveImpactToEnemy(Enemy enemy)
 {
     count--;
     enemy.AddBuff(new Stunned(5));
 }
    protected override void Attack()
    {
        base.Attack();


        List <Collider> hits = new List <Collider>();

        //Check all affected enemies with sphere checks
        // RaycastHit hit;


        RaycastHit[] playerHits = Physics.SphereCastAll(characterTrans.position, effectArea, characterTrans.forward, hopRadius, layersOfEffect);
        foreach (RaycastHit hit in playerHits)
        {
            if (!hits.Contains(hit.collider))
            {
                //Draw lightning line between player & spherehit
                var points = new Vector3[2];
                points[0] = characterTrans.position;
                points[1] = hit.collider.transform.position;

                var line = Instantiate(linerenderer, characterTrans.position, characterTrans.rotation);
                line.SetPositions(points);
                Destroy(line.gameObject, 0.1f);
                //Deal damage to spherehit
                Enemy enemy = hit.collider.GetComponentInChildren <Enemy>();
                if (!enemy)
                {
                    enemy = hit.collider.GetComponentInParent <Enemy>();
                }
                if (enemy)
                {
                    enemy.AddBuff(iceBuff, stunBuff, buffTime);
                    enemy.GetHit(damage);
                }

                hits.Add(hit.collider);
            }
        }

        float tempradius = hopRadius;

        for (int i = 0; i < hops; i++)
        {
            tempradius *= radiusMultiplier;
            // foreach (Collider spherehit in hits)
            int forCount = hits.Count;
            for (int j = 0; i < forCount; i++)
            {
                Collider[] enemyHits = Physics.OverlapSphere(hits[j].transform.position, tempradius, layersOfEffect);
                foreach (Collider spherehit2 in enemyHits)
                {
                    if (!hits.Contains(spherehit2))
                    {
                        Vector3[] points = new Vector3[2];
                        points[0] = hits[j].transform.position;
                        points[1] = spherehit2.transform.position;
                        LineRenderer line = Instantiate(linerenderer, characterTrans.position, characterTrans.rotation);
                        line.SetPositions(points);
                        Destroy(line.gameObject, 0.1f);

                        Enemy enemy = spherehit2.GetComponentInChildren <Enemy>();
                        if (!enemy)
                        {
                            enemy = spherehit2.GetComponentInParent <Enemy>();
                        }
                        enemy.AddBuff(iceBuff, stunBuff, buffTime);
                        enemy.GetHit(damage);
                        hits.Add(spherehit2);
                    }
                }
                forCount = hits.Count;
            }
        }


        if (hits.Count == 0)
        {
            Vector3[] points = new Vector3[2];
            points[0] = characterTrans.position;
            points[1] = characterTrans.forward * hopRadius + characterTrans.position;
            LineRenderer line = Instantiate(linerenderer, characterTrans.position, characterTrans.rotation);
            line.SetPositions(points);
            Destroy(line.gameObject, 0.1f);
        }
    }
Beispiel #6
0
 public override bool ThrownTo(Enemy enemy)
 {
     enemy.AddBuff(new HitByHallucinogen(3));
     return(true);
 }
Beispiel #7
0
 public override bool ThrownTo(Enemy enemy)
 {
     enemy.AddBuff(new Poison(30));
     return(true);
 }
Beispiel #8
0
 public override bool ThrownTo(Enemy enemy)
 {
     enemy.AddBuff(new Burn(15));
     return(true);
 }