The Battle for Wesnoth  1.13.10+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Macros | Functions | Variables
advancement.cpp File Reference

Fighting. More...

#include "actions/advancement.hpp"
#include "actions/vision.hpp"
#include "ai/lua/aspect_advancements.hpp"
#include "game_events/pump.hpp"
#include "preferences/game.hpp"
#include "game_data.hpp"
#include "gui/dialogs/unit_advance.hpp"
#include "gui/widgets/window.hpp"
#include "log.hpp"
#include "play_controller.hpp"
#include "random.hpp"
#include "resources.hpp"
#include "statistics.hpp"
#include "synced_user_choice.hpp"
#include "units/unit.hpp"
#include "units/abilities.hpp"
#include "units/animation_component.hpp"
#include "units/udisplay.hpp"
#include "units/helper.hpp"
#include "whiteboard/manager.hpp"
Include dependency graph for advancement.cpp:

Go to the source code of this file.

Macros

#define DBG_NG   LOG_STREAM(debug, log_engine)
 
#define LOG_NG   LOG_STREAM(info, log_engine)
 
#define WRN_NG   LOG_STREAM(err, log_engine)
 
#define ERR_NG   LOG_STREAM(err, log_engine)
 
#define LOG_CF   LOG_STREAM(info, log_config)
 
#define LOG_DP   LOG_STREAM(info, log_display)
 

Functions

void advance_unit_at (const advance_unit_params &params)
 
unit_ptr get_advanced_unit (const unit &u, const std::string &advance_to)
 Returns the advanced version of a unit (with traits and items retained). More...
 
unit_ptr get_amla_unit (const unit &u, const config &mod_option)
 Returns the AMLA-advanced version of a unit (with traits and items retained). More...
 
void advance_unit (map_location loc, const advancement_option &advance_to, bool fire_event)
 Function which will advance the unit at loc to 'advance_to'. More...
 

Variables

static lg::log_domain log_engine ("engine")
 
static lg::log_domain log_config ("config")
 
static lg::log_domain log_display ("display")
 

Detailed Description

Fighting.

Definition in file advancement.cpp.

Macro Definition Documentation

#define DBG_NG   LOG_STREAM(debug, log_engine)

Definition at line 43 of file advancement.cpp.

Referenced by advance_unit_at().

#define ERR_NG   LOG_STREAM(err, log_engine)

Definition at line 46 of file advancement.cpp.

Referenced by advance_unit_at().

#define LOG_CF   LOG_STREAM(info, log_config)

Definition at line 49 of file advancement.cpp.

Referenced by advance_unit().

#define LOG_DP   LOG_STREAM(info, log_display)

Definition at line 52 of file advancement.cpp.

#define LOG_NG   LOG_STREAM(info, log_engine)

Definition at line 44 of file advancement.cpp.

Referenced by advance_unit(), and advance_unit_at().

#define WRN_NG   LOG_STREAM(err, log_engine)

Definition at line 45 of file advancement.cpp.

Referenced by advance_unit_at().

Function Documentation

void advance_unit ( map_location  loc,
const advancement_option advance_to,
bool  fire_event = true 
)

Function which will advance the unit at loc to 'advance_to'.

which is eigher a type to advance to or a config containing the [advancement] to perform an amla. Note that 'loc' is not a reference, because if it were a reference, we couldn't safely pass in a reference to the item in the map that we're going to delete, since deletion would invalidate the reference.

Definition at line 314 of file advancement.cpp.

References actions::actor_sighted(), statistics::advance_unit(), actions::shroud_clearer::clear_unit(), preferences::encountered_units(), unit_map::erase(), unit_map::find(), game_events::wml_event_pump::fire(), actions::shroud_clearer::fire_events(), resources::game_events, resources::gameboard, get_advanced_unit(), get_amla_unit(), actions::get_sides_not_seeing(), unit_map::insert(), LOG_CF, LOG_NG, game_events::manager::pump(), game_board::units(), unit_map::iterator_base< iter_types >::valid(), and resources::whiteboard.

Referenced by ai::helper_advance_unit().

void advance_unit_at ( const advance_unit_params params)
unit_ptr get_advanced_unit ( const unit u,
const std::string &  advance_to 
)

Returns the advanced version of a unit (with traits and items retained).

Definition at line 282 of file advancement.cpp.

References unit_type_data::find(), unit::STATE_PETRIFIED, unit::STATE_POISONED, unit::STATE_SLOWED, and unit_types.

Referenced by advance_unit().

unit_ptr get_amla_unit ( const unit u,
const config mod_option 
)

Returns the AMLA-advanced version of a unit (with traits and items retained).

Definition at line 305 of file advancement.cpp.

Referenced by advance_unit().

Variable Documentation

lg::log_domain log_config("config")
static
lg::log_domain log_display("display")
static
lg::log_domain log_engine("engine")
static