diff --git a/GameSettings.cpp b/GameSettings.cpp index 3d29f3ff..fee4e77d 100644 --- a/GameSettings.cpp +++ b/GameSettings.cpp @@ -2500,6 +2500,8 @@ void LoadSkillTraitsExternalSettings() gSkillTraitValues.usVOMortarSignalShellRadius = iniReader.ReadInteger("Radio Operator","RADIO_OPERATOR_MORTAR_SIGNAL_SHELL_RADIUS", 2, 2, 100); gSkillTraitValues.sVOScanAssignmentBaseRange = iniReader.ReadInteger("Radio Operator","RADIO_OPERATOR_ASSIGNMENT_SCAN_BASE_RANGE", 5, 0, 20); gSkillTraitValues.sVOListeningHearingBonus = iniReader.ReadInteger("Radio Operator","RADIO_OPERATOR_LISTENING_HEARING_BONUS", 20, 0, 100); + gSkillTraitValues.fVOJammingBlocksRemoteBombs = iniReader.ReadBoolean("Radio Operator","RADIO_OPERATOR_JAMMING_BLOCKSRADIOBOMBS", FALSE); + gSkillTraitValues.fVOEnemyVOSetsOffRemoteBombs = iniReader.ReadBoolean("Radio Operator","RADIO_OPERATOR_ENEMY_JAMMINGSETSOFFRADIOBOMBS", TRUE); // anv: SNITCH gSkillTraitValues.ubSNTBaseChance = iniReader.ReadInteger("Snitch","BASE_CHANCE", 50, 0, 100); diff --git a/GameSettings.h b/GameSettings.h index b1afc40f..0488c54f 100644 --- a/GameSettings.h +++ b/GameSettings.h @@ -1826,6 +1826,8 @@ typedef struct UINT8 usVOMortarSignalShellRadius; INT8 sVOScanAssignmentBaseRange; INT8 sVOListeningHearingBonus; + BOOLEAN fVOJammingBlocksRemoteBombs; + BOOLEAN fVOEnemyVOSetsOffRemoteBombs; // SNITCH diff --git a/Tactical/Handle Items.cpp b/Tactical/Handle Items.cpp index 2992e545..bfd1cf5a 100644 --- a/Tactical/Handle Items.cpp +++ b/Tactical/Handle Items.cpp @@ -5023,7 +5023,9 @@ void BombMessageBoxCallBack( UINT8 ubExitValue ) if (Item[ gpTempSoldier->inv[HANDPOS].usItem ].remotetrigger ) { - SetOffBombsByFrequency( gpTempSoldier->ubID, ubExitValue ); + // Flugente: jamming can prevent bomb activation + if ( !gSkillTraitValues.fVOJammingBlocksRemoteBombs || !SectorJammed() ) + SetOffBombsByFrequency( gpTempSoldier->ubID, ubExitValue ); } else { diff --git a/Tactical/Soldier Control.cpp b/Tactical/Soldier Control.cpp index d7bc8b26..5a37fd47 100644 --- a/Tactical/Soldier Control.cpp +++ b/Tactical/Soldier Control.cpp @@ -17129,6 +17129,10 @@ void SOLDIERTYPE::SoldierPropertyUpkeep() if ( this->stats.bLife < OKLIFE ) this->SwitchOffRadio(); + // if we are an enemy radio operator, and we are jamming frequencies, there is a slight chance that we set off remote-controlled bombs/defuses! + if ( !gSkillTraitValues.fVOJammingBlocksRemoteBombs && gSkillTraitValues.fVOEnemyVOSetsOffRemoteBombs && this->bTeam == ENEMY_TEAM && IsJamming() && Chance(5) ) + SetOffBombsByFrequency( this->ubID, 1 + Random(8) ); + // effects eventually run out for (UINT8 counter = 0; counter < SOLDIER_COUNTER_MAX; ++counter) { @@ -17988,7 +17992,16 @@ BOOLEAN SOLDIERTYPE::OrderArtilleryStrike( UINT32 usSectorNr, INT32 sTargetGridN BOOLEAN SOLDIERTYPE::IsJamming() { - return ( (bSoldierFlagMask & SOLDIER_RADIO_OPERATOR_JAMMING) && CanUseRadio(FALSE) ); + if ( bSoldierFlagMask & SOLDIER_RADIO_OPERATOR_JAMMING ) + { + if ( CanUseRadio(FALSE) ) + return TRUE; + // if we cannot use the radio, remove that flag hile we're at it + else + bSoldierFlagMask &= ~SOLDIER_RADIO_OPERATOR_JAMMING; + } + + return FALSE; } BOOLEAN SOLDIERTYPE::JamCommunications() @@ -18018,7 +18031,16 @@ BOOLEAN SOLDIERTYPE::JamCommunications() BOOLEAN SOLDIERTYPE::IsScanning() { - return ( (bSoldierFlagMask & SOLDIER_RADIO_OPERATOR_SCANNING) && CanUseRadio(FALSE) ); + if ( bSoldierFlagMask & SOLDIER_RADIO_OPERATOR_SCANNING ) + { + if ( CanUseRadio(FALSE) ) + return TRUE; + // if we cannot use the radio, remove that flag hile we're at it + else + bSoldierFlagMask &= ~SOLDIER_RADIO_OPERATOR_SCANNING; + } + + return FALSE; } BOOLEAN SOLDIERTYPE::ScanForJam()