From 6e824810ab9c79b5b75a208ffe3eeb345017a340 Mon Sep 17 00:00:00 2001 From: Flugente Date: Mon, 9 Mar 2015 18:19:34 +0000 Subject: [PATCH] - Fix: profile id was used instead of profile's face id - Fix: squad names were not used correctly - Change: spotter minimum preparation time lowered to 2 turns (was 3) - Change: spotter ct bonus has been doubled - Cahnge: spotter cth bonus now works for rifles and sniper rifles git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7774 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- GameSettings.cpp | 2 +- Laptop/DynamicDialogueWidget.cpp | 2 +- Laptop/merccompare.cpp | 4 ++-- Tactical/Handle UI.cpp | 6 +++++- Tactical/Interface Panels.cpp | 7 +++++-- Tactical/Soldier Control.cpp | 16 ++++++++-------- Tactical/Turn Based Input.cpp | 4 ++-- Tactical/Weapons.cpp | 6 +++--- Utils/Text.h | 2 ++ Utils/_ChineseText.cpp | 1 + Utils/_DutchText.cpp | 1 + Utils/_EnglishText.cpp | 1 + Utils/_FrenchText.cpp | 1 + Utils/_GermanText.cpp | 1 + Utils/_ItalianText.cpp | 1 + Utils/_PolishText.cpp | 1 + Utils/_RussianText.cpp | 1 + 17 files changed, 37 insertions(+), 20 deletions(-) diff --git a/GameSettings.cpp b/GameSettings.cpp index 3278f724..4e083281 100644 --- a/GameSettings.cpp +++ b/GameSettings.cpp @@ -1254,7 +1254,7 @@ void LoadGameExternalOptions() gGameExternalOptions.fScopeModes = iniReader.ReadBoolean("Tactical Gameplay Settings","USE_SCOPE_MODES", FALSE); gGameExternalOptions.fDisplayScopeModes = iniReader.ReadBoolean("Tactical Gameplay Settings","DISPLAY_SCOPE_MODES", FALSE); - gGameExternalOptions.usSpotterPreparationTurns = iniReader.ReadInteger("Tactical Gameplay Settings","SPOTTER_PREPARATIONTURNS", 3, 3, 10); + gGameExternalOptions.usSpotterPreparationTurns = iniReader.ReadInteger("Tactical Gameplay Settings","SPOTTER_PREPARATIONTURNS", 2, 2, 10); gGameExternalOptions.usSpotterRange = iniReader.ReadInteger("Tactical Gameplay Settings","SPOTTER_RANGE", 10, 0, 30); gGameExternalOptions.usSpotterMaxCTHBoost = iniReader.ReadInteger("Tactical Gameplay Settings","SPOTTER_MAX_CTHBOOST", 50, 0, 100); diff --git a/Laptop/DynamicDialogueWidget.cpp b/Laptop/DynamicDialogueWidget.cpp index 0b3e5e2f..6a155073 100644 --- a/Laptop/DynamicDialogueWidget.cpp +++ b/Laptop/DynamicDialogueWidget.cpp @@ -126,7 +126,7 @@ DDBox::Display( ) } else { - sprintf( sTemp, "FACES\\%02d.sti", mEvent.usSpeaker ); + sprintf( sTemp, "FACES\\%02d.sti", gMercProfiles[mEvent.usSpeaker].ubFaceIndex ); } FilenameForBPP( sTemp, VObjectDesc.ImageFile ); diff --git a/Laptop/merccompare.cpp b/Laptop/merccompare.cpp index 8a982df1..61811e53 100644 --- a/Laptop/merccompare.cpp +++ b/Laptop/merccompare.cpp @@ -484,7 +484,7 @@ BOOLEAN DisplayMercData( UINT8 usProfileA, UINT8 usProfileB ) } else { - sprintf( sTemp, "FACES\\%02d.sti", usProfileA ); + sprintf( sTemp, "FACES\\%02d.sti", gMercProfiles[usProfileA].ubFaceIndex ); FilenameForBPP( sTemp, VObjectDesc.ImageFile ); CHECKF( AddVideoObject( &VObjectDesc, &uiInsMercFaceImage ) ); } @@ -518,7 +518,7 @@ BOOLEAN DisplayMercData( UINT8 usProfileA, UINT8 usProfileB ) } else { - sprintf( sTemp, "FACES\\%02d.sti", usProfileB ); + sprintf( sTemp, "FACES\\%02d.sti", gMercProfiles[usProfileB].ubFaceIndex ); FilenameForBPP( sTemp, VObjectDesc.ImageFile ); CHECKF( AddVideoObject( &VObjectDesc, &uiInsMercFaceImage ) ); } diff --git a/Tactical/Handle UI.cpp b/Tactical/Handle UI.cpp index 3ab9fcf0..f3e8346b 100644 --- a/Tactical/Handle UI.cpp +++ b/Tactical/Handle UI.cpp @@ -96,6 +96,7 @@ #include "teamturns.h" #include "Options Screen.h" #include "SaveLoadScreen.h" +#include "Map Screen Interface.h" // added by Flugente for SquadNames ////////////////////////////////////////////////////////////////////////////// // SANDRO - In this file, all APBPConstants[AP_CROUCH] and APBPConstants[AP_PRONE] were changed to GetAPsCrouch() and GetAPsProne() @@ -1445,7 +1446,10 @@ UINT32 UIHandleSelectMerc( UI_EVENT *pUIEvent ) // If different, display message if ( CurrentSquad( ) != iCurrentSquad ) { - ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[ MSG_SQUAD_ACTIVE ], ( CurrentSquad( ) + 1 ) ); + if ( gGameExternalOptions.fUseXMLSquadNames && CurrentSquad( ) + 1 < ON_DUTY ) + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[MSG_SQUAD_ACTIVE_STRING], SquadNames[CurrentSquad( ) + 1].squadname ); + else + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[ MSG_SQUAD_ACTIVE ], ( CurrentSquad( ) + 1 ) ); } } diff --git a/Tactical/Interface Panels.cpp b/Tactical/Interface Panels.cpp index 4e263f8a..77a60278 100644 --- a/Tactical/Interface Panels.cpp +++ b/Tactical/Interface Panels.cpp @@ -7301,8 +7301,11 @@ UINT8 FindNextMercInTeamPanel( SOLDIERTYPE *pSoldier, BOOLEAN fGoodForLessOKLife if ( pNewSoldier->bAssignment != iCurrentSquad ) { - //ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[ MSG_SQUAD_ACTIVE ], ( CurrentSquad( ) + 1 ) ); - ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[ MSG_SQUAD_ACTIVE ], ( pNewSoldier->bAssignment + 1 ) ); + if ( gGameExternalOptions.fUseXMLSquadNames && pNewSoldier->bAssignment < ON_DUTY ) + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[MSG_SQUAD_ACTIVE_STRING], SquadNames[pNewSoldier->bAssignment].squadname ); + else + //ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[ MSG_SQUAD_ACTIVE ], ( CurrentSquad( ) + 1 ) ); + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[ MSG_SQUAD_ACTIVE ], ( pNewSoldier->bAssignment + 1 ) ); return( pNewSoldier->ubID ); } diff --git a/Tactical/Soldier Control.cpp b/Tactical/Soldier Control.cpp index cf1c6f05..f8e04fee 100644 --- a/Tactical/Soldier Control.cpp +++ b/Tactical/Soldier Control.cpp @@ -22342,18 +22342,18 @@ UINT16 GridNoSpotterCTHBonus( SOLDIERTYPE* pSniper, INT32 sGridNo, UINT bTeam ) // relation counts twice. Also account for special background. Effectivity cannot be lower than 0%! effectivity = max( 0, effectivity + 2 * relation + pSoldier->GetBackgroundValue( BG_PERC_SPOTTER ) ); - + // a good relation boosts value tremendously - a bad relation makes spotting useless // the spotter background also alters effectiveness - // -> value between 0 and 2000 - value = (value * effectivity) / 100; - - // longer spotting gives a linear bonus - up to 100% -> value between 0 and 4000 - value = (value * min( pSoldier->usSkillCounter[SOLDIER_COUNTER_SPOTTER], 2 * gGameExternalOptions.usSpotterPreparationTurns )) / gGameExternalOptions.usSpotterPreparationTurns; + // -> value between 0 and 2000, nominal 1000 + value = (value * effectivity ) / 100; + // longer spotting gives a linear bonus - up to 100% -> value between 0 and 4000, nominal 2000 + value = (value * min(pSoldier->usSkillCounter[SOLDIER_COUNTER_SPOTTER], 2 * gGameExternalOptions.usSpotterPreparationTurns)) / gGameExternalOptions.usSpotterPreparationTurns; + // reasonable values: 0 to gGameExternalOptions.usSpotterMaxCTHBoost - value = (value * gGameExternalOptions.usSpotterMaxCTHBoost) / 4000; - + value = (value * gGameExternalOptions.usSpotterMaxCTHBoost) / 2000; + if ( value > bestvalue ) bestvalue = value; } diff --git a/Tactical/Turn Based Input.cpp b/Tactical/Turn Based Input.cpp index b29170a7..ba4cdb54 100644 --- a/Tactical/Turn Based Input.cpp +++ b/Tactical/Turn Based Input.cpp @@ -2214,7 +2214,7 @@ void GetKeyboardInput( UINT32 *puiNewEvent ) HandleLocateSelectMerc( pNewSoldier->ubID, LOCATEANDSELECT_MERC ); if ( gGameExternalOptions.fUseXMLSquadNames && pNewSoldier->bAssignment < ON_DUTY ) - ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[ MSG_SQUAD_ACTIVE ], SquadNames[ pNewSoldier->bAssignment ].squadname ); + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[ MSG_SQUAD_ACTIVE_STRING ], SquadNames[pNewSoldier->bAssignment].squadname ); else //ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[ MSG_SQUAD_ACTIVE ], ( CurrentSquad( ) + 1 ) ); ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[ MSG_SQUAD_ACTIVE ], ( pNewSoldier->bAssignment + 1 ) ); @@ -5940,7 +5940,7 @@ void ChangeCurrentSquad( INT32 iSquad ) SetCurrentSquad( cnt, FALSE ); if ( gGameExternalOptions.fUseXMLSquadNames && cnt < ON_DUTY ) - ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[ MSG_SQUAD_ACTIVE ], SquadNames[ cnt ].squadname ); + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[ MSG_SQUAD_ACTIVE_STRING ], SquadNames[cnt].squadname ); else ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[ MSG_SQUAD_ACTIVE ], ( cnt + 1 ) ); diff --git a/Tactical/Weapons.cpp b/Tactical/Weapons.cpp index c085df93..6bc1217f 100644 --- a/Tactical/Weapons.cpp +++ b/Tactical/Weapons.cpp @@ -5515,7 +5515,7 @@ if (gGameExternalOptions.fUseNewCTHCalculation) fAimModifier += pSoldier->GetBackgroundValue(BG_PERC_CTH_CREATURE); // Flugente: if we are a sniper and a spotter from our team spots the targetted location, we receive a powerful cth bonus - if ( gGameOptions.fNewTraitSystem && Weapon[usInHand].ubWeaponType == GUN_SN_RIFLE ) + if ( gGameOptions.fNewTraitSystem && Weapon[usInHand].ubWeaponType == GUN_SN_RIFLE || Weapon[usInHand].ubWeaponType == GUN_RIFLE ) { fAimModifier += GridNoSpotterCTHBonus( pSoldier, sGridNo, pSoldier->bTeam); } @@ -5701,7 +5701,7 @@ else iTraitModifier += pSoldier->GetBackgroundValue(BG_PERC_CTH_CREATURE); // Flugente: if we are a sniper and a spotter from our team spots the targetted location, we receive a powerful cth bonus - if ( gGameOptions.fNewTraitSystem && Weapon[usInHand].ubWeaponType == GUN_SN_RIFLE ) + if ( gGameOptions.fNewTraitSystem && Weapon[usInHand].ubWeaponType == GUN_SN_RIFLE || Weapon[usInHand].ubWeaponType == GUN_RIFLE ) { iTraitModifier += (INT8)(GridNoSpotterCTHBonus( pSoldier, sGridNo, pSoldier->bTeam)); } @@ -7289,7 +7289,7 @@ UINT32 CalcChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTime, iChance += pSoldier->GetBackgroundValue(BG_PERC_CTH_CREATURE); // Flugente: if we are a sniper and a spotter from our team spots the targetted location, we receive a powerful cth bonus - if ( gGameOptions.fNewTraitSystem && Weapon[usInHand].ubWeaponType == GUN_SN_RIFLE ) + if ( gGameOptions.fNewTraitSystem && Weapon[usInHand].ubWeaponType == GUN_SN_RIFLE || Weapon[usInHand].ubWeaponType == GUN_RIFLE ) { iChance += (INT32)(GridNoSpotterCTHBonus( pSoldier, sGridNo, pSoldier->bTeam)); } diff --git a/Utils/Text.h b/Utils/Text.h index e71a895d..117da335 100644 --- a/Utils/Text.h +++ b/Utils/Text.h @@ -488,6 +488,8 @@ enum MSG_MERC_CASTS_LIGHT_ON, MSG_MERC_CASTS_LIGHT_OFF, + MSG_SQUAD_ACTIVE_STRING, + TEXT_NUM_MSG, }; extern STR16 pMessageStrings[]; diff --git a/Utils/_ChineseText.cpp b/Utils/_ChineseText.cpp index 6bd59eb7..4497189a 100644 --- a/Utils/_ChineseText.cpp +++ b/Utils/_ChineseText.cpp @@ -6206,6 +6206,7 @@ STR16 pMessageStrings[] = L"保持佣兵间距关闭", L"虚拟佣兵光照开启", L"虚拟佣兵光照关闭", + L"Squad %s active.", //TODO.Translate }; diff --git a/Utils/_DutchText.cpp b/Utils/_DutchText.cpp index 3192d1f2..72822ac6 100644 --- a/Utils/_DutchText.cpp +++ b/Utils/_DutchText.cpp @@ -6214,6 +6214,7 @@ STR16 pMessageStrings[] = L"Move in Formation OFF", L"Artificial Merc Light ON", // TODO.Translate L"Artificial Merc Light OFF", + L"Squad %s active.", //TODO.Translate }; diff --git a/Utils/_EnglishText.cpp b/Utils/_EnglishText.cpp index 47b6b5cf..75ea4150 100644 --- a/Utils/_EnglishText.cpp +++ b/Utils/_EnglishText.cpp @@ -6205,6 +6205,7 @@ STR16 pMessageStrings[] = L"Move in Formation OFF", L"Artificial Merc Light ON", L"Artificial Merc Light OFF", + L"Squad %s active.", }; diff --git a/Utils/_FrenchText.cpp b/Utils/_FrenchText.cpp index 3b913fb9..3daae829 100644 --- a/Utils/_FrenchText.cpp +++ b/Utils/_FrenchText.cpp @@ -6216,6 +6216,7 @@ STR16 pMessageStrings[] = L"Déplacement tactique désactivé", L"Éclairage du mercenaire activé", L"Éclairage du mercenaire désactivé", + L"Squad %s active.", //TODO.Translate }; diff --git a/Utils/_GermanText.cpp b/Utils/_GermanText.cpp index 43f597e1..eb9a3daa 100644 --- a/Utils/_GermanText.cpp +++ b/Utils/_GermanText.cpp @@ -6051,6 +6051,7 @@ STR16 pMessageStrings[] = L"In Formation bewegen - AUSGESCHALTET", L"Artificial Merc Light ON", // TODO.Translate L"Artificial Merc Light OFF", + L"Squad %s active.", //TODO.Translate }; CHAR16 ItemPickupHelpPopup[][40] = diff --git a/Utils/_ItalianText.cpp b/Utils/_ItalianText.cpp index c8e6414a..58fe6067 100644 --- a/Utils/_ItalianText.cpp +++ b/Utils/_ItalianText.cpp @@ -6202,6 +6202,7 @@ STR16 pMessageStrings[] = L"Move in Formation OFF", L"Artificial Merc Light ON", // TODO.Translate L"Artificial Merc Light OFF", + L"Squad %s active.", //TODO.Translate }; diff --git a/Utils/_PolishText.cpp b/Utils/_PolishText.cpp index b52bf59c..b236dc96 100644 --- a/Utils/_PolishText.cpp +++ b/Utils/_PolishText.cpp @@ -6220,6 +6220,7 @@ STR16 pMessageStrings[] = L"Move in Formation OFF", L"Artificial Merc Light ON", // TODO.Translate L"Artificial Merc Light OFF", + L"Squad %s active.", //TODO.Translate }; diff --git a/Utils/_RussianText.cpp b/Utils/_RussianText.cpp index 63e989ea..7639e360 100644 --- a/Utils/_RussianText.cpp +++ b/Utils/_RussianText.cpp @@ -6202,6 +6202,7 @@ STR16 pMessageStrings[] = L"Движение в обычном порядке", L"Подсветка наемника включена", L"Подсветка наемника отключена", + L"Squad %s active.", //TODO.Translate };