import {
ACTION_GROUP_BUNDLE,
CONSTRUCTIBLE_TYPE_TAG,
ConstructibleBuilder,
DISTRICT,
Mod,
ModifierBuilder,
UniqueQuarterBuilder,
COLLECTION,
EFFECT,
REQUIREMENT,
YIELD
} from "civ7-modding-tools";
const mod = new Mod({
id: 'my-quarter-mod',
version: '1.0',
});
// Step 1: Create first building
const warriorHall = new ConstructibleBuilder({
actionGroupBundle: ACTION_GROUP_BUNDLE.AGE_ANTIQUITY,
constructible: {
constructibleType: 'BUILDING_WARRIOR_HALL',
},
building: {},
typeTags: [
CONSTRUCTIBLE_TYPE_TAG.AGELESS,
CONSTRUCTIBLE_TYPE_TAG.UNIQUE,
CONSTRUCTIBLE_TYPE_TAG.MILITARY
],
constructibleValidDistricts: [
DISTRICT.URBAN,
DISTRICT.CITY_CENTER,
],
constructibleYieldChanges: [
{ yieldType: YIELD.PRODUCTION, yieldChange: 2 },
],
localizations: [
{
name: 'Warrior Hall',
description: 'Training hall for Dacian warriors.',
tooltip: '+2 Production.'
},
]
});
// Step 2: Create second building
const wolfShrine = new ConstructibleBuilder({
actionGroupBundle: ACTION_GROUP_BUNDLE.AGE_ANTIQUITY,
constructible: {
constructibleType: 'BUILDING_WOLF_SHRINE',
},
building: {},
typeTags: [
CONSTRUCTIBLE_TYPE_TAG.AGELESS,
CONSTRUCTIBLE_TYPE_TAG.UNIQUE,
CONSTRUCTIBLE_TYPE_TAG.CULTURE
],
constructibleValidDistricts: [
DISTRICT.URBAN,
DISTRICT.CITY_CENTER,
],
constructibleYieldChanges: [
{ yieldType: YIELD.CULTURE, yieldChange: 2 },
],
localizations: [
{
name: 'Wolf Shrine',
description: 'Sacred shrine to the wolf deity.',
tooltip: '+2 Culture.'
},
]
});
// Step 3: Create Unique Quarter
const dragonMountain = new UniqueQuarterBuilder({
actionGroupBundle: ACTION_GROUP_BUNDLE.AGE_ANTIQUITY,
uniqueQuarter: {
uniqueQuarterType: 'QUARTER_DRAGON_MOUNTAIN',
buildingType1: warriorHall.constructible.constructibleType,
buildingType2: wolfShrine.constructible.constructibleType,
},
localizations: [
{
name: 'Dragon Mountain',
description: 'Sacred military training complex of the Dacians.'
},
]
});
// Step 4: Create a modifier for the Unique Quarter
const quarterAbility = new ModifierBuilder({
modifier: {
collection: COLLECTION.ALL_CITIES,
effect: EFFECT.CITY_ADJUST_YIELD,
permanent: true,
requirements: [{
type: REQUIREMENT.CITY_HAS_UNIQUE_QUARTER,
arguments: [{ name: 'UniqueQuarterType', value: 'QUARTER_DRAGON_MOUNTAIN' }]
}],
arguments: [
{ name: "YieldType", value: YIELD.PRODUCTION },
{ name: "Amount", value: 2 },
{ name: "Tooltip", value: 'LOC_QUARTER_DRAGON_MOUNTAIN_NAME' }
]
}
});
// Step 5: Bind the modifier to the Unique Quarter
dragonMountain.bind([quarterAbility]);
// Step 6: Add everything to the mod
mod.add([warriorHall, wolfShrine, dragonMountain]);
// Build the mod
mod.build('./dist');