- Changed the number of times a creature can appear in an outdoor encounter to match the documentation. - Moved count_monst to cCurTown::countMonsters. - Code cleanup in create_wand_monst() - removing unnecessary comparisons with true or false. - Moved is_null_out_wand_entry to cOutdoors::cWandering::isNull(). - Moved is_null_wand_entry to cTown::cWandering::isNull(). - In create_wand_monst for the town case, I changed it so that the fourth monster (and only the fourth monster) has a 50% chance of appearing twice. - In monst_check_speciall_terrain, replaced the commented check for town number in the force barrier case with a check for a new bit field variable: univ.town->strong_barrier - Removed specials1, specials2, res1, and res2 from the townrecord; the checks for specials2 & 1 have been replaced with checks for the new bit field variable defy_mapping. - In adj_town_look(), the lines uncommented in the previous revision were reduced to a single add_string_to_buf() call. - Removed the 50 node limit in favour of an interrupt key. Pressing command-period while a node sequence is underway will now interrupt it. Control-C is supposed to have the same effect, but it's not working yet. - Affect PC nodes other than Kill/Raise Dead now only affect the active character when the party is split up. - Added missing breaks in the split party node which would allow the party to be split in combat or when already split, despite a message saying they can't. - Added a second operator[] to cCurOut which takes a location as a parameter rather than an x coordinate. - Properly fixed an earlier error in cPitc::init() which had a temporary fix; it turned out to be a case of static objects not being initialized in the right order. git-svn-id: http://openexile.googlecode.com/svn/trunk@98 4ebdad44-0ea0-11de-aab3-ff745001d230
116 lines
2.8 KiB
C++
116 lines
2.8 KiB
C++
/*
|
|
* town.h
|
|
* BoE
|
|
*
|
|
* Created by Celtic Minsrel on 22/04/09.
|
|
*
|
|
*/
|
|
|
|
#ifndef TOWN_H
|
|
#define TOWN_H
|
|
|
|
#include <vector>
|
|
#include <iosfwd>
|
|
|
|
namespace legacy {
|
|
struct town_record_type;
|
|
struct big_tr_type;
|
|
struct ave_tr_type;
|
|
struct tiny_tr_type;
|
|
struct creature_start_type;
|
|
struct wandering_type;
|
|
struct preset_item_type;
|
|
struct preset_field_type;
|
|
};
|
|
|
|
class cTown { // formerly town_record_type
|
|
public:
|
|
// class cCreature { // formerly creature_start_type
|
|
// public:
|
|
// unsigned short number;
|
|
// unsigned char start_attitude;
|
|
// location start_loc;
|
|
// unsigned char mobile;
|
|
// unsigned char time_flag;
|
|
// unsigned char extra1,extra2;
|
|
// short spec1, spec2;
|
|
// char spec_enc_code,time_code;
|
|
// short monster_time,personality;
|
|
// short special_on_kill,facial_pic;
|
|
//
|
|
// cCreature& operator = (legacy::creature_start_type old);
|
|
// };
|
|
class cWandering { // formerly wandering_type
|
|
public:
|
|
m_num_t monst[4];
|
|
|
|
bool isNull();
|
|
cWandering& operator = (legacy::wandering_type old);
|
|
};
|
|
class cItem { // formerly preset_item_type
|
|
public:
|
|
location loc;
|
|
short code,ability;
|
|
unsigned char charges,always_there,property,contained;
|
|
|
|
cItem& operator = (legacy::preset_item_type old);
|
|
};
|
|
class cField { // formerly preset_field_type
|
|
public:
|
|
location loc;
|
|
short type;
|
|
|
|
cField& operator = (legacy::preset_field_type old);
|
|
};
|
|
short town_chop_time,town_chop_key;
|
|
cWandering wandering[4];
|
|
location wandering_locs[4];
|
|
location special_locs[50];
|
|
unsigned short spec_id[50];
|
|
location sign_locs[15];
|
|
short lighting_type;
|
|
location start_locs[4];
|
|
location exit_locs[4];
|
|
short exit_specs[4];
|
|
rectangle in_town_rect;
|
|
cItem preset_items[64];
|
|
short max_num_monst;
|
|
std::vector<cField> preset_fields;
|
|
short spec_on_entry,spec_on_entry_if_dead;
|
|
short timer_spec_times[8];
|
|
short timer_specs[8];
|
|
unsigned char strlens[180];
|
|
cSpecial specials[100];
|
|
//unsigned char specials1,specials2,res1,res2;
|
|
bool strong_barriers : 1;
|
|
bool defy_mapping : 1;
|
|
char reserved_bits : 6;
|
|
short difficulty;
|
|
//char town_strs[180][256];
|
|
char town_name[256];
|
|
char rect_names[16][256];
|
|
char comment[3][256];
|
|
char spec_strs[100][256];
|
|
char sign_strs[20][256];
|
|
char(& town_strs(short i))[256] __attribute__((deprecated));
|
|
cSpeech talking;
|
|
|
|
virtual ~cTown(){}
|
|
virtual void append(legacy::big_tr_type& old);
|
|
virtual void append(legacy::ave_tr_type& old);
|
|
virtual void append(legacy::tiny_tr_type& old);
|
|
virtual ter_num_t& terrain(size_t x, size_t y) = 0;
|
|
virtual rectangle& room_rect(size_t i) = 0;
|
|
virtual cCreature& creatures(size_t i) = 0;
|
|
virtual unsigned char& lighting(size_t i, size_t r) = 0;
|
|
virtual short max_dim() = 0;
|
|
virtual short max_monst() = 0;
|
|
virtual short max_items() = 0;
|
|
|
|
cTown();
|
|
cTown(short size);
|
|
cTown& operator = (legacy::town_record_type& old);
|
|
void writeTo(std::ostream& file);
|
|
};
|
|
|
|
#endif |