- added a system to display one or two strings and/or call a special the first time the party sees a particular type of monster

- added ambient sound, both outdoor ambient sound and monster vocalizing ambient sound (eg cat meowing when in sight)
- fixed an inconsistency whereby two sounds were swapped relative to their original Mac versions
- added (but haven't yet used much) a few more typedefs for clarity

git-svn-id: http://openexile.googlecode.com/svn/trunk@86 4ebdad44-0ea0-11de-aab3-ff745001d230
This commit is contained in:
2009-05-31 22:13:43 +00:00
parent 851859d61e
commit 48210becd9
19 changed files with 199 additions and 35 deletions

View File

@@ -187,6 +187,8 @@ enum eItemAbil {
ITEM_MISSILE_HEAL_TARGET = 176,
};
typedef signed short item_num_t;
class cItemRec {
public:
eItemType variety;

View File

@@ -164,19 +164,38 @@ public:
m_num_t m_num; // TODO: This probably shouldn't be necessary. Consider why it is, and determine if it can be removed
unsigned char level;
std::string m_name;
short health,m_health,mp,max_mp; // TODO: Move health and mp to cCreature
unsigned char armor,skill;
short health; // TODO: Move health, mp and max_mp to cCreature
short m_health;
short mp;
short max_mp;
unsigned char armor;
unsigned char skill;
cAttack a[3];
unsigned char a1_type,a23_type; // TODO: Delete in favour of type field of cAttack
eMonsterType m_type;
unsigned char speed,ap,mu,cl,breath,breath_type,treasure,spec_skill,poison; // TODO: Move ap to cCreature
unsigned char speed;
unsigned char ap; // TODO: Move ap to cCreature
unsigned char mu;
unsigned char cl;
unsigned char breath;
unsigned char breath_type;
unsigned char treasure;
unsigned char spec_skill;
unsigned char poison;
short morale,m_morale; // TODO: Move to cCreature (since these are calculated in-game based on the level)
short corpse_item,corpse_item_chance;
item_num_t corpse_item;
short corpse_item_chance;
short status[15]; // TODO: Move to cCreature
unsigned char direction,immunities,x_width,y_width,radiate_1; // TODO: Move direction to cCreature
unsigned char direction; // TODO: Move direction to cCreature
unsigned char immunities;
unsigned char x_width,y_width;
unsigned char radiate_1;
unsigned short radiate_2; // I THINK this is the extra field for the second ability
unsigned char default_attitude,summon_type,default_facial_pic,res1,res2,res3;
short picture_num;
str_num_t see_str1, see_str2;
snd_num_t see_sound, ambient_sound; // ambient_sound has a
spec_num_t see_spec;
cMonster& operator = (legacy::monster_record_type& old);
void writeTo(std::ostream& file, std::string prefix);

View File

@@ -60,7 +60,7 @@ cParty& cParty::operator = (legacy::party_record_type& old){
magic_store_items[j][i] = old.magic_store_items[j][i];
}
for(i = 0; i < 256; i++)
m_seen[i] = old.m_seen[i];
m_noted[i] = old.m_seen[i];
journal.reserve(50);
for(i = 0; i < 50; i++){
cJournal j;
@@ -241,8 +241,11 @@ void cParty::writeTo(std::ostream& file){
magic_store_items[i][j].writeTo(file, sout.str());
}
for(int i = 0; i < 256; i++)
if(m_seen[i])
if(m_noted[i])
file << "ROSTER " << i << std::endl;
for(int i = 0; i < 256; i++)
if(m_seen[i])
file << "SEEN " << i << std::endl;
for(int i = 0; i < 10; i++)
if(out_c[i].exists){
file << "ENCOUNTER " << i << " DIRECTION " << out_c[i].direction << std::endl;
@@ -364,6 +367,10 @@ void cParty::readFrom(std::istream& file){
sin >> i >> j >> cur;
magic_store_items[i][j].readAttrFrom(cur,sin);
}else if(cur == "ROSTER"){
int i;
sin >> i;
m_noted[i] = true;
}else if(cur == "SEEN"){
int i;
sin >> i;
m_seen[i] = true;

View File

@@ -70,7 +70,8 @@ public:
cOutdoors::cCreature out_c[10];
cItemRec magic_store_items[5][10];
short imprisoned_monst[4]; // Soul Crystal?
char m_seen[256];
char m_noted[256]; // has the monster been scried?
char m_seen[256]; // has the monster ever been seen? (this used to have the above meaning)
std::vector<cJournal> journal;
std::vector<cEncNote> special_notes;
std::vector<cConvers> talk_save;

View File

@@ -87,6 +87,7 @@ public:
char spec_item_names[50][256];
char spec_item_strs[50][256];
char spec_strs[100][256];
char monst_strs[100][256];
FSSpec scen_file; // transient
cOutdoors* outdoors;
cTown* towns;

View File

@@ -13,6 +13,8 @@
namespace legacy { struct special_node_type; };
typedef signed short spec_num_t;
class cSpecial {
public:
short type;

View File

@@ -128,6 +128,13 @@ public:
void readFrom(std::istream& file);
};
enum eAmbientSound {
AMBIENT_NONE,
AMBIENT_DRIP,
AMBIENT_BIRD,
AMBIENT_CUSTOM,
};
class cUniverse{
public:
cParty party;
@@ -135,6 +142,7 @@ public:
char town_maps[200][8][64]; // formerly stored_town_maps_type
cCurOut out;
char out_maps[100][6][48]; // formerly stored_outdoor_maps_type
snd_num_t out_sound;
FSSpec file;
void append(legacy::stored_town_maps_type& old);