mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
New feature: we have to bury corpses, or their rot causes diseases in sectors
Requires GameDir >= r2436. Fopr more info, see http://thepit.ja-galaxy-forum.com/index.php?t=tree&th=23828&goto=354321&#msg_354321 git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8591 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -49,6 +49,7 @@
|
||||
#include "Vehicles.h" // added by silversurfer
|
||||
#include "ai.h" // added by Flugente
|
||||
#include "PreBattle Interface.h" // added by Flugente
|
||||
#include "Strategic Town Loyalty.h" // added by Flugente
|
||||
#endif
|
||||
|
||||
#include "Animation Control.h"
|
||||
@@ -677,6 +678,15 @@ INT32 AddRottingCorpse( ROTTING_CORPSE_DEFINITION *pCorpseDef )
|
||||
}
|
||||
}
|
||||
|
||||
// Flugente: update number of corpses in this sector
|
||||
if ( !gbWorldSectorZ )
|
||||
{
|
||||
SECTORINFO *pSectorInfo = &( SectorInfo[SECTOR( gWorldSectorX, gWorldSectorY )] );
|
||||
|
||||
if ( pSectorInfo )
|
||||
pSectorInfo->usNumCorpses = giNumRottingCorpse;
|
||||
}
|
||||
|
||||
// OK, we're done!
|
||||
return( iIndex );
|
||||
}
|
||||
@@ -1614,7 +1624,7 @@ void VaporizeCorpse( INT32 sGridNo, INT8 asLevel, UINT16 usStructureID )
|
||||
{
|
||||
// Add explosion
|
||||
memset( &AniParams, 0, sizeof( ANITILE_PARAMS ) );
|
||||
AniParams.sGridNo = sBaseGridNo;
|
||||
AniParams.sGridNo = sBaseGridNo;
|
||||
|
||||
// Check if on roof or not...
|
||||
if ( pCorpse->def.bLevel == 0 )
|
||||
@@ -1622,12 +1632,12 @@ void VaporizeCorpse( INT32 sGridNo, INT8 asLevel, UINT16 usStructureID )
|
||||
else
|
||||
AniParams.ubLevelID = ANI_ONROOF_LEVEL;
|
||||
|
||||
AniParams.sDelay = (INT16)( 80 );
|
||||
AniParams.sStartFrame = 0;
|
||||
AniParams.uiFlags = ANITILE_CACHEDTILE | ANITILE_FORWARD;
|
||||
AniParams.sX = CenterX( sBaseGridNo );
|
||||
AniParams.sY = CenterY( sBaseGridNo );
|
||||
AniParams.sZ = (INT16)pCorpse->def.sHeightAdjustment;
|
||||
AniParams.sDelay = (INT16)( 80 );
|
||||
AniParams.sStartFrame = 0;
|
||||
AniParams.uiFlags = ANITILE_CACHEDTILE | ANITILE_FORWARD;
|
||||
AniParams.sX = CenterX( sBaseGridNo );
|
||||
AniParams.sY = CenterY( sBaseGridNo );
|
||||
AniParams.sZ = (INT16)pCorpse->def.sHeightAdjustment;
|
||||
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\GEN_BLOW.STI" );
|
||||
CreateAnimationTile( &AniParams );
|
||||
@@ -1636,6 +1646,25 @@ void VaporizeCorpse( INT32 sGridNo, INT8 asLevel, UINT16 usStructureID )
|
||||
RemoveCorpse( pCorpse->iID );
|
||||
SetRenderFlags( RENDER_FLAG_FULL );
|
||||
|
||||
// add disease
|
||||
if ( !gbWorldSectorZ )
|
||||
{
|
||||
SECTORINFO *pSectorInfo = &( SectorInfo[SECTOR( gWorldSectorX, gWorldSectorY )] );
|
||||
|
||||
if ( pSectorInfo )
|
||||
pSectorInfo->fDiseasePoints = min( DISEASE_MAX_SECTOR, pSectorInfo->fDiseasePoints + DISEASE_PER_ROTTINGCORPSE );
|
||||
|
||||
// the population doesn't like it when we blow chunks of people all over the place
|
||||
INT8 bTownId = GetTownIdForSector( gWorldSectorX, gWorldSectorY );
|
||||
|
||||
// if NOT in a town
|
||||
if ( bTownId != BLANK_SECTOR )
|
||||
{
|
||||
UINT32 uiLoyaltyChange = LOYALTY_PENALTY_ROTTED_CORPSE;
|
||||
DecrementTownLoyalty( bTownId, uiLoyaltyChange );
|
||||
}
|
||||
}
|
||||
|
||||
if ( pCorpse->def.bLevel == 0 )
|
||||
{
|
||||
// Set some blood......
|
||||
|
||||
Reference in New Issue
Block a user