Merge pull request #302 from kitty624/source-dev

Rework of r9343 - simplyfied some things and removed unnecessary parts
This commit is contained in:
Kitty
2024-04-15 07:18:14 +02:00
committed by GitHub
5 changed files with 14 additions and 41 deletions
+4 -17
View File
@@ -5633,28 +5633,15 @@ void EnableWeaponKitSelectionButtons()
{ {
if ( !(gMercProfiles[gbCurrentSoldier].ubMiscFlags & PROFILE_MISC_FLAG_ALREADY_USED_ITEMS) || gGameExternalOptions.fGearKitsAlwaysAvailable ) 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) for(int i=0; i<NUM_MERCSTARTINGGEAR_KITS; ++i)
{ {
bShow = false;
for(int j=INV_START_POS; j<NUM_INV_SLOTS; ++j) for(int j=INV_START_POS; j<NUM_INV_SLOTS; ++j)
{ {
usItem = gMercProfileGear[gbCurrentSoldier][i].inv[j]; if(gMercProfileGear[gbCurrentSoldier][i].inv[j] != NONE)
if(usItem != NONE)
{ {
bShow = true; ShowButton( giWeaponboxSelectionButton[i] );
//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 break;
if (((Item[usItem].usLimitedToSystem & FOOD_SYSTEM_FLAG) && !UsingFoodSystem()) || ((Item[usItem].usLimitedToSystem & DISEASE_SYSTEM_FLAG) && !gGameExternalOptions.fDisease)) }
{
bShow = false;
break;
}
}
}
if (bShow)
{
ShowButton(giWeaponboxSelectionButton[i]);
} }
} }
} }
+3 -5
View File
@@ -947,9 +947,6 @@ extern OBJECTTYPE gTempObject;
// autofiretohitbonus, // autofiretohitbonus,
// bursttohitbonus // bursttohitbonus
// bitflags for usLimitedToSystem
#define FOOD_SYSTEM_FLAG 1
#define DISEASE_SYSTEM_FLAG 2
typedef struct typedef struct
{ {
@@ -1218,8 +1215,9 @@ typedef struct
BOOLEAN fProvidesRobotCamo; BOOLEAN fProvidesRobotCamo;
BOOLEAN fProvidesRobotNightVision; BOOLEAN fProvidesRobotNightVision;
BOOLEAN fProvidesRobotLaserBonus; 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 // rftr: the progress bounds that allow a transport group to drop an item
INT8 iTransportGroupMinProgress; INT8 iTransportGroupMinProgress;
+3 -2
View File
@@ -1279,8 +1279,9 @@ BOOLEAN ItemIsLegal( UINT16 usItemIndex, BOOLEAN fIgnoreCoolness )
return FALSE; return FALSE;
} }
//shadooow: exclude also any item that is limited to specific system and this system isn't enabled // kitty: no disease items if the disease system is off
if (((Item[usItemIndex].usLimitedToSystem & FOOD_SYSTEM_FLAG) && !UsingFoodSystem()) || ((Item[usItemIndex].usLimitedToSystem & DISEASE_SYSTEM_FLAG) && !gGameExternalOptions.fDisease)) // whether the item is exclusive is defined by tag
if (!gGameExternalOptions.fDisease && Item[usItemIndex].DiseaseSystemExclusive)
{ {
return FALSE; return FALSE;
} }
-7
View File
@@ -2896,13 +2896,6 @@ BOOLEAN DetermineArmsDealersSellingInventory( )
continue; 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; bool increment = true;
if (ItemIsSpecial(*iter) == false) { if (ItemIsSpecial(*iter) == false) {
StoreObjectsInNextFreeDealerInvSlot( &(*iter), gpTempDealersInventory, gbSelectedArmsDealerID ); StoreObjectsInNextFreeDealerInvSlot( &(*iter), gpTempDealersInventory, gbSelectedArmsDealerID );
+4 -10
View File
@@ -306,7 +306,6 @@ itemStartElementHandle(void *userData, const XML_Char *name, const XML_Char **at
strcmp(name, "ProvidesRobotCamo") == 0 || strcmp(name, "ProvidesRobotCamo") == 0 ||
strcmp(name, "ProvidesRobotNightVision") == 0 || strcmp(name, "ProvidesRobotNightVision") == 0 ||
strcmp(name, "ProvidesRobotLaserBonus") == 0 || strcmp(name, "ProvidesRobotLaserBonus") == 0 ||
strcmp(name, "FoodSystemExclusive") == 0 ||
strcmp(name, "DiseaseSystemExclusive") == 0 || strcmp(name, "DiseaseSystemExclusive") == 0 ||
strcmp(name, "TransportGroupMinProgress") == 0 || strcmp(name, "TransportGroupMinProgress") == 0 ||
strcmp(name, "TransportGroupMaxProgress") == 0 strcmp(name, "TransportGroupMaxProgress") == 0
@@ -1515,17 +1514,10 @@ itemEndElementHandle(void *userData, const XML_Char *name)
pData->curElement = ELEMENT; pData->curElement = ELEMENT;
pData->curItem.fProvidesRobotLaserBonus = (BOOLEAN)atol(pData->szCharData); 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) else if (strcmp(name, "DiseaseSystemExclusive") == 0)
{ {
pData->curElement = ELEMENT; pData->curElement = ELEMENT;
if (atol(pData->szCharData)) pData->curItem.DiseaseSystemExclusive = (BOOLEAN)atol(pData->szCharData);
pData->curItem.usLimitedToSystem|= DISEASE_SYSTEM_FLAG;
} }
else if (strcmp(name, "TransportGroupMinProgress") == 0) else if (strcmp(name, "TransportGroupMinProgress") == 0)
{ {
@@ -2194,6 +2186,8 @@ BOOLEAN WriteItemStats()
FilePrintf(hFile,"\t\t<ProvidesRobotNightVision>%d</ProvidesRobotNightVision>\r\n", Item[cnt].fProvidesRobotNightVision ); 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<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,"\t</ITEM>\r\n");
} }
FilePrintf(hFile,"</ITEMLIST>\r\n"); FilePrintf(hFile,"</ITEMLIST>\r\n");