From 48210becd9e2e3eb7c09f944217f33536347de73 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sun, 31 May 2009 22:13:43 +0000 Subject: [PATCH] - 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 --- osx/BoE.xcodeproj/project.pbxproj | 76 ++++++++++++++++++++++++++++++ osx/boe.actions.cpp | 1 + osx/boe.combat.cpp | 2 +- osx/boe.graphutil.cpp | 70 ++++++++++++++++++++------- osx/boe.graphutil.h | 1 + osx/boe.party.cpp | 6 +-- osx/boe.specials.cpp | 5 +- osx/classes.h | 15 ++++-- osx/classes/item.h | 2 + osx/classes/monster.h | 29 ++++++++++-- osx/classes/party.cpp | 11 ++++- osx/classes/party.h | 3 +- osx/classes/scenario.h | 1 + osx/classes/special.h | 2 + osx/classes/universe.h | 8 ++++ osx/tools/graphtool.h | 1 + osx/tools/soundtool.h | 1 + rsrc/sounds.exa/SND78.WAV | Bin 6047 -> 972 bytes rsrc/sounds.exa/SND79.WAV | Bin 972 -> 6047 bytes 19 files changed, 199 insertions(+), 35 deletions(-) diff --git a/osx/BoE.xcodeproj/project.pbxproj b/osx/BoE.xcodeproj/project.pbxproj index 9e70bfa0..d9d05995 100644 --- a/osx/BoE.xcodeproj/project.pbxproj +++ b/osx/BoE.xcodeproj/project.pbxproj @@ -44,6 +44,23 @@ 2BF04DE90BF7A6FE006C0831 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2BF04DE80BF7A6FE006C0831 /* Carbon.framework */; }; 9122832E0FCF6C7200B21642 /* busywork.exs in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9122832D0FCF6C7200B21642 /* busywork.exs */; }; 912283C90FD0E16C00B21642 /* undo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 912283C80FD0E16C00B21642 /* undo.cpp */; }; + 912286F80FD330E500B21642 /* dlogutil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 910BBADA0FB91D2A001E34EA /* dlogutil.cpp */; }; + 912286F90FD330EA00B21642 /* button.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 910BBA890FB8EC57001E34EA /* button.cpp */; }; + 912286FA0FD330EA00B21642 /* control.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 910BBA3C0FB8DA8E001E34EA /* control.cpp */; }; + 912286FB0FD330EB00B21642 /* dialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 910BBA180FB8BECA001E34EA /* dialog.cpp */; }; + 912286FC0FD330EB00B21642 /* dlogutil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 910BBADA0FB91D2A001E34EA /* dlogutil.cpp */; }; + 912286FD0FD330EC00B21642 /* field.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 910BBAB50FB91A26001E34EA /* field.cpp */; }; + 912286FE0FD330EC00B21642 /* message.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 910BBAB90FB91ADB001E34EA /* message.cpp */; }; + 912286FF0FD330ED00B21642 /* pict.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 910BBAA90FB8F733001E34EA /* pict.cpp */; }; + 912287000FD330F100B21642 /* button.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 910BBA890FB8EC57001E34EA /* button.cpp */; }; + 912287010FD330F100B21642 /* control.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 910BBA3C0FB8DA8E001E34EA /* control.cpp */; }; + 912287020FD330F200B21642 /* dialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 910BBA180FB8BECA001E34EA /* dialog.cpp */; }; + 912287030FD330F200B21642 /* dlogutil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 910BBADA0FB91D2A001E34EA /* dlogutil.cpp */; }; + 912287040FD330F300B21642 /* field.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 910BBAB50FB91A26001E34EA /* field.cpp */; }; + 912287050FD330F300B21642 /* message.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 910BBAB90FB91ADB001E34EA /* message.cpp */; }; + 912287060FD330F300B21642 /* pict.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 910BBAA90FB8F733001E34EA /* pict.cpp */; }; + 912287280FD3358A00B21642 /* libticpp.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 9141DAB50FCB94900047D3A3 /* libticpp.dylib */; }; + 912287290FD3359300B21642 /* libticpp.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 9141DAB50FCB94900047D3A3 /* libticpp.dylib */; }; 9127903E0F9B7F49007B0D52 /* boe.actions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BF04ACF0BF51923006C0831 /* boe.actions.cpp */; }; 9127903F0F9B7F50007B0D52 /* boe.graphics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BF04AD30BF51923006C0831 /* boe.graphics.cpp */; }; 912793640F9C107B007B0D52 /* viewdlog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91B3EEF80F969BA700BF5B67 /* viewdlog.cpp */; }; @@ -188,6 +205,20 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + 9122870E0FD3339F00B21642 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 2BF04AA10BF51845006C0831 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 9141DAB40FCB94900047D3A3 /* ticpp */; + remoteInfo = ticpp; + }; + 912287110FD333AE00B21642 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 2BF04AA10BF51845006C0831 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 9141DAB40FCB94900047D3A3 /* ticpp */; + remoteInfo = ticpp; + }; 9141DABB0FCB95030047D3A3 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 2BF04AA10BF51845006C0831 /* Project object */; @@ -452,6 +483,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 912287290FD3359300B21642 /* libticpp.dylib in Frameworks */, 2BF04DE90BF7A6FE006C0831 /* Carbon.framework in Frameworks */, 913D02690FA0EB0300184C18 /* QuickTime.framework in Frameworks */, ); @@ -477,6 +509,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 912287280FD3358A00B21642 /* libticpp.dylib in Frameworks */, 91B3EF1E0F969C4B00BF5B67 /* Carbon.framework in Frameworks */, 913D026B0FA0EB0500184C18 /* QuickTime.framework in Frameworks */, ); @@ -929,6 +962,7 @@ buildRules = ( ); dependencies = ( + 912287120FD333AE00B21642 /* PBXTargetDependency */, ); name = "Blades of Exile"; productName = "Blades of Exile"; @@ -981,6 +1015,7 @@ buildRules = ( ); dependencies = ( + 9122870F0FD3339F00B21642 /* PBXTargetDependency */, ); name = "Blades of Exile Character Editor"; productName = "Blades of Exile Character Editor"; @@ -1126,6 +1161,13 @@ 91AC60A80FA26C1B00EEAE67 /* tmpltown.cpp in Sources */, 91AC61C60FA2729900EEAE67 /* universe.cpp in Sources */, 91AC620B0FA2853700EEAE67 /* creatlist.cpp in Sources */, + 912287000FD330F100B21642 /* button.cpp in Sources */, + 912287010FD330F100B21642 /* control.cpp in Sources */, + 912287020FD330F200B21642 /* dialog.cpp in Sources */, + 912287030FD330F200B21642 /* dlogutil.cpp in Sources */, + 912287040FD330F300B21642 /* field.cpp in Sources */, + 912287050FD330F300B21642 /* message.cpp in Sources */, + 912287060FD330F300B21642 /* pict.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1189,6 +1231,13 @@ 91AC60AA0FA26C1B00EEAE67 /* tmpltown.cpp in Sources */, 91AC620D0FA2853700EEAE67 /* creatlist.cpp in Sources */, 91AC65AD0FA34AC600EEAE67 /* universe.cpp in Sources */, + 912286F90FD330EA00B21642 /* button.cpp in Sources */, + 912286FA0FD330EA00B21642 /* control.cpp in Sources */, + 912286FB0FD330EB00B21642 /* dialog.cpp in Sources */, + 912286FC0FD330EB00B21642 /* dlogutil.cpp in Sources */, + 912286FD0FD330EC00B21642 /* field.cpp in Sources */, + 912286FE0FD330EC00B21642 /* message.cpp in Sources */, + 912286FF0FD330ED00B21642 /* pict.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1237,12 +1286,23 @@ 91C1FCAA0FCB6F7200EBAA65 /* message.cpp in Sources */, 91C1FCAB0FCB6F7300EBAA65 /* pict.cpp in Sources */, 912283C90FD0E16C00B21642 /* undo.cpp in Sources */, + 912286F80FD330E500B21642 /* dlogutil.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + 9122870F0FD3339F00B21642 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 9141DAB40FCB94900047D3A3 /* ticpp */; + targetProxy = 9122870E0FD3339F00B21642 /* PBXContainerItemProxy */; + }; + 912287120FD333AE00B21642 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 9141DAB40FCB94900047D3A3 /* ticpp */; + targetProxy = 912287110FD333AE00B21642 /* PBXContainerItemProxy */; + }; 9141DABC0FCB95030047D3A3 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 9141DAB40FCB94900047D3A3 /* ticpp */; @@ -1366,6 +1426,10 @@ GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/Carbon.framework/Headers/Carbon.h"; INFOPLIST_FILE = "Blades of Exile-Info.plist"; INSTALL_PATH = "$(HOME)/Applications"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", + ); OTHER_LDFLAGS = ( "-framework", Carbon, @@ -1395,6 +1459,10 @@ GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/Carbon.framework/Headers/Carbon.h"; INFOPLIST_FILE = "Blades of Exile-Info.plist"; INSTALL_PATH = "$(HOME)/Applications"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", + ); OTHER_LDFLAGS = ( "-framework", Carbon, @@ -1515,6 +1583,10 @@ GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/Carbon.framework/Headers/Carbon.h"; INFOPLIST_FILE = "Blades of Exile Char Editor/Blades of Exile Character Editor-Info.plist"; INSTALL_PATH = "$(HOME)/Applications"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", + ); OTHER_LDFLAGS = ( "-framework", Carbon, @@ -1546,6 +1618,10 @@ GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/Carbon.framework/Headers/Carbon.h"; INFOPLIST_FILE = "Blades of Exile Char Editor/Blades of Exile Character Editor-Info.plist"; INSTALL_PATH = "$(HOME)/Applications"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", + ); OTHER_LDFLAGS = ( "-framework", Carbon, diff --git a/osx/boe.actions.cpp b/osx/boe.actions.cpp index 63cbe622..4f8c7475 100644 --- a/osx/boe.actions.cpp +++ b/osx/boe.actions.cpp @@ -1312,6 +1312,7 @@ bool handle_action(EventRecord event) // Handle non-PC stuff (like monsters) if the party actually did something if (did_something == true) { draw_map(modeless_dialogs[5],5); + play_ambient_sound(); if ((overall_mode >= MODE_COMBAT) && (overall_mode < MODE_TALKING)) { if (no_pcs_left() == true) { diff --git a/osx/boe.combat.cpp b/osx/boe.combat.cpp index d124e6c2..e1effeb0 100644 --- a/osx/boe.combat.cpp +++ b/osx/boe.combat.cpp @@ -1188,7 +1188,7 @@ void do_combat_cast(location target)//// case 7: // monster info store_m_type = -1; play_sound(52); - univ.party.m_seen[cur_monst->number] = true; + univ.party.m_noted[cur_monst->number] = true; adjust_monst_menu(); display_monst(0,cur_monst,0); break; diff --git a/osx/boe.graphutil.cpp b/osx/boe.graphutil.cpp index 78d8e249..d71f69e2 100644 --- a/osx/boe.graphutil.cpp +++ b/osx/boe.graphutil.cpp @@ -13,8 +13,9 @@ #include "boe.graphics.h" #include "boe.infodlg.h" #include "boe.monster.h" +#include "boe.specials.h" #include "dlgtool.h" -//#include "soundtool.h" +#include "soundtool.h" #include "graphtool.h" #include "mathutil.h" #include "dlgutil.h" @@ -77,7 +78,7 @@ extern GWorldPtr spec_scen_g; Rect boat_rects[4] = {{0,0,36,28}, {0,28,36,56},{0,56,36,84},{0,84,36,112}}; bool gave_no_g_error = false; - +eAmbientSound ambient_sound; //unsigned char m_pic_index[200] = {//// //1,2,3,4,5,6,7,8,9,10, //11,12,13,14,15,16,17,18,19,20, @@ -368,8 +369,21 @@ void draw_monsters() //// } } -void play_see_monster_str(unsigned short m) // TODO: Seems like this would be worth reviving -{} +void play_see_monster_str(unsigned short m){ + short str1, str2, pic, type, snd, spec, s1 = 0, s2 = 0, s3 = 0; + str1 = scenario.scen_monsters[m].see_str1; + str2 = scenario.scen_monsters[m].see_str2; + pic = scenario.scen_monsters[m].picture_num; + type = get_monst_pictype(m); + snd = scenario.scen_monsters[m].see_sound; + spec = scenario.scen_monsters[m].see_spec; + // First display strings, if any + display_strings(str1 ? scenario.monst_strs[str1] : NULL, str2 ? scenario.monst_strs[str2] : NULL, "", snd, pic,type, 0); + // Then run the special, if any + if(spec > -1) + run_special(18, 0, spec, loc(0,0), &s1, &s2, &s3); + // TODO: may need to check s3 to determine if redraw is needed +} void draw_pcs(location center,short mode) //short mode; // 0 - put pcs in gworld 1 - only rectangle around active pc @@ -1014,19 +1028,39 @@ char get_fluid_trim(location where,ter_num_t ter_type) return to_return; } -// Sees if party has seen a monster of this sort, updates menu and gives -// special messages as necessary -void check_if_monst_seen(unsigned short m_num) -{ - // this rule has been changed - return; // TODO: Bring this back? - if (univ.party.m_seen[m_num] == 0) { - univ.party.m_seen[m_num] = 1; - switch (m_num) { - - } - adjust_monst_menu(); - } +// Sees if party has seen a monster of this sort, gives special messages as necessary +void check_if_monst_seen(unsigned short m_num) { + // Give special messages if necessary + if (!univ.party.m_seen[m_num]) { + univ.party.m_seen[m_num] = true; + play_see_monster_str(m_num); + } + // Make the monster vocalize if applicable + snd_num_t sound = scenario.scen_monsters[m_num].ambient_sound; + if(get_ran(1,1,100) < 10) play_sound(-sound); +} + +void play_ambient_sound(){ // TODO: Maybe add a system for in-town ambient sounds + static const short drip[2] = {78,79}, bird[3] = {76,77,91}; + if(overall_mode != MODE_OUTDOORS) return; // ambient sounds are outdoors only at the moment + if(get_ran(1,1,100) > 10) return; // 10% chance per move of playing a sound + short sound_to_play; + switch(ambient_sound){ + case AMBIENT_DRIP: + sound_to_play = get_ran(1,0,1); + play_sound(-drip[sound_to_play]); + break; + case AMBIENT_BIRD: + sound_to_play = get_ran(1,0,2); + play_sound(-bird[sound_to_play]); + break; + case AMBIENT_CUSTOM: + sound_to_play = univ.out_sound; + play_sound(-sound_to_play); + break; + case AMBIENT_NONE: + break; // obviously, do nothing + } } void adjust_monst_menu() @@ -1042,7 +1076,7 @@ void adjust_monst_menu() on_monst_menu[i] = -1; } for (i = 1; i < 256; i++) - if ((i == 1) || (univ.party.m_seen[i] > 0)) { + if ((i == 1) || (univ.party.m_noted[i] > 0)) { on_monst_menu[monst_pos] = i; monst_pos++; } diff --git a/osx/boe.graphutil.h b/osx/boe.graphutil.h index 7ea802f4..0f4c8d2e 100644 --- a/osx/boe.graphutil.h +++ b/osx/boe.graphutil.h @@ -25,3 +25,4 @@ bool is_ground(ter_num_t ter_type); char get_fluid_trim(location where,ter_num_t ter_type); void check_if_monst_seen(unsigned short m_num); void adjust_monst_menu(); +void play_ambient_sound(); diff --git a/osx/boe.party.cpp b/osx/boe.party.cpp index c8b3860a..000a26e6 100644 --- a/osx/boe.party.cpp +++ b/osx/boe.party.cpp @@ -232,7 +232,7 @@ void init_party(short mode) for (i = 0; i < 4; i++) univ.party.imprisoned_monst[i] = 0; for (i = 0; i < 256; i++) - univ.party.m_seen[i] = 0; + univ.party.m_seen[i] = univ.party.m_noted[i] = 0; // for (i = 0; i < 50; i++) // univ.party.journal_str[i] = -1; // for (i = 0; i < 140; i++) @@ -376,7 +376,7 @@ void init_party_scen_data() for (i = 0; i < 4; i++) univ.party.imprisoned_monst[i] = 0; for (i = 0; i < 256; i++) - univ.party.m_seen[i] = 0; + univ.party.m_seen[i] = univ.party.m_noted[i] = 0; // for (i = 0; i < 50; i++) // univ.party.journal_str[i] = -1; // for (i = 0; i < 140; i++) @@ -2019,7 +2019,7 @@ void cast_town_spell(location where) //// targ = monst_there(where); if (targ < univ.town->max_monst()) { if (town_spell == 7) { - univ.party.m_seen[univ.town.monst[targ].number] = true; + univ.party.m_noted[univ.town.monst[targ].number] = true; adjust_monst_menu(); display_monst(0,&univ.town.monst[targ],0); } diff --git a/osx/boe.specials.cpp b/osx/boe.specials.cpp index 2e283cef..55881519 100644 --- a/osx/boe.specials.cpp +++ b/osx/boe.specials.cpp @@ -1671,7 +1671,7 @@ void special_increase_age() // 0 - out moving (a - 1 if blocked) // 1 - town moving (a - 1 if blocked) // 2 - combat moving (a - 1 if blocked) -// 3 - out looking (a - 1 if don't get items inside) NOT USED!!! +// 3 - out looking (a - 1 if don't get items inside) TODO: NOT USED!!! // 4 - town looking (a - 1 if don't get items inside) // 5 - entering town // 6 - leaving town @@ -1684,8 +1684,9 @@ void special_increase_age() // 13 - encountering outdoor enc (a - 1 if no fight) // 14 - winning outdoor enc // 15 - fleeing outdoor enc -// 16 - ritual of sanct +// 16 - ritual of sanct TODO: This will become "target space", hopefully // 17 - using space +// 18 - seeing monster TODO: This is currently unused // which_type - 0 - scen 1 - out 2 - town // start spec - the number of the first spec to call // a,b - 2 values that can be returned diff --git a/osx/classes.h b/osx/classes.h index 834b86cd..9c283564 100644 --- a/osx/classes.h +++ b/osx/classes.h @@ -8,13 +8,22 @@ * */ +typedef unsigned short str_num_t; + +//class sbyte { +// signed char c; +//public: +// operator int() {return c;} +// sbyte(signed char k) : c(k) {} +//} + #include "location.h" #include "terrain.h" #include "vehicle.h" -#include "monster.h" -#include "special.h" -#include "talking.h" #include "item.h" +#include "special.h" +#include "monster.h" +#include "talking.h" #include "town.h" #include "regtown.h" #include "tmpltown.h" diff --git a/osx/classes/item.h b/osx/classes/item.h index 10afa2eb..9f9f149e 100644 --- a/osx/classes/item.h +++ b/osx/classes/item.h @@ -187,6 +187,8 @@ enum eItemAbil { ITEM_MISSILE_HEAL_TARGET = 176, }; +typedef signed short item_num_t; + class cItemRec { public: eItemType variety; diff --git a/osx/classes/monster.h b/osx/classes/monster.h index 06fca71d..55d92b3d 100644 --- a/osx/classes/monster.h +++ b/osx/classes/monster.h @@ -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); diff --git a/osx/classes/party.cpp b/osx/classes/party.cpp index cc751a52..47ad0e27 100644 --- a/osx/classes/party.cpp +++ b/osx/classes/party.cpp @@ -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; diff --git a/osx/classes/party.h b/osx/classes/party.h index 5aead0a4..e2949c53 100644 --- a/osx/classes/party.h +++ b/osx/classes/party.h @@ -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 journal; std::vector special_notes; std::vector talk_save; diff --git a/osx/classes/scenario.h b/osx/classes/scenario.h index e752fe30..3523f9b7 100644 --- a/osx/classes/scenario.h +++ b/osx/classes/scenario.h @@ -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; diff --git a/osx/classes/special.h b/osx/classes/special.h index cf8e4043..58dd83c2 100644 --- a/osx/classes/special.h +++ b/osx/classes/special.h @@ -13,6 +13,8 @@ namespace legacy { struct special_node_type; }; +typedef signed short spec_num_t; + class cSpecial { public: short type; diff --git a/osx/classes/universe.h b/osx/classes/universe.h index 9c3a1445..0b491861 100644 --- a/osx/classes/universe.h +++ b/osx/classes/universe.h @@ -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); diff --git a/osx/tools/graphtool.h b/osx/tools/graphtool.h index aa9e0712..7d45b047 100644 --- a/osx/tools/graphtool.h +++ b/osx/tools/graphtool.h @@ -11,6 +11,7 @@ struct m_pic_index_t { unsigned char i, x, y; }; +typedef unsigned short pic_num_t; void init_graph_tool(void (*redraw_callback)(),Point* p); GWorldPtr load_pict(int picture_to_get); GWorldPtr load_bmp(unsigned char *data, unsigned long length); diff --git a/osx/tools/soundtool.h b/osx/tools/soundtool.h index 28206307..46954868 100644 --- a/osx/tools/soundtool.h +++ b/osx/tools/soundtool.h @@ -8,6 +8,7 @@ #define NUM_SOUNDS 99 +typedef unsigned short snd_num_t; void init_snd_tool(); void play_sound(short which, short how_many_times = 1); void one_sound(short which); diff --git a/rsrc/sounds.exa/SND78.WAV b/rsrc/sounds.exa/SND78.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