Several Mac bug fixes, most of which are untested (but are known to work in the Windows version)
- Added code to the special queue handling which runs the queued specials as if they had happened at the time the special was queue, rather than when it's actually run. - Fixed bug in which horses would enter lava while outdoors, but not in town. - Fixed bug that sometimes occurred when a PC is killed by backlash while attempting to move away from a monster. - Fixed checking for the wrong ability in handle_disease(). - Fixed bug in which asking about "name" would not show the Name response while talking. Instead, asking about "nama" would show that response. - Added a response to "buy" and "bye". - Removed the check in destroy_an_item() which gave rocks the top priorite to be destroyed. They still have high priority due to a value below 3, and besides this function will eventually be deprecated. - Added a check to Absorb Spells monsters to avoid overflow of the monster's health. - If you call add_string_to_buf with an empty string, it now does nothing. - Changed cItemRec::type_flag to unsigned short, since it's supposed to be able to range up to 1000. - Added flag to the scenario structure to disable the automatic doubling of hit points with high level parties. - Fixed bug in which starting combat in dense forest results in a swap arena instead of a forest arena. (This was never noticed because dense forest is usually impassable.) - Fixed bug with triggering combat on a walkway space (if in cave, a grass arena was created and vice versa) - Extended the conversion code to account for arenas on animated terrain. I also started to rework the way Split Party works, only to decide that I didn't want to do it that way. As a result, I haven't written code to convert split party data from old saved game files, yet. - The old SDF_ constants related to party splitting are now gone. - Several member functions are added to cParty to fulfill the function of the constants - Altered the way an Affect PC node will decide which PC to affect. If the party is split and only one PC is present, it affects that PC. Otherwise, it affects the chosen PC, even if the party is split. git-svn-id: http://openexile.googlecode.com/svn/trunk@111 4ebdad44-0ea0-11de-aab3-ff745001d230
This commit is contained in:
@@ -28,7 +28,7 @@ public:
|
||||
unsigned short graphic_num;
|
||||
eItemAbil ability;
|
||||
unsigned char ability_strength;
|
||||
unsigned char type_flag;
|
||||
unsigned short type_flag;
|
||||
unsigned char is_special;
|
||||
short value;
|
||||
unsigned char weight;
|
||||
|
@@ -484,3 +484,73 @@ unsigned char cParty::get_ptr(short p){
|
||||
if(iter == pointers.end()) return 0;
|
||||
return stuff_done[iter->second.first][iter->second.second];
|
||||
}
|
||||
|
||||
bool cParty::is_split(){
|
||||
bool ret = false;
|
||||
for(int i = 0; i < 6; i++)
|
||||
if(!stuff_done[304][i])
|
||||
ret = true;
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool cParty::pc_present(short i){
|
||||
if(i >= 6 || i < 0) return false;
|
||||
return stuff_done[304][i];
|
||||
}
|
||||
|
||||
location cParty::left_at(){
|
||||
return loc(stuff_done[304][6],stuff_done[304][7]);
|
||||
}
|
||||
|
||||
size_t cParty::left_in(){
|
||||
return stuff_done[304][8];
|
||||
}
|
||||
extern cUniverse univ;
|
||||
std::string cParty::start_split(short a,short b,snd_num_t noise,short who) {
|
||||
short i;
|
||||
|
||||
if(who >= 6 || who < 0) return "";
|
||||
if(is_split())
|
||||
return "Party already split!";
|
||||
stuff_done[304][who] = 0;
|
||||
stuff_done[304][6] = univ.town.p_loc.x;
|
||||
stuff_done[304][7] = univ.town.p_loc.y;
|
||||
stuff_done[304][8] = univ.town.num;
|
||||
univ.town.p_loc.x = a;
|
||||
univ.town.p_loc.y = b;
|
||||
for (i = 0; i < 6; i++)
|
||||
if (!stuff_done[304][who])
|
||||
adven[i].main_status += MAIN_STATUS_SPLIT;
|
||||
if (noise > 0)
|
||||
play_sound(10);
|
||||
return "";
|
||||
}
|
||||
|
||||
std::string cParty::end_split(snd_num_t noise) {
|
||||
short i;
|
||||
|
||||
if (!is_split())
|
||||
return "Party already together!";
|
||||
univ.town.p_loc = left_at();
|
||||
univ.town.num = left_in();
|
||||
for (i = 0; i < 6; i++){
|
||||
if (univ.party[i].main_status >= MAIN_STATUS_SPLIT)
|
||||
univ.party[i].main_status -= MAIN_STATUS_SPLIT;
|
||||
stuff_done[304][i] = true;
|
||||
}
|
||||
if (noise > 0)
|
||||
play_sound(10);
|
||||
return "You are reunited.";
|
||||
}
|
||||
|
||||
short cParty::pc_present(){
|
||||
short ret = 7;
|
||||
for(int i = 0; i < 6; i++){
|
||||
if(stuff_done[304][i] && ret == 7)
|
||||
ret = i;
|
||||
else if(stuff_done[304][i] && ret < 6)
|
||||
ret = 6;
|
||||
}
|
||||
if(ret == 7) ret = 6;
|
||||
return ret;
|
||||
}
|
||||
|
@@ -122,6 +122,14 @@ public:
|
||||
void writeTo(std::ostream& file);
|
||||
void readFrom(std::istream& file);
|
||||
|
||||
std::string start_split(short a, short b, snd_num_t noise, short who);
|
||||
std::string end_split(snd_num_t noise);
|
||||
bool is_split();
|
||||
bool pc_present(short n);
|
||||
short pc_present(); // If only one pc is present, returns the number of that pc. Otherwise returns 6.
|
||||
location left_at(); // The location that the left-behind character in a split were left at.
|
||||
size_t left_in(); // The town they were left in.
|
||||
|
||||
typedef std::vector<cEncNote>::iterator encIter;
|
||||
typedef std::vector<cJournal>::iterator journalIter;
|
||||
typedef std::vector<cConvers>::iterator talkIter;
|
||||
|
@@ -14,27 +14,6 @@
|
||||
|
||||
namespace legacy { struct pc_record_type; };
|
||||
|
||||
enum eMainStatus {
|
||||
MAIN_STATUS_ABSENT = 0, // absent, empty slot
|
||||
MAIN_STATUS_ALIVE = 1,
|
||||
MAIN_STATUS_DEAD = 2,
|
||||
MAIN_STATUS_DUST = 3,
|
||||
MAIN_STATUS_STONE = 4,
|
||||
MAIN_STATUS_FLED = 5,
|
||||
MAIN_STATUS_SURFACE = 6, // fled to surface?
|
||||
MAIN_STATUS_WON = 7,
|
||||
MAIN_STATUS_SPLIT = 10,
|
||||
// The rest are not really necessary, but are here for completeness so that all valid values have a name.
|
||||
MAIN_STATUS_SPLIT_ABSENT = MAIN_STATUS_SPLIT + MAIN_STATUS_ABSENT,
|
||||
MAIN_STATUS_SPLIT_ALIVE = MAIN_STATUS_SPLIT + MAIN_STATUS_ALIVE,
|
||||
MAIN_STATUS_SPLIT_DEAD = MAIN_STATUS_SPLIT + MAIN_STATUS_DEAD,
|
||||
MAIN_STATUS_SPLIT_DUST = MAIN_STATUS_SPLIT + MAIN_STATUS_DUST,
|
||||
MAIN_STATUS_SPLIT_STONE = MAIN_STATUS_SPLIT + MAIN_STATUS_STONE,
|
||||
MAIN_STATUS_SPLIT_FLED = MAIN_STATUS_SPLIT + MAIN_STATUS_FLED,
|
||||
MAIN_STATUS_SPLIT_SURFACE = MAIN_STATUS_SPLIT + MAIN_STATUS_SURFACE,
|
||||
MAIN_STATUS_SPLIT_WON = MAIN_STATUS_SPLIT + MAIN_STATUS_WON,
|
||||
};
|
||||
|
||||
class cPlayer {
|
||||
public:
|
||||
eMainStatus main_status;
|
||||
|
@@ -92,6 +92,7 @@ cScenario& cScenario::operator = (legacy::scenario_data_type& old){
|
||||
last_out_edited.x = old.last_out_edited.x;
|
||||
last_out_edited.y = old.last_out_edited.y;
|
||||
last_town_edited = old.last_town_edited;
|
||||
adjust_diff = true;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
@@ -88,6 +88,8 @@ public:
|
||||
char spec_item_strs[50][256];
|
||||
char spec_strs[100][256];
|
||||
char monst_strs[100][256];
|
||||
bool adjust_diff : 1;
|
||||
char : 7;
|
||||
FSSpec scen_file; // transient
|
||||
cOutdoors* outdoors;
|
||||
cTown* towns;
|
||||
|
@@ -12,6 +12,27 @@ typedef signed short spec_num_t;
|
||||
typedef signed short item_num_t;
|
||||
typedef unsigned short str_num_t;
|
||||
|
||||
enum eMainStatus {
|
||||
MAIN_STATUS_ABSENT = 0, // absent, empty slot
|
||||
MAIN_STATUS_ALIVE = 1,
|
||||
MAIN_STATUS_DEAD = 2,
|
||||
MAIN_STATUS_DUST = 3,
|
||||
MAIN_STATUS_STONE = 4,
|
||||
MAIN_STATUS_FLED = 5,
|
||||
MAIN_STATUS_SURFACE = 6, // fled to surface?
|
||||
MAIN_STATUS_WON = 7,
|
||||
MAIN_STATUS_SPLIT = 10,
|
||||
// The rest are not really necessary, but are here for completeness so that all valid values have a name.
|
||||
MAIN_STATUS_SPLIT_ABSENT = MAIN_STATUS_SPLIT + MAIN_STATUS_ABSENT,
|
||||
MAIN_STATUS_SPLIT_ALIVE = MAIN_STATUS_SPLIT + MAIN_STATUS_ALIVE,
|
||||
MAIN_STATUS_SPLIT_DEAD = MAIN_STATUS_SPLIT + MAIN_STATUS_DEAD,
|
||||
MAIN_STATUS_SPLIT_DUST = MAIN_STATUS_SPLIT + MAIN_STATUS_DUST,
|
||||
MAIN_STATUS_SPLIT_STONE = MAIN_STATUS_SPLIT + MAIN_STATUS_STONE,
|
||||
MAIN_STATUS_SPLIT_FLED = MAIN_STATUS_SPLIT + MAIN_STATUS_FLED,
|
||||
MAIN_STATUS_SPLIT_SURFACE = MAIN_STATUS_SPLIT + MAIN_STATUS_SURFACE,
|
||||
MAIN_STATUS_SPLIT_WON = MAIN_STATUS_SPLIT + MAIN_STATUS_WON,
|
||||
};
|
||||
|
||||
/* adven[i].race */ //complete
|
||||
enum eRace {
|
||||
RACE_UNKNOWN = -1, // for parameters to some functions; not valid in the class
|
||||
|
@@ -37,6 +37,7 @@ struct pending_special_type {
|
||||
eSpecContext mode;
|
||||
unsigned char type; // 0 - scen, 1 - out, 2 - town
|
||||
location where;
|
||||
long long trigger_time;
|
||||
};
|
||||
|
||||
#endif
|
@@ -17,7 +17,7 @@
|
||||
#include "boe.consts.h" // TODO: Put these constants in a global file
|
||||
|
||||
cTerrain& cTerrain::operator = (legacy::terrain_type_type& old){
|
||||
static const short arenas[260] = {
|
||||
static const short arenas[274] = {
|
||||
1, 1, 0, 0, 0, 1, 1, 1, 1, 1, // 0 - grassy field
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 2, 2, // 1 - ordinary cave
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 2 - mountain
|
||||
@@ -26,7 +26,7 @@ cTerrain& cTerrain::operator = (legacy::terrain_type_type& old){
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* 50 */ // 5 - rubble-strewn cave
|
||||
0, 3, 3, 3, 3, 3, 3, 5, 5, 5, // 6 - cave tree forest
|
||||
6, 6, 7, 7, 1, 1, 8, 9, 10,11, // 7 - cave mushrooms
|
||||
10,11,12,13,13,9, 9, 9, 1, 1, // 8 - cave swamp
|
||||
11,11,12,13,13,9, 9, 9, 1, 1, // 8 - cave swamp
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 - surface rocks
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 100 */ // 10 - surface swamp
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 11 - surface woods
|
||||
@@ -38,12 +38,14 @@ cTerrain& cTerrain::operator = (legacy::terrain_type_type& old){
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 17 - surface road (proposed)
|
||||
1, 0, 1, 1, 1, 1, 1, 1, 1, 0, // 18 - hills road (proposed)
|
||||
0, 0, 0, 0, 1, 0, 0, 0, 0, 0, // 19 - crops (proposed)
|
||||
0, 0, 1, 0, 2, 0, 0, 1, 1, 1,/* 200 */ // (note: fumaroles would have lava.)
|
||||
1, 0, 2, 1, 1, 0, 1, 1, 1, 1, // the numbers in this array are indices into the other arrays
|
||||
1, 1, 0, 0, 0, 0, 1, 0, 1, 1, // (ter_base, ground_type, and terrain_odds first index)
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1 /* 250 */
|
||||
0, 0, 1, 0, 2, 0, 0, 1, 1, 1,/* 200 */ // 20 - cave camp (proposed)
|
||||
1, 0, 2, 1, 1, 1, 0, 1, 1, 1, // 21 - surface camp (proposed)
|
||||
1, 1, 0, 0, 0, 0, 1, 0, 1, 1, // (note: fumaroles would have lava.)
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // the numbers in this array are indices into the other arrays
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // (ter_base, ground_type, and terrain_odds first index)
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 250 */
|
||||
4, 4, 4, 4, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1
|
||||
};
|
||||
static const short ground[274] = {
|
||||
0, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3,
|
||||
@@ -95,17 +97,18 @@ cTerrain& cTerrain::operator = (legacy::terrain_type_type& old){
|
||||
};
|
||||
picture = old.picture;
|
||||
blockage = old.blockage;
|
||||
if(picture >= 260) combat_arena = 1;
|
||||
else combat_arena = arenas[picture];
|
||||
if(picture < 260){
|
||||
combat_arena = arenas[picture];
|
||||
ground_type = ground[picture];
|
||||
trim_type = (eTrimType) trims[picture];
|
||||
trim_ter = trim_ters[picture];
|
||||
}else if(picture >= 400 && picture < 1000){
|
||||
combat_arena = arenas[picture - 140];
|
||||
ground_type = ground[picture - 140];
|
||||
trim_type = (eTrimType) trims[picture - 140];
|
||||
trim_ter = trim_ters[picture - 140];
|
||||
}else{
|
||||
combat_arena = 1;
|
||||
ground_type = 255;
|
||||
trim_type = TRIM_NONE;
|
||||
trim_ter = 0;
|
||||
|
@@ -814,6 +814,8 @@ short cUniverse::difficulty_adjust() {
|
||||
short party_level = 0;
|
||||
short adj = 1;
|
||||
|
||||
if(!scenario.adjust_diff) return 1;
|
||||
|
||||
for (short i = 0; i < 6; i++)
|
||||
if (party[i].main_status == 1)
|
||||
party_level += party[i].level;
|
||||
|
Reference in New Issue
Block a user