- Generalized the special queue which was formerly used only for town enter/leave specials, and made the see monster special also use it.

- Redid the draw items and draw fields code to draw just on one space rather than the entire area.
- Fixed bug where special spots were not masked properly.
- Removed some large chunks of commented, obsolete code.
- Found and fixed bug where the instant help system caused the game to believe you had stolen items when in fact you hadn't.
- Added enum for special node context (ie the context in which a special node is being run); not really used yet though.
- Added support and graphic for forcecage, and graphic for stone block; mechanics not yet implemented.

git-svn-id: http://openexile.googlecode.com/svn/trunk@88 4ebdad44-0ea0-11de-aab3-ff745001d230
This commit is contained in:
2009-06-02 02:07:17 +00:00
parent 715aab7a3c
commit c958e5b01c
15 changed files with 388 additions and 479 deletions

View File

@@ -55,9 +55,15 @@ cMonster& cMonster::operator = (legacy::monster_record_type& old){
default_facial_pic = old.default_facial_pic;
picture_num = old.picture_num;
if(picture_num == 122) picture_num = 119;
see_spec = -1;
return *this;
}
cMonster::cMonster(){
// TODO: Fill in
see_spec = -1;
}
cCreature::cCreature(){
// short personality;
// short special_on_kill,facial_pic;

View File

@@ -146,6 +146,7 @@ public:
std::string getAbil2Name();
bool hasAbil(eMonstAbil what, unsigned char* x1 = NULL, unsigned char* x2 = NULL);
cMonster& operator = (legacy::monster_record_type& old);
cMonster();
void writeTo(std::ostream& file, std::string prefix);
};

View File

@@ -484,3 +484,25 @@ inline void operator += (eDamageType& cur, eDamageType othr){
// operator int() {return c;}
// sbyte(signed char k) : c(k) {}
//}
enum eSpecContext {
SPEC_OUT_MOVE = 0,
SPEC_TOWN_MOVE = 1,
SPEC_COMBAT_MOVE = 2,
SPEC_OUT_LOOK = 3,
SPEC_TOWN_LOOK = 4,
SPEC_ENTER_TOWN = 5,
SPEC_LEAVE_TOWN = 6,
SPEC_TALK = 7,
SPEC_USE_SPEC_ITEM = 8,
SPEC_TOWN_TIMER = 9,
SPEC_SCEN_TIMER = 10,
SPEC_PARTY_TIMER = 11,
SPEC_KILL_MONST = 12,
SPEC_OUTDOOR_ENC = 13,
SPEC_WIN_ENCOUNTER = 14,
SPEC_FLEE_ENCOUNTER = 15,
SPEC_TARGET = 16,
SPEC_USE_SPACE = 17,
SPEC_SEE_MONST = 18,
};

View File

@@ -32,4 +32,11 @@ public:
void writeTo(std::ostream& file);
};
struct pending_special_type {
spec_num_t spec;
eSpecContext mode;
unsigned char type; // 0 - scen, 1 - out, 2 - town
location where;
};
#endif

View File

@@ -237,6 +237,11 @@ bool cCurTown::is_rubble(char x, char y) const{
return fields[x][y] & 8388608L;
}
bool cCurTown::is_force_cage(char x, char y) const{
if(x > record->max_dim() || y > record->max_dim()) return false;
return fields[x][y] & 16777216L;
}
//bool cCurTown::is_trim(char x, char y, char t){
// unsigned char bit = 1 << t;
// return trim[x][y] & bit;
@@ -612,6 +617,15 @@ bool cCurTown::set_rubble(char x, char y, bool b){
return true;
}
bool cCurTown::set_force_cage(char x, char y, bool b){
// TODO: Consider whether placing a forcecage should erase anything already present, or fail due to something already present
// TODO: Also consider checking for forcecage in some of the other placement functions.
if(x > record->max_dim() || y > record->max_dim()) return false;
if(b) fields[x][y] |= 16777216L;
else fields[x][y] &= ~16777216L;
return true;
}
//bool cCurTown::set_trim(char x, char y, char t, bool b){
// unsigned char bit = 1 << t;
// if(b){

View File

@@ -80,6 +80,7 @@ public:
bool is_ash(char x, char y) const;
bool is_bones(char x, char y) const;
bool is_rubble(char x, char y) const;
bool is_force_cage(char x, char y) const;
// bool is_trim(char x, char y, char t) const;
bool set_explored(char x, char y, bool b);
bool set_force_wall(char x, char y, bool b);
@@ -106,6 +107,7 @@ public:
bool set_ash(char x, char y, bool b);
bool set_bones(char x, char y, bool b);
bool set_rubble(char x, char y, bool b);
bool set_force_cage(char x, char y, bool b);
// bool set_trim(char x, char y, char t, bool b);
void writeTo(std::ostream& file);
void readFrom(std::istream& file);