StandardGaussian
Chieftain
- Joined
- Mar 8, 2017
- Messages
- 15
I have a unique district (Imperial Treasury) whose abilities read as follows:
+1 Gold if adjacent to City Center
+2 Production is adjacent to at least one Strategic Resource
The first bit is easily handled through the usual District_Adjacencies table stuff. The second is handled by a modifier that looks like this:
and the requirement under ADJACENT_TO_STRATEGIC_REQUIREMENTS is:
Now, that works like a charm, except I get the +2 Production bonus when my district is next to a strat resource that I haven't discovered yet.
I know that I can rework the requirements to list out every strat resource visiblity req (REQUIREMENT_PLAYER_HAS_RESOURCE_VISIBILITY) and apply them all separately to get the right effect.
The only problem, and the reason for my post, is that there is no RequirementType for being adjacent to a specific resource. Specific resource adjacency requirements are hardcoded for various wonders (Great Zimbabwe) and whatnot, but for adjacency requirements the only adjacency option for resources is to go by the entire ResourceClass.
That means that I can't make a RequirementSet with two requirements like :
1. District is adjacent to Niter
2. Player can see Niter
Without that, I don't know a way to make my district only provide its strat resource adjacency bonus if I have actually discovered it. Requirement Types have specific arguments for improvement type, district type, feature type, etc:, but since the devs didn't need a specific resource condition in their base game, they never programmed an appropriate RequirementType for it.
There is a "REQUIREMENT_PLOT_RESOURCE_TYPE_MATCHES" ReqType, and one for tags too, but I don't know how to incorporate that into my district. I'd need to be able to reference specific plots in my definitions for my district modifiers.
Using strat resources specifically is kind of this civ's thing, so I'd like to keep this ability if it's at all possible. The entire problem lies in the District_YieldChanges table structure: "AdjacentResource" is a boolean and cares about being next to any resource (this is for Hansa), so I have to use a modifier to implement my resource adjacency, and it just kind of looks like there's no real way to do it right.
If ya'll see something I'm missing or know of some hoops I can try jumping through, I'd be happy to hear about it!
+1 Gold if adjacent to City Center
+2 Production is adjacent to at least one Strategic Resource
The first bit is easily handled through the usual District_Adjacencies table stuff. The second is handled by a modifier that looks like this:
Code:
INSERT INTO Modifiers (ModifierId, ModifierType, RunOnce, Permanent, SubjectRequirementSetId)
VALUES ("MODIFIER_DISTRICT_BOOST_TREASURY_STRATEGIC", "MODIFIER_PLAYER_DISTRICT_ADJUST_YIELD_CHANGE", 0,0, "ADJACENT_TO_STRATEGIC_REQUIREMENTS");
and the requirement under ADJACENT_TO_STRATEGIC_REQUIREMENTS is:
Code:
INSERT INTO Requirements (RequirementId, RequirementType)
VALUES ("REQUIRES_PLOT_ADJACENT_TO_STRATEGIC", "REQUIREMENT_PLOT_ADJACENT_RESOURCE_CLASS_TYPE_MATCHES");
INSERT INTO RequirementArguments(RequirementId, Name, Value)
VALUES ("REQUIRES_PLOT_ADJACENT_TO_STRATEGIC", "ResourceClassType", "RESOURCECLASS_STRATEGIC");
Now, that works like a charm, except I get the +2 Production bonus when my district is next to a strat resource that I haven't discovered yet.
I know that I can rework the requirements to list out every strat resource visiblity req (REQUIREMENT_PLAYER_HAS_RESOURCE_VISIBILITY) and apply them all separately to get the right effect.
The only problem, and the reason for my post, is that there is no RequirementType for being adjacent to a specific resource. Specific resource adjacency requirements are hardcoded for various wonders (Great Zimbabwe) and whatnot, but for adjacency requirements the only adjacency option for resources is to go by the entire ResourceClass.
That means that I can't make a RequirementSet with two requirements like :
1. District is adjacent to Niter
2. Player can see Niter
Without that, I don't know a way to make my district only provide its strat resource adjacency bonus if I have actually discovered it. Requirement Types have specific arguments for improvement type, district type, feature type, etc:, but since the devs didn't need a specific resource condition in their base game, they never programmed an appropriate RequirementType for it.
There is a "REQUIREMENT_PLOT_RESOURCE_TYPE_MATCHES" ReqType, and one for tags too, but I don't know how to incorporate that into my district. I'd need to be able to reference specific plots in my definitions for my district modifiers.
Using strat resources specifically is kind of this civ's thing, so I'd like to keep this ability if it's at all possible. The entire problem lies in the District_YieldChanges table structure: "AdjacentResource" is a boolean and cares about being next to any resource (this is for Hansa), so I have to use a modifier to implement my resource adjacency, and it just kind of looks like there's no real way to do it right.
If ya'll see something I'm missing or know of some hoops I can try jumping through, I'd be happy to hear about it!