public override void Update() { if (!cdHandler.IsOnCooldown()) { Kill(Team.None); } base.Update(); }
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; } }
public virtual void Update() { if (!cdHandler.IsOnCooldown() && entityHandler.EntityList.Count < 5) { Spawn(); } if (SwinGame.MouseClicked(MouseButton.LeftButton)) { Spawn(); } }
/// <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(); } }
public override void Update() { Vel = Vel.Multiply(friction); turnRate *= friction; theta = turnRate; if (!cdHandler.IsOnCooldown()) { Kill(Team.None); } base.Update(); }
/// <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(); } }
protected void Shoot() { //guard if (shootCooldown == null) { return; } if (!shootCooldown.IsOnCooldown()) { controlled.Fire(); shootCooldown.StartCooldown(); } }
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(); } }
public override void Update() { if (sleep) { return; } aiStrat.Update(); base.Update(); //kill ammo if expired if (cdHandler != null) { if (!cdHandler.IsOnCooldown()) { Kill(Team.None); } } }
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(); }