Mostly bugfixes and small changes.

- 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
This commit is contained in:
2009-06-18 16:51:14 +00:00
parent acbba1b625
commit 2c5faa51c3
15 changed files with 142 additions and 150 deletions

View File

@@ -185,3 +185,10 @@ void cOutdoors::cWandering::readAttrFrom(std::string cur, std::istream& sin){
else if(cur == "SDF")
sin >> end_spec1 >> end_spec2;
}
bool cOutdoors::cWandering::isNull(){
for (short i = 0; i < 7; i++)
if (monst[i] != 0)
return false;
return true;
}

View File

@@ -28,6 +28,7 @@ public:
short spec_on_meet,spec_on_win,spec_on_flee,cant_flee;
short end_spec1,end_spec2;
bool isNull();
cWandering& operator = (legacy::out_wandering_type old);
void writeTo(std::ostream& file, std::string prefix = "");
void readAttrFrom(std::string cur, std::istream& sin);
@@ -58,9 +59,9 @@ public:
char comment[256];
char spec_strs[90][256];
char sign_strs[8][256];
char(& out_strs(short i))[256] __attribute__((deprecated));
bool special_spot[48][48];
char(& out_strs(short i))[256] __attribute__((deprecated));
cOutdoors();
cOutdoors& operator = (legacy::outdoor_record_type& old);
void writeTo(std::ostream& file);

View File

@@ -75,10 +75,6 @@ cTown& cTown::operator = (legacy::town_record_type& old){
strlens[i] = old.strlens[i];
for(i = 0; i < 100; i++)
specials[i] = old.specials[i];
specials1 = old.specials1;
specials2 = old.specials2;
res1 = old.res1;
res2 = old.res2;
difficulty = old.difficulty;
return *this;
}
@@ -140,10 +136,6 @@ cTown::cTown(short size){
for (i = 0; i < 100; i++) {
specials[i] = cSpecial();
}
specials1 = 0;
specials2 = 0;
res1 = 0;
res2 = 0;
difficulty = 0;
}
@@ -183,3 +175,9 @@ cTown::cField& cTown::cField::operator = (legacy::preset_field_type old){
return *this;
}
bool cTown::cWandering::isNull(){
for (short i = 0;i < 4;i++)
if (monst[i] != 0)
return false;
return true;
}

View File

@@ -44,6 +44,7 @@ public:
public:
m_num_t monst[4];
bool isNull();
cWandering& operator = (legacy::wandering_type old);
};
class cItem { // formerly preset_item_type
@@ -80,7 +81,10 @@ public:
short timer_specs[8];
unsigned char strlens[180];
cSpecial specials[100];
unsigned char specials1,specials2,res1,res2;
//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];

View File

@@ -674,6 +674,10 @@ ter_num_t(& cCurOut::operator [] (size_t i))[96]{
return out[i];
}
ter_num_t& cCurOut::operator [] (location loc) {
return out[loc.x][loc.y];
}
void cCurOut::writeTo(std::ostream& file){
// for(int i = 0; i < 96; i++){
// file << expl[i][0];
@@ -823,3 +827,11 @@ short cUniverse::difficulty_adjust() {
return adj;
}
short cCurTown::countMonsters(){
short to_ret = 0;
for (short i = 0; i < record->max_monst(); i++)
if (monst[i].active > 0)
to_ret++;
return to_ret;
}

View File

@@ -46,14 +46,15 @@ public:
void append(unsigned char(& old_sfx)[64][64], unsigned char(& old_misc_i)[64][64]);
void cCurTown::append(legacy::big_tr_type& old);
unsigned char explored(char x,char y) const;
unsigned char misc_i(char x, char y) const;
unsigned char sfx(char x, char y) const;
unsigned char explored(char x,char y) const __attribute__((deprecated));
unsigned char misc_i(char x, char y) const __attribute__((deprecated));
unsigned char sfx(char x, char y) const __attribute__((deprecated));
cTown* operator -> ();
cCurTown();
bool loaded() const;
void unload();
short countMonsters();
bool is_explored(char x, char y) const;
bool is_force_wall(char x, char y) const;
@@ -126,6 +127,7 @@ public:
void append(legacy::out_info_type& old);
ter_num_t(& operator [] (size_t i))[96];
ter_num_t& operator [] (location loc);
void writeTo(std::ostream& file);
void readFrom(std::istream& file);
};