diff options
Diffstat (limited to 'src/map/battle.t.hpp')
-rw-r--r-- | src/map/battle.t.hpp | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/src/map/battle.t.hpp b/src/map/battle.t.hpp index 9685ae7..53c34ff 100644 --- a/src/map/battle.t.hpp +++ b/src/map/battle.t.hpp @@ -1,5 +1,4 @@ -#ifndef TMWA_MAP_BATTLE_T_HPP -#define TMWA_MAP_BATTLE_T_HPP +#pragma once // battle.t.hpp - Not so scary code. // // Copyright © ????-2004 Athena Dev Teams @@ -21,10 +20,15 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. -# include "../sanity.hpp" +#include "fwd.hpp" -# include "../generic/enum.hpp" +#include <cstdint> +#include "../generic/enum.hpp" + + +namespace tmwa +{ namespace e { enum class BF : uint16_t @@ -65,11 +69,11 @@ struct BCT }; constexpr -BCT operator & (BCT l, BCT r) { return {uint8_t(l.lo & r.lo), uint8_t(l.mid & r.mid), uint8_t(l.classic & r.classic), uint8_t(l.level & r.level), uint8_t(l.unused & r.unused) }; } +BCT operator & (BCT l, BCT r) { return {static_cast<uint8_t>(l.lo & r.lo), static_cast<uint8_t>(l.mid & r.mid), static_cast<uint8_t>(l.classic & r.classic), static_cast<uint8_t>(l.level & r.level), static_cast<uint8_t>(l.unused & r.unused) }; } constexpr -BCT operator | (BCT l, BCT r) { return {uint8_t(l.lo | r.lo), uint8_t(l.mid | r.mid), uint8_t(l.classic | r.classic), uint8_t(l.level | r.level), uint8_t(l.unused | r.unused) }; } +BCT operator | (BCT l, BCT r) { return {static_cast<uint8_t>(l.lo | r.lo), static_cast<uint8_t>(l.mid | r.mid), static_cast<uint8_t>(l.classic | r.classic), static_cast<uint8_t>(l.level | r.level), static_cast<uint8_t>(l.unused | r.unused) }; } constexpr -BCT operator ^ (BCT l, BCT r) { return {uint8_t(l.lo ^ r.lo), uint8_t(l.mid ^ r.mid), uint8_t(l.classic ^ r.classic), uint8_t(l.level ^ r.level), uint8_t(l.unused ^ r.unused) }; } +BCT operator ^ (BCT l, BCT r) { return {static_cast<uint8_t>(l.lo ^ r.lo), static_cast<uint8_t>(l.mid ^ r.mid), static_cast<uint8_t>(l.classic ^ r.classic), static_cast<uint8_t>(l.level ^ r.level), static_cast<uint8_t>(l.unused ^ r.unused) }; } inline BCT& operator &= (BCT& l, BCT r) { return l = l & r; } inline @@ -237,15 +241,4 @@ earray<Races, Race, Race::COUNT> race_shift //= Races::boss, Races::other, }}; - -enum class DamageType : uint8_t -{ - NORMAL = 0x00, - TAKEITEM = 0x01, - RETURNED = 0x04, - DOUBLED = 0x08, - CRITICAL = 0x0a, - FLEE2 = 0x0b, -}; - -#endif // TMWA_MAP_BATTLE_T_HPP +} // namespace tmwa |