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

@@ -40,17 +40,13 @@ template<> pair<string,cPict*> cDialog::parse(Element& who /*pict*/){
std::istringstream sin(val);
bool wide = false, tall = false, custom = false;
int width = 0, height = 0;
printf("%p\n",p.second);
p.second = new cPict(this);
printf("%p\n",p.second);
for(attr = attr.begin(&who); attr != attr.end(); attr++){
printf("%p\n",p.second);
attr->GetName(&name);
attr->GetValue(&val);
if(name == "name")
p.first = val;
else if(name == "type"){
printf("%p\n",p.second);
if(val == "blank"){
p.second->picType = PIC_TER;
p.second->picNum = -1;
@@ -93,7 +89,6 @@ template<> pair<string,cPict*> cDialog::parse(Element& who /*pict*/){
else if(val == "large") wide = tall = true;
else throw xBadVal("pict",name,val);
}else if(name == "num"){
printf("%p\n",p.second);
sin.str(val);
sin >> p.second->picNum;
}else if(name == "top"){

View File

@@ -19,46 +19,51 @@ extern GWorldPtr bg_gworld;
void cPict::init(){
// TODO: Load or otherwise acquire the various GWorlds.
teranim = dlog = talk = scen = largeScen = item = tinyItem = pc = field = boom = missile = save = header = map = status = NULL;
drawPict[PIC_TER] = drawPresetTer;
drawPict[PIC_TER_ANIM] = drawPresetTerAnim;
drawPict[PIC_MONST] = drawPresetMonstSm;
drawPict[PIC_DLOG] = drawPresetDlog;
drawPict[PIC_TALK] = drawPresetTalk;
drawPict[PIC_SCEN] = drawPresetScen;
drawPict[PIC_ITEM] = drawPresetItem;
drawPict[PIC_PC] = drawPresetPc;
drawPict[PIC_FIELD] = drawPresetField;
drawPict[PIC_BOOM] = drawPresetBoom;
drawPict[PIC_FULL] = drawFullSheet;
drawPict[PIC_MISSILE] = drawPresetMissile;
drawPict[PIC_DLOG_LG] = drawPresetDlogLg;
drawPict[PIC_SCEN_LG] = drawPresetScenLg;
drawPict[PIC_TER_MAP] = drawPresetTerMap;
drawPict[PIC_TER_MAP] = drawStatusIcon;
drawPict[PIC_MONST_WIDE] = drawPresetMonstWide;
drawPict[PIC_MONST_TALL] = drawPresetMonstTall;
drawPict[PIC_MONST_LG] = drawPresetMonstLg;
drawPict[PIC_CUSTOM_TER] = drawCustomTer;
drawPict[PIC_CUSTOM_TER_ANIM] = drawCustomTerAnim;
drawPict[PIC_CUSTOM_MONST] = drawCustomMonstSm;
drawPict[PIC_CUSTOM_DLOG] = drawCustomDlog;
drawPict[PIC_CUSTOM_TALK] = drawCustomTalk;
drawPict[PIC_CUSTOM_SCEN] = drawCustomTalk;
drawPict[PIC_CUSTOM_ITEM] = drawCustomItem;
drawPict[PIC_CUSTOM_FULL] = drawFullSheet;
drawPict[PIC_CUSTOM_MISSILE] = drawCustomMissile;
drawPict[PIC_CUSTOM_DLOG_LG] = drawCustomDlogLg;
drawPict[PIC_CUSTOM_TER_MAP] = drawCustomTerMap;
drawPict[PIC_CUSTOM_MONST_WIDE] = drawCustomMonstWide;
drawPict[PIC_CUSTOM_MONST_TALL] = drawCustomMonstTall;
drawPict[PIC_CUSTOM_MONST_LG] = drawCustomMonstLg;
drawPict[PIC_PARTY_MONST] = drawPartyMonstSm;
drawPict[PIC_PARTY_SCEN] = drawPartyScen;
drawPict[PIC_PARTY_ITEM] = drawPartyItem;
drawPict[PIC_PARTY_PC] = drawPartyPc;
drawPict[PIC_PARTY_MONST_WIDE] = drawPartyMonstWide;
drawPict[PIC_PARTY_MONST_TALL] = drawPartyMonstTall;
drawPict[PIC_PARTY_MONST_LG] = drawPartyMonstLg;
drawPict()[PIC_TER] = drawPresetTer;
drawPict()[PIC_TER_ANIM] = drawPresetTerAnim;
drawPict()[PIC_MONST] = drawPresetMonstSm;
drawPict()[PIC_DLOG] = drawPresetDlog;
drawPict()[PIC_TALK] = drawPresetTalk;
drawPict()[PIC_SCEN] = drawPresetScen;
drawPict()[PIC_ITEM] = drawPresetItem;
drawPict()[PIC_PC] = drawPresetPc;
drawPict()[PIC_FIELD] = drawPresetField;
drawPict()[PIC_BOOM] = drawPresetBoom;
drawPict()[PIC_FULL] = drawFullSheet;
drawPict()[PIC_MISSILE] = drawPresetMissile;
drawPict()[PIC_DLOG_LG] = drawPresetDlogLg;
drawPict()[PIC_SCEN_LG] = drawPresetScenLg;
drawPict()[PIC_TER_MAP] = drawPresetTerMap;
drawPict()[PIC_TER_MAP] = drawStatusIcon;
drawPict()[PIC_MONST_WIDE] = drawPresetMonstWide;
drawPict()[PIC_MONST_TALL] = drawPresetMonstTall;
drawPict()[PIC_MONST_LG] = drawPresetMonstLg;
drawPict()[PIC_CUSTOM_TER] = drawCustomTer;
drawPict()[PIC_CUSTOM_TER_ANIM] = drawCustomTerAnim;
drawPict()[PIC_CUSTOM_MONST] = drawCustomMonstSm;
drawPict()[PIC_CUSTOM_DLOG] = drawCustomDlog;
drawPict()[PIC_CUSTOM_TALK] = drawCustomTalk;
drawPict()[PIC_CUSTOM_SCEN] = drawCustomTalk;
drawPict()[PIC_CUSTOM_ITEM] = drawCustomItem;
drawPict()[PIC_CUSTOM_FULL] = drawFullSheet;
drawPict()[PIC_CUSTOM_MISSILE] = drawCustomMissile;
drawPict()[PIC_CUSTOM_DLOG_LG] = drawCustomDlogLg;
drawPict()[PIC_CUSTOM_TER_MAP] = drawCustomTerMap;
drawPict()[PIC_CUSTOM_MONST_WIDE] = drawCustomMonstWide;
drawPict()[PIC_CUSTOM_MONST_TALL] = drawCustomMonstTall;
drawPict()[PIC_CUSTOM_MONST_LG] = drawCustomMonstLg;
drawPict()[PIC_PARTY_MONST] = drawPartyMonstSm;
drawPict()[PIC_PARTY_SCEN] = drawPartyScen;
drawPict()[PIC_PARTY_ITEM] = drawPartyItem;
drawPict()[PIC_PARTY_PC] = drawPartyPc;
drawPict()[PIC_PARTY_MONST_WIDE] = drawPartyMonstWide;
drawPict()[PIC_PARTY_MONST_TALL] = drawPartyMonstTall;
drawPict()[PIC_PARTY_MONST_LG] = drawPartyMonstLg;
}
std::map<ePicType,void(*)(short,GWorldPtr,Rect)>& cPict::drawPict(){
static std::map<ePicType,void(*)(short,GWorldPtr,Rect)> f;
return f;
}
void cPict::attachClickHandler(click_callback_t f) throw(){
@@ -500,8 +505,8 @@ GWorldPtr cPict::item = NULL, cPict::tinyItem = NULL, cPict::pc = NULL, cPict::f
GWorldPtr cPict::missile = NULL, cPict::save = NULL, cPict::header = NULL, cPict::map = NULL, cPict::status = NULL;
std::vector<GWorldPtr> cPict::ter, cPict::monst, cPict::customSheets;
std::map<size_t,GWorldPtr> cPict::largeSheets;
//std::map<ePicType,void(*)(short,GWorldPtr,Rect)> cPict::drawPict;
void(* cPict::drawPict[NUM_PIC_TYPES])(short,GWorldPtr,Rect);
//std::map<ePicType,void(*)(short,GWorldPtr,Rect)> cPict::drawPict();
//void(* cPict::drawPict()[NUM_PIC_TYPES])(short,GWorldPtr,Rect);
short cPict::animFrame = 0;
void cPict::draw(){
@@ -523,7 +528,7 @@ void cPict::draw(){
GetBackColor(&store_color);
BackColor(whiteColor);
drawPict[picType](picNum,(GWorldPtr) parent->win,rect);
drawPict()[picType](picNum,(GWorldPtr) parent->win,rect);
if(drawFramed) drawFrame(2,0);
}

View File

@@ -154,8 +154,8 @@ private:
static void drawPartyScen(short num, GWorldPtr to_gw, Rect to_rect);
static void drawPartyItem(short num, GWorldPtr to_gw, Rect to_rect);
static void drawPartyPc(short num, GWorldPtr to_gw, Rect to_rect);
//static std::map<ePicType,void(*)(short,GWorldPtr,Rect)> drawPict;
static void(* drawPict[NUM_PIC_TYPES])(short,GWorldPtr,Rect);
static std::map<ePicType,void(*)(short,GWorldPtr,Rect)>& drawPict();
//static void(* drawPict[NUM_PIC_TYPES])(short,GWorldPtr,Rect);
click_callback_t onClick;
};