mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
New feature (by rftr): Mini events are a feature where the player can receive short text blurbs, and pick one of two outcomes.
Based on game implementations like Gloomhaven (road/city events) or Battletech (travel events). For more info, see https://thepit.ja-galaxy-forum.com/index.php?t=msg&th=24865&goto=363481&#msg_363481 Requires GameDir >= r2599 git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9137 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -475,7 +475,7 @@ void ProfileUpdateStats( MERCPROFILESTRUCT *pProfile, UINT8 ubReason )
|
||||
}
|
||||
|
||||
|
||||
void ChangeStat( MERCPROFILESTRUCT *pProfile, SOLDIERTYPE *pSoldier, UINT8 ubStat, INT16 sPtsChanged, UINT8 ubReason = 0 )
|
||||
void ChangeStat( MERCPROFILESTRUCT *pProfile, SOLDIERTYPE *pSoldier, UINT8 ubStat, INT16 sPtsChanged, UINT8 ubReason )
|
||||
{
|
||||
// this function changes the stat a given amount...
|
||||
INT16 *psStatGainPtr = NULL;
|
||||
|
||||
@@ -66,6 +66,7 @@ void StatChange(SOLDIERTYPE *pSoldier, UINT8 ubStat, UINT16 usNumChances, UINT8
|
||||
void ProfileStatChange(MERCPROFILESTRUCT *pProfile, UINT8 ubStat, UINT16 usNumChances, UINT8 ubReason);
|
||||
void ProcessStatChange(MERCPROFILESTRUCT *pProfile, UINT8 ubStat, UINT16 usNumChances, UINT8 ubReason);
|
||||
|
||||
void ChangeStat(MERCPROFILESTRUCT* pProfile, SOLDIERTYPE* pSoldier, UINT8 ubStat, INT16 sPtsChanged, UINT8 ubReason = 0);
|
||||
void UpdateStats( SOLDIERTYPE *pSoldier, UINT8 ubReason = 0 );
|
||||
void ProfileUpdateStats( MERCPROFILESTRUCT *pProfile, UINT8 ubReason = 0 );
|
||||
void ProcessUpdateStats( MERCPROFILESTRUCT *pProfile, SOLDIERTYPE *pSoldier, UINT8 ubReason = 0 );
|
||||
|
||||
@@ -1512,6 +1512,9 @@ BOOLEAN DelayedTacticalCharacterDialogue( SOLDIERTYPE *pSoldier, UINT16 usQuoteN
|
||||
if( pSoldier->bAssignment == ASSIGNMENT_POW )
|
||||
return( FALSE );
|
||||
|
||||
if( pSoldier->bAssignment == ASSIGNMENT_MINIEVENT )
|
||||
return( FALSE );
|
||||
|
||||
return( CharacterDialogue( pSoldier->ubProfile, usQuoteNum, pSoldier->iFaceIndex, DIALOGUE_TACTICAL_UI, TRUE, TRUE ) );
|
||||
}
|
||||
|
||||
@@ -1569,6 +1572,8 @@ BOOLEAN TacticalCharacterDialogueWithSpecialEventEx( SOLDIERTYPE *pSoldier, UINT
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
if( pSoldier->bAssignment == ASSIGNMENT_MINIEVENT )
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
return( CharacterDialogueWithSpecialEventEx( pSoldier->ubProfile, usQuoteNum, pSoldier->iFaceIndex, DIALOGUE_TACTICAL_UI, TRUE, FALSE, uiFlag, uiData1, uiData2, uiData3 ) );
|
||||
@@ -1617,6 +1622,9 @@ BOOLEAN TacticalCharacterDialogue( SOLDIERTYPE *pSoldier, UINT16 usQuoteNum )
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
if( pSoldier->bAssignment == ASSIGNMENT_MINIEVENT )
|
||||
return( FALSE );
|
||||
|
||||
// OK, let's check if this is the exact one we just played, if so, skip.
|
||||
if ( pSoldier->ubProfile == gTacticalStatus.ubLastQuoteProfileNUm &&
|
||||
usQuoteNum == gTacticalStatus.ubLastQuoteSaid )
|
||||
@@ -1706,6 +1714,9 @@ BOOLEAN SnitchTacticalCharacterDialogue( SOLDIERTYPE *pSoldier, UINT16 usQuoteNu
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
if( pSoldier->bAssignment == ASSIGNMENT_MINIEVENT )
|
||||
return( FALSE );
|
||||
|
||||
// OK, let's check if this is the exact one we just played, if so, skip.
|
||||
//if ( pSoldier->ubProfile == gTacticalStatus.ubLastQuoteProfileNUm &&
|
||||
// usQuoteNum == gTacticalStatus.ubLastQuoteSaid )
|
||||
@@ -1760,6 +1771,9 @@ BOOLEAN AdditionalTacticalCharacterDialogue_CallsLua( SOLDIERTYPE *pSoldier, UIN
|
||||
if ( pSoldier->bAssignment == ASSIGNMENT_POW )
|
||||
return( FALSE );
|
||||
|
||||
if( pSoldier->bAssignment == ASSIGNMENT_MINIEVENT )
|
||||
return( FALSE );
|
||||
|
||||
if ( AM_AN_EPC( pSoldier ) && !( gMercProfiles[pSoldier->ubProfile].ubMiscFlags & PROFILE_MISC_FLAG_FORCENPCQUOTE ) )
|
||||
return( FALSE );
|
||||
|
||||
@@ -1788,7 +1802,7 @@ void AdditionalTacticalCharacterDialogue_AllInSector(INT16 aSectorX, INT16 aSect
|
||||
if ( pSoldier->stats.bLife >= OKLIFE && pSoldier->bActive &&
|
||||
pSoldier->ubProfile != ausIgnoreProfile &&
|
||||
pSoldier->sSectorX == aSectorX && pSoldier->sSectorY == aSectorY && pSoldier->bSectorZ == aSectorZ &&
|
||||
pSoldier->bAssignment != ASSIGNMENT_POW && pSoldier->bAssignment != IN_TRANSIT &&
|
||||
pSoldier->bAssignment != ASSIGNMENT_POW && pSoldier->bAssignment != IN_TRANSIT && pSoldier->bAssignment != ASSIGNMENT_MINIEVENT &&
|
||||
(aAroundGridno == NOWHERE || PythSpacesAway( pSoldier->sGridNo, aAroundGridno ) <= aRadius ) &&
|
||||
!pSoldier->flags.fBetweenSectors )
|
||||
{
|
||||
@@ -2088,6 +2102,9 @@ BOOLEAN ExecuteCharacterDialogue( UINT8 ubCharacterNum, UINT16 usQuoteNum, INT32
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
if( pSoldier->bAssignment == ASSIGNMENT_MINIEVENT )
|
||||
return( FALSE );
|
||||
|
||||
// sleeping guys don't talk.. go to standby to talk
|
||||
if( pSoldier->flags.fMercAsleep == TRUE )
|
||||
{
|
||||
|
||||
@@ -957,6 +957,9 @@ BOOLEAN DynamicOpinionTacticalCharacterDialogue( DynamicOpinionSpeechEvent& aEve
|
||||
if ( pSoldier->bAssignment == ASSIGNMENT_POW )
|
||||
return(FALSE);
|
||||
|
||||
if( pSoldier->bAssignment == ASSIGNMENT_MINIEVENT )
|
||||
return( FALSE );
|
||||
|
||||
CHAR16 gzQuoteStr[500];
|
||||
|
||||
// remove old box, in case that still exists
|
||||
@@ -2017,7 +2020,7 @@ UINT8 GetFittingInterjectorProfile( UINT8 usEvent, UINT8 usProfileVictim, UINT8
|
||||
for ( pTeamSoldier = MercPtrs[bMercID]; bMercID <= bLastTeamID; ++bMercID, pTeamSoldier++ )
|
||||
{
|
||||
// only people that are here
|
||||
if ( !pTeamSoldier->bActive || pTeamSoldier->bAssignment == IN_TRANSIT || pTeamSoldier->bAssignment == ASSIGNMENT_DEAD || pTeamSoldier->bAssignment == ASSIGNMENT_POW )
|
||||
if ( !pTeamSoldier->bActive || pTeamSoldier->bAssignment == IN_TRANSIT || pTeamSoldier->bAssignment == ASSIGNMENT_DEAD || pTeamSoldier->bAssignment == ASSIGNMENT_POW || pTeamSoldier->bAssignment == ASSIGNMENT_MINIEVENT )
|
||||
continue;
|
||||
|
||||
// if fSameSector is TRUE then the teammate must be in the same sector
|
||||
|
||||
+14
-2
@@ -595,8 +595,8 @@ void HourlyFoodAutoDigestion( SOLDIERTYPE *pSoldier )
|
||||
// if we're a prisoner, we can't feed ourself, and the player can't do that either. Instead the army provides food (not much and of bad quality)
|
||||
if (pSoldier->bAssignment == ASSIGNMENT_POW)
|
||||
{
|
||||
INT16 powwater = gGameExternalOptions.usFoodDigestionHourlyBaseDrink * gGameExternalOptions.sFoodDigestionAssignment * FOOD_POW_MULTIPLICATOR;
|
||||
INT16 powfoodadd = powwater * gGameExternalOptions.usFoodDigestionHourlyBaseFood / max(1, gGameExternalOptions.usFoodDigestionHourlyBaseDrink);
|
||||
const INT16 powwater = gGameExternalOptions.usFoodDigestionHourlyBaseDrink * gGameExternalOptions.sFoodDigestionAssignment * FOOD_POW_MULTIPLICATOR;
|
||||
const INT16 powfoodadd = powwater * gGameExternalOptions.usFoodDigestionHourlyBaseFood / max(1, gGameExternalOptions.usFoodDigestionHourlyBaseDrink);
|
||||
|
||||
// if we're thirsty or hungry, and this is nutritious, consume it
|
||||
if ( pSoldier->bDrinkLevel < FoodMoraleMods[FOOD_VERY_LOW].bThreshold )
|
||||
@@ -605,6 +605,18 @@ void HourlyFoodAutoDigestion( SOLDIERTYPE *pSoldier )
|
||||
if ( pSoldier->bFoodLevel < FoodMoraleMods[FOOD_VERY_LOW].bThreshold )
|
||||
AddFoodpoints(pSoldier->bDrinkLevel, powfoodadd);
|
||||
}
|
||||
// while on a minievent, assume that we can feed ourselves.. somehow
|
||||
else if (pSoldier->bAssignment == ASSIGNMENT_MINIEVENT)
|
||||
{
|
||||
const INT16 water = gGameExternalOptions.usFoodDigestionHourlyBaseDrink * gGameExternalOptions.sFoodDigestionAssignment;
|
||||
const INT16 foodadd = water * gGameExternalOptions.usFoodDigestionHourlyBaseFood / max(1, gGameExternalOptions.usFoodDigestionHourlyBaseDrink);
|
||||
|
||||
if ( pSoldier->bDrinkLevel < FoodMoraleMods[FOOD_NORMAL].bThreshold )
|
||||
AddFoodpoints(pSoldier->bDrinkLevel, water);
|
||||
|
||||
if ( pSoldier->bFoodLevel < FoodMoraleMods[FOOD_NORMAL].bThreshold )
|
||||
AddFoodpoints(pSoldier->bDrinkLevel, foodadd);
|
||||
}
|
||||
else
|
||||
{
|
||||
// no eating if not able to!
|
||||
|
||||
@@ -6305,7 +6305,7 @@ void SOLDIERTYPE::EVENT_SoldierGotHit( UINT16 usWeaponIndex, INT16 sDamage, INT1
|
||||
// If anything other than on a squad or guard, make them guard....
|
||||
if ( this->bTeam == gbPlayerNum )
|
||||
{
|
||||
if ( this->bAssignment >= ON_DUTY && this->bAssignment != ASSIGNMENT_POW )
|
||||
if ( this->bAssignment >= ON_DUTY && this->bAssignment != ASSIGNMENT_POW && this->bAssignment != ASSIGNMENT_MINIEVENT )
|
||||
{
|
||||
if ( this->flags.fMercAsleep )
|
||||
{
|
||||
|
||||
@@ -1575,8 +1575,8 @@ public:
|
||||
|
||||
// Flugente: Decrease this filler by 1 for each new UINT8 / BOOLEAN variable, so we can maintain savegame compatibility!!
|
||||
// Note that we also have to account for padding, so you might need to substract more than just the size of the new variables
|
||||
UINT8 ubFiller[12];
|
||||
UINT8 ubFiller1;
|
||||
UINT8 ubFiller[10];
|
||||
UINT16 ubHoursRemainingOnMiniEvent;
|
||||
|
||||
// Flugente: modifiers to fire modes
|
||||
UINT8 usGLDelayMode; // if > 0, delay GL grenade explosions
|
||||
|
||||
@@ -1384,6 +1384,11 @@ BOOLEAN IsSquadInSector( SOLDIERTYPE *pSoldier, UINT8 ubSquad )
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
if( pSoldier->bAssignment == ASSIGNMENT_MINIEVENT )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
if( SquadIsEmpty( ubSquad ) == TRUE )
|
||||
{
|
||||
return( TRUE );
|
||||
|
||||
@@ -238,7 +238,7 @@ BOOLEAN InternalInitSectorExitMenu( UINT8 ubDirection, INT32 sAdditionalData )//
|
||||
pSoldier->stats.bLife >= OKLIFE &&
|
||||
( pSoldier->bAssignment != MercPtrs[ gusSelectedSoldier ]->bAssignment ||
|
||||
( pSoldier->bAssignment == VEHICLE && pSoldier->iVehicleId != MercPtrs[ gusSelectedSoldier ]->iVehicleId ) ) &&
|
||||
pSoldier->bAssignment != ASSIGNMENT_POW && pSoldier->bAssignment != IN_TRANSIT && pSoldier->bAssignment != ASSIGNMENT_DEAD
|
||||
pSoldier->bAssignment != ASSIGNMENT_POW && pSoldier->bAssignment != IN_TRANSIT && pSoldier->bAssignment != ASSIGNMENT_DEAD && pSoldier->bAssignment != ASSIGNMENT_MINIEVENT
|
||||
&& !(pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE) )
|
||||
{ //KM: We need to determine if there are more than one squad (meaning other concious mercs in a different squad or assignment)
|
||||
// These conditions were done to the best of my knowledge, so if there are other situations that require modification,
|
||||
|
||||
@@ -6013,7 +6013,7 @@ void ProcessNoise(UINT8 ubNoiseMaker, INT32 sGridNo, INT8 bLevel, UINT8 ubTerrTy
|
||||
continue; // skip
|
||||
}
|
||||
|
||||
if ( bTeam == gbPlayerNum && pSoldier->bAssignment == ASSIGNMENT_POW )
|
||||
if ( bTeam == gbPlayerNum && (pSoldier->bAssignment == ASSIGNMENT_POW || pSoldier->bAssignment == ASSIGNMENT_MINIEVENT) )
|
||||
{
|
||||
// POWs should not be processed for noise
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user