diff options
Diffstat (limited to 'src/map')
61 files changed, 99 insertions, 1132 deletions
diff --git a/src/map/atcommand.cpp b/src/map/atcommand.cpp index bf64473..d3e215f 100644 --- a/src/map/atcommand.cpp +++ b/src/map/atcommand.cpp @@ -37,23 +37,26 @@ #include "../generic/random.hpp" #include "../io/cxxstdio.hpp" -#include "../io/cxxstdio_enums.hpp" +#include "../io/extract.hpp" #include "../io/read.hpp" #include "../io/write.hpp" #include "../net/socket.hpp" #include "../net/timer.hpp" +#include "../net/timestamp-utils.hpp" #include "../mmo/config_parse.hpp" -#include "../mmo/core.hpp" -#include "../mmo/extract.hpp" +#include "../mmo/cxxstdio_enums.hpp" #include "../mmo/extract_enums.hpp" #include "../mmo/human_time_diff.hpp" #include "../mmo/ids.hpp" -#include "../mmo/mmo.hpp" -#include "../mmo/utils.hpp" #include "../mmo/version.hpp" +#include "../high/core.hpp" +#include "../high/extract_mmo.hpp" +#include "../high/mmo.hpp" +#include "../high/utils.hpp" + #include "battle.hpp" #include "chrif.hpp" #include "clif.hpp" diff --git a/src/map/atcommand.hpp b/src/map/atcommand.hpp index 4bf5277..745039d 100644 --- a/src/map/atcommand.hpp +++ b/src/map/atcommand.hpp @@ -22,14 +22,6 @@ #include "fwd.hpp" -#include "../strings/fwd.hpp" - -#include "../generic/fwd.hpp" - -#include "../net/fwd.hpp" - -#include "../mmo/fwd.hpp" - namespace tmwa { diff --git a/src/map/battle.cpp b/src/map/battle.cpp index ce10c5c..63dc957 100644 --- a/src/map/battle.cpp +++ b/src/map/battle.cpp @@ -32,10 +32,12 @@ #include "../generic/random.hpp" #include "../io/cxxstdio.hpp" -#include "../io/cxxstdio_enums.hpp" #include "../io/read.hpp" #include "../mmo/config_parse.hpp" +#include "../mmo/cxxstdio_enums.hpp" + +#include "../high/utils.hpp" #include "clif.hpp" #include "itemdb.hpp" diff --git a/src/map/battle.hpp b/src/map/battle.hpp index 5f47b70..4a69b8e 100644 --- a/src/map/battle.hpp +++ b/src/map/battle.hpp @@ -24,15 +24,11 @@ #include "fwd.hpp" -#include "../strings/fwd.hpp" - -#include "../generic/fwd.hpp" - #include "../net/timer.t.hpp" -#include "clif.t.hpp" +#include "../mmo/clif.t.hpp" #include "map.t.hpp" -#include "skill.t.hpp" +#include "../mmo/skill.t.hpp" namespace tmwa diff --git a/src/map/chrif.cpp b/src/map/chrif.cpp index 090cccf..09c238c 100644 --- a/src/map/chrif.cpp +++ b/src/map/chrif.cpp @@ -29,15 +29,16 @@ #include "../io/cxxstdio.hpp" #include "../net/ip.hpp" -#include "../net/packets.hpp" #include "../net/socket.hpp" #include "../net/timer.hpp" +#include "../net/timestamp-utils.hpp" #include "../proto2/char-map.hpp" #include "../mmo/human_time_diff.hpp" -#include "../mmo/mmo.hpp" -#include "../mmo/utils.hpp" +#include "../high/mmo.hpp" + +#include "../wire/packets.hpp" #include "battle.hpp" #include "clif.hpp" diff --git a/src/map/chrif.hpp b/src/map/chrif.hpp index 4711bc5..4bd00aa 100644 --- a/src/map/chrif.hpp +++ b/src/map/chrif.hpp @@ -22,14 +22,6 @@ #include "fwd.hpp" -#include "../strings/fwd.hpp" - -#include "../generic/fwd.hpp" - -#include "../net/fwd.hpp" - -#include "../mmo/fwd.hpp" - namespace tmwa { diff --git a/src/map/clif.cpp b/src/map/clif.cpp index a5b7278..430d928 100644 --- a/src/map/clif.cpp +++ b/src/map/clif.cpp @@ -36,22 +36,25 @@ #include "../strings/xstring.hpp" #include "../io/cxxstdio.hpp" -#include "../io/cxxstdio_enums.hpp" +#include "../io/extract.hpp" #include "../io/write.hpp" #include "../net/ip.hpp" -#include "../net/packets.hpp" #include "../net/socket.hpp" #include "../net/timer.hpp" +#include "../net/timestamp-utils.hpp" #include "../proto2/any-user.hpp" #include "../proto2/char-map.hpp" #include "../proto2/map-user.hpp" -#include "../mmo/md5more.hpp" -#include "../mmo/utils.hpp" +#include "../mmo/cxxstdio_enums.hpp" #include "../mmo/version.hpp" +#include "../high/md5more.hpp" + +#include "../wire/packets.hpp" + #include "atcommand.hpp" #include "battle.hpp" #include "chrif.hpp" @@ -5675,38 +5678,4 @@ void do_init_clif(void) { make_listen_port(map_port, SessionParsers{.func_parse= clif_parse, .func_delete= clif_delete}); } - -bool extract(XString str, DIR *d) -{ - unsigned di; - if (extract(str, &di) && di < 8) - { - *d = static_cast<DIR>(di); - return true; - } - const struct - { - LString str; - DIR d; - } dirs[] = - { - {"S"_s, DIR::S}, - {"SW"_s, DIR::SW}, - {"W"_s, DIR::W}, - {"NW"_s, DIR::NW}, - {"N"_s, DIR::N}, - {"NE"_s, DIR::NE}, - {"E"_s, DIR::E}, - {"SE"_s, DIR::SE}, - }; - for (auto& pair : dirs) - { - if (str == pair.str) - { - *d = pair.d; - return true; - } - } - return false; -} } // namespace tmwa diff --git a/src/map/clif.hpp b/src/map/clif.hpp index 9873592..24f4b80 100644 --- a/src/map/clif.hpp +++ b/src/map/clif.hpp @@ -20,25 +20,20 @@ // 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 "clif.t.hpp" +#include "../mmo/clif.t.hpp" #include "fwd.hpp" #include <functional> -#include "../strings/fwd.hpp" - -#include "../generic/fwd.hpp" +#include "../high/mmo.hpp" #include "../net/timer.t.hpp" -#include "../mmo/fwd.hpp" -#include "../mmo/mmo.hpp" - #include "battle.t.hpp" #include "map.t.hpp" #include "pc.t.hpp" -#include "skill.t.hpp" +#include "../mmo/skill.t.hpp" namespace tmwa @@ -189,6 +184,4 @@ int clif_GM_kick(dumb_ptr<map_session_data> sd, dumb_ptr<map_session_data> tsd, int clif_foreachclient(std::function<void(dumb_ptr<map_session_data>)>); void do_init_clif(void); - -bool extract(XString, DIR *); } // namespace tmwa diff --git a/src/map/clif.t.hpp b/src/map/clif.t.hpp deleted file mode 100644 index 0f8cdbf..0000000 --- a/src/map/clif.t.hpp +++ /dev/null @@ -1,717 +0,0 @@ -#pragma once -// clif.t.hpp - Network interface to the client. -// -// Copyright © ????-2004 Athena Dev Teams -// Copyright © 2004-2011 The Mana World Development Team -// Copyright © 2011-2014 Ben Longbons <b.r.longbons@gmail.com> -// -// This file is part of The Mana World (Athena server) -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// 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 "fwd.hpp" - -#include <cstdint> - -#include "../ints/little.hpp" - -#include "../compat/iter.hpp" - -#include "../generic/enum.hpp" - -#include "../mmo/consts.hpp" -#include "../mmo/enums.hpp" - - -namespace tmwa -{ -namespace e -{ -// [Fate] status.option properties. These are persistent status changes. -// IDs that are not listed are not used in the code (to the best of my knowledge) -enum class Opt0 : uint16_t -{ - ZERO = 0x0000, - - // [Fate] This is the GM `@hide' flag - HIDE = 0x0040, - // [Fate] Complete invisibility to other clients - INVISIBILITY = 0x1000, - - // ? - REAL_ANY_HIDE = HIDE, -}; -enum class Opt1 : uint16_t -{ - ZERO = 0, - _stone1 = 1, - _freeze = 2, - _stan = 3, - _sleep = 4, - _stone6 = 6, -}; -enum class Opt2 : uint16_t -{ - ZERO = 0x0000, - _poison = 0x0001, - _curse = 0x0002, - _silence = 0x0004, - BLIND = 0x0010, - _speedpotion0 = 0x0020, - _signumcrucis = 0x0040, - _atkpot = 0x0080, - _heal = 0x0100, - _slowpoison = 0x0200, -}; -enum class Opt3 : uint16_t -{ - ZERO = 0x0000, - _concentration = 0x0001, - _overthrust = 0x0002, - _energycoat = 0x0004, - _explosionspirits = 0x0008, - _steelbody = 0x0010, - _berserk = 0x0080, - - _marionette = 0x0400, - _assumptio = 0x0800, -}; - -ENUM_BITWISE_OPERATORS(Opt0) -ENUM_BITWISE_OPERATORS(Opt2) -ENUM_BITWISE_OPERATORS(Opt3) -} -using e::Opt0; -using e::Opt1; -using e::Opt2; -using e::Opt3; - - -enum class ItemType : uint8_t -{ - USE = 0, // in eA, healing only - _1 = 1, // unused - _2 = 2, // in eA, other usable items - JUNK = 3, // "useless" items (e.g. quests) - WEAPON = 4, // all weapons - ARMOR = 5, // all other equipment - _6 = 6, // in eA, card - _7 = 7, // in eA, pet egg - _8 = 8, // in eA, pet equipment - _9 = 9, // unused - ARROW = 10, // ammo - _11 = 11, // in eA, delayed use (special script) -}; - -enum class BeingRemoveWhy : uint8_t -{ - // general disappearance - GONE = 0, - // only case handled specially in client - DEAD = 1, - QUIT = 2, - WARPED = 3, - // handled specially in clif_clearchar - sent as 0 over network - DISGUISE = 9, - - // handled speciall in mob_warp - not actually sent over network - NEGATIVE1 = 0xff, -}; - -enum class PickupFail : uint8_t -{ - OKAY = 0, - BAD_ITEM = 1, - TOO_HEAVY = 2, - TOO_FAR = 3, - INV_FULL = 4, - STACK_FULL = 5, - DROP_STEAL = 6, -}; - -// this is used for both input and output -// different values are valid in 0x0089 vs 0x008a -enum class DamageType : uint8_t -{ - NORMAL = 0x00, - TAKEITEM = 0x01, - SIT = 0x02, - STAND = 0x03, - RETURNED = 0x04, - CONTINUOUS = 0x07, - DOUBLED = 0x08, - CRITICAL = 0x0a, - FLEE2 = 0x0b, -}; - -enum class LOOK : uint8_t -{ - BASE = 0, - HAIR = 1, - WEAPON = 2, - HEAD_BOTTOM = 3, - HEAD_TOP = 4, - HEAD_MID = 5, - HAIR_COLOR = 6, - CLOTHES_COLOR = 7, - SHIELD = 8, - SHOES = 9, - GLOVES = 10, - CAPE = 11, - MISC1 = 12, - MISC2 = 13, - - COUNT, -}; - -// Note: there is also a typedef by this name in <dirent.h> -// but we should be fine since we never include it. -// (in the long term we should still rename this though) -enum class DIR : uint8_t -{ - S = 0, - SW = 1, - W = 2, - NW = 3, - N = 4, - NE = 5, - E = 6, - SE = 7, - - COUNT, -}; - -constexpr -earray<int, DIR, DIR::COUNT> dirx //= -{{ - 0, -1, -1, -1, 0, 1, 1, 1, -}}, diry //= -{{ - 1, 1, 0, -1, -1, -1, 0, 1, -}}; - -constexpr -bool dir_is_diagonal(DIR d) -{ - return static_cast<uint8_t>(d) & 1; -} - - -enum class SP : uint16_t -{ - // sent to client - SPEED = 0, - - // when used as "no stat" - ZERO = 0, - - // sent to client - BASEEXP = 1, - // sent to client - JOBEXP = 2, -#if 0 - KARMA = 3, -#endif - - // sent to client - HP = 5, - // sent to client - MAXHP = 6, - // sent to client - SP = 7, - // sent to client - MAXSP = 8, - // sent to client - STATUSPOINT = 9, - - // sent to client - BASELEVEL = 11, - // sent to client - SKILLPOINT = 12, - // sent to client - STR = 13, - // sent to client - AGI = 14, - // sent to client - VIT = 15, - // sent to client - INT = 16, - // sent to client - DEX = 17, - // sent to client - LUK = 18, - CLASS = 19, - // sent to client - ZENY = 20, - SEX = 21, - // sent to client - NEXTBASEEXP = 22, - // sent to client - NEXTJOBEXP = 23, - // sent to client - WEIGHT = 24, - // sent to client - MAXWEIGHT = 25, - - // sent to client - USTR = 32, - // sent to client - UAGI = 33, - // sent to client - UVIT = 34, - // sent to client - UINT = 35, - // sent to client - UDEX = 36, - // sent to client - ULUK = 37, - - // sent to client - ATK1 = 41, - // sent to client - ATK2 = 42, - // sent to client - MATK1 = 43, - // sent to client - MATK2 = 44, - // sent to client - DEF1 = 45, - // sent to client - DEF2 = 46, - // sent to client - MDEF1 = 47, - // sent to client - MDEF2 = 48, - // sent to client - HIT = 49, - // sent to client - FLEE1 = 50, - // sent to client - FLEE2 = 51, - // sent to client - CRITICAL = 52, - // sent to client - ASPD = 53, - - // sent to client - JOBLEVEL = 55, - -#if 0 - PARTNER = 57, - CART = 58, - FAME = 59, - UNBREAKABLE = 60, -#endif - - DEAF = 70, - - // sent to client - GM = 500, - - // sent to client - ATTACKRANGE = 1000, -#if 0 - ATKELE = 1001, -#endif -#if 0 - DEFELE = 1002, -#endif -#if 0 - CASTRATE = 1003, -#endif - MAXHPRATE = 1004, -#if 0 - MAXSPRATE = 1005, -#endif -#if 0 - SPRATE = 1006, -#endif - -#if 0 - ADDEFF = 1012, -#endif -#if 0 - RESEFF = 1013, -#endif - BASE_ATK = 1014, - ASPD_RATE = 1015, - HP_RECOV_RATE = 1016, -#if 0 - SP_RECOV_RATE = 1017, -#endif -#if 0 - SPEED_RATE = 1018, -#endif - CRITICAL_DEF = 1019, -#if 0 - NEAR_ATK_DEF = 1020, -#endif -#if 0 - LONG_ATK_DEF = 1021, -#endif -#if 0 - DOUBLE_RATE = 1022, -#endif - DOUBLE_ADD_RATE = 1023, -#if 0 - MATK = 1024, -#endif -#if 0 - MATK_RATE = 1025, -#endif -#if 0 - IGNORE_DEF_ELE = 1026, -#endif -#if 0 - IGNORE_DEF_RACE = 1027, -#endif -#if 0 - ATK_RATE = 1028, -#endif - SPEED_ADDRATE = 1029, -#if 0 - ASPD_ADDRATE = 1030, -#endif -#if 0 - MAGIC_ATK_DEF = 1031, -#endif -#if 0 - MISC_ATK_DEF = 1032, -#endif -#if 0 - IGNORE_MDEF_ELE = 1033, -#endif -#if 0 - IGNORE_MDEF_RACE = 1034, -#endif - -#if 0 - PERFECT_HIT_RATE = 1038, -#endif -#if 0 - PERFECT_HIT_ADD_RATE = 1039, -#endif -#if 0 - CRITICAL_RATE = 1040, -#endif -#if 0 - GET_ZENY_NUM = 1041, -#endif -#if 0 - ADD_GET_ZENY_NUM = 1042, -#endif - -#if 0 - ADD_MONSTER_DROP_ITEM = 1047, -#endif -#if 0 - DEF_RATIO_ATK_ELE = 1048, -#endif -#if 0 - DEF_RATIO_ATK_RACE = 1049, -#endif -#if 0 - ADD_SPEED = 1050, -#endif -#if 0 - HIT_RATE = 1051, -#endif -#if 0 - FLEE_RATE = 1052, -#endif -#if 0 - FLEE2_RATE = 1053, -#endif - DEF_RATE = 1054, - DEF2_RATE = 1055, -#if 0 - MDEF_RATE = 1056, -#endif -#if 0 - MDEF2_RATE = 1057, -#endif -#if 0 - SPLASH_RANGE = 1058, -#endif -#if 0 - SPLASH_ADD_RANGE = 1059, -#endif - - HP_DRAIN_RATE = 1061, -#if 0 - SP_DRAIN_RATE = 1062, -#endif -#if 0 - SHORT_WEAPON_DAMAGE_RETURN = 1063, -#endif -#if 0 - LONG_WEAPON_DAMAGE_RETURN = 1064, -#endif - -#if 0 - ADDEFF2 = 1067, -#endif - BREAK_WEAPON_RATE = 1068, - BREAK_ARMOR_RATE = 1069, - ADD_STEAL_RATE = 1070, - MAGIC_DAMAGE_RETURN = 1071, -#if 0 - RANDOM_ATTACK_INCREASE = 1072, -#endif -}; - -constexpr -SP attr_to_sp(ATTR attr) -{ - return static_cast<SP>(static_cast<uint16_t>(attr) + static_cast<uint16_t>(SP::STR)); -} - -constexpr -ATTR sp_to_attr(SP sp) -{ - return static_cast<ATTR>(static_cast<uint16_t>(sp) - static_cast<uint16_t>(SP::STR)); -} - -constexpr -SP attr_to_usp(ATTR attr) -{ - return static_cast<SP>(static_cast<uint16_t>(attr) + static_cast<uint16_t>(SP::USTR)); -} - -constexpr -ATTR usp_to_attr(SP sp) -{ - return static_cast<ATTR>(static_cast<uint16_t>(sp) - static_cast<uint16_t>(SP::USTR)); -} - -constexpr -SP sp_to_usp(SP sp) -{ - return attr_to_usp(sp_to_attr(sp)); -} - -constexpr -SP usp_to_sp(SP sp) -{ - return attr_to_sp(usp_to_attr(sp)); -} - - -// xxxx xxxx xxyy yyyy yyyy dddd -struct NetPosition1 -{ - Byte data[3]; -}; - -struct Position1 -{ - uint16_t x, y; - DIR dir; -}; - -inline -bool native_to_network(NetPosition1 *network, Position1 native) -{ - uint16_t x = native.x; - uint16_t y = native.y; - uint8_t d = static_cast<uint8_t>(native.dir); - - uint8_t *p = reinterpret_cast<uint8_t *>(network); - p[0] = x >> 2; - p[1] = (x << 6) | ((y >> 4) & 0x3f); - p[2] = y << 4 | d; - - return x < 1024 && y < 1024 && d < 16; -} - -inline -bool network_to_native(Position1 *native, NetPosition1 network) -{ - const uint8_t *p = reinterpret_cast<const uint8_t *>(&network); - native->x = (p[0] & (0x3ff >> 2)) << 2 | p[1] >> (8 - 2); - native->y = (p[1] & (0x3ff >> 4)) << 4 | p[2] >> (8 - 4); - uint8_t d = p[2] & 0x0f; - native->dir = static_cast<DIR>(d); - return d < 8; -} - -// x0xx xxxx xxy0 yyyy yyyy x1xx xxxx xxy1 yyyy yyyy -struct NetPosition2 -{ - Byte data[5]; -}; - -struct Position2 -{ - uint16_t x0, y0; - uint16_t x1, y1; -}; - -inline -bool native_to_network(NetPosition2 *network, Position2 native) -{ - uint16_t x0 = native.x0; - uint16_t y0 = native.y0; - uint16_t x1 = native.x1; - uint16_t y1 = native.y1; - - uint8_t *p = reinterpret_cast<uint8_t *>(network); - p[0] = x0 >> 2; - p[1] = (x0 << 6) | ((y0 >> 4) & 0x3f); - p[2] = (y0 << 4) | ((x1 >> 6) & 0x0f); - p[3] = (x1 << 2) | ((y1 >> 8) & 0x03); - p[4] = y1; - - return x0 < 1024 && y0 < 1024 && x1 < 1024 && y1 < 1024; -} - -inline -bool network_to_native(Position2 *native, NetPosition2 network) -{ - const uint8_t *p = reinterpret_cast<const uint8_t *>(&network); - native->x0 = (p[0] & (0x3ff >> 2)) << 2 | p[1] >> (8 - 2); - native->y0 = (p[1] & (0x3ff >> 4)) << 4 | p[2] >> (8 - 4); - native->x1 = (p[2] & (0x3ff >> 6)) << 6 | p[3] >> (8 - 6); - native->y1 = (p[3] & (0x3ff >> 8)) << 8 | p[4] >> (8 - 8); - return true; -} - -struct IOff2; -struct SOff1; - -struct IOff0 -{ - uint16_t index; - - bool ok() const - { return get0() < MAX_INVENTORY; } - uint16_t get0() const - { return index; } - static IOff0 from(uint16_t i) - { return IOff0{i}; } - static IteratorPair<ValueIterator<IOff0>> iter() - { return {IOff0::from(0), IOff0::from(MAX_INVENTORY)}; } - friend uint16_t convert_for_printf(IOff0 i0) { return i0.index; } - - IOff0& operator ++() { ++index; return *this; } - friend bool operator == (IOff0 l, IOff0 r) { return l.index == r.index; } - friend bool operator != (IOff0 l, IOff0 r) { return !(l == r); } - IOff2 shift() const; - - IOff0() : index(0) {} -private: - explicit IOff0(uint16_t i) : index(i) {} -}; - -struct SOff0 -{ - uint16_t index; - - bool ok() const - { return get0() < MAX_STORAGE; } - uint16_t get0() const - { return index; } - static SOff0 from(uint16_t i) - { return SOff0{i}; } - static IteratorPair<ValueIterator<SOff0>> iter() - { return {SOff0::from(0), SOff0::from(MAX_STORAGE)}; } - friend uint16_t convert_for_printf(SOff0 s0) { return s0.index; } - - SOff0& operator ++() { ++index; return *this; } - friend bool operator == (SOff0 l, SOff0 r) { return l.index == r.index; } - friend bool operator != (SOff0 l, SOff0 r) { return !(l == r); } - SOff1 shift() const; - - SOff0() : index(0) {} -private: - explicit SOff0(uint16_t i) : index(i) {} -}; - -struct IOff2 -{ - uint16_t index; - - bool ok() const - { return get2() < MAX_INVENTORY; } - uint16_t get2() const - { return index - 2; } - static IOff2 from(uint16_t i) - { return IOff2{static_cast<uint16_t>(i + 2)}; } - static IteratorPair<ValueIterator<IOff2>> iter() - { return {IOff2::from(0), IOff2::from(MAX_INVENTORY)}; } - - IOff2& operator ++() { ++index; return *this; } - friend bool operator == (IOff2 l, IOff2 r) { return l.index == r.index; } - friend bool operator != (IOff2 l, IOff2 r) { return !(l == r); } - IOff0 unshift() const - { return IOff0::from(get2()); } - - IOff2() : index(0) {} -private: - explicit IOff2(uint16_t i) : index(i) {} -}; - -struct SOff1 -{ - uint16_t index; - - bool ok() const - { return get1() < MAX_STORAGE; } - uint16_t get1() const - { return index - 1; } - static SOff1 from(uint16_t i) - { return SOff1{static_cast<uint16_t>(i + 1)}; } - static IteratorPair<ValueIterator<SOff1>> iter() - { return {SOff1::from(0), SOff1::from(MAX_STORAGE)}; } - - SOff1& operator ++() { ++index; return *this; } - friend bool operator == (SOff1 l, SOff1 r) { return l.index == r.index; } - friend bool operator != (SOff1 l, SOff1 r) { return !(l == r); } - SOff0 unshift() const - { return SOff0::from(get1()); } - - SOff1() : index(0) {} -private: - explicit SOff1(uint16_t i) : index(i) {} -}; - -inline IOff2 IOff0::shift() const -{ return IOff2::from(get0()); } -inline SOff1 SOff0::shift() const -{ return SOff1::from(get0()); } - -inline -bool native_to_network(Little16 *network, IOff2 native) -{ - return native_to_network(network, native.index); -} - -inline -bool network_to_native(IOff2 *native, Little16 network) -{ - return network_to_native(&native->index, network); -} - -inline -bool native_to_network(Little16 *network, SOff1 native) -{ - return native_to_network(network, native.index); -} - -inline -bool network_to_native(SOff1 *native, Little16 network) -{ - return network_to_native(&native->index, network); -} -} // namespace tmwa diff --git a/src/map/fwd.hpp b/src/map/fwd.hpp index 578b08a..f998b77 100644 --- a/src/map/fwd.hpp +++ b/src/map/fwd.hpp @@ -22,11 +22,24 @@ #include <cstdint> +#include "../ints/fwd.hpp" // rank 1 +#include "../range/fwd.hpp" // rank 1 +#include "../strings/fwd.hpp" // rank 1 +#include "../compat/fwd.hpp" // rank 2 +#include "../generic/fwd.hpp" // rank 3 +#include "../io/fwd.hpp" // rank 4 +#include "../net/fwd.hpp" // rank 5 +#include "../sexpr/fwd.hpp" // rank 5 +#include "../mmo/fwd.hpp" // rank 6 +#include "../proto2/fwd.hpp" // rank 8 +#include "../high/fwd.hpp" // rank 9 +#include "../wire/fwd.hpp" // rank 9 +// map/fwd.hpp is rank ∞ because it is an executable + namespace tmwa { // meh, add more when I feel like it -class BlockId; struct block_list; struct map_session_data; struct npc_data; @@ -38,11 +51,6 @@ class npc_data_script; class npc_data_shop; class npc_data_warp; class npc_data_message; -struct NpcEvent; -struct MobName; -struct NpcName; -struct ScriptLabel; -struct ItemName; struct item_data; diff --git a/src/map/grfio.cpp b/src/map/grfio.cpp index 4a1656b..8821374 100644 --- a/src/map/grfio.cpp +++ b/src/map/grfio.cpp @@ -33,10 +33,11 @@ #include "../strings/zstring.hpp" #include "../io/cxxstdio.hpp" +#include "../io/extract.hpp" #include "../io/read.hpp" -#include "../mmo/extract.hpp" -#include "../mmo/mmo.hpp" +#include "../high/extract_mmo.hpp" +#include "../high/mmo.hpp" #include "../poison.hpp" diff --git a/src/map/grfio.hpp b/src/map/grfio.hpp index d2ab058..4cd4092 100644 --- a/src/map/grfio.hpp +++ b/src/map/grfio.hpp @@ -26,10 +26,6 @@ #include <vector> -#include "../strings/fwd.hpp" - -#include "../mmo/fwd.hpp" - namespace tmwa { diff --git a/src/map/intif.cpp b/src/map/intif.cpp index 6cc3772..c6821b6 100644 --- a/src/map/intif.cpp +++ b/src/map/intif.cpp @@ -29,13 +29,14 @@ #include "../io/cxxstdio.hpp" -#include "../net/packets.hpp" #include "../net/socket.hpp" -#include "../mmo/mmo.hpp" +#include "../high/mmo.hpp" #include "../proto2/char-map.hpp" +#include "../wire/packets.hpp" + #include "battle.hpp" #include "chrif.hpp" #include "clif.hpp" diff --git a/src/map/intif.hpp b/src/map/intif.hpp index 00f3c49..d51ca11 100644 --- a/src/map/intif.hpp +++ b/src/map/intif.hpp @@ -22,16 +22,6 @@ #include "fwd.hpp" -#include "../compat/fwd.hpp" - -#include "../strings/fwd.hpp" - -#include "../generic/fwd.hpp" - -#include "../net/fwd.hpp" - -#include "../mmo/fwd.hpp" - namespace tmwa { diff --git a/src/map/itemdb.cpp b/src/map/itemdb.cpp index 5ffa725..2e3d0c5 100644 --- a/src/map/itemdb.cpp +++ b/src/map/itemdb.cpp @@ -29,10 +29,10 @@ #include "../generic/db.hpp" #include "../io/cxxstdio.hpp" +#include "../io/extract.hpp" #include "../io/read.hpp" #include "../mmo/config_parse.hpp" -#include "../mmo/extract.hpp" #include "../mmo/extract_enums.hpp" #include "script-parse.hpp" diff --git a/src/map/itemdb.hpp b/src/map/itemdb.hpp index fccfa23..fcc92c4 100644 --- a/src/map/itemdb.hpp +++ b/src/map/itemdb.hpp @@ -23,7 +23,7 @@ #include "fwd.hpp" #include "../mmo/ids.hpp" -#include "../mmo/mmo.hpp" +#include "../high/mmo.hpp" #include "map.t.hpp" #include "script-buffer.hpp" diff --git a/src/map/magic-expr.cpp b/src/map/magic-expr.cpp index 4afa3bc..9cc4e33 100644 --- a/src/map/magic-expr.cpp +++ b/src/map/magic-expr.cpp @@ -33,7 +33,8 @@ #include "../generic/random.hpp" #include "../io/cxxstdio.hpp" -#include "../io/cxxstdio_enums.hpp" + +#include "../mmo/cxxstdio_enums.hpp" #include "battle.hpp" #include "itemdb.hpp" diff --git a/src/map/magic-expr.hpp b/src/map/magic-expr.hpp index 2a4b4be..8b88142 100644 --- a/src/map/magic-expr.hpp +++ b/src/map/magic-expr.hpp @@ -21,15 +21,9 @@ #include "fwd.hpp" -#include "../generic/fwd.hpp" - -#include "../range/fwd.hpp" - #include "../strings/zstring.hpp" #include "../strings/literal.hpp" -#include "../mmo/fwd.hpp" - #include "magic-interpreter.t.hpp" diff --git a/src/map/magic-interpreter-base.cpp b/src/map/magic-interpreter-base.cpp index be9a61a..7fde979 100644 --- a/src/map/magic-interpreter-base.cpp +++ b/src/map/magic-interpreter-base.cpp @@ -25,7 +25,8 @@ #include "../strings/xstring.hpp" #include "../io/cxxstdio.hpp" -#include "../io/cxxstdio_enums.hpp" + +#include "../mmo/cxxstdio_enums.hpp" #include "../net/timer.hpp" diff --git a/src/map/magic-interpreter-base.hpp b/src/map/magic-interpreter-base.hpp index 4bb41a0..2557ecb 100644 --- a/src/map/magic-interpreter-base.hpp +++ b/src/map/magic-interpreter-base.hpp @@ -21,12 +21,6 @@ #include "fwd.hpp" -#include "../strings/fwd.hpp" - -#include "../generic/fwd.hpp" - -#include "../mmo/fwd.hpp" - namespace tmwa { diff --git a/src/map/magic-interpreter.hpp b/src/map/magic-interpreter.hpp index 09642cb..547e294 100644 --- a/src/map/magic-interpreter.hpp +++ b/src/map/magic-interpreter.hpp @@ -27,21 +27,17 @@ #include <memory> -#include "../strings/fwd.hpp" #include "../strings/rstring.hpp" -#include "../generic/fwd.hpp" - #include "../sexpr/variant.hpp" #include "../net/timer.t.hpp" #include "../mmo/ids.hpp" -#include "../mmo/utils.hpp" #include "map.hpp" #include "script-buffer.hpp" -#include "skill.t.hpp" +#include "../mmo/skill.t.hpp" namespace tmwa diff --git a/src/map/magic-stmt.cpp b/src/map/magic-stmt.cpp index b532ec8..d5e1a15 100644 --- a/src/map/magic-stmt.cpp +++ b/src/map/magic-stmt.cpp @@ -29,7 +29,8 @@ #include "../generic/random2.hpp" #include "../io/cxxstdio.hpp" -#include "../io/cxxstdio_enums.hpp" + +#include "../mmo/cxxstdio_enums.hpp" #include "../net/timer.hpp" diff --git a/src/map/magic-stmt.hpp b/src/map/magic-stmt.hpp index 0385858..cdbd40f 100644 --- a/src/map/magic-stmt.hpp +++ b/src/map/magic-stmt.hpp @@ -21,13 +21,9 @@ #include "fwd.hpp" -#include "../range/fwd.hpp" - #include "../strings/zstring.hpp" -#include "../generic/fwd.hpp" - -#include "skill.t.hpp" +#include "../mmo/skill.t.hpp" namespace tmwa diff --git a/src/map/magic.hpp b/src/map/magic.hpp index a420872..8c1ef84 100644 --- a/src/map/magic.hpp +++ b/src/map/magic.hpp @@ -21,12 +21,8 @@ #include "fwd.hpp" -#include "../strings/fwd.hpp" - -#include "../generic/fwd.hpp" - #include "map.t.hpp" -#include "skill.t.hpp" +#include "../mmo/skill.t.hpp" namespace tmwa diff --git a/src/map/main.cpp b/src/map/main.cpp index c16f642..a54bb3f 100644 --- a/src/map/main.cpp +++ b/src/map/main.cpp @@ -17,7 +17,7 @@ // 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 "../mmo/core.hpp" +#include "../high/core.hpp" #include "map.hpp" diff --git a/src/map/map.cpp b/src/map/map.cpp index dbb54d6..9ae865f 100644 --- a/src/map/map.cpp +++ b/src/map/map.cpp @@ -45,20 +45,21 @@ #include "../generic/random2.hpp" #include "../io/cxxstdio.hpp" -#include "../io/cxxstdio_enums.hpp" +#include "../io/extract.hpp" #include "../io/read.hpp" #include "../io/tty.hpp" #include "../io/write.hpp" #include "../net/socket.hpp" #include "../net/timer.hpp" +#include "../net/timestamp-utils.hpp" #include "../mmo/config_parse.hpp" -#include "../mmo/core.hpp" -#include "../mmo/extract.hpp" -#include "../mmo/utils.hpp" +#include "../mmo/cxxstdio_enums.hpp" #include "../mmo/version.hpp" +#include "../high/core.hpp" + #include "atcommand.hpp" #include "battle.hpp" #include "chrif.hpp" @@ -127,11 +128,6 @@ VString<49> convert_for_printf(NpcEvent ev) { return STRNPRINTF(50, "%s::%s"_fmt, ev.npc, ev.label); } -bool extract(XString str, NpcEvent *ev) -{ - XString mid; - return extract(str, record<':'>(&ev->npc, &mid, &ev->label)) && !mid; -} /*========================================== * 全map鯖総計での接続数設定 diff --git a/src/map/map.hpp b/src/map/map.hpp index cb4273f..183b74d 100644 --- a/src/map/map.hpp +++ b/src/map/map.hpp @@ -30,7 +30,6 @@ #include "../ints/udl.hpp" -#include "../strings/fwd.hpp" #include "../strings/rstring.hpp" #include "../strings/astring.hpp" #include "../strings/vstring.hpp" @@ -42,15 +41,13 @@ #include "../net/socket.hpp" #include "../net/timer.t.hpp" -#include "../mmo/utils.hpp" - #include "battle.t.hpp" -#include "clif.t.hpp" +#include "../mmo/clif.t.hpp" #include "mapflag.hpp" #include "mob.t.hpp" #include "script-buffer.hpp" #include "script-persist.hpp" -#include "skill.t.hpp" +#include "../mmo/skill.t.hpp" namespace tmwa @@ -69,35 +66,6 @@ constexpr int MAX_DROP_PER_MAP = 48; constexpr interval_t DEFAULT_AUTOSAVE_INTERVAL = 1_min; -// formerly VString<49>, as name::label -struct NpcEvent -{ - NpcName npc; - ScriptLabel label; - - explicit operator bool() - { - return npc || label; - } - bool operator !() - { - return !bool(*this); - } - - friend bool operator == (const NpcEvent& l, const NpcEvent& r) - { - return l.npc == r.npc && l.label == r.label; - } - - friend bool operator < (const NpcEvent& l, const NpcEvent& r) - { - return l.npc < r.npc || (l.npc == r.npc && l.label < r.label); - } - - friend VString<49> convert_for_printf(NpcEvent ev); -}; -bool extract(XString str, NpcEvent *ev); - extern map_local undefined_gat; struct block_list diff --git a/src/map/map.t.hpp b/src/map/map.t.hpp index b475f9b..e8a62bc 100644 --- a/src/map/map.t.hpp +++ b/src/map/map.t.hpp @@ -29,7 +29,7 @@ #include "../generic/enum.hpp" #include "../mmo/ids.hpp" -#include "../mmo/mmo.hpp" +#include "../high/mmo.hpp" namespace tmwa @@ -191,11 +191,6 @@ ENUM_BITWISE_OPERATORS(MapCell) } using e::MapCell; -struct MobName : VString<23> {}; -struct NpcName : VString<23> {}; -struct ScriptLabel : VString<23> {}; -struct ItemName : VString<23> {}; - inline BlockId account_to_block(AccountId a) { return wrap<BlockId>(unwrap<AccountId>(a)); } inline diff --git a/src/map/mapflag.cpp b/src/map/mapflag.cpp index be2ae67..91dfe8d 100644 --- a/src/map/mapflag.cpp +++ b/src/map/mapflag.cpp @@ -18,6 +18,8 @@ // 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 "../strings/xstring.hpp" + #include "../poison.hpp" diff --git a/src/map/mapflag.hpp b/src/map/mapflag.hpp index 6d046fa..d964405 100644 --- a/src/map/mapflag.hpp +++ b/src/map/mapflag.hpp @@ -22,8 +22,6 @@ #include <cstdint> -#include "../mmo/extract.hpp" // TODO remove this (requires specializing the *other* half) - namespace tmwa { diff --git a/src/map/mob.cpp b/src/map/mob.cpp index a2932d0..cab17a0 100644 --- a/src/map/mob.cpp +++ b/src/map/mob.cpp @@ -36,14 +36,14 @@ #include "../generic/random.hpp" #include "../io/cxxstdio.hpp" -#include "../io/cxxstdio_enums.hpp" +#include "../io/extract.hpp" #include "../io/read.hpp" #include "../net/socket.hpp" #include "../net/timer.hpp" #include "../mmo/config_parse.hpp" -#include "../mmo/extract.hpp" +#include "../mmo/cxxstdio_enums.hpp" #include "../mmo/extract_enums.hpp" #include "battle.hpp" diff --git a/src/map/mob.hpp b/src/map/mob.hpp index c4fcce1..6f6fb47 100644 --- a/src/map/mob.hpp +++ b/src/map/mob.hpp @@ -24,16 +24,15 @@ #include "fwd.hpp" -#include "../generic/fwd.hpp" #include "../generic/enum.hpp" #include "../generic/random.t.hpp" #include "../net/timer.t.hpp" #include "battle.t.hpp" -#include "clif.t.hpp" +#include "../mmo/clif.t.hpp" #include "map.hpp" -#include "skill.t.hpp" +#include "../mmo/skill.t.hpp" namespace tmwa diff --git a/src/map/npc-internal.hpp b/src/map/npc-internal.hpp index 65cef3d..4ddcc84 100644 --- a/src/map/npc-internal.hpp +++ b/src/map/npc-internal.hpp @@ -23,8 +23,6 @@ #include "npc.hpp" #include "fwd.hpp" -#include "../generic/fwd.hpp" - namespace tmwa { diff --git a/src/map/npc-parse.cpp b/src/map/npc-parse.cpp index f5b6a07..81a5ba2 100644 --- a/src/map/npc-parse.cpp +++ b/src/map/npc-parse.cpp @@ -31,10 +31,13 @@ #include "../generic/enum.hpp" #include "../io/cxxstdio.hpp" +#include "../io/extract.hpp" #include "../io/read.hpp" #include "../mmo/config_parse.hpp" +#include "../high/extract_mmo.hpp" + #include "battle.hpp" #include "clif.hpp" #include "itemdb.hpp" diff --git a/src/map/npc-parse.hpp b/src/map/npc-parse.hpp index 0d66aa7..a9cf300 100644 --- a/src/map/npc-parse.hpp +++ b/src/map/npc-parse.hpp @@ -22,14 +22,6 @@ #include "fwd.hpp" -#include "../compat/fwd.hpp" - -#include "../generic/fwd.hpp" - -#include "../strings/fwd.hpp" - -#include "../mmo/fwd.hpp" - namespace tmwa { diff --git a/src/map/npc.cpp b/src/map/npc.cpp index 471553b..304224a 100644 --- a/src/map/npc.cpp +++ b/src/map/npc.cpp @@ -38,12 +38,10 @@ #include "../generic/db.hpp" #include "../io/cxxstdio.hpp" +#include "../io/extract.hpp" #include "../net/timer.hpp" -#include "../mmo/extract.hpp" -#include "../mmo/utils.hpp" - #include "../proto2/map-user.hpp" #include "battle.hpp" diff --git a/src/map/npc.hpp b/src/map/npc.hpp index 67a62a9..cb42dbd 100644 --- a/src/map/npc.hpp +++ b/src/map/npc.hpp @@ -26,14 +26,8 @@ #include "../range/slice.hpp" -#include "../strings/fwd.hpp" - -#include "../generic/fwd.hpp" - #include "../net/timer.t.hpp" -#include "../proto2/fwd.hpp" - #include "map.hpp" #include "script-call.t.hpp" diff --git a/src/map/party.cpp b/src/map/party.cpp index 45c406a..8150743 100644 --- a/src/map/party.cpp +++ b/src/map/party.cpp @@ -32,7 +32,7 @@ #include "../net/timer.hpp" #include "../mmo/ids.hpp" -#include "../mmo/mmo.hpp" +#include "../high/mmo.hpp" #include "battle.hpp" #include "clif.hpp" diff --git a/src/map/party.hpp b/src/map/party.hpp index 466ee6a..a3f28e3 100644 --- a/src/map/party.hpp +++ b/src/map/party.hpp @@ -24,14 +24,6 @@ #include <functional> -#include "../compat/fwd.hpp" - -#include "../strings/fwd.hpp" - -#include "../generic/fwd.hpp" - -#include "../mmo/fwd.hpp" - namespace tmwa { diff --git a/src/map/path.cpp b/src/map/path.cpp index 7f9a657..3c05d52 100644 --- a/src/map/path.cpp +++ b/src/map/path.cpp @@ -31,7 +31,7 @@ #include "../io/cxxstdio.hpp" -#include "clif.t.hpp" +#include "../mmo/clif.t.hpp" #include "map.hpp" #include "../poison.hpp" diff --git a/src/map/path.hpp b/src/map/path.hpp index a588f1b..49dac7f 100644 --- a/src/map/path.hpp +++ b/src/map/path.hpp @@ -22,8 +22,6 @@ #include "fwd.hpp" -#include "../compat/fwd.hpp" - namespace tmwa { diff --git a/src/map/pc.cpp b/src/map/pc.cpp index 68d478e..1e7d295 100644 --- a/src/map/pc.cpp +++ b/src/map/pc.cpp @@ -37,12 +37,12 @@ #include "../generic/random.hpp" #include "../io/cxxstdio.hpp" -#include "../io/cxxstdio_enums.hpp" #include "../io/read.hpp" -#include "../net/timer.hpp" +#include "../mmo/cxxstdio_enums.hpp" -#include "../mmo/utils.hpp" +#include "../net/timer.hpp" +#include "../net/timestamp-utils.hpp" #include "../proto2/char-map.hpp" diff --git a/src/map/pc.hpp b/src/map/pc.hpp index 605915e..9795443 100644 --- a/src/map/pc.hpp +++ b/src/map/pc.hpp @@ -24,15 +24,9 @@ #include "fwd.hpp" -#include "../strings/fwd.hpp" - #include "../generic/dumb_ptr.hpp" -#include "../mmo/utils.hpp" - -#include "../proto2/fwd.hpp" - -#include "clif.t.hpp" +#include "../mmo/clif.t.hpp" #include "map.hpp" diff --git a/src/map/script-call.cpp b/src/map/script-call.cpp index 6d3e6f2..8af5099 100644 --- a/src/map/script-call.cpp +++ b/src/map/script-call.cpp @@ -25,7 +25,8 @@ #include "../generic/intern-pool.hpp" #include "../io/cxxstdio.hpp" -#include "../io/cxxstdio_enums.hpp" + +#include "../mmo/cxxstdio_enums.hpp" #include "battle.hpp" #include "map.hpp" diff --git a/src/map/script-call.hpp b/src/map/script-call.hpp index 89cadb8..1a405b2 100644 --- a/src/map/script-call.hpp +++ b/src/map/script-call.hpp @@ -26,12 +26,6 @@ #include "../compat/borrow.hpp" -#include "../range/fwd.hpp" - -#include "../generic/fwd.hpp" - -#include "../mmo/fwd.hpp" - namespace tmwa { diff --git a/src/map/script-fun.cpp b/src/map/script-fun.cpp index 958b127..69aee10 100644 --- a/src/map/script-fun.cpp +++ b/src/map/script-fun.cpp @@ -33,10 +33,11 @@ #include "../net/timer.hpp" -#include "../mmo/core.hpp" - #include "../proto2/net-HumanTimeDiff.hpp" +#include "../high/core.hpp" +#include "../high/extract_mmo.hpp" + #include "atcommand.hpp" #include "battle.hpp" #include "chrif.hpp" diff --git a/src/map/script-parse-internal.hpp b/src/map/script-parse-internal.hpp index f7e153b..89a35fd 100644 --- a/src/map/script-parse-internal.hpp +++ b/src/map/script-parse-internal.hpp @@ -23,8 +23,6 @@ #include "script-parse.hpp" #include "fwd.hpp" -#include "../compat/fwd.hpp" - #include "../strings/rstring.hpp" diff --git a/src/map/script-parse.cpp b/src/map/script-parse.cpp index e2cb4c6..7956831 100644 --- a/src/map/script-parse.cpp +++ b/src/map/script-parse.cpp @@ -30,7 +30,8 @@ #include "../strings/rstring.hpp" #include "../io/cxxstdio.hpp" -#include "../io/cxxstdio_enums.hpp" + +#include "../mmo/cxxstdio_enums.hpp" #include "map.t.hpp" #include "script-buffer.hpp" diff --git a/src/map/script-parse.hpp b/src/map/script-parse.hpp index 6f536f8..d1f824f 100644 --- a/src/map/script-parse.hpp +++ b/src/map/script-parse.hpp @@ -24,10 +24,6 @@ #include <memory> -#include "../strings/fwd.hpp" - -#include "../generic/fwd.hpp" - namespace tmwa { diff --git a/src/map/script-startup-internal.hpp b/src/map/script-startup-internal.hpp index e4d6a8f..0b2b0e1 100644 --- a/src/map/script-startup-internal.hpp +++ b/src/map/script-startup-internal.hpp @@ -23,10 +23,6 @@ #include "script-startup.hpp" #include "fwd.hpp" -#include "../generic/fwd.hpp" - -#include "../strings/fwd.hpp" - #include "script-persist.hpp" diff --git a/src/map/script-startup.cpp b/src/map/script-startup.cpp index 27ec903..7c77a27 100644 --- a/src/map/script-startup.cpp +++ b/src/map/script-startup.cpp @@ -28,13 +28,12 @@ #include "../generic/intern-pool.hpp" #include "../io/cxxstdio.hpp" +#include "../io/extract.hpp" #include "../io/read.hpp" #include "../io/lock.hpp" #include "../net/timer.hpp" -#include "../mmo/extract.hpp" - #include "map.hpp" #include "script-parse-internal.hpp" #include "script-persist.hpp" diff --git a/src/map/script-startup.hpp b/src/map/script-startup.hpp index 8a6b50d..3894676 100644 --- a/src/map/script-startup.hpp +++ b/src/map/script-startup.hpp @@ -22,8 +22,6 @@ #include "fwd.hpp" -#include "../strings/fwd.hpp" - namespace tmwa { void do_init_script(void); diff --git a/src/map/skill-pools.cpp b/src/map/skill-pools.cpp index 89bf426..8ed03b8 100644 --- a/src/map/skill-pools.cpp +++ b/src/map/skill-pools.cpp @@ -21,7 +21,8 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>. #include "../io/cxxstdio.hpp" -#include "../io/cxxstdio_enums.hpp" + +#include "../mmo/cxxstdio_enums.hpp" #include "battle.hpp" #include "pc.hpp" diff --git a/src/map/skill.cpp b/src/map/skill.cpp index 7c79e46..9889772 100644 --- a/src/map/skill.cpp +++ b/src/map/skill.cpp @@ -39,12 +39,12 @@ #include "../generic/random.hpp" #include "../io/cxxstdio.hpp" -#include "../io/cxxstdio_enums.hpp" +#include "../io/extract.hpp" #include "../io/read.hpp" #include "../net/timer.hpp" -#include "../mmo/extract.hpp" +#include "../mmo/cxxstdio_enums.hpp" #include "../mmo/extract_enums.hpp" #include "battle.hpp" diff --git a/src/map/skill.hpp b/src/map/skill.hpp index 5d23bae..4e6fff0 100644 --- a/src/map/skill.hpp +++ b/src/map/skill.hpp @@ -20,17 +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 "skill.t.hpp" +#include "../mmo/skill.t.hpp" #include "fwd.hpp" #include "skill-pools.hpp" -#include "../strings/fwd.hpp" #include "../strings/rstring.hpp" #include "../strings/literal.hpp" -#include "../generic/fwd.hpp" #include "../generic/array.hpp" #include "map.hpp" diff --git a/src/map/skill.t.hpp b/src/map/skill.t.hpp deleted file mode 100644 index d0e3926..0000000 --- a/src/map/skill.t.hpp +++ /dev/null @@ -1,136 +0,0 @@ -#pragma once -// skill.t.hpp - Old-style skills. -// -// Copyright © ????-2004 Athena Dev Teams -// Copyright © 2004-2011 The Mana World Development Team -// Copyright © 2011-2014 Ben Longbons <b.r.longbons@gmail.com> -// -// This file is part of The Mana World (Athena server) -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// 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 "fwd.hpp" - -#include <cstdint> - -#include "../generic/enum.hpp" - - -namespace tmwa -{ -// TODO remove most of these as their corresponding SkillIDs get deleted. -enum class StatusChange : uint16_t -{ - // indices into (map_session_data).status_change - SC_SENDMAX = 256, - - // sometimes means "none", sometimes not - NEGATIVE1 = 0xffff, - - // these ones are used by clif_status_change, - // e.g. by the magic system - ZERO = 0, - ATTACK_ICON_GENERIC = 2000, - ATTACK_ICON_SHEARING = 2001, - CART = 0x0c, - CLIF_OPTION_SC_INVISIBILITY = 0x1000, - CLIF_OPTION_SC_SCRIBE = 0x1001, - - // the rest are the normal effects - SC_SLOWPOISON = 14, // item script - - SC_WEIGHT50 = 35, // ? sort of used - SC_WEIGHT90 = 36, // definitely used - SC_SPEEDPOTION0 = 37, // item script - - SC_HEALING = 70, // item script - - SC_POISON = 132, // bad; actually used - - SC_ATKPOT = 185, // item script - SC_MATKPOT = 186, // unused, but kept for parallel - -// Added for Fate's spells - SC_HIDE = 194, // Hide from `detect' magic (PCs only) - SC_SHEARED = 194, // Has been sheared (mobs only) - SC_HALT_REGENERATE = 195, // Suspend regeneration - SC_FLYING_BACKPACK = 196, // Flying backpack - SC_MBARRIER = 197, // Magical barrier, magic resistance (val1 : power (%)) - SC_HASTE = 198, // `Haste' spell (val1 : power) - SC_PHYS_SHIELD = 199, // `Protect' spell, reduce damage (val1: power) - MAX_STATUSCHANGE = 200, -}; - -enum class SkillID : uint16_t -{ - // TODO: Remove these! - NEGATIVE = 0xffff, - ZERO = 0x0000, - ONE = 0x0001, - - // Basic skills. - // These should probably be made unconditional. - NV_EMOTE = 1, // - NV_TRADE = 2, // - NV_PARTY = 3, // - - AC_OWL = 45, // Mallard's Eye - - NPC_SELFDESTRUCTION = 175, // - - NPC_POISON = 178, // - - NPC_SUMMONSLAVE = 198, // - NPC_EMOTION = 199, // - - TMW_SKILLPOOL = 339, // skill pool size - - // magic skills - TMW_MAGIC = 340, // - TMW_MAGIC_LIFE = 341, // - TMW_MAGIC_WAR = 342, // - TMW_MAGIC_TRANSMUTE = 343, // - TMW_MAGIC_NATURE = 344, // - TMW_MAGIC_ETHER = 345, // - TMW_MAGIC_DARK = 346, // - TMW_MAGIC_LIGHT = 347, // - - // focusable skills - TMW_BRAWLING = 350, // - TMW_LUCKY_COUNTER = 351, // - TMW_SPEED = 352, // - TMW_RESIST_POISON = 353, // - TMW_ASTRAL_SOUL = 354, // - TMW_RAGING = 355, // - - // Note: this value is also hard-coded in common/mmo.hpp - MAX_SKILL_DB = 474, // not 450 -}; - -namespace e -{ -enum class SkillFlags : uint16_t -{ - ZERO = 0x00, - // is a pool skill - POOL_FLAG = 0x01, - // is an active pool skill - POOL_ACTIVE = 0x02, - // pool skill has been activated (used for clif) - POOL_ACTIVATED = 0x04, -}; -ENUM_BITWISE_OPERATORS(SkillFlags) -} -using e::SkillFlags; -} // namespace tmwa diff --git a/src/map/storage.cpp b/src/map/storage.cpp index 295eff0..1a98d5b 100644 --- a/src/map/storage.cpp +++ b/src/map/storage.cpp @@ -25,7 +25,7 @@ #include "../generic/db.hpp" #include "../mmo/ids.hpp" -#include "../mmo/mmo.hpp" +#include "../high/mmo.hpp" #include "chrif.hpp" #include "clif.hpp" diff --git a/src/map/storage.hpp b/src/map/storage.hpp index 59a8858..038df7d 100644 --- a/src/map/storage.hpp +++ b/src/map/storage.hpp @@ -22,15 +22,9 @@ #include "fwd.hpp" -#include "../compat/fwd.hpp" - -#include "../generic/fwd.hpp" - -#include "../mmo/fwd.hpp" - #include "../proto2/net-Storage.hpp" -#include "clif.t.hpp" +#include "../mmo/clif.t.hpp" namespace tmwa diff --git a/src/map/tmw.cpp b/src/map/tmw.cpp index 60b5027..04906b6 100644 --- a/src/map/tmw.cpp +++ b/src/map/tmw.cpp @@ -29,7 +29,6 @@ #include "../io/cxxstdio.hpp" #include "../mmo/human_time_diff.hpp" -#include "../mmo/utils.hpp" #include "atcommand.hpp" #include "battle.hpp" diff --git a/src/map/tmw.hpp b/src/map/tmw.hpp index ffd6f7f..7f0a57e 100644 --- a/src/map/tmw.hpp +++ b/src/map/tmw.hpp @@ -21,10 +21,6 @@ #include "fwd.hpp" -#include "../strings/fwd.hpp" - -#include "../generic/fwd.hpp" - namespace tmwa { diff --git a/src/map/trade.hpp b/src/map/trade.hpp index 91ed954..86bfc96 100644 --- a/src/map/trade.hpp +++ b/src/map/trade.hpp @@ -22,9 +22,7 @@ #include "fwd.hpp" -#include "../generic/fwd.hpp" - -#include "clif.t.hpp" +#include "../mmo/clif.t.hpp" namespace tmwa |