Skip to content

Commit

Permalink
Presetsv3.6 (#298)
Browse files Browse the repository at this point in the history
* Presetsv3.6
Added Radius to the Arctic buildings, for Heat Shield Generator, if exists
Added Radius to the Moon Protection Shield Generators
Added Radius to Training Center Buildings (Orbit DLC)

* Fix wrong file
Fixing presets file to the right and complete one

Co-authored-by: Sting Mcray <[email protected]>
  • Loading branch information
StingMcRay and StingMcRay authored Oct 2, 2020
1 parent 92efb22 commit b761b88
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
19 changes: 15 additions & 4 deletions PresetParser/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class Program
public static bool isExcludedGUID = false; /*only for Anno 1800 */

private static Dictionary<string, Dictionary<string, PathRef[]>> VersionSpecificPaths { get; set; }
private const string BUILDING_PRESETS_VERSION = "3.5.1";
private const string BUILDING_PRESETS_VERSION = "3.6";
// Initalisizing Language Directory's and Filenames
private static readonly string[] Languages = new[] { "eng", "ger", "fra", "pol", "rus" };
private static readonly string[] LanguagesFiles2205 = new[] { "english", "german", "french", "polish", "russian" };
Expand Down Expand Up @@ -915,9 +915,20 @@ private static void ParseBuilding2205(List<IBuildingInfo> buildings, XmlNode bui

#region Get/Set InfluenceRange information

//because this number does not exist yet, we set this to zero
b.InfluenceRange = 0;

// New 29-09-2020 : Head shield generation into radius parameter, on request #296
// Read the xml key : <ShieldGenerator> / <ShieldedRadius> for heating arctic buildings (raw number)
// and Moon Shield Generators
b.InfluenceRadius = Convert.ToInt32(values?["ShieldGenerator"]?["ShieldedRadius"]?.InnerText);
// read the xml key : <Energy> / <RadiusUsed> and then devide by 4096 for the training centers
if (string.IsNullOrEmpty(Convert.ToString(b.InfluenceRadius)) || b.InfluenceRadius == 0)
{
b.InfluenceRadius = (Convert.ToInt32(values?["Energy"]?["RadiusUsed"]?.InnerText) / 4096);
}
// Set influenceRadius to 0, if it is still Null/Empty
if (string.IsNullOrEmpty(Convert.ToString(b.InfluenceRadius)))
{
b.InfluenceRadius = 0;
}
#endregion

#region Get BuildBlockers information
Expand Down
2 changes: 1 addition & 1 deletion Presets/presets.json

Large diffs are not rendered by default.

0 comments on commit b761b88

Please sign in to comment.