- 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
+1
View File
@@ -192,6 +192,7 @@ enum {
BG_PERC_DISEASE_TREAT,
BG_TRACKER_ABILITY,
BG_AMBUSH_RADIUS,
BG_SNAKEDEFENSE,
BG_DISLIKEBG, // dislike any other background that has the negative of this value set
BG_SMOKERTYPE, // 0: doesnt care about smoking 1: will consume cigarettes, dislikes non-smokers 2: will refuse to smoke, dislikes smokers
+1
View File
@@ -510,6 +510,7 @@ typedef struct
UINT8 snowchance; // chance that it snows in this sector
UINT8 snakechance; // if positive, snakes can attack in water, the higher the number, the more often it happens
UINT8 numsnakes; // how many snakes can be active at maximum
UINT8 maxworkers; // maximum number of workers in this sector;
+2
View File
@@ -19145,6 +19145,8 @@ UINT8 SOLDIERTYPE::GetWaterSnakeDefenseChance()
if ( gGameOptions.fNewTraitSystem )
val += gSkillTraitValues.usSVSnakeDefense * NUM_SKILL_TRAITS( this, SURVIVAL_NT );
val += this->GetBackgroundValue( BG_SNAKEDEFENSE );
// bonus if we have a knife, extra if it is in our hands
INT8 invsize = (INT8)inv.size( ); // remember inventorysize, so we don't call size() repeatedly
for ( INT8 bLoop = 0; bLoop < invsize; ++bLoop )
+6
View File
@@ -130,6 +130,7 @@ backgroundStartElementHandle(void *userData, const XML_Char *name, const XML_Cha
strcmp(name, "disease_treatment" ) == 0 ||
strcmp(name, "tracker_ability" ) == 0 ||
strcmp(name, "ambush_radius" ) == 0 ||
strcmp(name, "snake_defense" ) == 0 ||
strcmp(name, "dislikebackground" ) == 0 ||
strcmp(name, "smoker" ) == 0 ||
strcmp(name, "croucheddefense" ) == 0 ||
@@ -553,6 +554,11 @@ backgroundEndElementHandle(void *userData, const XML_Char *name)
pData->curElement = ELEMENT;
pData->curBackground.value[BG_AMBUSH_RADIUS] = min( 50, max( 0, (INT16)atol( pData->szCharData ) ) );
}
else if ( strcmp( name, "snake_defense" ) == 0 )
{
pData->curElement = ELEMENT;
pData->curBackground.value[BG_SNAKEDEFENSE] = min( 100, max( -100, (INT16)atol( pData->szCharData ) ) );
}
else if ( strcmp( name, "dislikebackground" ) == 0 )
{
pData->curElement = ELEMENT;