The Battle for Wesnoth  1.19.5+dev
Macros | Functions | Variables
advancement.cpp File Reference

Fighting. More...

#include "actions/advancement.hpp"
#include "actions/vision.hpp"
#include "ai/manager.hpp"
#include "ai/lua/aspect_advancements.hpp"
#include "game_events/pump.hpp"
#include "preferences/preferences.hpp"
#include "game_data.hpp"
#include "gettext.hpp"
#include "gui/dialogs/unit_advance.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/types.hpp"
#include "units/animation_component.hpp"
#include "units/helper.hpp"
#include "video.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(warn, 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

◆ DBG_NG

#define DBG_NG   LOG_STREAM(debug, log_engine)

Definition at line 45 of file advancement.cpp.

◆ ERR_NG

#define ERR_NG   LOG_STREAM(err, log_engine)

Definition at line 48 of file advancement.cpp.

◆ LOG_CF

#define LOG_CF   LOG_STREAM(info, log_config)

Definition at line 51 of file advancement.cpp.

◆ LOG_DP

#define LOG_DP   LOG_STREAM(info, log_display)

Definition at line 54 of file advancement.cpp.

◆ LOG_NG

#define LOG_NG   LOG_STREAM(info, log_engine)

Definition at line 46 of file advancement.cpp.

◆ WRN_NG

#define WRN_NG   LOG_STREAM(warn, log_engine)

Definition at line 47 of file advancement.cpp.

Function Documentation

◆ advance_unit()

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 344 of file advancement.cpp.

References actions::actor_sighted(), statistics_t::advance_unit(), actions::shroud_clearer::clear_unit(), resources::controller, utils::decayed_is_same, prefs::encountered_units(), unit_map::erase(), unit_map::find(), game_events::wml_event_pump::fire(), gui2::event::implementation::fire_event(), actions::shroud_clearer::fire_events(), resources::game_events, resources::gameboard, prefs::get(), get_advanced_unit(), get_amla_unit(), actions::get_sides_not_seeing(), unit_map::insert(), LOG_CF, LOG_NG, game_events::manager::pump(), play_controller::statistics(), game_board::units(), unit_map::iterator_base< iter_types >::valid(), and resources::whiteboard.

Referenced by ai::helper_advance_unit().

◆ advance_unit_at()

void advance_unit_at ( const advance_unit_params params)

◆ get_advanced_unit()

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 312 of file advancement.cpp.

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

Referenced by advance_unit().

◆ get_amla_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 335 of file advancement.cpp.

References unit::clone().

Referenced by advance_unit().

Variable Documentation

◆ log_config

lg::log_domain log_config("config") ( "config"  )
static

◆ log_display

lg::log_domain log_display("display") ( "display"  )
static

◆ log_engine

lg::log_domain log_engine("engine") ( "engine"  )
static