New Feature: Drug System Overhaul. The drug system has been completely overhauled.

Requires GameDir >= r2257.

For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&goto=341541&#msg_341541

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7896 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2015-06-28 17:47:25 +00:00
parent ceea35b0e9
commit 4d9140da57
61 changed files with 1667 additions and 871 deletions
+1
View File
@@ -489,6 +489,7 @@ enum
MSG_MERC_CASTS_LIGHT_OFF,
MSG_SQUAD_ACTIVE_STRING,
MSG_MERC_TOOK_CIGARETTE,
TEXT_NUM_MSG,
};
+24 -5
View File
@@ -85,13 +85,16 @@ itemStartElementHandle(void *userData, const XML_Char *name, const XML_Char **at
if ( !localizedTextOnly )
memset(&pData->curItem,0,sizeof(INVTYPE));
// Flugente: default value
pData->curItem.usPortionSize = 100;
// HEADROCK HAM 4: With the new stance-based variables, it is necessary to set vars to have an impossible
// value. That way when they are later recorded in the item structs, a parent->child inheritence can occur
// for children that do not have data put into them from XML.
// -10000 has been selected to pose as "no value". Modders should never even reduce the value of any of
// these tags below -100 anyway, and although it's not the best solution that's the only one I came up with.
for (INT8 X = 0; X < 3; X++)
for (INT8 X = 0; X < 3; ++X)
{
pData->curItem.flatbasemodifier[X] = -10000;
pData->curItem.percentbasemodifier[X] = -10000;
@@ -283,6 +286,8 @@ itemStartElementHandle(void *userData, const XML_Char *name, const XML_Char **at
strcmp(name, "usSpotting") == 0 ||
strcmp(name, "sBackpackWeightModifier") == 0 ||
strcmp(name, "fAllowClimbing") == 0 ||
strcmp(name, "cigarette" ) == 0 ||
strcmp(name, "usPortionSize" ) == 0 ||
strcmp(name, "diseaseprotectionface" ) == 0 ||
strcmp(name, "diseaseprotectionhand" ) == 0))
{
@@ -941,7 +946,9 @@ itemEndElementHandle(void *userData, const XML_Char *name)
else if(strcmp(name, "Alcohol") == 0)
{
pData->curElement = ELEMENT;
pData->curItem.alcohol = (BOOLEAN) atol(pData->szCharData);
pData->curItem.alcohol = (FLOAT) atof(pData->szCharData);
pData->curItem.alcohol = max( 0.0f, pData->curItem.alcohol );
}
else if(strcmp(name, "Hardware") == 0)
{
@@ -1453,6 +1460,16 @@ itemEndElementHandle(void *userData, const XML_Char *name)
pData->curElement = ELEMENT;
pData->curItem.fAllowClimbing = (BOOLEAN)atol(pData->szCharData);
}
else if ( strcmp( name, "cigarette" ) == 0 )
{
pData->curElement = ELEMENT;
pData->curItem.cigarette = (BOOLEAN)atol( pData->szCharData );
}
else if ( strcmp( name, "usPortionSize" ) == 0 )
{
pData->curElement = ELEMENT;
pData->curItem.usPortionSize = (UINT8)atol( pData->szCharData );
}
// Flugente: simple tags in the xml get translated into flags
else if ( strcmp( name, "diseaseprotectionface" ) == 0 )
{
@@ -1986,7 +2003,7 @@ BOOLEAN WriteItemStats()
FilePrintf(hFile,"\t\t<GasMask>%d</GasMask>\r\n", Item[cnt].gasmask );
FilePrintf(hFile,"\t\t<Alcohol>%d</Alcohol>\r\n", Item[cnt].alcohol );
FilePrintf(hFile,"\t\t<Alcohol>%3.2f</Alcohol>\r\n", Item[cnt].alcohol );
FilePrintf(hFile,"\t\t<Hardware>%d</Hardware>\r\n", Item[cnt].hardware );
FilePrintf(hFile,"\t\t<Medical>%d</Medical>\r\n", Item[cnt].medical );
FilePrintf(hFile,"\t\t<CamouflageKit>%d</CamouflageKit>\r\n", Item[cnt].camouflagekit );
@@ -2095,8 +2112,10 @@ BOOLEAN WriteItemStats()
FilePrintf(hFile,"\t\t<buddyitem>%d</buddyitem>\r\n", Item[cnt].usBuddyItem );
FilePrintf(hFile,"\t\t<SleepModifier>%d</SleepModifier>\r\n", Item[cnt].ubSleepModifier );
FilePrintf(hFile,"\t\t<usSpotting>%d</usSpotting>\r\n", Item[cnt].usSpotting );
FilePrintf(hFile, "\t\t<sBackpackWeightModifier>%d</sBackpackWeightModifier>\r\n", Item[cnt].sBackpackWeightModifier);
FilePrintf(hFile, "\t\t<fAllowClimbing>%d</fAllowClimbing>\r\n", Item[cnt].fAllowClimbing);
FilePrintf(hFile,"\t\t<sBackpackWeightModifier>%d</sBackpackWeightModifier>\r\n", Item[cnt].sBackpackWeightModifier);
FilePrintf(hFile,"\t\t<fAllowClimbing>%d</fAllowClimbing>\r\n", Item[cnt].fAllowClimbing);
FilePrintf(hFile, "\t\t<cigarette>%d</cigarette>\r\n", Item[cnt].cigarette );
FilePrintf(hFile,"\t\t<usPortionSize>%d</usPortionSize>\r\n", Item[cnt].usPortionSize );
if ( Item[cnt].usItemFlag & DISEASEPROTECTION_1 )
FilePrintf( hFile, "\t\t<diseaseprotectionface>%d</diseaseprotectionface>\r\n", 1 );
+3
View File
@@ -6207,6 +6207,7 @@ STR16 pMessageStrings[] =
L"虚拟佣兵光照开启",
L"虚拟佣兵光照关闭",
L"Squad %s active.", //TODO.Translate
L"%s smoked %s.",
};
@@ -8278,6 +8279,8 @@ STR16 szBackgroundText_Value[]=
L" %s%d%% initial distance to enemy in ambush\n",
L" dislikes some other backgrounds", // TODO.Translate
L"Smoker",
L"Nonsmoker",
};
STR16 szBackgroundTitleText[] =
+3
View File
@@ -6215,6 +6215,7 @@ STR16 pMessageStrings[] =
L"Artificial Merc Light ON", // TODO.Translate
L"Artificial Merc Light OFF",
L"Squad %s active.", //TODO.Translate
L"%s smoked %s.",
};
@@ -8291,6 +8292,8 @@ STR16 szBackgroundText_Value[]=
L" %s%d%% initial distance to enemy in ambush\n",
L" dislikes some other backgrounds", // TODO.Translate
L"Smoker",
L"Nonsmoker",
};
STR16 szBackgroundTitleText[] = // TODO.Translate
+3
View File
@@ -6206,6 +6206,7 @@ STR16 pMessageStrings[] =
L"Artificial Merc Light ON",
L"Artificial Merc Light OFF",
L"Squad %s active.",
L"%s smoked %s.",
};
@@ -8276,6 +8277,8 @@ STR16 szBackgroundText_Value[]=
L" %s%d%% initial distance to enemy in ambush\n",
L" dislikes some other backgrounds",
L"Smoker",
L"Nonsmoker",
};
STR16 szBackgroundTitleText[] =
+3
View File
@@ -6217,6 +6217,7 @@ STR16 pMessageStrings[] =
L"Éclairage du mercenaire activé",
L"Éclairage du mercenaire désactivé",
L"Squad %s active.", //TODO.Translate
L"%s smoked %s.",
};
@@ -8277,6 +8278,8 @@ STR16 szBackgroundText_Value[]=
L" %s%d%% initial distance to enemy in ambush\n",
L" dislikes some other backgrounds", // TODO.Translate
L"Smoker",
L"Nonsmoker",
};
STR16 szBackgroundTitleText[] =
+3
View File
@@ -6052,6 +6052,7 @@ STR16 pMessageStrings[] =
L"Artificial Merc Light ON", // TODO.Translate
L"Artificial Merc Light OFF",
L"Squad %s active.", //TODO.Translate
L"%s smoked %s.",
};
CHAR16 ItemPickupHelpPopup[][40] =
@@ -8108,6 +8109,8 @@ STR16 szBackgroundText_Value[]=
L" %s%d%% initial distance to enemy in ambush\n",
L" dislikes some other backgrounds", // TODO.Translate
L"Smoker",
L"Nonsmoker",
};
STR16 szBackgroundTitleText[] = // TODO.Translate
+3
View File
@@ -6203,6 +6203,7 @@ STR16 pMessageStrings[] =
L"Artificial Merc Light ON", // TODO.Translate
L"Artificial Merc Light OFF",
L"Squad %s active.", //TODO.Translate
L"%s smoked %s.",
};
@@ -8286,6 +8287,8 @@ STR16 szBackgroundText_Value[]=
L" %s%d%% initial distance to enemy in ambush\n",
L" dislikes some other backgrounds", // TODO.Translate
L"Smoker",
L"Nonsmoker",
};
STR16 szBackgroundTitleText[] = // TODO.Translate
+3
View File
@@ -6221,6 +6221,7 @@ STR16 pMessageStrings[] =
L"Artificial Merc Light ON", // TODO.Translate
L"Artificial Merc Light OFF",
L"Squad %s active.", //TODO.Translate
L"%s smoked %s.",
};
@@ -8303,6 +8304,8 @@ STR16 szBackgroundText_Value[]=
L" %s%d%% initial distance to enemy in ambush\n",
L" dislikes some other backgrounds", // TODO.Translate
L"Smoker",
L"Nonsmoker",
};
STR16 szBackgroundTitleText[] = // TODO.Translate
+3
View File
@@ -6203,6 +6203,7 @@ STR16 pMessageStrings[] =
L"Подсветка наемника включена",
L"Подсветка наемника отключена",
L"Squad %s active.", //TODO.Translate
L"%s smoked %s.",
};
@@ -8275,6 +8276,8 @@ STR16 szBackgroundText_Value[]=
L" %s%d%% initial distance to enemy in ambush\n",
L" dislikes some other backgrounds", // TODO.Translate
L"Smoker",
L"Nonsmoker",
};
STR16 szBackgroundTitleText[] =