Ejemplo n.º 1
0
        public static bool RequiresDesign(
            WeaponEnums.TurretClasses turretClass,
            out RealShipClasses correspondingShipClass)
        {
            switch (turretClass)
            {
            case WeaponEnums.TurretClasses.Biomissile:
                correspondingShipClass = RealShipClasses.Biomissile;
                return(true);

            case WeaponEnums.TurretClasses.Drone:
                correspondingShipClass = RealShipClasses.Drone;
                return(true);

            case WeaponEnums.TurretClasses.AssaultShuttle:
                correspondingShipClass = RealShipClasses.AssaultShuttle;
                return(true);

            case WeaponEnums.TurretClasses.BoardingPod:
                correspondingShipClass = RealShipClasses.BoardingPod;
                return(true);

            default:
                correspondingShipClass = RealShipClasses.AssaultShuttle;
                return(false);
            }
        }
Ejemplo n.º 2
0
        protected void SyncDesignListList(RealShipClasses shipclass)
        {
            this._app.UI.ClearItems(this._app.UI.Path(this.ID, "gameFleetList"));
            bool flag = false;

            foreach (DesignInfo availableDesign in this.GetAvailableDesigns(shipclass))
            {
                this._app.UI.AddItem(this._app.UI.Path(this.ID, "gameFleetList"), "", availableDesign.ID, availableDesign.Name);
                string itemGlobalId = this._app.UI.GetItemGlobalID(this._app.UI.Path(this.ID, "gameFleetList"), "", availableDesign.ID, "");
                if (!flag)
                {
                    this._app.UI.SetSelection(this._app.UI.Path(this.ID, "gameFleetList"), availableDesign.ID);
                    flag = true;
                }
                this._app.UI.SetPropertyColor(this._app.UI.Path(itemGlobalId, "designName"), "color", new Vector3((float)byte.MaxValue, (float)byte.MaxValue, (float)byte.MaxValue));
                string str = "";
                if (availableDesign.Class == ShipClass.BattleRider)
                {
                    str = "   " + App.Localize(availableDesign.GetMissionSectionAsset().Title);
                    if (!this.CanMountBattleRider(availableDesign))
                    {
                        this._app.UI.SetPropertyColor(this._app.UI.Path(itemGlobalId, "designName"), "color", new Vector3((float)byte.MaxValue, 0.0f, 0.0f));
                    }
                }
                this._app.UI.SetText(this._app.UI.Path(itemGlobalId, "designName"), availableDesign.Name + "  [" + ((float)availableDesign.GetPlayerProductionCost(this._app.GameDatabase, availableDesign.PlayerID, !availableDesign.isPrototyped, new float?()) / 1000f).ToString("0.0K") + "]" + str);
                this._app.UI.SetVisible(this._app.UI.Path(itemGlobalId, "designDeleteButton"), false);
            }
        }
Ejemplo n.º 3
0
        private IEnumerable <DesignInfo> GetAvailableDesigns(
            RealShipClasses shipClass)
        {
            IEnumerable <DesignInfo> designInfosForPlayer = this._app.GameDatabase.GetVisibleDesignInfosForPlayer(this._app.LocalPlayer.ID, shipClass);
            List <DesignInfo>        list = designInfosForPlayer.ToList <DesignInfo>();

            foreach (DesignInfo designInfo in designInfosForPlayer)
            {
                if (!this.IsDesignAllowed(designInfo) || !Kerberos.Sots.StarFleet.StarFleet.IsNewestRetrofit(designInfo, designInfosForPlayer))
                {
                    list.Remove(designInfo);
                }
            }
            return((IEnumerable <DesignInfo>)list);
        }
Ejemplo n.º 4
0
        public static bool IsWeaponBattleRiderClass(RealShipClasses shipClass)
        {
            switch (shipClass)
            {
            case RealShipClasses.Drone:
            case RealShipClasses.BoardingPod:
            case RealShipClasses.EscapePod:
            case RealShipClasses.AssaultShuttle:
            case RealShipClasses.Biomissile:
                return(true);

            default:
                return(false);
            }
        }
Ejemplo n.º 5
0
        private void PopulateClassList(RealShipClasses shipClass)
        {
            List <RealShipClasses> list = this.GetAllowedShipClasses().ToList <RealShipClasses>();

            this._app.UI.ClearItems("gameClassList");
            foreach (RealShipClasses shipClass1 in list)
            {
                if (this.GetAvailableDesigns(shipClass1).Count <DesignInfo>() > 0)
                {
                    this._app.UI.AddItem("gameClassList", string.Empty, (int)shipClass1, shipClass1.Localize());
                }
            }
            this.SelectedClass = shipClass;
            this._app.UI.SetSelection("gameClassList", (int)shipClass);
            this.SyncDesignListList(shipClass);
        }
Ejemplo n.º 6
0
        public void SetShipClass(RealShipClasses value)
        {
            if (this._currentShipClass == value)
            {
                return;
            }
            switch (value)
            {
            case RealShipClasses.Cruiser:
            case RealShipClasses.BattleCruiser:
                this._goalDist  = 750f;
                this._modelFile = "props\\models\\CR_Target.scene";
                break;

            case RealShipClasses.Dreadnought:
            case RealShipClasses.BattleShip:
                this._goalDist  = 1500f;
                this._modelFile = "props\\models\\DN_Target.scene";
                break;

            case RealShipClasses.Leviathan:
                this._goalDist  = 2000f;
                this._modelFile = "props\\models\\LV_Target.scene";
                break;

            case RealShipClasses.BattleRider:
            case RealShipClasses.Drone:
            case RealShipClasses.BoardingPod:
            case RealShipClasses.EscapePod:
            case RealShipClasses.AssaultShuttle:
            case RealShipClasses.Biomissile:
                this._goalDist  = 300f;
                this._modelFile = "props\\models\\BR_Target.scene";
                break;

            case RealShipClasses.Station:
                this._goalDist  = 2500f;
                this._modelFile = "props\\models\\LV_Target.scene";
                break;
            }
            this._currentShipClass = value;
            this.ResetTargets();
            this.PositionsChanged();
        }
Ejemplo n.º 7
0
        public static ShipSpeedModifiers GetShipSpeedModifiers(
            AssetDatabase ab,
            Player player,
            RealShipClasses shipClass,
            IEnumerable <PlayerTechInfo> playerTechs,
            bool isDeepSpace)
        {
            ShipSpeedModifiers shipSpeedModifiers = new ShipSpeedModifiers();

            shipSpeedModifiers.SpeedModifier       = 1f;
            shipSpeedModifiers.RotSpeedModifier    = 1f;
            shipSpeedModifiers.LinearAccelModifier = 1f;
            shipSpeedModifiers.RotAccelModifier    = 1f;
            if (player != null)
            {
                PlayerTechInfo playerTechInfo1 = playerTechs.FirstOrDefault <PlayerTechInfo>((Func <PlayerTechInfo, bool>)(x => x.TechFileID == "NRG_Ionic_Thruster"));
                if (playerTechInfo1 != null && playerTechInfo1.State == TechStates.Researched)
                {
                    float techBonus1 = ab.GetTechBonus <float>(playerTechInfo1.TechFileID, "shiprot");
                    float techBonus2 = ab.GetTechBonus <float>(playerTechInfo1.TechFileID, "shipaccel");
                    shipSpeedModifiers.RotSpeedModifier    += techBonus1;
                    shipSpeedModifiers.LinearAccelModifier += techBonus2;
                    shipSpeedModifiers.RotAccelModifier    += techBonus2;
                }
                PlayerTechInfo playerTechInfo2 = playerTechs.FirstOrDefault <PlayerTechInfo>((Func <PlayerTechInfo, bool>)(x => x.TechFileID == "NRG_Small_Scale_Fusion"));
                if (playerTechInfo2 != null && playerTechInfo2.State == TechStates.Researched && (shipClass == RealShipClasses.AssaultShuttle || shipClass == RealShipClasses.Drone || shipClass == RealShipClasses.Biomissile))
                {
                    shipSpeedModifiers.SpeedModifier += ab.GetTechBonus <float>(playerTechInfo2.TechFileID, "speed");
                }
                if (isDeepSpace && player.Faction.Name == "liir_zuul")
                {
                    shipSpeedModifiers.SpeedModifier       += 0.2f;
                    shipSpeedModifiers.RotSpeedModifier    += 0.2f;
                    shipSpeedModifiers.LinearAccelModifier += 0.2f;
                    shipSpeedModifiers.RotAccelModifier    += 0.2f;
                }
            }
            return(shipSpeedModifiers);
        }
Ejemplo n.º 8
0
 protected override void OnPanelMessage(string panelName, string msgType, string[] msgParams)
 {
     if (msgType == "list_item_dblclk")
     {
         if (panelName == "gameFleetList")
         {
             this.AddDesign(int.Parse(msgParams[0]));
             this.SyncDesignWorkingList();
         }
         else
         {
             if (!(panelName == "gameWorkingFleet"))
             {
                 return;
             }
             this.RemoveDesign(int.Parse(msgParams[0].Split('|')[0]), true);
             this.SyncDesignWorkingList();
         }
     }
     else if (msgType == "list_sel_changed")
     {
         if (panelName == "gameFleetList")
         {
             this.DesignDetailCard.SyncDesign(int.Parse(msgParams[0].Split('|')[0]), new int?());
         }
         else if (panelName == "gameWorkingFleet")
         {
             int key = int.Parse(msgParams[0].Split('|')[0]);
             if (!this.ListDesignMap.ContainsKey(key))
             {
                 return;
             }
             this.DesignDetailCard.SyncDesign(this.ListDesignMap[key], new int?());
         }
         else
         {
             if (!(panelName == "gameClassList"))
             {
                 return;
             }
             RealShipClasses shipClass = (RealShipClasses)int.Parse(msgParams[0]);
             if (this.SelectedClass == shipClass)
             {
                 return;
             }
             this.PopulateClassList(shipClass);
         }
     }
     else if (msgType == "button_clicked")
     {
         if (panelName == "okButton" || panelName == "single_okButton")
         {
             this.namedialog = this._app.UI.CreateDialog((Dialog) new GenericTextEntryDialog(this._app, "Enter Name for Composition", "input a name for your fleet composition", "Composition", 1024, 3, false, EditBoxFilterMode.None), null);
         }
         else if (panelName.StartsWith("designDeleteButton"))
         {
             this.RemoveDesign(int.Parse(panelName.Split('|')[2]), true);
             this.SyncDesignWorkingList();
         }
         else
         {
             if (!(panelName == "cancelButton"))
             {
                 return;
             }
             this._app.UI.CloseDialog((Dialog)this, true);
         }
     }
     else
     {
         if (!(msgType == "dialog_closed") || !(panelName == this.namedialog) || !bool.Parse(msgParams[0]))
         {
             return;
         }
         this.invoicename = msgParams[1];
         this.commitdesigns();
         this._app.UI.CloseDialog((Dialog)this, true);
     }
 }
Ejemplo n.º 9
0
        public void LoadFromXml(
            AssetDatabase assetdb,
            string filename,
            string faction,
            ShipSectionType sectionType,
            ShipClass sectionClass)
        {
            ShipSection ss = new ShipSection();

            ShipXmlUtility.LoadShipSectionFromXml(filename, ref ss);
            this.Type        = sectionType;
            this.Class       = sectionClass;
            this.Faction     = faction;
            this.SectionName = Path.GetFileNameWithoutExtension(filename);
            string str1 = "";

            switch (this.Class)
            {
            case ShipClass.Cruiser:
                str1 = "CR";
                break;

            case ShipClass.Dreadnought:
                str1 = "DN";
                break;

            case ShipClass.Leviathan:
                str1 = "LV";
                break;

            case ShipClass.BattleRider:
                str1 = "BR";
                break;

            case ShipClass.Station:
                str1 = "SN";
                break;
            }
            this.ModelName = FileSystemHelpers.StripMountName(ss.ModelPath);
            string str2 = Path.Combine(Path.GetDirectoryName(this.ModelName), "Damage_" + str1 + "_" + this.Type.ToString() + "_Default.scene");

            this.DestroyedModelName = string.IsNullOrEmpty(ss.DestroyedModelPath) ? str2 : ss.DestroyedModelPath;
            this.DamagedModelName   = ss.DamageModelPath;
            this.AmbientSound       = ss.AmbientSound;
            this.EngineSound        = ss.EngineSound;
            string str3 = string.Format("COMBAT_023-01_{0}_GeneralShipsBeingAttacked", (object)faction);
            string str4 = "";

            switch (this.Class)
            {
            case ShipClass.Cruiser:
                str4 = string.Format("COMBAT_029-01_{0}_CruiserDestroyed", (object)faction);
                break;

            case ShipClass.Dreadnought:
                str4 = string.Format("COMBAT_030-01_{0}_DreadnoughtDestroyed", (object)faction);
                break;

            case ShipClass.Leviathan:
                str4 = string.Format("COMBAT_031-01_{0}_LeviathanDestroyed", (object)faction);
                break;

            case ShipClass.BattleRider:
                str4 = string.Format("COMBAT_020-01_{0}_BattleRiderDestroyed", (object)faction);
                break;

            case ShipClass.Station:
                switch (this.StationType)
                {
                case StationType.NAVAL:
                    str3 = string.Format("COMBAT_067-01_{0}_NavalStationUnderAttack", (object)faction);
                    str4 = string.Format("COMBAT_066-01_{0}_NavalStationDestroyed", (object)faction);
                    break;

                case StationType.SCIENCE:
                    str3 = string.Format("COMBAT_069-01_{0}_ScienceStationUnderAttack", (object)faction);
                    str4 = string.Format("COMBAT_068-01_{0}_ScienceStationDestroyed", (object)faction);
                    break;

                case StationType.CIVILIAN:
                    str3 = string.Format("COMBAT_071-01_{0}_CivilianStationUnderAttack", (object)faction);
                    str4 = string.Format("COMBAT_072-01_{0}_CivilianStationDestroyed", (object)faction);
                    break;

                case StationType.DIPLOMATIC:
                    str3 = string.Format("COMBAT_070a-01_{0}_DiplomaticStationUnderAttack", (object)faction);
                    str4 = string.Format("COMBAT_070-01_{0}_DiplomaticStationDestroyed", (object)faction);
                    break;
                }
                break;
            }
            this.UnderAttackSound = string.IsNullOrEmpty(ss.UnderAttackSound) ? str3 : ss.UnderAttackSound;
            this.DestroyedSound   = string.IsNullOrEmpty(ss.DestroyedSound) ? str4 : ss.DestroyedSound;
            this.Title            = ss.Title;
            this.Description      = ss.Description;
            if (string.IsNullOrWhiteSpace(this.Title))
            {
                this.Title = Path.GetFileNameWithoutExtension(filename);
            }
            string withoutExtension = Path.GetFileNameWithoutExtension(filename);

            this.CombatAIType = !string.IsNullOrEmpty(ss.CombatAiType) ? (SectionEnumerations.CombatAiType)Enum.Parse(typeof(SectionEnumerations.CombatAiType), ss.CombatAiType) : SectionEnumerations.CombatAiType.Normal;
            switch (this.CombatAIType)
            {
            case SectionEnumerations.CombatAiType.Drone:
                this.SetBattleRiderType(BattleRiderTypes.drone);
                break;

            case SectionEnumerations.CombatAiType.AssaultShuttle:
                this.SetBattleRiderType(BattleRiderTypes.assaultshuttle);
                break;

            case SectionEnumerations.CombatAiType.NodeFighter:
                this.SetBattleRiderType(BattleRiderTypes.nodefighter);
                break;

            case SectionEnumerations.CombatAiType.Swarmer:
            case SectionEnumerations.CombatAiType.SwarmerGuardian:
            case SectionEnumerations.CombatAiType.VonNeumannPyramid:
            case SectionEnumerations.CombatAiType.LocustFighter:
            case SectionEnumerations.CombatAiType.MorrigiCrow:
                this.SetBattleRiderType(BattleRiderTypes.battlerider);
                break;

            case SectionEnumerations.CombatAiType.VonNeumannSeekerProbe:
                this.SetBattleRiderType(BattleRiderTypes.assaultshuttle);
                break;

            default:
                this.SetBattleRiderType(ObtainShipClassTypes.GetBattleRiderTypeByName(this.Class, withoutExtension));
                break;
            }
            if (withoutExtension.Contains("protectorate"))
            {
                this.ShipFleetAbilityType = ShipFleetAbilityType.Protectorate;
            }
            else if (withoutExtension.Contains("suulka_the_hidden"))
            {
                this.ShipFleetAbilityType = ShipFleetAbilityType.Hidden;
            }
            else if (withoutExtension.Contains("suulka_the_deaf"))
            {
                this.ShipFleetAbilityType = ShipFleetAbilityType.Deaf;
            }
            this.IsSuperTransport  = this.SectionName.StartsWith("lv_supertransport", StringComparison.InvariantCultureIgnoreCase);
            this.IsBoreShip        = this.SectionName.EndsWith("bore", StringComparison.InvariantCultureIgnoreCase);
            this.IsSupplyShip      = this.SectionName.Contains("_supply");
            this.IsGateShip        = this.SectionName.StartsWith("cr_mis_gate", StringComparison.InvariantCultureIgnoreCase);
            this.IsTrapShip        = this.SectionName.StartsWith("cr_mis_colonytrickster", StringComparison.InvariantCultureIgnoreCase);
            this.IsGravBoat        = this.SectionName.StartsWith("cr_mis_gravboat", StringComparison.InvariantCultureIgnoreCase);
            this.IsAbsorberSection = this.SectionName.Contains("_absorber") || this.SectionName.Contains("_absorbtion");
            this.IsListener        = this.SectionName.Contains("_listener");
            this.IsFireControl     = this.Title.Contains("CR_CMD_FIRECONTROL") || this.Title.Contains("CR_CMD_FIRE_CONTROL");
            this.IsAIControl       = this.Title.Contains("CR_CMD_AI") || this.Title.Contains("DN_CMD_AI");
            this.SuulkaType        = this.GetSuulkaType(this.SectionName);
            this.IsFreighter       = ss.isFreighter;
            this.FreighterSpace    = ss.FreighterSpace;
            this.isPolice          = ss.isPolice;
            this.SlaveCapacity     = ss.SlaveCapacity;
            this.isPropaganda      = this.SectionName.StartsWith("cr_mis_propaganda", StringComparison.InvariantCultureIgnoreCase);
            this.IsAccelerator     = this.SectionName.StartsWith("cr_mis_ngp", StringComparison.InvariantCultureIgnoreCase);
            this.IsLoaCube         = this.SectionName.StartsWith("cr_mis_cube", StringComparison.InvariantCultureIgnoreCase);
            this.IsScavenger       = this.FileName.Contains("mis_scavenger") || this.FileName.Contains("dn_mis_subjugator");
            this.IsWraithAbductor  = this.FileName.Contains("wraith_abductor");
            this.Armor[1]          = new Kerberos.Sots.Framework.Size()
            {
                X = ss.TopArmor.X,
                Y = ss.TopArmor.Y
            };
            this.Armor[3] = new Kerberos.Sots.Framework.Size()
            {
                X = ss.BottomArmor.X,
                Y = ss.BottomArmor.Y
            };
            this.Armor[2] = this.Armor[0] = new Kerberos.Sots.Framework.Size()
            {
                X = ss.SideArmor.X,
                Y = ss.SideArmor.Y
            };
            this.Structure          = ss.Struct;
            this.LowStruct          = ss.StructDamageAmount;
            this.Mass               = (float)ss.Mass;
            this.SavingsCost        = ss.SavingsCost;
            this.ProductionCost     = ss.ProductionCost;
            this.ColonizationSpace  = ss.ColonizerSpace;
            this.TerraformingSpace  = ss.TerraformingPoints;
            this.ConstructionPoints = ss.ConstructionPoints;
            this.ReserveSize        = ss.BattleRiderReserveSize;
            this.RepairPoints       = ss.RepairPoints;
            this.FtlSpeed           = ss.FtlSpeed;
            this.NodeSpeed          = ss.NodeSpeed;
            this.MissionTime        = ss.MissionTime;
            this.LaunchDelay        = ss.LaunchDelay;
            this.DockingDelay       = ss.DockingDelay;
            this.Crew               = ss.Crew;
            this.CrewRequired       = ss.CrewRequired;
            this.Power              = ss.Power;
            this.Supply             = ss.Supply;
            this.ECM                 = ss.ECM;
            this.ECCM                = ss.ECCM;
            this.CommandPoints       = ss.CommandPoints;
            this.Signature           = ss.Signature;
            this.TacticalSensorRange = ss.TacticalSensorRange;
            this.ShipExplosiveDamage = ss.DeathDamage;
            this.ShipExplosiveRange  = ss.ExplosionRadius;
            this.PsionicPowerLevel   = ss.PsionicPowerLevel;
            if ((double)this.TacticalSensorRange <= 0.0)
            {
                this.TacticalSensorRange = 20000f;
            }
            this.DamageEffect = new LogicalEffect()
            {
                Name = !string.IsNullOrEmpty(ss.DamageEffectPath) ? ss.DamageEffectPath : ShipSectionAsset.GetShipDefaultDeathEffect(this.Class, this.BattleRiderType)
            };
            this.DeathEffect = new LogicalEffect()
            {
                Name = !string.IsNullOrEmpty(ss.DestroyedEffectPath) ? ss.DestroyedEffectPath : ShipSectionAsset.GetShipDefaultDeathEffect(this.Class, this.BattleRiderType)
            };
            this.ReactorFailureDeathEffect = new LogicalEffect()
            {
                Name = ShipSectionAsset.GetReactorShieldFailureDeathEffect(this.Class, this.Type)
            };
            this.ReactorCriticalDeathEffect = new LogicalEffect()
            {
                Name = ShipSectionAsset.GetReactorCriticalDeathEffect(this.Class, this.Type, withoutExtension)
            };
            this.AbsorbedDeathEffect = new LogicalEffect()
            {
                Name = ShipSectionAsset.GetAbsorbedDeathEffect(this.Class, this.Type)
            };
            this.StrategicSensorRange = ss.StrategicSensorRange;
            this.FleetSpeedModifier   = ss.FleetSpeedModifier;
            if ((double)this.StrategicSensorRange <= 0.0)
            {
                this.StrategicSensorRange = assetdb.DefaultStratSensorRange;
            }
            this.StationType                = ss.StationType != null ? SectionEnumerations.StationTypesWithInvalid[ss.StationType] : StationType.INVALID_TYPE;
            this.StationLevel               = ss.StationLevel;
            this.isConstructor              = ss.isConstructor;
            this.Maneuvering.LinearAccel    = ss.Acceleration;
            this.Maneuvering.RotAccel.X     = ss.RotationalAccelerationYaw;
            this.Maneuvering.RotAccel.Y     = ss.RotationalAccelerationPitch;
            this.Maneuvering.RotAccel.Z     = ss.RotationalAccelerationRoll;
            this.Maneuvering.Deacceleration = ss.Decceleration;
            this.Maneuvering.LinearSpeed    = ss.LinearSpeed;
            this.Maneuvering.RotationSpeed  = ss.RotationSpeed;
            HashSet <string> source1 = new HashSet <string>();

            foreach (Kerberos.Sots.Data.ShipFramework.Tech tech in ss.Techs)
            {
                source1.Add(tech.Name);
                this.isDeepScan = this.isDeepScan || tech.Name == "CCC_Advanced_Sensors";
                this.hasJammer  = this.hasJammer || tech.Name == "CCC_Sensor_Jammer";
                if (this.cloakingType == CloakingType.None)
                {
                    switch (tech.Name)
                    {
                    case "SLD_Cloaking":
                        this.cloakingType = CloakingType.Cloaking;
                        continue;

                    case "SLD_Improved_Cloaking":
                        this.cloakingType = CloakingType.ImprovedCloaking;
                        continue;

                    default:
                        continue;
                    }
                }
            }
            List <HashSet <string> > stringSetList = new List <HashSet <string> >();

            foreach (ShipOptionGroup shipOptionGroup in ss.ShipOptionGroups)
            {
                HashSet <string> stringSet = new HashSet <string>();
                foreach (ShipOption shipOption in shipOptionGroup.ShipOptions)
                {
                    stringSet.Add(shipOption.Name);
                }
                stringSetList.Add(stringSet);
            }
            switch (sectionClass)
            {
            case ShipClass.Cruiser:
                source1.Add("ENG_Cruiser_Construction");
                break;

            case ShipClass.Dreadnought:
                source1.Add("ENG_Dreadnought_Construction");
                break;

            case ShipClass.Leviathan:
                source1.Add("ENG_Leviathian_Construction");
                break;
            }
            List <LogicalModuleMount> logicalModuleMountList = new List <LogicalModuleMount>();

            foreach (ModuleMount module in ss.Modules)
            {
                LogicalModuleMount logicalModuleMount = new LogicalModuleMount()
                {
                    Section = this
                };
                logicalModuleMount.AssignedModuleName = module.AssignedModuleName;
                logicalModuleMount.ModuleType         = module.Type;
                logicalModuleMount.NodeName           = module.NodeName;
                logicalModuleMount.FrameX             = module.FrameX;
                logicalModuleMount.FrameY             = module.FrameY;
                logicalModuleMountList.Add(logicalModuleMount);
            }
            List <LogicalBank>  banks            = new List <LogicalBank>();
            List <LogicalMount> logicalMountList = new List <LogicalMount>();

            foreach (Bank bank in ss.Banks)
            {
                LogicalBank logicalBank = new LogicalBank()
                {
                    TurretSize        = (WeaponEnums.WeaponSizes)Enum.Parse(typeof(WeaponEnums.WeaponSizes), bank.Size),
                    Section           = this,
                    Module            = (LogicalModule)null,
                    GUID              = Guid.Parse(bank.Id),
                    DefaultWeaponName = bank.DefaultWeapon
                };
                logicalBank.TurretClass = (WeaponEnums.TurretClasses)Enum.Parse(typeof(WeaponEnums.TurretClasses), bank.Class);
                logicalBank.FrameX      = bank.FrameX;
                logicalBank.FrameY      = bank.FrameY;
                this.IsCarrier          = this.IsCarrier || WeaponEnums.IsBattleRider(logicalBank.TurretClass);
                this.isMineLayer        = this.isMineLayer || logicalBank.TurretClass == WeaponEnums.TurretClasses.Minelayer;
                banks.Add(logicalBank);
                foreach (Mount mount in bank.Mounts)
                {
                    LogicalMount logicalMount = new LogicalMount()
                    {
                        Bank           = logicalBank,
                        NodeName       = mount.NodeName,
                        TurretOverload = mount.TurretOverload,
                        BarrelOverload = mount.BarrelOverload,
                        BaseOverload   = mount.BaseOverload,
                        FireAnimName   = mount.SectionFireAnimation != null ? mount.SectionFireAnimation : "",
                        ReloadAnimName = mount.SectionReloadAnimation != null ? mount.SectionReloadAnimation : "",
                        Yaw            =
                        {
                            Min = mount.YawMin,
                            Max = mount.YawMax
                        },
                        Pitch =
                        {
                            Min = mount.PitchMin,
                            Max = mount.PitchMax
                        }
                    };
                    logicalMount.Pitch.Min = Math.Max(-90f, logicalMount.Pitch.Min);
                    logicalMount.Pitch.Max = Math.Min(90f, logicalMount.Pitch.Max);
                    logicalMountList.Add(logicalMount);
                }
            }
            if (this.IsCarrier)
            {
                this.CarrierType = ShipSectionAsset.GetCarrierType(banks);
            }
            List <string>          stringList          = new List <string>();
            List <ShipSectionType> shipSectionTypeList = new List <ShipSectionType>();

            foreach (ExcludedSection excludedSection in ss.ExcludedSections)
            {
                stringList.Add(excludedSection.Name);
            }
            foreach (ExcludedType excludedType in ss.ExcludedTypes)
            {
                ShipSectionType shipSectionType = ShipSectionType.Command;
                if (excludedType.Name == "Engine")
                {
                    shipSectionType = ShipSectionType.Engine;
                }
                else if (excludedType.Name == "Mission")
                {
                    shipSectionType = ShipSectionType.Mission;
                }
                shipSectionTypeList.Add(shipSectionType);
            }
            List <SectionEnumerations.PsionicAbility> psionicAbilityList = new List <SectionEnumerations.PsionicAbility>();

            foreach (AvailablePsionicAbility psionicAbility in ss.PsionicAbilities)
            {
                psionicAbilityList.Add((SectionEnumerations.PsionicAbility)Enum.Parse(typeof(SectionEnumerations.PsionicAbility), psionicAbility.Name));
            }
            foreach (IEnumerable <string> source2 in stringSetList)
            {
                this.ShipOptions.Add(source2.ToArray <string>());
            }
            this.RequiredTechs       = source1.ToArray <string>();
            this.Banks               = banks.ToArray();
            this.Mounts              = logicalMountList.ToArray();
            this.Modules             = logicalModuleMountList.ToArray();
            this.ExcludeSections     = stringList.ToArray();
            this.ExcludeSectionTypes = shipSectionTypeList.ToArray();
            this.PsionicAbilities    = psionicAbilityList.ToArray();
            if (!ss.RealShipClass.HasValue)
            {
                if (this.RealClass != RealShipClasses.BattleCruiser && this.RealClass != RealShipClasses.BattleShip)
                {
                    this.RealClass = ObtainShipClassTypes.GetRealShipClass(this.Class, this.BattleRiderType, filename);
                }
            }
            else
            {
                this.RealClass = ss.RealShipClass.Value;
            }
            if (this.CombatAIType != SectionEnumerations.CombatAiType.VonNeumannDisc)
            {
                return;
            }
            this.cloakingType = CloakingType.ImprovedCloaking;
        }