From dc2b482a8f9852c0f9ac99606ae449dca35e7467 Mon Sep 17 00:00:00 2001 From: lalien Date: Mon, 1 May 2006 19:19:45 +0000 Subject: [PATCH] ********************************************************* * 2006/05/01 * * Madd Mugsy * * Developed in VS 2003 * ********************************************************* Source: - Added bullet tracers (& tracerEffect to AmmoTypes.xml) - Remedied IMP name saving, which didn't seem to upload properly Data: - Add bullet_tracer.sti to tilecache (will upload a full data folder w/new images at some point) git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@45 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Laptop/IMP Begin Screen.cpp | 2 +- Laptop/IMP Confirm.cpp | 50 ++++++-- Laptop/IMP Confirm.h | 1 + Laptop/IMP HomePage.cpp | 15 ++- Laptop/IMP HomePage.h | 2 + Laptop/laptop.cpp | 227 +++++++++++++++++------------------ Tactical/Bullets.h | 1 + Tactical/Interface Items.cpp | 6 +- Tactical/LOS.cpp | 10 +- Tactical/Weapons.h | 1 + Tactical/XML_AmmoTypes.cpp | 7 ++ Tactical/bullets.cpp | 10 +- 12 files changed, 197 insertions(+), 135 deletions(-) diff --git a/Laptop/IMP Begin Screen.cpp b/Laptop/IMP Begin Screen.cpp index 4aff5b2f..efca9fb4 100644 --- a/Laptop/IMP Begin Screen.cpp +++ b/Laptop/IMP Begin Screen.cpp @@ -1244,7 +1244,7 @@ void Print8CharacterOnlyString( void ) BOOLEAN CheckCharacterInputForEgg( void ) { - MERC_HIRE_STRUCT HireMercStruct; +// MERC_HIRE_STRUCT HireMercStruct; #ifndef JA2BETAVERSION return( FALSE ); diff --git a/Laptop/IMP Confirm.cpp b/Laptop/IMP Confirm.cpp index 5705cc3d..88fc2de6 100644 --- a/Laptop/IMP Confirm.cpp +++ b/Laptop/IMP Confirm.cpp @@ -651,13 +651,40 @@ INT32 FirstFreeBigEnoughPocket(MERCPROFILESTRUCT *pProfile, UINT16 usItem) void WriteOutCurrentImpCharacter( INT32 iProfileId ) +{ + DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("WriteOutCurrentImpCharacter: IMP.dat")); + char zImpFileName[12]; + strcat(zImpFileName,IMP_MERC_FILENAME); + strcat(zImpFileName,IMP_FILENAME_SUFFIX); + WriteOutCurrentImpCharacter ( iProfileId, zImpFileName); + + + DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("WriteOutCurrentImpCharacter: Nickname.dat")); + + char zFileName[12]; + char temp; + + for(int i=0;i < 8;i++) // Madd: I couldn't get strcpy or anything to work here... weird... if s/o wants to fix it, go ahead + { + temp = (char) gMercProfiles[iProfileId].zNickname[i]; + zFileName[i] = temp; + } + + strcat(zFileName,IMP_FILENAME_SUFFIX); + + DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("WriteOutCurrentImpCharacter: %s", zFileName)); + WriteOutCurrentImpCharacter ( iProfileId, zFileName); +} + +void WriteOutCurrentImpCharacter( INT32 iProfileId, STR fileName ) { // grab the profile number and write out what is contained there in HWFILE hFile; UINT32 uiBytesWritten = 0; // open the file for writing - hFile = FileOpen(strcat((STR)(&gMercProfiles[iProfileId].zNickname),IMP_FILENAME_SUFFIX), FILE_ACCESS_WRITE | FILE_CREATE_ALWAYS, FALSE); + DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("WriteOutCurrentImpCharacter: %s", fileName)); + hFile = FileOpen(fileName, FILE_ACCESS_WRITE | FILE_CREATE_ALWAYS, FALSE); // write out the profile id if (!FileWrite(hFile, &iProfileId, sizeof( INT32 ), &uiBytesWritten)) @@ -685,11 +712,15 @@ void WriteOutCurrentImpCharacter( INT32 iProfileId ) BOOLEAN ImpExists ( STR nickName ) { - DWORD attribs = GetFileAttributes(strcat(nickName,IMP_FILENAME_SUFFIX)); - if ( attribs != INVALID_FILE_ATTRIBUTES && !(attribs & FILE_ATTRIBUTE_DIRECTORY) ) - return TRUE; - - return FALSE; + char zFileName[12]; + + strcpy(zFileName,nickName); + strcat(zFileName,IMP_FILENAME_SUFFIX); + + DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("ImpExists: %s", (STR) zFileName)); + DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("ImpExists: %d", FileExistsNoDB(zFileName) )); + + return FileExistsNoDB(zFileName); } void LoadImpCharacter( STR nickName ) @@ -698,8 +729,13 @@ void LoadImpCharacter( STR nickName ) HWFILE hFile; UINT32 uiBytesRead = 0; + char zFileName[12]; + + strcpy(zFileName,nickName); + strcat(zFileName,IMP_FILENAME_SUFFIX); + // open the file for writing - hFile = FileOpen(strcat(nickName,IMP_FILENAME_SUFFIX), FILE_ACCESS_READ, FALSE); + hFile = FileOpen(zFileName, FILE_ACCESS_READ, FALSE); // valid file? if( hFile == -1 ) diff --git a/Laptop/IMP Confirm.h b/Laptop/IMP Confirm.h index 283f49f4..9ae17f33 100644 --- a/Laptop/IMP Confirm.h +++ b/Laptop/IMP Confirm.h @@ -9,6 +9,7 @@ void HandleIMPConfirm( void ); BOOLEAN AddCharacterToPlayersTeam( void ); void LoadImpCharacter( STR fileName ); void WriteOutCurrentImpCharacter( INT32 iProfileId ); +void WriteOutCurrentImpCharacter( INT32 iProfileId, STR fileName ); void ResetIMPCharactersEyesAndMouthOffsets( UINT8 ubMercProfileID ); diff --git a/Laptop/IMP HomePage.cpp b/Laptop/IMP HomePage.cpp index fa2b0e00..b8bb03f8 100644 --- a/Laptop/IMP HomePage.cpp +++ b/Laptop/IMP HomePage.cpp @@ -342,7 +342,7 @@ void HandleTextEvent( UINT32 uiKey ) uiKey == '_' || uiKey == '.' ) { // if the current string position is at max or great, do nothing - if( iStringPos >= 6 ) + if( iStringPos >= 8 ) { break; } @@ -387,6 +387,9 @@ void ProcessPlayerInputActivationString( void ) if( NumberOfMercsOnPlayerTeam() >= 18 ) return; + char charPlayerActivationString[32]; + wcstombs(charPlayerActivationString,pPlayerActivationString,32); + //Madd multiple imps if( ( ( wcscmp(pPlayerActivationString, L"XEP624") == 0 ) || ( wcscmp(pPlayerActivationString, L"xep624") == 0 ) )&&( LaptopSaveInfo.fIMPCompletedFlag == FALSE ) &&( LaptopSaveInfo.gfNewGameLaptop < 2 ) ) if( ( ( wcscmp(pPlayerActivationString, L"XEP624") == 0 ) || ( wcscmp(pPlayerActivationString, L"xep624") == 0 ) ) &&( LaptopSaveInfo.gfNewGameLaptop < 2 ) ) { @@ -397,10 +400,14 @@ void ProcessPlayerInputActivationString( void ) } //Madd multiple imps else if( ( wcscmp(pPlayerActivationString, L"90210") == 0 ) && ( LaptopSaveInfo.fIMPCompletedFlag == FALSE ) ) - // Madd: load characters by name: - else if ( ImpExists( (STR)pPlayerActivationString ) ) + else if( wcscmp(pPlayerActivationString, L"90210") == 0 ) { - LoadImpCharacter( (STR)pPlayerActivationString ); + LoadImpCharacter( IMP_MERC_FILENAME ); + } + // Madd: load characters by name + else if ( ImpExists( charPlayerActivationString ) ) + { + LoadImpCharacter( charPlayerActivationString ); } else diff --git a/Laptop/IMP HomePage.h b/Laptop/IMP HomePage.h index 500ba641..c6d657b8 100644 --- a/Laptop/IMP HomePage.h +++ b/Laptop/IMP HomePage.h @@ -12,5 +12,7 @@ void HandleImpHomePage( void ); #define MIN_GLOW_DELTA 100 #define CURSOR_HEIGHT GetFontHeight( FONT14ARIAL ) + 6 +#define IMP_MERC_FILENAME "IMP" + extern INT32 GlowColorsList[][3]; #endif \ No newline at end of file diff --git a/Laptop/laptop.cpp b/Laptop/laptop.cpp index 316c3941..f96af261 100644 --- a/Laptop/laptop.cpp +++ b/Laptop/laptop.cpp @@ -1811,15 +1811,14 @@ UINT32 LaptopScreenHandle() if( gfStartMapScreenToLaptopTransition ) { - // WANNE 2: I disabled the animation of the laptop, because the screen redrawing does not work correct! - // Madd: It'd be nice if someone who knows more about graphics than I do could re-enable this, at least for 640x480 //Everything is set up to start the transition animation. - //SGPRect SrcRect2, DstRect; - //INT32 iPercentage, iScalePercentage, iFactor; - //UINT32 uiStartTime, uiTimeRange, uiCurrTime; - //INT32 iX, iY, iWidth, iHeight; + //SGPRect SrcRect1; + SGPRect SrcRect2, DstRect; + INT32 iPercentage, iScalePercentage, iFactor; + UINT32 uiStartTime, uiTimeRange, uiCurrTime; + INT32 iX, iY, iWidth, iHeight; - //INT32 iRealPercentage; + INT32 iRealPercentage; SetCurrentCursorFromDatabase( VIDEO_NO_CURSOR ); //Step 1: Build the laptop image into the save buffer. @@ -1834,63 +1833,62 @@ UINT32 LaptopScreenHandle() PrintNumberOnTeam( ); ShowLights(); - //// WANNE 2 - ////Step 2: The mapscreen image is in the EXTRABUFFER, and laptop is in the SAVEBUFFER - //// Start transitioning the screen. - //DstRect.iLeft = iScreenWidthOffset; //0 - //DstRect.iTop = iScreenHeightOffset; //0 - //DstRect.iRight = iScreenWidthOffset + 640; //640 - //DstRect.iBottom = iScreenHeightOffset + 480; //480 - //uiTimeRange = 1000; - //iPercentage = iRealPercentage = 0; - //uiStartTime = GetJA2Clock(); + //Step 2: The mapscreen image is in the EXTRABUFFER, and laptop is in the SAVEBUFFER + // Start transitioning the screen. + DstRect.iLeft = iScreenWidthOffset; //0 + DstRect.iTop = iScreenHeightOffset; //0 + DstRect.iRight = iScreenWidthOffset + 640; //640 + DstRect.iBottom = iScreenHeightOffset + 480; //480 + uiTimeRange = 1000; + iPercentage = iRealPercentage = 0; + uiStartTime = GetJA2Clock(); - //BlitBufferToBuffer( FRAME_BUFFER, guiSAVEBUFFER, iScreenWidthOffset, iScreenHeightOffset, - // 640, 480 ); - //BlitBufferToBuffer( guiEXTRABUFFER, FRAME_BUFFER, iScreenWidthOffset, iScreenHeightOffset, 640, 480 ); + BlitBufferToBuffer( FRAME_BUFFER, guiSAVEBUFFER, iScreenWidthOffset, iScreenHeightOffset, + 640, 480 ); + BlitBufferToBuffer( guiEXTRABUFFER, FRAME_BUFFER, iScreenWidthOffset, iScreenHeightOffset, 640, 480 ); - //PlayJA2SampleFromFile( "SOUNDS\\Laptop power up (8-11).wav", RATE_11025, HIGHVOLUME, 1, MIDDLEPAN ); - // - //// WANNE 2 with laptop zooming - //while( iRealPercentage < 100 ) - //{ - // uiCurrTime = GetJA2Clock(); - // iPercentage = (uiCurrTime-uiStartTime) * 100 / uiTimeRange; - // iPercentage = min( iPercentage, 100 ); + PlayJA2SampleFromFile( "SOUNDS\\Laptop power up (8-11).wav", RATE_11025, HIGHVOLUME, 1, MIDDLEPAN ); + + // WANNE 2 with laptop zooming + while( iRealPercentage < 100 ) + { + uiCurrTime = GetJA2Clock(); + iPercentage = (uiCurrTime-uiStartTime) * 100 / uiTimeRange; + iPercentage = min( iPercentage, 100 ); - // iRealPercentage = iPercentage; + iRealPercentage = iPercentage; - // //Factor the percentage so that it is modified by a gravity falling acceleration effect. - // iFactor = (iPercentage - 50) * 2; - // if( iPercentage < 50 ) - // iPercentage = (UINT32)(iPercentage + iPercentage * iFactor * 0.01 + 0.5); - // else - // iPercentage = (UINT32)(iPercentage + (100-iPercentage) * iFactor * 0.01 + 0.5); + //Factor the percentage so that it is modified by a gravity falling acceleration effect. + iFactor = (iPercentage - 50) * 2; + if( iPercentage < 50 ) + iPercentage = (UINT32)(iPercentage + iPercentage * iFactor * 0.01 + 0.5); + else + iPercentage = (UINT32)(iPercentage + (100-iPercentage) * iFactor * 0.01 + 0.5); - // //Laptop source rect - // if( iPercentage < 99 ) - // iScalePercentage = 10000 / (100-iPercentage); - // else - // iScalePercentage = 5333; - // iWidth = 12 * iScalePercentage / 100; - // iHeight = 9 * iScalePercentage / 100; + //Laptop source rect + if( iPercentage < 99 ) + iScalePercentage = 10000 / (100-iPercentage); + else + iScalePercentage = 5333; + iWidth = 12 * iScalePercentage / 100; + iHeight = 9 * iScalePercentage / 100; - // iX = iScreenWidthOffset + 472 - (472-320) * iScalePercentage / 5333; - // iY = iScreenHeightOffset + 424 - (424-240) * iScalePercentage / 5333; + iX = 472 - (472 - (iScreenWidthOffset + 320)) * iScalePercentage / 5333; + iY = 424 - (424 - (iScreenHeightOffset + 240)) * iScalePercentage / 5333; - // SrcRect2.iLeft = iX - iWidth / 2; - // SrcRect2.iRight = SrcRect2.iLeft + iWidth; - // SrcRect2.iTop = iY - iHeight / 2; - // SrcRect2.iBottom = SrcRect2.iTop + iHeight; - // - // BltStretchVideoSurface(FRAME_BUFFER, guiSAVEBUFFER, 0, 0, 0, &DstRect, &SrcRect2 ); + SrcRect2.iLeft = iX - iWidth / 2; + SrcRect2.iRight = SrcRect2.iLeft + iWidth; + SrcRect2.iTop = iY - iHeight / 2; + SrcRect2.iBottom = SrcRect2.iTop + iHeight; + + BltStretchVideoSurface( FRAME_BUFFER, guiSAVEBUFFER, iScreenWidthOffset, iScreenHeightOffset, 0, &DstRect, &SrcRect2 ); - // //WANNE 2 - // InvalidateScreen(); - // - // //WANNE 2 - // RefreshScreen( NULL ); - //} + //WANNE 2 + InvalidateScreen(); + + //WANNE 2 + RefreshScreen( NULL ); + } fReDrawScreenFlag = TRUE; } @@ -2445,14 +2443,11 @@ BOOLEAN LeaveLapTopScreen( void ) if( !gfDontStartTransitionFromLaptop ) { - // WANNE 2: I disabled the laptop animation, because the screen redrawing does not work correctly! - // Madd: It'd be nice if someone who knows more about graphics than I do could re-enable this, at least for 640x480 - - //SGPRect SrcRect1, SrcRect2, DstRect; - //INT32 iPercentage, iScalePercentage, iFactor; - //UINT32 uiStartTime, uiTimeRange, uiCurrTime; - //INT32 iX, iY, iWidth, iHeight; - //INT32 iRealPercentage; + SGPRect SrcRect1, SrcRect2, DstRect; + INT32 iPercentage, iScalePercentage, iFactor; + UINT32 uiStartTime, uiTimeRange, uiCurrTime; + INT32 iX, iY, iWidth, iHeight; + INT32 iRealPercentage; gfDontStartTransitionFromLaptop = TRUE; SetCurrentCursorFromDatabase( VIDEO_NO_CURSOR ); @@ -2467,66 +2462,66 @@ BOOLEAN LeaveLapTopScreen( void ) PrintNumberOnTeam( ); ShowLights(); - ////Step 2: The mapscreen image is in the EXTRABUFFER, and laptop is in the SAVEBUFFER - //// Start transitioning the screen. - //DstRect.iLeft = iScreenWidthOffset + 0; // 0 - //DstRect.iTop = iScreenHeightOffset + 0; // 0 - //DstRect.iRight = iScreenWidthOffset + 640; // 640 - //DstRect.iBottom = iScreenHeightOffset + 480; // 480 - //uiTimeRange = 1000; - //iPercentage = iRealPercentage = 100; - //uiStartTime = GetJA2Clock(); + //Step 2: The mapscreen image is in the EXTRABUFFER, and laptop is in the SAVEBUFFER + // Start transitioning the screen. + DstRect.iLeft = iScreenWidthOffset + 0; // 0 + DstRect.iTop = iScreenHeightOffset + 0; // 0 + DstRect.iRight = iScreenWidthOffset + 640; // 640 + DstRect.iBottom = iScreenHeightOffset + 480; // 480 + uiTimeRange = 1000; + iPercentage = iRealPercentage = 100; + uiStartTime = GetJA2Clock(); - //BlitBufferToBuffer( FRAME_BUFFER, guiSAVEBUFFER, iScreenWidthOffset, iScreenHeightOffset, - // 640, 480 ); + BlitBufferToBuffer( FRAME_BUFFER, guiSAVEBUFFER, iScreenWidthOffset, iScreenHeightOffset, + 640, 480 ); - //PlayJA2SampleFromFile( "SOUNDS\\Laptop power down (8-11).wav", RATE_11025, HIGHVOLUME, 1, MIDDLEPAN ); + PlayJA2SampleFromFile( "SOUNDS\\Laptop power down (8-11).wav", RATE_11025, HIGHVOLUME, 1, MIDDLEPAN ); - //// WANNE 2 - //while( iRealPercentage > 0 ) - //{ - // BlitBufferToBuffer( guiEXTRABUFFER, FRAME_BUFFER, iScreenWidthOffset, iScreenHeightOffset, 640, 480 ); + // WANNE 2 + while( iRealPercentage > 0 ) + { + BlitBufferToBuffer( guiEXTRABUFFER, FRAME_BUFFER, iScreenWidthOffset, iScreenHeightOffset, 640, 480 ); - // uiCurrTime = GetJA2Clock(); - // iPercentage = (uiCurrTime-uiStartTime) * 100 / uiTimeRange; - // iPercentage = min( iPercentage, 100 ); - // iPercentage = 100 - iPercentage; + uiCurrTime = GetJA2Clock(); + iPercentage = (uiCurrTime-uiStartTime) * 100 / uiTimeRange; + iPercentage = min( iPercentage, 100 ); + iPercentage = 100 - iPercentage; - // iRealPercentage = iPercentage; + iRealPercentage = iPercentage; - // //Factor the percentage so that it is modified by a gravity falling acceleration effect. - // iFactor = (iPercentage - 50) * 2; - // if( iPercentage < 50 ) - // iPercentage = (UINT32)(iPercentage + iPercentage * iFactor * 0.01 + 0.5); - // else - // iPercentage = (UINT32)(iPercentage + (100-iPercentage) * iFactor * 0.01 + 0.5); + //Factor the percentage so that it is modified by a gravity falling acceleration effect. + iFactor = (iPercentage - 50) * 2; + if( iPercentage < 50 ) + iPercentage = (UINT32)(iPercentage + iPercentage * iFactor * 0.01 + 0.5); + else + iPercentage = (UINT32)(iPercentage + (100-iPercentage) * iFactor * 0.01 + 0.5); - // //Mapscreen source rect - // SrcRect1.iLeft = iScreenWidthOffset + 464 * iPercentage / 100; - // SrcRect1.iRight = iScreenWidthOffset + 640 - 163 * iPercentage / 100; - // SrcRect1.iTop = iScreenHeightOffset + 417 * iPercentage / 100; - // SrcRect1.iBottom = iScreenHeightOffset + 480 - 55 * iPercentage / 100; - // //Laptop source rect - // if( iPercentage < 99 ) - // iScalePercentage = 10000 / (100-iPercentage); - // else - // iScalePercentage = 5333; - // iWidth = 12 * iScalePercentage / 100; - // iHeight = 9 * iScalePercentage / 100; - // iX = iScreenWidthOffset + 472 - (472-320) * iScalePercentage / 5333; - // iY = iScreenHeightOffset + 424 - (424-240) * iScalePercentage / 5333; + //Mapscreen source rect + SrcRect1.iLeft = iScreenWidthOffset + 464 * iPercentage / 100; + SrcRect1.iRight = iScreenWidthOffset + 640 - 163 * iPercentage / 100; + SrcRect1.iTop = iScreenHeightOffset + 417 * iPercentage / 100; + SrcRect1.iBottom = iScreenHeightOffset + 480 - 55 * iPercentage / 100; + //Laptop source rect + if( iPercentage < 99 ) + iScalePercentage = 10000 / (100-iPercentage); + else + iScalePercentage = 5333; + iWidth = 12 * iScalePercentage / 100; + iHeight = 9 * iScalePercentage / 100; + iX = 472 - (472 - (iScreenWidthOffset + 320)) * iScalePercentage / 5333; + iY = 424 - (424 - (iScreenHeightOffset + 240)) * iScalePercentage / 5333; - // SrcRect2.iLeft = iX - iWidth / 2; - // SrcRect2.iRight = SrcRect2.iLeft + iWidth; - // SrcRect2.iTop = iY - iHeight / 2; - // SrcRect2.iBottom = SrcRect2.iTop + iHeight; + SrcRect2.iLeft = iX - iWidth / 2; + SrcRect2.iRight = SrcRect2.iLeft + iWidth; + SrcRect2.iTop = iY - iHeight / 2; + SrcRect2.iBottom = SrcRect2.iTop + iHeight; - // BltStretchVideoSurface( FRAME_BUFFER, guiSAVEBUFFER, 0, 0, 0, &DstRect, &SrcRect2 ); + BltStretchVideoSurface( FRAME_BUFFER, guiSAVEBUFFER, 0, iScreenWidthOffset, iScreenHeightOffset, &DstRect, &SrcRect2 ); - // InvalidateScreen(); - // //gfPrintFrameBuffer = TRUE; - // RefreshScreen( NULL ); - //} + InvalidateScreen(); + //gfPrintFrameBuffer = TRUE; + RefreshScreen( NULL ); + } } } return( TRUE ); @@ -4519,8 +4514,8 @@ BOOLEAN DisplayTitleBarMaximizeGraphic(BOOLEAN fForward, BOOLEAN fInit, UINT16 u sPosBottomY = LAPTOP_TITLE_BAR_HEIGHT; - SrcRect.iLeft = iScreenWidthOffset; - SrcRect.iTop = iScreenHeightOffset; + SrcRect.iLeft = 0; + SrcRect.iTop = 0; SrcRect.iRight = LAPTOP_TITLE_BAR_WIDTH; SrcRect.iBottom = LAPTOP_TITLE_BAR_HEIGHT; diff --git a/Tactical/Bullets.h b/Tactical/Bullets.h index 5a2774c0..cbbd3b5d 100644 --- a/Tactical/Bullets.h +++ b/Tactical/Bullets.h @@ -15,6 +15,7 @@ #define BULLET_FLAG_TANK_CANNON 0x0020 #define BULLET_FLAG_BUCKSHOT 0x0040 #define BULLET_FLAG_FLAME 0x0080 +#define BULLET_FLAG_TRACER 0x0100 typedef struct { diff --git a/Tactical/Interface Items.cpp b/Tactical/Interface Items.cpp index 78e899a6..798f5af2 100644 --- a/Tactical/Interface Items.cpp +++ b/Tactical/Interface Items.cpp @@ -5677,6 +5677,8 @@ BOOLEAN LoadTileGraphicForItem( INVTYPE *pItem, UINT32 *puiVo ) VOBJECT_DESC VObjectDesc; UINT16 ubGraphic; + DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("LoadTileGraphicForItem")); + // CHECK SUBCLASS ubGraphic = pItem->ubGraphicNum; @@ -5735,6 +5737,8 @@ BOOLEAN LoadTileGraphicForItem( INVTYPE *pItem, UINT32 *puiVo ) *puiVo = uiVo; + DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("LoadTileGraphicForItem: done")); + return( TRUE ); } @@ -7298,7 +7302,7 @@ void GetHelpTextForItem( INT16 * pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldi // 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 ); + swprintf( (wchar_t *)pStr, L"%s [%d rnds]", ItemNames[ usItem ], pObject->ubShotsLeft[0] ); } // The final, and typical case, is that of an item with a percent status else diff --git a/Tactical/LOS.cpp b/Tactical/LOS.cpp index 047ad596..a7e944d8 100644 --- a/Tactical/LOS.cpp +++ b/Tactical/LOS.cpp @@ -3534,6 +3534,10 @@ INT8 FireBulletGivenTarget( SOLDIERTYPE * pFirer, FLOAT dEndX, FLOAT dEndY, FLOA usBulletFlags |= BULLET_FLAG_FLAME; ubSpreadIndex = 2; } + else if ( AmmoTypes[ pFirer->inv[pFirer->ubAttackingHand].ubGunAmmoType ].tracerEffect && pFirer->bDoBurst ) + { + usBulletFlags |= BULLET_FLAG_TRACER; + } ubImpact =(UINT8) GetDamage(&pFirer->inv[pFirer->ubAttackingHand]); // if (!fFake) @@ -4196,7 +4200,7 @@ void MoveBullet( INT32 iBullet ) return; } - if ( pBullet->usFlags & ( BULLET_FLAG_MISSILE | BULLET_FLAG_SMALL_MISSILE | BULLET_FLAG_TANK_CANNON | BULLET_FLAG_FLAME | BULLET_FLAG_CREATURE_SPIT ) ) + if ( pBullet->usFlags & ( BULLET_FLAG_MISSILE | BULLET_FLAG_SMALL_MISSILE | BULLET_FLAG_TANK_CANNON | BULLET_FLAG_FLAME | BULLET_FLAG_CREATURE_SPIT | BULLET_FLAG_TRACER ) ) { INT8 bStepsPerMove = STEPS_FOR_BULLET_MOVE_TRAILS; @@ -4481,11 +4485,11 @@ void MoveBullet( INT32 iBullet ) pBullet->iCurrCubesZ = CONVERT_HEIGHTUNITS_TO_INDEX( FIXEDPT_TO_INT32( pBullet->qCurrZ ) ); pBullet->iLoop++; - if ( pBullet->usFlags & ( BULLET_FLAG_MISSILE | BULLET_FLAG_SMALL_MISSILE | BULLET_FLAG_TANK_CANNON | BULLET_FLAG_FLAME | BULLET_FLAG_CREATURE_SPIT ) ) + if ( pBullet->usFlags & ( BULLET_FLAG_MISSILE | BULLET_FLAG_SMALL_MISSILE | BULLET_FLAG_TANK_CANNON | BULLET_FLAG_FLAME | BULLET_FLAG_CREATURE_SPIT | BULLET_FLAG_TRACER ) ) { INT8 bStepsPerMove = STEPS_FOR_BULLET_MOVE_TRAILS; - if ( pBullet->usFlags & ( BULLET_FLAG_SMALL_MISSILE ) ) + if ( pBullet->usFlags & ( BULLET_FLAG_SMALL_MISSILE | BULLET_FLAG_TRACER ) ) { bStepsPerMove = STEPS_FOR_BULLET_MOVE_SMALL_TRAILS; } diff --git a/Tactical/Weapons.h b/Tactical/Weapons.h index 32cf36e6..e40d5551 100644 --- a/Tactical/Weapons.h +++ b/Tactical/Weapons.h @@ -166,6 +166,7 @@ typedef struct BOOLEAN ignoreArmour; BOOLEAN acidic; INT16 lockBustingPower; + BOOLEAN tracerEffect; } AMMOTYPE; diff --git a/Tactical/XML_AmmoTypes.cpp b/Tactical/XML_AmmoTypes.cpp index af2cad56..c2eae81f 100644 --- a/Tactical/XML_AmmoTypes.cpp +++ b/Tactical/XML_AmmoTypes.cpp @@ -110,6 +110,7 @@ ammotypeStartElementHandle(void *userData, const char *name, const char **atts) strcmp(name, "ignoreArmour") == 0 || strcmp(name, "lockBustingPower") == 0 || strcmp(name, "acidic") == 0 || + strcmp(name, "tracerEffect") == 0 || strcmp(name, "monsterSpit") == 0 )) { pData->curElement = ELEMENT_PROPERTY; @@ -297,6 +298,11 @@ ammotypeEndElementHandle(void *userData, const char *name) pData->curElement = ELEMENT; pData->curAmmoType.acidic = (BOOLEAN) atol(pData->szCharData); } + else if(strcmp(name, "tracerEffect") == 0) + { + pData->curElement = ELEMENT; + pData->curAmmoType.tracerEffect = (BOOLEAN) atol(pData->szCharData); + } pData->maxReadDepth--; } @@ -417,6 +423,7 @@ BOOLEAN WriteAmmoTypeStats() FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].acidic ); FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].ignoreArmour ); FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].lockBustingPower ); + FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].tracerEffect ); FilePrintf(hFile,"\t\r\n"); diff --git a/Tactical/bullets.cpp b/Tactical/bullets.cpp index 8fcf1922..85256d33 100644 --- a/Tactical/bullets.cpp +++ b/Tactical/bullets.cpp @@ -256,7 +256,7 @@ void UpdateBullets( ) { // ALRIGHTY, CHECK WHAT TYPE OF BULLET WE ARE - if ( gBullets[ uiCount ].usFlags & ( BULLET_FLAG_CREATURE_SPIT | BULLET_FLAG_KNIFE | BULLET_FLAG_MISSILE | BULLET_FLAG_SMALL_MISSILE | BULLET_FLAG_TANK_CANNON | BULLET_FLAG_FLAME ) ) + if ( gBullets[ uiCount ].usFlags & ( BULLET_FLAG_CREATURE_SPIT | BULLET_FLAG_KNIFE | BULLET_FLAG_MISSILE | BULLET_FLAG_SMALL_MISSILE | BULLET_FLAG_TANK_CANNON | BULLET_FLAG_FLAME | BULLET_FLAG_TRACER ) ) { } else @@ -300,7 +300,7 @@ void UpdateBullets( ) } } // Are we a missle? - else if ( gBullets[ uiCount ].usFlags & ( BULLET_FLAG_MISSILE | BULLET_FLAG_SMALL_MISSILE | BULLET_FLAG_TANK_CANNON | BULLET_FLAG_FLAME | BULLET_FLAG_CREATURE_SPIT ) ) + else if ( gBullets[ uiCount ].usFlags & ( BULLET_FLAG_MISSILE | BULLET_FLAG_SMALL_MISSILE | BULLET_FLAG_TANK_CANNON | BULLET_FLAG_FLAME | BULLET_FLAG_CREATURE_SPIT | BULLET_FLAG_TRACER ) ) { } else @@ -360,7 +360,7 @@ void AddMissileTrail( BULLET *pBullet, FIXEDPT qCurrX, FIXEDPT qCurrY, FIXEDPT q ANITILE_PARAMS AniParams; // If we are a small missle, don't show - if ( pBullet->usFlags & ( BULLET_FLAG_SMALL_MISSILE | BULLET_FLAG_FLAME | BULLET_FLAG_CREATURE_SPIT ) ) + if ( pBullet->usFlags & ( BULLET_FLAG_SMALL_MISSILE | BULLET_FLAG_FLAME | BULLET_FLAG_CREATURE_SPIT | BULLET_FLAG_TRACER ) ) { if ( pBullet->iLoop < 5 ) { @@ -406,6 +406,10 @@ void AddMissileTrail( BULLET *pBullet, FIXEDPT qCurrX, FIXEDPT qCurrY, FIXEDPT q strcpy( AniParams.zCachedFile, "TILECACHE\\FLMTHR2.STI" ); AniParams.sDelay = (INT16)( 100 ); } + else if ( pBullet->usFlags & ( BULLET_FLAG_TRACER ) ) + { + strcpy( AniParams.zCachedFile, "TILECACHE\\BULLET_TRACER.STI" ); + } CreateAnimationTile( &AniParams ); }