29 #define LOG_NG LOG_STREAM(info, log_engine)
30 #define ERR_NG LOG_STREAM(err, log_engine)
40 std::vector<team>& teams = board.
teams();
43 if(teams.size() < 1) {
47 std::ostringstream report;
52 title =
_(
"Scenario Report");
53 }
else if(is_victory) {
58 report <<
_(
"You have been defeated!");
64 int persistent_teams = 0;
65 for(
const team&
t : teams) {
76 for(
team&
t : teams) {
77 if(!
t.persistent() ||
t.lost()) {
81 const int finishing_bonus_per_turn = map.
villages().size() *
t.village_gold() +
t.base_income();
82 const int finishing_bonus =
t.carryover_bonus() * finishing_bonus_per_turn *
turns_left;
84 t.set_carryover_gold(
div100rounded((
t.gold() + finishing_bonus) *
t.carryover_percentage()));
86 if(!
t.is_local_human()) {
90 if(persistent_teams > 1) {
96 if(
t.carryover_bonus() != 0) {
101 _(
"Early finish bonus: "), finishing_bonus_per_turn,
_(
" per turn"),
"\n",
102 _(
"Total bonus: "), finishing_bonus,
"\n");
109 report <<
"\n" <<
markup::tag(
"small",
_(
"Carryover percentage: "),
t.carryover_percentage());
112 if(
t.carryover_add()) {
121 symbols[
"gold"] = lexical_cast_default<std::string>(
t.carryover_gold());
125 if(
t.carryover_add()) {
126 if(
t.carryover_gold() > 0) {
128 "You will start the next scenario with $gold on top of the defined minimum starting gold.",
129 "You will start the next scenario with $gold on top of the defined minimum starting gold.",
130 t.carryover_gold(), symbols
135 "You will start the next scenario with the defined minimum starting gold.",
136 "You will start the next scenario with the defined minimum starting gold.",
137 t.carryover_gold(), symbols
142 "You will start the next scenario with $gold or its defined minimum starting gold, "
143 "whichever is higher.",
144 "You will start the next scenario with $gold or its defined minimum starting gold, "
145 "whichever is higher.",
146 t.carryover_gold(), symbols
151 report <<
"\n" << goldmsg;
static lg::log_domain log_engine("engine")
void carryover_show_gold(game_state &state, bool hidden, bool is_observer, bool is_test)
calculates the amount of gold carried over for each team, stores the data in the team object and show...
virtual const std::vector< team > & teams() const override
virtual const gamemap & map() const override
const std::string & next_scenario() const
utils::optional< end_level_data > end_level_data_
virtual const game_data * get_game_data() const override
Inherited from filter_context.
virtual const tod_manager & get_tod_man() const override
Inherited from filter_context.
Encapsulates the map of the game.
const std::vector< map_location > & villages() const
Return a list of the locations of villages on the map.
This class stores all the data for a single 'side' (in game nomenclature).
int number_of_turns() const
static std::string _(const char *str)
Standard logging facilities (interface).
constexpr int div100rounded(int num)
Guarantees portable results for division by 100; round half up, to the nearest integer.
void show_transient_message(const std::string &title, const std::string &message, const std::string &image, const bool message_use_markup, const bool title_use_markup)
Shows a transient message to the user.
std::string tag(const std::string &tag_name, Args &&... contents)
std::string bold(Args &&... data)
std::string half_signed_value(int val)
Sign with Unicode "−" if negative.
std::map< std::string, t_string > string_map
Additional information on the game outcome which can be provided by WML.
bool proceed_to_next_level
whether to proceed to the next scenario, equals is_victory in sp.
transient_end_level transient
bool carryover_report
Should a summary of the scenario outcome be displayed?