Skip to content

Commit

Permalink
4.2.1 fixes (#10355)
Browse files Browse the repository at this point in the history
* fix more ordering issues
- ducal stable missing resource yields
- ostrog missing resource yields
- also remove ducal stable instant culture that's still there for some reason

* fix xcom being gunpowder unit instead of recon

* fix Policy_CapitalYieldPerPopChangeEmpire
it's using division instead of multiplication
  • Loading branch information
azum4roll authored Oct 10, 2023
1 parent 170976a commit 0dc0204
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 106 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ DELETE FROM Building_YieldModifiers;
DELETE FROM Building_PrereqBuildingClasses;
DELETE FROM Building_ClassesNeededInCity;
DELETE FROM Building_LocalResourceAnds;
DELETE FROM Building_ResourceYieldChanges;
DELETE FROM Building_SeaResourceYieldChanges;

-- Delete National Visitor Center
Expand Down
5 changes: 0 additions & 5 deletions (2) Vox Populi/Database Changes/Civilizations/Poland.sql
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@ VALUES
('BUILDING_DUCAL_STABLE', 'RESOURCE_SHEEP', 'YIELD_GOLD', 3),
('BUILDING_DUCAL_STABLE', 'RESOURCE_HORSE', 'YIELD_GOLD', 3);

INSERT INTO Building_InstantYield
(BuildingType, YieldType, Yield)
VALUES
('BUILDING_DUCAL_STABLE', 'YIELD_CULTURE', 100);

INSERT INTO Building_ResourceQuantity
(BuildingType, ResourceType, Quantity)
VALUES
Expand Down
6 changes: 5 additions & 1 deletion (2) Vox Populi/Database Changes/Units/UnitChanges.sql
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,11 @@ SET
WHERE Class = 'UNITCLASS_MARINE';

-- XCOM Squad
UPDATE Units SET PrereqTech = 'TECH_LASERS' WHERE Class = 'UNITCLASS_XCOM_SQUAD';
UPDATE Units
SET
CombatClass = 'UNITCOMBAT_RECON',
PrereqTech = 'TECH_LASERS'
WHERE Class = 'UNITCLASS_XCOM_SQUAD';

----------------------------------------------------------------------------
-- Anti-Air
Expand Down
100 changes: 100 additions & 0 deletions (2) Vox Populi/Database Changes/WorldMap/Resources/ResourceChanges.sql
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,106 @@ UPDATE Resources
SET PolicyReveal = 'POLICY_AESTHETICS_FINISHER'
WHERE Type = 'RESOURCE_HIDDEN_ARTIFACTS';

--------------------------------------------------------------------------------------------
-- Resource building boosts (putting it here since it makes more sense tied to resources)
-- Using BuildingClass, uniques may update it again later
--------------------------------------------------------------------------------------------
CREATE TEMP TABLE BuildingClass_ResourceYieldChanges (
BuildingClass TEXT,
ResourceType TEXT,
YieldType TEXT,
Yield INTEGER
);

INSERT INTO BuildingClass_ResourceYieldChanges
VALUES
-- Bonus
('BUILDINGCLASS_STONE_WORKS', 'RESOURCE_STONE', 'YIELD_PRODUCTION', 2),
('BUILDINGCLASS_GRANARY', 'RESOURCE_WHEAT', 'YIELD_FOOD', 1),
('BUILDINGCLASS_GRANARY', 'RESOURCE_MAIZE', 'YIELD_FOOD', 1),
('BUILDINGCLASS_GRANARY', 'RESOURCE_RICE', 'YIELD_FOOD', 1),
('BUILDINGCLASS_GRANARY', 'RESOURCE_BANANA', 'YIELD_FOOD', 1),
('BUILDINGCLASS_MINT', 'RESOURCE_BANANA', 'YIELD_GOLD', 2),
('BUILDINGCLASS_LODGE', 'RESOURCE_BISON', 'YIELD_FOOD', 1),
('BUILDINGCLASS_LODGE', 'RESOURCE_DEER', 'YIELD_FOOD', 1),
('BUILDINGCLASS_STABLE', 'RESOURCE_COW', 'YIELD_PRODUCTION', 2),
('BUILDINGCLASS_STABLE', 'RESOURCE_SHEEP', 'YIELD_PRODUCTION', 2),
-- Strategics
('BUILDINGCLASS_FORGE', 'RESOURCE_IRON', 'YIELD_PRODUCTION', 1),
('BUILDINGCLASS_FORGE', 'RESOURCE_IRON', 'YIELD_GOLD', 1),
('BUILDINGCLASS_STABLE', 'RESOURCE_HORSE', 'YIELD_PRODUCTION', 2),
('BUILDINGCLASS_FACTORY', 'RESOURCE_COAL', 'YIELD_PRODUCTION', 2),
('BUILDINGCLASS_FACTORY', 'RESOURCE_COAL', 'YIELD_SCIENCE', 2),
('BUILDINGCLASS_LABORATORY', 'RESOURCE_OIL', 'YIELD_SCIENCE', 4),
('BUILDINGCLASS_LABORATORY', 'RESOURCE_ALUMINUM', 'YIELD_SCIENCE', 4),
('BUILDINGCLASS_LABORATORY', 'RESOURCE_URANIUM', 'YIELD_SCIENCE', 4),
-- Luxuries
('BUILDINGCLASS_MARKET', 'RESOURCE_SPICES', 'YIELD_FOOD', 1),
('BUILDINGCLASS_MARKET', 'RESOURCE_SPICES', 'YIELD_PRODUCTION', 1),
('BUILDINGCLASS_MARKET', 'RESOURCE_SUGAR', 'YIELD_FOOD', 1),
('BUILDINGCLASS_MARKET', 'RESOURCE_SUGAR', 'YIELD_GOLD', 1),
('BUILDINGCLASS_STONE_WORKS', 'RESOURCE_SALT', 'YIELD_GOLD', 2),
('BUILDINGCLASS_STONE_WORKS', 'RESOURCE_MARBLE', 'YIELD_PRODUCTION', 1),
('BUILDINGCLASS_STONE_WORKS', 'RESOURCE_MARBLE', 'YIELD_GOLD', 1),
('BUILDINGCLASS_STONE_WORKS', 'RESOURCE_JADE', 'YIELD_PRODUCTION', 1),
('BUILDINGCLASS_STONE_WORKS', 'RESOURCE_JADE', 'YIELD_GOLD', 1),
('BUILDINGCLASS_COLOSSEUM', 'RESOURCE_OLIVE', 'YIELD_FOOD', 1),
('BUILDINGCLASS_COLOSSEUM', 'RESOURCE_OLIVE', 'YIELD_GOLD', 1),
('BUILDINGCLASS_COLOSSEUM', 'RESOURCE_PERFUME', 'YIELD_GOLD', 1),
('BUILDINGCLASS_COLOSSEUM', 'RESOURCE_PERFUME', 'YIELD_CULTURE', 1),
('BUILDINGCLASS_FORGE', 'RESOURCE_COPPER', 'YIELD_GOLD', 2),
('BUILDINGCLASS_AMPHITHEATER', 'RESOURCE_DYE', 'YIELD_GOLD', 1),
('BUILDINGCLASS_AMPHITHEATER', 'RESOURCE_DYE', 'YIELD_CULTURE', 1),
('BUILDINGCLASS_AMPHITHEATER', 'RESOURCE_SILK', 'YIELD_GOLD', 1),
('BUILDINGCLASS_AMPHITHEATER', 'RESOURCE_SILK', 'YIELD_CULTURE', 1),
('BUILDINGCLASS_AMPHITHEATER', 'RESOURCE_LAPIS', 'YIELD_CULTURE', 2),
('BUILDINGCLASS_CARAVANSARY', 'RESOURCE_TRUFFLES', 'YIELD_GOLD', 2),
('BUILDINGCLASS_CARAVANSARY', 'RESOURCE_COTTON', 'YIELD_PRODUCTION', 1),
('BUILDINGCLASS_CARAVANSARY', 'RESOURCE_COTTON', 'YIELD_CULTURE', 1),
('BUILDINGCLASS_CARAVANSARY', 'RESOURCE_FUR', 'YIELD_PRODUCTION', 1),
('BUILDINGCLASS_CARAVANSARY', 'RESOURCE_FUR', 'YIELD_GOLD', 1),
('BUILDINGCLASS_CIRCUS', 'RESOURCE_IVORY', 'YIELD_CULTURE', 3),
('BUILDINGCLASS_TEMPLE', 'RESOURCE_INCENSE', 'YIELD_GOLD', 1),
('BUILDINGCLASS_TEMPLE', 'RESOURCE_INCENSE', 'YIELD_CULTURE', 1),
('BUILDINGCLASS_TEMPLE', 'RESOURCE_WINE', 'YIELD_GOLD', 1),
('BUILDINGCLASS_TEMPLE', 'RESOURCE_WINE', 'YIELD_CULTURE', 1),
('BUILDINGCLASS_TEMPLE', 'RESOURCE_AMBER', 'YIELD_GOLD', 1),
('BUILDINGCLASS_TEMPLE', 'RESOURCE_AMBER', 'YIELD_CULTURE', 1),
('BUILDINGCLASS_GARDEN', 'RESOURCE_CITRUS', 'YIELD_FOOD', 1),
('BUILDINGCLASS_GARDEN', 'RESOURCE_CITRUS', 'YIELD_GOLD', 1),
('BUILDINGCLASS_GARDEN', 'RESOURCE_COCOA', 'YIELD_FOOD', 1),
('BUILDINGCLASS_GARDEN', 'RESOURCE_COCOA', 'YIELD_GOLD', 1),
('BUILDINGCLASS_MINT', 'RESOURCE_TEA', 'YIELD_PRODUCTION', 1),
('BUILDINGCLASS_MINT', 'RESOURCE_TEA', 'YIELD_GOLD', 2),
('BUILDINGCLASS_MINT', 'RESOURCE_COFFEE', 'YIELD_PRODUCTION', 2),
('BUILDINGCLASS_MINT', 'RESOURCE_COFFEE', 'YIELD_GOLD', 1),
('BUILDINGCLASS_MINT', 'RESOURCE_TOBACCO', 'YIELD_GOLD', 3),
('BUILDINGCLASS_BANK', 'RESOURCE_GEMS', 'YIELD_GOLD', 1),
('BUILDINGCLASS_BANK', 'RESOURCE_GEMS', 'YIELD_CULTURE', 2),
('BUILDINGCLASS_BANK', 'RESOURCE_GOLD', 'YIELD_GOLD', 3),
('BUILDINGCLASS_BANK', 'RESOURCE_SILVER', 'YIELD_PRODUCTION', 1),
('BUILDINGCLASS_BANK', 'RESOURCE_SILVER', 'YIELD_GOLD', 1),
('BUILDINGCLASS_BANK', 'RESOURCE_SILVER', 'YIELD_CULTURE', 1),
-- Uniques
('BUILDINGCLASS_AMPHITHEATER', 'RESOURCE_BRAZILWOOD', 'YIELD_GOLD', 1),
('BUILDINGCLASS_AMPHITHEATER', 'RESOURCE_BRAZILWOOD', 'YIELD_CULTURE', 1),
('BUILDINGCLASS_GARDEN', 'RESOURCE_CLOVES', 'YIELD_CULTURE', 1),
('BUILDINGCLASS_GARDEN', 'RESOURCE_CLOVES', 'YIELD_FAITH', 1),
('BUILDINGCLASS_GARDEN', 'RESOURCE_PEPPER', 'YIELD_GOLD', 1),
('BUILDINGCLASS_GARDEN', 'RESOURCE_PEPPER', 'YIELD_FAITH', 1),
('BUILDINGCLASS_GARDEN', 'RESOURCE_NUTMEG', 'YIELD_PRODUCTION', 1),
('BUILDINGCLASS_GARDEN', 'RESOURCE_NUTMEG', 'YIELD_CULTURE', 1);

INSERT INTO Building_ResourceYieldChanges
(BuildingType, ResourceType, YieldType, Yield)
SELECT DISTINCT
a.Type, b.ResourceType, b.YieldType, b.Yield
FROM Buildings a, BuildingClass_ResourceYieldChanges b
WHERE a.BuildingClass = b.BuildingClass
ORDER BY a.BuildingClass, a.Type;

DROP TABLE BuildingClass_ResourceYieldChanges;

--------------------------------------------------------------------------------------------
-- Tech reveal
-- Supports the COMMUNITY_CORE_BALANCE_RESOURCE_REVEAL option
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
-- To be inserted back below
DELETE FROM Resource_YieldChanges;
DELETE FROM Improvement_ResourceType_Yields;
DELETE FROM Building_ResourceYieldChanges;
DELETE FROM Resource_QuantityTypes;

-- Resource base yields
Expand Down Expand Up @@ -166,104 +165,6 @@ VALUES
('IMPROVEMENT_PLANTATION', 'RESOURCE_PEPPER', 'YIELD_GOLD', 1),
('IMPROVEMENT_PLANTATION', 'RESOURCE_PEPPER', 'YIELD_FAITH', 1);

-- Resource building boosts (putting it here since it makes more sense tied to resources)
-- Using BuildingClass, uniques may update it again later
CREATE TEMP TABLE BuildingClass_ResourceYieldChanges (
BuildingClass TEXT,
ResourceType TEXT,
YieldType TEXT,
Yield INTEGER
);

INSERT INTO BuildingClass_ResourceYieldChanges
VALUES
-- Bonus
('BUILDINGCLASS_STONE_WORKS', 'RESOURCE_STONE', 'YIELD_PRODUCTION', 2),
('BUILDINGCLASS_GRANARY', 'RESOURCE_WHEAT', 'YIELD_FOOD', 1),
('BUILDINGCLASS_GRANARY', 'RESOURCE_MAIZE', 'YIELD_FOOD', 1),
('BUILDINGCLASS_GRANARY', 'RESOURCE_RICE', 'YIELD_FOOD', 1),
('BUILDINGCLASS_GRANARY', 'RESOURCE_BANANA', 'YIELD_FOOD', 1),
('BUILDINGCLASS_MINT', 'RESOURCE_BANANA', 'YIELD_GOLD', 2),
('BUILDINGCLASS_LODGE', 'RESOURCE_BISON', 'YIELD_FOOD', 1),
('BUILDINGCLASS_LODGE', 'RESOURCE_DEER', 'YIELD_FOOD', 1),
('BUILDINGCLASS_STABLE', 'RESOURCE_COW', 'YIELD_PRODUCTION', 2),
('BUILDINGCLASS_STABLE', 'RESOURCE_SHEEP', 'YIELD_PRODUCTION', 2),
-- Strategics
('BUILDINGCLASS_FORGE', 'RESOURCE_IRON', 'YIELD_PRODUCTION', 1),
('BUILDINGCLASS_FORGE', 'RESOURCE_IRON', 'YIELD_GOLD', 1),
('BUILDINGCLASS_STABLE', 'RESOURCE_HORSE', 'YIELD_PRODUCTION', 2),
('BUILDINGCLASS_FACTORY', 'RESOURCE_COAL', 'YIELD_PRODUCTION', 2),
('BUILDINGCLASS_FACTORY', 'RESOURCE_COAL', 'YIELD_SCIENCE', 2),
('BUILDINGCLASS_LABORATORY', 'RESOURCE_OIL', 'YIELD_SCIENCE', 4),
('BUILDINGCLASS_LABORATORY', 'RESOURCE_ALUMINUM', 'YIELD_SCIENCE', 4),
('BUILDINGCLASS_LABORATORY', 'RESOURCE_URANIUM', 'YIELD_SCIENCE', 4),
-- Luxuries
('BUILDINGCLASS_MARKET', 'RESOURCE_SPICES', 'YIELD_FOOD', 1),
('BUILDINGCLASS_MARKET', 'RESOURCE_SPICES', 'YIELD_PRODUCTION', 1),
('BUILDINGCLASS_MARKET', 'RESOURCE_SUGAR', 'YIELD_FOOD', 1),
('BUILDINGCLASS_MARKET', 'RESOURCE_SUGAR', 'YIELD_GOLD', 1),
('BUILDINGCLASS_STONE_WORKS', 'RESOURCE_SALT', 'YIELD_GOLD', 2),
('BUILDINGCLASS_STONE_WORKS', 'RESOURCE_MARBLE', 'YIELD_PRODUCTION', 1),
('BUILDINGCLASS_STONE_WORKS', 'RESOURCE_MARBLE', 'YIELD_GOLD', 1),
('BUILDINGCLASS_STONE_WORKS', 'RESOURCE_JADE', 'YIELD_PRODUCTION', 1),
('BUILDINGCLASS_STONE_WORKS', 'RESOURCE_JADE', 'YIELD_GOLD', 1),
('BUILDINGCLASS_COLOSSEUM', 'RESOURCE_OLIVE', 'YIELD_FOOD', 1),
('BUILDINGCLASS_COLOSSEUM', 'RESOURCE_OLIVE', 'YIELD_GOLD', 1),
('BUILDINGCLASS_COLOSSEUM', 'RESOURCE_PERFUME', 'YIELD_GOLD', 1),
('BUILDINGCLASS_COLOSSEUM', 'RESOURCE_PERFUME', 'YIELD_CULTURE', 1),
('BUILDINGCLASS_FORGE', 'RESOURCE_COPPER', 'YIELD_GOLD', 2),
('BUILDINGCLASS_AMPHITHEATER', 'RESOURCE_DYE', 'YIELD_GOLD', 1),
('BUILDINGCLASS_AMPHITHEATER', 'RESOURCE_DYE', 'YIELD_CULTURE', 1),
('BUILDINGCLASS_AMPHITHEATER', 'RESOURCE_SILK', 'YIELD_GOLD', 1),
('BUILDINGCLASS_AMPHITHEATER', 'RESOURCE_SILK', 'YIELD_CULTURE', 1),
('BUILDINGCLASS_AMPHITHEATER', 'RESOURCE_LAPIS', 'YIELD_CULTURE', 2),
('BUILDINGCLASS_CARAVANSARY', 'RESOURCE_TRUFFLES', 'YIELD_GOLD', 2),
('BUILDINGCLASS_CARAVANSARY', 'RESOURCE_COTTON', 'YIELD_PRODUCTION', 1),
('BUILDINGCLASS_CARAVANSARY', 'RESOURCE_COTTON', 'YIELD_CULTURE', 1),
('BUILDINGCLASS_CARAVANSARY', 'RESOURCE_FUR', 'YIELD_PRODUCTION', 1),
('BUILDINGCLASS_CARAVANSARY', 'RESOURCE_FUR', 'YIELD_GOLD', 1),
('BUILDINGCLASS_CIRCUS', 'RESOURCE_IVORY', 'YIELD_CULTURE', 3),
('BUILDINGCLASS_TEMPLE', 'RESOURCE_INCENSE', 'YIELD_GOLD', 1),
('BUILDINGCLASS_TEMPLE', 'RESOURCE_INCENSE', 'YIELD_CULTURE', 1),
('BUILDINGCLASS_TEMPLE', 'RESOURCE_WINE', 'YIELD_GOLD', 1),
('BUILDINGCLASS_TEMPLE', 'RESOURCE_WINE', 'YIELD_CULTURE', 1),
('BUILDINGCLASS_TEMPLE', 'RESOURCE_AMBER', 'YIELD_GOLD', 1),
('BUILDINGCLASS_TEMPLE', 'RESOURCE_AMBER', 'YIELD_CULTURE', 1),
('BUILDINGCLASS_GARDEN', 'RESOURCE_CITRUS', 'YIELD_FOOD', 1),
('BUILDINGCLASS_GARDEN', 'RESOURCE_CITRUS', 'YIELD_GOLD', 1),
('BUILDINGCLASS_GARDEN', 'RESOURCE_COCOA', 'YIELD_FOOD', 1),
('BUILDINGCLASS_GARDEN', 'RESOURCE_COCOA', 'YIELD_GOLD', 1),
('BUILDINGCLASS_MINT', 'RESOURCE_TEA', 'YIELD_PRODUCTION', 1),
('BUILDINGCLASS_MINT', 'RESOURCE_TEA', 'YIELD_GOLD', 2),
('BUILDINGCLASS_MINT', 'RESOURCE_COFFEE', 'YIELD_PRODUCTION', 2),
('BUILDINGCLASS_MINT', 'RESOURCE_COFFEE', 'YIELD_GOLD', 1),
('BUILDINGCLASS_MINT', 'RESOURCE_TOBACCO', 'YIELD_GOLD', 3),
('BUILDINGCLASS_BANK', 'RESOURCE_GEMS', 'YIELD_GOLD', 1),
('BUILDINGCLASS_BANK', 'RESOURCE_GEMS', 'YIELD_CULTURE', 2),
('BUILDINGCLASS_BANK', 'RESOURCE_GOLD', 'YIELD_GOLD', 3),
('BUILDINGCLASS_BANK', 'RESOURCE_SILVER', 'YIELD_PRODUCTION', 1),
('BUILDINGCLASS_BANK', 'RESOURCE_SILVER', 'YIELD_GOLD', 1),
('BUILDINGCLASS_BANK', 'RESOURCE_SILVER', 'YIELD_CULTURE', 1),
-- Uniques
('BUILDINGCLASS_AMPHITHEATER', 'RESOURCE_BRAZILWOOD', 'YIELD_GOLD', 1),
('BUILDINGCLASS_AMPHITHEATER', 'RESOURCE_BRAZILWOOD', 'YIELD_CULTURE', 1),
('BUILDINGCLASS_GARDEN', 'RESOURCE_CLOVES', 'YIELD_CULTURE', 1),
('BUILDINGCLASS_GARDEN', 'RESOURCE_CLOVES', 'YIELD_FAITH', 1),
('BUILDINGCLASS_GARDEN', 'RESOURCE_PEPPER', 'YIELD_GOLD', 1),
('BUILDINGCLASS_GARDEN', 'RESOURCE_PEPPER', 'YIELD_FAITH', 1),
('BUILDINGCLASS_GARDEN', 'RESOURCE_NUTMEG', 'YIELD_PRODUCTION', 1),
('BUILDINGCLASS_GARDEN', 'RESOURCE_NUTMEG', 'YIELD_CULTURE', 1);

INSERT INTO Building_ResourceYieldChanges
(BuildingType, ResourceType, YieldType, Yield)
SELECT DISTINCT
a.Type, b.ResourceType, b.YieldType, b.Yield
FROM Buildings a, BuildingClass_ResourceYieldChanges b
WHERE a.BuildingClass = b.BuildingClass
ORDER BY a.BuildingClass, a.Type;

DROP TABLE BuildingClass_ResourceYieldChanges;

-- Tech where the resource can be set as "owned"
-- For Strategics, this is the reveal tech
-- For Luxury and Bonus resources, this is the tech for the improvement required to connect it
Expand Down
2 changes: 1 addition & 1 deletion CvGameCoreDLL_Expansion2/CvPlot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9552,7 +9552,7 @@ int CvPlot::calculateNatureYield(YieldTypes eYield, PlayerTypes ePlayer, const C

if (GET_PLAYER(ePlayer).GetCapitalYieldPerPopChangeEmpire(eYield) != 0)
{
int iPerPopYieldEmpire = GET_PLAYER(ePlayer).getTotalPopulation() / GET_PLAYER(ePlayer).GetCapitalYieldPerPopChangeEmpire(eYield);
int iPerPopYieldEmpire = GET_PLAYER(ePlayer).getTotalPopulation() * GET_PLAYER(ePlayer).GetCapitalYieldPerPopChangeEmpire(eYield);
//Implied 100x, see ChangeCapitalYieldPerPopChangeEmpire.
iPerPopYieldEmpire /= 100;
iYield += iPerPopYieldEmpire;
Expand Down

0 comments on commit 0dc0204

Please sign in to comment.