-
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 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>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>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>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>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>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_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_PLAYER_PLOT_YIELDS |
EFFECT_PLOT_ADJUST_YIELD |
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>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>