summaryrefslogtreecommitdiff
path: root/src/monster_spell_flag.hpp
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2016-06-20 22:49:05 +0200
committerBardur Arantsson <bardur@scientician.net>2016-06-20 22:49:05 +0200
commit59b5314b6b7880cfda73f34aed03a700fd523017 (patch)
tree4b5255289c8216f2d7dcfac2824045e5c0acdc45 /src/monster_spell_flag.hpp
parentfa5083020d4cc4d6d7471b461c430d40ed36c02e (diff)
Rework RF{4,5,6}_* monster spell flags to flag_set<>
Diffstat (limited to 'src/monster_spell_flag.hpp')
-rw-r--r--src/monster_spell_flag.hpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/monster_spell_flag.hpp b/src/monster_spell_flag.hpp
new file mode 100644
index 00000000..3de649ec
--- /dev/null
+++ b/src/monster_spell_flag.hpp
@@ -0,0 +1,20 @@
+#pragma once
+
+#include "monster_spell_flag_set.hpp"
+#include <boost/preprocessor/cat.hpp>
+
+//
+// Define flag set for each flag.
+//
+#define SF(tier, index, name, is_summon, is_annoy, is_damage, is_bolt, is_smart, is_innate, is_escape, is_tactic, is_haste, is_heal) \
+ DECLARE_FLAG(monster_spell_flag_set, BOOST_PP_CAT(SF_,name), tier, index)
+#include "monster_spell_flag_list.hpp"
+#undef SF
+
+//
+// Define index for each flag.
+//
+#define SF(tier, index, name, is_summon, is_annoy, is_damage, is_bolt, is_smart, is_innate, is_escape, is_tactic, is_haste, is_heal) \
+ constexpr std::size_t BOOST_PP_CAT(BOOST_PP_CAT(SF_,name), _IDX) = (tier - 1) * 32 + index;
+#include "monster_spell_flag_list.hpp"
+#undef SF