Exemplo n.º 1
0
 public override void ApplyEffects(Pathogen p)
 {
     p.Slow(slowPercentage, slowTime);
     sender.IncrementKillCount();
     audioSource.Play();
     Destroy(gameObject);
 }
 public void RemoveAttackerFromList(Pathogen p)
 {
     attackers.Remove(p);
     if (attackers.Count == 0 && waveHandler.remaining == 0)
     {
         EndWave();
     }
 }
Exemplo n.º 3
0
 public virtual void ApplyEffects(Pathogen p)
 {
     if (p.DealDamage(damage))
     {
         sender.IncrementKillCount();
     }
     sender.IncrementDamageCount(damage);
     audioSource.Play();
     Destroy(gameObject);
 }
Exemplo n.º 4
0
 private void SpawnPathogen(Pathogen p)
 {
     if (p == Pathogen.linear)
     {
         Instantiate(linear_pathogen, Camera.main.ViewportToWorldPoint(new Vector3((float)random.NextDouble(), 1.05f, 2)), Quaternion.identity);
     }
     else if (p == Pathogen.bouncing)
     {
         Instantiate(bouncing_pathogen, Camera.main.ViewportToWorldPoint(new Vector3((float)random.NextDouble(), 1.05f, 2)), Quaternion.identity);
     }
 }
Exemplo n.º 5
0
    protected override void Shoot()
    {
        Target();
        if (target != null)
        {
            GameObject proj = GameObject.Instantiate(projectile, transform.position, transform.rotation);
            Projectile p    = proj.GetComponent <Projectile>();
            SetStats(p);

            timer  = 0;
            target = null;
        }
    }
 public void AddAttackersToList(Pathogen p)
 {
     if (p == null)
     {
         return;
     }
     if (attackers.Count == 0)
     {
         attackers.AddFirst(p);
     }
     else
     {
         attackers.AddLast(p);
     }
 }
    public void Spawn(char c)
    {
        GameObject g = null;

        switch (c)
        {
        case 'e':
            g = GameObject.Instantiate(escherichiaColi, path.startPoint.position, transform.rotation);
            if (g == null)
            {
                print("Prankd");
            }
            break;

        case 't':
            g = GameObject.Instantiate(tuberculosis, path.startPoint.position, transform.rotation);
            break;

        case 'i':
            g = GameObject.Instantiate(influenza, path.startPoint.position, transform.rotation);
            break;

        case 'c':
            g = GameObject.Instantiate(coronavirus, path.startPoint.position, transform.rotation);
            break;

        case 'm':
            g = GameObject.Instantiate(malaria, path.startPoint.position, transform.rotation);
            break;

        case 'n':
            g = GameObject.Instantiate(tetanus, path.startPoint.position, transform.rotation);
            break;

        case 'p':
            g = GameObject.Instantiate(plague, path.startPoint.position, transform.rotation);
            break;

        case 'b':
            g = GameObject.Instantiate(ebola, path.startPoint.position, transform.rotation);
            break;

        default: return;
        }
        Pathogen p = g.GetComponent <Pathogen>();

        attackers.AddLast(p);
    }
Exemplo n.º 8
0
 private void SpawnPathogen(Pathogen p)
 {
     if (p == Pathogen.linear)
     {
         Instantiate(linear_pathogen, Camera.main.ViewportToWorldPoint(new Vector3((float)random.NextDouble(), 1.05f, 2)), Quaternion.identity);
     }
     else if (p == Pathogen.bouncing)
     {
         Instantiate(bouncing_pathogen, Camera.main.ViewportToWorldPoint(new Vector3((float)random.NextDouble(), 1.05f, 2)), Quaternion.identity);
     }
     else if (p == Pathogen.ray)
     {
         float spawn_x        = (float)random.NextDouble();
         int   warning_buffer = 4;
         StartCoroutine(SpawnRay(spawn_x, warning_buffer));
         //Instantiate(ray_warning, Camera.main.ViewportToWorldPoint(new Vector3(spawn_x, 1.05f, 2)), Quaternion.identity);
         //yield return new WaitForSeconds(warning_buffer);
         //Instantiate(uv_ray, Camera.main.ViewportToWorldPoint(new Vector3(spawn_x, 1.05f, 2)), Quaternion.identity);
     }
 }
    public void AntibioticUpgrade()
    {
        playerHandler.AddMoney(-antibioticUpgradeCost);

        LinkedListNode <Pathogen> p = attackerHandler.attackers.First;

        while (p != null)
        {
            Pathogen pn = p.Value;
            if (pn.type == 'b')
            {
                p = p.Next;
                pn.Die();
            }
            else
            {
                p = p.Next;
            }
        }
    }
Exemplo n.º 10
0
    protected void Target()
    {
        LinkedList <Pathogen>     att  = handler.attackers;
        LinkedListNode <Pathogen> curr = null;

        if (att.Count == 0)
        {
            return;
        }

        do
        {
            if (curr == null)
            {
                curr = att.First;
            }
            else
            {
                curr = curr.Next;
            }

            if (curr.Value == null)
            {
                continue;
            }

            if (Vector3.Distance(curr.Value.transform.position, transform.position) <= radius)
            {
                if (ValidTarget(curr.Value))
                {
                    target = curr.Value;
                    return;
                }
            }
        } while (curr != att.Last);
    }
Exemplo n.º 11
0
 protected override bool ValidTarget(Pathogen p)
 {
     return(true);
 }
Exemplo n.º 12
0
 protected override bool ValidTarget(Pathogen p)
 {
     return(!p.slowed);
 }
Exemplo n.º 13
0
    // Protected Methods

    protected virtual bool ValidTarget(Pathogen p)
    {
        return(true);
    }
    // Public Methods

    public void KillAttacker(Pathogen p)
    {
        p.Die();
    }