New feature: interactive actions allow various actions (hacking/reading/drinking/...) from user-defined xml acttions. The exact results can be set in a lua function.

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

This is fully savegame compatible.

GameDir >= r2333 is required.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8278 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2016-08-02 19:03:28 +00:00
parent 41dcb598dd
commit 99f5be0ed7
48 changed files with 1406 additions and 60 deletions
+72
View File
@@ -128,6 +128,18 @@ CursorFileData CursorFileDatabase[] =
{ "CURSORS\\apply_r.sti" , FALSE, 0, ANIMATED_CURSOR, 3, NULL }, // Flugente: apply items - still needs animation
{ "CURSORS\\apply.sti" , FALSE, 0, ANIMATED_CURSOR, 3, NULL }, // yes, the red one is the 'valid' one - just like for taking items
{ "CURSORS\\hack.sti" , FALSE, 0, ANIMATED_CURSOR, 3, NULL}, // Flugente: hack
{ "CURSORS\\hack_r.sti" , FALSE, 0, ANIMATED_CURSOR, 3, NULL},
{ "CURSORS\\readfile.sti" , FALSE, 0, ANIMATED_CURSOR, 3, NULL}, // Flugente: read file
{ "CURSORS\\readfile_r.sti" , FALSE, 0, ANIMATED_CURSOR, 3, NULL},
{"CURSORS\\watertap.sti" , FALSE, 0, ANIMATED_CURSOR, 3, NULL}, // Flugente: watertap
{"CURSORS\\watertap_r.sti" , FALSE, 0, ANIMATED_CURSOR, 3, NULL},
{"CURSORS\\sodamachine.sti" , FALSE, 0, ANIMATED_CURSOR, 3, NULL}, // Flugente: soda machine
{"CURSORS\\sodamachine_r.sti" , FALSE, 0, ANIMATED_CURSOR, 3, NULL},
{ "CURSORS\\can_01.sti" , FALSE, 0, 0, 0, NULL },
{ "CURSORS\\can_02.sti" , FALSE, 0, 0, 0, NULL },
{ "CURSORS\\cur_tagr_ncth.sti" , FALSE, 0, ANIMATED_CURSOR, 7, NULL },
@@ -1232,6 +1244,66 @@ CursorData CursorDatabase[] =
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
2, CENTER_CURSOR, CENTER_CURSOR, 0, 0 , 0, 0 },
// Flugente: hack
{ C_TRINGS, 6, 0, HIDE_SUBCURSOR, HIDE_SUBCURSOR,
C_HACK, 0, 0, CENTER_SUBCURSOR, CENTER_SUBCURSOR,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
2, CENTER_CURSOR, CENTER_CURSOR, 0, 0, 0, 0},
{ C_TRINGS, 6, 0, HIDE_SUBCURSOR, HIDE_SUBCURSOR,
C_HACK_RED, 0, 0, CENTER_SUBCURSOR, CENTER_SUBCURSOR,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
2, CENTER_CURSOR, CENTER_CURSOR, 0, 0, 0, 0},
// Flugente: read file
{C_TRINGS, 6, 0, HIDE_SUBCURSOR, HIDE_SUBCURSOR,
C_READFILE, 0, 0, CENTER_SUBCURSOR, CENTER_SUBCURSOR,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
2, CENTER_CURSOR, CENTER_CURSOR, 0, 0, 0, 0},
{C_TRINGS, 6, 0, HIDE_SUBCURSOR, HIDE_SUBCURSOR,
C_READFILE_RED, 0, 0, CENTER_SUBCURSOR, CENTER_SUBCURSOR,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
2, CENTER_CURSOR, CENTER_CURSOR, 0, 0, 0, 0},
// Flugente: watertap
{C_TRINGS, 6, 0, HIDE_SUBCURSOR, HIDE_SUBCURSOR,
C_WATERTAP, 0, 0, CENTER_SUBCURSOR, CENTER_SUBCURSOR,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
2, CENTER_CURSOR, CENTER_CURSOR, 0, 0, 0, 0},
{C_TRINGS, 6, 0, HIDE_SUBCURSOR, HIDE_SUBCURSOR,
C_WATERTAP_RED, 0, 0, CENTER_SUBCURSOR, CENTER_SUBCURSOR,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
2, CENTER_CURSOR, CENTER_CURSOR, 0, 0, 0, 0},
// Flugente: soad machine
{C_TRINGS, 6, 0, HIDE_SUBCURSOR, HIDE_SUBCURSOR,
C_SODAMACHINE, 0, 0, CENTER_SUBCURSOR, CENTER_SUBCURSOR,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
2, CENTER_CURSOR, CENTER_CURSOR, 0, 0, 0, 0},
{C_TRINGS, 6, 0, HIDE_SUBCURSOR, HIDE_SUBCURSOR,
C_SODAMACHINE_RED, 0, 0, CENTER_SUBCURSOR, CENTER_SUBCURSOR,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
2, CENTER_CURSOR, CENTER_CURSOR, 0, 0, 0, 0},
{ C_TRINGS, 6, 0, HIDE_SUBCURSOR, HIDE_SUBCURSOR,
C_FUEL , 0, 0, CENTER_SUBCURSOR, CENTER_SUBCURSOR,
+20
View File
@@ -162,6 +162,18 @@ typedef enum
CURSOR_APPLYITEM,
CURSOR_APPLYITEM_RED,
CURSOR_HACK,
CURSOR_HACK_RED,
CURSOR_READFILE,
CURSOR_READFILE_RED,
CURSOR_WATERTAP,
CURSOR_WATERTAP_RED,
CURSOR_SODAMACHINE,
CURSOR_SODAMACHINE_RED,
CURSOR_FUEL,
CURSOR_FUEL_RED,
@@ -241,6 +253,14 @@ typedef enum
C_HANDCUFFS_RED,
C_APPLYITEM,
C_APPLYITEM_RED,
C_HACK,
C_HACK_RED,
C_READFILE,
C_READFILE_RED,
C_WATERTAP,
C_WATERTAP_RED,
C_SODAMACHINE,
C_SODAMACHINE_RED,
C_FUEL,
C_FUEL_RED,
C_ACTIONMODERED_NCTH,
+4
View File
@@ -885,6 +885,7 @@ enum
STR_MTA_NONE,
STR_MTA_FORTIFY,
STR_MTA_REMOVE_FORTIFY,
STR_MTA_HACK,
STR_MTA_CANCEL,
STR_MTA_CANNOT_BUILD,
@@ -2977,6 +2978,9 @@ extern STR16 szSnakeText[];
// Flugente: militia resources
extern STR16 szSMilitiaResourceText[];
// Flugente: interactive actions
extern STR16 szInteractiveActionText[];
#define TACTICAL_INVENTORY_DIALOG_NUM 16
#define TACTICAL_COVER_DIALOG_NUM 16
+7
View File
@@ -275,6 +275,7 @@ itemStartElementHandle(void *userData, const XML_Char *name, const XML_Char **at
strcmp(name, "CrowbarModifier") == 0 ||
strcmp(name, "DisarmModifier") == 0 ||
strcmp(name, "RepairModifier") == 0 ||
strcmp(name, "usHackingModifier" ) == 0 ||
strcmp(name, "usActionItemFlag") == 0 ||
strcmp(name, "clothestype") == 0 ||
@@ -1396,6 +1397,11 @@ itemEndElementHandle(void *userData, const XML_Char *name)
pData->curElement = ELEMENT;
pData->curItem.RepairModifier = (INT8) atol(pData->szCharData);
}
else if ( strcmp( name, "usHackingModifier" ) == 0 )
{
pData->curElement = ELEMENT;
pData->curItem.usHackingModifier = min(100, (UINT8)atol( pData->szCharData ) );
}
else if(strcmp(name, "DamageChance") == 0)
{
pData->curElement = ELEMENT;
@@ -2106,6 +2112,7 @@ BOOLEAN WriteItemStats()
FilePrintf(hFile, "\t\t<CrowbarModifier>%d</CrowbarModifier>\r\n", Item[cnt].CrowbarModifier );
FilePrintf(hFile, "\t\t<DisarmModifier>%d</DisarmModifier>\r\n", Item[cnt].DisarmModifier );
FilePrintf(hFile, "\t\t<RepairModifier>%d</RepairModifier>\r\n", Item[cnt].RepairModifier );
FilePrintf(hFile, "\t\t<usHackingModifier>%d</usHackingModifier>\r\n", Item[cnt].usHackingModifier );
FilePrintf(hFile,"\t\t<DamageChance>%d</DamageChance>\r\n", Item[cnt].usDamageChance );
FilePrintf(hFile,"\t\t<DirtIncreaseFactor>%4.2f</DirtIncreaseFactor>\r\n", Item[cnt].dirtIncreaseFactor );
+18 -1
View File
@@ -8832,7 +8832,7 @@ STR16 szPrisonerTextStr[]=
L"敌人不肯拿你当囚犯 - 他们宁愿你死!", //L"The enemy refuses to take you as prisoners - they prefer you dead!",
L"这些可以在 INI 设置关闭。", // L"This behaviour is set OFF in your ini settings.",
L"%s释放了%s", //L"%s has freed %s!",
L"囚犯会暴露高级军官的位置 %s", //L"A prisoner revealed the location of a high-ranking army officer in %s!",
L"A high-ranking army officer in %s has been revealed!", // TODO.Translate
L"敌方首领会拒绝即使被认为投降!", //L"The enemy leader refuses to even consider surrender!",
L"%d 囚犯自愿加入我军。", //L"%d prisoners volunteered to join our forces.",
};
@@ -8842,6 +8842,7 @@ STR16 szMTATextStr[]=
L"空无一物",
L"建造掩体", //L"building a fortification",
L"拆除掩体", //L"removing a fortification",
L"hacking", // TODO.Translate
L"%s必须停止%s", //L"%s had to stop %s.",
L"所选的路障无法再该分区建造",
};
@@ -8953,6 +8954,7 @@ STR16 szBackgroundText_Value[]=
L"非吸烟者", //L"Nonsmoker",
L" %s%d%% 如果敌人 CTH 蹲在厚覆盖他们的方向\n", //L" %s%d%% enemy CTH if crouched against thick cover in their direction\n",
L" %s%d%% building speed\n",
L" hacking skill: %s%d ", // TODO.Translate
};
STR16 szBackgroundTitleText[] =
@@ -11160,6 +11162,21 @@ STR16 szSMilitiaResourceText[] =
L"Not enough resources to train militia!",
};
STR16 szInteractiveActionText[] =
{
L"%s starts hacking.",
L"%s accesses the computer, but finds nothing of interest.",
L"%s is not skilled enough to hack the computer.",
L"%s reads the file, but learns nothing new.",
L"%s can't make sense out of this.",
L"%s couldn't use the watertap.",
L"%s has bought a %s.",
L"%s doesn't have enough money. That's just embarassing.",
L"%s drank from water tap",
};
// WANNE: Some Chinese specific strings that needs to be in unicode!
STR16 ChineseSpecString1 = L"%"; //defined in _ChineseText.cpp as this file is already unicode
STR16 ChineseSpecString2 = L"*%3d%%%"; //defined in _ChineseText.cpp as this file is already unicode
+18 -1
View File
@@ -8847,7 +8847,7 @@ STR16 szPrisonerTextStr[]=
L"The enemy refuses to take you as prisoners - they prefer you dead!",
L"This behaviour is set OFF in your ini settings.",
L"%s has freed %s!",
L"A prisoner revealed the location of a high-ranking army officer in %s!", // TODO.Translate
L"A high-ranking army officer in %s has been revealed!", // TODO.Translate
L"The enemy leader refuses to even consider surrender!",
L"%d prisoners volunteered to join our forces.",
};
@@ -8857,6 +8857,7 @@ STR16 szMTATextStr[]= // TODO.Translate
L"nothing",
L"building a fortification",
L"removing a fortification",
L"hacking", // TODO.Translate
L"%s had to stop %s.",
L"The selected barricade cannot be built in this sector", // TODO.Translate
};
@@ -8970,6 +8971,7 @@ STR16 szBackgroundText_Value[]=
L"Nonsmoker",
L" %s%d%% enemy CTH if crouched against thick cover in their direction\n",
L" %s%d%% building speed\n",
L" hacking skill: %s%d ", // TODO.Translate
};
STR16 szBackgroundTitleText[] = // TODO.Translate
@@ -11177,4 +11179,19 @@ STR16 szSMilitiaResourceText[] =
L"Not enough resources to train militia!",
};
STR16 szInteractiveActionText[] =
{
L"%s starts hacking.",
L"%s accesses the computer, but finds nothing of interest.",
L"%s is not skilled enough to hack the computer.",
L"%s reads the file, but learns nothing new.",
L"%s can't make sense out of this.",
L"%s couldn't use the watertap.",
L"%s has bought a %s.",
L"%s doesn't have enough money. That's just embarassing.",
L"%s drank from water tap",
};
#endif //DUTCH
+20 -3
View File
@@ -8830,7 +8830,7 @@ STR16 szPrisonerTextStr[]=
L"The enemy refuses to take you as prisoners - they prefer you dead!",
L"This behaviour is set OFF in your ini settings.",
L"%s has freed %s!",
L"A prisoner revealed the location of a high-ranking army officer in %s!",
L"A high-ranking army officer in %s has been revealed!",
L"The enemy leader refuses to even consider surrender!",
L"%d prisoners volunteered to join our forces.",
};
@@ -8840,6 +8840,7 @@ STR16 szMTATextStr[]=
L"nothing",
L"building a fortification",
L"removing a fortification",
L"hacking",
L"%s had to stop %s.",
L"The selected barricade cannot be built in this sector",
};
@@ -8947,10 +8948,11 @@ STR16 szBackgroundText_Value[]=
L" %s%d%% chance to evade snake attacks\n",
L" dislikes some other backgrounds\n",
L"Smoker",
L"Nonsmoker",
L" Smoker",
L" Nonsmoker",
L" %s%d%% enemy CTH if crouched against thick cover in their direction\n",
L" %s%d%% building speed\n",
L" hacking skill: %s%d ",
};
STR16 szBackgroundTitleText[] =
@@ -11160,4 +11162,19 @@ STR16 szSMilitiaResourceText[] =
L"Not enough resources to train militia!",
};
STR16 szInteractiveActionText[] =
{
L"%s starts hacking.",
L"%s accesses the computer, but finds nothing of interest.",
L"%s is not skilled enough to hack the computer.",
L"%s reads the file, but learns nothing new.",
L"%s can't make sense out of this.",
L"%s couldn't use the watertap.",
L"%s has bought a %s.",
L"%s doesn't have enough money. That's just embarassing.",
L"%s drank from water tap",
};
#endif //ENGLISH
+18 -1
View File
@@ -8829,7 +8829,7 @@ STR16 szPrisonerTextStr[]=
L"L'ennemi refuse votre reddition... Ils veulent vos têtes !",
L"Ce comportement est désactivé dans vos fichiers ini.",
L"%s a libéré %s !",
L"A prisoner revealed the location of a high-ranking army officer in %s!", // TODO.Translate
L"A high-ranking army officer in %s has been revealed!", // TODO.Translate
L"The enemy leader refuses to even consider surrender!",
L"%d prisoners volunteered to join our forces.",
};
@@ -8839,6 +8839,7 @@ STR16 szMTATextStr[]=
L"rien, en fait.",
L"la construction d'une fortification",
L"le retrait d'une fortification",
L"hacking", // TODO.Translate
L"%s a dû arrêter... %s",
L"Cette sorte de barricade ne peut pas être construite dans ce secteur",
};
@@ -8952,6 +8953,7 @@ STR16 szBackgroundText_Value[]=
L"Nonsmoker",
L" %s%d%% enemy CTH if crouched against thick cover in their direction\n",
L" %s%d%% building speed\n",
L" hacking skill: %s%d ", // TODO.Translate
};
STR16 szBackgroundTitleText[] =
@@ -11159,4 +11161,19 @@ STR16 szSMilitiaResourceText[] =
L"Not enough resources to train militia!",
};
STR16 szInteractiveActionText[] =
{
L"%s starts hacking.",
L"%s accesses the computer, but finds nothing of interest.",
L"%s is not skilled enough to hack the computer.",
L"%s reads the file, but learns nothing new.",
L"%s can't make sense out of this.",
L"%s couldn't use the watertap.",
L"%s has bought a %s.",
L"%s doesn't have enough money. That's just embarassing.",
L"%s drank from water tap",
};
#endif //FRENCH
+18 -1
View File
@@ -8659,7 +8659,7 @@ STR16 szPrisonerTextStr[]=
L"Der Feind weigert sich, Sie als Gefangenen zu nehmen - Er möchte Sie tod sehen!",
L"Dieses Verhalten ist ausgeschaltet in der ja2_options.ini Datei.",
L"%s hat %s befreit!",
L"Ein Gefangener hat den Aufenthaltsort eines hochrangigen Offiziers in %s enthüllt!",
L"A high-ranking army officer in %s has been revealed!", // TODO.Translate
L"Der feindliche Anführer denkt nicht mal an Kapitulation!",
L"%d Gefangene sind uns als Freiwillige beigetreten.",
};
@@ -8669,6 +8669,7 @@ STR16 szMTATextStr[]=
L"nichts",
L"baue eine Befestigung",
L"entferne eine Befestigung",
L"hacking", // TODO.Translate
L"%s musste %s stoppen.",
L"The selected barricade cannot be built in this sector", // TODO.Translate
};
@@ -8782,6 +8783,7 @@ STR16 szBackgroundText_Value[]=
L"Nonsmoker",
L" %s%d%% enemy CTH if crouched against thick cover in their direction\n",
L" %s%d%% building speed\n",
L" hacking skill: %s%d ", // TODO.Translate
};
STR16 szBackgroundTitleText[] = // TODO.Translate
@@ -10989,4 +10991,19 @@ STR16 szSMilitiaResourceText[] =
L"Not enough resources to train militia!",
};
STR16 szInteractiveActionText[] =
{
L"%s starts hacking.",
L"%s accesses the computer, but finds nothing of interest.",
L"%s is not skilled enough to hack the computer.",
L"%s reads the file, but learns nothing new.",
L"%s can't make sense out of this.",
L"%s couldn't use the watertap.",
L"%s has bought a %s.",
L"%s doesn't have enough money. That's just embarassing.",
L"%s drank from water tap",
};
#endif //GERMAN
+18 -1
View File
@@ -8837,7 +8837,7 @@ STR16 szPrisonerTextStr[]=
L"The enemy refuses to take you as prisoners - they prefer you dead!",
L"This behaviour is set OFF in your ini settings.",
L"%s has freed %s!",
L"A prisoner revealed the location of a high-ranking army officer in %s!", // TODO.Translate
L"A high-ranking army officer in %s has been revealed!", // TODO.Translate
L"The enemy leader refuses to even consider surrender!",
L"%d prisoners volunteered to join our forces.",
};
@@ -8847,6 +8847,7 @@ STR16 szMTATextStr[]= // TODO.Translate
L"nothing",
L"building a fortification",
L"removing a fortification",
L"hacking", // TODO.Translate
L"%s had to stop %s.",
L"The selected barricade cannot be built in this sector", // TODO.Translate
};
@@ -8961,6 +8962,7 @@ STR16 szBackgroundText_Value[]=
L"Nonsmoker",
L" %s%d%% enemy CTH if crouched against thick cover in their direction\n",
L" %s%d%% building speed\n",
L" hacking skill: %s%d ", // TODO.Translate
};
STR16 szBackgroundTitleText[] = // TODO.Translate
@@ -11168,4 +11170,19 @@ STR16 szSMilitiaResourceText[] =
L"Not enough resources to train militia!",
};
STR16 szInteractiveActionText[] =
{
L"%s starts hacking.",
L"%s accesses the computer, but finds nothing of interest.",
L"%s is not skilled enough to hack the computer.",
L"%s reads the file, but learns nothing new.",
L"%s can't make sense out of this.",
L"%s couldn't use the watertap.",
L"%s has bought a %s.",
L"%s doesn't have enough money. That's just embarassing.",
L"%s drank from water tap",
};
#endif //ITALIAN
+18 -1
View File
@@ -8851,7 +8851,7 @@ STR16 szPrisonerTextStr[]=
L"The enemy refuses to take you as prisoners - they prefer you dead!",
L"This behaviour is set OFF in your ini settings.",
L"%s has freed %s!",
L"A prisoner revealed the location of a high-ranking army officer in %s!", // TODO.Translate
L"A high-ranking army officer in %s has been revealed!", // TODO.Translate
L"The enemy leader refuses to even consider surrender!",
L"%d prisoners volunteered to join our forces.",
};
@@ -8861,6 +8861,7 @@ STR16 szMTATextStr[]= // TODO.Translate
L"nothing",
L"building a fortification",
L"removing a fortification",
L"hacking", // TODO.Translate
L"%s had to stop %s.",
L"The selected barricade cannot be built in this sector", // TODO.Translate
};
@@ -8974,6 +8975,7 @@ STR16 szBackgroundText_Value[]=
L"Nonsmoker",
L" %s%d%% enemy CTH if crouched against thick cover in their direction\n",
L" %s%d%% building speed\n",
L" hacking skill: %s%d ", // TODO.Translate
};
STR16 szBackgroundTitleText[] = // TODO.Translate
@@ -11181,4 +11183,19 @@ STR16 szSMilitiaResourceText[] =
L"Not enough resources to train militia!",
};
STR16 szInteractiveActionText[] =
{
L"%s starts hacking.",
L"%s accesses the computer, but finds nothing of interest.",
L"%s is not skilled enough to hack the computer.",
L"%s reads the file, but learns nothing new.",
L"%s can't make sense out of this.",
L"%s couldn't use the watertap.",
L"%s has bought a %s.",
L"%s doesn't have enough money. That's just embarassing.",
L"%s drank from water tap",
};
#endif //POLISH
+18 -1
View File
@@ -8830,7 +8830,7 @@ STR16 szPrisonerTextStr[]=
L"Противник отказывается взять вас в плен - они предпочли бы видеть вас мертвыми!",
L"Этот режим отключен в настройках.",
L"%s освободил %s!",
L"Заключенный указал расположение высокопоставленного офицера в %s!",
L"A high-ranking army officer in %s has been revealed!", // TODO.Translate
L"Вражеский командир отказывается даже подумать о сдаче!",
L"%d заключенных добровольно присоединились к нашим силам.",
};
@@ -8840,6 +8840,7 @@ STR16 szMTATextStr[]=
L"ничего",
L"укрепление строится",
L"укрепление убирается",
L"hacking", // TODO.Translate
L"%s был вынужден прекратить %s.",
L"Выбранное укрепление не может быть построено в этом секторе",
};
@@ -8951,6 +8952,7 @@ STR16 szBackgroundText_Value[]=
L"Не курит",
L" %s%d%% enemy CTH if crouched against thick cover in their direction\n",
L" %s%d%% building speed\n",
L" hacking skill: %s%d ", // TODO.Translate
};
STR16 szBackgroundTitleText[] =
@@ -11160,4 +11162,19 @@ STR16 szSMilitiaResourceText[] =
L"Not enough resources to train militia!",
};
STR16 szInteractiveActionText[] =
{
L"%s starts hacking.",
L"%s accesses the computer, but finds nothing of interest.",
L"%s is not skilled enough to hack the computer.",
L"%s reads the file, but learns nothing new.",
L"%s can't make sense out of this.",
L"%s couldn't use the watertap.",
L"%s has bought a %s.",
L"%s doesn't have enough money. That's just embarassing.",
L"%s drank from water tap",
};
#endif //RUSSIAN