Data and Source v1.13 Mod High Resolution version from 2006-03-01

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@23 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
lalien
2006-04-19 17:10:53 +00:00
parent e54aeb96aa
commit 89b4d71bf3
71 changed files with 11332 additions and 731 deletions
+5 -2
View File
@@ -1,3 +1,4 @@
// WANNE 2 <changed some lines>
#ifdef PRECOMPILEDHEADERS
#include "Tactical All.h"
#else
@@ -430,10 +431,11 @@ void AutoBandage( BOOLEAN fStart )
giBoxId = PrepareMercPopupBox( -1, DIALOG_MERC_POPUP_BACKGROUND, DIALOG_MERC_POPUP_BORDER, sAutoBandageString, 200, 40, 10, 30, &gusTextBoxWidth, &gusTextBoxHeight );
}
// WANNE 2
aRect.iTop = 0;
aRect.iLeft = 0;
aRect.iBottom = INV_INTERFACE_START_Y;
aRect.iRight = 640;
aRect.iRight = SCREEN_WIDTH;
// Determine position ( centered in rect )
gsX = (INT16)( ( ( ( aRect.iRight - aRect.iLeft ) - gusTextBoxWidth ) / 2 ) + aRect.iLeft );
@@ -725,8 +727,9 @@ void DisplayAutoBandageUpdatePanel( void )
iTotalPixelsWide = TACT_UPDATE_MERC_FACE_X_WIDTH * iNumberDoctorsWide;
// WANNE 2
// now get the x and y position for the box
sXPosition = ( 640 - iTotalPixelsWide ) / 2;
sXPosition = ( SCREEN_WIDTH - iTotalPixelsWide ) / 2;
sYPosition = ( INV_INTERFACE_START_Y - iTotalPixelsHigh ) / 2;
+7 -2
View File
@@ -1,3 +1,4 @@
// WANNE 2 <changed some lines>
#ifdef PRECOMPILEDHEADERS
#include "Tactical All.h"
#else
@@ -60,8 +61,12 @@ UINT8 CalcImportantSectorControl( void );
// give pSoldier usNumChances to improve ubStat. If it's from training, it doesn't count towards experience level gain
void StatChange(SOLDIERTYPE *pSoldier, UINT8 ubStat, UINT16 usNumChances, UINT8 ubReason)
{
Assert(pSoldier != NULL);
Assert(pSoldier->bActive);
// WANNE 2
if (pSoldier == NULL || pSoldier->bActive == FALSE)
return; // THIS SHOULD NEVER HAPPEN
//Assert(pSoldier != NULL);
//Assert(pSoldier->bActive);
// ignore non-player soldiers
if (!PTR_OURTEAM)
+5 -4
View File
@@ -1,3 +1,4 @@
// WANNE 2 <changed some lines>
#ifdef PRECOMPILEDHEADERS
#include "Tactical All.h"
#endif
@@ -380,9 +381,9 @@ void BeginCivQuote( SOLDIERTYPE *pCiv, UINT8 ubCivQuoteID, UINT8 ubEntryID, INT1
}
// CHECK FOR LEFT/RIGHT
if ( ( sX + gusCivQuoteBoxWidth ) > 640 )
if ( ( sX + gusCivQuoteBoxWidth ) > SCREEN_WIDTH )
{
sX = 640 - gusCivQuoteBoxWidth;
sX = SCREEN_WIDTH - gusCivQuoteBoxWidth;
}
// Now check for top
@@ -392,9 +393,9 @@ void BeginCivQuote( SOLDIERTYPE *pCiv, UINT8 ubCivQuoteID, UINT8 ubEntryID, INT1
}
// Check for bottom
if ( ( sY + gusCivQuoteBoxHeight ) > 340 )
if ( ( sY + gusCivQuoteBoxHeight ) > (SCREEN_HEIGHT - INV_INTERFACE_HEIGHT))
{
sY = 340 - gusCivQuoteBoxHeight;
sY = (SCREEN_HEIGHT - INV_INTERFACE_HEIGHT) - gusCivQuoteBoxHeight;
}
}
+9
View File
@@ -1,3 +1,4 @@
// WANNE 2 <changed some lines>
#ifdef PRECOMPILEDHEADERS
#include "Tactical All.h"
#include "PreBattle Interface.h"
@@ -1977,6 +1978,8 @@ void ExecuteTacticalTextBox( INT16 sLeftPosition, STR16 pString )
VIDEO_OVERLAY_DESC VideoOverlayDesc;
// check if mouse region created, if so, do not recreate
// WANNE 2
if( fTextBoxMouseRegionCreated == TRUE )
{
return;
@@ -2003,6 +2006,12 @@ void ExecuteTacticalTextBox( INT16 sLeftPosition, STR16 pString )
gsTopPosition = 20;
// WANNE 2
//if( fTextBoxMouseRegionCreated == TRUE )
//{
// return;
//}
//Define main region
MSYS_DefineRegion( &gTextBoxMouseRegion, VideoOverlayDesc.sLeft, VideoOverlayDesc.sTop, VideoOverlayDesc.sRight, VideoOverlayDesc.sBottom, MSYS_PRIORITY_HIGHEST,
CURSOR_NORMAL, MSYS_NO_CALLBACK, TextOverlayClickCallback );
+2 -2
View File
@@ -434,7 +434,7 @@ INT8 CalcCoverForGridNoBasedOnTeamKnownEnemies( SOLDIERTYPE *pSoldier, INT16 sTa
}
usRange = (UINT16)GetRangeInCellCoordsFromGridNoDiff( pOpponent->sGridNo, sTargetGridNo );
usSightLimit = DistanceVisible( pOpponent, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, sTargetGridNo, pSoldier->bLevel );
usSightLimit = DistanceVisible( pOpponent, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, sTargetGridNo, pSoldier->bLevel, pSoldier );
if( usRange > ( usSightLimit * CELL_X_SIZE ) )
{
@@ -933,7 +933,7 @@ INT8 CalcIfSoldierCanSeeGridNo( SOLDIERTYPE *pSoldier, INT16 sTargetGridNo, BOOL
}
usSightLimit = DistanceVisible( pSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, sTargetGridNo, fRoof );
usSightLimit = DistanceVisible( pSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, sTargetGridNo, fRoof, pSoldier );
//
// Prone
+2 -2
View File
@@ -163,7 +163,7 @@ void HandleDeidrannaDeath( SOLDIERTYPE *pKillerSoldier, INT16 sGridNo, INT8 bLev
if ( QuoteExp_WitnessDeidrannaDeath[ pTeamSoldier->ubProfile ] )
{
// Can we see location?
sDistVisible = DistanceVisible( pTeamSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, sGridNo, bLevel );
sDistVisible = DistanceVisible( pTeamSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, sGridNo, bLevel, pTeamSoldier );
if ( SoldierTo3DLocationLineOfSightTest( pTeamSoldier, sGridNo, bLevel, 3, (UINT8) sDistVisible, TRUE ) )
{
@@ -454,7 +454,7 @@ void HandleQueenBitchDeath( SOLDIERTYPE *pKillerSoldier, INT16 sGridNo, INT8 bLe
if ( QuoteExp_WitnessQueenBugDeath[ pTeamSoldier->ubProfile ] )
{
// Can we see location?
sDistVisible = DistanceVisible( pTeamSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, sGridNo, bLevel );
sDistVisible = DistanceVisible( pTeamSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, sGridNo, bLevel, pTeamSoldier );
if ( SoldierTo3DLocationLineOfSightTest( pTeamSoldier, sGridNo, bLevel, 3, (UINT8) sDistVisible, TRUE ) )
{
+7 -2
View File
@@ -452,7 +452,12 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, UINT16 usGridNo, INT8 bLevel, UINT16 us
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("HandleItem: auto fire - setting dice sides, marksmanship = %d",pSoldier->bMarksmanship));
//UINT32 diceSides = RAND_MAX;
//Madd: tried to make this more marksmanship dependent than agility, a level 10 auto-weapons specialist with 100 in all stats was wasting wayyy too many APs on this fucker
UINT32 diceSides = RAND_MAX / ( max(1,pSoldier->bMarksmanship) / 10) ;
//UINT32 diceSides = RAND_MAX / ( max(1,pSoldier->bMarksmanship) / 10) ;
//Kaiden: Had to change the minimum value to 10 instead of 1,
//Rounding down resulted in division by zero and caused a crash.
UINT32 diceSides = RAND_MAX / ( max(10,pSoldier->bMarksmanship) / 10) ;
DOUBLE avgAPadded = max(((400.0f-2.0f*pSoldier->bAgility))*(63.0f-5.0f*(pSoldier->bExpLevel+2.0f*NUM_SKILL_TRAITS( pSoldier, AUTO_WEAPS )))/2700.0f,1); //Important! don't make this zero, the formulae don't like it.
UINT32 chanceToMisfire = (UINT32)(((DOUBLE)diceSides*(2.0f*avgAPadded+1.0f-sqrt(4.0f*avgAPadded+1.0f)))/(2.0f*avgAPadded)); //derive the chace to misfire from the desired average AP overspent, derived suing
UINT32 chanceToMisfireDry = (UINT32)(((DOUBLE)diceSides*(avgAPadded+1.0f-sqrt(2.0f*avgAPadded+1.0f)))/(avgAPadded)); //chance to misfire if weapon is dry. Designed to waste avgAPadded/2 APs
@@ -4973,7 +4978,7 @@ void TestPotentialOwner( SOLDIERTYPE * pSoldier )
{
if ( pSoldier->bActive && pSoldier->bInSector && pSoldier->bLife >= OKLIFE )
{
if ( SoldierToSoldierLineOfSightTest( pSoldier, gpTempSoldier, (UINT8) DistanceVisible( pSoldier, DIRECTION_IRRELEVANT, 0, gpTempSoldier->sGridNo, gpTempSoldier->bLevel ), TRUE ) )
if ( SoldierToSoldierLineOfSightTest( pSoldier, gpTempSoldier, (UINT8) DistanceVisible( pSoldier, DIRECTION_IRRELEVANT, 0, gpTempSoldier->sGridNo, gpTempSoldier->bLevel, gpTempSoldier ), TRUE ) )
{
MakeNPCGrumpyForMinorOffense( pSoldier, gpTempSoldier );
}
+3 -3
View File
@@ -4669,7 +4669,7 @@ UINT32 UIHandleTOnTerrain( UI_EVENT *pUIEvent )
//ATE: Check if we have good LOS
// is he close enough to see that gridno if he turns his head?
sDistVisible = DistanceVisible( pSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, sTargetGridNo, pSoldier->bLevel );
sDistVisible = DistanceVisible( pSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, sTargetGridNo, pSoldier->bLevel, pSoldier );
if ( uiRange <= NPC_TALK_RADIUS )
@@ -5484,7 +5484,7 @@ BOOLEAN HandleTalkInit( )
{
//ATE: Check if we have good LOS
// is he close enough to see that gridno if he turns his head?
sDistVisible = DistanceVisible( pSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, pTSoldier->sGridNo, pTSoldier->bLevel );
sDistVisible = DistanceVisible( pSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, pTSoldier->sGridNo, pTSoldier->bLevel, pTSoldier );
// Check LOS!
if ( !SoldierTo3DLocationLineOfSightTest( pSoldier, pTSoldier->sGridNo, pTSoldier->bLevel, 3, (UINT8) sDistVisible, TRUE ) )
@@ -6150,7 +6150,7 @@ BOOLEAN ValidQuickExchangePosition( )
if ( PythSpacesAway( pSoldier->sGridNo, pOverSoldier->sGridNo ) == 1 )
{
// Check if we have LOS to them....
sDistVisible = DistanceVisible( pSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, pOverSoldier->sGridNo, pOverSoldier->bLevel );
sDistVisible = DistanceVisible( pSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, pOverSoldier->sGridNo, pOverSoldier->bLevel, pOverSoldier );
if ( SoldierTo3DLocationLineOfSightTest( pSoldier, pOverSoldier->sGridNo, pOverSoldier->bLevel, (UINT8)3, (UINT8) sDistVisible, TRUE ) )
{
+40 -43
View File
@@ -1,3 +1,4 @@
// WANNE 2 <changed some lines>
#ifdef PRECOMPILEDHEADERS
#include "Tactical All.h"
#include "language defines.h"
@@ -1062,37 +1063,6 @@ void INVRenderINVPanelItem( SOLDIERTYPE *pSoldier, INT16 sPocket, UINT8 fDirtyLe
{
// CHECK FOR COMPATIBILITY WITH MAGAZINES
/* OLD VERSION OF GUN/AMMO MATCH HIGHLIGHTING
UINT32 uiDestPitchBYTES;
UINT8 *pDestBuf;
UINT16 usLineColor;
if ( ( Item [ pSoldier->inv[ HANDPOS ].usItem ].usItemClass & IC_GUN ) && ( Item[ pObject->usItem ].usItemClass & IC_AMMO ) )
{
// CHECK
if (Weapon[pSoldier->inv[ HANDPOS ].usItem].ubCalibre == Magazine[Item[pObject->usItem].ubClassIndex].ubCalibre )
{
// IT's an OK calibre ammo, do something!
// Render Item with specific color
//fOutline = TRUE;
//sOutlineColor = Get16BPPColor( FROMRGB( 96, 104, 128 ) );
//sOutlineColor = Get16BPPColor( FROMRGB( 20, 20, 120 ) );
// Draw rectangle!
pDestBuf = LockVideoSurface( guiSAVEBUFFER, &uiDestPitchBYTES );
SetClippingRegionAndImageWidth( uiDestPitchBYTES, 0, 0, 640, 480 );
//usLineColor = Get16BPPColor( FROMRGB( 255, 255, 0 ) );
usLineColor = Get16BPPColor( FROMRGB( 230, 215, 196 ) );
RectangleDraw( TRUE, (sX+1), (sY+1), (sX + gSMInvData[ sPocket ].sWidth - 2 ),( sY + gSMInvData[ sPocket ].sHeight - 2 ), usLineColor, pDestBuf );
SetClippingRegionAndImageWidth( uiDestPitchBYTES, 0, 0, 640, 480 );
UnLockVideoSurface( guiSAVEBUFFER );
}
}
*/
if ( gbCompatibleAmmo[ sPocket ] )
{
fOutline = TRUE;
@@ -4913,7 +4883,7 @@ BOOLEAN HandleItemPointerClick( UINT16 usMapPos )
return( FALSE );
}
sDistVisible = DistanceVisible( pSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, gpItemPointerSoldier->sGridNo, gpItemPointerSoldier->bLevel );
sDistVisible = DistanceVisible( pSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, gpItemPointerSoldier->sGridNo, gpItemPointerSoldier->bLevel, gpItemPointerSoldier );
// Check LOS....
if ( !SoldierTo3DLocationLineOfSightTest( pSoldier, gpItemPointerSoldier->sGridNo, gpItemPointerSoldier->bLevel, 3, (UINT8) sDistVisible, TRUE ) )
@@ -7221,15 +7191,34 @@ void GetHelpTextForItem( INT16 * pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldi
}
else if ( usItem != NOTHING )
{
if ( !gGameOptions.fGunNut && Item[ usItem ].usItemClass == IC_GUN && !Item[usItem].rocketlauncher && !Item[usItem].rocketrifle )
// Retrieve the status of the items
// Find the minimum status value - not just the first one
INT16 sValue = pObject->bStatus[ 0 ];
INT16 i;
for(i = 1; i < pObject->ubNumberOfObjects; i++)
{
swprintf( (wchar_t *)pStr, L"%s (%s)", ItemNames[ usItem ], AmmoCaliber[ Weapon[ usItem ].ubCalibre ] );
}
else
{
swprintf( (wchar_t *)pStr, L"%s", ItemNames[ usItem ] );
if(pObject->bStatus[ i ] < sValue)
{
sValue = pObject->bStatus[ i ];
}
}
// The first tool tip is for rocket rifles
if ( !gGameOptions.fGunNut && Item[ usItem ].usItemClass == IC_GUN && !Item[usItem].rocketlauncher && !Item[usItem].rocketrifle )
{
swprintf( (wchar_t *)pStr, L"%s (%s) [%d%%]", ItemNames[ usItem ], AmmoCaliber[ Weapon[ usItem ].ubCalibre ], sValue );
}
// The next is for ammunition which gets the measurement 'rnds'
else if (Item[ usItem ].usItemClass == IC_AMMO)
{
swprintf( (wchar_t *)pStr, L"%s [%d rnds]", ItemNames[ usItem ], sValue );
}
// The final, and typical case, is that of an item with a percent status
else
{
swprintf( (wchar_t *)pStr, L"%s [%d%%]", ItemNames[ usItem ], sValue );
}
if ( ( Item[pObject->usItem].fingerprintid ) && pObject->ubImprintID < NO_PROFILE )
{
INT16 pStr2[20];
@@ -7531,9 +7520,10 @@ BOOLEAN InitializeStealItemPickupMenu( SOLDIERTYPE *pSoldier, SOLDIERTYPE *pOppo
}
// CHECK FOR LEFT/RIGHT
if ( ( sX + gItemPickupMenu.sWidth ) > 640 )
// WANNE 2
if ( ( sX + gItemPickupMenu.sWidth ) > SCREEN_WIDTH )
{
sX = 640 - gItemPickupMenu.sWidth - ITEMPICK_START_X_OFFSET;
sX = SCREEN_WIDTH - gItemPickupMenu.sWidth - ITEMPICK_START_X_OFFSET;
}
else
{
@@ -7552,9 +7542,10 @@ BOOLEAN InitializeStealItemPickupMenu( SOLDIERTYPE *pSoldier, SOLDIERTYPE *pOppo
}
// Check for bottom
if ( ( sY + gItemPickupMenu.sHeight ) > 340 )
// WANNE 2
if ( ( sY + gItemPickupMenu.sHeight ) > (SCREEN_HEIGHT - INV_INTERFACE_HEIGHT) )
{
sY = 340 - gItemPickupMenu.sHeight;
sY = (SCREEN_HEIGHT - INV_INTERFACE_HEIGHT) - gItemPickupMenu.sHeight;
}
}
@@ -7580,8 +7571,14 @@ BOOLEAN InitializeStealItemPickupMenu( SOLDIERTYPE *pSoldier, SOLDIERTYPE *pOppo
// Build a mouse region here that is over any others.....
MSYS_DefineRegion( &(gItemPickupMenu.BackRegion ), (INT16)( 532 ), (INT16)( 367 ), (INT16)( 640 ),(INT16)( 480 ), MSYS_PRIORITY_HIGHEST,
/*MSYS_DefineRegion( &(gItemPickupMenu.BackRegion ), (INT16)( 532 ), (INT16)( 367 ), (INT16)( 640 ),(INT16)( 480 ), MSYS_PRIORITY_HIGHEST,
CURSOR_NORMAL, MSYS_NO_CALLBACK, MSYS_NO_CALLBACK ); */
// WANNE 2
// Build a mouse region here that is over any others.....
MSYS_DefineRegion( &(gItemPickupMenu.BackRegion ), (INT16)( iScreenWidthOffset + 532 ), (INT16)( iScreenHeightOffset + 367 ), (INT16)( SCREEN_WIDTH ),(INT16)( SCREEN_HEIGHT ), MSYS_PRIORITY_HIGHEST,
CURSOR_NORMAL, MSYS_NO_CALLBACK, MSYS_NO_CALLBACK );
// Add region
MSYS_AddRegion( &(gItemPickupMenu.BackRegion ) );
+26 -18
View File
@@ -1,3 +1,4 @@
// WANNE 2 <changed some lines>
#ifdef PRECOMPILEDHEADERS
#include "Tactical All.h"
#else
@@ -312,7 +313,7 @@ int INTERFACE_CLOCK_X;
int INTERFACE_CLOCK_Y;
int LOCATION_NAME_X;
int LOCATION_NAME_Y;
typedef enum
{
@@ -561,7 +562,7 @@ void CheckForDisabledForGiveItem( )
{
sDist = PythSpacesAway( gpSMCurrentMerc->sGridNo, pSoldier->sGridNo );
sDistVisible = DistanceVisible( pSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, gpSMCurrentMerc->sGridNo, gpSMCurrentMerc->bLevel );
sDistVisible = DistanceVisible( pSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, gpSMCurrentMerc->sGridNo, gpSMCurrentMerc->bLevel, gpSMCurrentMerc );
// Check LOS....
if ( SoldierTo3DLocationLineOfSightTest( pSoldier, gpSMCurrentMerc->sGridNo, gpSMCurrentMerc->bLevel, 3, (UINT8) sDistVisible, TRUE ) )
@@ -596,7 +597,7 @@ void CheckForDisabledForGiveItem( )
sDist = PythSpacesAway( MercPtrs[ ubSrcSoldier ]->sGridNo, sDestGridNo );
// is he close enough to see that gridno if he turns his head?
sDistVisible = DistanceVisible( MercPtrs[ ubSrcSoldier ], DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, sDestGridNo, bDestLevel );
sDistVisible = DistanceVisible( MercPtrs[ ubSrcSoldier ], DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, sDestGridNo, bDestLevel, MercPtrs[ ubSrcSoldier ] );
// Check LOS....
if ( SoldierTo3DLocationLineOfSightTest( MercPtrs[ ubSrcSoldier ], sDestGridNo, bDestLevel, 3, (UINT8) sDistVisible, TRUE ) )
@@ -1316,9 +1317,11 @@ BOOLEAN InitializeSMPanelCoords( )
SM_LOOKB_Y = ( 108 + INV_INTERFACE_START_Y );
SM_STEALTHMODE_X = ( 187 + INTERFACE_START_X );
SM_STEALTHMODE_Y = ( 73 + INV_INTERFACE_START_Y );
SM_DONE_X = ( 543 + INTERFACE_START_X );
// WANNE 2
SM_DONE_X = (SCREEN_WIDTH - 97);//( 543 + INTERFACE_START_X );
SM_DONE_Y = ( 4 + INV_INTERFACE_START_Y );
SM_MAPSCREEN_X = ( 589 + INTERFACE_START_X );
SM_MAPSCREEN_X = (SCREEN_WIDTH - 51);//( 589 + INTERFACE_START_X );
SM_MAPSCREEN_Y = ( 4 + INV_INTERFACE_START_Y );
SM_POSITIONB_X = ( 106 + INTERFACE_START_X );
@@ -1382,9 +1385,9 @@ BOOLEAN InitializeSMPanelCoords( )
STATS_TEXT_FONT_COLOR = 5;
// ow and te clock and location i will put it here
INTERFACE_CLOCK_X = ( 554 + INTERFACE_START_X );
INTERFACE_CLOCK_X = (SCREEN_WIDTH - 86); //( 554 + INTERFACE_START_X );
INTERFACE_CLOCK_Y = ( 119 + INV_INTERFACE_START_Y );
LOCATION_NAME_X = ( 548 + INTERFACE_START_X );
LOCATION_NAME_X = (SCREEN_WIDTH - 92); //( 548 + INTERFACE_START_X );
LOCATION_NAME_Y = ( 65 + INTERFACE_START_Y );
// so we got everything "dynamic" now we just return TRUE
@@ -3486,6 +3489,7 @@ void BtnPositionShowCallback(GUI_BUTTON *btn,INT32 reason)
}
// WANNE 2
BOOLEAN InitializeTEAMPanelCoords( )
{
@@ -3494,11 +3498,12 @@ BOOLEAN InitializeTEAMPanelCoords( )
TM_APPANEL_HEIGHT = 56;
TM_APPANEL_WIDTH = 16;
TM_ENDTURN_X = ( 507 + INTERFACE_START_X );
// WANNE 2
TM_ENDTURN_X = (SCREEN_WIDTH - 133); //( 507 + INTERFACE_START_X );
TM_ENDTURN_Y = ( 9 + INTERFACE_START_Y );
TM_ROSTERMODE_X = ( 507 + INTERFACE_START_X );
TM_ROSTERMODE_X = (SCREEN_WIDTH - 133); //( 507 + INTERFACE_START_X );
TM_ROSTERMODE_Y = ( 45 + INTERFACE_START_Y );
TM_DISK_X = ( 507 + INTERFACE_START_X );
TM_DISK_X = (SCREEN_WIDTH - 133); //( 507 + INTERFACE_START_X );
TM_DISK_Y = ( 81 + INTERFACE_START_Y );
TM_NAME_WIDTH = 60;
@@ -3606,6 +3611,9 @@ BOOLEAN InitializeTEAMPanel( )
UINT32 cnt, posIndex;
static BOOLEAN fFirstTime = TRUE;
// WANNE 2
fDisplayOverheadMap = TRUE;
/* OK i need to initialize coords here
* Isnt it cool
* any questions? joker
@@ -3716,6 +3724,7 @@ BOOLEAN InitializeTEAMPanel( )
// Add user data
MSYS_SetRegionUserData( &gTEAM_SecondHandInv[ cnt ], 0, cnt );
}
@@ -3784,6 +3793,7 @@ void RenderTEAMPanel( BOOLEAN fDirty )
SOLDIERTYPE *pSoldier;
static INT16 pStr[ 200 ], pMoraleStr[ 20 ];
// WANNE 2 <new>
if ( fDirty == DIRTYLEVEL2 )
{
MarkAButtonDirty( iTEAMPanelButtons[ TEAM_DONE_BUTTON ] );
@@ -3792,12 +3802,10 @@ void RenderTEAMPanel( BOOLEAN fDirty )
// Blit video surface
//if(gbPixelDepth==16)
//{
BltVideoObjectFromIndex( guiSAVEBUFFER, guiTEAMPanel, 0, INTERFACE_START_X, INTERFACE_START_Y, VO_BLT_SRCTRANSPARENCY, NULL );
//}
RestoreExternBackgroundRect( INTERFACE_START_X, INTERFACE_START_Y, SCREEN_WIDTH - INTERFACE_START_X , INTERFACE_HEIGHT );
BltVideoObjectFromIndex( guiSAVEBUFFER, guiTEAMPanel, 0, INTERFACE_START_X, INTERFACE_START_Y, VO_BLT_SRCTRANSPARENCY, NULL );
RestoreExternBackgroundRect( INTERFACE_START_X, INTERFACE_START_Y, SCREEN_WIDTH - INTERFACE_START_X , INTERFACE_HEIGHT );
// WANNE 2 <new> <begin>
// LOOP THROUGH ALL MERCS ON TEAM PANEL
for ( cnt = 0, posIndex = 0; cnt < NUM_TEAM_SLOTS; cnt++, posIndex+= 2 )
{
@@ -4039,10 +4047,10 @@ void RenderTEAMPanel( BOOLEAN fDirty )
}
}
}
UpdateTEAMPanel( );
if( fRenderRadarScreen == TRUE )
{
// Render clock
+4 -4
View File
@@ -253,7 +253,7 @@ void GenerateRandomEquipment( SOLDIERCREATE_STRUCT *pp, INT8 bSoldierClass, INT8
{
case SOLDIER_CLASS_NONE:
// ammo is here only so that civilians with pre-assigned ammo will get some clips for it!
bAmmoClips = (INT8)(1 + Random( 2 ));
bAmmoClips = (INT8)(2 + Random( 2 ));
// civilians get nothing, anyone who should get something should be preassigned by Linda
break;
@@ -274,7 +274,7 @@ void GenerateRandomEquipment( SOLDIERCREATE_STRUCT *pp, INT8 bSoldierClass, INT8
if( Random( 2 ) )
bKnifeClass = bRating;
bAmmoClips = (INT8)(2 + Random( 2 ));
bAmmoClips = (INT8)(3 + Random( 2 ));
if( bRating >= GOOD_ADMINISTRATOR_EQUIPMENT_RATING )
{
@@ -316,7 +316,7 @@ void GenerateRandomEquipment( SOLDIERCREATE_STRUCT *pp, INT8 bSoldierClass, INT8
bAttachClass = bRating;
}
bAmmoClips = (INT8)(2 + Random( 2 ));
bAmmoClips = (INT8)(3 + Random( 2 ));
if( bRating >= AVERAGE_ARMY_EQUIPMENT_RATING )
{
@@ -429,7 +429,7 @@ void GenerateRandomEquipment( SOLDIERCREATE_STRUCT *pp, INT8 bSoldierClass, INT8
}
bAmmoClips = (INT8)(3 + Random( 2 ));
bGrenades = (INT8)(1 + Random( 3 ));
bGrenades = (INT8)(3 + Random( 3 ));
if( ( bRating >= AVERAGE_ELITE_EQUIPMENT_RATING ) && ( Random( 100 ) < 75 ) )
{
+3 -3
View File
@@ -1309,7 +1309,7 @@ BOOLEAN AllMercsLookForDoor( INT16 sGridNo, BOOLEAN fUpdateValue )
if ( pSoldier->bLife >= OKLIFE && pSoldier->sGridNo != NOWHERE && pSoldier->bActive && pSoldier->bInSector )
{
// is he close enough to see that gridno if he turns his head?
sDistVisible = DistanceVisible( pSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, sGridNo, 0 );
sDistVisible = DistanceVisible( pSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, sGridNo, 0, pSoldier );
if (PythSpacesAway( pSoldier->sGridNo, sGridNo ) <= sDistVisible )
{
@@ -1330,7 +1330,7 @@ BOOLEAN AllMercsLookForDoor( INT16 sGridNo, BOOLEAN fUpdateValue )
for ( cnt2 = 0; cnt2 < 8; cnt2++ )
{
usNewGridNo = NewGridNo( sGridNo, DirectionInc( bDirs[ cnt2 ] ) );
sDistVisible = DistanceVisible( pSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, usNewGridNo, 0 );
sDistVisible = DistanceVisible( pSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, usNewGridNo, 0, pSoldier );
if (PythSpacesAway( pSoldier->sGridNo, usNewGridNo ) <= sDistVisible )
{
@@ -1378,7 +1378,7 @@ BOOLEAN MercLooksForDoors( SOLDIERTYPE *pSoldier, BOOLEAN fUpdateValue )
sGridNo = pDoorStatus->sGridNo;
// is he close enough to see that gridno if he turns his head?
sDistVisible = DistanceVisible( pSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, sGridNo, 0 );
sDistVisible = DistanceVisible( pSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, sGridNo, 0, pSoldier );
if ( PythSpacesAway( pSoldier->sGridNo, sGridNo ) <= sDistVisible )
{
+2
View File
@@ -7123,6 +7123,8 @@ BOOLEAN ProcessImplicationsOfPCAttack( SOLDIERTYPE * pSoldier, SOLDIERTYPE ** pp
if ( pTarget->ubProfile == NO_PROFILE || !(gMercProfiles[ pTarget->ubProfile ].ubMiscFlags3 & PROFILE_MISC_FLAG3_TOWN_DOESNT_CARE_ABOUT_DEATH) )
{
//Kaiden: Added to keep Militia from going Hostile if you attack a Crow or Cow with an explosive.
if ( (pTarget->ubBodyType != CROW) && (pTarget->ubBodyType != COW) )
// militia, if any, turn hostile
MilitiaChangesSides();
}
+2 -2
View File
@@ -1210,7 +1210,7 @@ void AllMercsOnTeamLookForCorpse( ROTTING_CORPSE *pCorpse, INT8 bTeam )
if ( pSoldier->bLife >= OKLIFE && pSoldier->sGridNo != NOWHERE && pSoldier->bActive && pSoldier->bInSector )
{
// is he close enough to see that gridno if he turns his head?
sDistVisible = DistanceVisible( pSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, sGridNo, pCorpse->def.bLevel );
sDistVisible = DistanceVisible( pSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, sGridNo, pCorpse->def.bLevel, pSoldier );
if (PythSpacesAway( pSoldier->sGridNo, sGridNo ) <= sDistVisible )
{
@@ -1274,7 +1274,7 @@ void MercLooksForCorpses( SOLDIERTYPE *pSoldier )
sGridNo = pCorpse->def.sGridNo;
// is he close enough to see that gridno if he turns his head?
sDistVisible = DistanceVisible( pSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, sGridNo, pCorpse->def.bLevel );
sDistVisible = DistanceVisible( pSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, sGridNo, pCorpse->def.bLevel, pSoldier );
if (PythSpacesAway( pSoldier->sGridNo, sGridNo ) <= sDistVisible )
{
+119 -97
View File
@@ -1,3 +1,4 @@
// WANNE 2 <changed some lines>
#ifdef PRECOMPILEDHEADERS
#include "Tactical All.h"
#else
@@ -79,6 +80,13 @@ SKIRGBCOLOR SkiGlowColorsA[]={
//
///////////////////////////////////////////
// WANNE 2
#define SKI_INTERFACE_WIDTH 536
#define SKI_INTERFACE_HEIGHT 340
#define SCREEN_X_OFFSET (((SCREEN_WIDTH - SKI_INTERFACE_WIDTH) / 2))
#define SCREEN_Y_OFFSET ((((SCREEN_HEIGHT - INV_INTERFACE_HEIGHT) - (SKI_INTERFACE_HEIGHT)) / 2))
#define SKI_BUTTON_FONT MILITARYFONT1//FONT14ARIAL
#define SKI_BUTTON_COLOR 73
@@ -96,50 +104,50 @@ SKIRGBCOLOR SkiGlowColorsA[]={
#define SKIT_NUMBER_FONT BLOCKFONT2
#define SKI_MAIN_BACKGROUND_X 0
#define SKI_MAIN_BACKGROUND_Y 0
#define SKI_MAIN_BACKGROUND_X SCREEN_X_OFFSET
#define SKI_MAIN_BACKGROUND_Y SCREEN_Y_OFFSET
#define SKI_FACE_X 13
#define SKI_FACE_Y 13
#define SKI_FACE_X (SCREEN_X_OFFSET + 13)
#define SKI_FACE_Y (SCREEN_Y_OFFSET + 13)
#define SKI_FACE_WIDTH 90
#define SKI_FACE_HEIGHT 100
#define SKI_PAGE_UP_ARROWS_X 121
#define SKI_PAGE_UP_ARROWS_Y 35
#define SKI_PAGE_UP_ARROWS_X (SCREEN_X_OFFSET + 121)
#define SKI_PAGE_UP_ARROWS_Y (SCREEN_Y_OFFSET + 35)
#define SKI_PAGE_DOWN_ARROWS_X SKI_PAGE_UP_ARROWS_X
#define SKI_PAGE_DOWN_ARROWS_Y 102
#define SKI_PAGE_DOWN_ARROWS_Y (SCREEN_Y_OFFSET + 102)
//Evaluate:
//#define SKI_EVALUATE_BUTTON_X 15
//#define SKI_EVALUATE_BUTTON_Y 233
#define SKI_TRANSACTION_BUTTON_X 147//214
#define SKI_TRANSACTION_BUTTON_Y 233//SKI_EVALUATE_BUTTON_Y
#define SKI_TRANSACTION_BUTTON_X (SCREEN_X_OFFSET + 147)//214
#define SKI_TRANSACTION_BUTTON_Y (SCREEN_Y_OFFSET +233)//SKI_EVALUATE_BUTTON_Y
#define SKI_DONE_BUTTON_X 292//414
#define SKI_DONE_BUTTON_Y 233//SKI_EVALUATE_BUTTON_Y
#define SKI_DONE_BUTTON_X (SCREEN_X_OFFSET + 292)//414
#define SKI_DONE_BUTTON_Y (SCREEN_Y_OFFSET + 233)//SKI_EVALUATE_BUTTON_Y
#define SKI_MAIN_TITLE_X 112
#define SKI_MAIN_TITLE_Y 12
#define SKI_MAIN_TITLE_X (SCREEN_X_OFFSET + 112)
#define SKI_MAIN_TITLE_Y (SCREEN_Y_OFFSET + 12)
#define SKI_MAIN_TITLE_WIDTH 420
#define SKI_TOTAL_COST_X 9
#define SKI_TOTAL_COST_Y 162//159
#define SKI_TOTAL_COST_X (SCREEN_X_OFFSET + 9)
#define SKI_TOTAL_COST_Y (SCREEN_Y_OFFSET + 162)//159
#define SKI_TOTAL_COST_WIDTH 73
#define SKI_TOTAL_VALUE_X SKI_TOTAL_COST_X
#define SKI_TOTAL_VALUE_Y 291//268
#define SKI_TOTAL_VALUE_Y (SCREEN_Y_OFFSET + 291)//268
#define SKI_TOTAL_VALUE_WIDTH SKI_TOTAL_COST_WIDTH
#define SKI_PLAYERS_CURRENT_BALANCE_X SKI_TOTAL_COST_X
#define SKI_PLAYERS_CURRENT_BALANCE_Y 235
#define SKI_PLAYERS_CURRENT_BALANCE_WIDTH SKI_TOTAL_COST_WIDTH
#define SKI_PLAYERS_CURRENT_BALANCE_OFFSET_TO_VALUE 265
#define SKI_PLAYERS_CURRENT_BALANCE_X SKI_TOTAL_COST_X
#define SKI_PLAYERS_CURRENT_BALANCE_Y (SCREEN_Y_OFFSET + 235)
#define SKI_PLAYERS_CURRENT_BALANCE_WIDTH SKI_TOTAL_COST_WIDTH
#define SKI_PLAYERS_CURRENT_BALANCE_OFFSET_TO_VALUE SCREEN_Y_OFFSET + 265
#define SKI_PAGE_X 112
#define SKI_PAGE_Y 70
#define SKI_PAGE_X (SCREEN_X_OFFSET + 112)
#define SKI_PAGE_Y (SCREEN_Y_OFFSET + 70)
#define SKI_PAGE_WIDTH 45
#define SKI_PAGE_HEIGHT 27
@@ -166,49 +174,48 @@ SKIRGBCOLOR SkiGlowColorsA[]={
#define SKI_GLOW_DELAY 70
//Start Locations for the inventory boxes
#define SKI_ARMS_DEALERS_INV_START_X 165
#define SKI_ARMS_DEALERS_INV_START_Y 30
#define SKI_ARMS_DEALERS_INV_START_X (SCREEN_X_OFFSET + 165)
#define SKI_ARMS_DEALERS_INV_START_Y (SCREEN_Y_OFFSET + 30)
#define SKI_ARMS_DEALERS_TRADING_INV_X 91
#define SKI_ARMS_DEALERS_TRADING_INV_Y 151
#define SKI_ARMS_DEALERS_TRADING_INV_X (SCREEN_X_OFFSET + 91)
#define SKI_ARMS_DEALERS_TRADING_INV_Y (SCREEN_Y_OFFSET + 151)
#define SKI_ARMS_DEALERS_TRADING_INV_WIDTH 436
#define SKI_ARMS_DEALERS_TRADING_INV_HEIGHT 67
#define SKI_PLAYERS_TRADING_INV_X 91
#define SKI_PLAYERS_TRADING_INV_Y 266
#define SKI_PLAYERS_TRADING_INV_X (SCREEN_X_OFFSET + 91)
#define SKI_PLAYERS_TRADING_INV_Y (SCREEN_Y_OFFSET + 266)
#define SKI_PLAYERS_TRADING_INV_HEIGHT 70
#define SKI_PLAYERS_TRADING_INV_WIDTH 440
#define SKI_ARMS_DEALER_TOTAL_COST_X 16
#define SKI_ARMS_DEALER_TOTAL_COST_Y 194//191
#define SKI_ARMS_DEALER_TOTAL_COST_X (SCREEN_X_OFFSET + 16)
#define SKI_ARMS_DEALER_TOTAL_COST_Y (SCREEN_Y_OFFSET + 194)//191
#define SKI_ARMS_DEALER_TOTAL_COST_WIDTH 59
#define SKI_ARMS_DEALER_TOTAL_COST_HEIGHT 20
#define SKI_PLAYERS_TOTAL_VALUE_X 16
#define SKI_PLAYERS_TOTAL_VALUE_Y 310//308
#define SKI_PLAYERS_TOTAL_VALUE_X (SCREEN_X_OFFSET + 16)
#define SKI_PLAYERS_TOTAL_VALUE_Y (SCREEN_Y_OFFSET + 310)//308
#define SKI_PLAYERS_TOTAL_VALUE_WIDTH 59
#define SKI_PLAYERS_TOTAL_VALUE_HEIGHT 20
#define SKI_TACTICAL_BACKGROUND_START_X 536
#define SKI_TACTICAL_BACKGROUND_START_X (SCREEN_X_OFFSET + SKI_INTERFACE_WIDTH)
#define SKI_TACTICAL_BACKGROUND_START_Y 0
#define SKI_DROP_ITEM_TO_GROUND_START_X SKI_TACTICAL_BACKGROUND_START_X
#define SKI_DROP_ITEM_TO_GROUND_START_Y 262
#define SKI_DROP_ITEM_TO_GROUND_TEXT_START_Y 262
#define SKI_DROP_ITEM_TO_GROUND_START_Y (SCREEN_Y_OFFSET + 262)
#define SKI_DROP_ITEM_TO_GROUND_TEXT_START_Y (SCREEN_Y_OFFSET + 262)
#define SKI_TACTICAL_BACKGROUND_START_WIDTH 640 - SKI_TACTICAL_BACKGROUND_START_X
#define SKI_TACTICAL_BACKGROUND_START_HEIGHT 340
#define SKI_TACTICAL_BACKGROUND_START_WIDTH (SCREEN_WIDTH - SKI_TACTICAL_BACKGROUND_START_X)
#define SKI_ITEM_MOVEMENT_AREA_X 85
#define SKI_ITEM_MOVEMENT_AREA_Y 263
#define SKI_ITEM_MOVEMENT_AREA_WIDTH (640 - SKI_ITEM_MOVEMENT_AREA_X)
//#define SKI_ITEM_MOVEMENT_AREA_WIDTH 448
#define SKI_ITEM_MOVEMENT_AREA_HEIGHT 215//72
#define SKI_TACTICAL_BACKGROUND_START_HEIGHT (SCREEN_HEIGHT - INV_INTERFACE_HEIGHT)
#define SKI_DEALER_OFFER_AREA_Y 148
//#define SKI_DEALER_OFFER_AREA_Y 148
#define SKI_ITEM_MOVEMENT_AREA_X (SCREEN_X_OFFSET + 85)
#define SKI_ITEM_MOVEMENT_AREA_Y (SCREEN_Y_OFFSET + 263)
#define SKI_ITEM_MOVEMENT_AREA_WIDTH (SCREEN_WIDTH - SKI_ITEM_MOVEMENT_AREA_X)
#define SKI_ITEM_MOVEMENT_AREA_HEIGHT (SCREEN_Y_OFFSET + 215)//72
#define SKI_DEALER_OFFER_AREA_Y (SCREEN_Y_OFFSET + 148)
#define SKI_ITEM_NUMBER_TEXT_OFFSET_X 50
#define SKI_ITEM_NUMBER_TEXT_OFFSET_Y 15
@@ -216,7 +223,7 @@ SKIRGBCOLOR SkiGlowColorsA[]={
#define SKI_SUBTITLE_TEXT_SIZE 512
#define SKI_POSITION_SUBTITLES_Y 140//100
#define SKI_POSITION_SUBTITLES_Y (SCREEN_Y_OFFSET + INV_INTERFACE_HEIGHT)//100
#define SKI_SMALL_FACE_WIDTH 16
#define SKI_SMALL_FACE_HEIGHT 14
@@ -227,8 +234,8 @@ SKIRGBCOLOR SkiGlowColorsA[]={
#define SKI_ATTACHMENT_SYMBOL_Y_OFFSET 14
#define SKI_ATM_PANEL_X 87
#define SKI_ATM_PANEL_Y 342
#define SKI_ATM_PANEL_X (SCREEN_X_OFFSET + 87)
#define SKI_ATM_PANEL_Y (SCREEN_Y_OFFSET + SKI_INTERFACE_HEIGHT)
#define SKI_ATM_PANEL_WIDTH 127
#define SKI_ATM_PANEL_HEIGHT 135
@@ -236,7 +243,7 @@ SKIRGBCOLOR SkiGlowColorsA[]={
#define SKI_ATM_BUTTON_Y SKI_ATM_PANEL_Y + 64
#define SKI_ATM_BUTTON_HEIGHT 15
#define SKI_ATM_NUM_BUTTON_WIDTH 15
#define SKI_ATM_SIDE_MENU_PANEL_START_X 48
#define SKI_ATM_SIDE_MENU_PANEL_START_X (SCREEN_X_OFFSET + 48)
#define SKI_TRANSFER_STRING_X SKI_ATM_PANEL_X + 22
#define SKI_TRANSFER_STRING_Y SKI_ATM_PANEL_Y + 50
@@ -705,7 +712,8 @@ UINT32 ShopKeeperScreenHandle()
}
gubSkiDirtyLevel = SKI_DIRTY_LEVEL2;
gfRenderScreenOnNextLoop = TRUE;
InvalidateRegion( 0, 0, 640, 480 );
InvalidateRegion( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
}
if( gfRenderScreenOnNextLoop )
@@ -810,7 +818,6 @@ BOOLEAN EnterShopKeeperInterface()
// make sure current merc is close enough and eligible to talk to the shopkeeper.
AssertMsg( CanMercInteractWithSelectedShopkeeper( MercPtrs[ gusSelectedSoldier ] ), "Selected merc can't interact with shopkeeper. Send save AM-1");
// Create a video surface to blt corner of the tactical screen that still shines through
vs_desc.fCreateFlags = VSURFACE_CREATE_DEFAULT | VSURFACE_SYSTEM_MEM_USAGE;
vs_desc.usWidth = SKI_TACTICAL_BACKGROUND_START_WIDTH;
@@ -829,6 +836,9 @@ BOOLEAN EnterShopKeeperInterface()
//Clear out all the save background rects
EmptyBackgroundRects( );
// WANNE 2
ShadowVideoSurfaceRect( FRAME_BUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT - INV_INTERFACE_HEIGHT );
if( gfExitSKIDueToMessageBox )
{
gubSkiDirtyLevel = SKI_DIRTY_LEVEL2;
@@ -973,7 +983,7 @@ ATM:
//Blanket the entire screen
MSYS_DefineRegion( &gSKI_EntireScreenMouseRegions, 0, 0, 639, 339, MSYS_PRIORITY_HIGH-2,
MSYS_DefineRegion( &gSKI_EntireScreenMouseRegions, 0, 0, (SCREEN_WIDTH - 1), (SCREEN_HEIGHT - INV_INTERFACE_HEIGHT), MSYS_PRIORITY_HIGH-2,
CURSOR_NORMAL, MSYS_NO_CALLBACK, MSYS_NO_CALLBACK);
MSYS_AddRegion( &gSKI_EntireScreenMouseRegions );
@@ -1025,6 +1035,8 @@ ATM:
//Setup the currently selected arms dealer
InitializeShopKeeper( TRUE );
//Set the flag indicating that we are in the shop keeper interface
guiTacticalInterfaceFlags |= INTERFACE_SHOPKEEP_INTERFACE;
@@ -1107,7 +1119,7 @@ ATM:
//Region to allow the user to drop items to the ground
MSYS_DefineRegion( &gArmsDealersDropItemToGroundMouseRegions, SKI_DROP_ITEM_TO_GROUND_START_X, SKI_DROP_ITEM_TO_GROUND_START_Y, 639, 339, MSYS_PRIORITY_HIGH,
MSYS_DefineRegion( &gArmsDealersDropItemToGroundMouseRegions, SKI_DROP_ITEM_TO_GROUND_START_X, SKI_DROP_ITEM_TO_GROUND_START_Y, SCREEN_WIDTH - 1, SCREEN_HEIGHT - INV_INTERFACE_HEIGHT, MSYS_PRIORITY_HIGH,
CURSOR_NORMAL, SelectArmsDealersDropItemToGroundMovementRegionCallBack, SelectArmsDealersDropItemToGroundRegionCallBack );
// CURSOR_NORMAL, MSYS_NO_CALLBACK, SelectArmsDealersDropItemToGroundRegionCallBack );
MSYS_AddRegion( &gArmsDealersDropItemToGroundMouseRegions );
@@ -1439,7 +1451,7 @@ BOOLEAN RenderShopKeeperInterface()
SrcRect.iRight = SKI_TACTICAL_BACKGROUND_START_X + SKI_TACTICAL_BACKGROUND_START_WIDTH;
SrcRect.iBottom = SKI_TACTICAL_BACKGROUND_START_Y + SKI_TACTICAL_BACKGROUND_START_HEIGHT;
BltVSurfaceUsingDD( hDestVSurface, hSrcVSurface, VO_BLT_SRCTRANSPARENCY, 0, 0, (RECT*)&SrcRect );
BltVSurfaceUsingDD( hDestVSurface, hSrcVSurface, VO_BLT_SRCTRANSPARENCY, SKI_TACTICAL_BACKGROUND_START_X, SKI_TACTICAL_BACKGROUND_START_Y, (RECT*)&SrcRect );
gfRenderScreenOnNextLoop = FALSE;
}
@@ -1466,7 +1478,7 @@ BOOLEAN RenderShopKeeperInterface()
//Restore the tactical background that is visble behind the SKI panel
RestoreTacticalBackGround();
InvalidateRegion( 0, 0, 640, 480 );
InvalidateRegion( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
return( TRUE );
}
@@ -1476,23 +1488,21 @@ void RestoreTacticalBackGround()
HVSURFACE hDestVSurface, hSrcVSurface;
SGPRect SrcRect;
//Restore the background before blitting the text back on
// RestoreExternBackgroundRect( SKI_TACTICAL_BACKGROUND_START_X, SKI_TACTICAL_BACKGROUND_START_Y, SKI_TACTICAL_BACKGROUND_START_WIDTH, SKI_TACTICAL_BACKGROUND_START_HEIGHT );
// BlitBufferToBuffer( guiCornerWhereTacticalIsStillSeenImage, guiRENDERBUFFER, SKI_TACTICAL_BACKGROUND_START_X, SKI_TACTICAL_BACKGROUND_START_Y, SKI_TACTICAL_BACKGROUND_START_WIDTH, SKI_TACTICAL_BACKGROUND_START_HEIGHT );
GetVideoSurface( &hDestVSurface, guiRENDERBUFFER );
GetVideoSurface( &hSrcVSurface, guiCornerWhereTacticalIsStillSeenImage );
SrcRect.iLeft = 0;
SrcRect.iTop = 0;
SrcRect.iRight = SKI_TACTICAL_BACKGROUND_START_WIDTH;
SrcRect.iBottom = SKI_TACTICAL_BACKGROUND_START_HEIGHT;
// WANNE 2
// Top
SrcRect.iLeft = SKI_TACTICAL_BACKGROUND_START_X; //0;
SrcRect.iTop = SKI_TACTICAL_BACKGROUND_START_Y; //0;
SrcRect.iRight = SKI_TACTICAL_BACKGROUND_START_WIDTH; //SKI_TACTICAL_BACKGROUND_START_WIDTH;
SrcRect.iBottom = SKI_TACTICAL_BACKGROUND_START_HEIGHT; //SKI_TACTICAL_BACKGROUND_START_HEIGHT;
BltVSurfaceUsingDD( hDestVSurface, hSrcVSurface, VO_BLT_SRCTRANSPARENCY, SKI_TACTICAL_BACKGROUND_START_X, SKI_TACTICAL_BACKGROUND_START_Y, (RECT*)&SrcRect );
InvalidateRegion( 0, 0, 640, 480 );
// WANNE 2
//InvalidateRegion( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
}
@@ -1571,7 +1581,7 @@ void GetShopKeeperInterfaceUserInput()
gubSkiDirtyLevel = SKI_DIRTY_LEVEL2;
break;
case 'i':
InvalidateRegion( 0, 0, 640, 480 );
InvalidateRegion( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
break;
case 'd':
@@ -1599,7 +1609,7 @@ void DisplayAllDealersCash()
for( bArmsDealer=0; bArmsDealer<NUM_ARMS_DEALERS; bArmsDealer++ )
{
//Display the shopkeeper's name
DrawTextToScreen( gMercProfiles[ ArmsDealerInfo[ bArmsDealer ].ubShopKeeperID ].zNickname, 540, usPosY, 0, FONT10ARIAL, SKI_TITLE_COLOR, FONT_MCOLOR_BLACK, TRUE, LEFT_JUSTIFIED );
DrawTextToScreen( gMercProfiles[ ArmsDealerInfo[ bArmsDealer ].ubShopKeeperID ].zNickname, SCREEN_X_OFFSET + 540, SCREEN_Y_OFFSET + usPosY, 0, FONT10ARIAL, SKI_TITLE_COLOR, FONT_MCOLOR_BLACK, TRUE, LEFT_JUSTIFIED );
//Display the arms dealer cash on hand
swprintf( zTemp, L"%d", gArmsDealerStatus[ bArmsDealer ].uiArmsDealersCash );
@@ -1607,7 +1617,7 @@ void DisplayAllDealersCash()
InsertCommasForDollarFigure( zTemp );
InsertDollarSignInToString( zTemp );
ubForeColor = ( UINT8 ) ( ( bArmsDealer == gbSelectedArmsDealerID ) ? SKI_BUTTON_COLOR : SKI_TITLE_COLOR );
DrawTextToScreen( zTemp, 590, usPosY, 0, FONT10ARIAL, ubForeColor, FONT_MCOLOR_BLACK, TRUE, LEFT_JUSTIFIED );
DrawTextToScreen( zTemp, SCREEN_X_OFFSET + 590, SCREEN_Y_OFFSET + usPosY, 0, FONT10ARIAL, ubForeColor, FONT_MCOLOR_BLACK, TRUE, LEFT_JUSTIFIED );
usPosY += 17;
}
}
@@ -2541,7 +2551,6 @@ void DisplayArmsDealerCurrentInventoryPage( )
}
}
if( gubSkiDirtyLevel == SKI_DIRTY_LEVEL2 )
{
//This handles the remaining (empty) slots, resetting Fast Help text, and hatching out disabled ones
@@ -4721,13 +4730,17 @@ void InitShopKeeperSubTitledText( STR16 pString )
UINT16 usActualHeight=0;
SET_USE_WINFONTS( TRUE );
SET_WINFONT( giSubTitleWinFont );
SET_WINFONT( giSubTitleWinFont );
giPopUpBoxId = PrepareMercPopupBox( giPopUpBoxId, BASIC_MERC_POPUP_BACKGROUND, BASIC_MERC_POPUP_BORDER, gsShopKeeperTalkingText, 300, 0, 0, 0, &usActualWidth, &usActualHeight);
SET_USE_WINFONTS( FALSE );
SET_USE_WINFONTS( FALSE );
// gusPositionOfSubTitlesX = ( 640 - usActualWidth ) / 2 ;
//position it to start under the guys face
gusPositionOfSubTitlesX = 13;
gusPositionOfSubTitlesX = 13 + SCREEN_X_OFFSET;
RenderMercPopUpBoxFromIndex( giPopUpBoxId, gusPositionOfSubTitlesX, SKI_POSITION_SUBTITLES_Y, FRAME_BUFFER);
@@ -6075,7 +6088,7 @@ void EvaluateItemAddedToPlayersOfferArea( INT8 bSlotID, BOOLEAN fFirstOne )
BOOLEAN DoSkiMessageBox( UINT8 ubStyle, STR16 zString, UINT32 uiExitScreen, UINT8 ubFlags, MSGBOX_CALLBACK ReturnCallback )
{
SGPRect pCenteringRect= {0, 0, 639, 339 };
SGPRect pCenteringRect= {0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - INV_INTERFACE_HEIGHT };
// reset exit mode
gfExitSKIDueToMessageBox = TRUE;
@@ -6312,23 +6325,24 @@ void InitShopKeeperItemDescBox( OBJECTTYPE *pObject, UINT8 ubPocket, UINT8 ubFro
sPosY = SKI_ARMS_DEALERS_INV_START_Y + ( ( SKI_INV_OFFSET_Y * ubSelectedInvSlot / SKI_NUM_ARMS_DEALERS_INV_COLS ) + 1 ) - ( 128 / 2 ) + SKI_INV_SLOT_HEIGHT / 2;
// WANNE 2
//if the start position + the height of the box is off the screen, reposition
if( sPosY < 0 )
sPosY = 0;
if( sPosY < (0 + SCREEN_Y_OFFSET) )
sPosY = 0 + SCREEN_Y_OFFSET;
//if the start position + the width of the box is off the screen, reposition
if( ( sPosX + 358 ) > 640 )
sPosX = sPosX - ( ( sPosX + 358 ) - 640 ) - 5;
if( ( sPosX + 358 ) > SCREEN_WIDTH )
sPosX = sPosX - ( ( sPosX + 358 ) - SCREEN_WIDTH ) - 5;
//if it is starting to far to the left
else if( sPosX < 0 )
sPosX = 0;
else if( sPosX < (0 + SCREEN_X_OFFSET) )
sPosX = 0 + SCREEN_X_OFFSET;
//if the box will appear over the mercs face, move the box over so it doesn't obstruct the face
if( sPosY < SKI_FACE_Y + SKI_FACE_HEIGHT + 20 )
if( sPosX < 160 )
sPosX = 160;
if( sPosX < (SCREEN_X_OFFSET + 160) )
sPosX = SCREEN_X_OFFSET + 160;
}
break;
@@ -6340,22 +6354,22 @@ void InitShopKeeperItemDescBox( OBJECTTYPE *pObject, UINT8 ubPocket, UINT8 ubFro
sPosY = SKI_ARMS_DEALERS_TRADING_INV_Y + ( ( SKI_INV_OFFSET_Y * ubPocket / ( SKI_NUM_TRADING_INV_SLOTS/2) ) + 1 ) - ( 128 / 2 ) + SKI_INV_SLOT_HEIGHT / 2;
//if the start position + the height of the box is off the screen, reposition
if( sPosY < 0 )
sPosY = 0;
if( sPosY < (SCREEN_Y_OFFSET + 0) )
sPosY = 0 + SCREEN_Y_OFFSET;
//if the start position + the width of the box is off the screen, reposition
if( ( sPosX + 358 ) > 640 )
sPosX = sPosX - ( ( sPosX + 358 ) - 640 ) - 5;
if( ( sPosX + 358 ) > SCREEN_WIDTH )
sPosX = sPosX - ( ( sPosX + 358 ) - SCREEN_WIDTH ) - 5;
//if it is starting to far to the left
else if( sPosX < 0 )
sPosX = 10;
else if( sPosX < (0 + SCREEN_X_OFFSET) )
sPosX = 10 + SCREEN_X_OFFSET;
//if the box will appear over the mercs face, move the box over so it doesn't obstruct the face
if( sPosY < SKI_FACE_Y + SKI_FACE_HEIGHT + 20 )
if( sPosX < 160 )
sPosY = 140;
if( sPosX < (160 + SCREEN_X_OFFSET) )
sPosY = SCREEN_Y_OFFSET + INV_INTERFACE_HEIGHT;
}
break;
@@ -6377,17 +6391,20 @@ void StartSKIDescriptionBox( void )
{
INT32 iCnt;
//shadow the entire screen
// ShadowVideoSurfaceRect( FRAME_BUFFER, 0, 0, 640, 480 );
//if the current merc is too far away, dont shade the SM panel because it is already shaded
// WANNE 2: Do not shade the background
if( gfSMDisableForItems )
DrawHatchOnInventory( FRAME_BUFFER, 0, 0, 640, 338 );
DrawHatchOnInventory( FRAME_BUFFER, SCREEN_X_OFFSET, SCREEN_Y_OFFSET, SKI_INTERFACE_WIDTH, SKI_INTERFACE_HEIGHT );
else
DrawHatchOnInventory( FRAME_BUFFER, 0, 0, 640, 480 );
{
DrawHatchOnInventory( FRAME_BUFFER, SCREEN_X_OFFSET, SCREEN_Y_OFFSET, SKI_INTERFACE_WIDTH, SKI_INTERFACE_HEIGHT );
}
InvalidateRegion( 0, 0, 640, 480 );
InvalidateRegion( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
// disable almost everything!
@@ -7044,7 +7061,7 @@ BOOLEAN CanMercInteractWithSelectedShopkeeper( SOLDIERTYPE *pSoldier )
bDestLevel = pShopkeeper->bLevel;
// is he close enough to see that gridno if he turns his head?
sDistVisible = DistanceVisible( pSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, sDestGridNo, bDestLevel );
sDistVisible = DistanceVisible( pSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, sDestGridNo, bDestLevel, pSoldier );
// If he has LOS...
if ( SoldierTo3DLocationLineOfSightTest( pSoldier, sDestGridNo, bDestLevel, 3, (UINT8) sDistVisible, TRUE ) )
@@ -7462,6 +7479,8 @@ void DelayRepairsInProgressBy( UINT32 uiMinutesDelayed )
//Mouse Call back for the Arms delaers face
void SelectArmsDealersDropItemToGroundRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason )
{
// WANNE 2: not needed to drop the item to the ground -> on the right side of the shopkeeper screen!
/*
if (iReason & MSYS_CALLBACK_REASON_INIT)
{
}
@@ -7482,6 +7501,7 @@ void SelectArmsDealersDropItemToGroundRegionCallBack(MOUSE_REGION * pRegion, INT
//if we don't have an item, pick one up
if( gMoveingItem.sItemIndex != 0 )
{
//add the item to the ground
ShopkeeperAddItemToPool( pDropSoldier->sGridNo, &gMoveingItem.ItemObject, VISIBLE, pDropSoldier->bLevel, 0, 0 );
@@ -7492,6 +7512,7 @@ void SelectArmsDealersDropItemToGroundRegionCallBack(MOUSE_REGION * pRegion, INT
gubSkiDirtyLevel = SKI_DIRTY_LEVEL2;
}
}
*/
}
void SelectArmsDealersDropItemToGroundMovementRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason )
@@ -7533,10 +7554,11 @@ void DisplayTheSkiDropItemToGroundString()
UINT16 usHeight;
//get the height of the displayed text
usHeight = DisplayWrappedString( SKI_DROP_ITEM_TO_GROUND_START_X, SKI_DROP_ITEM_TO_GROUND_TEXT_START_Y, (UINT16)(640-SKI_DROP_ITEM_TO_GROUND_START_X), 2, SKI_LABEL_FONT, SKI_TITLE_COLOR, SKI_Text[ SKI_TEXT_DROP_ITEM_TO_GROUND ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED | DONT_DISPLAY_TEXT );
usHeight = DisplayWrappedString( SKI_DROP_ITEM_TO_GROUND_START_X, SKI_DROP_ITEM_TO_GROUND_TEXT_START_Y, (UINT16)(SCREEN_WIDTH-SKI_DROP_ITEM_TO_GROUND_START_X), 2, SKI_LABEL_FONT, SKI_TITLE_COLOR, SKI_Text[ SKI_TEXT_DROP_ITEM_TO_GROUND ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED | DONT_DISPLAY_TEXT );
// WANNE 2 - not needed to show the string
//display the 'drop item to ground' text
DisplayWrappedString( SKI_DROP_ITEM_TO_GROUND_START_X, (UINT16)(SKI_DROP_ITEM_TO_GROUND_TEXT_START_Y-usHeight), (UINT16)(640-SKI_DROP_ITEM_TO_GROUND_START_X), 2, SKI_LABEL_FONT, SKI_TITLE_COLOR, SKI_Text[ SKI_TEXT_DROP_ITEM_TO_GROUND ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED | INVALIDATE_TEXT );
//DisplayWrappedString( SKI_DROP_ITEM_TO_GROUND_START_X, (UINT16)(SKI_DROP_ITEM_TO_GROUND_TEXT_START_Y-usHeight), (UINT16)(SCREEN_WIDTH-SKI_DROP_ITEM_TO_GROUND_START_X), 2, SKI_LABEL_FONT, SKI_TITLE_COLOR, SKI_Text[ SKI_TEXT_DROP_ITEM_TO_GROUND ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED | INVALIDATE_TEXT );
}
+12 -2
View File
@@ -1,3 +1,4 @@
// WANNE 2 <changed some lines>
#ifdef PRECOMPILEDHEADERS
#include "Tactical All.h"
#else
@@ -23,8 +24,17 @@ INT8 EffectiveStrength( SOLDIERTYPE * pSoldier )
// 1/2 full strength
// plus 1/2 strength scaled according to how hurt we are
bBandaged = pSoldier->bLifeMax - pSoldier->bLife - pSoldier->bBleeding;
iEffStrength = pSoldier->bStrength / 2;
iEffStrength += (pSoldier->bStrength / 2) * (pSoldier->bLife + bBandaged / 2) / (pSoldier->bLifeMax);
// WANNE 2
if (pSoldier->bStrength > 0)
{
iEffStrength = pSoldier->bStrength / 2;
iEffStrength += (pSoldier->bStrength / 2) * (pSoldier->bLife + bBandaged / 2) / (pSoldier->bLifeMax);
}
else
{
iEffStrength = 0;
}
// ATE: Make sure at least 2...
iEffStrength = __max( iEffStrength, 2 );
+4 -4
View File
@@ -2909,7 +2909,7 @@ void SayBuddyWitnessedQuoteFromKill( SOLDIERTYPE *pKillerSoldier, INT16 sGridNo,
// TO LOS check to killed
// Can we see location of killer?
sDistVisible = DistanceVisible( pTeamSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, pKillerSoldier->sGridNo, pKillerSoldier->bLevel );
sDistVisible = DistanceVisible( pTeamSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, pKillerSoldier->sGridNo, pKillerSoldier->bLevel, pKillerSoldier );
if ( SoldierTo3DLocationLineOfSightTest( pTeamSoldier, pKillerSoldier->sGridNo, pKillerSoldier->bLevel, (UINT8)3, (UINT8) sDistVisible, TRUE ) == 0 )
{
continue;
@@ -2917,7 +2917,7 @@ void SayBuddyWitnessedQuoteFromKill( SOLDIERTYPE *pKillerSoldier, INT16 sGridNo,
// Can we see location of killed?
sDistVisible = DistanceVisible( pTeamSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, sGridNo, bLevel );
sDistVisible = DistanceVisible( pTeamSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, sGridNo, bLevel, pTeamSoldier );
if ( SoldierTo3DLocationLineOfSightTest( pTeamSoldier, sGridNo, bLevel, (UINT8)3, (UINT8) sDistVisible, TRUE ) == 0 )
{
continue;
@@ -2976,7 +2976,7 @@ void HandleKilledQuote( SOLDIERTYPE *pKilledSoldier, SOLDIERTYPE *pKillerSoldier
gfLastMercTalkedAboutKillingID = pKilledSoldier->ubID;
// Can we see location?
sDistVisible = DistanceVisible( pKillerSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, sGridNo, bLevel );
sDistVisible = DistanceVisible( pKillerSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, sGridNo, bLevel, pKillerSoldier );
fCanWeSeeLocation = ( SoldierTo3DLocationLineOfSightTest( pKillerSoldier, sGridNo, bLevel, (UINT8)3, (UINT8) sDistVisible, TRUE ) != 0 );
@@ -3039,7 +3039,7 @@ void HandleKilledQuote( SOLDIERTYPE *pKilledSoldier, SOLDIERTYPE *pKillerSoldier
if ( OK_INSECTOR_MERC( pTeamSoldier ) && !( pTeamSoldier->uiStatusFlags & SOLDIER_GASSED ) && !AM_AN_EPC( pTeamSoldier ) )
{
// Can we see location?
sDistVisible = DistanceVisible( pTeamSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, sGridNo, bLevel );
sDistVisible = DistanceVisible( pTeamSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, sGridNo, bLevel, pTeamSoldier );
if ( SoldierTo3DLocationLineOfSightTest( pTeamSoldier, sGridNo, bLevel, 3, (UINT8) sDistVisible, TRUE ) )
{
+137 -4
View File
@@ -574,8 +574,41 @@ INT8 CalcActionPoints(SOLDIERTYPE *pSold)
}
//Madd
if ( pSold->bTeam != CIV_TEAM && pSold->bTeam != gbPlayerNum && gGameOptions.ubDifficultyLevel == DIF_LEVEL_INSANE )
ubPoints += 5; // everything and everyone moves a little faster against you on insane...
// if ( pSold->bTeam != CIV_TEAM && pSold->bTeam != gbPlayerNum && gGameOptions.ubDifficultyLevel == DIF_LEVEL_INSANE )
// ubPoints += 5; // everything and everyone moves a little faster against you on insane...
//Kaiden: Took your idea a step further adding the bonus for each difficulty level
// and then externalized it. AND added it to the Dont max out points section below.
if ( pSold->bTeam != CIV_TEAM && pSold->bTeam != gbPlayerNum)
{
switch( gGameOptions.ubDifficultyLevel )
{
case DIF_LEVEL_EASY:
ubPoints += gGameExternalOptions.iEasyAPBonus;
break;
case DIF_LEVEL_MEDIUM:
ubPoints += gGameExternalOptions.iExperiencedAPBonus;
break;
case DIF_LEVEL_HARD:
ubPoints += gGameExternalOptions.iExpertAPBonus;
break;
case DIF_LEVEL_INSANE:
ubPoints += gGameExternalOptions.iInsaneAPBonus;
break;
default:
ubPoints +=0;
}
}
// if we are in boxing mode, adjust APs... THIS MUST BE LAST!
if ( gTacticalStatus.bBoxingState == BOXING || gTacticalStatus.bBoxingState == PRE_BOXING )
@@ -608,8 +641,43 @@ void CalcNewActionPoints( SOLDIERTYPE *pSoldier )
// Don't max out if we are drugged....
if ( !GetDrugEffect( pSoldier, DRUG_TYPE_ADRENALINE ) )
{
{ //Kaiden: If Enemy, they can max out, but their Max is NOW = MAX + diffAPBonus
// No sense in giving them a bonus if some of the points are wasted because we
// Didn't raise their cap by the same amount.
if ( pSoldier->bTeam != CIV_TEAM && pSoldier->bTeam != gbPlayerNum)
{
switch( gGameOptions.ubDifficultyLevel )
{
case DIF_LEVEL_EASY:
pSoldier->bActionPoints = __min( pSoldier->bActionPoints, (gubMaxActionPoints[ pSoldier->ubBodyType ] + gGameExternalOptions.iEasyAPBonus));
break;
case DIF_LEVEL_MEDIUM:
pSoldier->bActionPoints = __min( pSoldier->bActionPoints, (gubMaxActionPoints[ pSoldier->ubBodyType ] + gGameExternalOptions.iExperiencedAPBonus));
break;
case DIF_LEVEL_HARD:
pSoldier->bActionPoints = __min( pSoldier->bActionPoints, (gubMaxActionPoints[ pSoldier->ubBodyType ] + gGameExternalOptions.iExpertAPBonus));
break;
case DIF_LEVEL_INSANE:
pSoldier->bActionPoints = __min( pSoldier->bActionPoints, (gubMaxActionPoints[ pSoldier->ubBodyType ] + gGameExternalOptions.iInsaneAPBonus));
break;
default:
pSoldier->bActionPoints = __min( pSoldier->bActionPoints, gubMaxActionPoints[ pSoldier->ubBodyType ] );
}
}
else
{ //Kaiden: Players just max out normally unless drugged
pSoldier->bActionPoints = __min( pSoldier->bActionPoints, gubMaxActionPoints[ pSoldier->ubBodyType ] );
}
}
pSoldier->bInitialActionPoints = pSoldier->bActionPoints;
@@ -2665,7 +2733,7 @@ void SetSoldierGridNo( SOLDIERTYPE *pSoldier, INT16 sNewGridNo, BOOLEAN fForceRe
// if we SEE this particular oppponent, and he DOESN'T see us... and he COULD see us...
if ( (pSoldier->bOppList[ cnt ] == SEEN_CURRENTLY) &&
pEnemy->bOppList[ pSoldier->ubID ] != SEEN_CURRENTLY &&
PythSpacesAway( pSoldier->sGridNo, pEnemy->sGridNo ) < DistanceVisible( pEnemy, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, pSoldier->sGridNo, pSoldier->bLevel ) )
PythSpacesAway( pSoldier->sGridNo, pEnemy->sGridNo ) < DistanceVisible( pEnemy, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, pSoldier->sGridNo, pSoldier->bLevel, pSoldier ) )
{
// AGILITY (5): Soldier snuck 1 square past unaware enemy
StatChange( pSoldier, AGILAMT, 5, FALSE );
@@ -6120,11 +6188,22 @@ void MoveMercFacingDirection( SOLDIERTYPE *pSoldier, BOOLEAN fReverse, FLOAT dMo
void BeginSoldierClimbUpRoof( SOLDIERTYPE *pSoldier )
{
INT8 bNewDirection;
UINT8 ubWhoIsThere;
if ( FindHeigherLevel( pSoldier, pSoldier->sGridNo, pSoldier->bDirection, &bNewDirection ) && ( pSoldier->bLevel == 0 ) )
{
if ( EnoughPoints( pSoldier, GetAPsToClimbRoof( pSoldier, FALSE ), 0, TRUE ) )
{
//Kaiden: Helps if we look where we are going before we try to climb on top of someone
ubWhoIsThere = WhoIsThere2( NewGridNo( (UINT16)pSoldier->sGridNo, (UINT16)DirectionInc(bNewDirection ) ), 1 );
if ( ubWhoIsThere != NOBODY && ubWhoIsThere != pSoldier->ubID )
{
return;
}
else
{
if (pSoldier->bTeam == gbPlayerNum)
{
// OK, SET INTERFACE FIRST
@@ -6141,6 +6220,8 @@ void BeginSoldierClimbUpRoof( SOLDIERTYPE *pSoldier )
InternalGivingSoldierCancelServices( pSoldier, FALSE );
}
}
}
}
@@ -7329,17 +7410,31 @@ BOOLEAN CheckSoldierHitRoof( SOLDIERTYPE *pSoldier )
void BeginSoldierClimbDownRoof( SOLDIERTYPE *pSoldier )
{
INT8 bNewDirection;
UINT8 ubWhoIsThere;
if ( FindLowerLevel( pSoldier, pSoldier->sGridNo, pSoldier->bDirection, &bNewDirection ) && ( pSoldier->bLevel > 0 ) )
{
if ( EnoughPoints( pSoldier, GetAPsToClimbRoof( pSoldier, TRUE ), 0, TRUE ) )
{
//Kaiden: Helps if we look where we are going before we try to climb on top of someone
ubWhoIsThere = WhoIsThere2( NewGridNo( (UINT16)pSoldier->sGridNo, (UINT16)DirectionInc(bNewDirection ) ), 0 );
if ( ubWhoIsThere != NOBODY && ubWhoIsThere != pSoldier->ubID )
{
return;
}
else
{
if (pSoldier->bTeam == gbPlayerNum)
{
// OK, SET INTERFACE FIRST
SetUIBusy( pSoldier->ubID );
}
pSoldier->sTempNewGridNo = NewGridNo( (UINT16)pSoldier->sGridNo, (UINT16)DirectionInc(bNewDirection ) );
bNewDirection = gTwoCDirection[ bNewDirection ];
@@ -7352,8 +7447,46 @@ void BeginSoldierClimbDownRoof( SOLDIERTYPE *pSoldier )
}
}
}
}
/*
void BeginSoldierClimbDownRoof( SOLDIERTYPE *pSoldier )
{
INT8 bNewDirection;
UINT8 ubWhoIsThere;
if ( FindLowerLevel( pSoldier, pSoldier->sGridNo, pSoldier->bDirection, &bNewDirection ) && ( pSoldier->bLevel > 0 ) )
{
if ( EnoughPoints( pSoldier, GetAPsToClimbRoof( pSoldier, TRUE ), 0, TRUE ) )
{
if (pSoldier->bTeam == gbPlayerNum)
{
// OK, SET INTERFACE FIRST
SetUIBusy( pSoldier->ubID );
}
pSoldier->sTempNewGridNo = NewGridNo( (UINT16)pSoldier->sGridNo, (UINT16)DirectionInc(bNewDirection ) );
bNewDirection = gTwoCDirection[ bNewDirection ];
pSoldier->ubPendingDirection = bNewDirection;
EVENT_InitNewSoldierAnim( pSoldier, CLIMBDOWNROOF, 0 , FALSE );
InternalReceivingSoldierCancelServices( pSoldier, FALSE );
InternalGivingSoldierCancelServices( pSoldier, FALSE );
}
}
}
*/
void MoveMerc( SOLDIERTYPE *pSoldier, FLOAT dMovementChange, FLOAT dAngle, BOOLEAN fCheckRange )
{
+2 -2
View File
@@ -53,7 +53,7 @@ enum NPCIDs
PERKO,
QUEEN,
AUNTIE,
ENRICO,
GABBY, //ENRICO,
CARMEN,
JOE,
STEVE,
@@ -83,7 +83,7 @@ enum NPCIDs
FATIMA, // 101
WARDEN,
GORDON,
GABBY,
ENRICO, //GABBY,
ERNEST,
FRED,
MADAME,
+5 -2
View File
@@ -1,3 +1,4 @@
// WANNE 2 <changed some lines>
#ifdef PRECOMPILEDHEADERS
#include "Tactical All.h"
#include "Language Defines.h"
@@ -2683,8 +2684,10 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
break;
case INSERT:
GoIntoOverheadMap();
// WANNE 2: commented this out, because the interface panel is not correctly redrawn!
// I do not know the bug ;(
//GoIntoOverheadMap();
break;
case END:
+1 -1
View File
@@ -3372,7 +3372,7 @@ UINT32 CalcChanceToHitGun(SOLDIERTYPE *pSoldier, UINT16 sGridNo, UINT8 ubAimTime
iChance -= iPenalty;
}
sDistVis = DistanceVisible( pSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, sGridNo, 0 );
sDistVis = DistanceVisible( pSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, sGridNo, 0, pSoldier );
// give some leeway to allow people to spot for each other...
// use distance limitation for LOS routine of 2 x maximum distance EVER visible, so that we get accurate
+30 -20
View File
@@ -785,7 +785,6 @@ void HandleSight(SOLDIERTYPE *pSoldier, UINT8 ubSightFlags)
pSoldier->bNewOppCnt = 0;
pSoldier->bNeedToLook = FALSE;
// Temporary for opplist synching - disable random order radioing
#ifndef RECORDOPPLIST
// if this soldier's NOT on our team (MAY be under our control, though!)
@@ -840,6 +839,7 @@ void HandleSight(SOLDIERTYPE *pSoldier, UINT8 ubSightFlags)
// CJC August 13 2002: at the end of handling sight, reset sight flags to allow interrupts in case an audio cue should
// cause someone to see an enemy
gubSightFlags |= SIGHT_INTERRUPT;
}
@@ -997,7 +997,7 @@ INT16 MaxDistanceVisible( void )
return( STRAIGHT * 2 );
}
INT16 DistanceVisible( SOLDIERTYPE *pSoldier, INT8 bFacingDir, INT8 bSubjectDir, INT16 sSubjectGridNo, INT8 bLevel )
INT16 DistanceVisible( SOLDIERTYPE *pSoldier, INT8 bFacingDir, INT8 bSubjectDir, INT16 sSubjectGridNo, INT8 bLevel, SOLDIERTYPE *pOther )
{
INT16 sDistVisible;
INT8 bLightLevel;
@@ -1028,6 +1028,7 @@ INT16 DistanceVisible( SOLDIERTYPE *pSoldier, INT8 bFacingDir, INT8 bSubjectDir,
//bSubjectDir = atan8(pSoldier->sX,pSoldier->sY,pOpponent->sX,pOpponent->sY);
}
if ( !TANK( pSoldier ) && ( bFacingDir == DIRECTION_IRRELEVANT || (pSoldier->uiStatusFlags & SOLDIER_ROBOT) || (pSubject && pSubject->fMuzzleFlash) ) )
{
sDistVisible = MaxDistanceVisible();
@@ -1074,8 +1075,26 @@ INT16 DistanceVisible( SOLDIERTYPE *pSoldier, INT8 bFacingDir, INT8 bSubjectDir,
// now reduce based on light level; SHADE_MIN is the define for the
// highest number the light can be
bLightLevel = LightTrueLevel(sSubjectGridNo, bLevel);
// If we're about to ask for a light level for a location outside of our
// valid map references then use the ambient light level instead.
if(0 > sSubjectGridNo || sSubjectGridNo > WORLD_MAX)
{
if(pSoldier != pOther)
{
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("113/UC Warning! Tried to detect the light level when character %ls[%d] at gridno %d tries to look for character %ls[%d] who outside of the valid map (gridno %d). Assigning default %d",
pSoldier->name, pSoldier->ubID, pSoldier->sGridNo, pOther->name, pOther->ubID, pOther->sGridNo, ubAmbientLightLevel));
}
else
{
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, String("113/UC Warning! Tried to detect the light level when character %ls[%d] looks at a location outside of the valid map (gridno %d). Assigning default %d",
pSoldier->name, pSoldier->ubID, pSoldier->sGridNo, ubAmbientLightLevel));
}
}
else
{
bLightLevel = LightTrueLevel(sSubjectGridNo, bLevel);
}
// Snap: I think this was intended to give maximum visibility to targets with muzzle flash...
// Corrected accordingly:
@@ -1150,7 +1169,7 @@ void EndMuzzleFlash( SOLDIERTYPE * pSoldier )
{
if ( pOtherSoldier->sGridNo != NOWHERE )
{
if ( PythSpacesAway( pOtherSoldier->sGridNo, pSoldier->sGridNo ) > DistanceVisible( pOtherSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, pSoldier->sGridNo, pSoldier->bLevel ) )
if ( PythSpacesAway( pOtherSoldier->sGridNo, pSoldier->sGridNo ) > DistanceVisible( pOtherSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, pSoldier->sGridNo, pSoldier->bLevel, pSoldier ) )
{
// if this guy can no longer see us, change to seen this turn
HandleManNoLongerSeen( pOtherSoldier, pSoldier, &(pOtherSoldier->bOppList[ pSoldier->ubID ]), &(gbPublicOpplist[ pOtherSoldier->bTeam ][ pSoldier->ubID ] ) );
@@ -1401,7 +1420,6 @@ void ManLooksForOtherTeams(SOLDIERTYPE *pSoldier)
UINT32 uiLoop;
SOLDIERTYPE *pOpponent;
#ifdef TESTOPPLIST
DebugMsg( TOPIC_JA2OPPLIST, DBG_LEVEL_3,
String("MANLOOKSFOROTHERTEAMS ID %d(%S) team %d side %d",pSoldier->ubID,pSoldier->name,pSoldier->bTeam,pSoldier->bSide));
@@ -1439,6 +1457,7 @@ void ManLooksForOtherTeams(SOLDIERTYPE *pSoldier)
}
}
}
}
void HandleManNoLongerSeen( SOLDIERTYPE * pSoldier, SOLDIERTYPE * pOpponent, INT8 * pPersOL, INT8 * pbPublOL )
@@ -1531,7 +1550,6 @@ INT16 ManLooksForMan(SOLDIERTYPE *pSoldier, SOLDIERTYPE *pOpponent, UINT8 ubCall
INT16 sDistVisible,sDistAway;
INT8 *pPersOL,*pbPublOL;
/*
if (ptr->guynum >= NOBODY)
{
@@ -1575,8 +1593,6 @@ INT16 ManLooksForMan(SOLDIERTYPE *pSoldier, SOLDIERTYPE *pOpponent, UINT8 ubCall
return(FALSE);
}
// if we're somehow looking for a guy who is inactive, at base, or already dead
if (!pOpponent->bActive || !pOpponent->bInSector || pOpponent->bLife <= 0 || pOpponent->sGridNo == NOWHERE )
{
@@ -1680,15 +1696,13 @@ INT16 ManLooksForMan(SOLDIERTYPE *pSoldier, SOLDIERTYPE *pOpponent, UINT8 ubCall
pPersOL = &(pSoldier->bOppList[pOpponent->ubID]);
pbPublOL = &(gbPublicOpplist[pSoldier->bTeam][pOpponent->ubID]);
// if soldier is known about (SEEN or HEARD within last few turns)
if (*pPersOL || *pbPublOL)
{
bAware = TRUE;
// then we look for him full viewing distance in EVERY direction
sDistVisible = DistanceVisible(pSoldier, DIRECTION_IRRELEVANT, 0, pOpponent->sGridNo, pOpponent->bLevel );
sDistVisible = DistanceVisible(pSoldier, DIRECTION_IRRELEVANT, 0, pOpponent->sGridNo, pOpponent->bLevel, pOpponent );
//if (pSoldier->ubID == 0)
//sprintf(gDebugStr,"ALREADY KNOW: ME %d him %d val %d",pSoldier->ubID,pOpponent->ubID,pSoldier->bOppList[pOpponent->ubID]);
}
@@ -1699,8 +1713,7 @@ INT16 ManLooksForMan(SOLDIERTYPE *pSoldier, SOLDIERTYPE *pOpponent, UINT8 ubCall
// BIG NOTE: must use desdir instead of direction, since in a projected
// situation, the direction may still be changing if it's one of the first
// few animation steps when this guy's turn to do his stepped look comes up
sDistVisible = DistanceVisible(pSoldier,pSoldier->bDesiredDirection,bDir, pOpponent->sGridNo, pOpponent->bLevel );
sDistVisible = DistanceVisible(pSoldier,pSoldier->bDesiredDirection,bDir, pOpponent->sGridNo, pOpponent->bLevel, pOpponent );
//if (pSoldier->ubID == 0)
//sprintf(gDebugStr,"dist visible %d: my dir %d to him %d",sDistVisible,pSoldier->bDesiredDirection,bDir);
}
@@ -1712,7 +1725,6 @@ INT16 ManLooksForMan(SOLDIERTYPE *pSoldier, SOLDIERTYPE *pOpponent, UINT8 ubCall
DebugMsg( TOPIC_JA2OPPLIST, DBG_LEVEL_3, String( "MANLOOKSFORMAN: ID %d(%S) to ID %d: sDistAway %d sDistVisible %d",pSoldier->ubID,pSoldier->name,pOpponent->ubID,sDistAway,sDistVisible) );
#endif
// if we see close enough to see the soldier
if (sDistAway <= sDistVisible)
{
@@ -1779,8 +1791,6 @@ INT16 ManLooksForMan(SOLDIERTYPE *pSoldier, SOLDIERTYPE *pOpponent, UINT8 ubCall
}
return(bSuccess);
}
@@ -5520,7 +5530,7 @@ void HearNoise(SOLDIERTYPE *pSoldier, UINT8 ubNoiseMaker, UINT16 sGridNo, INT8 b
}
}
sDistVisible = DistanceVisible( pSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, sGridNo, bLevel );
sDistVisible = DistanceVisible( pSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, sGridNo, bLevel, pSoldier );
if ( fMuzzleFlash )
{
@@ -6370,7 +6380,7 @@ void NoticeUnseenAttacker( SOLDIERTYPE * pAttacker, SOLDIERTYPE * pDefender, INT
}
}
ubTileSightLimit = (UINT8) DistanceVisible( pDefender, DIRECTION_IRRELEVANT, 0, pAttacker->sGridNo, pAttacker->bLevel );
ubTileSightLimit = (UINT8) DistanceVisible( pDefender, DIRECTION_IRRELEVANT, 0, pAttacker->sGridNo, pAttacker->bLevel, pAttacker );
if (SoldierToSoldierLineOfSightTest( pDefender, pAttacker, ubTileSightLimit, TRUE ) != 0)
{
fSeesAttacker = TRUE;
@@ -6489,7 +6499,7 @@ void CheckForAlertWhenEnemyDies( SOLDIERTYPE * pDyingSoldier )
// distance we "see" then depends on the direction he is located from us
bDir = atan8(pSoldier->sX,pSoldier->sY,pDyingSoldier->sX,pDyingSoldier->sY);
sDistVisible = DistanceVisible( pSoldier, pSoldier->bDesiredDirection, bDir, pDyingSoldier->sGridNo, pDyingSoldier->bLevel );
sDistVisible = DistanceVisible( pSoldier, pSoldier->bDesiredDirection, bDir, pDyingSoldier->sGridNo, pDyingSoldier->bLevel, pDyingSoldier );
sDistAway = PythSpacesAway( pSoldier->sGridNo, pDyingSoldier->sGridNo );
// if we see close enough to see the soldier
@@ -6630,7 +6640,7 @@ INT8 GetHighestVisibleWatchedLoc( UINT8 ubID )
{
if ( gsWatchedLoc[ ubID ][ bLoop ] != NOWHERE && gubWatchedLocPoints[ ubID ][ bLoop ] > bHighestPoints )
{
sDistVisible = DistanceVisible( MercPtrs[ ubID ], DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, gsWatchedLoc[ ubID ][ bLoop ], gbWatchedLocLevel[ ubID ][ bLoop ] );
sDistVisible = DistanceVisible( MercPtrs[ ubID ], DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, gsWatchedLoc[ ubID ][ bLoop ], gbWatchedLocLevel[ ubID ][ bLoop ], MercPtrs[ubID] );
// look at standing height
if ( SoldierTo3DLocationLineOfSightTest( MercPtrs[ ubID ], gsWatchedLoc[ ubID ][ bLoop ], gbWatchedLocLevel[ ubID ][ bLoop ], 3, (UINT8) sDistVisible, TRUE ) )
{
+1 -1
View File
@@ -100,7 +100,7 @@ void AddOneOpponent(SOLDIERTYPE *pSoldier);
void RemoveOneOpponent(SOLDIERTYPE *pSoldier);
void UpdatePersonal(SOLDIERTYPE *pSoldier, UINT8 ubID, INT8 bNewOpplist, INT16 sGridno, INT8 bLevel);
INT16 MaxDistanceVisible( void );
INT16 DistanceVisible( SOLDIERTYPE *pSoldier, INT8 bFacingDir, INT8 bSubjectDir, INT16 sSubjectGridNo, INT8 bLevel );
INT16 DistanceVisible( SOLDIERTYPE *pSoldier, INT8 bFacingDir, INT8 bSubjectDir, INT16 sSubjectGridNo, INT8 bLevel, SOLDIERTYPE *pOther );
void ResetLastKnownLocs(SOLDIERTYPE *ptr);
void RecalculateOppCntsDueToNoLongerNeutral( SOLDIERTYPE * pSoldier );