예제 #1
0
 public override void Update()
 {
     if (!cdHandler.IsOnCooldown())
     {
         Kill(Team.None);
     }
     base.Update();
 }
예제 #2
0
        private void HandleEmitters()
        {
            if (emitters == null)
            {
                return;
            }

            if (thrusting && !primingTimer.IsOnCooldown())
            {
                foreach (Emitter e in emitters)
                {
                    e.Update();
                    e.Activate();
                    e.TeleportTo(RealPos);
                }
                thrusting = false;
            }
        }
예제 #3
0
        public virtual void Update()
        {
            if (!cdHandler.IsOnCooldown() && entityHandler.EntityList.Count < 5)
            {
                Spawn();
            }

            if (SwinGame.MouseClicked(MouseButton.LeftButton))
            {
                Spawn();
            }
        }
예제 #4
0
        /// <summary>
        /// Create, initialise, and track new particle
        /// </summary>
        public void Activate()
        {
            if (!cdHandler.IsOnCooldown())
            {
                JObject particleObj = Util.Deserialize(Particle.FilePath);

                Particle newParticle = new ParticleFactory().Create(particleObj, FilePath, entHandler, boundaryStrat, Team, offsetPos) as Particle;

                newParticle.Init(refPos, Dir);
                entHandler.Track(newParticle);
                cdHandler.StartCooldown();
            }
        }
예제 #5
0
        public override void Update()
        {
            Vel       = Vel.Multiply(friction);
            turnRate *= friction;
            theta     = turnRate;

            if (!cdHandler.IsOnCooldown())
            {
                Kill(Team.None);
            }

            base.Update();
        }
예제 #6
0
        /// <summary>
        /// activate the tool and fire it's ammo
        /// </summary>
        public void Activate()
        {
            if (!cdHandler.IsOnCooldown())
            {
                JObject ammoObj = Util.Deserialize(Ammo.FilePath);

                Ammo newAmmo = new AmmoFactory().Create(ammoObj, FilePath, entHandler, boundaryStrat, Team, SwinGame.PointAt(0, 0)) as Ammo;
                newAmmo.TeleportTo(RealPos);

                newAmmo.Init(RealPos, Dir, Vel);
                entHandler.Track(newAmmo);
                cdHandler.StartCooldown();
            }
        }
예제 #7
0
        protected void Shoot()
        {
            //guard
            if (shootCooldown == null)
            {
                return;
            }

            if (!shootCooldown.IsOnCooldown())
            {
                controlled.Fire();
                shootCooldown.StartCooldown();
            }
        }
예제 #8
0
        protected override void ExecuteStrategy()
        {
            base.ExecuteStrategy();

            //set new random vector and random timer threshhold
            if (!cdHandler.IsOnCooldown())
            {
                Vector newDir = Util.RandomUnitVector();
                cdHandler.StartNewThreshhold(Util.Rand(turnCooldown));
            }

            TryRotate();

            if (controlled.ShouldThrust(targetDir))
            {
                ThrustForward();
            }
        }
예제 #9
0
        public override void Update()
        {
            if (sleep)
            {
                return;
            }

            aiStrat.Update();
            base.Update();

            //kill ammo if expired
            if (cdHandler != null)
            {
                if (!cdHandler.IsOnCooldown())
                {
                    Kill(Team.None);
                }
            }
        }
예제 #10
0
        public override void Update()
        {
            if (cdHandler != null)
            {
                if (cdHandler.IsOnCooldown())
                {
                    Vel       = Vel.Multiply(friction);
                    turnRate *= friction;
                    theta     = turnRate;

                    colorIndex = SwinGame.Rnd(colors.Count);
                }
                else
                {
                    Kill(Team.None);
                }
            }

            base.Update();
        }