protected override void InitFactories()
        {
            ProjectileFactory p1, p2, p3;

            switch (Instability)
            {
            default:
            case 0:
            case 1:
            case 2:
            case 3:
                p1         = ProjectileFactory.CreateFactory(ProjectileType.Fireball, Instability);
                p1.heading = Vector3.forward;
                AddFactory(p1);
                break;

            case 4:
                p1         = ProjectileFactory.CreateFactory(ProjectileType.Fireball, Instability);
                p1.heading = Vector3.forward;
                AddFactory(p1);
                p2         = ProjectileFactory.CreateFactory(ProjectileType.Fireball, 3);
                p2.heading = Quaternion.Euler(0f, -20f, 0f) * Vector3.forward;
                AddFactory(p2);
                p3         = ProjectileFactory.CreateFactory(ProjectileType.Fireball, 3);
                p3.heading = Quaternion.Euler(0f, 20f, 0f) * Vector3.forward;
                AddFactory(p3);
                break;
            }
        }
Beispiel #2
0
        protected override void InitFactories()
        {
            ProjectileFactory projectile = ProjectileFactory.CreateFactory(ProjectileType.Beam, Instability);

            projectile.heading = Vector3.forward;
            AddFactory(projectile);
        }
Beispiel #3
0
        protected override void InitFactories()
        {
            instantiateDistanceMult = 3f;
            ProjectileFactory projectile = ProjectileFactory.CreateFactory(ProjectileType.Tornado, Instability);

            projectile.heading = Vector3.forward;
            AddFactory(projectile);
        }
Beispiel #4
0
 public void AddFactory(ProjectileFactory proj)
 {
     if (projectileFactories == null)
     {
         projectileFactories = new List <ProjectileFactory>();
     }
     projectileFactories.Add(proj);
 }
Beispiel #5
0
 public ProjectileFactory CreateFactory(ProjectileType type, int instability)
 {
     foreach (ProjectileFactory fact in factories)
     {
         if (fact.type == type)
         {
             ProjectileFactory copy = fact.Copy();
             copy.instability = instability;
             return(copy);
         }
     }
     return(null);
 }
        private void Split()           // TODO fix weird split
        {
            ProjectileFactory fact  = ProjectileFactory.CreateFactory(ProjectileType.IceSpike, instability);
            float             side  = (Random.value >= .5f) ? 1f : -1f;
            float             angle = Random.Range(side * minSplitAngle, side * maxSplitAngle);

            fact.heading = Quaternion.Euler(0f, angle, 0f) * heading;
            heading      = Quaternion.Euler(0f, -angle, 0f) * heading;
            IceSpikeProjectile proj = fact.CreateInstance() as IceSpikeProjectile;

            proj.transform.position = transform.position;
            proj.distanceTravelled  = 0f;
            proj.splitDepth         = splitDepth + 1;
            proj.minSplitDistance   = minSplitDistance;
            proj.maxSplitDistance   = maxSplitDistance;
            proj.minSplitAngle      = minSplitAngle;
            proj.maxSplitAngle      = maxSplitAngle;
            proj.maxSplits          = maxSplits;
            proj.eraticAngle        = eraticAngle;
        }
        protected override void InitFactories()
        {
            ProjectileFactory p1, p2;

            if (Instability >= 1)
            {
                p1         = ProjectileFactory.CreateFactory(ProjectileType.ElectricArc, Instability);
                p1.heading = Quaternion.Euler(0f, -doubleAngle, 0f) * Vector3.forward;
                AddFactory(p1);
                p2         = ProjectileFactory.CreateFactory(ProjectileType.ElectricArc, Instability);
                p2.heading = Quaternion.Euler(0f, doubleAngle, 0f) * Vector3.forward;
                AddFactory(p2);
            }
            else
            {
                p1         = ProjectileFactory.CreateFactory(ProjectileType.ElectricArc, Instability);
                p1.heading = Vector3.forward;
                AddFactory(p1);
            }
        }
 public void Start()
 {
     enemy             = GetComponent <Enemy>();
     projectileFactory = ProjectileFactory.CreateFactory(ProjectileType.Arrow, 0);
 }