The Battle for Wesnoth  1.19.5+dev
ability_tags.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2024 - 2024
3  Part of the Battle for Wesnoth Project https://www.wesnoth.org/
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY.
10  See the COPYING file for more details.
11 */
12 
13 #pragma once
14 
15 #include "enum_base.hpp"
16 
17 #include <set>
18 
20 {
21  // abilities
22  static constexpr const char* const heals = "heals";
23  static constexpr const char* const regenerate = "regenerate";
24  static constexpr const char* const resistance = "resistance";
25  static constexpr const char* const leadership = "leadership";
26  static constexpr const char* const skirmisher = "skirmisher";
27  static constexpr const char* const illuminates = "illuminates";
28  static constexpr const char* const teleport = "teleport";
29  static constexpr const char* const hides = "hides";
30  static constexpr const char* const dummy = "dummy";
31  // weapon specials
32  static constexpr const char* const attacks = "attacks";
33  static constexpr const char* const berserk = "berserk";
34  static constexpr const char* const chance_to_hit = "chance_to_hit";
35  static constexpr const char* const damage = "damage";
36  static constexpr const char* const damage_type = "damage_type";
37  static constexpr const char* const disable = "disable";
38  static constexpr const char* const drains = "drains";
39  static constexpr const char* const firststrike = "firststrike";
40  static constexpr const char* const heal_on_hit = "heal_on_hit";
41  static constexpr const char* const petrifies = "petrifies";
42  static constexpr const char* const plague = "plague";
43  static constexpr const char* const poison = "poison";
44  static constexpr const char* const slow = "slow";
45  static constexpr const char* const swarm = "swarm";
46 
48 
49  static const std::set<std::string> weapon_number_tags()
50  {
51  static std::set<std::string> tags{attacks, damage, chance_to_hit, berserk, swarm, drains, heal_on_hit};
52  return tags;
53  }
54 
55  static const std::set<std::string> no_weapon_number_tags()
56  {
57  static std::set<std::string> tags{disable, plague, slow, petrifies, firststrike, poison, damage_type};
58  return tags;
59  }
60 
61  static const std::set<std::string> ability_value_tags()
62  {
63  static std::set<std::string> tags{resistance, leadership, heals, regenerate, illuminates};
64  return tags;
65  }
66 
67  static const std::set<std::string> ability_no_value_tags()
68  {
69  static std::set<std::string> tags{teleport, hides, skirmisher};
70  return tags;
71  }
72 };
#define ENUM_AND_ARRAY(...)
Definition: enum_base.hpp:96
void set(CURSOR_TYPE type)
Use the default parameter to reset cursors.
Definition: cursor.cpp:176
static constexpr const char *const regenerate
static constexpr const char *const drains
static constexpr const char *const firststrike
static constexpr const char *const resistance
static constexpr const char *const plague
static constexpr const char *const damage_type
static constexpr const char *const dummy
static constexpr const char *const disable
static constexpr const char *const swarm
static constexpr const char *const berserk
static constexpr const char *const heal_on_hit
static const std::set< std::string > weapon_number_tags()
static constexpr const char *const illuminates
static constexpr const char *const poison
static constexpr const char *const slow
static constexpr const char *const teleport
static constexpr const char *const attacks
static constexpr const char *const chance_to_hit
static const std::set< std::string > ability_no_value_tags()
static const std::set< std::string > no_weapon_number_tags()
static constexpr const char *const petrifies
static constexpr const char *const hides
static constexpr const char *const damage
static constexpr const char *const skirmisher
static constexpr const char *const heals
static const std::set< std::string > ability_value_tags()
static constexpr const char *const leadership
The base template for associating string values with enum values.
Definition: enum_base.hpp:33