public override IEnumerable <string> AfterUpdate(ModData modData)
        {
            if (locations.Any())
            {
                yield return("WithSiloAnimation has been replaced by WithResourceLevelSpriteBody.\n" +
                             "You may need to disable/remove any previous (including inherited) *SpriteBody traits\n" +
                             "on the following actors:\n" +
                             UpdateUtils.FormatMessageList(locations));
            }

            locations.Clear();
        }
示例#2
0
        public override IEnumerable <string> AfterUpdate(ModData modData)
        {
            if (locations.Any())
            {
                yield return("Review the following definitions and, for those that are buildings,\n" +
                             "define conditions to disable them while WithMakeAnimation is active:\n" +
                             UpdateUtils.FormatMessageList(locations.Select(
                                                               kv => kv.Key + ":\n" + UpdateUtils.FormatMessageList(kv.Value))));
            }

            locations.Clear();
        }
示例#3
0
        public override IEnumerable <string> AfterUpdate(ModData modData)
        {
            if (locations.Any())
            {
                yield return("Review the following definitions and, if the actor is Demolishable,\n" +
                             "define Demolishable.Condition and use this condition to disable them:\n" +
                             UpdateUtils.FormatMessageList(locations.Select(
                                                               kv => kv.Key + ":\n" + UpdateUtils.FormatMessageList(kv.Value))));
            }

            locations.Clear();
        }
        public override IEnumerable <string> AfterUpdate(ModData modData)
        {
            if (locations.Any())
            {
                yield return("The following definitions implement WithMoveAnimation\n" +
                             "or GrantConditionOnMovement. Check if they need updated ValidMovementTypes:\n" +
                             UpdateUtils.FormatMessageList(locations.Select(
                                                               kv => kv.Key + ":\n" + UpdateUtils.FormatMessageList(kv.Value))));
            }

            locations.Clear();
        }
        public override IEnumerable <string> AfterUpdate(ModData modData)
        {
            if (locations.Any())
            {
                yield return("Some actor(s) defined a MinDamage of neither 'Heavy' nor 'Undamaged' on SmokeTrailWhenDamaged before update.\n" +
                             "Review the following definitions and add custom GrandConditionOnDamageState configs as required:\n" +
                             UpdateUtils.FormatMessageList(locations.Select(
                                                               kv => kv.Key + ":\n" + UpdateUtils.FormatMessageList(kv.Value))));
            }

            locations.Clear();
        }
示例#6
0
        public override IEnumerable <string> AfterUpdate(ModData modData)
        {
            if (locations.Any())
            {
                yield return("[D2k]ResourceRenderer has been added.\n" +
                             "You need to adjust the the field RenderTypes on trait [D2k]ResourceRenderer\n" +
                             "on the following actors:\n" +
                             UpdateUtils.FormatMessageList(locations));
            }

            locations.Clear();
        }
        public override IEnumerable <string> AfterUpdate(ModData modData)
        {
            if (locations.Any())
            {
                yield return("The automatic exclusion of harvesters from AI squads has been removed.\n" +
                             "You may wish to add your harvester-type actors to `ExcludeFromSquads` under `UnitCommonNames`\n" +
                             "on the following definitions:\n" +
                             UpdateUtils.FormatMessageList(locations));
            }

            locations.Clear();
        }
        public override IEnumerable <string> AfterUpdate(ModData modData)
        {
            if (locations.Any())
            {
                yield return("The IgnoresVisibility flag has been removed from the targeting logic on the following actors:\n" +
                             UpdateUtils.FormatMessageList(locations) + "\n\n" +
                             "You may wish to enable TargetFrozenActors, or implement a custom Attack* trait like AttackSwallow\n" +
                             "if you require visibility to be completely ignored.");
            }

            locations.Clear();
        }
        public override IEnumerable <string> AfterUpdate(ModData modData)
        {
            if (locations.Any())
            {
                yield return("The way that decorations are positioned relative to the selection box has changed.\n" +
                             "Review the following definitions and define Margin properties as required:\n" +
                             UpdateUtils.FormatMessageList(locations.Select(
                                                               kv => kv.Key + ":\n" + UpdateUtils.FormatMessageList(kv.Value))));
            }

            locations.Clear();
        }
        public override IEnumerable <string> AfterUpdate(ModData modData)
        {
            if (locations.Any())
            {
                yield return("The *Palette fields have been removed from the *PlaceBuildingPreview traits.\n" +
                             "You may wish to inspect the following definitions and define new Alpha or\n" +
                             "LineBuildSegmentAlpha properties as appropriate to recreate transparency effects:\n" +
                             UpdateUtils.FormatMessageList(locations));
            }

            locations.Clear();
        }
示例#11
0
        public override IEnumerable <string> AfterUpdate(ModData modData)
        {
            if (!hasAutoCarryable || !harvesters.Any())
            {
                yield break;
            }

            yield return("Detected an 'AutoCarryable' trait.\n" +
                         "Review the following definitions and, if required,\n" +
                         "add the new 'CarryableHarvester' trait.\n" +
                         UpdateUtils.FormatMessageList(harvesters, 1));
        }
示例#12
0
        public override IEnumerable <string> AfterUpdate(ModData modData)
        {
            var message = "ProductionAirdrop.ActorType no longer defaults to 'c17' and must be defined explicitly.\n"
                          + "You may have to define it manually now in the following places:\n"
                          + UpdateUtils.FormatMessageList(missingActorTypes.Select(n => n.Item1 + " (" + n.Item2 + ")"));

            if (missingActorTypes.Any())
            {
                yield return(message);
            }

            missingActorTypes.Clear();
        }
        public override IEnumerable <string> AfterUpdate(ModData modData)
        {
            if (locations.Any())
            {
                yield return("The following weapons may now target actors that have full health. Review their\n" +
                             "target types and, if necessary, use GrantConditionOnDamageState to enable\n" +
                             "a conditional Targetable trait with the appropriate target type when damaged:\n" +
                             UpdateUtils.FormatMessageList(locations.Select(
                                                               kv => kv.Key + ":\n" + UpdateUtils.FormatMessageList(kv.Value))));
            }

            locations.Clear();
        }
        public override IEnumerable <string> AfterUpdate(ModData modData)
        {
            if (locations.Any())
            {
                yield return("The WithPermanentInjury trait has been removed from the following actors.\n" +
                             "You must manually define TakeCover with a negative ProneTime and use\n" +
                             "GrantConditionOnDamageState/-Health with 'GrantPermanently: true'\n" +
                             "to enable TakeCover at the desired damage state:\n" +
                             UpdateUtils.FormatMessageList(locations));
            }

            locations.Clear();
        }
        public override IEnumerable <string> AfterUpdate(ModData modData)
        {
            var message = "InitialFacing is no longer hardcoded to 192 for aircraft with VTOL: false.\n"
                          + "You may have to set it manually now in the following places:\n"
                          + UpdateUtils.FormatMessageList(nonVTOLs.Select(n => n.Item1 + " (" + n.Item2 + ")"));

            if (nonVTOLs.Any())
            {
                yield return(message);
            }

            nonVTOLs.Clear();
        }
示例#16
0
        public override IEnumerable <string> AfterUpdate(ModData modData)
        {
            if (locations.Any())
            {
                yield return("UseClassicFacingFudge property on BodyOrientation was replaced with ClassicFacingBodyOrientation trait.\n" +
                             "UseClassicFacingFudge for sequences was renamed to UseClassicFacings and moved to\n" +
                             "Classic(TileSetSpecific)SpriteSequence loaders in Mods.Cnc.\n" +
                             "Update SpriteSequenceFormat: in mod.yaml accordingly.\n" +
                             "Make sure that actors implementing the following places don't use or inherit the standard BodyOrientation:\n" +
                             UpdateUtils.FormatMessageList(locations));
            }

            locations.Clear();
        }
示例#17
0
        public override IEnumerable <string> AfterUpdate(ModData modData)
        {
            var message = "TurnToDock is now deprecated. The following actors had TurnToDock enabled:\n"
                          + UpdateUtils.FormatMessageList(turningAircraft.Select(n => n.Item1 + " (" + n.Item2 + ")"))
                          + "\n If you wish these units to keep their turning behaviour when docking with a host building" +
                          "you will need to define a 'Facing' parameter on the 'Exit' trait of the host building. This change" +
                          "does not affect the behaviour for landing on terrain which is governed by TurnToLand.";

            if (turningAircraft.Any())
            {
                yield return(message);
            }

            turningAircraft.Clear();
        }
示例#18
0
        public override IEnumerable <string> AfterUpdate(ModData modData)
        {
            var message = "PrefixByFullness has been removed from WithHarvestAnimation.\n"
                          + "To display fullness levels, use the new WithHarvesterSpriteBody\n"
                          + "to switch between separate image sprites instead (see RA mod harvester for reference).\n"
                          + "The following places most likely need manual changes:\n"
                          + UpdateUtils.FormatMessageList(fullnessPrefixes.Select(n => n.Item1 + " (" + n.Item2 + ")"));

            if (fullnessPrefixes.Any())
            {
                yield return(message);
            }

            fullnessPrefixes.Clear();
        }
        public override IEnumerable <string> AfterUpdate(ModData modData)
        {
            var message = "ReturnOnIdle trait has been removed from the places listed below.\n"
                          + "Since this trait has been dysfunctional for a long time,\n"
                          + "IdleBehavior: ReturnToBase is NOT being set automatically.\n"
                          + "If you want your aircraft to return when idle, manually set it on the following definitions:\n"
                          + UpdateUtils.FormatMessageList(returnOnIdles.Select(n => n.Item1 + " (" + n.Item2 + ")"));

            if (returnOnIdles.Any())
            {
                yield return(message);
            }

            returnOnIdles.Clear();
        }
示例#20
0
        public override IEnumerable <string> AfterUpdate(ModData modData)
        {
            var message = "Aircraft attack behavior (Hover or Strafe) is now controlled via AttackAircraft.AttackType.\n"
                          + "Aircraft with CanHover: true will now also need AttackType: Hover on AttackAircraft\n"
                          + "to maintain position while attacking as before.\n"
                          + "The following places might need manual changes:\n"
                          + UpdateUtils.FormatMessageList(hoveringActors.Select(n => n.Item1 + " (" + n.Item2 + ")"));

            if (hoveringActors.Any())
            {
                yield return(message);
            }

            hoveringActors.Clear();
        }
示例#21
0
        public override IEnumerable <string> AfterUpdate(ModData modData)
        {
            if (overrideLocations.Any())
            {
                yield return("Region-specific image overrides are no longer supported. The following definitions must be replaced:\n" +
                             UpdateUtils.FormatMessageList(overrideLocations));
            }

            if (panelLocations.Any())
            {
                yield return("The following definitions appear to be panels, but could not be converted to the new PanelRegion format.\n" +
                             "You may wish to define PanelRegion/PanelSides manually to reduce duplication:\n" +
                             UpdateUtils.FormatMessageList(panelLocations));
            }

            overrideLocations.Clear();
            panelLocations.Clear();
        }
示例#22
0
        public override IEnumerable <string> AfterUpdate(ModData modData)
        {
            if (!messageShown)
            {
                yield return("You may want to check your AI yamls for possible redundant module entries.\n" +
                             "Additionally, make sure the Player actor has the ConditionManager trait and add it manually if it doesn't.");
            }

            messageShown = true;

            if (locations.Any())
            {
                yield return("This update rule can only autoamtically update the base HackyAI definitions,\n" +
                             "not any overrides in other files (unless they redefine Type).\n" +
                             "You will have to manually check and possibly update the following locations:\n" +
                             UpdateUtils.FormatMessageList(locations));
            }

            locations.Clear();
        }
示例#23
0
        static void ApplyRules(ModData modData, IEnumerable <UpdateRule> rules, bool skipMaps)
        {
            Console.WriteLine();

            var logWriter = File.CreateText("update.log");

            logWriter.AutoFlush = true;

            var externalFilenames = new HashSet <string>();

            foreach (var rule in rules)
            {
                var manualSteps = new List <string>();
                var allFiles    = new YamlFileSet();

                LogLine(logWriter, "{0}: {1}", rule.GetType().Name, rule.Name);

                try
                {
                    Log(logWriter, "   Updating mod... ");
                    manualSteps.AddRange(UpdateUtils.UpdateMod(modData, rule, out allFiles, externalFilenames));
                    LogLine(logWriter, "COMPLETE");
                }
                catch (Exception ex)
                {
                    Console.WriteLine("FAILED");

                    LogLine(logWriter);
                    LogLine(logWriter, "   The automated changes for this rule were not applied because of an error.");
                    LogLine(logWriter, "   After the issue reported below is resolved you should run the updater");
                    LogLine(logWriter, "   with SOURCE set to {0} to retry these changes", rule.GetType().Name);
                    LogLine(logWriter);
                    LogLine(logWriter, "   The exception reported was:");
                    LogLine(logWriter, "     " + ex.ToString().Replace("\n", "\n     "));

                    continue;
                }

                Log(logWriter, "   Updating system maps... ");

                if (!skipMaps)
                {
                    var mapsFailed           = false;
                    var mapExternalFilenames = new HashSet <string>();
                    foreach (var package in modData.MapCache.EnumerateMapPackagesWithoutCaching())
                    {
                        try
                        {
                            var mapSteps = UpdateUtils.UpdateMap(modData, package, rule, out var mapFiles, mapExternalFilenames);
                            allFiles.AddRange(mapFiles);

                            if (mapSteps.Any())
                            {
                                manualSteps.Add("Map: " + package.Name + ":\n" + UpdateUtils.FormatMessageList(mapSteps));
                            }
                        }
                        catch (Exception ex)
                        {
                            LogLine(logWriter, "FAILED");
                            LogLine(logWriter);
                            LogLine(logWriter, "   The automated changes for this rule were not applied because of an error.");
                            LogLine(logWriter, "   After the issue reported below is resolved you should run the updater");
                            LogLine(logWriter, "   with SOURCE set to {0} to retry these changes", rule.GetType().Name);
                            LogLine(logWriter);
                            LogLine(logWriter, "   The map that caused the error was:");
                            LogLine(logWriter, "     " + package.Name);
                            LogLine(logWriter);
                            LogLine(logWriter, "   The exception reported was:");
                            LogLine(logWriter, "     " + ex.ToString().Replace("\n", "\n     "));
                            mapsFailed = true;
                            break;
                        }
                    }

                    if (mapsFailed)
                    {
                        continue;
                    }

                    LogLine(logWriter, "COMPLETE");
                }
                else
                {
                    LogLine(logWriter, "SKIPPED");
                }

                // Files are saved after each successful automated rule update
                allFiles.Save();

                if (manualSteps.Any())
                {
                    LogLine(logWriter, "   Manual changes are required to complete this update:");
                    LogLine(logWriter, UpdateUtils.FormatMessageList(manualSteps, 1));
                }

                LogLine(logWriter);
            }

            if (externalFilenames.Any())
            {
                LogLine(logWriter, "The following external mod files have been ignored:");
                LogLine(logWriter, UpdateUtils.FormatMessageList(externalFilenames));
                LogLine(logWriter, "These files should be updated by running --update-mod on the referenced mod(s)");
                LogLine(logWriter);
            }

            Console.WriteLine("Semi-automated update complete.");
            Console.WriteLine("Please review the messages above for any manual actions that must be applied.");
            Console.WriteLine("These messages have also been written to an update.log file in the current directory.");
        }
示例#24
0
        public override IEnumerable <string> AfterUpdate(ModData modData)
        {
            if (locations.Any())
            {
                yield return("Review the following definitions and, if the actor uses Harvester or StoresResources,\n" +
                             "define a new Explodes trait with the previous EmptyWeapon, enabled by Harvester.EmptyCondition or\n" +
                             "GrantConditionOnPlayerResources.Condition (negated):\n" + UpdateUtils.FormatMessageList(locations));
            }

            locations.Clear();
        }