/* * outdoors.h * BoE * * Created by Celtic Minstrel on 22/04/09. * */ #ifndef BOE_DATA_OUTDOORS_H #define BOE_DATA_OUTDOORS_H #include #include #include #include #include "location.hpp" #include "special.hpp" #include "monster.hpp" #include "area.hpp" namespace legacy { struct out_wandering_type; struct outdoor_record_type; struct outdoor_creature_type; }; class cScenario; class cTagFile_Page; enum eAmbientSound { AMBIENT_NONE, AMBIENT_DRIP, AMBIENT_BIRD, AMBIENT_CUSTOM, }; template using bitmap = std::array, x>; class cOutdoors : public cArea { cScenario* scenario; public: // Definition of an outdoor combat encounter class cWandering { // formerly out_wandering_type public: // max 7 types of monster per encounter std::array monst; // max 3 types of friendly npc per encounter std::array friendly; short spec_on_meet,spec_on_win,spec_on_flee; short end_spec1,end_spec2; bool cant_flee, forced; bool isNull() const; void import_legacy(legacy::out_wandering_type old); void writeTo(cTagFile_Page& page) const; void readFrom(const cTagFile_Page& page); cWandering(); }; // Instantiation of an outdoor wandering monster on the map class cCreature { // formerly outdoor_creature_type public: bool exists = false; short direction; cWandering what_monst; location which_sector,m_loc,home_sector; // home_sector is the sector it was spawned in void import_legacy(legacy::outdoor_creature_type old); void writeTo(cTagFile_Page& page) const; void readFrom(const cTagFile_Page& page); }; short x,y; // Used while loading legacy scenarios. std::vector city_locs; std::array wandering, special_enc; std::array wandering_locs; std::string comment; std::vector spec_strs; bitmap<48, 48> special_spot; bitmap<48, 48> roads; eAmbientSound ambient_sound = AMBIENT_NONE; snd_num_t out_sound; int bg_out, bg_fight, bg_town, bg_dungeon; explicit cOutdoors(cScenario& scenario); void import_legacy(legacy::outdoor_record_type& old); void reattach(cScenario& to); }; #endif