Added spoken Slylandro probe coordinates; bug #732
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3610 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
Changes towards version 0.7:
|
Changes towards version 0.7:
|
||||||
|
- Added spoken Slylandro probe coordinates (bug #732) - Nic, Alex
|
||||||
- Added the missing bits to the no-voice versions of Mycon, Syreen and
|
- Added the missing bits to the no-voice versions of Mycon, Syreen and
|
||||||
Utwig dialogue (bug #327) - Alex
|
Utwig dialogue (bug #327) - Alex
|
||||||
- Syreen dialog tree no longer resets after visiting the Syreen Vault
|
- Syreen dialog tree no longer resets after visiting the Syreen Vault
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -51,3 +51,36 @@
|
|||||||
#(HOSTILE) 3785
|
#(HOSTILE) 3785
|
||||||
#(DESTRUCT_SEQUENCE)
|
#(DESTRUCT_SEQUENCE)
|
||||||
#(destruct_code)
|
#(destruct_code)
|
||||||
|
#(COORD_PLUS)
|
||||||
|
#(COORD_MINUS)
|
||||||
|
#(COORD_POINT)
|
||||||
|
#(ENUMERATE_HUNDRED)
|
||||||
|
#(ENUMERATE_THOUSAND)
|
||||||
|
#(ENUMERATE_ZERO)
|
||||||
|
#(ENUMERATE_ONE)
|
||||||
|
#(ENUMERATE_TWO)
|
||||||
|
#(ENUMERATE_THREE)
|
||||||
|
#(ENUMERATE_FOUR)
|
||||||
|
#(ENUMERATE_FIVE)
|
||||||
|
#(ENUMERATE_SIX)
|
||||||
|
#(ENUMERATE_SEVEN)
|
||||||
|
#(ENUMERATE_EIGHT)
|
||||||
|
#(ENUMERATE_NINE)
|
||||||
|
#(ENUMERATE_TEN)
|
||||||
|
#(ENUMERATE_ELEVEN)
|
||||||
|
#(ENUMERATE_TWELVE)
|
||||||
|
#(ENUMERATE_THIRTEEN)
|
||||||
|
#(ENUMERATE_FOURTEEN)
|
||||||
|
#(ENUMERATE_FIFTEEN)
|
||||||
|
#(ENUMERATE_SIXTEEN)
|
||||||
|
#(ENUMERATE_SEVENTEEN)
|
||||||
|
#(ENUMERATE_EIGHTEEN)
|
||||||
|
#(ENUMERATE_NINETEEN)
|
||||||
|
#(ENUMERATE_TWENTY)
|
||||||
|
#(ENUMERATE_THIRTY)
|
||||||
|
#(ENUMERATE_FOURTY)
|
||||||
|
#(ENUMERATE_FIFTY)
|
||||||
|
#(ENUMERATE_SIXTY)
|
||||||
|
#(ENUMERATE_SEVENTY)
|
||||||
|
#(ENUMERATE_EIGHTY)
|
||||||
|
#(ENUMERATE_NINETY)
|
||||||
|
|||||||
@@ -94,12 +94,12 @@ THIS IS PROBE 2418-B. WE SEEK TO MAKE FRIENDLY CONTACT WITH ALIEN LIFE FORMS.
|
|||||||
THIS IS PROBE 2418-B. WE REPLICATE SO THAT WE MAY EXPAND THE SCOPE OF MISSION.
|
THIS IS PROBE 2418-B. WE REPLICATE SO THAT WE MAY EXPAND THE SCOPE OF MISSION.
|
||||||
|
|
||||||
#(THIS_IS_PROBE_40) probe-019.ogg
|
#(THIS_IS_PROBE_40) probe-019.ogg
|
||||||
THIS IS PROBE 2418-B.
|
THIS IS PROBE 2418-B. COORDINATES ARE:
|
||||||
|
|
||||||
#(THIS_IS_PROBE_41) probe-030.ogg
|
#(THIS_IS_PROBE_41) probe-030.ogg
|
||||||
COORDINATES ARE:
|
,
|
||||||
|
|
||||||
#(THIS_IS_PROBE_42)
|
#(THIS_IS_PROBE_42) probe-031.ogg
|
||||||
.
|
.
|
||||||
|
|
||||||
#(why_attack_1)
|
#(why_attack_1)
|
||||||
@@ -177,3 +177,102 @@ ENGAGING SELF-DESTRUCTION CIRCUITRY.
|
|||||||
|
|
||||||
#(destruct_code)
|
#(destruct_code)
|
||||||
Transmit destruct sequence!
|
Transmit destruct sequence!
|
||||||
|
|
||||||
|
#(COORD_PLUS) probe-032.ogg
|
||||||
|
+
|
||||||
|
|
||||||
|
#(COORD_MINUS) probe-033.ogg
|
||||||
|
-
|
||||||
|
|
||||||
|
#(COORD_POINT) probe-034.ogg
|
||||||
|
.
|
||||||
|
|
||||||
|
#(ENUMERATE_HUNDRED) probe-035.ogg
|
||||||
|
hundred
|
||||||
|
|
||||||
|
#(ENUMERATE_THOUSAND) probe-036.ogg
|
||||||
|
thousand
|
||||||
|
|
||||||
|
#(ENUMERATE_ZERO) probe-037.ogg
|
||||||
|
zero
|
||||||
|
|
||||||
|
#(ENUMERATE_ONE) probe-038.ogg
|
||||||
|
one
|
||||||
|
|
||||||
|
#(ENUMERATE_TWO) probe-039.ogg
|
||||||
|
two
|
||||||
|
|
||||||
|
#(ENUMERATE_THREE) probe-040.ogg
|
||||||
|
three
|
||||||
|
|
||||||
|
#(ENUMERATE_FOUR) probe-041.ogg
|
||||||
|
four
|
||||||
|
|
||||||
|
#(ENUMERATE_FIVE) probe-042.ogg
|
||||||
|
five
|
||||||
|
|
||||||
|
#(ENUMERATE_SIX) probe-043.ogg
|
||||||
|
six
|
||||||
|
|
||||||
|
#(ENUMERATE_SEVEN) probe-044.ogg
|
||||||
|
seven
|
||||||
|
|
||||||
|
#(ENUMERATE_EIGHT) probe-045.ogg
|
||||||
|
eight
|
||||||
|
|
||||||
|
#(ENUMERATE_NINE) probe-046.ogg
|
||||||
|
nine
|
||||||
|
|
||||||
|
#(ENUMERATE_TEN) probe-047.ogg
|
||||||
|
ten
|
||||||
|
|
||||||
|
#(ENUMERATE_ELEVEN) probe-048.ogg
|
||||||
|
eleven
|
||||||
|
|
||||||
|
#(ENUMERATE_TWELVE) probe-049.ogg
|
||||||
|
twelve
|
||||||
|
|
||||||
|
#(ENUMERATE_THIRTEEN) probe-050.ogg
|
||||||
|
thirteen
|
||||||
|
|
||||||
|
#(ENUMERATE_FOURTEEN) probe-051.ogg
|
||||||
|
fourteen
|
||||||
|
|
||||||
|
#(ENUMERATE_FIFTEEN) probe-052.ogg
|
||||||
|
fifteen
|
||||||
|
|
||||||
|
#(ENUMERATE_SIXTEEN) probe-053.ogg
|
||||||
|
sixteen
|
||||||
|
|
||||||
|
#(ENUMERATE_SEVENTEEN) probe-054.ogg
|
||||||
|
seventeen
|
||||||
|
|
||||||
|
#(ENUMERATE_EIGHTEEN) probe-055.ogg
|
||||||
|
eighteen
|
||||||
|
|
||||||
|
#(ENUMERATE_NINETEEN) probe-056.ogg
|
||||||
|
nineteen
|
||||||
|
|
||||||
|
#(ENUMERATE_TWENTY) probe-057.ogg
|
||||||
|
twenty
|
||||||
|
|
||||||
|
#(ENUMERATE_THIRTY) probe-058.ogg
|
||||||
|
thirty
|
||||||
|
|
||||||
|
#(ENUMERATE_FOURTY) probe-059.ogg
|
||||||
|
fourty
|
||||||
|
|
||||||
|
#(ENUMERATE_FIFTY) probe-060.ogg
|
||||||
|
fifty
|
||||||
|
|
||||||
|
#(ENUMERATE_SIXTY) probe-061.ogg
|
||||||
|
sixty
|
||||||
|
|
||||||
|
#(ENUMERATE_SEVENTY) probe-062.ogg
|
||||||
|
seventy
|
||||||
|
|
||||||
|
#(ENUMERATE_EIGHTY) probe-063.ogg
|
||||||
|
eighty
|
||||||
|
|
||||||
|
#(ENUMERATE_NINETY) probe-064.ogg
|
||||||
|
ninety
|
||||||
|
|||||||
@@ -476,7 +476,7 @@ DoTransaction (RESPONSE_REF R)
|
|||||||
UnlockMutex (GraphicsLock);
|
UnlockMutex (GraphicsLock);
|
||||||
|
|
||||||
NPCPhrase (FUEL0);
|
NPCPhrase (FUEL0);
|
||||||
NPCPhrase (-(int)f);
|
NPCNumber (f, NULL);
|
||||||
NPCPhrase (FUEL1);
|
NPCPhrase (FUEL1);
|
||||||
|
|
||||||
if (f >= 250)
|
if (f >= 250)
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
#define NUM_ALIEN_RACE_ITEMS 16
|
#define NUM_ALIEN_RACE_ITEMS 16
|
||||||
#define NUM_TECH_ITEMS 13
|
#define NUM_TECH_ITEMS 13
|
||||||
|
|
||||||
static NUMBER_SPEECH_DESC melnorme_numbers_english;
|
static const NUMBER_SPEECH_DESC melnorme_numbers_english;
|
||||||
|
|
||||||
static LOCDATA melnorme_desc =
|
static LOCDATA melnorme_desc =
|
||||||
{
|
{
|
||||||
@@ -159,7 +159,7 @@ static COUNT melnorme_tens_names[] =
|
|||||||
ENUMERATE_NINETY
|
ENUMERATE_NINETY
|
||||||
};
|
};
|
||||||
|
|
||||||
static NUMBER_SPEECH_DESC melnorme_numbers_english =
|
static const NUMBER_SPEECH_DESC melnorme_numbers_english =
|
||||||
{
|
{
|
||||||
5, /* NumDigits */
|
5, /* NumDigits */
|
||||||
{
|
{
|
||||||
@@ -1183,9 +1183,9 @@ DoSell (RESPONSE_REF R)
|
|||||||
added_credit = GLOBAL_SIS (TotalBioMass) * BIO_CREDIT_VALUE;
|
added_credit = GLOBAL_SIS (TotalBioMass) * BIO_CREDIT_VALUE;
|
||||||
|
|
||||||
NPCPhrase (SOLD_LIFE_DATA1);
|
NPCPhrase (SOLD_LIFE_DATA1);
|
||||||
NPCPhrase (-(int)GLOBAL_SIS (TotalBioMass));
|
NPCNumber (GLOBAL_SIS (TotalBioMass), NULL);
|
||||||
NPCPhrase (SOLD_LIFE_DATA2);
|
NPCPhrase (SOLD_LIFE_DATA2);
|
||||||
NPCPhrase (-(int)added_credit);
|
NPCNumber (added_credit, NULL);
|
||||||
NPCPhrase (SOLD_LIFE_DATA3);
|
NPCPhrase (SOLD_LIFE_DATA3);
|
||||||
// queue WHAT_TO_SELL before talk-segue
|
// queue WHAT_TO_SELL before talk-segue
|
||||||
if (num_new_rainbows)
|
if (num_new_rainbows)
|
||||||
@@ -1231,9 +1231,9 @@ DoSell (RESPONSE_REF R)
|
|||||||
added_credit = num_new_rainbows * (250 * BIO_CREDIT_VALUE);
|
added_credit = num_new_rainbows * (250 * BIO_CREDIT_VALUE);
|
||||||
|
|
||||||
NPCPhrase (SOLD_RAINBOW_LOCATIONS1);
|
NPCPhrase (SOLD_RAINBOW_LOCATIONS1);
|
||||||
NPCPhrase (-(int)num_new_rainbows);
|
NPCNumber (num_new_rainbows, NULL);
|
||||||
NPCPhrase (SOLD_RAINBOW_LOCATIONS2);
|
NPCPhrase (SOLD_RAINBOW_LOCATIONS2);
|
||||||
NPCPhrase (-(int)added_credit);
|
NPCNumber (added_credit, NULL);
|
||||||
NPCPhrase (SOLD_RAINBOW_LOCATIONS3);
|
NPCPhrase (SOLD_RAINBOW_LOCATIONS3);
|
||||||
|
|
||||||
num_new_rainbows += GET_GAME_STATE (MELNORME_RAINBOW_COUNT);
|
num_new_rainbows += GET_GAME_STATE (MELNORME_RAINBOW_COUNT);
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../commall.h"
|
#include "../commall.h"
|
||||||
|
#include <math.h>
|
||||||
#include "resinst.h"
|
#include "resinst.h"
|
||||||
#include "strings.h"
|
#include "strings.h"
|
||||||
|
|
||||||
@@ -25,6 +26,8 @@
|
|||||||
#include "uqm/setup.h"
|
#include "uqm/setup.h"
|
||||||
|
|
||||||
|
|
||||||
|
static const NUMBER_SPEECH_DESC probe_numbers_english;
|
||||||
|
|
||||||
static LOCDATA slylandro_desc =
|
static LOCDATA slylandro_desc =
|
||||||
{
|
{
|
||||||
NULL, /* init_encounter_func */
|
NULL, /* init_encounter_func */
|
||||||
@@ -110,19 +113,116 @@ static LOCDATA slylandro_desc =
|
|||||||
0, 0, /* RestartRate */
|
0, 0, /* RestartRate */
|
||||||
0, /* BlockMask */
|
0, /* BlockMask */
|
||||||
},
|
},
|
||||||
NULL, /* AlienNumberSpeech - none */
|
&probe_numbers_english, /* AlienNumberSpeech - default */
|
||||||
/* Filler for loaded resources */
|
/* Filler for loaded resources */
|
||||||
NULL, NULL, NULL,
|
NULL, NULL, NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static COUNT probe_digit_names[] =
|
||||||
|
{
|
||||||
|
ENUMERATE_ZERO,
|
||||||
|
ENUMERATE_ONE,
|
||||||
|
ENUMERATE_TWO,
|
||||||
|
ENUMERATE_THREE,
|
||||||
|
ENUMERATE_FOUR,
|
||||||
|
ENUMERATE_FIVE,
|
||||||
|
ENUMERATE_SIX,
|
||||||
|
ENUMERATE_SEVEN,
|
||||||
|
ENUMERATE_EIGHT,
|
||||||
|
ENUMERATE_NINE,
|
||||||
|
};
|
||||||
|
|
||||||
|
static COUNT probe_teen_names[] =
|
||||||
|
{
|
||||||
|
ENUMERATE_TEN,
|
||||||
|
ENUMERATE_ELEVEN,
|
||||||
|
ENUMERATE_TWELVE,
|
||||||
|
ENUMERATE_THIRTEEN,
|
||||||
|
ENUMERATE_FOURTEEN,
|
||||||
|
ENUMERATE_FIFTEEN,
|
||||||
|
ENUMERATE_SIXTEEN,
|
||||||
|
ENUMERATE_SEVENTEEN,
|
||||||
|
ENUMERATE_EIGHTEEN,
|
||||||
|
ENUMERATE_NINETEEN,
|
||||||
|
};
|
||||||
|
|
||||||
|
static COUNT probe_tens_names[] =
|
||||||
|
{
|
||||||
|
0, /* invalid */
|
||||||
|
0, /* skip digit */
|
||||||
|
ENUMERATE_TWENTY,
|
||||||
|
ENUMERATE_THIRTY,
|
||||||
|
ENUMERATE_FOURTY,
|
||||||
|
ENUMERATE_FIFTY,
|
||||||
|
ENUMERATE_SIXTY,
|
||||||
|
ENUMERATE_SEVENTY,
|
||||||
|
ENUMERATE_EIGHTY,
|
||||||
|
ENUMERATE_NINETY,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const NUMBER_SPEECH_DESC probe_numbers_english =
|
||||||
|
{
|
||||||
|
5, /* NumDigits */
|
||||||
|
{
|
||||||
|
{ /* 1000-999999 */
|
||||||
|
1000, /* Divider */
|
||||||
|
0, /* Subtrahend */
|
||||||
|
NULL, /* StrDigits - recurse */
|
||||||
|
NULL, /* Names - not used */
|
||||||
|
ENUMERATE_THOUSAND /* CommonIndex */
|
||||||
|
},
|
||||||
|
{ /* 100-999 */
|
||||||
|
100, /* Divider */
|
||||||
|
0, /* Subtrahend */
|
||||||
|
probe_digit_names, /* StrDigits */
|
||||||
|
NULL, /* Names - not used */
|
||||||
|
ENUMERATE_HUNDRED /* CommonIndex */
|
||||||
|
},
|
||||||
|
{ /* 20-99 */
|
||||||
|
10, /* Divider */
|
||||||
|
0, /* Subtrahend */
|
||||||
|
probe_tens_names, /* StrDigits */
|
||||||
|
NULL, /* Names - not used */
|
||||||
|
0 /* CommonIndex - not used */
|
||||||
|
},
|
||||||
|
{ /* 10-19 */
|
||||||
|
1, /* Divider */
|
||||||
|
10, /* Subtrahend */
|
||||||
|
probe_teen_names, /* StrDigits */
|
||||||
|
NULL, /* Names - not used */
|
||||||
|
0 /* CommonIndex - not used */
|
||||||
|
},
|
||||||
|
{ /* 0-9 */
|
||||||
|
1, /* Divider */
|
||||||
|
0, /* Subtrahend */
|
||||||
|
probe_digit_names, /* StrDigits */
|
||||||
|
NULL, /* Names - not used */
|
||||||
|
0 /* CommonIndex - not used */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
static RESPONSE_REF threat,
|
static RESPONSE_REF threat,
|
||||||
something_wrong,
|
something_wrong,
|
||||||
we_are_us,
|
we_are_us,
|
||||||
why_attack,
|
why_attack,
|
||||||
bye;
|
bye;
|
||||||
|
|
||||||
|
static void
|
||||||
|
sayCoord (int coord)
|
||||||
|
{
|
||||||
|
int ac;
|
||||||
|
|
||||||
|
ac = abs (coord);
|
||||||
|
|
||||||
|
NPCPhrase_splice (coord < 0 ? COORD_MINUS : COORD_PLUS);
|
||||||
|
NPCNumber (ac / 10, "%03d");
|
||||||
|
NPCPhrase_splice (COORD_POINT);
|
||||||
|
NPCNumber (ac % 10, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
CombatIsInevitable (RESPONSE_REF R)
|
CombatIsInevitable (RESPONSE_REF R)
|
||||||
{
|
{
|
||||||
@@ -266,13 +366,6 @@ CombatIsInevitable (RESPONSE_REF R)
|
|||||||
else if (PLAYER_SAID (R, we_are_us))
|
else if (PLAYER_SAID (R, we_are_us))
|
||||||
{
|
{
|
||||||
NumVisits = GET_GAME_STATE (SLYLANDRO_PROBE_ID);
|
NumVisits = GET_GAME_STATE (SLYLANDRO_PROBE_ID);
|
||||||
if (NumVisits == 3 && !optSubtitles)
|
|
||||||
{
|
|
||||||
/* If playing without subtitles, don't use the
|
|
||||||
* last item in the conversation tree, which mentions
|
|
||||||
* coordinates which can't be spoken. */
|
|
||||||
NumVisits--;
|
|
||||||
}
|
|
||||||
switch (NumVisits++)
|
switch (NumVisits++)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
@@ -286,9 +379,16 @@ CombatIsInevitable (RESPONSE_REF R)
|
|||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
{
|
{
|
||||||
|
SIZE dx, dy;
|
||||||
|
|
||||||
|
// Probe's coordinate system is {-Y,X} relative to B Corvi
|
||||||
|
dx = LOGX_TO_UNIVERSE (GLOBAL_SIS (log_x)) - 333;
|
||||||
|
dy = 9812 - LOGY_TO_UNIVERSE (GLOBAL_SIS (log_y));
|
||||||
|
|
||||||
NPCPhrase (THIS_IS_PROBE_40);
|
NPCPhrase (THIS_IS_PROBE_40);
|
||||||
NPCPhrase (THIS_IS_PROBE_41);
|
sayCoord (dy);
|
||||||
NPCPhrase (GLOBAL_PLAYER_LOCATION);
|
NPCPhrase_splice (THIS_IS_PROBE_41);
|
||||||
|
sayCoord (dx);
|
||||||
NPCPhrase (THIS_IS_PROBE_42);
|
NPCPhrase (THIS_IS_PROBE_42);
|
||||||
|
|
||||||
--NumVisits;
|
--NumVisits;
|
||||||
|
|||||||
@@ -75,6 +75,39 @@ enum
|
|||||||
HOSTILE,
|
HOSTILE,
|
||||||
DESTRUCT_SEQUENCE,
|
DESTRUCT_SEQUENCE,
|
||||||
destruct_code,
|
destruct_code,
|
||||||
|
COORD_PLUS,
|
||||||
|
COORD_MINUS,
|
||||||
|
COORD_POINT,
|
||||||
|
ENUMERATE_HUNDRED,
|
||||||
|
ENUMERATE_THOUSAND,
|
||||||
|
ENUMERATE_ZERO,
|
||||||
|
ENUMERATE_ONE,
|
||||||
|
ENUMERATE_TWO,
|
||||||
|
ENUMERATE_THREE,
|
||||||
|
ENUMERATE_FOUR,
|
||||||
|
ENUMERATE_FIVE,
|
||||||
|
ENUMERATE_SIX,
|
||||||
|
ENUMERATE_SEVEN,
|
||||||
|
ENUMERATE_EIGHT,
|
||||||
|
ENUMERATE_NINE,
|
||||||
|
ENUMERATE_TEN,
|
||||||
|
ENUMERATE_ELEVEN,
|
||||||
|
ENUMERATE_TWELVE,
|
||||||
|
ENUMERATE_THIRTEEN,
|
||||||
|
ENUMERATE_FOURTEEN,
|
||||||
|
ENUMERATE_FIFTEEN,
|
||||||
|
ENUMERATE_SIXTEEN,
|
||||||
|
ENUMERATE_SEVENTEEN,
|
||||||
|
ENUMERATE_EIGHTEEN,
|
||||||
|
ENUMERATE_NINETEEN,
|
||||||
|
ENUMERATE_TWENTY,
|
||||||
|
ENUMERATE_THIRTY,
|
||||||
|
ENUMERATE_FOURTY,
|
||||||
|
ENUMERATE_FIFTY,
|
||||||
|
ENUMERATE_SIXTY,
|
||||||
|
ENUMERATE_SEVENTY,
|
||||||
|
ENUMERATE_EIGHTY,
|
||||||
|
ENUMERATE_NINETY,
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* _STRINGS_H */
|
#endif /* _STRINGS_H */
|
||||||
|
|||||||
+67
-51
@@ -26,12 +26,12 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include "libs/log.h"
|
#include "libs/log.h"
|
||||||
|
|
||||||
int NPCNumberPhrase (int number, UNICODE **ptrack);
|
static int NPCNumberPhrase (int number, const char *fmt, UNICODE **ptrack);
|
||||||
|
|
||||||
void
|
void
|
||||||
NPCPhrase_cb (int index, TFB_TrackCB cb)
|
NPCPhrase_cb (int index, TFB_TrackCB cb)
|
||||||
{
|
{
|
||||||
UNICODE *pStr, numbuf[400];
|
UNICODE *pStr, buf[400];
|
||||||
void *pClip, *pTimeStamp;
|
void *pClip, *pTimeStamp;
|
||||||
|
|
||||||
switch (index)
|
switch (index)
|
||||||
@@ -46,42 +46,13 @@ NPCPhrase_cb (int index, TFB_TrackCB cb)
|
|||||||
pClip = 0;
|
pClip = 0;
|
||||||
pTimeStamp = 0;
|
pTimeStamp = 0;
|
||||||
break;
|
break;
|
||||||
case GLOBAL_PLAYER_LOCATION:
|
|
||||||
{
|
|
||||||
SIZE dx, dy;
|
|
||||||
COUNT adx, ady;
|
|
||||||
|
|
||||||
dx = LOGX_TO_UNIVERSE (GLOBAL_SIS (log_x)) - 333;
|
|
||||||
adx = dx >= 0 ? dx : -dx;
|
|
||||||
dy = 9812 - LOGY_TO_UNIVERSE (GLOBAL_SIS (log_y));
|
|
||||||
ady = dy >= 0 ? dy : -dy;
|
|
||||||
sprintf (numbuf,
|
|
||||||
"%+04d.%01u,%+04d.%01u",
|
|
||||||
(SIZE)(dy / 10), (COUNT)(ady % 10),
|
|
||||||
(SIZE)(dx / 10), (COUNT)(adx % 10));
|
|
||||||
pStr = numbuf;
|
|
||||||
pClip = 0;
|
|
||||||
pTimeStamp = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 0:
|
case 0:
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
if (index < 0)
|
if (index < 0)
|
||||||
{
|
{ // One of the alliance name variants
|
||||||
if (index > UNREASONABLE_NUMBER)
|
|
||||||
{
|
|
||||||
if (CommData.AlienNumberSpeech)
|
|
||||||
{
|
|
||||||
NPCNumberPhrase (-index, NULL);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
sprintf (numbuf, "%d", -index);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
COUNT i;
|
COUNT i;
|
||||||
STRING S;
|
STRING S;
|
||||||
|
|
||||||
@@ -89,11 +60,11 @@ NPCPhrase_cb (int index, TFB_TrackCB cb)
|
|||||||
|
|
||||||
i = GET_GAME_STATE (NEW_ALLIANCE_NAME);
|
i = GET_GAME_STATE (NEW_ALLIANCE_NAME);
|
||||||
S = SetAbsStringTableIndex (CommData.ConversationPhrases, (index - 1) + i);
|
S = SetAbsStringTableIndex (CommData.ConversationPhrases, (index - 1) + i);
|
||||||
strcpy (numbuf, (UNICODE *)GetStringAddress (S));
|
strcpy (buf, (UNICODE *)GetStringAddress (S));
|
||||||
if (i == 3)
|
if (i == 3)
|
||||||
strcat (numbuf, GLOBAL_SIS (CommanderName));
|
strcat (buf, GLOBAL_SIS (CommanderName));
|
||||||
}
|
|
||||||
pStr = numbuf;
|
pStr = buf;
|
||||||
pClip = 0;
|
pClip = 0;
|
||||||
pTimeStamp = 0;
|
pTimeStamp = 0;
|
||||||
}
|
}
|
||||||
@@ -115,8 +86,56 @@ NPCPhrase_cb (int index, TFB_TrackCB cb)
|
|||||||
SpliceTrack (pClip, pStr, pTimeStamp, cb);
|
SpliceTrack (pClip, pStr, pTimeStamp, cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
// Special case variant: prevents page breaks.
|
||||||
NPCNumberPhrase (int number, UNICODE **ptrack)
|
void
|
||||||
|
NPCPhrase_splice (int index)
|
||||||
|
{
|
||||||
|
UNICODE *pStr;
|
||||||
|
void *pClip;
|
||||||
|
|
||||||
|
assert (index >= 0);
|
||||||
|
if (index == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
pStr = (UNICODE *)GetStringAddress (
|
||||||
|
SetAbsStringTableIndex (CommData.ConversationPhrases, index - 1));
|
||||||
|
pClip = GetStringSoundClip (
|
||||||
|
SetAbsStringTableIndex (CommData.ConversationPhrases, index - 1));
|
||||||
|
|
||||||
|
if (!pClip)
|
||||||
|
{ // Just appending some text
|
||||||
|
SpliceTrack (NULL, pStr, NULL, NULL);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{ // Splicing in some voice
|
||||||
|
UNICODE *tracks[] = {NULL, NULL};
|
||||||
|
|
||||||
|
tracks[0] = pClip;
|
||||||
|
SpliceMultiTrack (tracks, pStr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
NPCNumber (int number, const char *fmt)
|
||||||
|
{
|
||||||
|
UNICODE buf[32];
|
||||||
|
|
||||||
|
if (!fmt)
|
||||||
|
fmt = "%d";
|
||||||
|
|
||||||
|
if (CommData.AlienNumberSpeech)
|
||||||
|
{
|
||||||
|
NPCNumberPhrase (number, fmt, NULL);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// just splice in the subtitle text
|
||||||
|
snprintf (buf, sizeof buf, fmt, number);
|
||||||
|
SpliceTrack (NULL, buf, NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
NPCNumberPhrase (int number, const char *fmt, UNICODE **ptrack)
|
||||||
{
|
{
|
||||||
#define MAX_NUMBER_TRACKS 20
|
#define MAX_NUMBER_TRACKS 20
|
||||||
NUMBER_SPEECH speech = CommData.AlienNumberSpeech;
|
NUMBER_SPEECH speech = CommData.AlienNumberSpeech;
|
||||||
@@ -125,6 +144,7 @@ NPCNumberPhrase (int number, UNICODE **ptrack)
|
|||||||
int toplevel = 0;
|
int toplevel = 0;
|
||||||
UNICODE *TrackNames[MAX_NUMBER_TRACKS];
|
UNICODE *TrackNames[MAX_NUMBER_TRACKS];
|
||||||
UNICODE numbuf[60];
|
UNICODE numbuf[60];
|
||||||
|
const SPEECH_DIGIT* dig = NULL;
|
||||||
|
|
||||||
if (!speech)
|
if (!speech)
|
||||||
return 0;
|
return 0;
|
||||||
@@ -132,15 +152,17 @@ NPCNumberPhrase (int number, UNICODE **ptrack)
|
|||||||
if (!ptrack)
|
if (!ptrack)
|
||||||
{
|
{
|
||||||
toplevel = 1;
|
toplevel = 1;
|
||||||
sprintf (numbuf, "%d", number);
|
if (!fmt)
|
||||||
|
fmt = "%d";
|
||||||
|
sprintf (numbuf, fmt, number);
|
||||||
ptrack = TrackNames;
|
ptrack = TrackNames;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < speech->NumDigits; ++i)
|
for (i = 0; i < speech->NumDigits; ++i)
|
||||||
{
|
{
|
||||||
SPEECH_DIGIT* dig = speech->Digits + i;
|
|
||||||
int quot;
|
int quot;
|
||||||
|
|
||||||
|
dig = speech->Digits + i;
|
||||||
quot = number / dig->Divider;
|
quot = number / dig->Divider;
|
||||||
|
|
||||||
if (quot == 0)
|
if (quot == 0)
|
||||||
@@ -166,7 +188,7 @@ NPCNumberPhrase (int number, UNICODE **ptrack)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int ctracks = NPCNumberPhrase (quot, ptrack);
|
int ctracks = NPCNumberPhrase (quot, NULL, ptrack);
|
||||||
ptrack += ctracks;
|
ptrack += ctracks;
|
||||||
queued += ctracks;
|
queued += ctracks;
|
||||||
}
|
}
|
||||||
@@ -181,9 +203,7 @@ NPCNumberPhrase (int number, UNICODE **ptrack)
|
|||||||
{
|
{
|
||||||
*ptrack++ = GetStringSoundClip (
|
*ptrack++ = GetStringSoundClip (
|
||||||
SetAbsStringTableIndex (
|
SetAbsStringTableIndex (
|
||||||
CommData.ConversationPhrases,
|
CommData.ConversationPhrases, name->StrIndex - 1));
|
||||||
(COUNT) (name->StrIndex - 1)
|
|
||||||
));
|
|
||||||
queued++;
|
queued++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -192,9 +212,7 @@ NPCNumberPhrase (int number, UNICODE **ptrack)
|
|||||||
else if (dig->CommonNameIndex != 0)
|
else if (dig->CommonNameIndex != 0)
|
||||||
{
|
{
|
||||||
*ptrack++ = GetStringSoundClip (SetAbsStringTableIndex (
|
*ptrack++ = GetStringSoundClip (SetAbsStringTableIndex (
|
||||||
CommData.ConversationPhrases,
|
CommData.ConversationPhrases, dig->CommonNameIndex - 1));
|
||||||
(COUNT) (dig->CommonNameIndex - 1)
|
|
||||||
));
|
|
||||||
queued++;
|
queued++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -205,11 +223,9 @@ NPCNumberPhrase (int number, UNICODE **ptrack)
|
|||||||
{
|
{
|
||||||
if (queued == 0)
|
if (queued == 0)
|
||||||
{ // nothing queued, say "zero"
|
{ // nothing queued, say "zero"
|
||||||
|
assert (number == 0);
|
||||||
*ptrack++ = GetStringSoundClip (SetAbsStringTableIndex (
|
*ptrack++ = GetStringSoundClip (SetAbsStringTableIndex (
|
||||||
CommData.ConversationPhrases,
|
CommData.ConversationPhrases, dig->StrDigits[number] - 1));
|
||||||
speech->Digits[speech->NumDigits - 1].StrDigits[0]
|
|
||||||
));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
*ptrack++ = NULL; // term
|
*ptrack++ = NULL; // term
|
||||||
|
|
||||||
|
|||||||
@@ -74,10 +74,7 @@ enum
|
|||||||
{
|
{
|
||||||
GLOBAL_PLAYER_NAME = -1000000,
|
GLOBAL_PLAYER_NAME = -1000000,
|
||||||
GLOBAL_SHIP_NAME,
|
GLOBAL_SHIP_NAME,
|
||||||
GLOBAL_PLAYER_LOCATION,
|
|
||||||
|
|
||||||
GLOBAL_ALLIANCE_NAME,
|
GLOBAL_ALLIANCE_NAME,
|
||||||
UNREASONABLE_NUMBER = GLOBAL_ALLIANCE_NAME + 1000,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef COUNT RESPONSE_REF;
|
typedef COUNT RESPONSE_REF;
|
||||||
@@ -90,6 +87,8 @@ extern void DoNPCPhrase (UNICODE *pStr);
|
|||||||
|
|
||||||
extern void NPCPhrase_cb (int index, TFB_TrackCB cb);
|
extern void NPCPhrase_cb (int index, TFB_TrackCB cb);
|
||||||
#define NPCPhrase(index) NPCPhrase_cb ((index), NULL)
|
#define NPCPhrase(index) NPCPhrase_cb ((index), NULL)
|
||||||
|
extern void NPCPhrase_splice (int index);
|
||||||
|
extern void NPCNumber (int number, const char *fmt);
|
||||||
|
|
||||||
#define ALLIANCE_NAME_BUFSIZE 256
|
#define ALLIANCE_NAME_BUFSIZE 256
|
||||||
extern void GetAllianceName (UNICODE *buf, RESPONSE_REF name_1);
|
extern void GetAllianceName (UNICODE *buf, RESPONSE_REF name_1);
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ typedef struct
|
|||||||
// 0-9, 10-19, ..20-90, ..100-900, etc.
|
// 0-9, 10-19, ..20-90, ..100-900, etc.
|
||||||
SPEECH_DIGIT Digits[MAX_SPEECH_DIGITS];
|
SPEECH_DIGIT Digits[MAX_SPEECH_DIGITS];
|
||||||
} NUMBER_SPEECH_DESC;
|
} NUMBER_SPEECH_DESC;
|
||||||
typedef NUMBER_SPEECH_DESC *NUMBER_SPEECH;
|
typedef const NUMBER_SPEECH_DESC *NUMBER_SPEECH;
|
||||||
|
|
||||||
typedef DWORD LDAS_FLAGS;
|
typedef DWORD LDAS_FLAGS;
|
||||||
#define LDASF_NONE ((LDAS_FLAGS) 0 )
|
#define LDASF_NONE ((LDAS_FLAGS) 0 )
|
||||||
|
|||||||
Reference in New Issue
Block a user