mirror of
https://github.com/1dot13/source.git
synced 2026-09-02 14:36:06 +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:
@@ -2917,7 +2917,7 @@ UINT32 CalculateSnitchGuardValue(SOLDIERTYPE *pSoldier, UINT16 *pusMaxPts )
|
||||
return 0;
|
||||
|
||||
// only undercover snitches count
|
||||
if ( !pSoldier->bAssignment == FACILITY_PRISON_SNITCH )
|
||||
if ( pSoldier->bAssignment != FACILITY_PRISON_SNITCH )
|
||||
return 0;
|
||||
|
||||
usValue = 15 * EffectiveExpLevel( pSoldier ) + EffectiveLeadership( pSoldier ) / 2 + 2 * EffectiveWisdom( pSoldier );
|
||||
@@ -5178,6 +5178,9 @@ void FatigueCharacter( SOLDIERTYPE *pSoldier )
|
||||
{
|
||||
iBreathLoss = (INT32)(bMaxBreathLoss * iPercentEncumbrance / 100);
|
||||
bMaxBreathLoss = (float)min( 127, iBreathLoss );
|
||||
|
||||
// Flugente: dynamic opinions: other mercs might get annoyed, because we are slowing down the team
|
||||
HandleDynamicOpinionSlowdown( pSoldier );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4646,7 +4646,12 @@ void AttackTarget( SOLDIERCELL *pAttacker, SOLDIERCELL *pTarget )
|
||||
else if ( pTarget->pSoldier->bTeam == CIV_TEAM && !pTarget->pSoldier->aiData.bNeutral && pTarget->pSoldier->bSide != gbPlayerNum )
|
||||
gMercProfiles[ pAttacker->pSoldier->ubProfile ].records.usKillsHostiles++;
|
||||
else
|
||||
{
|
||||
gMercProfiles[ pAttacker->pSoldier->ubProfile ].records.usKillsOthers++;
|
||||
|
||||
// Flugente: dynamic opinions
|
||||
HandleDynamicOpinionCivKill( pAttacker->pSoldier );
|
||||
}
|
||||
break;
|
||||
}
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -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 ) )
|
||||
|
||||
@@ -610,6 +610,9 @@ void MercDailyUpdate()
|
||||
|
||||
// anv: time for snitches to report
|
||||
HandleSnitchCheck();
|
||||
|
||||
// Flugente: dynmaic opinion rollover
|
||||
HandleDynamicOpinions();
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -2061,6 +2061,9 @@ void HandleLoyaltyImplicationsOfMercRetreat( INT8 bRetreatCode, INT16 sSectorX,
|
||||
{
|
||||
HandleMoraleEvent( NULL, MORALE_RAN_AWAY, sSectorX, sSectorY, (INT8)sSectorZ );
|
||||
}
|
||||
|
||||
// Flugente: dynamic opinion: mercs retreated. Someone has to be blamed for this shameful defeat!
|
||||
HandleDynamicOpinionRetreat();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user