Ejemplo n.º 1
0
 internal override bool IsValidCommand(Game game)
 {
     if (CommandHelpers.IsCommandValid(game.GlobalManager, RequestingFactionGuid, EntityCommandingGuid, out _factionEntity, out _entityCommanding))
     {
         if (game.GlobalManager.FindEntityByGuid(TargetEntityGuid, out _targetEntity))
         {
             return(true);
         }
     }
     return(false);
 }
Ejemplo n.º 2
0
 internal override bool IsValidCommand(Game game)
 {
     if (CommandHelpers.IsCommandValid(game.GlobalManager, RequestingFactionGuid, EntityCommandingGuid, out factionEntity, out _entityCommanding))
     {
         if (game.GlobalManager.FindEntityByGuid(SendCargoToEntityGuid, out sendToEntity))
         {
             GetItemsToTransfer(game.StaticData);//should I try catch this? nah it's unlikely to be bad here.
             return(true);
         }
     }
     return(false);
 }
Ejemplo n.º 3
0
 internal override bool IsValidCommand(Game game)
 {
     _staticData = game.StaticData;
     if (CommandHelpers.IsCommandValid(game.GlobalManager, RequestingFactionGuid, EntityCommandingGuid, out _factionEntity, out _entityCommanding))
     {
         if (_staticData.ProcessedMaterials.ContainsKey(MaterialGuid))
         {
             int pointCost = _staticData.ProcessedMaterials[MaterialGuid].RefineryPointCost;
             _job = new RefineingJob(MaterialGuid, NumberOrderd, pointCost, RepeatJob);
             return(true);
         }
     }
     return(false);
 }
Ejemplo n.º 4
0
        internal override bool IsValidCommand(Game game)
        {
            if (CommandHelpers.IsCommandValid(game.GlobalManager, RequestingFactionGuid, EntityCommandingGuid, out _factionEntity, out _entityCommanding))
            {
                var instancesdb = _entityCommanding.GetDataBlob <ComponentInstancesDB>();
                if (instancesdb.AllComponents.TryGetValue(FireControlGuid, out var fc))
                {
                    if (fc.HasAblity <FireControlAbilityState>())
                    {
                        _fireControlComponent = fc;

                        return(true);
                    }
                }
            }
            return(false);
        }
Ejemplo n.º 5
0
        internal override bool IsValidCommand(Game game)
        {
            if (CommandHelpers.IsCommandValid(game.GlobalManager, RequestingFactionGuid, EntityCommandingGuid, out _factionEntity, out _entityCommanding))
            {
                var instancesdb = _entityCommanding.GetDataBlob <ComponentInstancesDB>();

                if (instancesdb.AllComponents.TryGetValue(WeaponGuid, out ComponentInstance wpn))
                {
                    _ordnanceAssigned = _factionEntity.GetDataBlob <FactionInfoDB>().MissileDesigns[OrdnanceAssigned];
                    if (wpn.TryGetAbilityState(out WeaponState wpnState))
                    {
                        _weaponInstance = wpn;
                        return(wpnState.FireWeaponInstructions.CanLoadOrdnance(_ordnanceAssigned));
                    }
                }
            }
            return(false);
        }
Ejemplo n.º 6
0
 internal override bool IsValidCommand(Game game)
 {
     if (CommandHelpers.IsCommandValid(game.GlobalManager, RequestingFactionGuid, EntityCommandingGuid, out _factionEntity, out _entityCommanding))
     {
         if (game.GlobalManager.FindEntityByGuid(FireControlGuid, out _fireControlComponent))
         {
             Entity weaponEntity;
             foreach (var item in WeaponsAssigned)
             {
                 if (game.GlobalManager.FindEntityByGuid(item, out weaponEntity))
                 {
                     _weaponsAssigned.Add(weaponEntity);
                 }
             }
             return(true);
         }
     }
     return(false);
 }