- new option for automatic IMP item distribution:

uiIndex 52 "Sidearm" in IMPItemChoices.xml is used to give the IMP a standard sidearm based on random selection. It is encouraged to remove marksmanship based gun choices and instead add special weaponry for traits.

- The following changes are supposed to remove useless items from vendors and other lists:
Function ItemIsLegal now filters out food items if the food system is off. The same applies to cleaning kits if the dirt system is off.


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7722 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
silversurfer
2015-01-31 14:36:36 +00:00
parent 4ba64556bf
commit 46b34e55d1
3 changed files with 20 additions and 2 deletions
+5 -2
View File
@@ -623,6 +623,8 @@ void GiveItemsToPC( UINT8 ubProfileId )
GiveIMPItems(pProfile, 100, IMP_DEFAULT);
GiveIMPRandomItems(pProfile, IMP_RANDOMDEFAULT);
// silversurfer: added sidearm selection
GiveIMPRandomItems(pProfile, IMP_SIDEARM);
GiveIMPItems (pProfile,pProfile->bWisdom,IMP_WISDOM);
GiveIMPItems (pProfile,pProfile->bMarksmanship,IMP_MARKSMANSHIP);
@@ -1686,7 +1688,8 @@ void GiveIMPRandomItems( MERCPROFILESTRUCT *pProfile, UINT8 typeIndex )
for ( UINT8 cnt=0; cnt < ubNumChoices; ++cnt )
{
usItem = gIMPItemChoices[ typeIndex ].bItemNo[ cnt ];
if ( ItemIsLegal(usItem) )
// allow guns no matter if Tons of Guns was selected so the merc doesn't have to start without a weapon
if ( ItemIsLegal(usItem) || Item[usItem].usItemClass == IC_GUN )
++ubValidChoices;
}
@@ -1710,7 +1713,7 @@ void GiveIMPRandomItems( MERCPROFILESTRUCT *pProfile, UINT8 typeIndex )
iChoice = Random( ubNumChoices );
usItem = gIMPItemChoices[ typeIndex ].bItemNo[ iChoice ];
// is this legal and we don't have it already?
if (ItemIsLegal(usItem) && !ubItemsGiven[iChoice] )
if ( (ItemIsLegal(usItem) || Item[usItem].usItemClass == IC_GUN) && !ubItemsGiven[iChoice] )
ubItemsGiven[iChoice] = TRUE;
else
usItem=0;
+3
View File
@@ -1881,6 +1881,9 @@ enum
// Flugente: added radio operator
IMP_RADIO_OPERATOR,
// silversurfer: added sidearm for standard weapons. Special weapons should come from traits.
IMP_SIDEARM,
MAX_IMP_ITEM_TYPES
};
+12
View File
@@ -1266,6 +1266,18 @@ BOOLEAN ItemIsLegal( UINT16 usItemIndex, BOOLEAN fIgnoreCoolness )
if ( Item[usItemIndex].ubCoolness == 0 && !fIgnoreCoolness )
return FALSE;
// silversurfer: no food items if the food system is off
if ( !gGameOptions.fFoodSystem && Item[ usItemIndex ].foodtype > 0 )
{
// Only restrict food for now. Water can be used to replenish lost energy so it is useful even without the food system.
if ( Food[Item[usItemIndex].foodtype].bFoodPoints > 0 )
return FALSE;
}
// silversurfer: we don't need cleaning kits if the dirt system is off
if ( !gGameExternalOptions.fDirtSystem && HasItemFlag(usItemIndex, CLEANING_KIT) )
return FALSE;
//if the user has selected the reduced gun list
if( !gGameOptions.fGunNut )
{