diff --git a/sc2/src/sc2code/comm.c b/sc2/src/sc2code/comm.c index e43045452..7187ee963 100644 --- a/sc2/src/sc2code/comm.c +++ b/sc2/src/sc2code/comm.c @@ -1966,6 +1966,7 @@ HailAlien (void) MEM_HANDLE hOldIndex; ENCOUNTER_STATE ES; FONT PlayerFont, OldFont; + MUSIC_REF SongRef = 0; pCurInputState = &ES; memset (pCurInputState, 0, sizeof (*pCurInputState)); @@ -1984,7 +1985,14 @@ HailAlien (void) CommData.AlienColorMap = CaptureColorMap ( LoadColorMapInstance ((RESOURCE)CommData.AlienColorMap) ); - CommData.AlienSong = LoadMusicInstance ((RESOURCE)CommData.AlienSong); + if ((CommData.AlienSongFlags & LDASF_USE_ALTERNATE) + && CommData.AlienAltSong) + SongRef = LoadMusicFile (CommData.AlienAltSong); + if (SongRef) + CommData.AlienSong = SongRef; + else + CommData.AlienSong = LoadMusicInstance ((RESOURCE)CommData.AlienSong); + CommData.ConversationPhrases = CaptureStringTable ( LoadStringTableInstance ((RESOURCE)CommData.ConversationPhrases) ); diff --git a/sc2/src/sc2code/comm/arilou/arilouc.c b/sc2/src/sc2code/comm/arilou/arilouc.c index 3a6be9070..567153ebe 100644 --- a/sc2/src/sc2code/comm/arilou/arilouc.c +++ b/sc2/src/sc2code/comm/arilou/arilouc.c @@ -35,6 +35,8 @@ static LOCDATA arilou_desc = 0, /* SIS_TEXT_WIDTH - 16, */ /* AlienTextWidth */ 0, /* AlienColorMap */ ARILOU_MUSIC, /* AlienSong */ + 0, /* AlienAltSong */ + 0, /* AlienSongFlags */ ARILOU_CONVERSATION_PHRASES, /* PlayerPhrases */ 20, /* NumAnimations */ { diff --git a/sc2/src/sc2code/comm/blackur/blackurc.c b/sc2/src/sc2code/comm/blackur/blackurc.c index 0e6467849..25fbcd873 100644 --- a/sc2/src/sc2code/comm/blackur/blackurc.c +++ b/sc2/src/sc2code/comm/blackur/blackurc.c @@ -32,6 +32,8 @@ static LOCDATA blackurq_desc = 0, /* SIS_TEXT_WIDTH - 16, */ /* AlienTextWidth */ 0, /* AlienColorMap */ BLACKURQ_MUSIC, /* AlienSong */ + 0, /* AlienAltSong */ + 0, /* AlienSongFlags */ BLACKURQ_CONVERSATION_PHRASES, /* PlayerPhrases */ 8, /* NumAnimations */ { diff --git a/sc2/src/sc2code/comm/chmmr/chmmrc.c b/sc2/src/sc2code/comm/chmmr/chmmrc.c index 91bab7d7c..ac83bb35e 100644 --- a/sc2/src/sc2code/comm/chmmr/chmmrc.c +++ b/sc2/src/sc2code/comm/chmmr/chmmrc.c @@ -35,6 +35,8 @@ static LOCDATA chmmr_desc = 0, /* SIS_TEXT_WIDTH - 16, */ /* AlienTextWidth */ (COLORMAP)CHMMR_COLOR_MAP, /* AlienColorMap */ CHMMR_MUSIC, /* AlienSong */ + 0, /* AlienAltSong */ + 0, /* AlienSongFlags */ CHMMR_CONVERSATION_PHRASES, /* PlayerPhrases */ 6, /* NumAnimations */ { diff --git a/sc2/src/sc2code/comm/comandr/comandr.c b/sc2/src/sc2code/comm/comandr/comandr.c index 410a6f043..65abab205 100644 --- a/sc2/src/sc2code/comm/comandr/comandr.c +++ b/sc2/src/sc2code/comm/comandr/comandr.c @@ -34,6 +34,8 @@ static LOCDATA commander_desc = 0, /* SIS_TEXT_WIDTH, */ /* AlienTextWidth */ COMMANDER_COLOR_MAP, /* AlienColorMap */ COMMANDER_MUSIC, /* AlienSong */ + 0, /* AlienAltSong */ + 0, /* AlienSongFlags */ COMMANDER_CONVERSATION_PHRASES, /* PlayerPhrases */ 3, /* NumAnimations */ { diff --git a/sc2/src/sc2code/comm/druuge/druugec.c b/sc2/src/sc2code/comm/druuge/druugec.c index 79b4bcffe..afafaeaaf 100644 --- a/sc2/src/sc2code/comm/druuge/druugec.c +++ b/sc2/src/sc2code/comm/druuge/druugec.c @@ -36,6 +36,8 @@ static LOCDATA druuge_desc = 0, /* SIS_TEXT_WIDTH - 16, */ /* AlienTextWidth */ 0, /* AlienColorMap */ DRUUGE_MUSIC, /* AlienSong */ + 0, /* AlienAltSong */ + 0, /* AlienSongFlags */ DRUUGE_CONVERSATION_PHRASES, /* PlayerPhrases */ 11, { diff --git a/sc2/src/sc2code/comm/ilwrath/ilwrathc.c b/sc2/src/sc2code/comm/ilwrath/ilwrathc.c index 0b00b3aad..acdb3bf83 100644 --- a/sc2/src/sc2code/comm/ilwrath/ilwrathc.c +++ b/sc2/src/sc2code/comm/ilwrath/ilwrathc.c @@ -35,6 +35,8 @@ static LOCDATA ilwrath_desc = 0, /* SIS_TEXT_WIDTH - 16, */ /* AlienTextWidth */ 0, /* AlienColorMap */ ILWRATH_MUSIC, /* AlienSong */ + 0, /* AlienAltSong */ + 0, /* AlienSongFlags */ ILWRATH_CONVERSATION_PHRASES, /* PlayerPhrases */ 4, /* NumAnimations */ { diff --git a/sc2/src/sc2code/comm/melnorm/melnorm.c b/sc2/src/sc2code/comm/melnorm/melnorm.c index af9f393ce..fbe8e257b 100644 --- a/sc2/src/sc2code/comm/melnorm/melnorm.c +++ b/sc2/src/sc2code/comm/melnorm/melnorm.c @@ -51,6 +51,8 @@ static LOCDATA melnorme_desc = 0, /* SIS_TEXT_WIDTH - 16, */ /* AlienTextWidth */ MELNORME_COLOR_MAP, /* AlienColorMap */ MELNORME_MUSIC, /* AlienSong */ + 0, /* AlienAltSong */ + 0, /* AlienSongFlags */ MELNORME_CONVERSATION_PHRASES, /* PlayerPhrases */ 4, /* NumAnimations */ { diff --git a/sc2/src/sc2code/comm/mycon/myconc.c b/sc2/src/sc2code/comm/mycon/myconc.c index 3f977197f..96314c8f5 100644 --- a/sc2/src/sc2code/comm/mycon/myconc.c +++ b/sc2/src/sc2code/comm/mycon/myconc.c @@ -36,6 +36,8 @@ static LOCDATA mycon_desc = 0, /* SIS_TEXT_WIDTH - 16, */ /* AlienTextWidth */ 0, /* AlienColorMap */ MYCON_MUSIC, /* AlienSong */ + 0, /* AlienAltSong */ + 0, /* AlienSongFlags */ MYCON_CONVERSATION_PHRASES, /* PlayerPhrases */ 5, /* NumAnimations */ { diff --git a/sc2/src/sc2code/comm/orz/orzc.c b/sc2/src/sc2code/comm/orz/orzc.c index c72493329..65cc77c77 100644 --- a/sc2/src/sc2code/comm/orz/orzc.c +++ b/sc2/src/sc2code/comm/orz/orzc.c @@ -34,6 +34,8 @@ static LOCDATA orz_desc = 0, /* SIS_TEXT_WIDTH - 16, */ /* AlienTextWidth */ (COLORMAP)ORZ_COLOR_MAP, /* AlienColorMap */ ORZ_MUSIC, /* AlienSong */ + 0, /* AlienAltSong */ + 0, /* AlienSongFlags */ ORZ_CONVERSATION_PHRASES, /* PlayerPhrases */ 12 /* 13 */, /* NumAnimations */ { diff --git a/sc2/src/sc2code/comm/pkunk/pkunkc.c b/sc2/src/sc2code/comm/pkunk/pkunkc.c index 05983859f..52210728d 100644 --- a/sc2/src/sc2code/comm/pkunk/pkunkc.c +++ b/sc2/src/sc2code/comm/pkunk/pkunkc.c @@ -36,6 +36,8 @@ static LOCDATA pkunk_desc = 0, /* SIS_TEXT_WIDTH - 16, */ /* AlienTextWidth */ 0, /* AlienColorMap */ PKUNK_MUSIC, /* AlienSong */ + 0, /* AlienAltSong */ + 0, /* AlienSongFlags */ PKUNK_CONVERSATION_PHRASES, /* PlayerPhrases */ 3, /* NumAnimations */ { diff --git a/sc2/src/sc2code/comm/rebel/rebel.c b/sc2/src/sc2code/comm/rebel/rebel.c index 6f85129de..7b9700d4c 100644 --- a/sc2/src/sc2code/comm/rebel/rebel.c +++ b/sc2/src/sc2code/comm/rebel/rebel.c @@ -35,6 +35,8 @@ static LOCDATA yehat_desc = 0, /* (SIS_TEXT_WIDTH - 16) * 2 / 3, */ /* AlienTextWidth */ 0, /* AlienColorMap */ YEHAT_MUSIC, /* AlienSong */ + 0, /* AlienAltSong */ + 0, /* AlienSongFlags */ REBEL_CONVERSATION_PHRASES, /* PlayerPhrases */ 15, /* NumAnimations */ { diff --git a/sc2/src/sc2code/comm/shofixt/shofixt.c b/sc2/src/sc2code/comm/shofixt/shofixt.c index 539d73604..a5d2873de 100644 --- a/sc2/src/sc2code/comm/shofixt/shofixt.c +++ b/sc2/src/sc2code/comm/shofixt/shofixt.c @@ -35,6 +35,8 @@ static LOCDATA shofixti_desc = 0, /* SIS_TEXT_WIDTH, */ /* AlienTextWidth */ 0, /* AlienColorMap */ SHOFIXTI_MUSIC, /* AlienSong */ + 0, /* AlienAltSong */ + 0, /* AlienSongFlags */ SHOFIXTI_CONVERSATION_PHRASES, /* PlayerPhrases */ 11, /* NumAnimations */ { diff --git a/sc2/src/sc2code/comm/slyhome/slyhome.c b/sc2/src/sc2code/comm/slyhome/slyhome.c index 25430eb89..b64750de3 100644 --- a/sc2/src/sc2code/comm/slyhome/slyhome.c +++ b/sc2/src/sc2code/comm/slyhome/slyhome.c @@ -34,6 +34,8 @@ static LOCDATA slylandro_desc = 0, /* SIS_TEXT_WIDTH, */ /* AlienTextWidth */ (COLORMAP)SLYLANDRO_COLOR_MAP, /* AlienColorMap */ SLYLANDRO_MUSIC, /* AlienSong */ + 0, /* AlienAltSong */ + 0, /* AlienSongFlags */ SLYLANDRO_CONVERSATION_PHRASES, /* PlayerPhrases */ 13, /* NumAnimations */ { diff --git a/sc2/src/sc2code/comm/slyland/slyland.c b/sc2/src/sc2code/comm/slyland/slyland.c index cab012ef1..703b87a56 100644 --- a/sc2/src/sc2code/comm/slyland/slyland.c +++ b/sc2/src/sc2code/comm/slyland/slyland.c @@ -36,6 +36,8 @@ static LOCDATA slylandro_desc = 0, /* SIS_TEXT_WIDTH - 16, */ /* AlienTextWidth */ 0, /* AlienColorMap */ SLYLAND_MUSIC, /* AlienSong */ + 0, /* AlienAltSong */ + 0, /* AlienSongFlags */ SLYLAND_CONVERSATION_PHRASES, /* PlayerPhrases */ 6, /* NumAnimations */ { diff --git a/sc2/src/sc2code/comm/spahome/spahome.c b/sc2/src/sc2code/comm/spahome/spahome.c index f267955fc..0c57bc94c 100644 --- a/sc2/src/sc2code/comm/spahome/spahome.c +++ b/sc2/src/sc2code/comm/spahome/spahome.c @@ -36,6 +36,8 @@ static LOCDATA spahome_desc = 0, /* SIS_TEXT_WIDTH - 16, */ /* AlienTextWidth */ (COLORMAP)SPATHI_HOME_COLOR_MAP, /* AlienColorMap */ SPATHI_MUSIC, /* AlienSong */ + 0, /* AlienAltSong */ + 0, /* AlienSongFlags */ SPATHI_HOME_CONVERSATION_PHRASES, /* PlayerPhrases */ 14, /* NumAnimations */ { diff --git a/sc2/src/sc2code/comm/spathi/spathic.c b/sc2/src/sc2code/comm/spathi/spathic.c index 13f5307aa..cea78ef87 100644 --- a/sc2/src/sc2code/comm/spathi/spathic.c +++ b/sc2/src/sc2code/comm/spathi/spathic.c @@ -35,6 +35,8 @@ static LOCDATA spathi_desc = 0, /* SIS_TEXT_WIDTH - 16, */ /* AlienTextWidth */ 0, /* AlienColorMap */ SPATHI_MUSIC, /* AlienSong */ + 0, /* AlienAltSong */ + 0, /* AlienSongFlags */ SPATHI_CONVERSATION_PHRASES, /* PlayerPhrases */ 8, /* NumAnimations */ { diff --git a/sc2/src/sc2code/comm/starbas/starbas.c b/sc2/src/sc2code/comm/starbas/starbas.c index 51d78a3a4..88778d762 100644 --- a/sc2/src/sc2code/comm/starbas/starbas.c +++ b/sc2/src/sc2code/comm/starbas/starbas.c @@ -52,6 +52,8 @@ static LOCDATA commander_desc = 0, /* SIS_TEXT_WIDTH, */ /* AlienTextWidth */ (COLORMAP)COMMANDER_COLOR_MAP, /* AlienColorMap */ COMMANDER_MUSIC, /* AlienSong */ + 0, /* AlienAltSong */ + 0, /* AlienSongFlags */ STARBASE_CONVERSATION_PHRASES, /* PlayerPhrases */ 10, /* NumAnimations */ { diff --git a/sc2/src/sc2code/comm/supox/supoxc.c b/sc2/src/sc2code/comm/supox/supoxc.c index e79d9db49..66524fdd9 100644 --- a/sc2/src/sc2code/comm/supox/supoxc.c +++ b/sc2/src/sc2code/comm/supox/supoxc.c @@ -35,6 +35,8 @@ static LOCDATA supox_desc = 0, /* SIS_TEXT_WIDTH - 16, */ /* AlienTextWidth */ 0, /* AlienColorMap */ SUPOX_MUSIC, /* AlienSong */ + 0, /* AlienAltSong */ + 0, /* AlienSongFlags */ SUPOX_CONVERSATION_PHRASES, /* PlayerPhrases */ 4, /* NumAnimations */ { diff --git a/sc2/src/sc2code/comm/syreen/syreenc.c b/sc2/src/sc2code/comm/syreen/syreenc.c index 4a8ed2ee3..f7965ae05 100644 --- a/sc2/src/sc2code/comm/syreen/syreenc.c +++ b/sc2/src/sc2code/comm/syreen/syreenc.c @@ -35,6 +35,8 @@ static LOCDATA syreen_desc = 0, /* SIS_TEXT_WIDTH - 16, */ /* AlienTextWidth */ (COLORMAP)SYREEN_COLOR_MAP, /* AlienColorMap */ SYREEN_MUSIC, /* AlienSong */ + 0, /* AlienAltSong */ + 0, /* AlienSongFlags */ SYREEN_CONVERSATION_PHRASES, /* PlayerPhrases */ 15, /* NumAnimations */ { diff --git a/sc2/src/sc2code/comm/talkpet/talkpet.c b/sc2/src/sc2code/comm/talkpet/talkpet.c index b3dce1da3..c4a6d8cb2 100644 --- a/sc2/src/sc2code/comm/talkpet/talkpet.c +++ b/sc2/src/sc2code/comm/talkpet/talkpet.c @@ -35,6 +35,8 @@ static LOCDATA talkpet_desc = 0, /* SIS_TEXT_WIDTH - 16, */ /* AlienTextWidth */ (COLORMAP)TALKING_PET_COLOR_MAP, /* AlienColorMap */ TALKING_PET_MUSIC, /* AlienSong */ + 0, /* AlienAltSong */ + 0, /* AlienSongFlags */ TALKING_PET_CONVERSATION_PHRASES, /* PlayerPhrases */ 16, /* NumAnimations */ { diff --git a/sc2/src/sc2code/comm/thradd/thraddc.c b/sc2/src/sc2code/comm/thradd/thraddc.c index 425849a4f..e8cfee81a 100644 --- a/sc2/src/sc2code/comm/thradd/thraddc.c +++ b/sc2/src/sc2code/comm/thradd/thraddc.c @@ -36,6 +36,8 @@ static LOCDATA thradd_desc = 0, /* SIS_TEXT_WIDTH - 16, */ /* AlienTextWidth */ 0, /* AlienColorMap */ THRADD_MUSIC, /* AlienSong */ + 0, /* AlienAltSong */ + 0, /* AlienSongFlags */ THRADD_CONVERSATION_PHRASES, /* PlayerPhrases */ 8, /* NumAnimations */ { diff --git a/sc2/src/sc2code/comm/umgah/umgahc.c b/sc2/src/sc2code/comm/umgah/umgahc.c index 62b22c04e..ebe0e21b0 100644 --- a/sc2/src/sc2code/comm/umgah/umgahc.c +++ b/sc2/src/sc2code/comm/umgah/umgahc.c @@ -35,6 +35,8 @@ static LOCDATA umgah_desc = 0, /* SIS_TEXT_WIDTH - 16, */ /* AlienTextWidth */ 0, /* AlienColorMap */ UMGAH_MUSIC, /* AlienSong */ + 0, /* AlienAltSong */ + 0, /* AlienSongFlags */ UMGAH_CONVERSATION_PHRASES, /* PlayerPhrases */ 16, /* NumAnimations */ { diff --git a/sc2/src/sc2code/comm/urquan/urquanc.c b/sc2/src/sc2code/comm/urquan/urquanc.c index 04999a6d5..a5d119eee 100644 --- a/sc2/src/sc2code/comm/urquan/urquanc.c +++ b/sc2/src/sc2code/comm/urquan/urquanc.c @@ -32,6 +32,8 @@ static LOCDATA urquan_desc = 0, /* SIS_TEXT_WIDTH - 16, */ /* AlienTextWidth */ 0, /* AlienColorMap */ URQUAN_MUSIC, /* AlienSong */ + 0, /* AlienAltSong */ + 0, /* AlienSongFlags */ URQUAN_CONVERSATION_PHRASES, /* PlayerPhrases */ 7, /* NumAnimations */ { diff --git a/sc2/src/sc2code/comm/utwig/utwigc.c b/sc2/src/sc2code/comm/utwig/utwigc.c index f16930bc2..a77c3a556 100644 --- a/sc2/src/sc2code/comm/utwig/utwigc.c +++ b/sc2/src/sc2code/comm/utwig/utwigc.c @@ -36,6 +36,8 @@ static LOCDATA utwig_desc = 0, /* SIS_TEXT_WIDTH - 16, */ /* AlienTextWidth */ 0, /* AlienColorMap */ UTWIG_MUSIC, /* AlienSong */ + 0, /* AlienAltSong */ + 0, /* AlienSongFlags */ UTWIG_CONVERSATION_PHRASES, /* PlayerPhrases */ 16, /* NumAnimations */ { @@ -962,6 +964,16 @@ init_utwig_comm (void) utwig_desc.AlienTextTemplate.valign = VALIGN_MIDDLE; utwig_desc.AlienTextWidth = SIS_TEXT_WIDTH - 16; + if (GET_GAME_STATE (UTWIG_HAVE_ULTRON)) + { // use alternate 'Happy Utwig!' track + utwig_desc.AlienAltSong = "comm/utwig/utwigult.ogg"; + utwig_desc.AlienSongFlags |= LDASF_USE_ALTERNATE; + } + else + { // regular track -- let's make sure + utwig_desc.AlienSongFlags &= ~LDASF_USE_ALTERNATE; + } + if (GET_GAME_STATE (UTWIG_HAVE_ULTRON) || LOBYTE (GLOBAL (CurrentActivity)) == WON_LAST_BATTLE) { diff --git a/sc2/src/sc2code/comm/vux/vuxc.c b/sc2/src/sc2code/comm/vux/vuxc.c index a9d053795..849391e34 100644 --- a/sc2/src/sc2code/comm/vux/vuxc.c +++ b/sc2/src/sc2code/comm/vux/vuxc.c @@ -32,6 +32,8 @@ static LOCDATA vux_desc = 0, /* (SIS_TEXT_WIDTH - 16) >> 1, */ /* AlienTextWidth */ VUX_COLOR_MAP, /* AlienColorMap */ VUX_MUSIC, /* AlienSong */ + 0, /* AlienAltSong */ + 0, /* AlienSongFlags */ VUX_CONVERSATION_PHRASES, /* PlayerPhrases */ 17, /* NumAnimations */ { diff --git a/sc2/src/sc2code/comm/yehat/yehatc.c b/sc2/src/sc2code/comm/yehat/yehatc.c index eaf9536be..e37ff61c1 100644 --- a/sc2/src/sc2code/comm/yehat/yehatc.c +++ b/sc2/src/sc2code/comm/yehat/yehatc.c @@ -37,6 +37,8 @@ static LOCDATA yehat_desc = 0, /* (SIS_TEXT_WIDTH - 16) * 2 / 3, */ /* AlienTextWidth */ 0, /* AlienColorMap */ YEHAT_MUSIC, /* AlienSong */ + 0, /* AlienAltSong */ + 0, /* AlienSongFlags */ YEHAT_CONVERSATION_PHRASES, /* PlayerPhrases */ 15, /* NumAnimations */ { diff --git a/sc2/src/sc2code/comm/zoqfot/zoqfotc.c b/sc2/src/sc2code/comm/zoqfot/zoqfotc.c index 97f0f7631..9f81198fd 100644 --- a/sc2/src/sc2code/comm/zoqfot/zoqfotc.c +++ b/sc2/src/sc2code/comm/zoqfot/zoqfotc.c @@ -52,6 +52,8 @@ static LOCDATA zoqfot_desc = 0, /* SIS_SCREEN_WIDTH, */ /* AlienTextWidth */ 0, /* AlienColorMap */ ZOQFOTPIK_MUSIC, /* AlienSong */ + 0, /* AlienAltSong */ + 0, /* AlienSongFlags */ ZOQFOTPIK_CONVERSATION_PHRASES, /* PlayerPhrases */ 3, /* NumAnimations */ { diff --git a/sc2/src/sc2code/globdata.h b/sc2/src/sc2code/globdata.h index 2c6938446..20a8ff1d1 100644 --- a/sc2/src/sc2code/globdata.h +++ b/sc2/src/sc2code/globdata.h @@ -111,6 +111,10 @@ typedef NUMBER_SPEECH_DESC *PNUMBER_SPEECH_DESC; #define NUMBER_SPEECH_DESCPTR PNUMBER_SPEECH_DESC typedef NUMBER_SPEECH_DESC *NUMBER_SPEECH; +typedef DWORD LDAS_FLAGS; +#define LDASF_NONE ((LDAS_FLAGS) 0 ) +#define LDASF_USE_ALTERNATE ((LDAS_FLAGS)(1 << 0)) + typedef struct { void (*init_encounter_func) (void); @@ -126,6 +130,8 @@ typedef struct COUNT AlienTextWidth; COLORMAP AlienColorMap; DWORD AlienSong; + PVOID AlienAltSong; + LDAS_FLAGS AlienSongFlags; STRING ConversationPhrases;