From 1ba75f97450ff0ca9834b247704c9080c985cce0 Mon Sep 17 00:00:00 2001 From: lalien Date: Mon, 29 May 2006 21:15:42 +0000 Subject: [PATCH] - tool tips for Bobby Ray added git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@133 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- GameVersion.cpp | 2 +- JA2.vcproj | 4 +- Laptop/BobbyRGuns.cpp | 190 ++++++++++++++++++++++++++++++++++++++---- 3 files changed, 176 insertions(+), 20 deletions(-) diff --git a/GameVersion.cpp b/GameVersion.cpp index 338edf47..e1485fbb 100644 --- a/GameVersion.cpp +++ b/GameVersion.cpp @@ -23,7 +23,7 @@ INT16 zVersionLabel[256] = { L"Beta v. 0.98" }; #else //RELEASE BUILD VERSION - INT16 zVersionLabel[256] = { L"Release v1.13.132" }; + INT16 zVersionLabel[256] = { L"Release v1.13.133" }; #endif diff --git a/JA2.vcproj b/JA2.vcproj index 17c964ef..b72d0071 100644 --- a/JA2.vcproj +++ b/JA2.vcproj @@ -43,7 +43,7 @@ 0) + // { + // swprintf( (wchar_t *)apStr2, L" / %d", ubAttackAPs + CalcAPsToBurst( DEFAULT_APS, pObject ) ); + // wcscat( apStr, apStr2 ); + // } + // else + // { + // wcscat( apStr, L" / -" ); + // } + + // if (GetAutofireShotsPerFiveAPs(pObject) > 0) + // { + // swprintf( (wchar_t *)apStr2, L" / %d", ubAttackAPs + CalcAPsToAutofire( DEFAULT_APS, pObject, 3 ) ); + // wcscat( apStr, apStr2 ); + // } + // else + // { + // wcscat( apStr, L" / -" ); + // } + //} + //else + //{ + // swprintf( (wchar_t *)apStr, L"" ); + //} + + //Info for weapons + if ( Item[ pItemNumbers[ i ] ].usItemClass == IC_GUN ) + { + swprintf( (wchar_t *)pStr, L"%s (%s)\n%s %d\n%s %d\n%s %d\n%s %s\n%s %1.1f %s", + ItemNames[ pItemNumbers[ i ] ], + AmmoCaliber[ Weapon[ pItemNumbers[ i ] ].ubCalibre ], + gWeaponStatsDesc[ 9 ], //Accuracy String + Weapon[ pItemNumbers[ i ] ].bAccuracy, + gWeaponStatsDesc[ 11 ], //Damage String + Weapon[ pItemNumbers[ i ] ].ubImpact, + gWeaponStatsDesc[ 10 ], //Range String + Weapon[ pItemNumbers[ i ] ].usRange, //Gun Range + gWeaponStatsDesc[ 5 ], //AP String + //apStr, //AP's + L"- / - / -", + gWeaponStatsDesc[ 12 ], //Weight String + fWeight, //Weight + GetWeightUnitString() //Weight units + ); + } + + + // The next is for ammunition which gets the measurement 'rnds' + else if (Item[ pItemNumbers[ i ] ].usItemClass == IC_AMMO) + { + swprintf( (wchar_t *)pStr, L"%s\n%s %1.1f %s", + ItemNames[ pItemNumbers[ i ] ], //Item long name + gWeaponStatsDesc[ 12 ], //Weight String + fWeight, //Weight + GetWeightUnitString() //Weight units + ); + + //Lal: do not delete, commented out for next version + //swprintf( (wchar_t *)pStr, L"%s %s %s %d [%d rnds]\n%s %1.1f %s", + // AmmoCaliber[ Magazine[ Item[usItem].ubClassIndex ].ubCalibre ], //Ammo calibre + // AmmoTypes[Magazine[ Item[usItem].ubClassIndex ].ubAmmoType].ammoName, //Ammo type + // MagNames[Magazine[ Item[usItem].ubClassIndex ].ubMagType], //Magazine type + // Magazine[ Item[usItem].ubClassIndex ].ubMagSize, //Magazine capacity + // pObject->ubShotsLeft[0], //Shots left + // gWeaponStatsDesc[ 12 ], //Weight String + // fWeight, //Weight + // GetWeightUnitString() //Weight units + // ); + } + + // explosives + else if ( (Item[ pItemNumbers[ i ] ].usItemClass == IC_GRENADE)||(Item[ pItemNumbers[ i ] ].usItemClass == IC_BOMB) ) + { + UINT16 explDamage = (UINT16)( Explosive[Item[ pItemNumbers[ i ] ].ubClassIndex].ubDamage + ( (double) Explosive[Item[ pItemNumbers[ i ] ].ubClassIndex].ubDamage / 100) * gGameExternalOptions.ubExplosivesDamageMultiplier ); + UINT16 explStunDamage = (UINT16)( Explosive[Item[ pItemNumbers[ i ] ].ubClassIndex].ubStunDamage + ( (double) Explosive[Item[ pItemNumbers[ i ] ].ubClassIndex].ubStunDamage / 100) * gGameExternalOptions.ubExplosivesDamageMultiplier ); + + swprintf( (wchar_t *)pStr, L"%s\n%s %d\n%s %d\n%s %1.1f %s", + ItemNames[ pItemNumbers[ i ] ], + gWeaponStatsDesc[ 11 ], //Damage String + explDamage, + gWeaponStatsDesc[ 13 ], //Stun Damage String + explStunDamage, //Stun Damage + gWeaponStatsDesc[ 12 ], //Weight String + fWeight, //Weight + GetWeightUnitString() //Weight units + ); + } + + //Armor + else if (Item[ pItemNumbers[ i ] ].usItemClass == IC_ARMOUR) + { + INT32 iProtection = Armour[ Item[ pItemNumbers[ i ] ].ubClassIndex ].ubProtection; + + switch( Armour[ Item[ pItemNumbers[ i ] ].ubClassIndex ].ubArmourClass ) + { + case( ARMOURCLASS_HELMET ): + iProtection = 15 * iProtection / Armour[ Item[ SPECTRA_HELMET_18 ].ubClassIndex ].ubProtection; + break; + + case( ARMOURCLASS_VEST ): + iProtection = 65 * iProtection / ( Armour[ Item[ SPECTRA_VEST_18 ].ubClassIndex ].ubProtection + Armour[ Item[ CERAMIC_PLATES ].ubClassIndex ].ubProtection ); + break; + + case( ARMOURCLASS_LEGGINGS ): + iProtection = 25 * iProtection / Armour[ Item[ SPECTRA_LEGGINGS_18 ].ubClassIndex ].ubProtection; + break; + + case( ARMOURCLASS_PLATE ): + iProtection = 65 * iProtection / ( Armour[ Item[ CERAMIC_PLATES ].ubClassIndex ].ubProtection ); + break; + } + + swprintf( (wchar_t *)pStr, L"%s [%d %%]\n%s %d%% (%d)\n%s %d%%\n%s %1.1f %s", + ItemNames[ pItemNumbers[ i ] ], //Item long name + pInvPanelTitleStrings[ 4 ], //Protection string + iProtection, //Protection rating in % based on best armor + Armour[ Item[ pItemNumbers[ i ] ].ubClassIndex ].ubProtection, //Protection (raw data) + pInvPanelTitleStrings[ 3 ], //Camo string + Item[ pItemNumbers[ i ] ].camobonus, //Camo bonus + gWeaponStatsDesc[ 12 ], //Weight string + fWeight, //Weight + GetWeightUnitString() //Weight units + ); + } + + // The final, and typical case, is that of an item with a percent status + else + { + swprintf( (wchar_t *)pStr, L"%s\n%s %1.1f %s", + ItemNames[ pItemNumbers[ i ] ], //Item long name + gWeaponStatsDesc[ 12 ], //Weight String + fWeight, //Weight + GetWeightUnitString() //Weight units + ); + } + + + + + + + + SetRegionFastHelpText( &gSelectedBigImageRegion[ i ], pStr ); SetRegionHelpEndCallback( &gSelectedBigImageRegion[ i ], BobbyrRGunsHelpTextDoneCallBack ); usPosY += BOBBYR_GRID_OFFSET;