replaced gamestatus argument by tod_manager in combat_modifier()
This commit is contained in:
parent
d5cd0bc754
commit
fd7a06c832
4 changed files with 7 additions and 6 deletions
|
@ -37,6 +37,7 @@
|
|||
#include "unit_display.hpp"
|
||||
#include "wml_exception.hpp"
|
||||
#include "formula_string_utils.hpp"
|
||||
#include "tod_manager.hpp"
|
||||
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
@ -682,7 +683,7 @@ battle_context::unit_stats::unit_stats(const unit &u, const map_location& u_loc,
|
|||
int damage_multiplier = 100;
|
||||
|
||||
// Time of day bonus.
|
||||
damage_multiplier += combat_modifier(status, units, u_loc, u.alignment(), u.is_fearless(), map);
|
||||
damage_multiplier += combat_modifier(tod_mng, units, u_loc, u.alignment(), u.is_fearless(), map);
|
||||
|
||||
// Leadership bonus.
|
||||
int leader_bonus = 0;
|
||||
|
@ -1997,14 +1998,14 @@ time_of_day timeofday_at(const gamestatus& status,const unit_map& units,const ma
|
|||
return tod;
|
||||
}
|
||||
|
||||
int combat_modifier(const gamestatus& status,
|
||||
int combat_modifier(const tod_manager& tod_mng,
|
||||
const unit_map& units,
|
||||
const map_location& loc,
|
||||
unit_type::ALIGNMENT alignment,
|
||||
bool is_fearless,
|
||||
const gamemap& map)
|
||||
{
|
||||
const time_of_day& tod = timeofday_at(status,units,loc,map);
|
||||
const time_of_day& tod = tod_mng.time_of_day_at(units,loc,map);
|
||||
|
||||
int bonus = tod.lawful_bonus;
|
||||
|
||||
|
|
|
@ -307,7 +307,7 @@ time_of_day timeofday_at(const gamestatus& status,
|
|||
* Returns the amount that a unit's damage should be multiplied by
|
||||
* due to the current time of day.
|
||||
*/
|
||||
int combat_modifier(const gamestatus& status,
|
||||
int combat_modifier(const tod_manager& tod_mng,
|
||||
const unit_map& units,
|
||||
const map_location& loc,
|
||||
unit_type::ALIGNMENT alignment,
|
||||
|
|
|
@ -320,7 +320,7 @@ private:
|
|||
loc = &u_call->get_location();
|
||||
}
|
||||
|
||||
return variant(combat_modifier(ai_.get_info().state, ai_.get_info().units, *loc, un.alignment(), un.is_fearless(), ai_.get_info().map));
|
||||
return variant(combat_modifier(ai_.get_info().tod_manager_, ai_.get_info().units, *loc, un.alignment(), un.is_fearless(), ai_.get_info().map));
|
||||
}
|
||||
|
||||
const formula_ai& ai_;
|
||||
|
|
|
@ -238,7 +238,7 @@ void battle_prediction_pane::get_unit_strings(const battle_context::unit_stats&
|
|||
}
|
||||
|
||||
// Time of day modifier.
|
||||
int tod_modifier = combat_modifier(status_, units_, u_loc, u.alignment(), u.is_fearless(), map_);
|
||||
int tod_modifier = combat_modifier(tod_manager_, units_, u_loc, u.alignment(), u.is_fearless(), map_);
|
||||
if(tod_modifier != 0) {
|
||||
left_strings.push_back(_("Time of day"));
|
||||
str.str("");
|
||||
|
|
Loading…
Add table
Reference in a new issue