mirror of
https://github.com/1dot13/source.git
synced 2026-08-12 14:10:23 +02:00
- New Feature: dynamic opinions allows mercs to form opinions about each other depening on actions they/the player take or do not take. These can be viewed in the 'MeLoDY 'website. See also http://www.bears-pit.com/board/ubbthreads.php/topics/333259.html#Post333259
- Requires GameDir r2050. - new background property: <dislikebackground> allows mercs to dislike specific backgrounds - Fix: snitches did not correctly prevent misbehaviour - Fix: morale event was not handled - Fix: DropDowns did not refresh when using the arrow buttons git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7240 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -414,13 +414,13 @@ void HourlyLarryUpdate()
|
||||
|
||||
if ( usTemptation > 0 )
|
||||
{
|
||||
|
||||
// anv: snitches stop mercs from getting wasted
|
||||
BOOLEAN fSnitchStoppedBehaviour = FALSE;
|
||||
for( INT32 cnt2 = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; cnt2 <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; ++cnt2 )
|
||||
{
|
||||
pOtherSoldier = MercPtrs[ cnt ];
|
||||
pOtherSoldier = MercPtrs[ cnt2 ];
|
||||
// note - snitches stop others, but can get wasted themselves (if they have drug use specifically set in background...)
|
||||
if( pOtherSoldier && !pOtherSoldier->flags.fBetweenSectors && pOtherSoldier->bActive && pOtherSoldier->bInSector && !pOtherSoldier->flags.fMercAsleep && pSoldier->ubProfile != pOtherSoldier->ubProfile )
|
||||
if( pOtherSoldier && !pOtherSoldier->flags.fBetweenSectors && pOtherSoldier->bActive && !pOtherSoldier->flags.fMercAsleep && pSoldier->ubProfile != pOtherSoldier->ubProfile )
|
||||
{
|
||||
if ( ProfileHasSkillTrait( pOtherSoldier->ubProfile, SNITCH_NT ) && !( pSoldier->usSoldierFlagMask2 & SOLDIER_PREVENT_MISBEHAVIOUR_OFF ) )
|
||||
{
|
||||
@@ -443,12 +443,20 @@ void HourlyLarryUpdate()
|
||||
// merc is not amused by being prevented
|
||||
HandleMoraleEvent( pSoldier, MORALE_PREVENTED_MISBEHAVIOUR, pSoldier->sSectorX, pSoldier->sSectorX, pSoldier->bSectorZ );
|
||||
// also here would be a place for dynamic relationship decrease between them
|
||||
// Flugente: then lets do that, shall we?
|
||||
AddOpinionEvent( pSoldier->ubProfile, pOtherSoldier->ubProfile, OPINIONEVENT_SNITCHINTERFERENCE );
|
||||
|
||||
fSnitchStoppedBehaviour = TRUE;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( fSnitchStoppedBehaviour )
|
||||
continue;
|
||||
|
||||
if ( pSoldier->ubProfile == LARRY_DRUNK )
|
||||
{
|
||||
// NB store all drunkenness info in LARRY_NORMAL profile (to use same values)
|
||||
@@ -466,6 +474,9 @@ void HourlyLarryUpdate()
|
||||
continue;
|
||||
}
|
||||
|
||||
// Flugente: dynamic opinion
|
||||
HandleDynamicOpinionAddict( pSoldier );
|
||||
|
||||
if ( fBar )
|
||||
{
|
||||
// take $ from player's account
|
||||
@@ -545,11 +556,12 @@ void HourlyStealUpdate()
|
||||
if ( Chance(50) )
|
||||
{
|
||||
// anv: snitches prevent scrounging in the same sector
|
||||
BOOLEAN fSnitchStoppedBehaviour = FALSE;
|
||||
for( INT32 cnt2 = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; cnt2 <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; ++cnt2 )
|
||||
{
|
||||
pOtherSoldier = MercPtrs[ cnt ];
|
||||
pOtherSoldier = MercPtrs[ cnt2 ];
|
||||
// note - snitches stop others, but can scrounge themselves (if they have scrounging specifically set in background...)
|
||||
if( pOtherSoldier && !pOtherSoldier->flags.fBetweenSectors && pOtherSoldier->bActive && pOtherSoldier->bInSector && !pOtherSoldier->flags.fMercAsleep && pSoldier->ubProfile != pOtherSoldier->ubProfile )
|
||||
if( pOtherSoldier && !pOtherSoldier->flags.fBetweenSectors && pOtherSoldier->bActive && !pOtherSoldier->flags.fMercAsleep && pSoldier->ubProfile != pOtherSoldier->ubProfile )
|
||||
{
|
||||
if ( ProfileHasSkillTrait( pOtherSoldier->ubProfile, SNITCH_NT ) && !( pSoldier->usSoldierFlagMask2 & SOLDIER_PREVENT_MISBEHAVIOUR_OFF ) )
|
||||
{
|
||||
@@ -572,12 +584,21 @@ void HourlyStealUpdate()
|
||||
// merc is not amused by being prevented
|
||||
HandleMoraleEvent( pSoldier, MORALE_PREVENTED_MISBEHAVIOUR, pSoldier->sSectorX, pSoldier->sSectorX, pSoldier->bSectorZ );
|
||||
// also here would be a place for dynamic relationship decrease between them
|
||||
// Flugente: then lets do that, shall we?
|
||||
AddOpinionEvent( pSoldier->ubProfile, pOtherSoldier->ubProfile, OPINIONEVENT_SNITCHINTERFERENCE );
|
||||
|
||||
fSnitchStoppedBehaviour = TRUE;
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( fSnitchStoppedBehaviour )
|
||||
continue;
|
||||
|
||||
// we loop over this sector's inventory and look for something shiny. We will pick it up if we hae enough space in our inventory
|
||||
// open sector inv
|
||||
UINT32 uiTotalNumberOfRealItems = 0;
|
||||
@@ -648,8 +669,13 @@ void HourlyStealUpdate()
|
||||
}
|
||||
|
||||
if ( pTargetObj )
|
||||
{
|
||||
AutoPlaceObject( pSoldier, pTargetObj, TRUE );
|
||||
|
||||
// Flugente: dynamic opinion
|
||||
HandleDynamicOpinionThief( pSoldier );
|
||||
}
|
||||
|
||||
// save the changed inventory
|
||||
// open sector inv
|
||||
if( ( gWorldSectorX == pSoldier->sSectorX )&&( gWorldSectorY == pSoldier->sSectorY ) && (gbWorldSectorZ == pSoldier->bSectorZ ) )
|
||||
|
||||
Reference in New Issue
Block a user