Resource icon

Wonder - Blocking Culture 2021-01-31

Hi,

This is some code I put together to implement an effect for the Argonath wonder.
The idea is that if the wonder is built in a city, no foreign cities can exert cultural influence in that city's sphere of influence.

It adds two tags to CIV4BuildingInfos.xml;
bSoloCulture identifies a building which prevents any foreign cities from exerting cultural influence on the tiles that the building city has cultural influence on.
iBorderCityRange defines the range that a foreign owned city must be within, to allow the building to be built. This is to ensure that the AI only builds it in border cities.

xml
Spoiler :

CIV4BuildingsSchema.xml
Code:
    <ElementType name="bSoloCulture" content="textOnly" dt:type="boolean"/><!-- LPlate - Wonder, Block Foreign Culture-->
   <ElementType name="iBorderCityRange" content="textOnly" dt:type="int"/><!-- LPlate addition, Block Foreign Culture, range within which a foreign city must be-->
Code:
       <element type="bSoloCulture" minOccurs="0"/><!-- LPlate - Wonder, Block Foreign Culture -->
       <element type="iBorderCityRange" minOccurs="0"/><!-- LPlate addition, Wonder, Block Foreign Culture, range within which a foreign city must be -->
CIV4BuildingInfos.xml
Code:
           <bSoloCulture>1</bSoloCulture>
           <iBorderCityRange>5</iBorderCityRange>


The edits in the DLL files can be found by searching for "Block Foreign Culture". There is some overlap with my terrain-culture edits. I've included some commented code to help anyone who wants to use this without the terrain-culture.

How it works;
A city isSoloCulture if it has a building which isSoloCulture.
Then when the doPlotCulture is being performed for a isSoloCulture city, surrounding plots are tagged to identify the player who owns the isSoloCulture city.
When other cities are executing doPlotCulture, they don't attribute culture to such a tagged plot, unless the same player owns the two cities.
In the event of the isSoloCulture city being destroyed or captured, the tags should be removed from the surrounding plots.
Author
LPlate2
Downloads
241
Views
677
First release
Last update

Ratings

0.00 star(s) 0 ratings

More resources from LPlate2

Back
Top Bottom