- New background property: <snake_defense> alters snake defense chance

- New sector property: <numsnakes> sets maximum number of snakes per snake attack

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8277 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2016-07-26 22:39:28 +00:00
parent 7b6f3d8441
commit 41dcb598dd
14 changed files with 34 additions and 3 deletions
+4 -3
View File
@@ -1106,7 +1106,7 @@ void AddSnakeAmim( INT32 sGridno, UINT8 usDirection )
ANITILE_PARAMS AniParams;
memset( &AniParams, 0, sizeof(ANITILE_PARAMS) );
AniParams.sGridNo = sGridno;
AniParams.ubLevelID = ANI_OBJECT_LEVEL;
AniParams.sDelay = 100;
@@ -1131,8 +1131,9 @@ void HandleEnvironmentHazard( )
if ( gGameExternalOptions.gfAllowSnakes && !gbWorldSectorZ && Chance( SectorExternalData[sector][0].snakechance ) )
{
// there can be up to 3 attacks at the same time
int actionstodo = 3;
// the number of snake attacks is randomized
int actionstodo = max(1, Random( SectorExternalData[sector][0].numsnakes ) );
BOOLEAN soundplayed = FALSE;
SOLDIERTYPE *pSoldier = NULL;