Beispiel #1
0
        private CoefficientTracker GetShootTracker()
        {
            Func<ContinuousPlayerShootScript> createShotScript = () => new ContinuousPlayerShootScript(new IAlive[] { Boss }) { ShootingTime = 2500 };

            const float shootAtBossTime = 2500;
            var tracker = new CoefficientTracker(5, 0.01f, _strategy);
            tracker.CoefficientProperlyChanged += (o, e) =>
                                                      {
                                                          if (!_gameState.Player.IsShooting)
                                                          {
                                                              _continuousBossKillingScript = createShotScript();
                                                              _gameState.AddScript(_continuousBossKillingScript);
                                                          }
                                                          else
                                                          {
                                                              _continuousBossKillingScript.ContinueFor(shootAtBossTime);
                                                          }
                                                      };
            return tracker;
        }
Beispiel #2
0
 private CoefficientTracker GetUseShieldsTracker()
 {
     var tracker = new CoefficientTracker(10, 0.01f, _strategy);
     tracker.CoefficientProperlyChanged += (o, e) => _gameState.Inventory.UseItemFromSlot(1, _gameState);
     return tracker;
 }