mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
- added new dynamic opinion events, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=21961&goto=333259&#msg_333259
- Fix: dynamic opinion events on finishing battle did not occur due to faulty sector coordinates - Fix: dynamic dialogue boxes were displayed with bad screen coordinates - Change: dynamic dialogue is also written into tactical log - Change: in events that require a leader, any merc can be considered leader, not just IMPs git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7807 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+170
-24
@@ -28,6 +28,7 @@
|
||||
#include "strategicmap.h"
|
||||
#include "connect.h"
|
||||
#include "Campaign.h"
|
||||
#include "Points.h"
|
||||
|
||||
extern INT32 ReadFieldByField( HWFILE hFile, PTR pDest, UINT32 uiFieldSize, UINT32 uiElementSize, UINT32 uiCurByteCount );
|
||||
|
||||
@@ -1021,6 +1022,9 @@ BOOLEAN DynamicOpinionTacticalCharacterDialogue( DynamicOpinionSpeechEvent& aEve
|
||||
pDDBox->Create( sX, sY );
|
||||
pDDBox->SetStartTime( aEvent.usStarttime );
|
||||
|
||||
// print out the dialogue to the log, too
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"%s: %s", pSoldier->GetName(), gzQuoteStr );
|
||||
|
||||
// delay destruction of all current boxes - as long as new dialogue comes in, they will be kept
|
||||
DelayBoxDestruction( aEvent.usStarttime + gGameExternalOptions.sDynamicDialogueTimeOffset * 3.5f );
|
||||
|
||||
@@ -1191,7 +1195,12 @@ void AddOpinionEvent( UINT8 usProfileA, UINT8 usProfileB, UINT8 usEvent, BOOLEAN
|
||||
|
||||
case OPINIONEVENT_BRUTAL_BAD: gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][4] |= OPINIONFLAG_STAGE1_BRUTAL_BAD; break;
|
||||
case OPINIONEVENT_TEACHER: gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][4] |= OPINIONFLAG_STAGE1_TEACHER; break;
|
||||
|
||||
case OPINIONEVENT_BESTCOMMANDEREVER: gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][4] |= OPINIONFLAG_STAGE1_BESTCOMMANDEREVER; break;
|
||||
case OPINIONEVENT_BATTLE_SAVIOUR: gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][4] |= OPINIONFLAG_STAGE1_BATTLE_SAVIOUR; break;
|
||||
case OPINIONEVENT_FRAGTHIEF: gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][4] |= OPINIONFLAG_STAGE1_FRAGTHIEF; break;
|
||||
case OPINIONEVENT_BATTLE_ASSIST: gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][4] |= OPINIONFLAG_STAGE1_BATTLE_ASSIST; break;
|
||||
case OPINIONEVENT_BATTLE_TOOK_PRISONER: gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][4] |= OPINIONFLAG_STAGE1_BATTLE_TOOK_PRISONER; break;
|
||||
|
||||
default: break;
|
||||
}
|
||||
|
||||
@@ -1521,6 +1530,41 @@ INT8 GetDynamicOpinion( UINT8 usProfileA, UINT8 usProfileB, UINT8 usEvent )
|
||||
if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][4] & OPINIONFLAG_STAGE3_TEACHER ) ++numflags;
|
||||
if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][4] & OPINIONFLAG_STAGE4_TEACHER ) ++numflags;
|
||||
break;
|
||||
|
||||
case OPINIONEVENT_BESTCOMMANDEREVER:
|
||||
if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][4] & OPINIONFLAG_STAGE1_BESTCOMMANDEREVER ) ++numflags;
|
||||
if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][4] & OPINIONFLAG_STAGE2_BESTCOMMANDEREVER ) ++numflags;
|
||||
if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][4] & OPINIONFLAG_STAGE3_BESTCOMMANDEREVER ) ++numflags;
|
||||
if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][4] & OPINIONFLAG_STAGE4_BESTCOMMANDEREVER ) ++numflags;
|
||||
break;
|
||||
|
||||
case OPINIONEVENT_BATTLE_SAVIOUR:
|
||||
if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][4] & OPINIONFLAG_STAGE1_BATTLE_SAVIOUR ) ++numflags;
|
||||
if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][4] & OPINIONFLAG_STAGE2_BATTLE_SAVIOUR ) ++numflags;
|
||||
if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][4] & OPINIONFLAG_STAGE3_BATTLE_SAVIOUR ) ++numflags;
|
||||
if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][4] & OPINIONFLAG_STAGE4_BATTLE_SAVIOUR ) ++numflags;
|
||||
break;
|
||||
|
||||
case OPINIONEVENT_FRAGTHIEF:
|
||||
if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][4] & OPINIONFLAG_STAGE1_FRAGTHIEF ) ++numflags;
|
||||
if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][4] & OPINIONFLAG_STAGE2_FRAGTHIEF ) ++numflags;
|
||||
if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][4] & OPINIONFLAG_STAGE3_FRAGTHIEF ) ++numflags;
|
||||
if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][4] & OPINIONFLAG_STAGE4_FRAGTHIEF ) ++numflags;
|
||||
break;
|
||||
|
||||
case OPINIONEVENT_BATTLE_ASSIST:
|
||||
if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][4] & OPINIONFLAG_STAGE1_BATTLE_ASSIST ) ++numflags;
|
||||
if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][4] & OPINIONFLAG_STAGE2_BATTLE_ASSIST ) ++numflags;
|
||||
if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][4] & OPINIONFLAG_STAGE3_BATTLE_ASSIST ) ++numflags;
|
||||
if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][4] & OPINIONFLAG_STAGE4_BATTLE_ASSIST ) ++numflags;
|
||||
break;
|
||||
|
||||
case OPINIONEVENT_BATTLE_TOOK_PRISONER:
|
||||
if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][4] & OPINIONFLAG_STAGE1_BATTLE_TOOK_PRISONER ) ++numflags;
|
||||
if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][4] & OPINIONFLAG_STAGE2_BATTLE_TOOK_PRISONER ) ++numflags;
|
||||
if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][4] & OPINIONFLAG_STAGE3_BATTLE_TOOK_PRISONER ) ++numflags;
|
||||
if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][4] & OPINIONFLAG_STAGE4_BATTLE_TOOK_PRISONER ) ++numflags;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
@@ -1699,27 +1743,51 @@ void HandleDynamicOpinionOnContractExtension( UINT8 ubCode, UINT8 usProfile )
|
||||
}
|
||||
}
|
||||
|
||||
void HandleDynamicOpinionBattleLosses( )
|
||||
// depending on what happened in the battle, our mercs might complain or celebrate
|
||||
void HandleDynamicOpinionBattleFinished( BOOLEAN fBattleWon )
|
||||
{
|
||||
UINT32 badstuff = 0;
|
||||
UINT32 ourlosses = 0;
|
||||
UINT32 enemylosses = 0;
|
||||
UINT32 oursidesize = 0;
|
||||
UINT32 enemysidesize = 0;
|
||||
|
||||
// pick the 'leader' who gets all the praise (or blame, depending on how this went)
|
||||
UINT8 leaderid = GetBestMercLeaderInSector( SECTORX( gCurrentIncident.usSector ), SECTORY( gCurrentIncident.usSector ), (INT8)gCurrentIncident.usLevel );
|
||||
|
||||
for ( UINT16 i = 0; i < CAMPAIGNHISTORY_SD_CIV; ++i )
|
||||
if ( leaderid != NOBODY )
|
||||
{
|
||||
badstuff += 5 * gCurrentIncident.usKills[i];
|
||||
badstuff += gCurrentIncident.usWounds[i];
|
||||
badstuff += 4 * gCurrentIncident.usPrisoners[i];
|
||||
}
|
||||
|
||||
if ( badstuff > 100 )
|
||||
{
|
||||
// This was a disaster (Ignoring of how high the enemies losses were to create drama :-) )! Let's blame the player -> blame an IMP!
|
||||
std::vector<UINT8> aTaboo;
|
||||
UINT8 impid = GetRandomMercInSectorNotInList( SECTORX( gCurrentIncident.usSector ), SECTORY( gCurrentIncident.usSector ), (INT8)gCurrentIncident.usLevel, aTaboo, TRUE );
|
||||
|
||||
// we've found someone competent. Let's all blame him for this disaster!
|
||||
if ( impid != NOBODY )
|
||||
// while it would be logical to also take civilian losses into account, this would lead to mercs always disapproving engaging hostile civilain factions like Kingpin and the Hicks
|
||||
for ( UINT16 i = 0; i < CAMPAIGNHISTORY_SD_CIV; ++i )
|
||||
{
|
||||
HandleDynamicOpinionChange( MercPtrs[impid], OPINIONEVENT_WORSTCOMMANDEREVER, TRUE, TRUE );
|
||||
ourlosses += 10 * gCurrentIncident.usKills[i];
|
||||
ourlosses += gCurrentIncident.usWounds[i];
|
||||
ourlosses += 8 * gCurrentIncident.usPrisoners[i]; // having our side being captured is not quite as bad as having them killed
|
||||
|
||||
oursidesize += gCurrentIncident.usParticipants[i];
|
||||
}
|
||||
|
||||
for ( UINT16 i = CAMPAIGNHISTORY_SD_ENEMY_ADMIN; i < CAMPAIGNHISTORY_SD_MAX; ++i )
|
||||
{
|
||||
enemylosses += 10 * gCurrentIncident.usKills[i];
|
||||
enemylosses += gCurrentIncident.usWounds[i];
|
||||
enemylosses += 12 * gCurrentIncident.usPrisoners[i]; // capturing the enemy is even better than killing them
|
||||
|
||||
enemysidesize += gCurrentIncident.usParticipants[i];
|
||||
}
|
||||
|
||||
// complains only happen if there was a significant battle
|
||||
if ( ourlosses > 100 || enemylosses > 100 )
|
||||
{
|
||||
// if we've taken more losses than the enemy, our mercs will complain - even if we won. Our mercs don't seem to like phyrric victories...
|
||||
if ( ourlosses > enemylosses )
|
||||
{
|
||||
HandleDynamicOpinionChange( MercPtrs[leaderid], OPINIONEVENT_WORSTCOMMANDEREVER, TRUE, TRUE );
|
||||
}
|
||||
// if we won with our losses significantly lower than the enemies', while the enemy vastly outnumbered us, our mercs will be quite happy
|
||||
else if ( fBattleWon && oursidesize < 2 * enemysidesize && 4 * ourlosses < enemylosses )
|
||||
{
|
||||
HandleDynamicOpinionChange( MercPtrs[leaderid], OPINIONEVENT_BESTCOMMANDEREVER, TRUE, TRUE );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1728,7 +1796,7 @@ void HandleDynamicOpinionRetreat( )
|
||||
{
|
||||
// This was a disaster (Ignoring of how high the enemies losses were to create drama :-) )! Let's blame the player -> blame an IMP!
|
||||
std::vector<UINT8> aTaboo;
|
||||
UINT8 impid = GetRandomMercInSectorNotInList( gWorldSectorX, gWorldSectorY, gbWorldSectorZ, aTaboo, TRUE );
|
||||
UINT8 impid = GetBestMercLeaderInSector( gWorldSectorX, gWorldSectorY, gbWorldSectorZ );
|
||||
|
||||
// we've found someone competent. Let's all blame him for this disaster!
|
||||
if ( impid != NOBODY )
|
||||
@@ -1814,14 +1882,59 @@ void HandleDynamicOpinionTeaching( SOLDIERTYPE* pSoldier, UINT8 ubStat )
|
||||
}
|
||||
}
|
||||
|
||||
// some events require a 'leader' - merc the team will regard as the one being in charge, and subsequently being praised or damned for the way things develop
|
||||
UINT32 GetSoldierLeaderRating( SOLDIERTYPE* pSoldier )
|
||||
{
|
||||
if ( !pSoldier )
|
||||
return 0;
|
||||
|
||||
// rating is based on leadership, experience and the squad leader trait. IMPs get a higher rating, as they represent the player closest
|
||||
UINT32 rating = 0;
|
||||
|
||||
rating += pSoldier->stats.bLeadership;
|
||||
rating += 10 * pSoldier->stats.bExpLevel;
|
||||
rating += 30 * NUM_SKILL_TRAITS( pSoldier, SQUADLEADER_NT );
|
||||
rating += 50 * (pSoldier->ubWhatKindOfMercAmI == MERC_TYPE__PLAYER_CHARACTER);
|
||||
|
||||
return rating;
|
||||
}
|
||||
|
||||
|
||||
UINT8 GetBestMercLeaderInSector( INT16 sX, INT16 sY, INT8 sZ )
|
||||
{
|
||||
UINT32 highestrating = 0;
|
||||
UINT8 bestid = NOBODY;
|
||||
|
||||
SOLDIERTYPE* pSoldier = NULL;
|
||||
UINT16 bMercID = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||
UINT16 bLastTeamID = gTacticalStatus.Team[gbPlayerNum].bLastID;
|
||||
for ( pSoldier = MercPtrs[bMercID]; bMercID <= bLastTeamID; ++bMercID, ++pSoldier )
|
||||
{
|
||||
// everybody other merc in the same sector gets annoyed
|
||||
if ( pSoldier->bActive && pSoldier->ubProfile != NO_PROFILE &&
|
||||
pSoldier->sSectorX == sX && pSoldier->sSectorY == sY && pSoldier->bSectorZ == sZ &&
|
||||
!(pSoldier->bAssignment == IN_TRANSIT || pSoldier->bAssignment == ASSIGNMENT_DEAD) )
|
||||
{
|
||||
UINT32 rating = GetSoldierLeaderRating( pSoldier );
|
||||
|
||||
if ( rating > highestrating )
|
||||
{
|
||||
highestrating = rating;
|
||||
bestid = bMercID;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return bestid;
|
||||
}
|
||||
|
||||
UINT8 GetRandomMercInSectorNotInList( INT16 sX, INT16 sY, INT8 sZ, std::vector<UINT8> aTaboo, BOOLEAN fImpOnly )
|
||||
{
|
||||
std::vector<UINT8> resultvector;
|
||||
std::vector<UINT8> resultvector;
|
||||
SOLDIERTYPE* pTeamSoldier = NULL;
|
||||
UINT16 bMercID = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||
UINT16 bLastTeamID = gTacticalStatus.Team[gbPlayerNum].bLastID;
|
||||
for ( pTeamSoldier = MercPtrs[bMercID]; bMercID <= bLastTeamID; ++bMercID, pTeamSoldier++ )
|
||||
for ( pTeamSoldier = MercPtrs[bMercID]; bMercID <= bLastTeamID; ++bMercID, ++pTeamSoldier )
|
||||
{
|
||||
// everybody other merc in the same sector gets annoyed
|
||||
if ( pTeamSoldier->bActive && pTeamSoldier->ubProfile != NO_PROFILE &&
|
||||
@@ -1832,7 +1945,7 @@ UINT8 GetRandomMercInSectorNotInList( INT16 sX, INT16 sY, INT8 sZ, std::vector<U
|
||||
{
|
||||
// only add if not already in list
|
||||
if ( std::find( aTaboo.begin( ), aTaboo.end( ), pTeamSoldier->ubProfile ) == aTaboo.end( ) )
|
||||
resultvector.push_back( pTeamSoldier->ubProfile );
|
||||
resultvector.push_back( bMercID );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1841,7 +1954,7 @@ UINT8 GetRandomMercInSectorNotInList( INT16 sX, INT16 sY, INT8 sZ, std::vector<U
|
||||
return resultvector[Random( resultvector.size( ) )];
|
||||
}
|
||||
|
||||
return NO_PROFILE;
|
||||
return NOBODY;
|
||||
}
|
||||
|
||||
UINT8 GetFittingInterjectorProfile( UINT8 usEvent, UINT8 usProfileVictim, UINT8 usProfileCause )
|
||||
@@ -1957,6 +2070,11 @@ void HandleDynamicOpinionChange( SOLDIERTYPE* pSoldier, UINT8 usEvent, BOOLEAN f
|
||||
case OPINIONEVENT_BRUTAL_GOOD:
|
||||
case OPINIONEVENT_BRUTAL_BAD:
|
||||
case OPINIONEVENT_TEACHER:
|
||||
case OPINIONEVENT_BESTCOMMANDEREVER:
|
||||
case OPINIONEVENT_BATTLE_SAVIOUR:
|
||||
case OPINIONEVENT_BATTLE_TOOK_PRISONER:
|
||||
case OPINIONEVENT_FRAGTHIEF:
|
||||
case OPINIONEVENT_BATTLE_ASSIST:
|
||||
break;
|
||||
|
||||
case OPINIONEVENT_SLOWSUSDOWN:
|
||||
@@ -2135,8 +2253,36 @@ void HandleDynamicOpinionChange( SOLDIERTYPE* pSoldier, UINT8 usEvent, BOOLEAN f
|
||||
break;
|
||||
|
||||
case OPINIONEVENT_TEACHER:
|
||||
// other guy needs to be a trainer
|
||||
case OPINIONEVENT_BESTCOMMANDEREVER:
|
||||
break;
|
||||
|
||||
case OPINIONEVENT_FRAGTHIEF:
|
||||
// we care if we were going for the same target at the same location
|
||||
if ( pTeamSoldier->ubTargetID == pSoldier->ubTargetID && pTeamSoldier->sTargetGridNo == pSoldier->sTargetGridNo )
|
||||
{
|
||||
// are we ambitious enough to care about kill counts?
|
||||
if ( gMercProfiles[pTeamSoldier->ubProfile].bCharacterTrait == CHAR_TRAIT_ASSERTIVE || gMercProfiles[pTeamSoldier->ubProfile].bCharacterTrait == CHAR_TRAIT_SHOWOFF )
|
||||
{
|
||||
// did we have enough AP to claim we were about to finish them?
|
||||
if ( !EnoughPoints( pTeamSoldier, 60, 0, FALSE ) )
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
// we are grateful for the assistance instead
|
||||
usEventUsed = OPINIONEVENT_BATTLE_ASSIST;
|
||||
}
|
||||
}
|
||||
else
|
||||
continue;
|
||||
break;
|
||||
|
||||
case OPINIONEVENT_BATTLE_TOOK_PRISONER:
|
||||
// we only care if we prefer the enemy to be taken alive
|
||||
if ( !(gMercProfiles[pTeamSoldier->ubProfile].ubMiscFlags3 & PROFILE_MISC_FLAG3_GOODGUY ||
|
||||
gMercProfiles[pTeamSoldier->ubProfile].bCharacterTrait == CHAR_TRAIT_INTELLECTUAL ||
|
||||
gMercProfiles[pTeamSoldier->ubProfile].bCharacterTrait == CHAR_TRAIT_PACIFIST) )
|
||||
continue;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
+35
-22
@@ -60,6 +60,12 @@ enum
|
||||
|
||||
OPINIONEVENT_BRUTAL_BAD, // other guy killed someone in a brutal fashion, and we dislike that
|
||||
OPINIONEVENT_TEACHER, // other guy taught us and we are grateful
|
||||
OPINIONEVENT_BESTCOMMANDEREVER, // we won a battle through what must be magnificent leadership
|
||||
OPINIONEVENT_BATTLE_SAVIOUR, // other guy saved us in a firefight
|
||||
|
||||
OPINIONEVENT_FRAGTHIEF, // other guy stole our kill
|
||||
OPINIONEVENT_BATTLE_ASSIST, // other guy assisted us in battle
|
||||
OPINIONEVENT_BATTLE_TOOK_PRISONER, // other guy chose to take prisoners instead of killing the enemy
|
||||
|
||||
OPINIONEVENT_MAX
|
||||
};
|
||||
@@ -255,32 +261,32 @@ extern DynamicOpinionEvent gDynamicOpinionEvent[OPINIONEVENT_MAX];
|
||||
#define OPINIONFLAG_STAGE3_TEACHER 0x00000040 //64
|
||||
#define OPINIONFLAG_STAGE4_TEACHER 0x00000080 //128
|
||||
|
||||
/*#define OPINIONFLAG_STAGE1_SOLVECONFLICT_REASON_BAD 0x00000100 //256 // attempted to solve the conflict reasonably, and we thought that was bad
|
||||
#define OPINIONFLAG_STAGE2_SOLVECONFLICT_REASON_BAD 0x00000200 //512
|
||||
#define OPINIONFLAG_STAGE3_SOLVECONFLICT_REASON_BAD 0x00000400 //1024
|
||||
#define OPINIONFLAG_STAGE4_SOLVECONFLICT_REASON_BAD 0x00000800 //2048
|
||||
#define OPINIONFLAG_STAGE1_BESTCOMMANDEREVER 0x00000100 //256 // this guy lead our team to a magnificent victory
|
||||
#define OPINIONFLAG_STAGE2_BESTCOMMANDEREVER 0x00000200 //512
|
||||
#define OPINIONFLAG_STAGE3_BESTCOMMANDEREVER 0x00000400 //1024
|
||||
#define OPINIONFLAG_STAGE4_BESTCOMMANDEREVER 0x00000800 //2048
|
||||
|
||||
#define OPINIONFLAG_STAGE1_SOLVECONFLICT_AGGRESSIVE_GOOD 0x00001000 //4096 // attempted to solve the conflict agressively, and we thought that was good
|
||||
#define OPINIONFLAG_STAGE2_SOLVECONFLICT_AGGRESSIVE_GOOD 0x00002000 //8192
|
||||
#define OPINIONFLAG_STAGE3_SOLVECONFLICT_AGGRESSIVE_GOOD 0x00004000 //16384
|
||||
#define OPINIONFLAG_STAGE4_SOLVECONFLICT_AGGRESSIVE_GOOD 0x00008000 //32768
|
||||
#define OPINIONFLAG_STAGE1_BATTLE_SAVIOUR 0x00001000 //4096 // other guy saved us in a firefight
|
||||
#define OPINIONFLAG_STAGE2_BATTLE_SAVIOUR 0x00002000 //8192
|
||||
#define OPINIONFLAG_STAGE3_BATTLE_SAVIOUR 0x00004000 //16384
|
||||
#define OPINIONFLAG_STAGE4_BATTLE_SAVIOUR 0x00008000 //32768
|
||||
|
||||
#define OPINIONFLAG_STAGE1_SOLVECONFLICT_AGGRESSIVE_BAD 0x00010000 //65536 // attempted to solve the conflict agressively, and we thought that was bad
|
||||
#define OPINIONFLAG_STAGE2_SOLVECONFLICT_AGGRESSIVE_BAD 0x00020000 //131072
|
||||
#define OPINIONFLAG_STAGE3_SOLVECONFLICT_AGGRESSIVE_BAD 0x00040000 //262144
|
||||
#define OPINIONFLAG_STAGE4_SOLVECONFLICT_AGGRESSIVE_BAD 0x00080000 //524288
|
||||
#define OPINIONFLAG_STAGE1_FRAGTHIEF 0x00010000 //65536 // other guy stole our kill
|
||||
#define OPINIONFLAG_STAGE2_FRAGTHIEF 0x00020000 //131072
|
||||
#define OPINIONFLAG_STAGE3_FRAGTHIEF 0x00040000 //262144
|
||||
#define OPINIONFLAG_STAGE4_FRAGTHIEF 0x00080000 //524288
|
||||
|
||||
#define OPINIONFLAG_STAGE1_DISEASE_DISGUSTING 0x00100000 //1048576 // is diseased, which we find disgusting
|
||||
#define OPINIONFLAG_STAGE2_DISEASE_DISGUSTING 0x00200000 //2097152
|
||||
#define OPINIONFLAG_STAGE3_DISEASE_DISGUSTING 0x00400000 //4194304
|
||||
#define OPINIONFLAG_STAGE4_DISEASE_DISGUSTING 0x00800000 //8388608
|
||||
#define OPINIONFLAG_STAGE1_BATTLE_ASSIST 0x00100000 //1048576 // other guy assisted us in battle
|
||||
#define OPINIONFLAG_STAGE2_BATTLE_ASSIST 0x00200000 //2097152
|
||||
#define OPINIONFLAG_STAGE3_BATTLE_ASSIST 0x00400000 //4194304
|
||||
#define OPINIONFLAG_STAGE4_BATTLE_ASSIST 0x00800000 //8388608
|
||||
|
||||
#define OPINIONFLAG_STAGE1_DISEASE_TREATMENT 0x01000000 //16777216 // treated our disease, which we like
|
||||
#define OPINIONFLAG_STAGE2_DISEASE_TREATMENT 0x02000000 //33554432
|
||||
#define OPINIONFLAG_STAGE3_DISEASE_TREATMENT 0x04000000 //67108864
|
||||
#define OPINIONFLAG_STAGE4_DISEASE_TREATMENT 0x08000000 //134217728
|
||||
#define OPINIONFLAG_STAGE1_BATTLE_TOOK_PRISONER 0x01000000 //16777216 // other guy chose to take prisoners instead of killing the enemy
|
||||
#define OPINIONFLAG_STAGE2_BATTLE_TOOK_PRISONER 0x02000000 //33554432
|
||||
#define OPINIONFLAG_STAGE3_BATTLE_TOOK_PRISONER 0x04000000 //67108864
|
||||
#define OPINIONFLAG_STAGE4_BATTLE_TOOK_PRISONER 0x08000000 //134217728
|
||||
|
||||
#define OPINIONFLAG_STAGE1_BRUTAL_GOOD 0x10000000 //268435456 // other guy killed someone in a brutal fashion, and we like that
|
||||
/*#define OPINIONFLAG_STAGE1_BRUTAL_GOOD 0x10000000 //268435456 // other guy killed someone in a brutal fashion, and we like that
|
||||
#define OPINIONFLAG_STAGE2_BRUTAL_GOOD 0x20000000 //536870912
|
||||
#define OPINIONFLAG_STAGE3_BRUTAL_GOOD 0x40000000 //1073741824
|
||||
#define OPINIONFLAG_STAGE4_BRUTAL_GOOD 0x80000000 //2147483648*/
|
||||
@@ -463,11 +469,18 @@ void RolloverDynamicOpinions( UINT8 usProfileA );
|
||||
void CheckForFriendsofHated( SOLDIERTYPE* pSoldier );
|
||||
|
||||
void HandleDynamicOpinionOnContractExtension( UINT8 ubCode, UINT8 usProfile );
|
||||
void HandleDynamicOpinionBattleLosses( );
|
||||
|
||||
// depending on what happened in the battle, our mercs might complain or celebrate
|
||||
void HandleDynamicOpinionBattleFinished( BOOLEAN fBattleWon );
|
||||
void HandleDynamicOpinionRetreat( );
|
||||
void HandleDynamicOpinionTeamDrinking( SOLDIERTYPE* pSoldier );
|
||||
void HandleDynamicOpinionTeaching( SOLDIERTYPE* pSoldier, UINT8 ubStat );
|
||||
|
||||
// some events require a 'leader' - merc the team will regard as the one being in charge, and subsequently being praised or damned for the way things develop
|
||||
UINT32 GetSoldierLeaderRating( SOLDIERTYPE* pSoldier );
|
||||
|
||||
UINT8 GetBestMercLeaderInSector( INT16 sX, INT16 sY, INT8 sZ );
|
||||
|
||||
// get id of a random merc in a sector, provided one exists
|
||||
UINT8 GetRandomMercInSectorNotInList( INT16 sX, INT16 sY, INT8 sZ, std::vector<UINT8> aTaboo, BOOLEAN fImpOnly );
|
||||
|
||||
|
||||
+7
-2
@@ -128,7 +128,7 @@ DynamicOpinionEvent gDynamicOpinionEvent[OPINIONEVENT_MAX] =
|
||||
{ OPINIONEVENT_ANNOYINGDISABILITY, -2, TRUE, FALSE, TRUE, FALSE },
|
||||
{ OPINIONEVENT_ADDICT, -6, TRUE, FALSE, TRUE, FALSE },
|
||||
{ OPINIONEVENT_THIEF, -5, TRUE, FALSE, TRUE, FALSE },
|
||||
{ OPINIONEVENT_WORSTCOMMANDEREVER, -7, TRUE, FALSE, FALSE, TRUE },
|
||||
{ OPINIONEVENT_WORSTCOMMANDEREVER, -9, TRUE, FALSE, FALSE, TRUE },
|
||||
{ OPINIONEVENT_RICHGUY, -1, FALSE, FALSE, FALSE, FALSE },
|
||||
{ OPINIONEVENT_BETTERGEAR, -2, TRUE, FALSE, FALSE, TRUE },
|
||||
{ OPINIONEVENT_YOUMOUNTEDAGUNONMYBREASTS, -3, TRUE, FALSE, FALSE, TRUE },
|
||||
@@ -149,7 +149,12 @@ DynamicOpinionEvent gDynamicOpinionEvent[OPINIONEVENT_MAX] =
|
||||
{OPINIONEVENT_DISEASE_TREATMENT, 1, TRUE, FALSE, TRUE, FALSE},
|
||||
{OPINIONEVENT_BRUTAL_GOOD, 1, TRUE, FALSE, TRUE, FALSE},
|
||||
{OPINIONEVENT_BRUTAL_BAD, -2, TRUE, FALSE, TRUE, FALSE},
|
||||
{OPINIONEVENT_TEACHER, 1, TRUE, FALSE, FALSE, FALSE}
|
||||
{OPINIONEVENT_TEACHER, 1, TRUE, FALSE, FALSE, FALSE},
|
||||
{ OPINIONEVENT_BESTCOMMANDEREVER, 8, TRUE, FALSE, FALSE, TRUE },
|
||||
{ OPINIONEVENT_BATTLE_SAVIOUR, 6, TRUE, FALSE, FALSE, TRUE},
|
||||
{ OPINIONEVENT_FRAGTHIEF, -2, TRUE, FALSE, FALSE, TRUE},
|
||||
{ OPINIONEVENT_BATTLE_ASSIST, -1, TRUE, FALSE, FALSE, TRUE},
|
||||
{ OPINIONEVENT_BATTLE_TOOK_PRISONER, 3, TRUE, FALSE, FALSE, TRUE}
|
||||
};
|
||||
|
||||
BOOLEAN gfSomeoneSaidMoraleQuote = FALSE;
|
||||
|
||||
@@ -10544,6 +10544,10 @@ void PrisonerSurrenderMessageBoxCallBack( UINT8 ubExitValue )
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// dynamic opinion: a merc caused the remaining enemies to give up
|
||||
if ( gusSelectedSoldier != NOBODY )
|
||||
HandleDynamicOpinionChange( MercPtrs[gusSelectedSoldier], OPINIONEVENT_BATTLE_TOOK_PRISONER, TRUE, TRUE );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -3961,6 +3961,23 @@ BOOLEAN HandleSoldierDeath( SOLDIERTYPE *pSoldier , BOOLEAN *pfMadeCorpse )
|
||||
//gMercProfiles[ MercPtrs[ pSoldier->ubAttackerID ]->ubProfile ].usKills++;
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
gStrategicStatus.usPlayerKills++;
|
||||
|
||||
// Flugente: dynamic opinions: if this guy is a not-hostile civilian, then some mercs will complain about killing civilians
|
||||
if ( pSoldier->bTeam == CIV_TEAM && (pSoldier->aiData.bNeutral || pSoldier->bSide == MercPtrs[ubAttacker]->bSide) )
|
||||
HandleDynamicOpinionChange( MercPtrs[ubAttacker], OPINIONEVENT_CIVKILLER, TRUE, TRUE );
|
||||
else
|
||||
{
|
||||
// if this enemy was attacking a freshly wounded merc, it is likely they posed a real threat - the merc will be thankful for saving their life
|
||||
if ( pSoldier->ubTargetID != NOBODY && MercPtrs[pSoldier->ubTargetID]->bBleeding > 10 )
|
||||
{
|
||||
AddOpinionEvent( MercPtrs[pSoldier->ubTargetID]->ubProfile, MercPtrs[ubAttacker]->ubProfile, OPINIONEVENT_BATTLE_SAVIOUR );
|
||||
}
|
||||
else
|
||||
{
|
||||
// complain about a fragthief, or thank for assistance - correct event is chosen internally
|
||||
HandleDynamicOpinionChange( MercPtrs[ubAttacker], OPINIONEVENT_FRAGTHIEF, TRUE, TRUE );
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( MercPtrs[ ubAttacker ]->bTeam == MILITIA_TEAM )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user