Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 4 additions & 17 deletions Laptop/AimMembers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5633,28 +5633,15 @@ void EnableWeaponKitSelectionButtons()
{
if ( !(gMercProfiles[gbCurrentSoldier].ubMiscFlags & PROFILE_MISC_FLAG_ALREADY_USED_ITEMS) || gGameExternalOptions.fGearKitsAlwaysAvailable )
{
bool bShow;
INT16 usItem;
for(int i=0; i<NUM_MERCSTARTINGGEAR_KITS; ++i)
{
bShow = false;
for(int j=INV_START_POS; j<NUM_INV_SLOTS; ++j)
{
usItem = gMercProfileGear[gbCurrentSoldier][i].inv[j];
if(usItem != NONE)
if(gMercProfileGear[gbCurrentSoldier][i].inv[j] != NONE)
{
bShow = true;
//shadooow: if any of the item in kit is limited to specific system and this system isn't enabled then disable the whole kit from selection
if (((Item[usItem].usLimitedToSystem & FOOD_SYSTEM_FLAG) && !UsingFoodSystem()) || ((Item[usItem].usLimitedToSystem & DISEASE_SYSTEM_FLAG) && !gGameExternalOptions.fDisease))
{
bShow = false;
break;
}
}
}
if (bShow)
{
ShowButton(giWeaponboxSelectionButton[i]);
ShowButton( giWeaponboxSelectionButton[i] );
break;
}
}
}
}
Expand Down
8 changes: 3 additions & 5 deletions Tactical/Item Types.h
Original file line number Diff line number Diff line change
Expand Up @@ -947,9 +947,6 @@ extern OBJECTTYPE gTempObject;
// autofiretohitbonus,
// bursttohitbonus

// bitflags for usLimitedToSystem
#define FOOD_SYSTEM_FLAG 1
#define DISEASE_SYSTEM_FLAG 2

typedef struct
{
Expand Down Expand Up @@ -1218,8 +1215,9 @@ typedef struct
BOOLEAN fProvidesRobotCamo;
BOOLEAN fProvidesRobotNightVision;
BOOLEAN fProvidesRobotLaserBonus;
//shadooow: bitflag controlling what system needs to be in play for item to appear
UINT8 usLimitedToSystem;

// kitty: item exclusively available with disease feature
BOOLEAN DiseaseSystemExclusive;

// rftr: the progress bounds that allow a transport group to drop an item
INT8 iTransportGroupMinProgress;
Expand Down
5 changes: 3 additions & 2 deletions Tactical/Items.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1279,8 +1279,9 @@ BOOLEAN ItemIsLegal( UINT16 usItemIndex, BOOLEAN fIgnoreCoolness )
return FALSE;
}

//shadooow: exclude also any item that is limited to specific system and this system isn't enabled
if (((Item[usItemIndex].usLimitedToSystem & FOOD_SYSTEM_FLAG) && !UsingFoodSystem()) || ((Item[usItemIndex].usLimitedToSystem & DISEASE_SYSTEM_FLAG) && !gGameExternalOptions.fDisease))
// kitty: no disease items if the disease system is off
// whether the item is exclusive is defined by tag
if (!gGameExternalOptions.fDisease && Item[usItemIndex].DiseaseSystemExclusive)
{
return FALSE;
}
Expand Down
7 changes: 0 additions & 7 deletions Tactical/ShopKeeper Interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2896,13 +2896,6 @@ BOOLEAN DetermineArmsDealersSellingInventory( )
continue;
}

//shadooow: do not sell any item that is limited to specific system and this system isn't enabled
if (((Item[iter->object.usItem].usLimitedToSystem & FOOD_SYSTEM_FLAG) && !UsingFoodSystem()) || ((Item[iter->object.usItem].usLimitedToSystem & DISEASE_SYSTEM_FLAG) && !gGameExternalOptions.fDisease))
{
++iter;
continue;
}

bool increment = true;
if (ItemIsSpecial(*iter) == false) {
StoreObjectsInNextFreeDealerInvSlot( &(*iter), gpTempDealersInventory, gbSelectedArmsDealerID );
Expand Down
14 changes: 4 additions & 10 deletions Utils/XML_Items.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,6 @@ itemStartElementHandle(void *userData, const XML_Char *name, const XML_Char **at
strcmp(name, "ProvidesRobotCamo") == 0 ||
strcmp(name, "ProvidesRobotNightVision") == 0 ||
strcmp(name, "ProvidesRobotLaserBonus") == 0 ||
strcmp(name, "FoodSystemExclusive") == 0 ||
strcmp(name, "DiseaseSystemExclusive") == 0 ||
strcmp(name, "TransportGroupMinProgress") == 0 ||
strcmp(name, "TransportGroupMaxProgress") == 0
Expand Down Expand Up @@ -1515,17 +1514,10 @@ itemEndElementHandle(void *userData, const XML_Char *name)
pData->curElement = ELEMENT;
pData->curItem.fProvidesRobotLaserBonus = (BOOLEAN)atol(pData->szCharData);
}
else if (strcmp(name, "FoodSystemExclusive") == 0)
{
pData->curElement = ELEMENT;
if (atol(pData->szCharData))
pData->curItem.usLimitedToSystem|= FOOD_SYSTEM_FLAG;
}
else if (strcmp(name, "DiseaseSystemExclusive") == 0)
{
pData->curElement = ELEMENT;
if (atol(pData->szCharData))
pData->curItem.usLimitedToSystem|= DISEASE_SYSTEM_FLAG;
pData->curElement = ELEMENT;
pData->curItem.DiseaseSystemExclusive = (BOOLEAN)atol(pData->szCharData);
}
else if (strcmp(name, "TransportGroupMinProgress") == 0)
{
Expand Down Expand Up @@ -2194,6 +2186,8 @@ BOOLEAN WriteItemStats()
FilePrintf(hFile,"\t\t<ProvidesRobotNightVision>%d</ProvidesRobotNightVision>\r\n", Item[cnt].fProvidesRobotNightVision );
FilePrintf(hFile,"\t\t<ProvidesRobotLaserBonus>%d</ProvidesRobotLaserBonus>\r\n", Item[cnt].fProvidesRobotLaserBonus );

FilePrintf(hFile, "\t\t<DiseaseSystemExclusive>%d</DiseaseSystemExclusive>\r\n", Item[cnt].DiseaseSystemExclusive);

FilePrintf(hFile,"\t</ITEM>\r\n");
}
FilePrintf(hFile,"</ITEMLIST>\r\n");
Expand Down