Ejemplo n.º 1
0
        public void OnStart()
        {
            if (_startCalled)
            {
                return;
            }
            _productionManager.ClearBuildOrder();

            // Colonies marked with Starting location are possible starting locations of the enemy NOT yourself
            _eStarts = _intelManager.Colonies.Where(c => c.IsStartingLocation);

            // Queue a hardcoded all-in
            QueueOneBaseRavager();

            // Using the AutoHarvestGather module DesiredVespeneWorkers decides how many workers will be assigned to gather vespene
            // Without AutoHarvestGather in the setup.json file (or and alternative) this has no effect
            _intelManager.PrimaryColony.DesiredVespeneWorkers = 4;

            // Creating a squad allows for treating a group of units as one.
            _theGang = _squadRep.Create("TheGang"); // The name allows other modules to look it up by name! (as IDs are generated at runtime)

            // The _intelManager.Handler allows for actions to be carried out when specific events happens.
            // Registering a handler to a Case means the handler will be called every time the event happens.
            _intelManager.Handler.RegisterHandler(Case.UnitAddedSelf, UnitMadeHandler);
            _intelManager.Handler.RegisterHandler(Case.StructureAddedSelf, s => {
                if (s.UnitType == BlizzardConstants.Unit.RoachWarren)
                {
                    _intelManager.PrimaryColony.DesiredVespeneWorkers = 6; // Increase vespene workers after the roach warren is added!
                }
            });

            // A variable needed since ZergDemo is a replaceable module relying on its on OnStart, but dont want it to be called twice
            _startCalled = true;
            _done        = false;
        }
Ejemplo n.º 2
0
        public void OnStart()
        {
            if (_startCalled)
            {
                return;
            }
            _productionManager.ClearBuildOrder();

            // Colonies marked with starting location are possible starting locations of the enemy, never yourself
            _eStarts = _intelManager.Colonies.Where(c => c.IsStartingLocation);
            _intelManager.Handler.RegisterHandler(Case.UnitAddedSelf, addCrook);

            QueueRaxRush();

            gang         = _squadRep.Create("TheGang");
            _done        = false;
            _startCalled = true;
        }
Ejemplo n.º 3
0
        public void Execute(ProductionRequest request)
        {
            switch (request.CallCase)
            {
            case ProductionRequest.CallOneofCase.None:
                break;

            case ProductionRequest.CallOneofCase.ClearBuildOrder:
                _manager.ClearBuildOrder();
                break;

            case ProductionRequest.CallOneofCase.QueueUnit:
                _manager.QueueUnit(request.QueueUnit.UnitId, request.QueueUnit.Pos, request.QueueUnit.Spacing, request.QueueUnit.Skippable);
                break;

            case ProductionRequest.CallOneofCase.QueueTech:
                _manager.QueueTech(request.QueueTech.UpgradeId, request.QueueTech.Skippable);
                break;
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Called on the first frame of the game.
        /// Queue our gameplan!
        /// </summary>
        public void OnStart()
        {
            if (_startCalled)
            {
                return;
            }
            _productionManager.ClearBuildOrder();

            // Colonies marked with starting location are possible starting locations of the enemy, never yourself
            _eStarts = _intelManager.Colonies.Where(c => c.IsStartingLocation);
            // Register callback function with Abathur -- this will call addCrook everytime we build a unit.
            _intelManager.Handler.RegisterHandler(Case.UnitAddedSelf, UnitCreationHandler);

            // Queue our build orders.
            QueueRaxRush();

            // Create a 'squad' (collection of units)
            gang = _squadRep.Create("TheGang");

            // Set primitive state trackers...
            _attackMode  = false;
            _startCalled = true;
        }