-
Notifications
You must be signed in to change notification settings - Fork 0
modifiers Collection Types
Collections determine which subjects a modifier affects. The modifier system gathers subjects through collections and then applies effects to matching subjects.
- Modifier activates (owner meets requirements)
- Collection gathers potential subjects
- Subject requirements filter subjects
- Effect applies to remaining subjects
The owner of the modifier itself. Use for effects that apply to the modifier's owner directly.
<Modifier id="EXAMPLE" collection="COLLECTION_OWNER" effect="EFFECT_PLAYER_GRANT_YIELD">
<Argument name="YieldType">YIELD_GOLD</Argument>
<Argument name="Amount">100</Argument>
</Modifier>All players in the game.
All major civilization players.
All independent (city-state/tribe) players.
All cities belonging to the player.
<Modifier id="EXAMPLE" collection="COLLECTION_PLAYER_CITIES" effect="EFFECT_CITY_ADJUST_YIELD">
<Argument name="YieldType">YIELD_FOOD</Argument>
<Argument name="Amount">2</Argument>
</Modifier>All cities in the game (all players).
All capital cities in the game.
The player's capital city only.
<Modifier id="EXAMPLE" collection="COLLECTION_PLAYER_CAPITAL_CITY" effect="EFFECT_CITY_ADJUST_YIELD">
<Argument name="YieldType">YIELD_PRODUCTION</Argument>
<Argument name="Amount">5</Argument>
</Modifier>The city that owns the modifier (for building/improvement modifiers).
<Modifier id="EXAMPLE" collection="COLLECTION_OWNER_CITY" effect="EFFECT_CITY_GRANT_UNIT">
<Argument name="UnitType">UNIT_WARRIOR</Argument>
</Modifier>The owner's city nearest to a narrative story location.
Cities that follow the owner's religion.
Player's cities affected by plague/infection.
Any city at the narrative story location.
All districts in the game.
All districts belonging to the player.
Districts in a specific city.
Districts in the player's capital city.
All units belonging to the player.
<Modifier id="EXAMPLE" collection="COLLECTION_PLAYER_UNITS" effect="EFFECT_UNIT_ADJUST_ABILITY">
<SubjectRequirements>
<Requirement type="REQUIREMENT_UNIT_TAG_MATCHES">
<Argument name="Tag">UNIT_CLASS_INFANTRY</Argument>
</Requirement>
</SubjectRequirements>
<Argument name="AbilityType">ABILITY_FIRST_STRIKE</Argument>
</Modifier>All units in the game.
Units trained in a specific city.
Units currently attached to a commander.
Owner's unit nearest to narrative story location.
Player's combat units during combat resolution.
<Modifier id="EXAMPLE" collection="COLLECTION_PLAYER_COMBAT" effect="EFFECT_ADJUST_UNIT_STRENGTH_MODIFIER">
<Argument name="Amount">5</Argument>
</Modifier>The specific unit in combat context.
<Modifier id="FLANKING_BONUS" collection="COLLECTION_UNIT_COMBAT" effect="EFFECT_ADJUST_UNIT_STRENGTH_MODIFIER">
<OwnerRequirements>
<Requirement type="REQUIREMENT_UNIT_FLANKING"/>
</OwnerRequirements>
<Argument name="Amount">3</Argument>
</Modifier>Plots that provide yields to the player. Used for plot-based yield bonuses.
<Modifier id="EXAMPLE" collection="COLLECTION_PLAYER_PLOT_YIELDS" effect="EFFECT_PLOT_ADJUST_YIELD">
<SubjectRequirements>
<Requirement type="REQUIREMENT_PLOT_RESOURCE_VISIBLE"/>
</SubjectRequirements>
<Argument name="YieldType">YIELD_GOLD</Argument>
<Argument name="Amount">1</Argument>
</Modifier>All plots providing yields (all players).
Plots providing yields to a specific city.
A single specific plot's yields.
All constructibles (buildings/improvements) belonging to the player.
These collections are used with the Narrative Events system.
The narrative story trigger location.
Nearest independent player to the story location.
Nearest independent player in homelands to story location.
Owner's commander nearest to story location.
Owner's highest level commander.
The city nearest to the unit.
The city a unit is currently occupying.
The district a unit is currently occupying.
Not all collections work with all effects. Common combinations:
| Collection | Common Effects |
|---|---|
COLLECTION_OWNER |
EFFECT_PLAYER_GRANT_YIELD, EFFECT_PLAYER_ADJUST_*, Scoring effects |
COLLECTION_PLAYER_CITIES |
EFFECT_CITY_ADJUST_YIELD, EFFECT_CITY_GRANT_UNIT, Production effects |
COLLECTION_PLAYER_CAPITAL_CITY |
EFFECT_CITY_* effects for capital-specific bonuses |
COLLECTION_OWNER_CITY |
EFFECT_CITY_* effects for building modifiers |
COLLECTION_PLAYER_UNITS |
EFFECT_UNIT_*, EFFECT_ARMY_* effects |
COLLECTION_PLAYER_COMBAT |
EFFECT_ADJUST_UNIT_STRENGTH_MODIFIER |
COLLECTION_UNIT_COMBAT |
EFFECT_ADJUST_UNIT_STRENGTH_MODIFIER (combat-specific) |
COLLECTION_PLAYER_PLOT_YIELDS |
EFFECT_PLOT_ADJUST_YIELD |
COLLECTION_PLAYER_DISTRICTS |
EFFECT_DISTRICT_* effects |
Collections gather all potential subjects, then SubjectRequirements filter them:
<Modifier id="COASTAL_CITY_BONUS" collection="COLLECTION_PLAYER_CITIES" effect="EFFECT_CITY_ADJUST_YIELD">
<SubjectRequirements>
<Requirement type="REQUIREMENT_PLOT_ADJACENT_TO_COAST"/>
<Requirement type="REQUIREMENT_CITY_IS_CITY"/>
</SubjectRequirements>
<Argument name="YieldType">YIELD_GOLD</Argument>
<Argument name="Amount">3</Argument>
</Modifier>This applies +3 gold only to coastal cities (filtering out inland cities and towns).
<Modifier id="PORT_OF_NATIONS_MOD_TRADE_ROUTE_CULTURE" collection="COLLECTION_OWNER" effect="EFFECT_PLAYER_ADJUST_YIELD_PER_NUM_TRADE_ROUTES">
<Argument name="YieldType">YIELD_CULTURE</Argument>
<Argument name="Amount">2</Argument>
</Modifier><Modifier id="STRATEGOI_MOD_COMMANDER_XP" collection="COLLECTION_PLAYER_UNITS" effect="EFFECT_ARMY_ADJUST_EXPERIENCE_RATE">
<SubjectRequirements>
<Requirement type="REQUIREMENT_UNIT_TAG_MATCHES">
<Argument name="Tag">UNIT_CLASS_COMMAND</Argument>
</Requirement>
</SubjectRequirements>
<Argument name="Percent">25</Argument>
</Modifier><Modifier id="AKHET_MOD_NAVIGABLE_RIVER_FOOD" collection="COLLECTION_PLAYER_PLOT_YIELDS" effect="EFFECT_PLOT_ADJUST_YIELD">
<SubjectRequirements>
<Requirement type="REQUIREMENT_PLOT_IS_RIVER">
<Argument name="Navigable">true</Argument>
</Requirement>
<Requirement type="REQUIREMENT_PLOT_DISTRICT_CLASS">
<Argument name="DistrictClass">RURAL, URBAN, CITYCENTER</Argument>
</Requirement>
</SubjectRequirements>
<Argument name="YieldType">YIELD_FOOD</Argument>
<Argument name="Amount">2</Argument>
</Modifier><Modifier id="CAPITAL_PRODUCTION_BONUS" collection="COLLECTION_PLAYER_CAPITAL_CITY" effect="EFFECT_CITY_ADJUST_YIELD">
<Argument name="YieldType">YIELD_PRODUCTION</Argument>
<Argument name="Amount">4</Argument>
</Modifier><Modifier id="HOLY_CITY_BONUS" collection="COLLECTION_CITIES_FOLLOWING_OWNER_RELIGION" effect="EFFECT_CITY_ADJUST_YIELD">
<Argument name="YieldType">YIELD_FAITH</Argument>
<Argument name="Amount">3</Argument>
</Modifier>In traditional database format, collections are defined in DynamicModifiers:
<DynamicModifiers>
<Row
ModifierType="MY_MODIFIER_TYPE"
CollectionType="COLLECTION_PLAYER_CITIES"
EffectType="EFFECT_CITY_ADJUST_YIELD"
/>
</DynamicModifiers>