--===========Trait==============================================================================
--+20% Production Towards Defensive Buildings (I.e. Defense > 0 OR ExtraCityHitpoints > 0;
--Takes BuildingClassOverrides into account.
-- E.g. no bonus when override DOESN'T provides defenses (irregardless of the default building)
-- E.g. applied bonus when override DOES provide defenses (irregardless of the default building)
-- IGNORES Buildings that cannot be constructed (I.e. those that have a negative cost)
--Dummy policy is granted via LUA
INSERT INTO Policies
(Type, Description, Civilopedia, Help, PolicyBranchType, CultureCost, GridX, GridY, PortraitIndex, IconAtlas, IconAtlasAchieved)
VALUES ('POLICY_TRL_PRODUCTION_BONUS_DEFENSIVE_BUILDINGS', 'TXT_KEY_POLICY_TRL_PRODUCTION_BONUS_DEFENSIVE_BUILDINGS', 'TXT_KEY_POLICY_TRL_PRODUCTION_BONUS_DEFENSIVE_BUILDINGS_HELP', 'TXT_KEY_POLICY_TRL_PRODUCTION_BONUS_DEFENSIVE_BUILDINGS_HELP', NULL, -1, -1, -1, 0, 'EXPANSIONPATCH_POLICY_ATLAS', 'EXPANSIONPATCH_POLICY_ACHIEVED_ATLAS');
INSERT INTO Policy_BuildingClassProductionModifiers
(PolicyType, BuildingClassType, ProductionModifier)
SELECT 'POLICY_TRL_PRODUCTION_BONUS_DEFENSIVE_BUILDINGS', Type, 20
FROM BuildingClasses --!=1 so that buildings like the Recycling Centre do get a bonus (as they're not wonders)
WHERE (MaxGlobalInstances<0 AND MaxPlayerInstances!=1 AND MaxTeamInstances!=1)
AND EXISTS
(SELECT * FROM Buildings WHERE BuildingClass == BuildingClasses.Type AND
(Cost>0 AND (Defense>0 OR ExtraCityHitPoints>0) AND
(
--The building is the default building of its buildingclass AND does NOT have an override for Whomp's Fortress (unless it overrides itself for w/e reason)
(Type==BuildingClasses.DefaultBuilding AND NOT EXISTS
(SELECT * FROM Civilization_BuildingClassOverrides WHERE CivilizationType=='CIVILIZATION_TRL_WHOMP_FORTRESS'
AND BuildingClassType == BuildingClasses.Type AND BuildingType!=Buildings.Type)
)
OR
--The building is NOT the default building of its buildingclass AND is the override for Whomp's Fortress
(Type!=BuildingClasses.DefaultBuilding AND EXISTS
(SELECT * FROM Civilization_BuildingClassOverrides WHERE CivilizationType=='CIVILIZATION_TRL_WHOMP_FORTRESS'
AND BuildingClassType == BuildingClasses.Type AND BuildingType==Buildings.Type)
)
)
--[..]snip[..]
)
);