Some other tweaks and fixes got pulled in along the way. Details: - Improved const-correctness - The scenario is now part of the universe, so now there's no global scenario object in the game or the PC editor. (Of course, the scenario editor has no universe, so it still has a global scenario object.) - Towns and outdoors now store a reference to the scenario; the party, current town, and current outdoors store a reference to the universe. Altogether this means that the data module has no need for global scenario or universe objects. - The fileio routines now take a scenario or universe reference as a parameter, so they don't need the global scenario or universe objects either. - cCurOut now has an arrow operator for accessing the current outdoor section, instead of a 2x2 subset of the outdoors; this replaces using i_w_c to index the 2x2 subset. (And it's much less verbose!) - cCurTown no longer stores a pointer to the town record, since it can simply access it through the universe instance which it stores a reference to. - Tweaked how the monster roster menu works (it now caches up to 60 monsters) - The operator= functions that convert from legacy to new scenario/save format are now ordinary functions rather than operators. - The bizarre use of assigning a cCreature to itself to populate certain fields has been nuked. - When at the corner of an outdoor sector, the scenario editor now shows the cornermost terrain in the diagonally adjacent sector. - There was a missing check to prevent horses entering dangerous terrain (eg, swamp) while in town. - Fix cancelling load party dialog causing a party to appear
58 lines
1.5 KiB
C++
58 lines
1.5 KiB
C++
/*
|
|
* terrain.h
|
|
* BoE
|
|
*
|
|
* Created by Celtic Minstrel on 20/04/09.
|
|
*
|
|
*/
|
|
|
|
#ifndef BOE_DATA_TERRAIN_H
|
|
#define BOE_DATA_TERRAIN_H
|
|
|
|
#include <string>
|
|
#include <iosfwd>
|
|
|
|
#include "simpletypes.h"
|
|
#include "graphtool.h" // for pic_num_t
|
|
|
|
namespace legacy { struct terrain_type_type; };
|
|
|
|
// Depending on the special ability, the flags may need to be treated as either signed or unsigned
|
|
union ter_flag_t {signed short s; unsigned short u;};
|
|
|
|
class cTerrain {
|
|
public:
|
|
std::string name;
|
|
pic_num_t picture;
|
|
eTerObstruct blockage;
|
|
ter_flag_t flag1;
|
|
ter_flag_t flag2;
|
|
ter_flag_t flag3; // new additional flag for special properties
|
|
eTerSpec special;
|
|
ter_num_t trans_to_what;
|
|
unsigned char fly_over;
|
|
unsigned char boat_over;
|
|
unsigned char block_horse;
|
|
unsigned char light_radius;
|
|
unsigned char step_sound;
|
|
unsigned char shortcut_key; // for editor use only
|
|
unsigned char obj_num; // ditto (formerly res1)
|
|
unsigned char ground_type; // ditto (formerly res2)
|
|
eTrimType trim_type; // ditto, mostly (formerly res3)
|
|
unsigned short trim_ter; // ditto
|
|
unsigned short combat_arena;
|
|
location obj_pos; // editor use only
|
|
location obj_size; // editor use only
|
|
pic_num_t map_pic;
|
|
unsigned short i; // for temporary use in porting
|
|
|
|
void append(legacy::terrain_type_type& old);
|
|
void writeTo(std::ostream& file) const;
|
|
};
|
|
|
|
std::ostream& operator << (std::ostream& out, eTerSpec& e);
|
|
std::istream& operator >> (std::istream& in, eTerSpec& e);
|
|
std::ostream& operator << (std::ostream& out, eTerObstruct& e);
|
|
std::istream& operator >> (std::istream& in, eTerObstruct& e);
|
|
|
|
#endif |