diff --git a/Strategic/Assignments.cpp b/Strategic/Assignments.cpp index 1aac652e..b60d194d 100644 --- a/Strategic/Assignments.cpp +++ b/Strategic/Assignments.cpp @@ -5477,6 +5477,9 @@ extern INT32 giReinforcementPool; // handle processing of prisoners void HandlePrisonerProcessingInSector( INT16 sMapX, INT16 sMapY, INT8 bZ ) { + if ( !gGameExternalOptions.fAllowPrisonerSystem ) + return; + // Is there a prison in this sector? UINT16 prisonerbaselimit = 0; for (UINT16 cnt = 0; cnt < NUM_FACILITY_TYPES; ++cnt) @@ -5698,6 +5701,9 @@ void HandlePrisonerProcessingInSector( INT16 sMapX, INT16 sMapY, INT8 bZ ) // Flugente: prisons can riot if there aren't enough guards around void HandlePrison( INT16 sMapX, INT16 sMapY, INT8 bZ ) { + if ( !gGameExternalOptions.fAllowPrisonerSystem ) + return; + BOOLEAN fBeginRiot = FALSE; // Is there a prison in this sector? diff --git a/Tactical/Handle Items.cpp b/Tactical/Handle Items.cpp index 97bc4974..203eba14 100644 --- a/Tactical/Handle Items.cpp +++ b/Tactical/Handle Items.cpp @@ -1216,7 +1216,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa } // Flugente: handcuffing people - if ( HasItemFlag(usHandItem, HANDCUFFS ) ) + if ( gGameExternalOptions.fAllowPrisonerSystem && HasItemFlag(usHandItem, HANDCUFFS ) ) { // ATE: AI CANNOT GO THROUGH HERE! INT32 usMapPos; diff --git a/Tactical/Soldier Control.cpp b/Tactical/Soldier Control.cpp index a9077b22..8e4d7868 100644 --- a/Tactical/Soldier Control.cpp +++ b/Tactical/Soldier Control.cpp @@ -5776,22 +5776,15 @@ void SOLDIERTYPE::EVENT_SoldierGotHit( UINT16 usWeaponIndex, INT16 sDamage, INT1 // Flugente: if the weapon is a taser and has enough batteries, the damage will be 0, but the breathdamage will knock out anyone if ( HasItemFlag(usWeaponIndex, TASER) ) { - if ( !Item[usWeaponIndex].needsbatteries ) - { - // a taser without batteries is odd, but why not, perhaps the thing has a 1000 pund battery or sth - sDamage = 0; - sBreathLoss = 20000; - ubReason = TAKE_DAMAGE_ELECTRICITY; - } - // if we need batteries, lets see if we can find some... - else + // tasers need batteries, because I say so + if ( Item[usWeaponIndex].needsbatteries ) { // check for batteries OBJECTTYPE* pBatteries = FindAttachedBatteries( &(MercPtrs[ubAttackerID]->inv[HANDPOS]) ); if ( pBatteries ) { sDamage = 0; - sBreathLoss = 20000; + sBreathLoss = 30000; ubReason = TAKE_DAMAGE_ELECTRICITY; // use up 8-12 percent of batteries @@ -16222,6 +16215,9 @@ void SOLDIERTYPE::EVENT_SoldierBuildStructure( INT32 sGridNo, UINT8 ubDirection void SOLDIERTYPE::EVENT_SoldierHandcuffPerson( INT32 sGridNo, UINT8 ubDirection ) { + if ( !gGameExternalOptions.fAllowPrisonerSystem ) + return; + UINT8 ubPerson = WhoIsThere2( sGridNo, this->pathing.bLevel ); if ( ubPerson != NOBODY && MercPtrs[ ubPerson ]->bTeam == ENEMY_TEAM && !(MercPtrs[ ubPerson ]->bSoldierFlagMask & SOLDIER_POW) ) @@ -16237,12 +16233,23 @@ void SOLDIERTYPE::EVENT_SoldierHandcuffPerson( INT32 sGridNo, UINT8 ubDirection { // check wether we can forcefully handcuff the other soldier, but this will be hard UINT32 attackrating = 10 * EffectiveExpLevel( this ) + EffectiveStrength( this, FALSE ) + 2 * EffectiveDexterity( this, FALSE ) + EffectiveAgility( this, FALSE ); - UINT32 defenserating = 10 * EffectiveExpLevel( pSoldier ) + 2 * EffectiveStrength( pSoldier, FALSE ) + EffectiveDexterity( pSoldier, FALSE ) + 2 * EffectiveAgility( pSoldier, FALSE ); + UINT32 defenserating = 10 * EffectiveExpLevel( pSoldier ) + 2 * EffectiveStrength( pSoldier, FALSE ) + 2 * EffectiveDexterity( pSoldier, FALSE ) + 2 * EffectiveAgility( pSoldier, FALSE ); + + if (gGameOptions.fNewTraitSystem) + { + attackrating += 25 * NUM_SKILL_TRAITS( this, MARTIAL_ARTS_NT ) + 10 * HAS_SKILL_TRAIT( this, MELEE_NT ); + defenserating += 25 * NUM_SKILL_TRAITS( pSoldier, MARTIAL_ARTS_NT ) + 10 * HAS_SKILL_TRAIT( pSoldier, MELEE_NT ); + } + else + { + attackrating += 25 * NUM_SKILL_TRAITS( this, MARTIALARTS_OT ) + 25 * NUM_SKILL_TRAITS( this, HANDTOHAND_OT ) + 10 * HAS_SKILL_TRAIT( this, KNIFING_OT ); + defenserating += 25 * NUM_SKILL_TRAITS( pSoldier, MARTIALARTS_OT ) + 25 * NUM_SKILL_TRAITS( pSoldier, HANDTOHAND_OT ) + 10 * HAS_SKILL_TRAIT( pSoldier, KNIFING_OT ); + } ReducePointsForFatigue( this, &attackrating ); ReducePointsForFatigue( pSoldier, &defenserating ); - if ( Random(attackrating) > Random(defenserating) + 50 ) + if ( Random(attackrating) > Random(defenserating) + 100 ) success = TRUE; } diff --git a/Tactical/UI Cursors.cpp b/Tactical/UI Cursors.cpp index 818032e2..8abd5b40 100644 --- a/Tactical/UI Cursors.cpp +++ b/Tactical/UI Cursors.cpp @@ -2711,7 +2711,7 @@ UINT8 GetActionModeCursor( SOLDIERTYPE *pSoldier ) ubCursor = FORTICURS; // Flugente: cursor for handcuffs - if ( HasItemFlag(usInHand, HANDCUFFS) ) + if ( gGameExternalOptions.fAllowPrisonerSystem && HasItemFlag(usInHand, HANDCUFFS) ) ubCursor = HANDCUFFCURS; // Now check our terrain to see if we cannot do the action now... diff --git a/TacticalAI/DecideAction.cpp b/TacticalAI/DecideAction.cpp index 0a317261..05ababce 100644 --- a/TacticalAI/DecideAction.cpp +++ b/TacticalAI/DecideAction.cpp @@ -899,7 +899,7 @@ INT8 DecideActionGreen(SOLDIERTYPE *pSoldier) } // Flugente: if we see one of our buddies in handcuffs, its a clear sign of enemy activity! - if ( pSoldier->bTeam == ENEMY_TEAM ) + if ( gGameExternalOptions.fAllowPrisonerSystem && pSoldier->bTeam == ENEMY_TEAM ) { UINT8 ubPerson = GetClosestFlaggedSoldierID( pSoldier, 10, ENEMY_TEAM, SOLDIER_POW ); @@ -1473,7 +1473,7 @@ INT8 DecideActionYellow(SOLDIERTYPE *pSoldier) } // Flugente: if we see one of our buddies in handcuffs, its a clear sign of enemy activity! - if ( pSoldier->bTeam == ENEMY_TEAM ) + if ( gGameExternalOptions.fAllowPrisonerSystem && pSoldier->bTeam == ENEMY_TEAM ) { UINT8 ubPerson = GetClosestFlaggedSoldierID( pSoldier, 10, ENEMY_TEAM, SOLDIER_POW );