Fixed special spots; they now appear in-game, and disappear when they should.
git-svn-id: http://openexile.googlecode.com/svn/trunk@58 4ebdad44-0ea0-11de-aab3-ff745001d230
This commit is contained in:
@@ -385,15 +385,15 @@ void cItemRec::readAttrFrom(string cur, istream& sin){
|
||||
}
|
||||
|
||||
ostream& operator << (ostream& out, eWeapType& e){
|
||||
out << (int) e;
|
||||
return out << (int) e;
|
||||
}
|
||||
|
||||
ostream& operator << (ostream& out, eItemType& e){
|
||||
out << (int) e;
|
||||
return out << (int) e;
|
||||
}
|
||||
|
||||
ostream& operator << (ostream& out, eItemAbil& e){
|
||||
out << (int) e;
|
||||
return out << (int) e;
|
||||
}
|
||||
|
||||
istream& operator >> (istream& in, eWeapType& e){
|
||||
@@ -402,6 +402,7 @@ istream& operator >> (istream& in, eWeapType& e){
|
||||
if(i > 0 && i < 4)
|
||||
e = (eWeapType) i;
|
||||
else e = ITEM_NOT_MELEE;
|
||||
return in;
|
||||
}
|
||||
|
||||
istream& operator >> (istream& in, eItemType& e){
|
||||
@@ -410,6 +411,7 @@ istream& operator >> (istream& in, eItemType& e){
|
||||
if(i > 0 && i < 28)
|
||||
e = (eItemType) i;
|
||||
else e = ITEM_TYPE_NO_ITEM;
|
||||
return in;
|
||||
}
|
||||
|
||||
istream& operator >> (istream& in, eItemAbil& e){
|
||||
@@ -420,4 +422,5 @@ istream& operator >> (istream& in, eItemAbil& e){
|
||||
(i > 149 && i < 162) || (i > 169 && i < 177))
|
||||
e = (eItemAbil) i;
|
||||
else e = ITEM_NO_ABILITY;
|
||||
return in;
|
||||
}
|
||||
|
@@ -448,4 +448,4 @@ void cParty::readFrom(istream& file){
|
||||
for(int j = 0; j < 64; j++)
|
||||
for(int k = 0; k < 64; k++)
|
||||
bin >> setup[i][j][k];
|
||||
}
|
||||
}
|
||||
|
@@ -355,7 +355,7 @@ void cPlayer::readFrom(istream& file){
|
||||
}
|
||||
|
||||
ostream& operator << (ostream& out, eMainStatus& e){
|
||||
out << (int) e;
|
||||
return out << (int) e;
|
||||
}
|
||||
|
||||
istream& operator >> (istream& in, eMainStatus& e){
|
||||
@@ -364,4 +364,5 @@ istream& operator >> (istream& in, eMainStatus& e){
|
||||
if(i > 0 && i < 18 && i !=8 && i != 9)
|
||||
e = (eMainStatus) i;
|
||||
else e = MAIN_STATUS_ABSENT;
|
||||
return in;
|
||||
}
|
||||
|
@@ -15,7 +15,7 @@ __attribute__((deprecated))
|
||||
void cTinyTown::append(legacy::tiny_tr_type& old){
|
||||
int i,j;
|
||||
cField the_field;
|
||||
the_field.type = 1;
|
||||
the_field.type = 2;
|
||||
for (i = 0; i < 32; i++)
|
||||
for (j = 0; j < 32; j++) {
|
||||
_terrain[i][j] = old.terrain[i][j];
|
||||
@@ -57,7 +57,7 @@ __attribute__((deprecated))
|
||||
void cMedTown::append(legacy::ave_tr_type& old){
|
||||
int i,j;
|
||||
cField the_field;
|
||||
the_field.type = 1;
|
||||
the_field.type = 2;
|
||||
for (i = 0; i < 48; i++)
|
||||
for (j = 0; j < 48; j++) {
|
||||
_terrain[i][j] = old.terrain[i][j];
|
||||
@@ -99,7 +99,7 @@ __attribute__((deprecated))
|
||||
void cBigTown::append(legacy::big_tr_type& old){
|
||||
int i,j;
|
||||
cField the_field;
|
||||
the_field.type = 1;
|
||||
the_field.type = 2;
|
||||
for (i = 0; i < 64; i++)
|
||||
for (j = 0; j < 64; j++) {
|
||||
_terrain[i][j] = old.terrain[i][j];
|
||||
|
@@ -154,11 +154,15 @@ bool cCurTown::is_sleep_cloud(char x, char y) const{
|
||||
return fields[x][y] & 128L;
|
||||
}
|
||||
|
||||
bool cCurTown::is_spot(char x, char y) const{ // currently unused
|
||||
bool cCurTown::is_block(char x, char y) const{ // currently unused
|
||||
if(x > record->max_dim() || y > record->max_dim()) return false;
|
||||
return fields[x][y] & 256L;
|
||||
}
|
||||
|
||||
bool cCurTown::is_spot(char x, char y) const{
|
||||
return special_spot[x][y];
|
||||
}
|
||||
|
||||
bool cCurTown::is_special(char x, char y) const{
|
||||
if(x > record->max_dim() || y > record->max_dim()) return false;
|
||||
return fields[x][y] & 512L;
|
||||
@@ -238,6 +242,7 @@ bool cCurTown::set_explored(char x, char y, bool b){
|
||||
if(x > record->max_dim() || y > record->max_dim()) return false;
|
||||
if(b) fields[x][y] |= 1L;
|
||||
else fields[x][y] &= ~1L;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool cCurTown::set_force_wall(char x, char y, bool b){
|
||||
@@ -348,16 +353,24 @@ bool cCurTown::set_sleep_cloud(char x, char y, bool b){
|
||||
return true;
|
||||
}
|
||||
|
||||
bool cCurTown::set_spot(char x, char y, bool b){ // currently unused
|
||||
bool cCurTown::set_block(char x, char y, bool b){ // currently unused
|
||||
if(x > record->max_dim() || y > record->max_dim()) return false;
|
||||
if(b) fields[x][y] |= 256L;
|
||||
else fields[x][y] &= ~256L;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool cCurTown::set_spot(char x, char y, bool b){
|
||||
if(x > record->max_dim() || y > record->max_dim()) return false;
|
||||
special_spot[x][y] = b;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool cCurTown::set_special(char x, char y, bool b){
|
||||
if(x > record->max_dim() || y > record->max_dim()) return false;
|
||||
if(b) fields[x][y] |= 512L;
|
||||
else fields[x][y] &= ~512L;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool cCurTown::set_web(char x, char y, bool b){
|
||||
@@ -479,6 +492,7 @@ bool cCurTown::set_sm_blood(char x, char y, bool b){
|
||||
set_rubble(x,y,false);
|
||||
}
|
||||
else fields[x][y] &= ~65536L;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool cCurTown::set_med_blood(char x, char y, bool b){
|
||||
@@ -495,6 +509,7 @@ bool cCurTown::set_med_blood(char x, char y, bool b){
|
||||
set_rubble(x,y,false);
|
||||
}
|
||||
else fields[x][y] &= ~131072L;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool cCurTown::set_lg_blood(char x, char y, bool b){
|
||||
@@ -510,6 +525,7 @@ bool cCurTown::set_lg_blood(char x, char y, bool b){
|
||||
set_rubble(x,y,false);
|
||||
}
|
||||
else fields[x][y] &= ~262144L;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool cCurTown::set_sm_slime(char x, char y, bool b){
|
||||
@@ -525,6 +541,7 @@ bool cCurTown::set_sm_slime(char x, char y, bool b){
|
||||
set_rubble(x,y,false);
|
||||
}
|
||||
else fields[x][y] &= ~524288L;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool cCurTown::set_lg_slime(char x, char y, bool b){
|
||||
@@ -540,6 +557,7 @@ bool cCurTown::set_lg_slime(char x, char y, bool b){
|
||||
set_rubble(x,y,false);
|
||||
}
|
||||
else fields[x][y] &= ~1048576L;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool cCurTown::set_ash(char x, char y, bool b){
|
||||
@@ -555,6 +573,7 @@ bool cCurTown::set_ash(char x, char y, bool b){
|
||||
set_rubble(x,y,false);
|
||||
}
|
||||
else fields[x][y] &= ~2097152L;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool cCurTown::set_bones(char x, char y, bool b){
|
||||
@@ -570,6 +589,7 @@ bool cCurTown::set_bones(char x, char y, bool b){
|
||||
set_rubble(x,y,false);
|
||||
}
|
||||
else fields[x][y] &= ~4194304L;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool cCurTown::set_rubble(char x, char y, bool b){
|
||||
@@ -585,6 +605,7 @@ bool cCurTown::set_rubble(char x, char y, bool b){
|
||||
set_bones(x,y,false);
|
||||
}
|
||||
else fields[x][y] &= ~8388608L;
|
||||
return true;
|
||||
}
|
||||
|
||||
unsigned char cCurTown::explored(char x,char y) const{
|
||||
|
@@ -33,6 +33,7 @@ public:
|
||||
|
||||
//unsigned short template_terrain[64][64];
|
||||
unsigned long fields[64][64];
|
||||
bool special_spot[64][64];
|
||||
|
||||
void append(legacy::current_town_type& old,short which_size);
|
||||
void append(legacy::town_item_list& old);
|
||||
@@ -56,7 +57,8 @@ public:
|
||||
bool is_ice_wall(char x, char y) const;
|
||||
bool is_blade_wall(char x, char y) const;
|
||||
bool is_sleep_cloud(char x, char y) const;
|
||||
bool is_spot(char x, char y) const; // currently unused
|
||||
bool is_block(char x, char y) const; // currently unused
|
||||
bool is_spot(char x, char y) const;
|
||||
bool is_special(char x, char y) const;
|
||||
bool is_web(char x, char y) const;
|
||||
bool is_crate(char x, char y) const;
|
||||
@@ -80,7 +82,8 @@ public:
|
||||
bool set_ice_wall(char x, char y, bool b);
|
||||
bool set_blade_wall(char x, char y, bool b);
|
||||
bool set_sleep_cloud(char x, char y, bool b);
|
||||
bool set_spot(char x, char y, bool b); // currently unused
|
||||
bool set_block(char x, char y, bool b); // currently unused
|
||||
bool set_spot(char x, char y, bool b);
|
||||
bool set_special(char x, char y, bool b);
|
||||
bool set_web(char x, char y, bool b);
|
||||
bool set_crate(char x, char y, bool b);
|
||||
|
Reference in New Issue
Block a user