Exemplo n.º 1
0
        private static void Go(Engine engine)
        {
            var currencyPresentationClass = engine.GetClass("WillowGame.CurrencyListDefinition.CurrencyPresentation");

            if (currencyPresentationClass == null)
            {
                throw new InvalidOperationException();
            }

            var currencyPresentations = engine.Objects
                                        .Where(o => o.IsA(currencyPresentationClass) &&
                                               o.GetName().StartsWith("Default__") == false)
                                        .OrderBy(o => o.GetPath());

            using (var writer = Dataminer.NewDump("Currencies.json"))
            {
                writer.WriteStartObject();
                foreach (dynamic currencyPresentation in currencyPresentations)
                {
                    writer.WritePropertyName(currencyPresentation.GetPath());
                    writer.WriteStartObject();

                    writer.WritePropertyName("type");
                    writer.WriteValue(currencyPresentation.Type);

                    writer.WritePropertyName("widget_frame");
                    writer.WriteValue(currencyPresentation.WidgetFrame);

                    writer.WriteEndObject();
                }
                writer.WriteEndObject();
            }
        }
Exemplo n.º 2
0
        private static void Go(Engine engine)
        {
            var playerClassDefinitionClass = engine.GetClass("WillowGame.PlayerClassDefinition");

            if (playerClassDefinitionClass == null)
            {
                throw new InvalidOperationException();
            }

            using (var writer = Dataminer.NewDump("Player Classes.json"))
            {
                writer.WriteStartObject();

                var playerClassDefinitionClasses = engine.Objects
                                                   .Where(o => o.IsA(playerClassDefinitionClass) &&
                                                          o.GetName().StartsWith("Default__") == false)
                                                   .OrderBy(o => o.GetPath());
                foreach (dynamic playerClassDefinition in playerClassDefinitionClasses)
                {
                    writer.WritePropertyName(playerClassDefinition.GetPath());
                    writer.WriteStartObject();

                    var characterNameId = playerClassDefinition.CharacterNameId;
                    if (characterNameId == null)
                    {
                        throw new InvalidOperationException();
                    }

                    var characterClassId = characterNameId.CharacterClassId;
                    if (characterClassId == null)
                    {
                        throw new InvalidOperationException();
                    }

                    writer.WritePropertyName("name");
                    writer.WriteValue(characterNameId.LocalizedCharacterName);

                    writer.WritePropertyName("class");
                    writer.WriteValue(characterClassId.LocalizedClassNameNonCaps);

                    writer.WritePropertyName("sort_order");
                    writer.WriteValue(characterNameId.UISortOrder);

                    if (characterClassId.DlcCharacterDef != null)
                    {
                        writer.WritePropertyName("dlc");
                        writer.WriteValue(characterClassId.DlcCharacterDef.GetPath());
                    }

                    writer.WriteEndObject();
                }

                writer.WriteEndObject();
                writer.Flush();
            }
        }
        private static void Go(Engine engine)
        {
            var missionDefinitionClass = engine.GetClass("WillowGame.MissionDefinition");

            if (missionDefinitionClass == null)
            {
                throw new InvalidOperationException();
            }

            using (var writer = Dataminer.NewDump("Missions.json"))
            {
                writer.WriteStartObject();

                var missionDefinitions = engine.Objects
                                         .Where(o => o.IsA(missionDefinitionClass) &&
                                                o.GetName().StartsWith("Default__") == false)
                                         .OrderBy(o => o.GetPath());
                foreach (dynamic missionDefinition in missionDefinitions)
                {
                    writer.WritePropertyName(missionDefinition.GetPath());
                    writer.WriteStartObject();

                    writer.WritePropertyName("number");
                    writer.WriteValue(missionDefinition.MissionNumber);

                    string missionName = missionDefinition.MissionName;
                    if (string.IsNullOrEmpty(missionName) == false)
                    {
                        writer.WritePropertyName("name");
                        writer.WriteValue(missionName);
                    }

                    string missionDescription = missionDefinition.MissionDescription;
                    if (string.IsNullOrEmpty(missionDescription) == false)
                    {
                        writer.WritePropertyName("description");
                        writer.WriteValue(missionDescription);
                    }

                    writer.WritePropertyName("is_plot_critical");
                    writer.WriteValue(missionDefinition.bPlotCritical);

                    writer.WritePropertyName("can_be_failed");
                    writer.WriteValue(missionDefinition.bCanBeFailed);

                    // TODO: objective info

                    writer.WriteEndObject();
                }

                writer.WriteEndObject();
                writer.Flush();
            }
        }
        private static void Go(Engine engine)
        {
            var travelStationDefinitionClass      = engine.GetClass("WillowGame.TravelStationDefinition");
            var fastTravelStationDefinitionClass  = engine.GetClass("WillowGame.FastTravelStationDefinition");
            var levelTravelStationDefinitionClass = engine.GetClass("WillowGame.LevelTravelStationDefinition");
            var fastTravelStationsListOrderClass  = engine.GetClass("WillowGame.FastTravelStationsListOrder");

            if (travelStationDefinitionClass == null ||
                fastTravelStationDefinitionClass == null ||
                levelTravelStationDefinitionClass == null ||
                fastTravelStationsListOrderClass == null)
            {
                throw new InvalidOperationException();
            }

            using (var writer = Dataminer.NewDump("Travel Stations.json"))
            {
                writer.WriteStartObject();

                var travelStationDefinitions = engine.Objects
                                               .Where(o =>
                                                      (o.IsA(travelStationDefinitionClass) == true ||
                                                       o.IsA(fastTravelStationDefinitionClass) == true ||
                                                       o.IsA(levelTravelStationDefinitionClass) == true) &&
                                                      o.GetName().StartsWith("Default__") == false)
                                               .OrderBy(o => o.GetPath());
                foreach (dynamic travelStationDefinition in travelStationDefinitions)
                {
                    UnrealClass uclass = travelStationDefinition.GetClass();
                    if (uclass.Path != "WillowGame.FastTravelStationDefinition" &&
                        uclass.Path != "WillowGame.LevelTravelStationDefinition")
                    {
                        throw new InvalidOperationException();
                    }

                    writer.WritePropertyName(travelStationDefinition.GetPath());
                    writer.WriteStartObject();

                    if (uclass.Path != "WillowGame.TravelStationDefinition")
                    {
                        writer.WritePropertyName("$type");
                        writer.WriteValue(uclass.Name);
                    }

                    writer.WritePropertyName("resource_name");
                    writer.WriteValue(travelStationDefinition.GetName());

                    string stationLevelName = travelStationDefinition.StationLevelName;
                    if (string.IsNullOrEmpty(stationLevelName) == false)
                    {
                        writer.WritePropertyName("level_name");
                        writer.WriteValue(stationLevelName);
                    }

                    var dlcExpansion = travelStationDefinition.DlcExpansion;
                    if (dlcExpansion != null)
                    {
                        writer.WritePropertyName("dlc_expansion");
                        writer.WriteValue(dlcExpansion.GetPath());
                    }

                    if (travelStationDefinition.PreviousStation != null)
                    {
                        writer.WritePropertyName("previous_station");
                        writer.WriteValue(travelStationDefinition.PreviousStation.GetPath());
                    }

                    string stationDisplayName = travelStationDefinition.StationDisplayName;
                    if (string.IsNullOrEmpty(stationDisplayName) == false)
                    {
                        writer.WritePropertyName("station_display_name");
                        writer.WriteValue(stationDisplayName);
                    }

                    var missionDependencies = ((IEnumerable <dynamic>)travelStationDefinition.MissionDependencies)
                                              .Where(md => md.MissionDefinition != null)
                                              .OrderBy(md => md.MissionDefinition.GetPath())
                                              .ToArray();
                    if (missionDependencies.Length > 0)
                    {
                        writer.WritePropertyName("mission_dependencies");
                        writer.WriteStartArray();

                        foreach (var missionDependency in missionDependencies)
                        {
                            writer.WriteStartObject();

                            writer.WritePropertyName("mission_definition");
                            writer.WriteValue(missionDependency.MissionDefinition.GetPath());

                            writer.WritePropertyName("mission_status");
                            writer.WriteValue(((MissionStatus)missionDependency.MissionStatus).ToString());

                            if ((bool)missionDependency.bIsObjectiveSpecific == true)
                            {
                                writer.WritePropertyName("is_objective_specific");
                                writer.WriteValue(true);

                                if (missionDependency.MissionObjective != null)
                                {
                                    writer.WritePropertyName("objective_definition");
                                    writer.WriteValue(missionDependency.MissionObjective.GetPath());
                                }

                                writer.WritePropertyName("objective_status");
                                writer.WriteValue(
                                    ((ObjectiveDependencyStatus)missionDependency.ObjectiveStatus).ToString());
                            }

                            writer.WriteEndObject();
                        }

                        writer.WriteEndArray();
                    }

                    if (uclass == fastTravelStationDefinitionClass)
                    {
                        writer.WritePropertyName("initially_active");
                        writer.WriteValue((bool)travelStationDefinition.bInitiallyActive);

                        writer.WritePropertyName("send_only");
                        writer.WriteValue((bool)travelStationDefinition.bSendOnly);

                        string stationDescription = travelStationDefinition.StationDescription;
                        if (string.IsNullOrEmpty(stationDescription) == false &&
                            stationDescription != "No Description" &&
                            stationDescription != stationDisplayName)
                        {
                            writer.WritePropertyName("description");
                            writer.WriteValue(stationDescription);
                        }

                        string stationSign = travelStationDefinition.StationSign;
                        if (string.IsNullOrEmpty(stationSign) == false &&
                            stationSign != stationDisplayName)
                        {
                            writer.WritePropertyName("sign");
                            writer.WriteValue(stationSign);
                        }

                        if (travelStationDefinition.InaccessibleObjective != null)
                        {
                            writer.WritePropertyName("inaccessible_objective");
                            writer.WriteValue(travelStationDefinition.InaccessibleObjective.GetPath());
                        }

                        if (travelStationDefinition.AccessibleObjective != null)
                        {
                            writer.WritePropertyName("accessible_objective");
                            writer.WriteValue(travelStationDefinition.AccessibleObjective.GetPath());
                        }
                    }
                    else if (uclass == levelTravelStationDefinitionClass)
                    {
                        if (travelStationDefinition.DestinationStationDefinition != null)
                        {
                            writer.WritePropertyName("destination_station");
                            writer.WriteValue(travelStationDefinition.DestinationStationDefinition.GetPath());
                        }

                        string displayName = travelStationDefinition.DisplayName;
                        if (string.IsNullOrEmpty(displayName) == false &&
                            displayName != "No Description" &&
                            displayName != stationDisplayName)
                        {
                            writer.WritePropertyName("display_name");
                            writer.WriteValue(displayName);
                        }
                    }

                    writer.WriteEndObject();
                }

                writer.WriteEndObject();
                writer.Flush();
            }

            var fastTravelStationsListOrders = engine.Objects
                                               .Where(o =>
                                                      (o.IsA(fastTravelStationsListOrderClass) == true) &&
                                                      o.GetName().StartsWith("Default__") == false)
                                               .OrderBy(o => o.GetPath());

            using (var writer = Dataminer.NewDump("Fast Travel Station Ordering.json"))
            {
                writer.WriteStartObject();

                foreach (dynamic fastTravelStationsListOrder in fastTravelStationsListOrders)
                {
                    writer.WritePropertyName(fastTravelStationsListOrder.GetPath());
                    writer.WriteStartObject();

                    writer.WritePropertyName("stations");
                    writer.WriteStartArray();
                    foreach (var fastTravelStationDefinition in fastTravelStationsListOrder.FastTravelStationOrderList)
                    {
                        writer.WriteValue(fastTravelStationDefinition.GetPath());
                    }
                    writer.WriteEndArray();

                    var dlcExpansion = fastTravelStationsListOrder.DlcExpansion;
                    if (dlcExpansion != null)
                    {
                        writer.WritePropertyName("dlc_expansion");
                        writer.WriteValue(dlcExpansion.GetPath());
                    }

                    writer.WriteEndObject();
                }

                writer.WriteEndObject();
            }
        }
Exemplo n.º 5
0
        private static void Go(Engine engine)
        {
            var weaponBalanceDefinitionClass        = engine.GetClass("WillowGame.WeaponBalanceDefinition");
            var missionWeaponBalanceDefinitionClass = engine.GetClass("WillowGame.MissionWeaponBalanceDefinition");
            var inventoryBalanceDefinitionClass     = engine.GetClass("WillowGame.InventoryBalanceDefinition");
            var itemBalanceDefinitionClass          = engine.GetClass("WillowGame.ItemBalanceDefinition");
            var classModBalanceDefinitionClass      = engine.GetClass("WillowGame.ClassModBalanceDefinition");

            if (weaponBalanceDefinitionClass == null ||
                missionWeaponBalanceDefinitionClass == null ||
                inventoryBalanceDefinitionClass == null ||
                itemBalanceDefinitionClass == null ||
                classModBalanceDefinitionClass == null)
            {
                throw new InvalidOperationException();
            }

            var weaponTypes = new List <dynamic>();
            {
                var balanceDefinitions = engine.Objects
                                         .Where(o => (o.IsA(inventoryBalanceDefinitionClass) ||
                                                      o.IsA(weaponBalanceDefinitionClass)) &&
                                                o.GetName().StartsWith("Default__") == false)
                                         .OrderBy(o => o.GetPath());
                foreach (dynamic balanceDefinition in balanceDefinitions)
                {
                    if (balanceDefinition.InventoryDefinition != null &&
                        balanceDefinition.InventoryDefinition.GetClass().Path == "WillowGame.WeaponTypeDefinition")
                    {
                        weaponTypes.Add(balanceDefinition.InventoryDefinition);
                    }

                    if (balanceDefinition.GetClass() == weaponBalanceDefinitionClass)
                    {
                        if (balanceDefinition.PartListCollection != null)
                        {
                            throw new NotSupportedException();
                        }

                        var partListCollection = balanceDefinition.WeaponPartListCollection;
                        if (partListCollection == null)
                        {
                            throw new InvalidOperationException();
                        }

                        if (partListCollection != null)
                        {
                            if (partListCollection.AssociatedWeaponType != null)
                            {
                                weaponTypes.Add(partListCollection.AssociatedWeaponType);
                            }
                        }
                    }
                }
            }

            var weaponPartLists = new List <dynamic>();

            using (var writer = Dataminer.NewDump("Weapon Types.json"))
            {
                writer.WriteStartObject();
                foreach (var weaponType in weaponTypes.Distinct().OrderBy(wp => wp.GetPath()))
                {
                    writer.WritePropertyName(weaponType.GetPath());
                    writer.WriteStartObject();

                    UnrealClass weaponPartClass = weaponType.GetClass();
                    if (weaponPartClass.Path != "WillowGame.WeaponTypeDefinition" &&
                        weaponPartClass.Path != "WillowGame.BuzzaxeWeaponTypeDefinition")
                    {
                        throw new InvalidOperationException();
                    }

                    writer.WritePropertyName("type");
                    writer.WriteValue(((WeaponType)weaponType.WeaponType).ToString());

                    writer.WritePropertyName("name");
                    writer.WriteValue(weaponType.Typename);

                    if (weaponType.TitleList != null &&
                        weaponType.TitleList.Length > 0)
                    {
                        writer.WritePropertyName("titles");
                        writer.WriteStartArray();
                        IEnumerable <dynamic> titleList = weaponType.TitleList;
                        foreach (var title in titleList
                                 .Where(tp => tp != null)
                                 .OrderBy(tp => tp.GetPath()))
                        {
                            writer.WriteValue(title.GetPath());
                        }
                        writer.WriteEndArray();
                    }

                    if (weaponType.PrefixList != null &&
                        weaponType.PrefixList.Length > 0)
                    {
                        writer.WritePropertyName("prefixes");
                        writer.WriteStartArray();
                        IEnumerable <dynamic> prefixList = weaponType.PrefixList;
                        foreach (var prefix in prefixList
                                 .Where(pp => pp != null)
                                 .OrderBy(pp => pp.GetPath()))
                        {
                            writer.WriteValue(prefix.GetPath());
                        }
                        writer.WriteEndArray();
                    }

                    WritePartListReference(writer, "body_parts", weaponType.BodyParts, weaponPartLists);
                    WritePartListReference(writer, "grip_parts", weaponType.GripParts, weaponPartLists);
                    WritePartListReference(writer, "barrel_parts", weaponType.BarrelParts, weaponPartLists);
                    WritePartListReference(writer, "sight_parts", weaponType.SightParts, weaponPartLists);
                    WritePartListReference(writer, "stock_parts", weaponType.StockParts, weaponPartLists);
                    WritePartListReference(writer, "elemental_parts", weaponType.ElementalParts, weaponPartLists);
                    WritePartListReference(writer, "accessory1_parts", weaponType.Accessory1Parts, weaponPartLists);
                    WritePartListReference(writer, "accessory2_parts", weaponType.Accessory2Parts, weaponPartLists);
                    WritePartListReference(writer, "material_parts", weaponType.MaterialParts, weaponPartLists);

                    writer.WriteEndObject();
                }
                writer.WriteEndObject();
            }

            using (var writer = Dataminer.NewDump("Weapon Part Lists.json"))
            {
                writer.WriteStartObject();
                foreach (var partList in weaponPartLists.Distinct().OrderBy(wp => wp.GetPath()))
                {
                    WritePartList(writer, partList.GetPath(), partList);
                }
                writer.WriteEndObject();
            }

            var items = new List <dynamic>();
            {
                var balances = engine.Objects
                               .Where(o => (o.IsA(inventoryBalanceDefinitionClass) ||
                                            o.IsA(itemBalanceDefinitionClass) ||
                                            o.IsA(classModBalanceDefinitionClass)) &&
                                      o.GetName().StartsWith("Default__") == false)
                               .OrderBy(o => o.GetPath());
                foreach (dynamic balance in balances)
                {
                    var balanceClass = balance.GetClass();
                    if (balanceClass != inventoryBalanceDefinitionClass &&
                        balanceClass != itemBalanceDefinitionClass &&
                        balanceClass != classModBalanceDefinitionClass)
                    {
                        throw new NotSupportedException();
                    }

                    if (balanceClass == classModBalanceDefinitionClass &&
                        balance.ClassModDefinitions.Length > 0)
                    {
                        IEnumerable <dynamic> classModDefinitions = balance.ClassModDefinitions;
                        items.AddRange(classModDefinitions.Where(cmd => cmd != null));
                    }

                    if (balance.InventoryDefinition != null &&
                        balance.InventoryDefinition.GetClass().Path != "WillowGame.WeaponTypeDefinition")
                    {
                        items.Add(balance.InventoryDefinition);
                    }

                    var partListCollection = balanceClass == classModBalanceDefinitionClass
                                                 ? balance.ItemPartListCollection
                                                 : balance.PartListCollection;
                    if (partListCollection != null)
                    {
                        if (partListCollection.GetClass().Path != "WillowGame.ItemPartListCollectionDefinition")
                        {
                            throw new InvalidOperationException();
                        }

                        if (partListCollection.AssociatedItem != null)
                        {
                            items.Add(partListCollection.AssociatedItem);
                        }
                    }
                }
            }

            var itemPartLists = new List <dynamic>();

            using (var writer = Dataminer.NewDump("Items.json"))
            {
                writer.WriteStartObject();
                foreach (var item in items.Distinct().OrderBy(wp => wp.GetPath()))
                {
                    UnrealClass itemClass = item.GetClass();

                    if (itemClass.Path != "WillowGame.UsableItemDefinition" &&
                        itemClass.Path != "WillowGame.ArtifactDefinition" &&
                        itemClass.Path != "WillowGame.UsableCustomizationItemDefinition" &&
                        itemClass.Path != "WillowGame.ClassModDefinition" &&
                        itemClass.Path != "WillowGame.GrenadeModDefinition" &&
                        itemClass.Path != "WillowGame.ShieldDefinition" &&
                        itemClass.Path != "WillowGame.MissionItemDefinition" &&
                        itemClass.Path != "WillowGame.CrossDLCClassModDefinition")
                    {
                        throw new InvalidOperationException();
                    }

                    writer.WritePropertyName(item.GetPath());
                    writer.WriteStartObject();

                    var itemName = (string)item.ItemName;
                    if (string.IsNullOrEmpty(itemName) == false &&
                        itemName != "None")
                    {
                        writer.WritePropertyName("name");
                        writer.WriteValue(itemName);
                    }
                    else if (itemClass.Path == "WillowGame.UsableCustomizationItemDefinition")
                    {
                        var customizationDef = item.CustomizationDef;
                        if (string.IsNullOrEmpty((string)customizationDef.CustomizationName) == false)
                        {
                            writer.WritePropertyName("name");
                            writer.WriteValue(customizationDef.CustomizationName);
                        }
                    }

                    if ((bool)item.bItemNameIsFullName == true)
                    {
                        writer.WritePropertyName("has_full_name");
                        writer.WriteValue(item.bItemNameIsFullName);
                    }

                    writer.WritePropertyName("type");
                    writer.WriteValue(_ItemTypeMapping[itemClass.Path]);

                    if (item.TitleList != null &&
                        item.TitleList.Length > 0)
                    {
                        writer.WritePropertyName("titles");
                        writer.WriteStartArray();
                        IEnumerable <dynamic> titleList = item.TitleList;
                        foreach (var title in titleList
                                 .Where(tp => tp != null)
                                 .OrderBy(tp => tp.GetPath()))
                        {
                            writer.WriteValue(title.GetPath());
                        }
                        writer.WriteEndArray();
                    }

                    if (item.PrefixList != null &&
                        item.PrefixList.Length > 0)
                    {
                        writer.WritePropertyName("prefixes");
                        writer.WriteStartArray();
                        IEnumerable <dynamic> prefixList = item.PrefixList;
                        foreach (var prefix in prefixList
                                 .Where(pp => pp != null)
                                 .OrderBy(pp => pp.GetPath()))
                        {
                            writer.WriteValue(prefix.GetPath());
                        }
                        writer.WriteEndArray();
                    }

                    WritePartListReference(writer, "alpha_parts", item.AlphaParts, itemPartLists);
                    WritePartListReference(writer, "beta_parts", item.BetaParts, itemPartLists);
                    WritePartListReference(writer, "gamma_parts", item.GammaParts, itemPartLists);
                    WritePartListReference(writer, "delta_parts", item.DeltaParts, itemPartLists);
                    WritePartListReference(writer, "epsilon_parts", item.EpsilonParts, itemPartLists);
                    WritePartListReference(writer, "zeta_parts", item.ZetaParts, itemPartLists);
                    WritePartListReference(writer, "eta_parts", item.EtaParts, itemPartLists);
                    WritePartListReference(writer, "theta_parts", item.ThetaParts, itemPartLists);
                    WritePartListReference(writer, "material_parts", item.MaterialParts, itemPartLists);

                    writer.WriteEndObject();
                }
                writer.WriteEndObject();
            }

            using (var writer = Dataminer.NewDump("Item Part Lists.json"))
            {
                writer.WriteStartObject();
                foreach (var partList in itemPartLists.Distinct().OrderBy(wp => wp.GetPath()))
                {
                    WritePartList(writer, partList.GetPath(), partList);
                }
                writer.WriteEndObject();
            }
        }
Exemplo n.º 6
0
        private static void Go(Engine engine)
        {
            var willowDownloadableContentManagerClass = engine.GetClass("WillowGame.WillowDownloadableContentManager");
            var downloadablePackageDefinitionClass    = engine.GetClass("WillowGame.DownloadablePackageDefinition");

            if (willowDownloadableContentManagerClass == null ||
                downloadablePackageDefinitionClass == null)
            {
                throw new InvalidOperationException();
            }

            using (var writer = Dataminer.NewDump("Downloadable Contents.json"))
            {
                writer.WriteStartObject();

                var willowDownloadableContentManagers = engine.Objects
                                                        .Where(o => o.IsA(willowDownloadableContentManagerClass) &&
                                                               o.GetName().StartsWith("Default__") == false)
                                                        .OrderBy(o => o.GetPath())
                                                        .ToArray();
                if (willowDownloadableContentManagers.Length != 1)
                {
                    throw new InvalidOperationException();
                }

                dynamic willowDownloadableContentManager = willowDownloadableContentManagers.First();
                var     allContent = willowDownloadableContentManager.AllContent;

                foreach (var content in ((IEnumerable <dynamic>)allContent).OrderBy(o => o.GetPath()))
                {
                    writer.WritePropertyName(content.GetPath());
                    writer.WriteStartObject();

                    UnrealClass uclass = content.GetClass();
                    if (uclass.Path != "WillowGame.DownloadableExpansionDefinition" &&
                        uclass.Path != "WillowGame.DownloadableCustomizationSetDefinition" &&
                        uclass.Path != "WillowGame.DownloadableItemSetDefinition" &&
                        uclass.Path != "WillowGame.DownloadableVehicleDefinition" &&
                        uclass.Path != "WillowGame.DownloadableCharacterDefinition" &&
                        uclass.Path != "WillowGame.DownloadableBalanceModifierDefinition")
                    {
                        throw new NotSupportedException();
                    }

                    writer.WritePropertyName("id");
                    writer.WriteValue(content.ContentId);

                    writer.WritePropertyName("name");
                    writer.WriteValue(content.ContentDisplayName);

                    if (content.PackageDef == null)
                    {
                        throw new InvalidOperationException();
                    }

                    writer.WritePropertyName("package");
                    writer.WriteValue(content.PackageDef.GetPath());

                    writer.WritePropertyName("type");
                    writer.WriteValue(_ContentTypeMapping[uclass.Path]);

                    writer.WriteEndObject();
                }

                writer.WriteEndObject();
                writer.Flush();
            }

            using (var writer = Dataminer.NewDump("Downloadable Packages.json"))
            {
                writer.WriteStartObject();

                var downloadablePackageDefinitions = engine.Objects
                                                     .Where(o => o.IsA(downloadablePackageDefinitionClass) &&
                                                            o.GetName().StartsWith("Default__") == false)
                                                     .OrderBy(o => o.GetPath());
                foreach (dynamic downloadablePackageDefinition in downloadablePackageDefinitions)
                {
                    writer.WritePropertyName(downloadablePackageDefinition.GetPath());
                    writer.WriteStartObject();

                    writer.WritePropertyName("id");
                    writer.WriteValue(downloadablePackageDefinition.PackageId);

                    writer.WritePropertyName("dlc_name");
                    writer.WriteValue(downloadablePackageDefinition.DLCName);

                    writer.WritePropertyName("display_name");
                    writer.WriteValue(downloadablePackageDefinition.PackageDisplayName);

                    writer.WriteEndObject();
                }

                writer.WriteEndObject();
                writer.Flush();
            }
        }
        private static void Go(Engine engine)
        {
            var weaponPartDefinitionClass        = engine.GetClass("WillowGame.WeaponPartDefinition");
            var itemPartDefinitionClass          = engine.GetClass("WillowGame.ItemPartDefinition");
            var artifactPartDefinitionClass      = engine.GetClass("WillowGame.ArtifactPartDefinition");
            var classModPartDefinitionClass      = engine.GetClass("WillowGame.ClassModPartDefinition");
            var equipableItemPartDefinitionClass = engine.GetClass("WillowGame.EquipableItemPartDefinition");
            var grenadeModPartDefinitionClass    = engine.GetClass("WillowGame.GrenadeModPartDefinition");
            var missionItemPartDefinitionClass   = engine.GetClass("WillowGame.MissionItemPartDefinition");
            var shieldPartDefinitionClass        = engine.GetClass("WillowGame.ShieldPartDefinition");
            var usableItemPartDefinitionClass    = engine.GetClass("WillowGame.UsableItemPartDefinition");

            if (weaponPartDefinitionClass == null ||
                itemPartDefinitionClass == null ||
                artifactPartDefinitionClass == null ||
                classModPartDefinitionClass == null ||
                equipableItemPartDefinitionClass == null ||
                grenadeModPartDefinitionClass == null ||
                missionItemPartDefinitionClass == null ||
                shieldPartDefinitionClass == null ||
                usableItemPartDefinitionClass == null)
            {
                throw new InvalidOperationException();
            }

            var weaponNamePartDefinitionClass = engine.GetClass("WillowGame.WeaponNamePartDefinition");
            var itemNamePartDefinitionClass   = engine.GetClass("WillowGame.ItemNamePartDefinition");

            if (weaponNamePartDefinitionClass == null ||
                itemNamePartDefinitionClass == null)
            {
                throw new InvalidOperationException();
            }

            var weaponParts = engine.Objects
                              .Where(o => o.IsA(weaponPartDefinitionClass) == true &&
                                     o.GetName().StartsWith("Default__") == false)
                              .Distinct()
                              .OrderBy(o => o.GetPath());

            using (var writer = Dataminer.NewDump("Weapon Parts.json"))
            {
                writer.WriteStartObject();

                foreach (dynamic weaponPart in weaponParts)
                {
                    UnrealClass uclass = weaponPart.GetClass();
                    if (uclass != weaponPartDefinitionClass)
                    {
                        throw new InvalidOperationException();
                    }

                    writer.WritePropertyName(weaponPart.GetPath());
                    writer.WriteStartObject();

                    if (weaponPart.TitleList != null &&
                        weaponPart.TitleList.Length > 0)
                    {
                        writer.WritePropertyName("titles");
                        writer.WriteStartArray();
                        IEnumerable <dynamic> titleList = weaponPart.TitleList;
                        foreach (var title in titleList
                                 .Where(tp => tp != null)
                                 .OrderBy(tp => tp.GetPath()))
                        {
                            writer.WriteValue(title.GetPath());
                        }
                        writer.WriteEndArray();
                    }

                    if (weaponPart.PrefixList != null &&
                        weaponPart.PrefixList.Length > 0)
                    {
                        writer.WritePropertyName("prefixes");
                        writer.WriteStartArray();
                        IEnumerable <dynamic> prefixList = weaponPart.PrefixList;
                        foreach (var prefix in prefixList
                                 .Where(pp => pp != null)
                                 .OrderBy(pp => pp.GetPath()))
                        {
                            writer.WriteValue(prefix.GetPath());
                        }
                        writer.WriteEndArray();
                    }

                    writer.WritePropertyName("type");
                    writer.WriteValue(((WeaponPartType)weaponPart.PartType).ToString());

                    writer.WriteEndObject();
                }

                writer.WriteEndObject();
            }

            var weaponNameParts = engine.Objects
                                  .Where(o => o.IsA(weaponNamePartDefinitionClass) == true &&
                                         o.GetName().StartsWith("Default__") == false)
                                  .Distinct()
                                  .OrderBy(o => o.GetPath());

            using (var writer = Dataminer.NewDump("Weapon Name Parts.json"))
            {
                writer.WriteStartObject();

                foreach (dynamic weaponNamePart in weaponNameParts)
                {
                    UnrealClass uclass = weaponNamePart.GetClass();
                    if (uclass != weaponNamePartDefinitionClass)
                    {
                        throw new InvalidOperationException();
                    }

                    writer.WritePropertyName(weaponNamePart.GetPath());
                    writer.WriteStartObject();

                    if (weaponNamePart.AttributeSlotEffects != null &&
                        weaponNamePart.AttributeSlotEffects.Length > 0)
                    {
                        throw new InvalidOperationException();
                    }

                    if (weaponNamePart.AttributeSlotUpgrades != null &&
                        weaponNamePart.AttributeSlotUpgrades.Length > 0)
                    {
                        throw new InvalidOperationException();
                    }

                    if (weaponNamePart.ExternalAttributeEffects != null &&
                        weaponNamePart.ExternalAttributeEffects.Length > 0)
                    {
                        IEnumerable <dynamic> externalAttributeEffects = weaponNamePart.ExternalAttributeEffects;
                        foreach (var externalAttributeEffect in externalAttributeEffects)
                        {
                            if (externalAttributeEffect.AttributeToModify != null)
                            {
                                var attributeToModifyPath = externalAttributeEffect.AttributeToModify.GetPath();
                                if (attributeToModifyPath != "GD_Shields.Attributes.Attr_LawEquipped" &&
                                    attributeToModifyPath != "GD_Anemone_Shields.Attributes.Attr_PeakEquipped" &&
                                    attributeToModifyPath != "GD_Anemone_Shields.Attributes.Attr_ToothEquipped")
                                {
                                    throw new InvalidOperationException();
                                }
                            }
                        }
                    }

                    if (weaponNamePart.WeaponAttributeEffects != null &&
                        weaponNamePart.WeaponAttributeEffects.Length > 0)
                    {
                        throw new InvalidOperationException();
                    }

                    if (weaponNamePart.ZoomExternalAttributeEffects != null &&
                        weaponNamePart.ZoomExternalAttributeEffects.Length > 0)
                    {
                        throw new InvalidOperationException();
                    }

                    if (weaponNamePart.ZoomWeaponAttributeEffects != null &&
                        weaponNamePart.ZoomWeaponAttributeEffects.Length > 0)
                    {
                        throw new InvalidOperationException();
                    }

                    if (weaponNamePart.WeaponCardAttributes != null &&
                        weaponNamePart.WeaponCardAttributes.Length > 0)
                    {
                        throw new InvalidOperationException();
                    }

                    if (weaponNamePart.CustomPresentations != null &&
                        weaponNamePart.CustomPresentations.Length > 0)
                    {
                        IEnumerable <dynamic> customPresentations = weaponNamePart.CustomPresentations;
                        foreach (var customPresentation in customPresentations)
                        {
                            if (string.IsNullOrEmpty((string)customPresentation.Suffix) == false)
                            {
                                throw new InvalidOperationException();
                            }

                            if (string.IsNullOrEmpty((string)customPresentation.Prefix) == false)
                            {
                                throw new InvalidOperationException();
                            }
                        }
                    }

                    if (weaponNamePart.TitleList != null &&
                        weaponNamePart.TitleList.Length > 0)
                    {
                        throw new InvalidOperationException();
                    }

                    if (weaponNamePart.PrefixList != null &&
                        weaponNamePart.PrefixList.Length > 0)
                    {
                        throw new InvalidOperationException();
                    }

                    var type = (WeaponPartType)weaponNamePart.PartType;
                    if (type != WeaponPartType.Body)
                    {
                        throw new InvalidOperationException();
                    }

                    if ((bool)weaponNamePart.bNameIsUnique != false)
                    {
                        writer.WritePropertyName("unique");
                        writer.WriteValue((bool)weaponNamePart.bNameIsUnique);
                    }

                    string partName = weaponNamePart.PartName;
                    if (string.IsNullOrEmpty(partName) == false)
                    {
                        writer.WritePropertyName("name");
                        writer.WriteValue(partName);
                    }

                    if (weaponNamePart.Expressions != null &&
                        weaponNamePart.Expressions.Length > 0)
                    {
                        /*
                         * writer.WritePropertyName("expressions");
                         * writer.WriteStartArray();
                         *
                         * foreach (var expression in weaponNamePart.Expressions)
                         * {
                         *  writer.WriteStartObject();
                         *
                         *  if (expression.AttributeOperand1 != null)
                         *  {
                         *      writer.WritePropertyName("operand1_attribute");
                         *      writer.WriteValue(expression.AttributeOperand1.GetPath());
                         *  }
                         *
                         *  var comparisonOperator = (ComparisonOperator)expression.ComparisonOperator;
                         *  writer.WritePropertyName("comparison_operator");
                         *  writer.WriteValue(comparisonOperator.ToString());
                         *
                         *  var operand2Usage = (OperandUsage)expression.Operand2Usage;
                         *  writer.WritePropertyName("operand2_usage");
                         *  writer.WriteValue(operand2Usage.ToString());
                         *
                         *  if (expression.AttributeOperand2 != null)
                         *  {
                         *      writer.WritePropertyName("operand2_attribute");
                         *      writer.WriteValue(expression.AttributeOperand2.GetPath());
                         *  }
                         *
                         *  float constantOperand2 = expression.ConstantOperand2;
                         *  if (constantOperand2.Equals(0.0f) == false)
                         *  {
                         *      writer.WritePropertyName("operand2_constant");
                         *      writer.WriteValue(constantOperand2);
                         *  }
                         *
                         *  writer.WriteEndObject();
                         * }
                         *
                         * writer.WriteEndArray();
                         */
                    }

                    if (weaponNamePart.MinExpLevelRequirement != 1)
                    {
                        /*
                         * writer.WritePropertyName("min_exp_level_required");
                         * writer.WriteValue(weaponNamePart.MinExpLevelRequirement);
                         */
                    }

                    if (weaponNamePart.MaxExpLevelRequirement != 100)
                    {
                        /*
                         * writer.WritePropertyName("max_exp_level_required");
                         * writer.WriteValue(weaponNamePart.MaxExpLevelRequirement);
                         */
                    }

                    /*
                     * writer.WritePropertyName("priority");
                     * writer.WriteValue(weaponNamePart.Priority);
                     */

                    writer.WriteEndObject();
                }

                writer.WriteEndObject();
            }

            var itemParts = engine.Objects
                            .Where(o => (o.IsA(itemPartDefinitionClass) == true ||
                                         o.IsA(artifactPartDefinitionClass) == true ||
                                         o.IsA(classModPartDefinitionClass) == true ||
                                         o.IsA(equipableItemPartDefinitionClass) == true ||
                                         o.IsA(grenadeModPartDefinitionClass) == true ||
                                         o.IsA(missionItemPartDefinitionClass) == true ||
                                         o.IsA(shieldPartDefinitionClass) == true ||
                                         o.IsA(usableItemPartDefinitionClass) == true) &&
                                   o.GetName().StartsWith("Default__") == false)
                            .Distinct()
                            .OrderBy(o => o.GetPath());

            using (var writer = Dataminer.NewDump("Item Parts.json"))
            {
                writer.WriteStartObject();

                foreach (dynamic itemPart in itemParts)
                {
                    UnrealClass uclass = itemPart.GetClass();
                    if (uclass != artifactPartDefinitionClass &&
                        uclass != classModPartDefinitionClass &&
                        uclass != grenadeModPartDefinitionClass &&
                        uclass != shieldPartDefinitionClass &&
                        uclass != usableItemPartDefinitionClass)
                    {
                        throw new InvalidOperationException();
                    }

                    writer.WritePropertyName(itemPart.GetPath());
                    writer.WriteStartObject();

                    writer.WritePropertyName("type");
                    writer.WriteValue(((ItemPartType)itemPart.PartType).ToString());

                    if (itemPart.TitleList != null &&
                        itemPart.TitleList.Length > 0)
                    {
                        writer.WritePropertyName("titles");
                        writer.WriteStartArray();
                        IEnumerable <dynamic> titleList = itemPart.TitleList;
                        foreach (var title in titleList
                                 .Where(tp => tp != null)
                                 .OrderBy(tp => tp.GetPath()))
                        {
                            writer.WriteValue(title.GetPath());
                        }
                        writer.WriteEndArray();
                    }

                    if (itemPart.PrefixList != null &&
                        itemPart.PrefixList.Length > 0)
                    {
                        writer.WritePropertyName("prefixes");
                        writer.WriteStartArray();
                        IEnumerable <dynamic> prefixList = itemPart.PrefixList;
                        foreach (var prefix in prefixList
                                 .Where(pp => pp != null)
                                 .OrderBy(pp => pp.GetPath()))
                        {
                            writer.WriteValue(prefix.GetPath());
                        }
                        writer.WriteEndArray();
                    }

                    writer.WriteEndObject();
                }

                writer.WriteEndObject();
            }

            var itemNameParts = engine.Objects
                                .Where(o => o.IsA(itemNamePartDefinitionClass) == true &&
                                       o.GetName().StartsWith("Default__") == false)
                                .Distinct()
                                .OrderBy(o => o.GetPath());

            using (var writer = Dataminer.NewDump("Item Name Parts.json"))
            {
                writer.WriteStartObject();

                foreach (dynamic itemNamePart in itemNameParts)
                {
                    UnrealClass uclass = itemNamePart.GetClass();
                    if (uclass != itemNamePartDefinitionClass)
                    {
                        throw new InvalidOperationException();
                    }

                    writer.WritePropertyName(itemNamePart.GetPath());
                    writer.WriteStartObject();

                    if (itemNamePart.AttributeSlotEffects != null &&
                        itemNamePart.AttributeSlotEffects.Length > 0)
                    {
                        throw new InvalidOperationException();
                    }

                    if (itemNamePart.AttributeSlotUpgrades != null &&
                        itemNamePart.AttributeSlotUpgrades.Length > 0)
                    {
                        throw new InvalidOperationException();
                    }

                    if (itemNamePart.ExternalAttributeEffects != null &&
                        itemNamePart.ExternalAttributeEffects.Length > 0)
                    {
                        IEnumerable <dynamic> externalAttributeEffects = itemNamePart.ExternalAttributeEffects;
                        foreach (var externalAttributeEffect in externalAttributeEffects)
                        {
                            if (externalAttributeEffect.AttributeToModify != null &&
                                externalAttributeEffect.AttributeToModify.GetPath() !=
                                "GD_Shields.Attributes.Attr_LawEquipped")
                            {
                                throw new InvalidOperationException();
                            }
                        }
                    }

                    if (itemNamePart.ItemAttributeEffects != null &&
                        itemNamePart.ItemAttributeEffects.Length > 0)
                    {
                        throw new InvalidOperationException();
                    }

                    if (itemNamePart.ItemCardAttributes != null &&
                        itemNamePart.ItemCardAttributes.Length > 0)
                    {
                        throw new InvalidOperationException();
                    }

                    if (itemNamePart.CustomPresentations != null &&
                        itemNamePart.CustomPresentations.Length > 0)
                    {
                        IEnumerable <dynamic> customPresentations = itemNamePart.CustomPresentations;
                        foreach (var customPresentation in customPresentations)
                        {
                            if (string.IsNullOrEmpty((string)customPresentation.Suffix) == false)
                            {
                                throw new InvalidOperationException();
                            }

                            if (string.IsNullOrEmpty((string)customPresentation.Prefix) == false)
                            {
                                throw new InvalidOperationException();
                            }
                        }
                    }

                    if (itemNamePart.TitleList != null &&
                        itemNamePart.TitleList.Length > 0)
                    {
                        throw new InvalidOperationException();
                    }

                    if (itemNamePart.PrefixList != null &&
                        itemNamePart.PrefixList.Length > 0)
                    {
                        throw new InvalidOperationException();
                    }

                    var type = (ItemPartType)itemNamePart.PartType;
                    if (type != ItemPartType.Alpha)
                    {
                        throw new InvalidOperationException();
                    }

                    if ((bool)itemNamePart.bNameIsUnique != false)
                    {
                        writer.WritePropertyName("unique");
                        writer.WriteValue((bool)itemNamePart.bNameIsUnique);
                    }

                    string partName = itemNamePart.PartName;
                    if (string.IsNullOrEmpty(partName) == false)
                    {
                        writer.WritePropertyName("name");
                        writer.WriteValue(partName);
                    }

                    if (itemNamePart.Expressions != null &&
                        itemNamePart.Expressions.Length > 0)
                    {
                        /*
                         * writer.WritePropertyName("expressions");
                         * writer.WriteStartArray();
                         *
                         * foreach (var expression in itemNamePart.Expressions)
                         * {
                         *  writer.WriteStartObject();
                         *
                         *  if (expression.AttributeOperand1 != null)
                         *  {
                         *      writer.WritePropertyName("operand1_attribute");
                         *      writer.WriteValue(expression.AttributeOperand1.GetPath());
                         *  }
                         *
                         *  var comparisonOperator = (ComparisonOperator)expression.ComparisonOperator;
                         *  writer.WritePropertyName("comparison_operator");
                         *  writer.WriteValue(comparisonOperator.ToString());
                         *
                         *  var operand2Usage = (OperandUsage)expression.Operand2Usage;
                         *  writer.WritePropertyName("operand2_usage");
                         *  writer.WriteValue(operand2Usage.ToString());
                         *
                         *  if (expression.AttributeOperand2 != null)
                         *  {
                         *      writer.WritePropertyName("operand2_attribute");
                         *      writer.WriteValue(expression.AttributeOperand2.GetPath());
                         *  }
                         *
                         *  float constantOperand2 = expression.ConstantOperand2;
                         *  if (constantOperand2.Equals(0.0f) == false)
                         *  {
                         *      writer.WritePropertyName("operand2_constant");
                         *      writer.WriteValue(constantOperand2);
                         *  }
                         *
                         *  writer.WriteEndObject();
                         * }
                         *
                         * writer.WriteEndArray();
                         */
                    }

                    if (itemNamePart.MinExpLevelRequirement != 1)
                    {
                        /*
                         * writer.WritePropertyName("min_exp_level_required");
                         * writer.WriteValue(itemNamePart.MinExpLevelRequirement);
                         */
                    }

                    if (itemNamePart.MaxExpLevelRequirement != 100)
                    {
                        /*
                         * writer.WritePropertyName("max_exp_level_required");
                         * writer.WriteValue(itemNamePart.MaxExpLevelRequirement);
                         */
                    }

                    /*
                     * writer.WritePropertyName("priority");
                     * writer.WriteValue(itemNamePart.Priority);
                     */

                    writer.WriteEndObject();
                }

                writer.WriteEndObject();
            }
        }
        private static void Go(Engine engine)
        {
            var customizationDefinitionClass = engine.GetClass("WillowGame.CustomizationDefinition");

            if (customizationDefinitionClass == null)
            {
                throw new InvalidOperationException();
            }

            using (var writer = Dataminer.NewDump("Customizations.json"))
            {
                writer.WriteStartObject();

                var customizationDefinitions = engine.Objects
                                               .Where(o => o.IsA(customizationDefinitionClass) &&
                                                      o.GetName().StartsWith("Default__") ==
                                                      false)
                                               .OrderBy(o => o.GetPath());
                foreach (dynamic customizationDefinition in customizationDefinitions)
                {
                    writer.WritePropertyName(customizationDefinition.GetPath());
                    writer.WriteStartObject();

                    string customizationName = customizationDefinition.CustomizationName;
                    if (customizationName == null)
                    {
                        throw new InvalidOperationException();
                    }

                    writer.WritePropertyName("name");
                    writer.WriteValue(customizationName);

                    UnrealClass customizationType = customizationDefinition.CustomizationType;
                    if (customizationType == null)
                    {
                        throw new InvalidOperationException();
                    }

                    if (_TypeMapping.ContainsKey(customizationType.Path) == false)
                    {
                        throw new NotSupportedException();
                    }

                    writer.WritePropertyName("type");
                    writer.WriteValue(_TypeMapping[customizationType.Path]);

                    var usageFlags = ((IEnumerable <UnrealClass>)customizationDefinition.UsageFlags).ToArray();

                    if (usageFlags.Length > 0)
                    {
                        writer.WritePropertyName("usage");
                        writer.WriteStartArray();
                        foreach (var usageFlag in usageFlags.OrderBy(uf => uf.Path))
                        {
                            if (_UsageFlagMapping.ContainsKey(usageFlag.Path) == false)
                            {
                                throw new NotSupportedException();
                            }

                            writer.WriteValue(_UsageFlagMapping[usageFlag.Path]);
                        }
                        writer.WriteEndArray();
                    }

                    var otherUsageFlags = customizationDefinition.OtherUsageFlags;
                    if (otherUsageFlags.Length > 0)
                    {
                        throw new NotSupportedException();
                    }

                    var dlcCustomizationSet = customizationDefinition.DlcCustomizationSetDef;
                    if (dlcCustomizationSet != null)
                    {
                        writer.WritePropertyName("dlc");
                        writer.WriteValue(dlcCustomizationSet.GetPath());
                    }

                    writer.WriteEndObject();
                }

                writer.WriteEndObject();

                writer.Flush();
            }
        }
Exemplo n.º 9
0
        private static void Go(Engine engine)
        {
            var globalsClass = engine.GetClass("WillowGame.WillowGlobals");

            if (globalsClass == null)
            {
                throw new InvalidOperationException();
            }

            dynamic globals = engine.Objects.FirstOrDefault(
                o => o.IsA(globalsClass) &&
                o.GetName().StartsWith("Default__") == false);

            if (globals == null)
            {
                throw new InvalidOperationException();
            }

            dynamic assLibMan = globals.AssLibMan;

            if (assLibMan == null)
            {
                throw new InvalidOperationException();
            }

            using (var writer = Dataminer.NewDump("Asset Library Manager.json"))
            {
                writer.WriteStartObject();

                writer.WritePropertyName("version");
                writer.WriteValue(7);

                writer.WritePropertyName("configs");
                writer.WriteStartObject();
                foreach (dynamic libraryConfig in assLibMan.LibraryConfigs)
                {
                    writer.WritePropertyName(((string)libraryConfig.Desc).Replace(" ", ""));
                    writer.WriteStartObject();

                    writer.WritePropertyName("sublibrary_bits");
                    writer.WriteValue(libraryConfig.SublibraryBits);

                    writer.WritePropertyName("asset_bits");
                    writer.WriteValue(libraryConfig.AssetBits);

                    writer.WritePropertyName("type");
                    writer.WriteValue(((UnrealClass)libraryConfig.LibraryType).Path);

                    writer.WriteEndObject();
                }
                writer.WriteEndObject();

                writer.WritePropertyName("sets");
                writer.WriteStartArray();
                foreach (dynamic assetLibrarySet in ((IEnumerable <dynamic>)assLibMan.RuntimeAssetLibraries)
                         .OrderBy(ral => ral.Id))
                {
                    writer.WriteStartObject();

                    writer.WritePropertyName("id");
                    writer.WriteValue(assetLibrarySet.Id);

                    writer.WritePropertyName("libraries");
                    writer.WriteStartObject();

                    int libraryIndex = 0;
                    foreach (dynamic library in assetLibrarySet.Libraries)
                    {
                        if (library == null)
                        {
                            libraryIndex++;
                            continue;
                        }

                        string desc = assLibMan.LibraryConfigs[libraryIndex].Desc;

                        writer.WritePropertyName(desc.Replace(" ", ""));
                        writer.WriteStartObject();

                        if (library.LibraryType != null)
                        {
                            writer.WritePropertyName("type");
                            writer.WriteValue(((UnrealClass)library.LibraryType).Path);
                        }

                        writer.WritePropertyName("sublibraries");
                        writer.WriteStartArray();

                        /*
                         * if (library.Sublibraries.Length != library.SublibraryLinks.Length)
                         * {
                         *  throw new InvalidOperationException();
                         * }
                         */

                        var sublibraryCount = (int)library.Sublibraries.Length;
                        for (int sublibraryIndex = 0; sublibraryIndex < sublibraryCount; sublibraryIndex++)
                        {
                            var     sublibraryPath = (string)library.Sublibraries[sublibraryIndex];
                            dynamic sublibrary     = sublibraryIndex < library.SublibraryLinks.Length
                                ? library.SublibraryLinks[sublibraryIndex]
                                : engine.GetObject(sublibraryPath);

                            writer.WriteStartObject();

                            writer.WritePropertyName("description");
                            writer.WriteValue(sublibraryPath);

                            if (sublibrary != null)
                            {
                                var cachedPackageName = (string)sublibrary.CachedPackageName;
                                if (cachedPackageName != "None")
                                {
                                    writer.WritePropertyName("package");
                                    writer.WriteValue(cachedPackageName);
                                }

                                if (_Blacklist.Contains(sublibraryPath) == false)
                                {
                                    writer.WritePropertyName("assets");
                                    writer.WriteStartArray();

                                    var assets = sublibrary.Assets;
                                    if (assets.Length != 0)
                                    {
                                        throw new NotSupportedException();
                                    }

                                    var assetPaths = sublibrary.AssetPaths;
                                    foreach (var assetPath in assetPaths)
                                    {
                                        var parts = new List <string>();
                                        foreach (var pathComponentName in ((IEnumerable <string>)assetPath.PathComponentNames)
                                                 .Reverse())
                                        {
                                            if (pathComponentName == "None")
                                            {
                                                break;
                                            }

                                            parts.Add(pathComponentName);
                                        }

                                        parts.Reverse();
                                        var path = string.Join(".", parts.ToArray());

                                        writer.WriteValue(path);
                                    }

                                    writer.WriteEndArray();
                                }
                            }

                            writer.WriteEndObject();
                        }

                        writer.WriteEndArray();
                        writer.WriteEndObject();

                        libraryIndex++;
                    }

                    writer.WriteEndObject();
                    writer.WriteEndObject();
                }
                writer.WriteEndArray();

                writer.WriteEndObject();
            }
        }
        private static void Go(Engine engine)
        {
            var developerPerksDefinitionClass = engine.GetClass("WillowGame.DeveloperPerksDefinition");

            if (developerPerksDefinitionClass == null)
            {
                throw new InvalidOperationException();
            }

            dynamic developerPerks = engine.Objects
                                     .FirstOrDefault(o => o.IsA(developerPerksDefinitionClass) &&
                                                     o.GetName().StartsWith("Default__") == false);

            if (developerPerks == null)
            {
                throw new InvalidOperationException();
            }

            using (var writer = Dataminer.NewDump("Developer Perks.json"))
            {
                writer.WriteStartObject();

                writer.WritePropertyName("developers");
                writer.WriteStartArray();
                foreach (var developerInfo in developerPerks.DeveloperInfo)
                {
                    writer.WriteStartObject();

                    writer.WritePropertyName("gamertag");
                    writer.WriteValue(developerInfo.Gamertag);

                    writer.WritePropertyName("unique_id");
                    writer.WriteValue(developerInfo.UniqueId);

                    writer.WritePropertyName("platform");
                    writer.WriteValue(((DeveloperPerksPlatforms)developerInfo.Platform).ToString());

                    if (developerInfo.UnlocksGamerpics != null &&
                        developerInfo.UnlocksGamerpics.Length > 0)
                    {
                        writer.WritePropertyName("unlock_gamerpics");
                        writer.WriteStartArray();
                        foreach (var b in developerInfo.UnlocksGamerpics)
                        {
                            writer.WriteValue((byte)b);
                        }
                        writer.WriteEnd();
                    }

                    writer.WritePropertyName("eligible_for_gearbox_customizations");
                    writer.WriteValue(developerInfo.bEligibleForGearboxCustomizations);

                    writer.WriteEndObject();
                }
                writer.WriteEndArray();

                writer.WritePropertyName("perks");
                writer.WriteStartArray();
                foreach (var perkInfo in developerPerks.PerkInfo)
                {
                    writer.WriteStartObject();

                    writer.WritePropertyName("button_chain");
                    writer.WriteStartArray();
                    foreach (var button in perkInfo.ButtonChain)
                    {
                        writer.WriteValue(button);
                    }
                    writer.WriteEndArray();

                    writer.WritePropertyName("command");
                    writer.WriteValue(perkInfo.Command);

                    writer.WritePropertyName("must_be_developer");
                    writer.WriteValue(perkInfo.bMustBeDeveloper);

                    writer.WriteEndObject();
                }
                writer.WriteEndArray();

                writer.WritePropertyName("developer_customization_unlocks");
                writer.WriteStartArray();
                foreach (var developerCustomizationUnlock in developerPerks.DeveloperCustomizationUnlocks)
                {
                    if (developerCustomizationUnlock != null)
                    {
                        writer.WriteValue(developerCustomizationUnlock.GetPath());
                    }
                }
                writer.WriteEndArray();

                writer.WriteEndObject();
                writer.Flush();
            }
        }
        private static void Go(Engine engine)
        {
            var inventoryBalanceClass     = engine.GetClass("WillowGame.InventoryBalanceDefinition");
            var weaponBalanceClass        = engine.GetClass("WillowGame.WeaponBalanceDefinition");
            var missionWeaponBalanceClass = engine.GetClass("WillowGame.MissionWeaponBalanceDefinition");
            var itemBalanceClass          = engine.GetClass("WillowGame.ItemBalanceDefinition");
            var classModBalanceClass      = engine.GetClass("WillowGame.ClassModBalanceDefinition");

            if (inventoryBalanceClass == null ||
                weaponBalanceClass == null ||
                missionWeaponBalanceClass == null ||
                itemBalanceClass == null ||
                classModBalanceClass == null)
            {
                throw new InvalidOperationException();
            }

            var weaponBalancePartLists = new List <KeyValuePair <string, dynamic> >();

            using (var writer = Dataminer.NewDump("Weapon Balance.json"))
            {
                writer.WriteStartObject();
                var balances = engine.Objects
                               .Where(o => o.IsA(weaponBalanceClass) &&
                                      o.GetName().StartsWith("Default__") == false)
                               .OrderBy(o => o.GetPath());
                foreach (dynamic balance in balances)
                {
                    var balancePath = (string)balance.GetPath();

                    writer.WritePropertyName(balancePath);
                    writer.WriteStartObject();

                    var baseBalance = balance.BaseDefinition;
                    if (baseBalance != null)
                    {
                        writer.WritePropertyName("base");
                        writer.WriteValue(baseBalance.GetPath());
                    }

                    var typePath     = (string)balance.InventoryDefinition?.GetPath();
                    var baseTypePath = (string)balance.BaseDefinition?.InventoryDefinition?.GetPath();
                    if (typePath != null && (baseTypePath == null || typePath != baseTypePath))
                    {
                        writer.WritePropertyName("weapon_type");
                        writer.WriteValue(typePath);
                    }

                    var manufacturers = balance.Manufacturers;
                    if (manufacturers != null && manufacturers.Length > 0)
                    {
                        writer.WritePropertyName("manufacturers");
                        writer.WriteStartArray();
                        foreach (var manufacturer in ((IEnumerable <dynamic>)manufacturers)
                                 .Where(imbd => imbd.Manufacturer != null)
                                 .OrderBy(imbd => imbd.Manufacturer.GetPath()))
                        {
                            writer.WriteValue(manufacturer.Manufacturer.GetPath());
                        }
                        writer.WriteEndArray();
                    }

                    if (balance.PartListCollection != null)
                    {
                        throw new NotSupportedException();
                    }

                    var weaponPartList = balance.WeaponPartListCollection;
                    if (weaponPartList == null)
                    {
                        throw new InvalidOperationException();
                    }

                    var runtimePartList = balance.RuntimePartListCollection;
                    if (runtimePartList == null)
                    {
                        throw new InvalidOperationException();
                    }

                    var weaponPartListPath = (string)weaponPartList.GetPath();
                    weaponBalancePartLists.Add(new KeyValuePair <string, dynamic>(weaponPartListPath, balance));

                    writer.WritePropertyName("parts");
                    writer.WriteValue(weaponPartListPath);

                    writer.WriteEndObject();
                }
                writer.WriteEndObject();
            }

            using (var writer = Dataminer.NewDump("Weapon Balance Part Lists.json"))
            {
                writer.WriteStartObject();
                foreach (var kv in weaponBalancePartLists)
                {
                    var partListPath = kv.Key;
                    var balance      = kv.Value;

                    var partList     = balance.RuntimePartListCollection;
                    var baseBalance  = balance.BaseDefinition;
                    var basePartList = baseBalance == null ? null : baseBalance.RuntimePartListCollection;

                    PartReplacementMode?mode = null;
                    var bodyPartData         = BuildPartList(partList.BodyPartData, basePartList?.BodyPartData, ref mode);
                    var gripPartData         = BuildPartList(partList.GripPartData, basePartList?.GripPartData, ref mode);
                    var barrelPartData       = BuildPartList(partList.BarrelPartData, basePartList?.BarrelPartData, ref mode);
                    var sightPartData        = BuildPartList(partList.SightPartData, basePartList?.SightPartData, ref mode);
                    var stockPartData        = BuildPartList(partList.StockPartData, basePartList?.StockPartData, ref mode);
                    var elementalPartData    = BuildPartList(partList.ElementalPartData, basePartList?.ElementalPartData, ref mode);
                    var accessory1PartData   = BuildPartList(partList.Accessory1PartData, basePartList?.Accessory1PartData, ref mode);
                    var accessory2PartData   = BuildPartList(partList.Accessory2PartData, basePartList?.Accessory2PartData, ref mode);
                    var materialPartData     = BuildPartList(partList.MaterialPartData, basePartList?.MaterialPartData, ref mode);

                    if (mode == null)
                    {
                        throw new InvalidOperationException();
                    }

                    writer.WritePropertyName(partListPath);
                    writer.WriteStartObject();

                    writer.WritePropertyName("mode");
                    writer.WriteValue(mode.ToString());

                    var associatedWeaponTypePath     = (string)partList.AssociatedWeaponType?.GetPath();
                    var baseAssociatedWeaponTypePath = (string)basePartList?.AssociatedWeaponType?.GetPath();
                    if (associatedWeaponTypePath != null &&
                        (baseAssociatedWeaponTypePath == null || associatedWeaponTypePath != baseAssociatedWeaponTypePath))
                    {
                        writer.WritePropertyName("weapon_type");
                        writer.WriteValue(associatedWeaponTypePath);
                    }

                    WriteStrings(writer, "body", bodyPartData);
                    WriteStrings(writer, "grip", gripPartData);
                    WriteStrings(writer, "barrel", barrelPartData);
                    WriteStrings(writer, "sight", sightPartData);
                    WriteStrings(writer, "stock", stockPartData);
                    WriteStrings(writer, "elemental", elementalPartData);
                    WriteStrings(writer, "accessory1", accessory1PartData);
                    WriteStrings(writer, "accessory2", accessory2PartData);
                    WriteStrings(writer, "material", materialPartData);

                    writer.WriteEndObject();
                }
                writer.WriteEndObject();
            }

            var itemBalancePartLists = new List <KeyValuePair <string, dynamic> >();

            using (var writer = Dataminer.NewDump("Item Balance.json"))
            {
                writer.WriteStartObject();
                var balances = engine.Objects
                               .Where(o => (o.IsA(inventoryBalanceClass) == true ||
                                            o.IsA(itemBalanceClass) == true ||
                                            o.IsA(classModBalanceClass) == true) &&
                                      o.GetName().StartsWith("Default__") == false)
                               .OrderBy(o => o.GetPath());
                foreach (dynamic balance in balances)
                {
                    var balanceClass = balance.GetClass();
                    if (balanceClass != inventoryBalanceClass &&
                        balanceClass != itemBalanceClass &&
                        balanceClass != classModBalanceClass)
                    {
                        throw new NotSupportedException();
                    }

                    var balancePath = (string)balance.GetPath();

                    writer.WritePropertyName(balancePath);
                    writer.WriteStartObject();

                    var baseBalance = balance.BaseDefinition;
                    if (baseBalance != null)
                    {
                        writer.WritePropertyName("base");
                        writer.WriteValue(baseBalance.GetPath());
                    }

                    var itemPath     = (string)balance.InventoryDefinition?.GetPath();
                    var baseItemPath = (string)balance.BaseDefinition?.InventoryDefinition?.GetPath();
                    if (itemPath != null && (baseItemPath == null || itemPath != baseItemPath))
                    {
                        writer.WritePropertyName("item");
                        writer.WriteValue(itemPath);
                    }

                    if (balanceClass == classModBalanceClass &&
                        balance.ClassModDefinitions.Length > 0)
                    {
                        dynamic[] classMods = balance.ClassModDefinitions;
                        writer.WritePropertyName("items");
                        writer.WriteStartArray();
                        foreach (var classMod in classMods.OrderBy(cmd => cmd.GetPath()))
                        {
                            writer.WriteValue(classMod.GetPath());
                        }
                        writer.WriteEndArray();
                    }

                    var manufacturers = balance.Manufacturers;
                    if (manufacturers != null &&
                        manufacturers.Length > 0)
                    {
                        writer.WritePropertyName("manufacturers");
                        writer.WriteStartArray();
                        foreach (var manufacturer in ((IEnumerable <dynamic>)manufacturers)
                                 .Where(imbd => imbd.Manufacturer != null)
                                 .OrderBy(imbd => imbd.Manufacturer.GetPath()))
                        {
                            writer.WriteValue(manufacturer.Manufacturer.GetPath());
                        }
                        writer.WriteEndArray();
                    }

                    dynamic itemPartList;
                    string  itemPartListPath = null;
                    if (balanceClass == inventoryBalanceClass)
                    {
                        itemPartList = balance.PartListCollection;
                        if (itemPartList != null)
                        {
                            itemPartListPath = (string)itemPartList.GetPath();
                        }
                    }
                    else
                    {
                        if (balance.PartListCollection != null)
                        {
                            throw new InvalidOperationException();
                        }

                        if (balance.ItemPartListCollection == null)
                        {
                            throw new InvalidOperationException();
                        }

                        itemPartList = balance.RuntimePartListCollection;
                        if (itemPartList == null)
                        {
                            throw new InvalidOperationException();
                        }

                        itemPartListPath = (string)balance.ItemPartListCollection.GetPath();
                    }

                    if (itemPartList != null)
                    {
                        itemBalancePartLists.Add(new KeyValuePair <string, dynamic>(itemPartListPath, balance));
                        writer.WritePropertyName("parts");
                        writer.WriteValue(itemPartListPath);
                    }

                    writer.WriteEndObject();
                }
                writer.WriteEndObject();
            }

            using (var writer = Dataminer.NewDump("Item Balance Part Lists.json"))
            {
                writer.WriteStartObject();
                foreach (var kv in itemBalancePartLists)
                {
                    var partListPath = kv.Key;
                    var balance      = kv.Value;
                    var balanceClass = balance.GetClass();
                    var baseBalance  = balance.BaseDefinition;

                    PartReplacementMode?mode;
                    dynamic             partList;
                    if (balanceClass == inventoryBalanceClass)
                    {
                        partList = balance.PartListCollection;
                        if (partList == null)
                        {
                            throw new InvalidOperationException();
                        }
                        mode = (PartReplacementMode)partList.PartReplacementMode;
                    }
                    else
                    {
                        if (balance.PartListCollection != null)
                        {
                            throw new InvalidOperationException();
                        }

                        if (balance.ItemPartListCollection == null)
                        {
                            throw new InvalidOperationException();
                        }

                        partList = balance.RuntimePartListCollection;
                        if (partList == null)
                        {
                            throw new InvalidOperationException();
                        }
                        mode = (PartReplacementMode)partList.PartReplacementMode;
                    }

                    if (partList.GetClass().Path != "WillowGame.ItemPartListCollectionDefinition")
                    {
                        throw new InvalidOperationException();
                    }

                    var basePartList = baseBalance == null ||
                                       baseBalance.GetClass() == inventoryBalanceClass
                        ? null : baseBalance.RuntimePartListCollection;

                    List <string>
                    alphaPartData, betaPartData, gammaPartData, deltaPartData, epsilonPartData,
                        zetaPartData, etaPartData, thetaPartData, materialPartData;
                    if (basePartList == null)
                    {
                        var associatedItem = partList.AssociatedItem;
                        alphaPartData    = BuildPartList(partList.AlphaPartData, associatedItem?.AlphaParts, ref mode);
                        betaPartData     = BuildPartList(partList.BetaPartData, associatedItem?.BetaParts, ref mode);
                        gammaPartData    = BuildPartList(partList.GammaPartData, associatedItem?.GammaParts, ref mode);
                        deltaPartData    = BuildPartList(partList.DeltaPartData, associatedItem?.DeltaParts, ref mode);
                        epsilonPartData  = BuildPartList(partList.EpsilonPartData, associatedItem?.EpsilonParts, ref mode);
                        zetaPartData     = BuildPartList(partList.ZetaPartData, associatedItem?.ZetaParts, ref mode);
                        etaPartData      = BuildPartList(partList.EtaPartData, associatedItem?.EtaParts, ref mode);
                        thetaPartData    = BuildPartList(partList.ThetaPartData, associatedItem?.ThetaParts, ref mode);
                        materialPartData = BuildPartList(partList.MaterialPartData, associatedItem?.MaterialParts, ref mode);
                    }
                    else
                    {
                        alphaPartData    = BuildPartList(partList.AlphaPartData, basePartList?.AlphaPartData, ref mode);
                        betaPartData     = BuildPartList(partList.BetaPartData, basePartList?.BetaPartData, ref mode);
                        gammaPartData    = BuildPartList(partList.GammaPartData, basePartList?.GammaPartData, ref mode);
                        deltaPartData    = BuildPartList(partList.DeltaPartData, basePartList?.DeltaPartData, ref mode);
                        epsilonPartData  = BuildPartList(partList.EpsilonPartData, basePartList?.EpsilonPartData, ref mode);
                        zetaPartData     = BuildPartList(partList.ZetaPartData, basePartList?.ZetaPartData, ref mode);
                        etaPartData      = BuildPartList(partList.EtaPartData, basePartList?.EtaPartData, ref mode);
                        thetaPartData    = BuildPartList(partList.ThetaPartData, basePartList?.ThetaPartData, ref mode);
                        materialPartData = BuildPartList(partList.MaterialPartData, basePartList?.MaterialPartData, ref mode);
                    }

                    if (mode == null)
                    {
                        mode = PartReplacementMode.Additive;
                    }

                    writer.WritePropertyName(partListPath);
                    writer.WriteStartObject();

                    writer.WritePropertyName("mode");
                    writer.WriteValue(mode.ToString());

                    var associatedItemPath     = (string)partList.AssociatedItem?.GetPath();
                    var baseAssociatedItemPath = (string)basePartList?.AssociatedItem?.GetPath();
                    if (associatedItemPath != null &&
                        (baseAssociatedItemPath == null || associatedItemPath != baseAssociatedItemPath))
                    {
                        writer.WritePropertyName("item");
                        writer.WriteValue(associatedItemPath);
                    }

                    WriteStrings(writer, "alpha", alphaPartData);
                    WriteStrings(writer, "beta", betaPartData);
                    WriteStrings(writer, "gamma", gammaPartData);
                    WriteStrings(writer, "delta", deltaPartData);
                    WriteStrings(writer, "epsilon", epsilonPartData);
                    WriteStrings(writer, "zeta", zetaPartData);
                    WriteStrings(writer, "eta", etaPartData);
                    WriteStrings(writer, "theta", thetaPartData);
                    WriteStrings(writer, "material", materialPartData);

                    writer.WriteEndObject();
                }
                writer.WriteEndObject();
            }
        }