mirror of
https://github.com/1dot13/source.git
synced 2026-08-26 14:30:26 +02:00
added opinion event OPINIONEVENT_CIV_ATTACKER, used when injuring a non-hostile civilian/militia
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7891 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -1200,6 +1200,7 @@ void AddOpinionEvent( UINT8 usProfileA, UINT8 usProfileB, UINT8 usEvent, BOOLEAN
|
||||
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;
|
||||
case OPINIONEVENT_CIV_ATTACKER: gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][4] |= OPINIONFLAG_STAGE1_CIV_ATTACKER; break;
|
||||
|
||||
default: break;
|
||||
}
|
||||
@@ -1566,6 +1567,13 @@ INT8 GetDynamicOpinion( UINT8 usProfileA, UINT8 usProfileB, UINT8 usEvent )
|
||||
if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][4] & OPINIONFLAG_STAGE4_BATTLE_TOOK_PRISONER ) ++numflags;
|
||||
break;
|
||||
|
||||
case OPINIONEVENT_CIV_ATTACKER:
|
||||
if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][4] & OPINIONFLAG_STAGE1_CIV_ATTACKER ) ++numflags;
|
||||
if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][4] & OPINIONFLAG_STAGE2_CIV_ATTACKER ) ++numflags;
|
||||
if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][4] & OPINIONFLAG_STAGE3_CIV_ATTACKER ) ++numflags;
|
||||
if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][4] & OPINIONFLAG_STAGE4_CIV_ATTACKER ) ++numflags;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -2077,6 +2085,7 @@ void HandleDynamicOpinionChange( SOLDIERTYPE* pSoldier, UINT8 usEvent, BOOLEAN f
|
||||
case OPINIONEVENT_BATTLE_TOOK_PRISONER:
|
||||
case OPINIONEVENT_FRAGTHIEF:
|
||||
case OPINIONEVENT_BATTLE_ASSIST:
|
||||
case OPINIONEVENT_CIV_ATTACKER:
|
||||
break;
|
||||
|
||||
case OPINIONEVENT_SLOWSUSDOWN:
|
||||
@@ -2287,6 +2296,14 @@ void HandleDynamicOpinionChange( SOLDIERTYPE* pSoldier, UINT8 usEvent, BOOLEAN f
|
||||
continue;
|
||||
break;
|
||||
|
||||
case OPINIONEVENT_CIV_ATTACKER:
|
||||
// psychos or malicious characters dont care
|
||||
if ( gMercProfiles[pTeamSoldier->ubProfile].bCharacterTrait == CHAR_TRAIT_MALICIOUS ||
|
||||
gMercProfiles[pTeamSoldier->ubProfile].bDisability == PSYCHO ||
|
||||
MercUnderTheInfluence( pTeamSoldier, DRUG_TYPE_PSYCHO ) )
|
||||
continue;
|
||||
break;
|
||||
|
||||
default:
|
||||
// either unknown event, or event is handled elsewhere - exit
|
||||
return;
|
||||
|
||||
@@ -66,6 +66,7 @@ enum
|
||||
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_CIV_ATTACKER, // other guy attacks a non-hostile civilian
|
||||
|
||||
OPINIONEVENT_MAX
|
||||
};
|
||||
@@ -286,10 +287,10 @@ extern DynamicOpinionEvent gDynamicOpinionEvent[OPINIONEVENT_MAX];
|
||||
#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_STAGE2_BRUTAL_GOOD 0x20000000 //536870912
|
||||
#define OPINIONFLAG_STAGE3_BRUTAL_GOOD 0x40000000 //1073741824
|
||||
#define OPINIONFLAG_STAGE4_BRUTAL_GOOD 0x80000000 //2147483648*/
|
||||
#define OPINIONFLAG_STAGE1_CIV_ATTACKER 0x10000000 //268435456 // other guy attacks a non-hostile civilian
|
||||
#define OPINIONFLAG_STAGE2_CIV_ATTACKER 0x20000000 //536870912
|
||||
#define OPINIONFLAG_STAGE3_CIV_ATTACKER 0x40000000 //1073741824
|
||||
#define OPINIONFLAG_STAGE4_CIV_ATTACKER 0x80000000 //2147483648
|
||||
|
||||
#define OPINIONFLAG_STAGE1_ALL 0x11111111 // flags of all first stages, used when rolling over
|
||||
#define OPINIONFLAG_STAGE4_ALL 0x88888888 // flags of all final stages, used when rolling over
|
||||
|
||||
+7
-5
@@ -116,6 +116,7 @@ MoraleEvent gbMoraleEvent[NUM_MORALE_EVENTS] =
|
||||
// Flugente: dynamic opinions
|
||||
DynamicOpinionEvent gDynamicOpinionEvent[OPINIONEVENT_MAX] =
|
||||
{
|
||||
// ubEventId sOpinionModifier fSameSector fSameAssignment fAwake fSquadsOnly
|
||||
{ OPINIONEVENT_FRIENDLYFIRE, -10, TRUE, FALSE, FALSE, FALSE },
|
||||
{ OPINIONEVENT_SNITCHSOLDMEOUT, -3, FALSE, FALSE, FALSE, FALSE },
|
||||
{ OPINIONEVENT_SNITCHINTERFERENCE, -5, FALSE, FALSE, FALSE, FALSE },
|
||||
@@ -150,11 +151,12 @@ DynamicOpinionEvent gDynamicOpinionEvent[OPINIONEVENT_MAX] =
|
||||
{OPINIONEVENT_BRUTAL_GOOD, 1, TRUE, FALSE, TRUE, FALSE},
|
||||
{OPINIONEVENT_BRUTAL_BAD, -2, TRUE, FALSE, TRUE, 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}
|
||||
{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},
|
||||
{OPINIONEVENT_CIV_ATTACKER, -3, TRUE, FALSE, FALSE, FALSE}
|
||||
};
|
||||
|
||||
BOOLEAN gfSomeoneSaidMoraleQuote = FALSE;
|
||||
|
||||
@@ -9780,6 +9780,15 @@ UINT8 SOLDIERTYPE::SoldierTakeDamage( INT8 bHeight, INT16 sLifeDeduct, INT16 sBr
|
||||
if ( ubAttacker != NOBODY && MercPtrs[ubAttacker] )
|
||||
{
|
||||
AddOpinionEvent( this->ubProfile, MercPtrs[ubAttacker]->ubProfile, OPINIONEVENT_FRIENDLYFIRE );
|
||||
|
||||
// if this is a civilian, other mercs can complain about mercs shooting innocents
|
||||
// Flugente: dynamic opinions: if this guy is not hostile towards us, then some mercs will complain about killing civilians
|
||||
if ( this->aiData.bNeutral || this->bSide == MercPtrs[ubAttacker]->bSide )
|
||||
{
|
||||
// not for killing animals though...
|
||||
if ( this->ubBodyType != CROW && this->ubBodyType != COW )
|
||||
HandleDynamicOpinionChange( MercPtrs[ubAttacker], OPINIONEVENT_CIV_ATTACKER, TRUE, TRUE );
|
||||
}
|
||||
}
|
||||
|
||||
// CJC Jan 21 99: add check to see if we are hurting an enemy in an enemy-controlled
|
||||
@@ -22856,7 +22865,7 @@ void HandleVolunteerRecruitment( SOLDIERTYPE* pRecruiter, SOLDIERTYPE* pTarget )
|
||||
return;
|
||||
}
|
||||
|
||||
// recruiter ability
|
||||
// several factors determine whether we can successfully recruit this guy
|
||||
FLOAT leadershipfactor = EffectiveLeadership( pRecruiter ) / 100.0;
|
||||
|
||||
// bonus for assertive characters
|
||||
|
||||
Reference in New Issue
Block a user