Project

General

Profile

Feature #512 ยป 0045-Add-support-for-Local-range-Tech-requirements.patch

Marko Lindqvist, 04/28/2024 01:39 PM

View differences:

common/requirements.c
case VUT_EXTRAFLAG:
invalid = (req.range > REQ_RANGE_TRADE_ROUTE);
break;
case VUT_ADVANCE:
case VUT_TECHFLAG:
case VUT_ACHIEVEMENT:
case VUT_MINTECHS:
invalid = (req.range < REQ_RANGE_PLAYER);
break;
case VUT_ADVANCE:
invalid = (req.range < REQ_RANGE_PLAYER
&& req.range != REQ_RANGE_LOCAL);
break;
case VUT_GOVERNMENT:
case VUT_AI_LEVEL:
case VUT_STYLE:
......
/* Not a 'surviving' requirement. */
switch (req->range) {
case REQ_RANGE_PLAYER:
if (NULL != context->player) {
if (context->player != nullptr) {
return BOOL_TO_TRISTATE(TECH_KNOWN == research_invention_state
(research_get(context->player), tech));
} else {
......
case REQ_RANGE_TEAM:
case REQ_RANGE_ALLIANCE:
case REQ_RANGE_WORLD:
if (NULL == context->player) {
if (context->player == nullptr) {
return TRI_MAYBE;
}
players_iterate_alive(plr2) {
......
return TRI_NO;
case REQ_RANGE_LOCAL:
if (context->player == nullptr) {
return TRI_MAYBE;
}
if (research_get(context->player)->researching == tech) {
return TRI_YES;
}
return TRI_NO;
case REQ_RANGE_TILE:
case REQ_RANGE_CADJACENT:
case REQ_RANGE_ADJACENT:
doc/README.effects
Requirement types and supported ranges
======================================
Tech: World, Alliance, Team, Player
Tech: World, Alliance, Team, Player, Local
TechFlag: World, Alliance, Team, Player
MinTechs: World, Player
MinCities: Player
    (1-1/1)