Skip to content

Commit

Permalink
Grand strategy mode improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrettin committed Aug 3, 2015
1 parent 49f192a commit ae1a86d
Show file tree
Hide file tree
Showing 9 changed files with 1,155 additions and 1,114 deletions.
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ https://github.com/Andrettin/Wyrmsun
- Improved AI troop movement decisions.
- Fixed issue with grand strategy under Linux which could cause a freeze.
- Added events to transform tribal factions into polity ones if writing has been researched.
- The "Teuton Culture Develops", "Goth Culture Develops" and "Norse Culture Develops" events now trigger immediately if a Germanic faction has one province of the respective culture.

* Items
- Potions of Healing can now be bought at the dwarven Bastion and the teuton Burg (healing potion icon by Jinn).
Expand Down
1,085 changes: 18 additions & 1,067 deletions scripts/grand_strategy/earth_world_map.lua

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion scripts/grand_strategy/germanic_events.lua
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ local GermanicEvents = {
-- and FactionHasTechnologyType(EventFaction, "wood-plow")
and (EventFaction.Name == "Asa Tribe" or EventFaction.Name == "Goth Tribe")
and EventFaction.Name ~= GrandStrategyFaction.Name -- only available for NPC factions, since the goth civilization is not playable
and SyncRand(50) < 1
and (SyncRand(50) < 1 or FactionHasCulture(EventFaction, "goth"))
) then
return true
end
Expand Down
11 changes: 11 additions & 0 deletions scripts/grand_strategy/grand_strategy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1446,6 +1446,15 @@ function FactionHasCoast(faction)
return false
end

function FactionHasCulture(faction, civilization)
for province_i, key in ipairs(faction.OwnedProvinces) do
if (WorldMapProvinces[key].Civilization == civilization) then
return true
end
end
return false
end

function RunGrandStrategyGameMenu()
local menu = WarGameMenu(panel(1))

Expand Down Expand Up @@ -1669,6 +1678,8 @@ function RunGrandStrategyLoadGameMenu()
ClearGrandStrategyUIVariables()
GrandStrategyMenu:stop();
end
CalculateFactionIncomes()
CalculateFactionUpkeeps()
InitGameSettings() -- initialize scenario variables (i.e. No Randomness)
RunGrandStrategyGame()
end)
Expand Down
81 changes: 55 additions & 26 deletions scripts/grand_strategy/grand_strategy_provinces.lua
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,10 @@ function LoadProvinces(world)
teuton = "Galicia"
},
Tiles = { {133, 28}, {134, 28}, {135, 28}, {136, 28}, {137, 28}, {137, 29}, {138, 28}, {138, 29} },
-- SettlementName = "Lvov",
SettlementName = "Lvov",
CulturalSettlementNames = {
teuton = "Lemberg"
},
SettlementLocation = {137, 28}, -- Lvov / Lemberg
Map = "maps/random_maps/random-map-forest.smp",
SettlementTerrain = "Plains"
Expand Down Expand Up @@ -976,8 +979,11 @@ function LoadProvinces(world)

local EarthOldProvinces = {
Albania = {
Name = "Taulantia",
Name = "Albania",
Tiles = { {134, 33}, {134, 34} },
CulturalNames = {
latin = "Taulantia"
},
SettlementName = "Dyrrhachium",
CulturalSettlementNames = {
greek = "Epidamnus",
Expand All @@ -1004,8 +1010,9 @@ function LoadProvinces(world)
SettlementTerrain = "Plains"
},
Aquitaine = {
Name = "Aquitania",
Name = "Aquitaine",
CulturalNames = {
latin = "Aquitania",
France = "Aquitaine"
},
Tiles = { {119, 31}, {119, 32}, {119, 33}, {120, 31}, {120, 32}, {120, 33}, {121, 31}, {121, 32}, {121, 33}, {122, 32} },
Expand All @@ -1018,8 +1025,9 @@ function LoadProvinces(world)
SettlementTerrain = "Plains"
},
Aragon = {
Name = "Hither Baetica",
Name = "Aragon",
CulturalNames = {
latin = "Hither Baetica",
Portugal = "Aragon",
Spain = "Aragon"
},
Expand Down Expand Up @@ -1068,8 +1076,10 @@ function LoadProvinces(world)
Coastal = true
},
Austria = {
Name = "Noricum",
Name = "Austria",
CulturalNames = {
celt = "Noricum",
latin = "Noricum",
teuton = "Austria"
},
Tiles = { {127, 30}, {128, 30}, {129, 29}, {129, 30}, {130, 29}, {130, 30}, {131, 29}, {131, 30} },
Expand All @@ -1096,10 +1106,11 @@ function LoadProvinces(world)
SettlementTerrain = "Plains"
},
Bavaria = {
Name = "Raetia",
Name = "Bavaria",
CulturalNames = {
Bavaria = "Bavaria",
BavarianTribe = "Bavaria",
latin = "Raetia",
teuton = "Bavaria"
},
Tiles = { {126, 29}, {127, 28}, {127, 29}, {128, 28}, {128, 29} },
Expand Down Expand Up @@ -1157,7 +1168,7 @@ function LoadProvinces(world)
SettlementTerrain = "Plains"
},
Brandenburg = {
Name = "Semnonia",
Name = "Brandenburg",
CulturalNames = {
teuton = "Brandenburg",
SuebiTribe = "Semnonia"
Expand Down Expand Up @@ -1188,8 +1199,11 @@ function LoadProvinces(world)
SettlementTerrain = "Plains"
},
Bulgaria = {
Name = "Lower Moesia",
Name = "Bulgaria",
Tiles = { {136, 33}, {137, 33}, {138, 33}, {139, 33} },
CulturalNames = {
latin = "Lower Moesia"
},
SettlementName = "Odessus",
CulturalSettlementNames = {
greek = "Odessus",
Expand All @@ -1203,8 +1217,10 @@ function LoadProvinces(world)
SettlementTerrain = "Plains"
},
Burgundy = {
Name = "Gallia Narbonensis",
Name = "Burgundy",
CulturalNames = {
celt = "Gallia Narbonensis",
latin = "Gallia Narbonensis",
France = "Provence"
},
Tiles = { {123, 31}, {123, 32}, {124, 30}, {124, 31}, {124, 32} },
Expand All @@ -1217,15 +1233,16 @@ function LoadProvinces(world)
SettlementTerrain = "Plains"
},
Castille = {
Name = "Hispania Tarraconensis",
Name = "Castille",
CulturalNames = {
latin = "Hispania Tarraconensis",
Portugal = "Castille",
Spain = "Castille"
},
Tiles = { {115, 34}, {115, 35}, {115, 36}, {116, 33}, {116, 34}, {116, 35}, {117, 33}, {117, 34}, {117, 35}, {118, 33}, {118, 34}, {118, 35}, {118, 36} },
SettlementName = "Toletum",
SettlementName = "Complutum",
CulturalSettlementNames = {
latin = "Toletum"
latin = "Complutum" -- Toletum is also in the same region and more important in antiquity, but not in the same site as Madrid
},
SettlementLocation = {117, 35}, -- Toledo
Map = "maps/random_maps/random-map-forest.smp",
Expand Down Expand Up @@ -1261,12 +1278,14 @@ function LoadProvinces(world)
Coastal = true
},
Croatia = {
Name = "Dalmatia",
Name = "Croatia",
CulturalNames = {
Croatia = "Croatia",
latin = "Dalmatia",
Muscovy = "Croatia",
Poland = "Croatia",
Russia = "Croatia"
Russia = "Croatia",
teuton = "Küstenland"
},
Tiles = { {130, 31}, {131, 31}, {131, 32}, {132, 31}, {132, 32}, {133, 32}, {133, 33} },
SettlementName = "Salonae",
Expand Down Expand Up @@ -1303,10 +1322,11 @@ function LoadProvinces(world)
SettlementTerrain = "Plains"
},
England = {
Name = "Britannia",
Name = "England",
CulturalNames = {
England = "England",
SaxonTribe = "England",
latin = "Britannia",
teuton = "England"
},
Tiles = { {117, 26}, {117, 27}, {118, 25}, {118, 26}, {118, 27}, {119, 25}, {119, 26}, {119, 27}, {120, 26} },
Expand All @@ -1325,11 +1345,13 @@ function LoadProvinces(world)
Coastal = true
},
France = {
Name = "Gallia Lugdunensis",
Name = "France",
CulturalNames = {
France = "France",
Francia = "Neustria", -- Source: William R. Shepherd, "Historical Atlas", 1911, pp. 53-55.
FrankTribe = "Neustria"
FrankTribe = "Neustria",
celt = "Gallia Lugdunensis",
latin = "Gallia Lugdunensis"
},
Tiles = { {119, 29}, {119, 30}, {120, 29}, {120, 30}, {121, 28}, {121, 29}, {121, 30}, {122, 29}, {122, 30}, {122, 31}, {123, 29}, {123, 30}, {124, 29}, {125, 29} },
SettlementName = "Lutetia",
Expand Down Expand Up @@ -1360,6 +1382,7 @@ function LoadProvinces(world)
GaliciaIberia = {
Name = "Gallaecia",
CulturalNames = {
latin = "Gallaecia",
Galicia = "Galicia",
Portugal = "Galicia",
Spain = "Galicia"
Expand Down Expand Up @@ -1409,8 +1432,9 @@ function LoadProvinces(world)
Coastal = true
},
Hungary = {
Name = "Pannonia",
Name = "Hungary",
CulturalNames = {
latin = "Pannonia",
Hungary = "Hungary"
},
Tiles = { {132, 29}, {132, 30}, {133, 29}, {133, 30}, {133, 31}, {134, 29}, {134, 30}, {134, 31}, {135, 29}, {135, 30}, {135, 31}, {136, 29} },
Expand Down Expand Up @@ -1577,8 +1601,9 @@ function LoadProvinces(world)
SettlementTerrain = "Plains"
},
Portugal = {
Name = "Lusitania",
Name = "Portugal",
CulturalNames = {
latin = "Lusitania",
Portugal = "Portugal",
Spain = "Portugal"
},
Expand All @@ -1595,7 +1620,7 @@ function LoadProvinces(world)
Coastal = true
},
Prussia = {
Name = "Gothiscandza",
Name = "Prussia",
CulturalNames = {
goth = "Gothiscandza",
teuton = "Prussia"
Expand Down Expand Up @@ -1631,7 +1656,7 @@ function LoadProvinces(world)
SettlementTerrain = "Plains"
},
Russia = {
Name = "Gardarike",
Name = "Russia",
CulturalNames = {
goth = "Gardarike",
norse = "Gardarike",
Expand Down Expand Up @@ -1660,8 +1685,9 @@ function LoadProvinces(world)
Coastal = true
},
Scotland = {
Name = "Caledonia",
Name = "Scotland",
CulturalNames = {
latin = "Caledonia",
England = "Scotland",
ScotTribe = "Scotland",
Scotland = "Scotland",
Expand All @@ -1674,8 +1700,11 @@ function LoadProvinces(world)
Coastal = true
},
Serbia = {
Name = "Upper Moesia",
Name = "Serbia",
Tiles = { {134, 32}, {135, 32}, {135, 33} },
CulturalNames = {
latin = "Upper Moesia"
},
SettlementName = "Viminacium",
CulturalSettlementNames = {
latin = "Viminacium"
Expand Down Expand Up @@ -1732,7 +1761,7 @@ function LoadProvinces(world)
SettlementTerrain = "Plains"
},
Switzerland = {
Name = "Helvetia",
Name = "Switzerland",
CulturalNames = {
celt = "Helvetia",
latin = "Helvetia",
Expand Down Expand Up @@ -1775,9 +1804,9 @@ function LoadProvinces(world)
SettlementTerrain = "Plains"
},
Ukraine = {
Name = "Danparstathir", -- name used in the Hervararsaga for a field of battle between the Goths and Huns, possibly the region of the Dnieper; Source: Henry Adams Bellows (transl.), "The Poetic Edda", p. 484.
Name = "Ukraine",
CulturalNames = {
goth = "Danparstathir",
goth = "Danparstathir", -- name used in the Hervararsaga for a field of battle between the Goths and Huns, possibly the region of the Dnieper; Source: Henry Adams Bellows (transl.), "The Poetic Edda", p. 484.
norse = "Danparstathir",
Muscovy = "Ukraine",
Poland = "Ukraine",
Expand Down
2 changes: 1 addition & 1 deletion scripts/grand_strategy/norse_events.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ local NorseEvents = {
-- and FactionHasTechnologyType(EventFaction, "wood-plow")
and (EventFaction.Name == "Asa Tribe" or EventFaction.Name == "Dane Tribe" or EventFaction.Name == "Swede Tribe")
and EventFaction.Name ~= GrandStrategyFaction.Name -- only available for NPC factions, since the norse civilization is not playable
and SyncRand(50) < 1
and (SyncRand(50) < 1 or FactionHasCulture(EventFaction, "norse"))
) then
return true
end
Expand Down
2 changes: 1 addition & 1 deletion scripts/grand_strategy/teuton_events.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ local TeutonEvents = {
and FactionHasTechnologyType(EventFaction, "ranged-projectile-1")
-- and FactionHasTechnologyType(EventFaction, "wood-plow")
and ((EventFaction.Name == "Asa Tribe" or EventFaction.Name == "Frank Tribe" or EventFaction.Name == "Jute Tribe" or EventFaction.Name == "Saxon Tribe" or EventFaction.Name == "Suebi Tribe") or (EventFaction.Name == GrandStrategyFaction.Name and (EventFaction.Name == "Dane Tribe" or EventFaction.Name == "Goth Tribe" or EventFaction.Name == "Swede Tribe")))
and SyncRand(50) < 1
and (SyncRand(50) < 1 or FactionHasCulture(EventFaction, "teuton"))
) then
return true
end
Expand Down
Binary file modified wyrmsun.exe
Binary file not shown.

0 comments on commit ae1a86d

Please sign in to comment.