Project

Profile

Help

HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. *Read more...*

Feature #871844 ยป 0030-Implement-impr_estimate_build_shield_cost.patch

Marko Lindqvist, 2020-05-05 12:47 AM

View differences:

client/citydlg_common.c
impr_build_shield_cost(pcity, pimprove));
} else {
fc_snprintf(buf[2], column_size, "%d",
impr_base_build_shield_cost(pimprove));
impr_estimate_build_shield_cost(pplayer, NULL, pimprove));
}
}
break;
client/gui-qt/citydlg.cpp
.arg(impr_build_shield_cost(pcity, building))
.arg(upkeep).toHtmlEscaped();
} else {
int base_cost = MAX(building->build_cost * game.info.shieldbox / 100, 1);
int cost_est = impr_estimate_build_shield_cost(client.conn.playing, NULL, building);
def_str += QString(_("Base Cost: %1, Upkeep: %2\n"))
.arg(base_cost)
def_str += QString(_("Cost Estimate: %1, Upkeep: %2\n"))
.arg(cost_est)
.arg(upkeep).toHtmlEscaped();
}
if (s1.compare(s2) != 0) {
common/improvement.c
return MAX(base * game.info.shieldbox / 100, 1);
}
/**********************************************************************//**
Returns estimate of the number of shields it takes to build this improvement.
pplayer and ptile can be NULL, but that might reduce quality of the
estimate.
**************************************************************************/
int impr_estimate_build_shield_cost(const struct player *pplayer,
const struct tile *ptile,
const struct impr_type *pimprove)
{
int base = pimprove->build_cost
* (100 +
get_target_bonus_effects(NULL,
pplayer, NULL, NULL, pimprove,
ptile, NULL, NULL, NULL, NULL,
NULL,
EFT_IMPR_BUILD_COST_PCT)) / 100;
return MAX(base * game.info.shieldbox / 100, 1);
}
/**********************************************************************//**
Returns the number of shields it takes to build this improvement.
**************************************************************************/
common/improvement.h
int impr_build_shield_cost(const struct city *pcity,
const struct impr_type *pimprove);
int impr_base_build_shield_cost(const struct impr_type *pimprove);
int impr_estimate_build_shield_cost(const struct player *pplayer,
const struct tile *ptile,
const struct impr_type *pimprove);
int impr_buy_gold_cost(const struct city *pcity, const struct impr_type *pimprove,
int shields_in_stock);
int impr_sell_gold(const struct impr_type *pimprove);
    (1-1/1)