mirror of
https://github.com/1dot13/source.git
synced 2026-08-26 14:30:26 +02:00
New ability: a disguised spy can distract unalerted enemies, making it easier to sneak by.
For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=20228&goto=352562&#msg_352562 git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8528 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+88
-6
@@ -483,6 +483,86 @@ void BeginCivQuote( SOLDIERTYPE *pCiv, UINT16 ubCivQuoteID, UINT16 ubEntryID, IN
|
||||
gCivQuoteData.pCiv = pCiv;
|
||||
}
|
||||
|
||||
void BeginChatQuote( SOLDIERTYPE *pCiv, INT16 sX, INT16 sY )
|
||||
{
|
||||
VIDEO_OVERLAY_DESC VideoOverlayDesc;
|
||||
|
||||
// OK, do we have another on?
|
||||
if ( gCivQuoteData.bActive )
|
||||
{
|
||||
// Delete?
|
||||
ShutDownQuoteBox( TRUE );
|
||||
}
|
||||
|
||||
if ( pCiv->bTeam == gbPlayerNum )
|
||||
swprintf( gzCivQuote, L"\"%s\"", szChatTextSpy[Random( 24 )] );
|
||||
else
|
||||
swprintf( gzCivQuote, L"\"%s\"", szChatTextEnemy[Random( 24 )] );
|
||||
|
||||
// Create video oeverlay....
|
||||
memset( &VideoOverlayDesc, 0, sizeof( VIDEO_OVERLAY_DESC ) );
|
||||
|
||||
// Prepare text box
|
||||
gCivQuoteData.iDialogueBox = PrepareMercPopupBox( gCivQuoteData.iDialogueBox, BASIC_MERC_POPUP_BACKGROUND, BASIC_MERC_POPUP_BORDER, gzCivQuote, DIALOGUE_DEFAULT_WIDTH, 0, 0, 0, &gusCivQuoteBoxWidth, &gusCivQuoteBoxHeight );
|
||||
|
||||
// Flugente: have the box appear a bit above the soldier. Otherwise it will obstruct us from aiming at him, which is annoying if it happens very often
|
||||
sY -= 30;
|
||||
|
||||
// OK, find center for box......
|
||||
sX = sX - ( gusCivQuoteBoxWidth / 2 );
|
||||
sY = sY - ( gusCivQuoteBoxHeight / 2 );
|
||||
|
||||
// OK, limit to screen......
|
||||
{
|
||||
if ( sX < 0 )
|
||||
{
|
||||
sX = 0;
|
||||
}
|
||||
|
||||
// CHECK FOR LEFT/RIGHT
|
||||
if ( ( sX + gusCivQuoteBoxWidth ) > SCREEN_WIDTH )
|
||||
{
|
||||
sX = SCREEN_WIDTH - gusCivQuoteBoxWidth;
|
||||
}
|
||||
|
||||
// Now check for top
|
||||
if ( sY < gsVIEWPORT_WINDOW_START_Y )
|
||||
{
|
||||
sY = gsVIEWPORT_WINDOW_START_Y;
|
||||
}
|
||||
|
||||
// Check for bottom
|
||||
if ( ( sY + gusCivQuoteBoxHeight ) > ( SCREEN_HEIGHT - INV_INTERFACE_HEIGHT ) )
|
||||
{
|
||||
sY = ( SCREEN_HEIGHT - INV_INTERFACE_HEIGHT ) - gusCivQuoteBoxHeight;
|
||||
}
|
||||
}
|
||||
|
||||
VideoOverlayDesc.sLeft = sX;
|
||||
VideoOverlayDesc.sTop = sY;
|
||||
VideoOverlayDesc.sRight = VideoOverlayDesc.sLeft + gusCivQuoteBoxWidth;
|
||||
VideoOverlayDesc.sBottom = VideoOverlayDesc.sTop + gusCivQuoteBoxHeight;
|
||||
VideoOverlayDesc.sX = VideoOverlayDesc.sLeft;
|
||||
VideoOverlayDesc.sY = VideoOverlayDesc.sTop;
|
||||
VideoOverlayDesc.BltCallback = RenderCivQuoteBoxOverlay;
|
||||
|
||||
gCivQuoteData.iVideoOverlay = RegisterVideoOverlay( 0, &VideoOverlayDesc );
|
||||
|
||||
//Define main region
|
||||
MSYS_DefineRegion( &( gCivQuoteData.MouseRegion ), VideoOverlayDesc.sLeft, VideoOverlayDesc.sTop, VideoOverlayDesc.sRight, VideoOverlayDesc.sBottom, MSYS_PRIORITY_HIGHEST,
|
||||
CURSOR_NORMAL, MSYS_NO_CALLBACK, QuoteOverlayClickCallback );
|
||||
// Add region
|
||||
MSYS_AddRegion( &( gCivQuoteData.MouseRegion ) );
|
||||
|
||||
gCivQuoteData.bActive = TRUE;
|
||||
|
||||
gCivQuoteData.uiTimeOfCreation = GetJA2Clock();
|
||||
|
||||
gCivQuoteData.uiDelayTime = FindDelayForString( gzCivQuote ) + 500;
|
||||
|
||||
gCivQuoteData.pCiv = pCiv;
|
||||
}
|
||||
|
||||
UINT16 DetermineCivQuoteEntry( SOLDIERTYPE *pCiv, UINT16 *pubCivHintToUse, BOOLEAN fCanUseHints )
|
||||
{
|
||||
UINT8 ubCivType;
|
||||
@@ -878,7 +958,6 @@ void HandleCivQuote( )
|
||||
void StartCivQuote( SOLDIERTYPE *pCiv )
|
||||
{
|
||||
UINT16 ubCivQuoteID;
|
||||
INT16 sX, sY;
|
||||
UINT16 ubEntryID = 0;
|
||||
INT16 sScreenX, sScreenY;
|
||||
UINT16 ubCivHintToUse;
|
||||
@@ -975,17 +1054,15 @@ void StartCivQuote( SOLDIERTYPE *pCiv )
|
||||
// Determine location...
|
||||
// Get location of civ on screen.....
|
||||
GetSoldierScreenPos( pCiv, &sScreenX, &sScreenY );
|
||||
sX = sScreenX;
|
||||
sY = sScreenY;
|
||||
|
||||
// begin quote
|
||||
BeginCivQuote( pCiv, ubCivQuoteID, ubEntryID, sX, sY );
|
||||
BeginCivQuote( pCiv, ubCivQuoteID, ubEntryID, sScreenX, sScreenY );
|
||||
|
||||
// Increment use
|
||||
if ( ubCivQuoteID != CIV_QUOTE_HINT )
|
||||
{
|
||||
//pCiv->bCurrentCivQuoteDelta++;
|
||||
CivQuoteDelta++;
|
||||
++CivQuoteDelta;
|
||||
/*
|
||||
if ( pCiv->bCurrentCivQuoteDelta == 2 )
|
||||
{
|
||||
@@ -2010,4 +2087,9 @@ void ShowTauntPopupBox( SOLDIERTYPE *pCiv, STR16 gzTauntQuote )
|
||||
gCivQuoteData.uiDelayTime = min( gTauntsSettings.sMaxDelay , max( gTauntsSettings.sMinDelay, FindDelayForString( gzTauntQuote ) + gTauntsSettings.sModDelay ) );
|
||||
|
||||
gCivQuoteData.pCiv = pCiv;
|
||||
}
|
||||
}
|
||||
|
||||
BOOLEAN CivQuoteActive()
|
||||
{
|
||||
return gCivQuoteData.bActive;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user