28 #define LOG_NG LOG_STREAM(info, log_engine)
29 #define ERR_NG LOG_STREAM(err, log_engine)
39 std::vector<team>& teams = board.
teams();
42 if(teams.size() < 1) {
46 std::ostringstream report;
51 title =
_(
"Scenario Report");
52 }
else if(is_victory) {
54 report <<
"<b>" <<
_(
"You have emerged victorious!") <<
"</b>";
57 report <<
_(
"You have been defeated!");
63 int persistent_teams = 0;
64 for(
const team&
t : teams) {
75 for(
team&
t : teams) {
76 if(!
t.persistent() ||
t.lost()) {
80 const int finishing_bonus_per_turn = map.
villages().size() *
t.village_gold() +
t.base_income();
81 const int finishing_bonus =
t.carryover_bonus() * finishing_bonus_per_turn *
turns_left;
83 t.set_carryover_gold(
div100rounded((
t.gold() + finishing_bonus) *
t.carryover_percentage()));
85 if(!
t.is_local_human()) {
89 if(persistent_teams > 1) {
90 report <<
"\n\n<b>" <<
t.side_name() <<
"</b>";
95 if(
t.carryover_bonus() != 0) {
97 report <<
"\n\n<b>" <<
_(
"Turns finished early: ") <<
turns_left <<
"</b>\n"
98 <<
"<small>" <<
_(
"Early finish bonus: ") << finishing_bonus_per_turn <<
_(
" per turn") <<
"</small>\n"
99 <<
"<small>" <<
_(
"Total bonus: ") << finishing_bonus <<
"</small>\n";
106 report <<
"\n<small>" <<
_(
"Carryover percentage: ") <<
t.carryover_percentage() <<
"</small>";
109 if(
t.carryover_add()) {
118 symbols[
"gold"] = lexical_cast_default<std::string>(
t.carryover_gold());
122 if(
t.carryover_add()) {
123 if(
t.carryover_gold() > 0) {
125 "You will start the next scenario with $gold on top of the defined minimum starting gold.",
126 "You will start the next scenario with $gold on top of the defined minimum starting gold.",
127 t.carryover_gold(), symbols
132 "You will start the next scenario with the defined minimum starting gold.",
133 "You will start the next scenario with the defined minimum starting gold.",
134 t.carryover_gold(), symbols
139 "You will start the next scenario with $gold or its defined minimum starting gold, "
140 "whichever is higher.",
141 "You will start the next scenario with $gold or its defined minimum starting gold, "
142 "whichever is higher.",
143 t.carryover_gold(), symbols
148 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 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?