Merged revision(s) 7057 from branches/ja2_source_official_2014:

- increased background-based chance to steal to 50%, money/gold/solver will be preferred targets
- lowered exp stat gain for handling tripwire
- new background ability: disarm_trap alters effectivity at defusing bombs
- Fix: incorrectly deleted soldiers could still be counted as jamming/scanning

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7058 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2014-03-12 22:29:56 +00:00
parent f6ffee0583
commit fddb72a94e
16 changed files with 75 additions and 50 deletions
+26 -28
View File
@@ -1805,8 +1805,8 @@ void HandleSoldierDropBomb( SOLDIERTYPE *pSoldier, INT32 sGridNo )
if ( iResult >= 0 )
{
// Less explosives gain for placing tripwire
if ( Item[ pSoldier->inv[ HANDPOS ].usItem ].tripwire == 1 )
StatChange( pSoldier, EXPLODEAMT, 5, FALSE );
if ( Item[ pSoldier->inv[ HANDPOS ].usItem ].tripwire )
StatChange( pSoldier, EXPLODEAMT, 1, FALSE );
else
// EXPLOSIVES GAIN (25): Place a bomb, or buried and armed a mine
StatChange( pSoldier, EXPLODEAMT, 25, FALSE );
@@ -6872,38 +6872,36 @@ BOOLEAN RemoveFortification( INT32 sGridNo )
INT32 CheckBombDisarmChance(void)
{
// NB owner grossness... bombs 'owned' by the enemy are stored with side value 1 in
// the map. So if we want to detect a bomb placed by the player, owner is > 1, and
// owner - 2 gives the ID of the character who planted it
if ( gTempObject[0]->data.misc.ubBombOwner > 1 && ( (INT32)gTempObject[0]->data.misc.ubBombOwner - 2 >= gTacticalStatus.Team[ OUR_TEAM ].bFirstID && gTempObject[0]->data.misc.ubBombOwner - 2 <= gTacticalStatus.Team[ OUR_TEAM ].bLastID ) )
// NB owner grossness... bombs 'owned' by the enemy are stored with side value 1 in
// the map. So if we want to detect a bomb placed by the player, owner is > 1, and
// owner - 2 gives the ID of the character who planted it
if ( gTempObject[0]->data.misc.ubBombOwner > 1 && ( (INT32)gTempObject[0]->data.misc.ubBombOwner - 2 >= gTacticalStatus.Team[ OUR_TEAM ].bFirstID && gTempObject[0]->data.misc.ubBombOwner - 2 <= gTacticalStatus.Team[ OUR_TEAM ].bLastID ) )
{
// Flugente: get a tripwire-related bonus if we have a wire cutter in our hands
INT8 wirecutterbonus = 0;
if ( ( (&gpBoobyTrapSoldier->inv[HANDPOS])->exists() && Item[ gpBoobyTrapSoldier->inv[HANDPOS].usItem ].wirecutters == 1 ) || ( (&gpBoobyTrapSoldier->inv[SECONDHANDPOS])->exists() && Item[ gpBoobyTrapSoldier->inv[SECONDHANDPOS].usItem ].wirecutters == 1 ) )
{
// Flugente: get a tripwire-related bonus if we have a wire cutter in our hands
INT8 wirecutterbonus = 0;
if ( ( (&gpBoobyTrapSoldier->inv[HANDPOS])->exists() && Item[ gpBoobyTrapSoldier->inv[HANDPOS].usItem ].wirecutters == 1 ) || ( (&gpBoobyTrapSoldier->inv[SECONDHANDPOS])->exists() && Item[ gpBoobyTrapSoldier->inv[SECONDHANDPOS].usItem ].wirecutters == 1 ) )
{
// + 10 if item gets activated by tripwire
if ( Item[gTempObject.usItem].tripwireactivation == 1 )
wirecutterbonus += 10;
// + 10 if item is tripwire
if ( Item[gTempObject.usItem].tripwire == 1 )
wirecutterbonus += 10;
}
// + 10 if item gets activated by tripwire
if ( Item[gTempObject.usItem].tripwireactivation == 1 )
wirecutterbonus += 10;
// + 10 if item is tripwire
if ( Item[gTempObject.usItem].tripwire == 1 )
wirecutterbonus += 10;
}
if ( gTempObject[0]->data.misc.ubBombOwner - 2 == gpBoobyTrapSoldier->ubID )
{
// my own boobytrap!
return SkillCheck( gpBoobyTrapSoldier, DISARM_TRAP_CHECK, 40 + wirecutterbonus );
}
else
{
// our team's boobytrap!
return SkillCheck( gpBoobyTrapSoldier, DISARM_TRAP_CHECK, 20 + wirecutterbonus );
}
if ( gTempObject[0]->data.misc.ubBombOwner - 2 == gpBoobyTrapSoldier->ubID )
{
// my own boobytrap!
return SkillCheck( gpBoobyTrapSoldier, DISARM_TRAP_CHECK, 40 + wirecutterbonus );
}
else
{
return SkillCheck( gpBoobyTrapSoldier, DISARM_TRAP_CHECK, 0 );
// our team's boobytrap!
return SkillCheck( gpBoobyTrapSoldier, DISARM_TRAP_CHECK, 20 + wirecutterbonus );
}
}
return SkillCheck( gpBoobyTrapSoldier, DISARM_TRAP_CHECK, 0 );
}
void ExtendedDisarmMessageBox(void)
+1
View File
@@ -173,6 +173,7 @@ enum {
BG_PERC_CTH_MAX,
BG_PERC_HEARING_NIGHT,
BG_PERC_HEARING_DAY,
BG_TRAP_DISARM,
// approaches
BG_PERC_APPROACH_FRIENDLY,
+5 -1
View File
@@ -455,6 +455,10 @@ INT32 SkillCheck( SOLDIERTYPE * pSoldier, INT8 bReason, INT8 bChanceMod )
}
iSkill += EffectiveDexterity( pSoldier, FALSE ) * 2;
iSkill += EffectiveExpLevel( pSoldier ) * 10;
// Flugente: backgrounds
iSkill += pSoldier->GetBackgroundValue(BG_TRAP_DISARM);
iSkill = iSkill / 10; // bring the value down to a percentage
//JMich_SkillModifiers: Adding a Disarm Trap bonus
bSlot = FindDisarmKit( pSoldier);
@@ -621,7 +625,7 @@ INT32 SkillCheck( SOLDIERTYPE * pSoldier, INT8 bReason, INT8 bChanceMod )
}
break;
case ATTACH_POWER_PACK: // added by Flugente
// technicians can attach it, other people can'
// technicians can attach it, other people can't
if ( HAS_SKILL_TRAIT( pSoldier, TECHNICIAN_NT ))
iSkill = 100;
else
+4 -6
View File
@@ -17022,7 +17022,7 @@ INT16 SOLDIERTYPE::GetAPBonus()
if ( this->pathing.bLevel )
bonus += this->GetBackgroundValue(BG_HEIGHT);
return bonus;
}
@@ -17039,7 +17039,7 @@ UINT8 SOLDIERTYPE::GetMoraleThreshold()
{
UINT8 threshold = 100;
UINT8 moraledamage = 0;
moraledamage = (moraledamage * (100 - GetFearResistanceBonus())) / 100;
return min(threshold, max(0, threshold - moraledamage));
@@ -17421,8 +17421,6 @@ BOOLEAN SOLDIERTYPE::UseRadio()
BOOLEAN SOLDIERTYPE::HasMortar()
{
UINT16 mortaritem = 0;
INT8 invsize = (INT8)inv.size(); // remember inventorysize, so we don't call size() repeatedly
for ( INT8 bLoop = 0; bLoop < invsize; ++bLoop)
{
@@ -21432,7 +21430,7 @@ BOOLEAN SectorJammed()
INT32 lastid = MAX_NUM_SOLDIERS;
for ( pSoldier = MercPtrs[ cnt ]; cnt < lastid; ++cnt, ++pSoldier)
{
if ( pSoldier->sSectorX == gWorldSectorX && pSoldier->sSectorY == gWorldSectorY && pSoldier->bSectorZ == gbWorldSectorZ && pSoldier->IsJamming() )
if ( pSoldier->sSectorX == gWorldSectorX && pSoldier->sSectorY == gWorldSectorY && pSoldier->bSectorZ == gbWorldSectorZ && pSoldier->stats.bLife > 0 && pSoldier->IsJamming() )
return TRUE;
}
@@ -21447,7 +21445,7 @@ BOOLEAN PlayerTeamIsScanning()
INT32 lastid = gTacticalStatus.Team[ OUR_TEAM ].bLastID;
for ( pSoldier = MercPtrs[ cnt ]; cnt < lastid; ++cnt, ++pSoldier)
{
if ( pSoldier->sSectorX == gWorldSectorX && pSoldier->sSectorY == gWorldSectorY && pSoldier->bSectorZ == gbWorldSectorZ && pSoldier->IsScanning() )
if ( pSoldier->sSectorX == gWorldSectorX && pSoldier->sSectorY == gWorldSectorY && pSoldier->bSectorZ == gbWorldSectorZ && pSoldier->stats.bLife > 0 && pSoldier->IsScanning() )
return TRUE;
}
+6
View File
@@ -116,6 +116,7 @@ backgroundStartElementHandle(void *userData, const XML_Char *name, const XML_Cha
strcmp(name, "increased_maxcth") == 0 ||
strcmp(name, "hearing_night") == 0 ||
strcmp(name, "hearing_day") == 0 ||
strcmp(name, "disarm_trap") == 0 ||
strcmp(name, "approach_friendly") == 0 ||
strcmp(name, "approach_direct") == 0 ||
strcmp(name, "approach_threaten") == 0 ||
@@ -471,6 +472,11 @@ backgroundEndElementHandle(void *userData, const XML_Char *name)
pData->curElement = ELEMENT;
pData->curBackground.value[BG_PERC_HEARING_DAY] = min(2, max(-5, (INT16) atol(pData->szCharData) ));
}
else if(strcmp(name, "disarm_trap") == 0)
{
pData->curElement = ELEMENT;
pData->curBackground.value[BG_TRAP_DISARM] = min(50, max(-50, (INT16) atol(pData->szCharData) ));
}
else if(strcmp(name, "approach_friendly") == 0)
{
pData->curElement = ELEMENT;