From 9f787dd73d68255ac033ae6648bc4570b5d0fafa Mon Sep 17 00:00:00 2001 From: Sevenfm Date: Thu, 14 Oct 2021 06:40:28 +0000 Subject: [PATCH] QOL change: show additional ammo stats at bobby ray's website (by rftr). git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9176 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Laptop/BobbyRGuns.cpp | 61 ++++++++++++++++++++++++++++++++++++++++++ Utils/Text.h | 3 +++ Utils/_ChineseText.cpp | 3 +++ Utils/_DutchText.cpp | 3 +++ Utils/_EnglishText.cpp | 3 +++ Utils/_FrenchText.cpp | 3 +++ Utils/_GermanText.cpp | 3 +++ Utils/_ItalianText.cpp | 3 +++ Utils/_PolishText.cpp | 3 +++ Utils/_RussianText.cpp | 3 +++ 10 files changed, 88 insertions(+) diff --git a/Laptop/BobbyRGuns.cpp b/Laptop/BobbyRGuns.cpp index 2e6557db..adda90a6 100644 --- a/Laptop/BobbyRGuns.cpp +++ b/Laptop/BobbyRGuns.cpp @@ -338,6 +338,9 @@ UINT16 DisplayExplosiveDamage(UINT16 usPosY, UINT16 usIndex, UINT16 usFontHeight UINT16 DisplayExplosiveStunDamage(UINT16 usPosY, UINT16 usIndex, UINT16 usFontHeight); UINT16 DisplayProtection(UINT16 usPosY, UINT16 usIndex, UINT16 usFontHeight); UINT16 DisplayCamo(UINT16 usPosY, UINT16 usIndex, UINT16 usFontHeight); +UINT16 DisplayAmmoArmourPierceModifier(UINT16 usPosY, UINT16 usIndex, UINT16 usFontHeight); +UINT16 DisplayAmmoDamageModifier(UINT16 usPosY, UINT16 usIndex, UINT16 usFontHeight); +UINT16 DisplayAmmoProjectileCount(UINT16 usPosY, UINT16 usIndex, UINT16 usFontHeight); void CreateMouseRegionForBigImage(UINT16 usPosY, UINT8 ubCount, INT16 *pItemNumbers ); // HEADROCK HAM 4: Now can purchase ALL items available. void PurchaseBobbyRayItem(UINT16 usItemNumber, BOOLEAN fAllItems ); @@ -1869,6 +1872,11 @@ BOOLEAN DisplayAmmoInfo(UINT16 usIndex, UINT16 usTextPosY, BOOLEAN fUsed, UINT16 //Magazine usHeight = DisplayMagazine(usHeight, usIndex, usFontHeight); + // rftr: display ammo stats + usHeight = DisplayAmmoArmourPierceModifier(usHeight, usIndex, usFontHeight); + usHeight = DisplayAmmoDamageModifier(usHeight, usIndex, usFontHeight); + usHeight = DisplayAmmoProjectileCount(usHeight, usIndex, usFontHeight); + //Display the Cost and the qty bought and on hand usHeight = DisplayCostAndQty(usTextPosY, usIndex, usFontHeight, usBobbyIndex, fUsed); @@ -2331,6 +2339,59 @@ UINT16 DisplayCamo(UINT16 usPosY, UINT16 usIndex, UINT16 usFontHeight) return(usPosY); } +UINT16 DisplayAmmoArmourPierceModifier(UINT16 usPosY, UINT16 usIndex, UINT16 usFontHeight) +{ + CHAR16 sTemp[10]; + + DrawTextToScreen(BobbyRText[BOBBYR_GUNS_ARMOUR_PIERCING_MODIFIER], BOBBYR_ITEM_WEIGHT_TEXT_X, (UINT16)usPosY, 0, BOBBYR_ITEM_DESC_TEXT_FONT, BOBBYR_STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED); + // armour piercing modifier + const FLOAT armourImpactReductionModifier = (FLOAT)AmmoTypes[Magazine[Item[usIndex].ubClassIndex].ubAmmoType].armourImpactReductionMultiplier / (FLOAT)AmmoTypes[Magazine[Item[usIndex].ubClassIndex].ubAmmoType].armourImpactReductionDivisor; + swprintf(sTemp, L"%1.2f", armourImpactReductionModifier); + UINT8 color = BOBBYR_ITEM_DESC_TEXT_COLOR_ALT; + if (armourImpactReductionModifier > 1.0f) + color = FONT_MCOLOR_DKRED; + else if (armourImpactReductionModifier < 1.0f) + color = FONT_MCOLOR_LTGREEN; + DrawTextToScreen(sTemp, BOBBYR_ITEM_WEIGHT_NUM_X, (UINT16)usPosY, BOBBYR_ITEM_WEIGHT_NUM_WIDTH, BOBBYR_ITEM_DESC_TEXT_FONT, color, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED); + + usPosY += usFontHeight + 2; + return(usPosY); +} + +UINT16 DisplayAmmoDamageModifier(UINT16 usPosY, UINT16 usIndex, UINT16 usFontHeight) +{ + CHAR16 sTemp[10]; + + DrawTextToScreen(BobbyRText[BOBBYR_GUNS_BULLET_TUMBLE_MODIFIER], BOBBYR_ITEM_WEIGHT_TEXT_X, (UINT16)usPosY, 0, BOBBYR_ITEM_DESC_TEXT_FONT, BOBBYR_STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED); + // body damage modifier (bullet tumble) + const FLOAT afterArmourDamageModifier = (FLOAT)AmmoTypes[Magazine[Item[usIndex].ubClassIndex].ubAmmoType].afterArmourDamageMultiplier / (FLOAT)AmmoTypes[Magazine[Item[usIndex].ubClassIndex].ubAmmoType].afterArmourDamageDivisor; + swprintf(sTemp, L"%1.2f", afterArmourDamageModifier); + UINT8 color = BOBBYR_ITEM_DESC_TEXT_COLOR_ALT; + if (afterArmourDamageModifier > 1.0f) + color = FONT_MCOLOR_LTGREEN; + else if (afterArmourDamageModifier < 1.0f) + color = FONT_MCOLOR_DKRED; + DrawTextToScreen(sTemp, BOBBYR_ITEM_WEIGHT_NUM_X, (UINT16)usPosY, BOBBYR_ITEM_WEIGHT_NUM_WIDTH, BOBBYR_ITEM_DESC_TEXT_FONT, color, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED); + + usPosY += usFontHeight + 2; + return(usPosY); +} + +UINT16 DisplayAmmoProjectileCount(UINT16 usPosY, UINT16 usIndex, UINT16 usFontHeight) +{ + const UINT8 numProjectiles = AmmoTypes[Magazine[Item[usIndex].ubClassIndex].ubAmmoType].numberOfBullets; + if (numProjectiles == 1) + return(usPosY); + + CHAR16 sTemp[4]; + DrawTextToScreen(BobbyRText[BOBBYR_GUNS_NUM_PROJECTILES], BOBBYR_ITEM_WEIGHT_TEXT_X, (UINT16)usPosY, 0, BOBBYR_ITEM_DESC_TEXT_FONT, BOBBYR_STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED); + swprintf(sTemp, L"%d", numProjectiles); + DrawTextToScreen(sTemp, BOBBYR_ITEM_WEIGHT_NUM_X, (UINT16)usPosY, BOBBYR_ITEM_WEIGHT_NUM_WIDTH, BOBBYR_ITEM_DESC_TEXT_FONT, BOBBYR_ITEM_DESC_TEXT_COLOR_ALT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED); + + usPosY += usFontHeight + 2; + return(usPosY); +} + // CHRISL: New display function for LBE Gear UINT16 DisplayLBEInfo(UINT16 usPosY, UINT16 usIndex, UINT16 usFontHeight) { diff --git a/Utils/Text.h b/Utils/Text.h index bcf3d705..081a4aae 100644 --- a/Utils/Text.h +++ b/Utils/Text.h @@ -1499,6 +1499,9 @@ enum BOBBYR_GUNS_STUN, BOBBYR_GUNS_PROTECTION, BOBBYR_GUNS_CAMO, + BOBBYR_GUNS_ARMOUR_PIERCING_MODIFIER, + BOBBYR_GUNS_BULLET_TUMBLE_MODIFIER, + BOBBYR_GUNS_NUM_PROJECTILES, BOBBYR_GUNS_COST, BOBBYR_GUNS_IN_STOCK, BOBBYR_GUNS_QTY_ON_ORDER, diff --git a/Utils/_ChineseText.cpp b/Utils/_ChineseText.cpp index 9ce83a8f..79681dfc 100644 --- a/Utils/_ChineseText.cpp +++ b/Utils/_ChineseText.cpp @@ -5731,6 +5731,9 @@ STR16 BobbyRText[] = L"晕眩: ", //L"Stun:", // Weapon's Stun Damage L"防护: ", //L"Protect:", // Armour's Protection L"伪装: ", //L"Camo:", // Armour's Camouflage + L"Armor Pen:", // Ammo's Armour Piercing modifier (see AmmoTypes.xml - armourImpactReduction) + L"Dmg Mod:", // Ammo's Bullet Tumble modifier (see AmmoTypes.xml - afterArmourDamage) + L"Projectiles:", // Ammo's bullet count (for buckshot) (see AmmoTypes.xml - numberOfBullets) L"单价: ", //"Cost:", // Cost of the item L"库存: ", //"In stock:", // The number of items still in the store's inventory L"购买量: ", //"Qty on Order:", // The number of items on order diff --git a/Utils/_DutchText.cpp b/Utils/_DutchText.cpp index 68223c31..e987f64e 100644 --- a/Utils/_DutchText.cpp +++ b/Utils/_DutchText.cpp @@ -5720,6 +5720,9 @@ STR16 BobbyRText[] = L"Stun:", // Weapon's Stun Damage L"Protect:", // Armour's Protection L"Camo:", // Armour's Camouflage + L"Armor Pen:", // Ammo's Armour Piercing modifier (see AmmoTypes.xml - armourImpactReduction) + L"Dmg Mod:", // Ammo's Bullet Tumble modifier (see AmmoTypes.xml - afterArmourDamage) + L"Projectiles:", // Ammo's bullet count (for buckshot) (see AmmoTypes.xml - numberOfBullets) L"Kost:", // Cost of the item L"Aanwezig:", // The number of items still in the store's inventory L"# Besteld:", // The number of items on order diff --git a/Utils/_EnglishText.cpp b/Utils/_EnglishText.cpp index 4b607fcf..c292062c 100644 --- a/Utils/_EnglishText.cpp +++ b/Utils/_EnglishText.cpp @@ -5731,6 +5731,9 @@ STR16 BobbyRText[] = L"Stun:", // Weapon's Stun Damage L"Protect:", // Armour's Protection L"Camo:", // Armour's Camouflage + L"Armor Pen:", // Ammo's Armour Piercing modifier (see AmmoTypes.xml - armourImpactReduction) + L"Dmg Mod:", // Ammo's Bullet Tumble modifier (see AmmoTypes.xml - afterArmourDamage) + L"Projectiles:", // Ammo's bullet count (for buckshot) (see AmmoTypes.xml - numberOfBullets) L"Cost:", // Cost of the item L"In stock:", // The number of items still in the store's inventory L"Qty on Order:", // The number of items on order diff --git a/Utils/_FrenchText.cpp b/Utils/_FrenchText.cpp index 258a39ce..5cde622a 100644 --- a/Utils/_FrenchText.cpp +++ b/Utils/_FrenchText.cpp @@ -5724,6 +5724,9 @@ STR16 BobbyRText[] = L"Étourdis. :", // Weapon's Stun Damage L"Prot. :", // Armour's Protection L"Cam. :", // Armour's Camouflage + L"Armor Pen:", // Ammo's Armour Piercing modifier (see AmmoTypes.xml - armourImpactReduction) + L"Dmg Mod:", // Ammo's Bullet Tumble modifier (see AmmoTypes.xml - afterArmourDamage) + L"Projectiles:", // Ammo's bullet count (for buckshot) (see AmmoTypes.xml - numberOfBullets) L"Prix :", // Cost of the item L"Stock :", // The number of items still in the store's inventory L"Quantité :", // The number of items on order diff --git a/Utils/_GermanText.cpp b/Utils/_GermanText.cpp index 04d4a978..19726bc9 100644 --- a/Utils/_GermanText.cpp +++ b/Utils/_GermanText.cpp @@ -5641,6 +5641,9 @@ STR16 BobbyRText[] = L"Bet.:", // Weapon's Stun Damage L"Rüstung:", // Armour's Protection L"Tarn.:", // Armour's Camouflage + L"Armor Pen:", // Ammo's Armour Piercing modifier (see AmmoTypes.xml - armourImpactReduction) + L"Dmg Mod:", // Ammo's Bullet Tumble modifier (see AmmoTypes.xml - afterArmourDamage) + L"Projectiles:", // Ammo's bullet count (for buckshot) (see AmmoTypes.xml - numberOfBullets) L"Preis:", // Cost of the item L"Vorrätig:", // The number of items still in the store's inventory L"Bestellt:", // The number of items on order diff --git a/Utils/_ItalianText.cpp b/Utils/_ItalianText.cpp index c57e5aad..ab146673 100644 --- a/Utils/_ItalianText.cpp +++ b/Utils/_ItalianText.cpp @@ -5706,6 +5706,9 @@ STR16 BobbyRText[] = L"Stun:", // Weapon's Stun Damage L"Protect:", // Armour's Protection L"Trav.:", // Armour's Camouflage + L"Armor Pen:", // Ammo's Armour Piercing modifier (see AmmoTypes.xml - armourImpactReduction) + L"Dmg Mod:", // Ammo's Bullet Tumble modifier (see AmmoTypes.xml - afterArmourDamage) + L"Projectiles:", // Ammo's bullet count (for buckshot) (see AmmoTypes.xml - numberOfBullets) L"Costo:", // Cost of the item L"Inventario:", // The number of items still in the store's inventory L"Num. ordine:", // The number of items on order diff --git a/Utils/_PolishText.cpp b/Utils/_PolishText.cpp index a6f5210e..af89a74a 100644 --- a/Utils/_PolishText.cpp +++ b/Utils/_PolishText.cpp @@ -5720,6 +5720,9 @@ STR16 BobbyRText[] = L"Ogłuszenie:", // Weapon's Stun Damage L"Ochrona:", // Armour's Protection L"Kamuf.:", // Armour's Camouflage + L"Armor Pen:", // Ammo's Armour Piercing modifier (see AmmoTypes.xml - armourImpactReduction) + L"Dmg Mod:", // Ammo's Bullet Tumble modifier (see AmmoTypes.xml - afterArmourDamage) + L"Projectiles:", // Ammo's bullet count (for buckshot) (see AmmoTypes.xml - numberOfBullets) L"Koszt:", // Cost of the item L"Na stanie:", // The number of items still in the store's inventory L"Ilość na zamów.:", // The number of items on order diff --git a/Utils/_RussianText.cpp b/Utils/_RussianText.cpp index acf2f03f..0fb0d900 100644 --- a/Utils/_RussianText.cpp +++ b/Utils/_RussianText.cpp @@ -5726,6 +5726,9 @@ STR16 BobbyRText[] = L"Оглушение:", // Weapon's Stun Damage L"Броня:", // Armour's Protection L"Камуф.:", // Armour's Camouflage + L"Armor Pen:", // Ammo's Armour Piercing modifier (see AmmoTypes.xml - armourImpactReduction) + L"Dmg Mod:", // Ammo's Bullet Tumble modifier (see AmmoTypes.xml - afterArmourDamage) + L"Projectiles:", // Ammo's bullet count (for buckshot) (see AmmoTypes.xml - numberOfBullets) L"Цена:", // Cost of the item L"Склад:", // The number of items still in the store's inventory L"Штук в заказе:", // The number of items on order