private IEnumerable <WeaponAssignment> GetWeaponAssignments( ShipSectionType sectionType) { foreach (WeaponBankShipData currentWeaponBank in this.GetCurrentWeaponBanks(sectionType)) { yield return new WeaponAssignment() { ModuleNode = "", Bank = currentWeaponBank.Bank, Weapon = currentWeaponBank.SelectedWeapon, DesignID = currentWeaponBank.SelectedDesign, InitialFireMode = currentWeaponBank.FiringMode, InitialTargetFilter = currentWeaponBank.FilterMode } } ; foreach (ModuleShipData currentSectionModule in this.GetCurrentSectionModules()) { if (currentSectionModule.SelectedModule != null && currentSectionModule.SelectedModule.SelectedWeapon != null) { yield return new WeaponAssignment() { ModuleNode = currentSectionModule.ModuleMount.NodeName, Bank = currentSectionModule.SelectedModule.Module.Banks[0], Weapon = currentSectionModule.SelectedModule.SelectedWeapon, DesignID = currentSectionModule.SelectedModule.SelectedDesign } } ; } }
public string GetCurrentSectionName(ShipSectionType sectionType) { ShipSectionAsset currentSection = this.GetCurrentSection(sectionType); if (currentSection != null) { return(App.Localize(currentSection.Title)); } return("unknown"); }
public string GetCurrentSectionAssetName(ShipSectionType sectionType) { ShipSectionAsset currentSection = this.GetCurrentSection(sectionType); if (currentSection != null) { return(currentSection.FileName); } return(string.Empty); }
public IEnumerable <ModuleShipData> GetCurrentSectionModules( ShipSectionType sectionType) { SectionShipData section = this.GetCurrentSectionData(sectionType); if (section != null) { foreach (ModuleShipData module in section.Modules) { yield return(module); } } }
public IEnumerable <WeaponBankShipData> GetCurrentWeaponBanks( ShipSectionType sectionType) { SectionShipData section = this.GetCurrentSectionData(sectionType); if (section != null) { foreach (WeaponBankShipData weaponBank in section.WeaponBanks) { yield return(weaponBank); } } }
public static ShipSectionAsset GetSectionAsset( App game, DesignInfo design, ShipSectionType sectionType) { foreach (DesignSectionInfo designSection1 in design.DesignSections) { DesignSectionInfo designSection = designSection1; ShipSectionAsset shipSectionAsset = game.AssetDatabase.ShipSections.First <ShipSectionAsset>((Func <ShipSectionAsset, bool>)(x => x.FileName == designSection.FilePath)); if (shipSectionAsset.Type == sectionType) { return(shipSectionAsset); } } return((ShipSectionAsset)null); }
public HashSet <ShipSectionAsset> GetSectionsByType( ShipClass shipClass, ShipSectionType type) { HashSet <ShipSectionAsset> shipSectionAssetSet; if (!this._bykey.TryGetValue(new ShipSectionCollection.Key() { Type = type, Class = shipClass }, out shipSectionAssetSet)) { return(ShipSectionCollection.Empty); } return(shipSectionAssetSet); }
private static string GetAbsorbedDeathEffect(ShipClass sc, ShipSectionType sst) { if (sst == ShipSectionType.Mission) { switch (sc) { case ShipClass.Cruiser: return("effects\\ShipDeath\\Cruiser_SRF.effect"); case ShipClass.Dreadnought: return("effects\\ShipDeath\\Dreadnought_SRF.effect"); case ShipClass.Leviathan: return("effects\\ShipDeath\\Levi_SRF.effect"); } } return(""); }
private static string GetReactorShieldFailureDeathEffect(ShipClass sc, ShipSectionType sst) { if (sst == ShipSectionType.Engine) { switch (sc) { case ShipClass.Cruiser: return("effects\\ShipDeath\\Cruiser_SRF.effect"); case ShipClass.Dreadnought: return("effects\\ShipDeath\\Dreadnought_SRF.effect"); case ShipClass.Leviathan: return("effects\\ShipDeath\\Levi_SRF.effect"); } } return(ShipSectionAsset.GetShipDefaultDeathEffect(sc, BattleRiderTypes.Unspecified)); }
private IEnumerable <ModuleAssignment> GetModuleAssignments( ShipSectionType sectionType) { IEnumerable <ModuleShipData> sectionModules = this.GetCurrentSectionModules(sectionType); foreach (ModuleShipData moduleShipData in sectionModules) { if (moduleShipData.SelectedModule != null) { yield return new ModuleAssignment() { ModuleMount = moduleShipData.ModuleMount, Module = moduleShipData.SelectedModule.Module, PsionicAbilities = moduleShipData.SelectedModule.SelectedPsionic.ToArray() } } ; } }
private static string GetReactorCriticalDeathEffect( ShipClass sc, ShipSectionType sst, string fileName) { if (sst == ShipSectionType.Engine || sc == ShipClass.Leviathan) { switch (sc) { case ShipClass.Cruiser: if (fileName.Contains("Reflex") || fileName.Contains("reflex") || (fileName.Contains("Antimatter") || fileName.Contains("antimatter"))) { return("effects\\ShipDeath\\Cruiser_CRF_Antimatter.effect"); } if (fileName.Contains("Fusion") || fileName.Contains("fusion")) { return("effects\\ShipDeath\\Cruiser_CRF_Fusion.effect"); } break; case ShipClass.Dreadnought: if (fileName.Contains("Reflex") || fileName.Contains("reflex") || (fileName.Contains("Antimatter") || fileName.Contains("antimatter"))) { return("effects\\ShipDeath\\Dreadnought_CRF_Antimatter.effect"); } if (fileName.Contains("Fusion") || fileName.Contains("fusion")) { return("effects\\ShipDeath\\Dreadnought_CRF_Fusion.effect"); } break; case ShipClass.Leviathan: return("effects\\ShipDeath\\Levi_CRF_Antimatter.effect"); } } return(ShipSectionAsset.GetShipDefaultDeathEffect(sc, BattleRiderTypes.Unspecified)); }
public ShipSectionAsset GetCurrentSection(ShipSectionType sectionType) { return(this.GetCurrentSectionData(sectionType)?.Section); }
public SectionShipData GetCurrentSectionData(ShipSectionType sectionType) { return(this.GetCurrentSectionTypeShipData(sectionType)?.SelectedSection); }
public SectionTypeShipData GetCurrentSectionTypeShipData( ShipSectionType sectionType) { return(this.Factions.Current.SelectedClass.SectionTypes.FirstOrDefault <SectionTypeShipData>((Func <SectionTypeShipData, bool>)(x => x.SectionType == sectionType))); }
public static LogicalModule CreateLogicalModuleFromFile( string moduleFile, string faction) { ShipModule sm = new ShipModule(); ShipModuleXmlUtility.LoadShipModuleFromXml(moduleFile, ref sm); LogicalModule logicalModule = new LogicalModule() { ModuleTitle = sm.ModuleTitle, Description = sm.Description, ModuleType = sm.ModuleType ?? string.Empty, ModulePath = PathHelpers.Combine("factions", faction, "modules", Path.GetFileName(moduleFile)) }; logicalModule.ModuleName = Path.GetFileNameWithoutExtension(logicalModule.ModulePath); logicalModule.ModelPath = sm.ModelPath; logicalModule.LowStructModelPath = sm.DamagedModelPath ?? string.Empty; logicalModule.DeadModelPath = sm.DestroyedModelPath ?? string.Empty; logicalModule.LowStruct = (float)sm.StructDamageAmount; logicalModule.AmbientSound = sm.AmbientSound; if (!string.IsNullOrEmpty(sm.AbilityType)) { logicalModule.AbilityType = (ModuleEnums.ModuleAbilities)Enum.Parse(typeof(ModuleEnums.ModuleAbilities), sm.AbilityType); } logicalModule.AbilitySupply = sm.AbilitySupply; if (logicalModule.AbilitySupply == 0) { if (logicalModule.AbilityType == ModuleEnums.ModuleAbilities.GoopArmorRepair) { logicalModule.AbilitySupply = 3; } else if (logicalModule.AbilityType == ModuleEnums.ModuleAbilities.JokerECM) { logicalModule.AbilitySupply = 5; } } logicalModule.Crew = sm.Crew; logicalModule.CrewRequired = sm.CrewRequired; logicalModule.Supply = sm.Supply; logicalModule.Structure = (float)sm.Structure; logicalModule.StructureBonus = (float)sm.StructureBonus; logicalModule.ArmorBonus = sm.ArmorBonus; logicalModule.ECCM = sm.ECCM; logicalModule.ECM = sm.ECM; logicalModule.RepairPointsBonus = sm.RepairPointsBonus; logicalModule.AccelBonus = sm.AccelerationBonus / 100f; logicalModule.CriticalHitBonus = sm.CriticalHitBonus; logicalModule.SensorBonus = sm.SensorBonus; logicalModule.AdmiralSurvivalBonus = sm.AdmiralSurvivalBonus; logicalModule.PsionicPowerBonus = sm.PsionicPowerBonus; logicalModule.PsionicStaminaBonus = sm.PsionicStaminaBonus; logicalModule.PowerBonus = sm.Power; logicalModule.DamageEffect = new LogicalEffect() { Name = sm.DamagedEffectPath ?? string.Empty }; logicalModule.DeathEffect = new LogicalEffect() { Name = sm.DestroyedEffectPath ?? string.Empty }; logicalModule.AssignByDefault = sm.AssignByDefault; logicalModule.Icon = sm.IconSprite; logicalModule.ROFBonus = sm.ROFBonus; logicalModule.CrewEfficiencyBonus = sm.CrewEfficiencyBonus; if (logicalModule.AbilityType == ModuleEnums.ModuleAbilities.KarnakTargeting) { logicalModule.AccuracyBonus = 10f; logicalModule.DamageBonus = 0.15f; } if (logicalModule.ModulePath.Contains("cr_")) { logicalModule.Class = ShipClass.Cruiser; } else if (logicalModule.ModulePath.Contains("dn_")) { logicalModule.Class = ShipClass.Dreadnought; } else if (logicalModule.ModulePath.Contains("lv_")) { logicalModule.Class = ShipClass.Leviathan; } else if (logicalModule.ModulePath.Contains("sn_")) { logicalModule.Class = ShipClass.Station; } List <LogicalBank> logicalBankList = new List <LogicalBank>(); List <LogicalMount> logicalMountList = new List <LogicalMount>(); List <LogicalPsionic> logicalPsionicList = new List <LogicalPsionic>(); foreach (Bank bank in sm.Banks) { LogicalBank logicalBank = new LogicalBank() { TurretSize = (WeaponEnums.WeaponSizes)Enum.Parse(typeof(WeaponEnums.WeaponSizes), bank.Size), Section = (ShipSectionAsset)null, Module = logicalModule, GUID = Guid.Parse(bank.Id), DefaultWeaponName = bank.DefaultWeapon }; logicalBank.TurretClass = (WeaponEnums.TurretClasses)Enum.Parse(typeof(WeaponEnums.TurretClasses), bank.Class); logicalBankList.Add(logicalBank); foreach (Mount mount in bank.Mounts) { LogicalMount logicalMount = new LogicalMount() { Bank = logicalBank, NodeName = mount.NodeName, 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); } } List <string> stringList1 = new List <string>(); List <ShipSectionType> shipSectionTypeList = new List <ShipSectionType>(); foreach (ExcludedSection excludedSection in sm.ExcludedSections) { stringList1.Add(excludedSection.Name); } foreach (ExcludedType excludedType in sm.ExcludedTypes) { ShipSectionType shipSectionType = ShipSectionType.Command; if (excludedType.Name == "Engine") { shipSectionType = ShipSectionType.Engine; } else if (excludedType.Name == "Mission") { shipSectionType = ShipSectionType.Mission; } shipSectionTypeList.Add(shipSectionType); } List <string> stringList2 = new List <string>(); foreach (IncludedSection includedSection in sm.IncludedSections) { stringList2.Add(includedSection.Name); } logicalModule.NumPsionicSlots = 0; if (logicalModule.ModuleTitle.Contains("PROFESSORX") || logicalModule.ModuleTitle.Contains("PSIWAR")) { if (logicalModule.Class == ShipClass.Cruiser) { logicalModule.NumPsionicSlots = 1; } else if (logicalModule.Class == ShipClass.Dreadnought) { logicalModule.NumPsionicSlots = 3; } for (int index = 0; index < logicalModule.NumPsionicSlots; ++index) { LogicalPsionic logicalPsionic = new LogicalPsionic(); logicalPsionicList.Add(logicalPsionic); } } logicalModule.Banks = logicalBankList.ToArray(); logicalModule.Mounts = logicalMountList.ToArray(); logicalModule.Psionics = logicalPsionicList.ToArray(); logicalModule.Techs = sm.Techs; logicalModule.SavingsCost = sm.SavingsCost; logicalModule.UpkeepCost = sm.UpkeepCost; logicalModule.ProductionCost = sm.ProductionCost; logicalModule.ExcludeSections = stringList1.ToArray(); logicalModule.IncludeSections = stringList2.ToArray(); logicalModule.ExcludeSectionTypes = shipSectionTypeList.ToArray(); logicalModule.Faction = faction; return(logicalModule); }
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; }