- added AP & BP cost setting for arming bombs/grenades in inventory

- Fix: blowing up grenades in inventory now correctly costs APs
- a message now shows how many prisoners were taken

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5891 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2013-03-03 16:24:34 +00:00
parent fc2e10314b
commit 48c66c8662
14 changed files with 145 additions and 24 deletions
+2 -1
View File
@@ -2445,9 +2445,9 @@ void LoadGameAPBPConstants()
APBPConstants[AP_FILL_SANDBAG] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_FILL_SANDBAG", 200), 200);
APBPConstants[AP_EAT] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_EAT",80),80);
APBPConstants[AP_CLEANINGKIT] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_CLEANINGKIT",80),80);
APBPConstants[AP_INVENTORY_EXPLOSIVE_ACTIVATE] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_INVENTORY_EXPLOSIVE_ACTIVATE",20),20);
APBPConstants[AP_DISGUISE] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_DISGUISE",80),80);
APBPConstants[AP_HANDCUFF] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_HANDCUFF",50),50);
APBPConstants[AP_INVENTORY_ARM] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_INVENTORY_ARM",50),50);
APBPConstants[DEFAULT_APS] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","DEFAULT_APS",80),80);
APBPConstants[DEFAULT_AIMSKILL] = iniReader.ReadInteger("APConstants","DEFAULT_AIMSKILL",80);
@@ -2505,6 +2505,7 @@ void LoadGameAPBPConstants()
APBPConstants[BP_REMOVE_FORTIFICATION] = iniReader.ReadInteger("BPConstants","BP_REMOVE_FORTIFICATION", 400);
APBPConstants[BP_FILL_SANDBAG] = iniReader.ReadInteger("BPConstants","BP_FILL_SANDBAG", 500);
APBPConstants[BP_HANDCUFF] = iniReader.ReadInteger("BPConstants","BP_HANDCUFF", 100);
APBPConstants[BP_INVENTORY_ARM] = iniReader.ReadInteger("BPConstants","BP_INVENTORY_ARM", 10);
SetupMaxActionPointsAnimation();
#undef ReadInteger
+2 -1
View File
@@ -150,9 +150,9 @@ AP_REMOVE_FORTIFICATION,
AP_FILL_SANDBAG,
AP_EAT,
AP_CLEANINGKIT,
AP_INVENTORY_EXPLOSIVE_ACTIVATE,
AP_DISGUISE,
AP_HANDCUFF,
AP_INVENTORY_ARM,
DEFAULT_APS,
DEFAULT_AIMSKILL,
@@ -209,6 +209,7 @@ BP_FORTIFICATION,
BP_REMOVE_FORTIFICATION,
BP_FILL_SANDBAG,
BP_HANDCUFF,
BP_INVENTORY_ARM,
TOTAL_APBP_VALUES
};
#endif
+26 -11
View File
@@ -12765,7 +12765,7 @@ void ItemDescTransformRegionCallback( MOUSE_REGION *pRegion, INT32 reason )
{
iTransformIndex++;
UINT16 apcost = APBPConstants[AP_INVENTORY_EXPLOSIVE_ACTIVATE];
UINT16 usAPCost = APBPConstants[AP_INVENTORY_ARM];
// test wether item is already armed
INT8 detonatortype;
@@ -12779,24 +12779,24 @@ void ItemDescTransformRegionCallback( MOUSE_REGION *pRegion, INT32 reason )
{
fHaveToDisarm = TRUE;
if ( apcost > 0 && gTacticalStatus.uiFlags & INCOMBAT && gTacticalStatus.uiFlags & TURNBASED )
if ( usAPCost > 0 && gTacticalStatus.uiFlags & INCOMBAT && gTacticalStatus.uiFlags & TURNBASED )
{
swprintf (MenuRowText, L"Disarm (%d AP)", apcost );
swprintf (MenuRowText, szInventoryArmTextStr[STR_INV_ARM_DISARM_AP], usAPCost );
}
else
{
swprintf (MenuRowText, L"Disarm");
swprintf (MenuRowText, szInventoryArmTextStr[STR_INV_ARM_DISARM]);
}
}
else
{
if ( apcost > 0 && gTacticalStatus.uiFlags & INCOMBAT && gTacticalStatus.uiFlags & TURNBASED )
if ( usAPCost > 0 && gTacticalStatus.uiFlags & INCOMBAT && gTacticalStatus.uiFlags & TURNBASED )
{
swprintf (MenuRowText, L"Arm (%d AP)", apcost );
swprintf (MenuRowText, szInventoryArmTextStr[STR_INV_ARM_ARM_AP], usAPCost );
}
else
{
swprintf (MenuRowText, L"Arm");
swprintf (MenuRowText, szInventoryArmTextStr[STR_INV_ARM_ARM]);
}
}
@@ -12813,17 +12813,17 @@ void ItemDescTransformRegionCallback( MOUSE_REGION *pRegion, INT32 reason )
{
iTransformIndex++;
UINT16 apcost = 20;
UINT16 usAPCost = APBPConstants[AP_INVENTORY_ARM];
CHAR16 MenuRowText[300];
if ( apcost > 0 && gTacticalStatus.uiFlags & INCOMBAT && gTacticalStatus.uiFlags & TURNBASED )
if ( usAPCost > 0 && gTacticalStatus.uiFlags & INCOMBAT && gTacticalStatus.uiFlags & TURNBASED )
{
swprintf (MenuRowText, L"Blow up (%d AP)", apcost );
swprintf (MenuRowText, szInventoryArmTextStr[STR_INV_ARM_BLOWUP_AP], usAPCost );
}
else
{
swprintf (MenuRowText, L"Blow up");
swprintf (MenuRowText, szInventoryArmTextStr[STR_INV_ARM_BLOWUP]);
}
// Generate a new option for the menu
@@ -13019,6 +13019,21 @@ void TransformationMenuPopup_Arm( OBJECTTYPE* pObj )
// if this is grenade, blow it up, no dialogue settings here
if ( Item[pObj->usItem].usItemClass == IC_GRENADE )
{
// Start reading transformation data with APBP costs.
UINT16 usAPCost = APBPConstants[AP_INVENTORY_ARM];
INT32 iBPCost = APBPConstants[BP_INVENTORY_ARM];
// Check whether our soldier can afford this transformation!
if (!EnoughPoints( gpItemDescSoldier, (INT16)usAPCost, iBPCost, true ))
{
return;
}
else
{
// Soldier can afford the transformation. Deduct APBP as necessary.
DeductPoints( gpItemDescSoldier, (INT16)usAPCost, iBPCost, false );
}
INT8 screen = guiCurrentScreen;
if ( screen == GAME_SCREEN )
{
+2 -2
View File
@@ -6723,7 +6723,7 @@ void PrisonerMessageBoxCallBack( UINT8 ubExitValue )
CHAR16 wString[ 64 ];
GetShortSectorString( SECTORX(usSectorID), SECTORY(usSectorID), wString );
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szPrisonerTextStr[STR_PRISONER_SENTTOSECTOR], wString );
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szPrisonerTextStr[STR_PRISONER_SENTTOSECTOR], prisonerstobemoved, wString );
}
}
}
@@ -6747,7 +6747,7 @@ void PrisonerMessageBoxCallBack( UINT8 ubExitValue )
CHAR16 wString[ 64 ];
GetShortSectorString( SECTORX(usSectorID), SECTORY(usSectorID), wString );
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szPrisonerTextStr[STR_PRISONER_SENTTOSECTOR], wString );
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szPrisonerTextStr[STR_PRISONER_SENTTOSECTOR], prisonerstobemoved, wString );
}
}
}
+14
View File
@@ -763,6 +763,20 @@ enum
extern STR16 szMTATextStr[];
enum
{
STR_INV_ARM_BLOWUP_AP,
STR_INV_ARM_BLOWUP,
STR_INV_ARM_ARM_AP,
STR_INV_ARM_ARM,
STR_INV_ARM_DISARM_AP,
STR_INV_ARM_DISARM,
TEXT_NUM_INV_ARM_STR
};
extern STR16 szInventoryArmTextStr[];
enum
{
AIR_RAID_TURN_STR,
+11 -1
View File
@@ -7521,7 +7521,7 @@ STR16 szPrisonerTextStr[]=
L"%d 名俘虏已供出同伙位置", //L"%d prisoners revealed enemy positions.",
L"%d 名俘虏已加入我方阵营", //L"%d prisoners joined our cause.",
L"俘虏掀起大规模暴动!在 %s 监狱!", //L"Prisoners start a massive riot in %s!",
L"俘虏被押送前往 %s 监狱", //L"Prisoners were sent to %s!",
L"%d 俘虏被押送前往 %s 监狱", //L"Prisoners were sent to %s!",
L"俘虏已被释放!", //L"Prisoners have been released!",
L"军队已占领 %s 监狱,俘虏已被释放!", //L"The army now occupies the prison in %s, the prisoners were freed!",
L"这敌人丫宁死不从!",//L"The enemy refuses to surrender!",
@@ -7538,4 +7538,14 @@ STR16 szMTATextStr[]= // TODO.Translate
L"%s had to stop %s.",
};
STR16 szInventoryArmTextStr[]= // TODO.Translate
{
L"Blow up (%d AP)",
L"Blow up",
L"Arm (%d AP)",
L"Arm",
L"Disarm (%d AP)",
L"Disarm",
};
#endif //CHINESE
+11 -1
View File
@@ -7519,7 +7519,7 @@ STR16 szPrisonerTextStr[]=
L"%d prisoners revealed enemy positions.",
L"%d prisoners joined our cause.",
L"Prisoners start a massive riot in %s!",
L"Prisoners were sent to %s!",
L"%d prisoners were sent to %s!",
L"Prisoners have been released!",
L"The army now occupies the prison in %s, the prisoners were freed!",
L"The enemy refuses to surrender!",
@@ -7536,4 +7536,14 @@ STR16 szMTATextStr[]= // TODO.Translate
L"%s had to stop %s.",
};
STR16 szInventoryArmTextStr[]= // TODO.Translate
{
L"Blow up (%d AP)",
L"Blow up",
L"Arm (%d AP)",
L"Arm",
L"Disarm (%d AP)",
L"Disarm",
};
#endif //DUTCH
+11 -1
View File
@@ -7506,7 +7506,7 @@ STR16 szPrisonerTextStr[]=
L"%d prisoners revealed enemy positions.",
L"%d prisoners joined our cause.",
L"Prisoners start a massive riot in %s!",
L"Prisoners were sent to %s!",
L"%d prisoners were sent to %s!",
L"Prisoners have been released!",
L"The army now occupies the prison in %s, the prisoners were freed!",
L"The enemy refuses to surrender!",
@@ -7523,4 +7523,14 @@ STR16 szMTATextStr[]=
L"%s had to stop %s.",
};
STR16 szInventoryArmTextStr[]=
{
L"Blow up (%d AP)",
L"Blow up",
L"Arm (%d AP)",
L"Arm",
L"Disarm (%d AP)",
L"Disarm",
};
#endif //ENGLISH
+11 -1
View File
@@ -7503,7 +7503,7 @@ STR16 szPrisonerTextStr[]=
L"%d prisoners revealed enemy positions.",
L"%d prisoners joined our cause.",
L"Prisoners start a massive riot in %s!",
L"Prisoners were sent to %s!",
L"%d prisoners were sent to %s!",
L"Prisoners have been released!",
L"The army now occupies the prison in %s, the prisoners were freed!",
L"The enemy refuses to surrender!",
@@ -7520,4 +7520,14 @@ STR16 szMTATextStr[]= // TODO.Translate
L"%s had to stop %s.",
};
STR16 szInventoryArmTextStr[]= // TODO.Translate
{
L"Blow up (%d AP)",
L"Blow up",
L"Arm (%d AP)",
L"Arm",
L"Disarm (%d AP)",
L"Disarm",
};
#endif //FRENCH
+11 -1
View File
@@ -7330,7 +7330,7 @@ STR16 szPrisonerTextStr[]=
L"%d Gefangene haben uns Truppenstandorte verraten.",
L"%d Gefangene schliessen sich uns an.",
L"Gefangenenaufstand in %s!",
L"Gefangene wurden nach %s geschickt!",
L"%d Gefangene wurden nach %s geschickt!",
L"Gefangene freigelassen!",
L"Die Armee hat das Gefängnis in %s besetzt, die Gefangenen wurden befreit!",
L"Der Gegner weigert sich aufzugeben!",
@@ -7347,4 +7347,14 @@ STR16 szMTATextStr[]=
L"%s musste %s stoppen.",
};
STR16 szInventoryArmTextStr[]= // TODO.Translate
{
L"Blow up (%d AP)",
L"Blow up",
L"Arm (%d AP)",
L"Arm",
L"Disarm (%d AP)",
L"Disarm",
};
#endif //GERMAN
+11 -1
View File
@@ -7506,7 +7506,7 @@ STR16 szPrisonerTextStr[]=
L"%d prisoners revealed enemy positions.",
L"%d prisoners joined our cause.",
L"Prisoners start a massive riot in %s!",
L"Prisoners were sent to %s!",
L"%d prisoners were sent to %s!",
L"Prisoners have been released!",
L"The army now occupies the prison in %s, the prisoners were freed!",
L"The enemy refuses to surrender!",
@@ -7523,4 +7523,14 @@ STR16 szMTATextStr[]= // TODO.Translate
L"%s had to stop %s.",
};
STR16 szInventoryArmTextStr[]= // TODO.Translate
{
L"Blow up (%d AP)",
L"Blow up",
L"Arm (%d AP)",
L"Arm",
L"Disarm (%d AP)",
L"Disarm",
};
#endif //ITALIAN
+11 -1
View File
@@ -7525,7 +7525,7 @@ STR16 szPrisonerTextStr[]=
L"%d prisoners revealed enemy positions.",
L"%d prisoners joined our cause.",
L"Prisoners start a massive riot in %s!",
L"Prisoners were sent to %s!",
L"%d prisoners were sent to %s!",
L"Prisoners have been released!",
L"The army now occupies the prison in %s, the prisoners were freed!",
L"The enemy refuses to surrender!",
@@ -7542,4 +7542,14 @@ STR16 szMTATextStr[]= // TODO.Translate
L"%s had to stop %s.",
};
STR16 szInventoryArmTextStr[]= // TODO.Translate
{
L"Blow up (%d AP)",
L"Blow up",
L"Arm (%d AP)",
L"Arm",
L"Disarm (%d AP)",
L"Disarm",
};
#endif //POLISH
+11 -1
View File
@@ -7506,7 +7506,7 @@ STR16 szPrisonerTextStr[]=
L"%d prisoners revealed enemy positions.",
L"%d prisoners joined our cause.",
L"Prisoners start a massive riot in %s!",
L"Prisoners were sent to %s!",
L"%d prisoners were sent to %s!",
L"Prisoners have been released!",
L"The army now occupies the prison in %s, the prisoners were freed!",
L"The enemy refuses to surrender!",
@@ -7523,4 +7523,14 @@ STR16 szMTATextStr[]= // TODO.Translate
L"%s had to stop %s.",
};
STR16 szInventoryArmTextStr[]= // TODO.Translate
{
L"Blow up (%d AP)",
L"Blow up",
L"Arm (%d AP)",
L"Arm",
L"Disarm (%d AP)",
L"Disarm",
};
#endif //RUSSIAN
+11 -1
View File
@@ -7523,7 +7523,7 @@ STR16 szPrisonerTextStr[]=
L"%d prisoners revealed enemy positions.",
L"%d prisoners joined our cause.",
L"Prisoners start a massive riot in %s!",
L"Prisoners were sent to %s!",
L"%d prisoners were sent to %s!",
L"Prisoners have been released!",
L"The army now occupies the prison in %s, the prisoners were freed!",
L"The enemy refuses to surrender!",
@@ -7540,4 +7540,14 @@ STR16 szMTATextStr[]= // TODO.Translate
L"%s had to stop %s.",
};
STR16 szInventoryArmTextStr[]= // TODO.Translate
{
L"Blow up (%d AP)",
L"Blow up",
L"Arm (%d AP)",
L"Arm",
L"Disarm (%d AP)",
L"Disarm",
};
#endif //TAIWANESE