mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
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:
+9
-9
@@ -15,9 +15,9 @@
|
||||
#ifdef JA2EDITOR
|
||||
|
||||
#ifdef JA2UB
|
||||
CHAR16 zVersionLabel[256] = { L"Unfinished Business - Map Editor v1.13.6823 (Development Build)" };
|
||||
CHAR16 zVersionLabel[256] = { L"Unfinished Business - Map Editor v1.13.7057 (Development Build)" };
|
||||
#else
|
||||
CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.6823 (Development Build)" };
|
||||
CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.7057 (Development Build)" };
|
||||
#endif
|
||||
|
||||
// ------------------------------
|
||||
@@ -27,11 +27,11 @@
|
||||
|
||||
//DEBUG BUILD VERSION
|
||||
#ifdef JA2UB
|
||||
CHAR16 zVersionLabel[256] = { L"Debug: Unfinished Business - v1.13.6670 (Development Build)" };
|
||||
CHAR16 zVersionLabel[256] = { L"Debug: Unfinished Business - v1.13.7057 (Development Build)" };
|
||||
#elif defined (JA113DEMO)
|
||||
CHAR16 zVersionLabel[256] = { L"Debug: JA2 Demo - v1.13.6670 (Development Build)" };
|
||||
CHAR16 zVersionLabel[256] = { L"Debug: JA2 Demo - v1.13.7057 (Development Build)" };
|
||||
#else
|
||||
CHAR16 zVersionLabel[256] = { L"Debug: v1.13.6670 (Development Build)" };
|
||||
CHAR16 zVersionLabel[256] = { L"Debug: v1.13.7057 (Development Build)" };
|
||||
#endif
|
||||
|
||||
#elif defined CRIPPLED_VERSION
|
||||
@@ -46,16 +46,16 @@
|
||||
|
||||
//RELEASE BUILD VERSION
|
||||
#ifdef JA2UB
|
||||
CHAR16 zVersionLabel[256] = { L"Release Unfinished Business - v1.13.6670 (Development Build)" };
|
||||
CHAR16 zVersionLabel[256] = { L"Release Unfinished Business - v1.13.7057 (Development Build)" };
|
||||
#elif defined (JA113DEMO)
|
||||
CHAR16 zVersionLabel[256] = { L"Release JA2 Demo - v1.13.6670 (Development Build)" };
|
||||
CHAR16 zVersionLabel[256] = { L"Release JA2 Demo - v1.13.7057 (Development Build)" };
|
||||
#else
|
||||
CHAR16 zVersionLabel[256] = { L"Release v1.13.6670 (Development Build)" };
|
||||
CHAR16 zVersionLabel[256] = { L"Release v1.13.7057 (Development Build)" };
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
CHAR8 czVersionNumber[16] = { "Build 13.11.30" }; //YY.MM.DD
|
||||
CHAR8 czVersionNumber[16] = { "Build 14.03.12" }; //YY.MM.DD
|
||||
CHAR16 zTrackingNumber[16] = { L"Z" };
|
||||
|
||||
// SAVE_GAME_VERSION is defined in header, change it there
|
||||
|
||||
@@ -515,12 +515,14 @@ void HourlyStealUpdate()
|
||||
{
|
||||
pSoldier = MercPtrs[ cnt ];
|
||||
|
||||
if ( pSoldier && !pSoldier->flags.fBetweenSectors && pSoldier->bActive && pSoldier->bInSector && !pSoldier->flags.fMercAsleep && !(gTacticalStatus.fEnemyInSector || guiCurrentScreen == GAME_SCREEN ) )
|
||||
// merc must be alive, not travelling and awake. If he is in the currently loaded sector, we may not be in tactical (we would see an item suddenly disappearing) and not in combat
|
||||
if ( pSoldier && !pSoldier->flags.fBetweenSectors && pSoldier->bActive && !pSoldier->flags.fMercAsleep &&
|
||||
!( ( ( gWorldSectorX == pSoldier->sSectorX ) && ( gWorldSectorY == pSoldier->sSectorY ) && (gbWorldSectorZ == pSoldier->bSectorZ ) ) && (gTacticalStatus.fEnemyInSector || guiCurrentScreen == GAME_SCREEN )) )
|
||||
{
|
||||
if ( pSoldier->HasBackgroundFlag( BACKGROUND_SCROUNGING ) )
|
||||
{
|
||||
// 20% chance that we'll steal something
|
||||
if ( Chance(20) )
|
||||
// 50% chance that we'll steal something
|
||||
if ( Chance(50) )
|
||||
{
|
||||
// anv: snitches prevent scrounging in the same sector
|
||||
for( INT32 cnt2 = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; cnt2 <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; ++cnt2 )
|
||||
@@ -562,7 +564,7 @@ void HourlyStealUpdate()
|
||||
std::vector<WORLDITEM> pWorldItem;//dnl ch75 271013
|
||||
BOOLEAN fReturn = FALSE;
|
||||
|
||||
if( ( gWorldSectorX == pSoldier->sSectorX ) && ( gWorldSectorY == pSoldier->sSectorY ) && (gbWorldSectorZ == pSoldier->bSectorZ ) )
|
||||
if ( ( gWorldSectorX == pSoldier->sSectorX ) && ( gWorldSectorY == pSoldier->sSectorY ) && (gbWorldSectorZ == pSoldier->bSectorZ ) )
|
||||
{
|
||||
uiTotalNumberOfRealItems = guiNumWorldItems;
|
||||
|
||||
@@ -591,7 +593,7 @@ void HourlyStealUpdate()
|
||||
}
|
||||
}
|
||||
|
||||
FLOAT bestpriceweightratio = 50.0f; // msut have a value of at least 50$/100 gram
|
||||
FLOAT bestpriceweightratio = 50.0f; // must have a value of at least 50$/100 gram
|
||||
OBJECTTYPE* pTargetObj = NULL;
|
||||
for( UINT32 uiCount = 0; uiCount < uiTotalNumberOfRealItems; ++uiCount ) // ... for all items in the world ...
|
||||
{
|
||||
@@ -604,8 +606,15 @@ void HourlyStealUpdate()
|
||||
// test wether item is reachable and useable by militia
|
||||
if ( (pWorldItem[ uiCount ].usFlags & WORLD_ITEM_REACHABLE) )
|
||||
{
|
||||
// of course we prefer money above everything else
|
||||
if ( Item[pWorldItem[ uiCount ].object.usItem].usItemClass == IC_MONEY )
|
||||
{
|
||||
// give it a high enough value
|
||||
bestpriceweightratio = 1000.0f;
|
||||
pTargetObj = &(pWorldItem[ uiCount ].object);
|
||||
}
|
||||
// ignore objects without weight (how does that happen anyway? careless modders...)
|
||||
if ( Item[pWorldItem[ uiCount ].object.usItem].ubWeight )
|
||||
else if ( Item[pWorldItem[ uiCount ].object.usItem].ubWeight )
|
||||
{
|
||||
if ( (FLOAT)(Item[pWorldItem[ uiCount ].object.usItem].usPrice) / (FLOAT)(Item[pWorldItem[ uiCount ].object.usItem].ubWeight) > bestpriceweightratio )
|
||||
{
|
||||
|
||||
+26
-28
@@ -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)
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -8103,6 +8103,7 @@ STR16 szBackgroundText_Value[]=
|
||||
L" %s%d%%最大准确度(CTH)\n", //L" %s%d%% max CTH\n",
|
||||
L" %s%d夜晚听力范围\n", //L" %s%d hearing range during the night\n",
|
||||
L" %s%d白天听力范围\n", //L" %s%d hearing range during the day\n",
|
||||
L" %s%d effectivity at disarming traps\n", // TODO.Translate
|
||||
|
||||
L" %s%d%%友好对话效果\n", //L" %s%d%% effectiveness to friendly approach\n",
|
||||
L" %s%d%%直接对话效果\n", //L" %s%d%% effectiveness to direct approach\n",
|
||||
|
||||
@@ -8117,6 +8117,7 @@ STR16 szBackgroundText_Value[]=
|
||||
L" %s%d%% max CTH\n",
|
||||
L" %s%d hearing range during the night\n",
|
||||
L" %s%d hearing range during the day\n",
|
||||
L" %s%d effectivity at disarming traps\n", // TODO.Translate
|
||||
|
||||
L" %s%d%% effectiveness to friendly approach\n",
|
||||
L" %s%d%% effectiveness to direct approach\n",
|
||||
|
||||
@@ -8100,6 +8100,7 @@ STR16 szBackgroundText_Value[]=
|
||||
L" %s%d%% max CTH\n",
|
||||
L" %s%d hearing range during the night\n",
|
||||
L" %s%d hearing range during the day\n",
|
||||
L" %s%d effectivity at disarming traps\n",
|
||||
|
||||
L" %s%d%% effectiveness to friendly approach\n",
|
||||
L" %s%d%% effectiveness to direct approach\n",
|
||||
|
||||
@@ -8100,6 +8100,7 @@ STR16 szBackgroundText_Value[]=
|
||||
L" %s%d%% de chance de toucher maximum\n",
|
||||
L" %s%d en audition pendant la nuit\n",
|
||||
L" %s%d en audition pendant la journée\n",
|
||||
L" %s%d effectivity at disarming traps\n", // TODO.Translate
|
||||
|
||||
L" %s%d%% d'efficacité dans une approche amicale\n",
|
||||
L" %s%d%% d'efficacité dans une approche directe\n",
|
||||
|
||||
@@ -7927,6 +7927,7 @@ STR16 szBackgroundText_Value[]=
|
||||
L" %s%d%% max CTH\n",
|
||||
L" %s%d hearing range during the night\n",
|
||||
L" %s%d hearing range during the day\n",
|
||||
L" %s%d effectivity at disarming traps\n", // TODO.Translate
|
||||
|
||||
L" %s%d%% effectiveness to friendly approach\n",
|
||||
L" %s%d%% effectiveness to direct approach\n",
|
||||
|
||||
@@ -8109,6 +8109,7 @@ STR16 szBackgroundText_Value[]=
|
||||
L" %s%d%% max CTH\n",
|
||||
L" %s%d hearing range during the night\n",
|
||||
L" %s%d hearing range during the day\n",
|
||||
L" %s%d effectivity at disarming traps\n", // TODO.Translate
|
||||
|
||||
L" %s%d%% effectiveness to friendly approach\n",
|
||||
L" %s%d%% effectiveness to direct approach\n",
|
||||
|
||||
@@ -8127,6 +8127,7 @@ STR16 szBackgroundText_Value[]=
|
||||
L" %s%d%% max CTH\n",
|
||||
L" %s%d hearing range during the night\n",
|
||||
L" %s%d hearing range during the day\n",
|
||||
L" %s%d effectivity at disarming traps\n", // TODO.Translate
|
||||
|
||||
L" %s%d%% effectiveness to friendly approach\n",
|
||||
L" %s%d%% effectiveness to direct approach\n",
|
||||
|
||||
@@ -8105,6 +8105,7 @@ STR16 szBackgroundText_Value[]=
|
||||
L" %s%d%% max CTH\n",
|
||||
L" %s%d hearing range during the night\n",
|
||||
L" %s%d hearing range during the day\n",
|
||||
L" %s%d effectivity at disarming traps\n", // TODO.Translate
|
||||
|
||||
L" %s%d%% effectiveness to friendly approach\n",
|
||||
L" %s%d%% effectiveness to direct approach\n",
|
||||
|
||||
@@ -8117,6 +8117,7 @@ STR16 szBackgroundText_Value[]=
|
||||
L" %s%d%% max CTH\n",
|
||||
L" %s%d hearing range during the night\n",
|
||||
L" %s%d hearing range during the day\n",
|
||||
L" %s%d effectivity at disarming traps\n", // TODO.Translate
|
||||
|
||||
L" %s%d%% effectiveness to friendly approach\n",
|
||||
L" %s%d%% effectiveness to direct approach\n",
|
||||
|
||||
Reference in New Issue
Block a user