diff options
Diffstat (limited to 'devtools')
-rw-r--r-- | devtools/create_titanic/create_titanic_dat.cpp | 213 |
1 files changed, 213 insertions, 0 deletions
diff --git a/devtools/create_titanic/create_titanic_dat.cpp b/devtools/create_titanic/create_titanic_dat.cpp index 9186c1ce20..61e5de1149 100644 --- a/devtools/create_titanic/create_titanic_dat.cpp +++ b/devtools/create_titanic/create_titanic_dat.cpp @@ -285,6 +285,136 @@ static const FrameRange BARBOT_FRAME_RANGES[60] = { { 202, 281 }, { 182, 202 }, { 165, 182 }, { 96, 165 }, { 0, 95 } }; +static const char *const MISSIVEOMAT_MESSAGES[3] = { + "Welcome, Leovinus.\n" + "\n" + "This is your Missive-O-Mat.\n" + "\n" + "You have received 1827 Electric Missives.\n" + "\n" + "For your convenience I have deleted:\n" + " 453 things that people you don't know thought it would be " + "terribly witty to forward to you,\n" + " 63 Missives containing double or triple exclamation marks,\n" + " 846 Missives from mailing-lists you once thought might be quite " + "interesting and now can't figure out how to cancel,\n" + " 962 Chain Missives,\n" + " 1034 instructions on how to become a millionaire using butter,\n" + " 3 Yassaccan Death Threats (slightly down on last week which is" + " pleasing news),\n" + " and a Missive from your Mother which I have answered reassuringly.\n" + "\n" + "I have selected the following Missives for your particular attention. " + "You will not need to run Fib-Finder to see why. Something Is Up and I " + "suspect those two slippery urchins Brobostigon and Scraliontis are behind it.", + + "Hello Droot. I have evaluated your recent missives.\n" + "Contents break down as follows:\n" + "\n" + "Good news 49%\n" + "Bad news 48%\n" + "Indifferent news 4%\n" + "Petty mailings and Family Missives 5%\n" + "Special Offers from the Blerontin Sand Society 1% (note - there's" + " a rather pretty dune for hire on p4)\n" + "\n" + "In general terms you Thrive. You continue to Prosper. Your shares are" + " Secure. Your hair, as always, looks Good. Carpet 14 needs cleaning. \n" + "\n" + "I am pleased to report there have been no further comments about " + "foot odor.\n" + "\n" + "Recommend urgently you sell all fish paste shares as Market jittery.\n" + "\n" + "As your Great Scheme nears completion I have taken the liberty of" + " replying to all non-urgent Missives and list below only communic" + "ations with Manager Brobostigon and His Pain in the Ass Loftiness" + " Leovinus. \n" + "\n" + "Beware - Leovinus grows suspicious. Don't take your eye off B" + "robostigon. \n" + "\n" + "Weather for the Launch tomorrow is bright and sunny. Hazy clouds" + " will be turned on at eleven. I suggest the red suit with the st" + "reamers.\n" + "\n" + "All money transfers will be completed through alias accounts by m" + "oonsup.\n" + "\n" + "Eat well. Your fish levels are down and you may suffer indecisio" + "n flutters mid-morning.\n" + "\n" + "Here are your Missives...", + + "Hello Antar, this is your Missive-o-Mat.\n" + "Not that you need reminding but today is the Glorious Dawning of " + "a New Age in Luxury Space Travel.\n" + "\n" + "Generally my assessment of your position this morning is that you" + " are well, albeit not as rich as you would like to be. I hope yo" + "ur interesting collaboration with Mr Scraliontis will soon bear f" + "ruit. \n" + "\n" + "I trust your flatulence has eased during the night. Such a distr" + "essing condition for a man in your position.\n" + "\n" + "Most of your Missives are routine construction matters which I ha" + "ve dealt with and deleted. All Missives from Mr Scraliontis and " + "His Loftiness Leovinus are here." +}; + +struct BedheadEntry { + const char *_name1; + const char *_name2; + const char *_name3; + const char *_name4; + int _startFrame; + int _endFrame; +}; + +static const BedheadEntry ON_CLOSED[4] = { + { "Closed", "Closed", "Open", "Open", 0, 12 }, + { "Open", "Any", "Any", "RestingUTV", 0, 4 }, + { "Closed", "Open", "Any", "RestingV", 0, 6 }, + { "Closed", "Closed", "Closed", "RestingG", 0, 21 } +}; +static const BedheadEntry ON_RESTING_TV[2] = { + { "Any", "Closed", "Open", "Open", 6, 12 }, + { "Any", "Closed", "Closed", "RestingG", 6, 21 } +}; +static const BedheadEntry ON_RESTING_UV[2] = { + { "Any", "Any", "Open", "Open", 8, 12 }, + { "Any", "Any", "Closed", "RestingG", 8, 21 } +}; +static const BedheadEntry ON_CLOSED_WRONG[2] = { + { "Any", "Any", "Closed", "OpenWrong", 42, 56 }, + { "Any", "Any", "Open", "RestingDWrong", 42, 52 } +}; + +static const BedheadEntry OFF_OPEN[3] = { + { "Closed", "Closed", "Open", "Closed", 27, 41 }, + { "Any", "Open", "Any", "RestingUV", 27, 29 }, + { "Open", "Closed", "Any", "RestingTV", 27, 33 } +}; +static const BedheadEntry OFF_RESTING_UTV[1] = { + { "Any", "Any", "Any", "Closed", 36, 41 } +}; +static const BedheadEntry OFF_RESTING_V[1] = { + { "Closed", "Any", "Any", "Closed", 32, 41 } +}; +static const BedheadEntry OFF_RESTING_G[3] = { + { "Closed", "Closed", "Closed", "Closed", 21, 41 }, + { "Any", "Open", "Closed", "RestingUV", 21, 29 }, + { "Open", "Closed", "Closed", "RestingTV", 21, 33 } +}; +static const BedheadEntry OFF_OPEN_WRONG[1] = { + { "Any", "Any", "Any", "ClosedWrong", 56, 70 } +}; +static const BedheadEntry OFF_RESTING_D_WRONG[1] = { + { "Any", "Any", "Any", "ClosedWrong", 59, 70 } +}; + + void NORETURN_PRE error(const char *s, ...) { printf("%s\n", s); exit(1); @@ -619,6 +749,86 @@ void writeBarbotFrameRanges() { dataOffset += size; } +void writeMissiveOMatMessages() { + outputFile.seek(dataOffset); + + for (int idx = 0; idx < 3; ++idx) + outputFile.writeString(MISSIVEOMAT_MESSAGES[idx]); + + uint size = outputFile.size() - dataOffset; + writeEntryHeader("TEXT/MISSIVEOMAT/WELCOME", dataOffset, size); + dataOffset += size; + + static const int MESSAGES[3] = { 0x5A63C0, 0x5A5BA8, 0x5A4A18 }; + writeStringArray("TEXT/MISSIVEOMAT/MESSAGES", MESSAGES[_version], 58); + static const int FROM[3] = { 0x5A61F0, 0x5A59D8, 0x5A4BE8 }; + writeStringArray("TEXT/MISSIVEOMAT/FROM", FROM[_version], 58); + static const int TO[3] = { 0x5A62D8, 0x5A5AC0, 0x5A4B00 }; + writeStringArray("TEXT/MISSIVEOMAT/TO", TO[_version], 58); +} + +void writeBedheadGroup(const BedheadEntry *data, int count) { + for (int idx = 0; idx < count; ++idx, ++data) { + outputFile.writeString(data->_name1); + outputFile.writeString(data->_name2); + outputFile.writeString(data->_name3); + outputFile.writeString(data->_name4); + outputFile.writeLong(data->_startFrame); + outputFile.writeLong(data->_endFrame); + } +} + +void writeBedheadData() { + outputFile.seek(dataOffset); + + writeBedheadGroup(ON_CLOSED, 4); + writeBedheadGroup(ON_RESTING_TV, 2); + writeBedheadGroup(ON_RESTING_UV, 2); + writeBedheadGroup(ON_CLOSED_WRONG, 2); + writeBedheadGroup(OFF_OPEN, 3); + writeBedheadGroup(OFF_RESTING_UTV, 1); + writeBedheadGroup(OFF_RESTING_V, 1); + writeBedheadGroup(OFF_RESTING_G, 3); + writeBedheadGroup(OFF_OPEN_WRONG, 1); + writeBedheadGroup(OFF_RESTING_D_WRONG, 1); + + uint size = outputFile.size() - dataOffset; + writeEntryHeader("DATA/BEDHEAD", dataOffset, size); + dataOffset += size; +} + +void writeParrotLobbyLinkUpdaterEntries() { + static const int OFFSETS[3] = { 0x5A5B38, 0x5A5320, 0x5A4360 }; + static const int COUNTS[5] = { 7, 5, 6, 9, 1 }; + static const int SKIP[5] = { 36, 36, 40, 36, 0 }; + uint recordOffset = OFFSETS[_version], linkOffset; + byte vals[8]; + + outputFile.seek(dataOffset); + + for (int groupNum = 0; groupNum < 4; ++groupNum) { + for (int entryNum = 0; entryNum < COUNTS[groupNum]; + ++entryNum, recordOffset += 36) { + inputFile.seek(recordOffset - FILE_DIFF[_version]); + linkOffset = inputFile.readUint32LE(); + for (int idx = 0; idx < 8; ++idx) + vals[idx] = inputFile.readUint32LE(); + + // Write out the entry + inputFile.seek(linkOffset - FILE_DIFF[_version]); + outputFile.writeString(inputFile); + outputFile.write(vals, 8); + } + + // Skip space between groups + recordOffset += SKIP[groupNum]; + } + + uint size = outputFile.size() - dataOffset; + writeEntryHeader("DATA/PARROT_LOBBY_LINK_UPDATOR", dataOffset, size); + dataOffset += size; +} + void writeHeader() { // Write out magic string const char *MAGIC_STR = "SVTN"; @@ -789,6 +999,9 @@ void writeData() { writeAllUpdateStates(); writeAllScriptPreResponses(); writeBarbotFrameRanges(); + writeMissiveOMatMessages(); + writeBedheadData(); + writeParrotLobbyLinkUpdaterEntries(); } void createScriptMap() { |