Esempio n. 1
0
        // Call the units smart ability.
        // I belive this is smart casting so units will check if other units are already doing the ability, but i am not sure.
        public void Smart(Unit unit)
        {
            var action = ControllerDefault.CreateRawUnitCommand(Abilities.SMART);

            action.ActionRaw.UnitCommand.TargetUnitTag = unit.tag;
            action.ActionRaw.UnitCommand.UnitTags.Add(tag);
            ControllerDefault.AddAction(action);
        }
Esempio n. 2
0
        // Move a unit to a location.
        public void Move(Vector3 target)
        {
            var action = ControllerDefault.CreateRawUnitCommand(Abilities.MOVE);

            action.ActionRaw.UnitCommand.TargetWorldSpacePos   = new Point2D();
            action.ActionRaw.UnitCommand.TargetWorldSpacePos.X = target.X;
            action.ActionRaw.UnitCommand.TargetWorldSpacePos.Y = target.Y;
            action.ActionRaw.UnitCommand.UnitTags.Add(tag);
            ControllerDefault.AddAction(action);
        }
Esempio n. 3
0
        // Train a unit.
        public void Train(uint unitType, bool queue = false)
        {
            if (!queue && orders.Count > 0)
            {
                return;
            }

            var abilityID = Abilities.GetID(unitType);
            var action    = ControllerDefault.CreateRawUnitCommand(abilityID);

            action.ActionRaw.UnitCommand.UnitTags.Add(tag);
            ControllerDefault.AddAction(action);

            var targetName = ControllerDefault.GetUnitName(unitType);

            Logger.Info("Started training: {0}", targetName);
        }