public override void OnBulletHitBullet(BulletHitBulletEvent evnt) { var bullets = blackboard.GetValue <List <Bullet> >(BB.bulletsKey); bullets.Remove(evnt.Bullet); blackboard.SetValue(BB.bulletsKey, bullets); }
public override void OnBulletHitBullet(BulletHitBulletEvent e) { BulletWave hitWave = null; foreach (var ew in enemyBullets) { if (Math.Abs(ew.GetTraveledDistance(Time) - Helper.GetDistance(e.HitBullet.X, e.HitBullet.Y, ew.StartX, ew.StartY)) < 0.001 && Math.Abs(Helper.GetBulletVelocity(e.HitBullet.Power) - ew.Velocity) < 0.001) { hitWave = ew; break; } } if (hitWave != null) { LogHit(hitWave, e.HitBullet.X, e.HitBullet.Y); enemyBullets.Remove(hitWave); } foreach (var bullet in myBullets) { if (Math.Abs(bullet.GetTraveledDistance(Time) - Helper.GetDistance(e.HitBullet.X, e.HitBullet.Y, bullet.StartX, bullet.StartY)) < 0.001 && Math.Abs(e.HitBullet.Power - bullet.Power) < 0.001 && Math.Abs(e.Bullet.HeadingRadians - bullet.Angle) < 0.001) { bullet.CheckHit(e.HitBullet.X, e.HitBullet.Y, Time); //maybe add more weight break; } } }
public double?RegisterBulletHitBullet(BulletHitBulletEvent evnt) { if (_queue.Count > 0) { return(_queue.Peek().GetGuessFactor(evnt)); } return(null); }
public override void OnBulletHitBullet(BulletHitBulletEvent evnt) { for (int i = 0; i < behaviors.Count; ++i) { var behavior = behaviors[i]; behavior.OnBulletHitBullet(evnt); } }
public double?GetGuessFactor(BulletHitBulletEvent bulletHitBulletEvent) { // todo double gf = new Angle(bulletHitBulletEvent.HitBullet.Heading - _initialEnemyDirect.Heading.Degrees).Degrees180 / (2.0 * _maxEscapeAngle); return(gf); }
public void OnBulletHitBullet(BulletHitBulletEvent evnt) { IEnemy enemy = SafeGetEnemy(evnt.Bullet.Name); if (enemy != null) { enemy.RegisterBulletHitBullet(evnt); } }
public void WhenOnBulletHitBulletIsCalled() { var b1 = RandomHelper.RandomBullet(); var b2 = RandomHelper.RandomBullet(); var e = new BulletHitBulletEvent(b1, b2); _brain.OnBulletHitBullet(e); }
public override void OnBulletHitBullet(BulletHitBulletEvent evnt) { base.OnBulletHitBullet(evnt); bulletHitBulletCount++; if (bulletHitBulletCount > 2) { this.blackBoard.Power = 1; bulletHitBulletCount = 0; } }
public void RegisterBulletHitBullet(BulletHitBulletEvent evnt) { if (Waves != null) { double?gf = Waves.RegisterBulletHitBullet(evnt); if (_enemyGuessFactorStats != null && gf != null) { _enemyGuessFactorStats.Update(gf.Value); } } }
public override void OnBulletHitBullet(BulletHitBulletEvent evnt) { SetTurnLeft(45); SetAhead(150); Execute(); }
public void OnBulletHitBullet(BulletHitBulletEvent evnt) { _context.OnBulletHitBullet(evnt); }
public override void OnBulletHitBullet(BulletHitBulletEvent evnt) { SetTurnLeft(15); Fire(1); }
public void OnBulletHitBullet(BulletHitBulletEvent evnt) { count(evnt); }
public override void OnBulletHitBullet(BulletHitBulletEvent e) { base.OnBulletHitBullet(e); }
public virtual void OnBulletHitBullet(BulletHitBulletEvent evnt) { }
public override void OnBulletHitBullet(BulletHitBulletEvent evnt) { _brain.OnBulletHitBullet(evnt); }
public void OnBulletHitBullet(BulletHitBulletEvent evnt) { Enemies.OnBulletHitBullet(evnt); }