I want to add a modifier with SQL. I'm checking whether the plot is adjacent to the city center (or a village district I'm working on) and if it has either a farm, pasture, camp or fishingboat. In that case I want to give the tile another +1 food. (In the case of a mine or quarry, +1 prod and all other +1 gold) I'm stuck because of not being sure how to check whether the improvement is one of these 4 for food or one of the two for prod. There's a requirement that checks for PLOT_HAS_FARM or PLOT_HAS_ANY_IMPROVEMENT, etc. But the one I threw in the code below does not exist, of course.
Since I need to check for multiple requirements; adjacent to city center/village (and later on, if a building is present in the village) AND available improvement, I need to set the RequirementSetType to TEST_ALL.
Can a modifier in the modifier table have multiple requirementSetId's? One where there's a TEST_ALL for checking adjacency and another RequirementSetId for a TEST_ANY to check if any of the Farm/Pasture/Etc is true? Or is there another way of going about this?
Since I need to check for multiple requirements; adjacent to city center/village (and later on, if a building is present in the village) AND available improvement, I need to set the RequirementSetType to TEST_ALL.
Can a modifier in the modifier table have multiple requirementSetId's? One where there's a TEST_ALL for checking adjacency and another RequirementSetId for a TEST_ANY to check if any of the Farm/Pasture/Etc is true? Or is there another way of going about this?
Code:
INSERT INTO Modifiers
(ModifierId, ModifierType, SubjectRequirementSetId)
VALUES ('IMPROVED_TILE_ADJACENCY_CITY_CENTER_BONUS_FOOD', 'MODIFIER_SINGLE_PLOT_ADJUST_PLOT_YIELDS', 'REQ_IMPROVED_TILE_IS_ADJACENT_TO_CITY_CENTER');
INSERT INTO ModifierArguments
(ModifierId, Name, Value)
VALUES ('IMPROVED_TILE_ADJACENCY_CITY_CENTER_BONUS_FOOD', 'YieldType', 'YIELD_FOOD'),
('IMPROVED_TILE_ADJACENCY_CITY_CENTER_BONUS_FOOD', 'Amount', 1);
INSERT INTO RequirementSets
(RequirementSetId, RequirementSetType)
VALUES ('REQ_IMPROVED_TILE_IS_ADJACENT_TO_CITY_CENTER', 'REQUIREMENTSET_TEST_ALL');
INSERT INTO RequirementSetRequirements
(RequirementSetId, RequirementId)
VALUES ('REQ_IMPROVED_TILE_IS_ADJACENT_TO_CITY_CENTER', 'IMPROVED_TILE_IS_ADJ_TO_CITY_CENTER'),
???
('REQ_IMPROVED_TILE_IS_ADJACENT_TO_CITY_CENTER', 'REQ_IMPROVED_TILE_HAS_FARM_PASTURE_CAMP_FISHINGBOAT'),
???
INSERT INTO Requirements
(RequirementId, RequirementType, Inverse)
VALUES ('IMPROVED_TILE_IS_ADJ_TO_CITY_CENTER', 'REQUIREMENT_PLOT_ADJACENT_DISTRICT_TYPE_MATCHES', 0);
INSERT INTO RequirementArguments
(RequirementId, Name, Value)
VALUES ('IMPROVED_TILE_IS_ADJ_TO_CITY_CENTER', 'DistrictType', 'DISTRICT_CITY_CENTER'),
('IMPROVED_TILE_IS_ADJ_TO_CITY_CENTER', 'MaxRange', 1);