Skip to content

Commit 88b8135

Browse files
Remove tech cost (tier) cap
1 parent 5a2d314 commit 88b8135

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/ModLoader.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,14 @@ public class PreviewTile
7373

7474
public record DataSprite(float? pixelsPerUnit, Vector2? pivot, bool? alphaIsTransparency);
7575

76-
private static readonly Stopwatch stopwatch = new();
7776
public static int autoidx = Plugin.AUTOIDX_STARTS_FROM;
7877
public static Dictionary<string, Sprite> sprites = new();
7978
public static Dictionary<string, AudioSource> audioClips = new();
8079
public static Dictionary<string, Mod> mods = new();
8180
public static Dictionary<string, PreviewTile[]> tribePreviews = new();
8281
public static Dictionary<string, DataSprite> spriteDatas = new();
82+
private static readonly Stopwatch stopwatch = new();
83+
private static int maxTechTier;
8384
private static List<TribeData.Type> customTribes = new();
8485
private static int climateAutoidx = (int)Enum.GetValues(typeof(TribeData.Type)).Cast<TribeData.Type>().Last();
8586
private static bool shouldInitializeSprites = true;
@@ -401,6 +402,11 @@ internal static void Load(JObject gameLogicdata)
401402
}
402403
}
403404

405+
TechItem.techTierFirebaseId.Clear();
406+
for (int i = 0; i <= maxTechTier; i++)
407+
{
408+
TechItem.techTierFirebaseId.Add($"tech_research_{i}");
409+
}
404410
shouldInitializeSprites = false;
405411
stopwatch.Stop();
406412
Plugin.logger.LogInfo($"Loaded all mods in {stopwatch.ElapsedMilliseconds}ms");
@@ -466,6 +472,8 @@ private static void GameLogicDataPatch(JObject gld, JObject patch)
466472
climateAutoidx++;
467473
break;
468474
case "techData":
475+
int cost = (int)token["cost"];
476+
if (cost > maxTechTier) maxTechTier = cost;
469477
EnumCache<TechData.Type>.AddMapping(id, (TechData.Type)autoidx);
470478
break;
471479
case "unitData":

0 commit comments

Comments
 (0)