The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
shroud_clearing_action.cpp
Go to the documentation of this file.
2 
3 #include "move.hpp" //get_village
4 #include "resources.hpp"
5 #include "team.hpp"
6 #include "log.hpp"
7 #include "units/udisplay.hpp"
8 #include "game_board.hpp"
9 #include "map/map.hpp"
10 #include "play_controller.hpp"
11 
12 namespace actions {
14 {
15  team &current_team = resources::controller->current_team();
16  const map_location back = route.back();
17  if(resources::gameboard->map().is_village(back)) {
18  get_village(back, original_village_owner, nullptr, false);
19  //MP_COUNTDOWN take away capture bonus
21  current_team.set_action_bonus_count(current_team.action_bonus_count() - 1);
22  }
23  }
24 }
26 {
27  team &current_team = resources::controller->current_team();
28  const map_location back = route.back();
29  if(resources::gameboard->map().is_village(back)) {
30  get_village(back, current_team.side(), nullptr, false);
31  //MP_COUNTDOWN restore capture bonus
33  current_team.set_action_bonus_count(1 + current_team.action_bonus_count());
34  }
35  }
36 }
37 }
play_controller * controller
Definition: resources.cpp:21
void take_village()
Change village owner on redo.
bool get_village(const map_location &loc, int side, bool *action_timebonus, bool fire_event)
Makes it so the village at the given location is owned by the given side.
Definition: move.cpp:140
bool take_village_timebonus
Whether this actions got a timebonus becasue it took a village.
-file sdl_utils.hpp
void return_village()
Change village owner on undo.
This class stores all the data for a single 'side' (in game nomenclature).
Definition: team.hpp:50
game_board * gameboard
Definition: resources.cpp:20
Encapsulates the map of the game.
Definition: location.hpp:38
Various functions related to moving units.
t_route route
The hexes occupied by the affected unit during this action.
int side() const
Definition: team.hpp:193
int original_village_owner
The number of the side that preivously owned the village that the unit stepped on Note...
void set_action_bonus_count(const int count)
Definition: team.hpp:219
Standard logging facilities (interface).
int action_bonus_count() const
Definition: team.hpp:218
Display units performing various actions: moving, attacking, and dying.