Skip to content

Commit

Permalink
Import the starting free techs and track the techs known by each civ
Browse files Browse the repository at this point in the history
  • Loading branch information
TomWerner committed Jan 23, 2025
1 parent 5998531 commit 26cbeef
Show file tree
Hide file tree
Showing 3 changed files with 145 additions and 1 deletion.
126 changes: 125 additions & 1 deletion C7/Text/c7-static-map-save.json
Original file line number Diff line number Diff line change
Expand Up @@ -62130,6 +62130,10 @@
"Lauriacum",
"Teurnia",
"Curia"
],
"knownTechs": [
"tech-6",
"tech-3"
]
},
{
Expand Down Expand Up @@ -62168,6 +62172,10 @@
"Oryx",
"Sebennytus",
"Cairo"
],
"knownTechs": [
"tech-7",
"tech-2"
]
},
{
Expand Down Expand Up @@ -62206,6 +62214,10 @@
"Syracuse",
"Apollonia",
"Apolyton"
],
"knownTechs": [
"tech-3",
"tech-1"
]
},
{
Expand Down Expand Up @@ -62242,6 +62254,10 @@
"Telloh",
"Nina",
"Ebla"
],
"knownTechs": [
"tech-1",
"tech-7"
]
},
{
Expand All @@ -62267,6 +62283,10 @@
"Salzburg",
"Dortmund",
"Brandenburg"
],
"knownTechs": [
"tech-6",
"tech-1"
]
},
{
Expand Down Expand Up @@ -62315,6 +62335,10 @@
"Nizhniy Novgorod",
"Suzdal\u0027",
"Magnitogorsk"
],
"knownTechs": [
"tech-4",
"tech-1"
]
},
{
Expand Down Expand Up @@ -62342,6 +62366,10 @@
"Ningpo",
"Paoting",
"Yangchow"
],
"knownTechs": [
"tech-6",
"tech-2"
]
},
{
Expand Down Expand Up @@ -62391,6 +62419,10 @@
"Springfield",
"Palo Alto",
"Spokane"
],
"knownTechs": [
"tech-4",
"tech-2"
]
},
{
Expand Down Expand Up @@ -62426,6 +62458,10 @@
"Echigo",
"Kozuke",
"Sado"
],
"knownTechs": [
"tech-5",
"tech-7"
]
},
{
Expand Down Expand Up @@ -62456,6 +62492,10 @@
"Brest",
"Bordeaux",
"Rennes"
],
"knownTechs": [
"tech-3",
"tech-2"
]
},
{
Expand All @@ -62482,6 +62522,10 @@
"Indus",
"Ganges",
"Pune"
],
"knownTechs": [
"tech-3",
"tech-7"
]
},
{
Expand Down Expand Up @@ -62520,6 +62564,10 @@
"Bunyan",
"Charsadda",
"Ura Tyube"
],
"knownTechs": [
"tech-1",
"tech-2"
]
},
{
Expand Down Expand Up @@ -62565,6 +62613,10 @@
"Itzapalapa",
"Ayotzinco",
"Iztapam"
],
"knownTechs": [
"tech-6",
"tech-4"
]
},
{
Expand All @@ -62590,6 +62642,10 @@
"Isipezi",
"Amatikulu",
"Zunguin"
],
"knownTechs": [
"tech-6",
"tech-4"
]
},
{
Expand Down Expand Up @@ -62628,6 +62684,10 @@
"Oiogouen",
"Skannayutenate",
"Onnontare"
],
"knownTechs": [
"tech-4",
"tech-3"
]
},
{
Expand Down Expand Up @@ -62666,6 +62726,10 @@
"Berwick",
"Bath",
"The Mumbles"
],
"knownTechs": [
"tech-3",
"tech-4"
]
},
{
Expand Down Expand Up @@ -62705,6 +62769,10 @@
"Ondorhaan",
"Saynshand",
"Tumentsogt"
],
"knownTechs": [
"tech-6",
"tech-4"
]
},
{
Expand Down Expand Up @@ -62745,6 +62813,10 @@
"Burgos",
"Vigo",
"Badajoz"
],
"knownTechs": [
"tech-3",
"tech-7"
]
},
{
Expand Down Expand Up @@ -62787,6 +62859,10 @@
"Helsinki",
"Keflavik",
"Thunderfall"
],
"knownTechs": [
"tech-6",
"tech-3"
]
},
{
Expand Down Expand Up @@ -62825,6 +62901,10 @@
"Yozgat",
"Tokat",
"Van"
],
"knownTechs": [
"tech-1",
"tech-2"
]
},
{
Expand Down Expand Up @@ -62864,6 +62944,10 @@
"Noviomagus",
"Arausio",
"Durocortorum"
],
"knownTechs": [
"tech-4",
"tech-7"
]
},
{
Expand Down Expand Up @@ -62901,6 +62985,10 @@
"Tabuk",
"Sana\u0027a",
"Shihr"
],
"knownTechs": [
"tech-4",
"tech-7"
]
},
{
Expand Down Expand Up @@ -62940,6 +63028,10 @@
"Gigthis",
"Tacape",
"Zama"
],
"knownTechs": [
"tech-3",
"tech-2"
]
},
{
Expand Down Expand Up @@ -62979,6 +63071,10 @@
"Namwon",
"Kumgang",
"Oijongbu"
],
"knownTechs": [
"tech-1",
"tech-3"
]
},
{
Expand Down Expand Up @@ -63013,6 +63109,10 @@
"Babil",
"Apisala",
"Dabrum"
],
"knownTechs": [
"tech-4",
"tech-1"
]
},
{
Expand Down Expand Up @@ -63047,6 +63147,10 @@
"Katna",
"Kultepe",
"Alisar Huyuk"
],
"knownTechs": [
"tech-4",
"tech-3"
]
},
{
Expand Down Expand Up @@ -63081,11 +63185,15 @@
"Leerdam",
"Hilversum",
"Roosendaal"
],
"knownTechs": [
"tech-4",
"tech-3"
]
},
{
"name": "Portugal",
"noun": "Portugese",
"noun": "Portuguese",
"leader": "Henry",
"colorIndex": 8,
"leaderGender": "male",
Expand Down Expand Up @@ -63126,6 +63234,10 @@
"Atoleiros",
"Mina",
"Pederneira"
],
"knownTechs": [
"tech-3",
"tech-4"
]
},
{
Expand Down Expand Up @@ -63160,6 +63272,10 @@
"Ani",
"Edessa",
"Taormina"
],
"knownTechs": [
"tech-1",
"tech-3"
]
},
{
Expand Down Expand Up @@ -63194,6 +63310,10 @@
"Sausa",
"Tambo Colorado",
"Huaca"
],
"knownTechs": [
"tech-4",
"tech-2"
]
},
{
Expand Down Expand Up @@ -63229,6 +63349,10 @@
"Tazumal",
"Cozumel",
""
],
"knownTechs": [
"tech-2",
"tech-4"
]
}
],
Expand Down
1 change: 1 addition & 0 deletions C7GameData/Civilization.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ public Civilization(string name) {
public int colorIndex;
public Gender leaderGender;
public List<string> cityNames = new List<string>();
public List<ID> knownTechs = new();
}
}
19 changes: 19 additions & 0 deletions C7GameData/ImportCiv3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,25 @@ private void ImportTechs() {
st.Prerequisites.Add(save.Techs[t.Prerequisite3].id);
}
}

// Now that we have ids for all the techs, distribute the free techs
for (int i = 0; i < save.Civilizations.Count; ++i) {
Civilization sc = save.Civilizations[i];
RACE race = theBiq.Race[i];

if (race.FreeTech1 > -1) {
sc.knownTechs.Add(save.Techs[race.FreeTech1].id);
}
if (race.FreeTech2 > -1) {
sc.knownTechs.Add(save.Techs[race.FreeTech2].id);
}
if (race.FreeTech3 > -1) {
sc.knownTechs.Add(save.Techs[race.FreeTech3].id);
}
if (race.FreeTech4 > -1) {
sc.knownTechs.Add(save.Techs[race.FreeTech4].id);
}
}
}

private static void SetWorldWrap(SavData civ3Save, SaveGame save) {
Expand Down

0 comments on commit 26cbeef

Please sign in to comment.