mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
feature improvement: if MILITIA_USE_SECTOR_EQUIPMENT_CLASS_SPECIFIC_TABOOS is TRUE, one can taboo equipment for specific militia classes
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6026 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+2
-1
@@ -1858,7 +1858,8 @@ void LoadGameExternalOptions()
|
||||
gGameExternalOptions.usMilitiaAmmo_Min = iniReader.ReadInteger("Militia Equipment Settings","MILITIA_USE_SECTOR_EQUIPMENT_AMMO_MIN", 10, 1, 400);
|
||||
gGameExternalOptions.usMilitiaAmmo_Max = iniReader.ReadInteger("Militia Equipment Settings","MILITIA_USE_SECTOR_EQUIPMENT_AMMO_MAX", 200, 30, 400);
|
||||
gGameExternalOptions.usMilitiaAmmo_OptimalMagCount = iniReader.ReadInteger("Militia Equipment Settings","MILITIA_USE_SECTOR_EQUIPMENT_AMMO_OPTIMAL_MAG_COUNT", 2, 1, 10);
|
||||
|
||||
gGameExternalOptions.fMilitiaUseSectorClassSpecificTaboos = iniReader.ReadBoolean("Militia Equipment Settings","MILITIA_USE_SECTOR_EQUIPMENT_CLASS_SPECIFIC_TABOOS", TRUE);
|
||||
|
||||
//################# Shopkeeper Inventory Settings ##################
|
||||
|
||||
// WDS - Improve Tony's and Devin's inventory like BR's
|
||||
|
||||
@@ -487,6 +487,7 @@ typedef struct
|
||||
UINT16 usMilitiaAmmo_Min;
|
||||
UINT16 usMilitiaAmmo_Max;
|
||||
UINT16 usMilitiaAmmo_OptimalMagCount;
|
||||
BOOLEAN fMilitiaUseSectorClassSpecificTaboos;
|
||||
|
||||
// WDS - Improve Tony's and Devin's inventory like BR's
|
||||
BOOLEAN tonyUsesBRSetting;
|
||||
|
||||
@@ -612,12 +612,18 @@ BOOLEAN RenderItemInPoolSlot( INT32 iCurrentSlot, INT32 iFirstSlotOnPage )
|
||||
}
|
||||
}
|
||||
|
||||
if( gGameExternalOptions.fMilitiaUseSectorInventory && ( pInventoryPoolList[ iCurrentSlot + iFirstSlotOnPage ].usFlags & WORLD_ITEM_TABOO_FOR_MILITIA_EQ ) )
|
||||
if( gGameExternalOptions.fMilitiaUseSectorInventory && ( pInventoryPoolList[ iCurrentSlot + iFirstSlotOnPage ].usFlags & WORLD_ITEM_TABOO_FOR_MILITIA_EQ_ALL ) )
|
||||
{
|
||||
//Shade the item, but only if it is an active item!
|
||||
if ( pInventoryPoolList[ iCurrentSlot + iFirstSlotOnPage ].object.exists() == true)
|
||||
{
|
||||
UINT16 usMilitia_EQColor = Get16BPPColor( FROMRGB( 69, 197, 149 ) );
|
||||
// colour depends on flag
|
||||
UINT16 usMilitia_EQColor = Get16BPPColor( FROMRGB( 31, 123, 129 ) );
|
||||
if ( pInventoryPoolList[ iCurrentSlot + iFirstSlotOnPage ].usFlags & WORLD_ITEM_TABOO_FOR_MILITIA_EQ_BLUE )
|
||||
usMilitia_EQColor = Get16BPPColor( FROMRGB( 57, 4, 155 ) );
|
||||
if ( pInventoryPoolList[ iCurrentSlot + iFirstSlotOnPage ].usFlags & WORLD_ITEM_TABOO_FOR_MILITIA_EQ_ELITE )
|
||||
usMilitia_EQColor = Get16BPPColor( FROMRGB( 156, 37, 3 ) );
|
||||
|
||||
DrawHatchOnInventory_MilitiaAccess( guiSAVEBUFFER, sX, sY, MAP_INVEN_SLOT_WIDTH, MAP_INVEN_SLOT_IMAGE_HEIGHT , usMilitia_EQColor);
|
||||
}
|
||||
}
|
||||
@@ -1327,10 +1333,20 @@ void MapInvenPoolSlots(MOUSE_REGION * pRegion, INT32 iReason )
|
||||
{
|
||||
if ( _KeyDown ( TAB ) && gGameExternalOptions.fMilitiaUseSectorInventory )
|
||||
{
|
||||
if ( pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCounter ].usFlags & WORLD_ITEM_TABOO_FOR_MILITIA_EQ )
|
||||
pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCounter ].usFlags &= ~ WORLD_ITEM_TABOO_FOR_MILITIA_EQ;
|
||||
if ( pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCounter ].usFlags & WORLD_ITEM_TABOO_FOR_MILITIA_EQ_ELITE )
|
||||
pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCounter ].usFlags &= ~WORLD_ITEM_TABOO_FOR_MILITIA_EQ_ALL;
|
||||
else if ( pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCounter ].usFlags & WORLD_ITEM_TABOO_FOR_MILITIA_EQ_BLUE )
|
||||
pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCounter ].usFlags |= WORLD_ITEM_TABOO_FOR_MILITIA_EQ_ELITE;
|
||||
else if ( pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCounter ].usFlags & WORLD_ITEM_TABOO_FOR_MILITIA_EQ_GREEN )
|
||||
pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCounter ].usFlags |= WORLD_ITEM_TABOO_FOR_MILITIA_EQ_BLUE;
|
||||
else
|
||||
pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCounter ].usFlags |= WORLD_ITEM_TABOO_FOR_MILITIA_EQ;
|
||||
{
|
||||
pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCounter ].usFlags |= WORLD_ITEM_TABOO_FOR_MILITIA_EQ_GREEN;
|
||||
|
||||
// if we do not use class specific taboos, set all flags at once
|
||||
if ( !gGameExternalOptions.fMilitiaUseSectorClassSpecificTaboos )
|
||||
pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCounter ].usFlags |= WORLD_ITEM_TABOO_FOR_MILITIA_EQ_ALL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1388,10 +1404,20 @@ void MapInvenPoolSlots(MOUSE_REGION * pRegion, INT32 iReason )
|
||||
|
||||
if ( _KeyDown ( TAB ) && gGameExternalOptions.fMilitiaUseSectorInventory )
|
||||
{
|
||||
if ( pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCounter ].usFlags & WORLD_ITEM_TABOO_FOR_MILITIA_EQ )
|
||||
pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCounter ].usFlags &= ~ WORLD_ITEM_TABOO_FOR_MILITIA_EQ;
|
||||
if ( pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCounter ].usFlags & WORLD_ITEM_TABOO_FOR_MILITIA_EQ_ELITE )
|
||||
pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCounter ].usFlags &= ~WORLD_ITEM_TABOO_FOR_MILITIA_EQ_ALL;
|
||||
else if ( pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCounter ].usFlags & WORLD_ITEM_TABOO_FOR_MILITIA_EQ_BLUE )
|
||||
pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCounter ].usFlags |= WORLD_ITEM_TABOO_FOR_MILITIA_EQ_ELITE;
|
||||
else if ( pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCounter ].usFlags & WORLD_ITEM_TABOO_FOR_MILITIA_EQ_GREEN )
|
||||
pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCounter ].usFlags |= WORLD_ITEM_TABOO_FOR_MILITIA_EQ_BLUE;
|
||||
else
|
||||
pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCounter ].usFlags |= WORLD_ITEM_TABOO_FOR_MILITIA_EQ;
|
||||
{
|
||||
pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCounter ].usFlags |= WORLD_ITEM_TABOO_FOR_MILITIA_EQ_GREEN;
|
||||
|
||||
// if we do not use class specific taboos, set all flags at once
|
||||
if ( !gGameExternalOptions.fMilitiaUseSectorClassSpecificTaboos )
|
||||
pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCounter ].usFlags |= WORLD_ITEM_TABOO_FOR_MILITIA_EQ_ALL;
|
||||
}
|
||||
}
|
||||
else
|
||||
BeginInventoryPoolPtr( &( pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCounter ].object ) );
|
||||
|
||||
@@ -2180,7 +2180,7 @@ void SoldierGetItemFromWorld( SOLDIERTYPE *pSoldier, INT32 iItemIndex, INT32 sGr
|
||||
}
|
||||
else if ( Item[gTempObject.usItem].usItemClass & IC_FACE && gGameExternalOptions.fMilitiaUseSectorInventory_Face )
|
||||
{
|
||||
gTempObject[0]->data.sObjectFlag |= IC_FACE;
|
||||
gTempObject[0]->data.sObjectFlag |= TAKEN_BY_MILITIA;
|
||||
}
|
||||
else if ( Item[gTempObject.usItem].usItemClass & (IC_BLADE|IC_PUNCH) && gGameExternalOptions.fMilitiaUseSectorInventory_Melee )
|
||||
{
|
||||
@@ -2198,6 +2198,11 @@ void SoldierGetItemFromWorld( SOLDIERTYPE *pSoldier, INT32 iItemIndex, INT32 sGr
|
||||
{
|
||||
gTempObject[0]->data.sObjectFlag |= TAKEN_BY_MILITIA;
|
||||
}
|
||||
|
||||
if ( gWorldItems[ iItemIndex ].usFlags & WORLD_ITEM_TABOO_FOR_MILITIA_EQ_GREEN )
|
||||
gWorldItems[ iItemIndex ].object[0]->data.sObjectFlag |= TAKEN_BY_MILITIA_TABOO_GREEN;
|
||||
if ( gWorldItems[ iItemIndex ].usFlags & WORLD_ITEM_TABOO_FOR_MILITIA_EQ_BLUE )
|
||||
gWorldItems[ iItemIndex ].object[0]->data.sObjectFlag |= TAKEN_BY_MILITIA_TABOO_BLUE;
|
||||
}
|
||||
|
||||
if ( !AutoPlaceObject( pSoldier, &gTempObject, TRUE ) )
|
||||
@@ -2352,6 +2357,11 @@ void SoldierGetItemFromWorld( SOLDIERTYPE *pSoldier, INT32 iItemIndex, INT32 sGr
|
||||
{
|
||||
gWorldItems[ iItemIndex ].object[0]->data.sObjectFlag |= TAKEN_BY_MILITIA;
|
||||
}
|
||||
|
||||
if ( gWorldItems[ iItemIndex ].usFlags & WORLD_ITEM_TABOO_FOR_MILITIA_EQ_GREEN )
|
||||
gWorldItems[ iItemIndex ].object[0]->data.sObjectFlag |= TAKEN_BY_MILITIA_TABOO_GREEN;
|
||||
if ( gWorldItems[ iItemIndex ].usFlags & WORLD_ITEM_TABOO_FOR_MILITIA_EQ_BLUE )
|
||||
gWorldItems[ iItemIndex ].object[0]->data.sObjectFlag |= TAKEN_BY_MILITIA_TABOO_BLUE;
|
||||
}
|
||||
|
||||
if ( !AutoPlaceObject( pSoldier, &(gWorldItems[ iItemIndex ].object ), TRUE ) )
|
||||
@@ -2937,6 +2947,12 @@ OBJECTTYPE* InternalAddItemToPool( INT32 *psGridNo, OBJECTTYPE *pObject, INT8 bV
|
||||
*piItemIndex = iWorldItem;
|
||||
}
|
||||
}
|
||||
|
||||
if ( (*pObject)[0]->data.sObjectFlag & TAKEN_BY_MILITIA_TABOO_GREEN )
|
||||
gWorldItems[ iWorldItem ].usFlags |= WORLD_ITEM_TABOO_FOR_MILITIA_EQ_GREEN;
|
||||
if ( (*pObject)[0]->data.sObjectFlag & TAKEN_BY_MILITIA_TABOO_BLUE )
|
||||
gWorldItems[ iWorldItem ].usFlags |= WORLD_ITEM_TABOO_FOR_MILITIA_EQ_BLUE;
|
||||
|
||||
return( &(gWorldItems[ iWorldItem ].object ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -3731,6 +3731,11 @@ void SearchItemRetrieval( WORLDITEM* pWorldItem, ItemSearchStruct* pSi, SOLDIERC
|
||||
|
||||
for ( UINT8 i = 0; i < usRealTake; ++i )
|
||||
(pp->Inv[ pSi->soldierslot ])[i]->data.sObjectFlag |= TAKEN_BY_MILITIA;
|
||||
|
||||
if ( pWorldItem[ pSi->pos ].usFlags & WORLD_ITEM_TABOO_FOR_MILITIA_EQ_GREEN )
|
||||
(pp->Inv[ pSi->soldierslot ])[0]->data.sObjectFlag |= TAKEN_BY_MILITIA_TABOO_GREEN;
|
||||
if ( pWorldItem[ pSi->pos ].usFlags & WORLD_ITEM_TABOO_FOR_MILITIA_EQ_BLUE )
|
||||
(pp->Inv[ pSi->soldierslot ])[0]->data.sObjectFlag |= TAKEN_BY_MILITIA_TABOO_BLUE;
|
||||
|
||||
if ( pWorldItem[ pSi->pos ].object.ubNumberOfObjects < 1 )
|
||||
{
|
||||
@@ -3981,7 +3986,7 @@ void MoveMilitiaEquipment(INT16 sSourceX, INT16 sSourceY, INT16 sTargetX, INT16
|
||||
|
||||
// Preparation: load correct sector inventory
|
||||
// init selection structures
|
||||
// decide which items categories to look for
|
||||
// decide which item categories to look for
|
||||
// delete existing soldier inventory, but account for gear already selected by this function (failsafe)
|
||||
// early exit if no items are found in sector at all
|
||||
|
||||
@@ -3989,9 +3994,9 @@ void MoveMilitiaEquipment(INT16 sSourceX, INT16 sSourceY, INT16 sTargetX, INT16
|
||||
// We do not yet evaluate guns - we do that later, when we know what ammo exists
|
||||
// We store ammo in a map that also stores caliber and ammotype
|
||||
// We store launchers in a structure that stores their item, wether they need ammo, and how much ammo we found
|
||||
// We evaluate objects via EvaluateObjForItem(...). If you are unsatisgied with militia selections, try to improve this funtion first
|
||||
// We evaluate objects via EvaluateObjForItem(...). If you are unsatisfied with militia selections, try to improve this funtion first
|
||||
|
||||
// 1st loop afterwork: If we are unable to determine a valid GridNo, soemthing is wrong here, abort
|
||||
// 1st loop afterwork: If we are unable to determine a valid GridNo, something is wrong here, abort
|
||||
// Definite decision on armour/face items/melee items/hand grenades
|
||||
|
||||
// 2nd loop: Evaluate all guns, taking ammo into account (we know how much ammo there is, as we wrote that into our map)
|
||||
@@ -4001,12 +4006,12 @@ void MoveMilitiaEquipment(INT16 sSourceX, INT16 sSourceY, INT16 sTargetX, INT16
|
||||
// Decide on a gun, we can now do that as we know all ammo
|
||||
// If we have selected a gun, but do not take ammo from the inventory, spawn ammo in the traditional way
|
||||
|
||||
// 3rd loop: If we ever decide to pick up a gun, we will have done so now. We will look for fitting ammo in all ammo/guns, spawn correct magazines in our inventory, and remove ammo from found objects
|
||||
// 3rd loop: If we ever decide to pick up a gun, we will have done so by now. We will look for fitting ammo in all ammo/guns, spawn correct magazines in our inventory, and remove ammo from found objects
|
||||
// As we have decided on which launcher we want, we evaluate all launchers of this type and take if afterwards. We also move enough ammo into our inventory.
|
||||
// If we created a new mag from the gun we took, try to add this to an empty invetory slot, if none is found, enlarge the inventory afterwards
|
||||
// If we created a new mag from the gun we took, try to add this to an empty inventory slot, if none is found, enlarge the inventory afterwards
|
||||
|
||||
// 3rd loop afterwork: Take launcher
|
||||
// Add mag if created adn it couldn't be added to empty slot earlier by enlarging the inventory
|
||||
// Add mag if created and it couldn't be added to empty slot earlier by enlarging the inventory
|
||||
|
||||
// Exit: Save changed inventory
|
||||
void TakeMilitiaEquipmentfromSector( INT16 sMapX, INT16 sMapY, INT8 sMapZ, SOLDIERCREATE_STRUCT *pp, INT8 bSoldierClass )
|
||||
@@ -4027,15 +4032,25 @@ void TakeMilitiaEquipmentfromSector( INT16 sMapX, INT16 sMapY, INT8 sMapZ, SOLDI
|
||||
UINT8 usLauncherAmmoLeftToTake = 0;
|
||||
UINT16 usSelectedGunBulletsNeeded = 0; // how many bullets do we want for our gun
|
||||
UINT16 usSelectedGunBulletCount = 0; // how many bullets have we already taken for our selected gun
|
||||
UINT16 usTabooFlag = 0;
|
||||
|
||||
if ( !gGameExternalOptions.fMilitiaUseSectorInventory )
|
||||
return;
|
||||
|
||||
// depending on our bSoldierClass, we may be forbidden from taking items the player has flagged
|
||||
// note that in the current implmentation, items with the WORLD_ITEM_TABOO_FOR_MILITIA_EQ_GREEN-flag will have the higher flags as well, but that might change in the future
|
||||
if ( bSoldierClass == SOLDIER_CLASS_ELITE_MILITIA )
|
||||
usTabooFlag = WORLD_ITEM_TABOO_FOR_MILITIA_EQ_ELITE;
|
||||
else if ( bSoldierClass == SOLDIER_CLASS_REG_MILITIA )
|
||||
usTabooFlag = WORLD_ITEM_TABOO_FOR_MILITIA_EQ_BLUE;
|
||||
else
|
||||
usTabooFlag = WORLD_ITEM_TABOO_FOR_MILITIA_EQ_GREEN;
|
||||
|
||||
///////////////////////////////// Preparation /////////////////////////////////////////////////////////
|
||||
|
||||
// Preparation: load correct sector inventory
|
||||
// init selection structures
|
||||
// decide which items categories to look for
|
||||
// decide which item categories to look for
|
||||
// delete existing soldier inventory, but account for gear already selected by this function (failsafe)
|
||||
// early exit if no items are found in sector at all
|
||||
|
||||
@@ -4185,7 +4200,7 @@ void TakeMilitiaEquipmentfromSector( INT16 sMapX, INT16 sMapY, INT8 sMapZ, SOLDI
|
||||
// this would be the place where we check wether the militia is allowed to pick up an item depending on its soldierclass
|
||||
|
||||
// test wether item is reachable and useable by militia
|
||||
if ( (pWorldItem[ uiCount ].usFlags & WORLD_ITEM_REACHABLE) && !(pWorldItem[ uiCount ].usFlags & WORLD_ITEM_TABOO_FOR_MILITIA_EQ) )
|
||||
if ( (pWorldItem[ uiCount ].usFlags & WORLD_ITEM_REACHABLE) && !(pWorldItem[ uiCount ].usFlags & usTabooFlag) )
|
||||
{
|
||||
// armour
|
||||
if ( Item[pWorldItem[ uiCount ].object.usItem].usItemClass & IC_ARMOUR && (!si[SI_HELMET].done || !si[SI_VEST].done || !si[SI_LEGS].done ) )
|
||||
@@ -4343,7 +4358,7 @@ void TakeMilitiaEquipmentfromSector( INT16 sMapX, INT16 sMapY, INT8 sMapZ, SOLDI
|
||||
// this would be the place where we check wether the militia is allowed to pick up an item depending on its soldierclass
|
||||
|
||||
// test wether item is reachable
|
||||
if ( (pWorldItem[ uiCount ].usFlags & WORLD_ITEM_REACHABLE) && !(pWorldItem[ uiCount ].usFlags & WORLD_ITEM_TABOO_FOR_MILITIA_EQ) )
|
||||
if ( (pWorldItem[ uiCount ].usFlags & WORLD_ITEM_REACHABLE) && !(pWorldItem[ uiCount ].usFlags & usTabooFlag) )
|
||||
{
|
||||
// only if we are still looking for a gun
|
||||
if ( Item[pWorldItem[ uiCount ].object.usItem].usItemClass & IC_GUN && !si[SI_GUN].done )
|
||||
@@ -4529,7 +4544,7 @@ void TakeMilitiaEquipmentfromSector( INT16 sMapX, INT16 sMapY, INT8 sMapZ, SOLDI
|
||||
if ( pObj != NULL && pObj->exists() ) // ... if pointer is not obviously useless ...
|
||||
{
|
||||
// test wether item is reachable
|
||||
if ( (pWorldItem[ uiCount ].usFlags & WORLD_ITEM_REACHABLE) && !(pWorldItem[ uiCount ].usFlags & WORLD_ITEM_TABOO_FOR_MILITIA_EQ) )
|
||||
if ( (pWorldItem[ uiCount ].usFlags & WORLD_ITEM_REACHABLE) && !(pWorldItem[ uiCount ].usFlags & usTabooFlag) )
|
||||
{
|
||||
// look for fitting ammo
|
||||
if ( Item[pWorldItem[ uiCount ].object.usItem].usItemClass & IC_GUN && fSearchForAmmo && usSelectedGunBulletCount < usSelectedGunBulletsNeeded )
|
||||
|
||||
@@ -813,8 +813,8 @@ extern OBJECTTYPE gTempObject;
|
||||
|
||||
#define TRIPWIRE_ACTIVATED 0x0000000100000000 // 4294967296
|
||||
#define TAKEN_BY_MILITIA 0x0000000200000000 // 8589934592
|
||||
//#define CORPSE_PANTS_TAN 0x0000000400000000 // 17179869184
|
||||
//#define CORPSE_PANTS_BLACK 0x0000000800000000 // 34359738368
|
||||
#define TAKEN_BY_MILITIA_TABOO_GREEN 0x0000000400000000 // 17179869184 // this item is taboo for green militia (have to reset flag for world item upon dropping it)
|
||||
#define TAKEN_BY_MILITIA_TABOO_BLUE 0x0000000800000000 // 34359738368 // this item is taboo for blue militia (have to reset flag for world item upon dropping it)
|
||||
|
||||
// Flugente TODO 2012-09-17: next time we break savegame compatibility, extend the flagmasks from UINT32 to UINT64. I didn't do it this time (see double-used flag above), as we try to minimise those breaks. But it is needed.
|
||||
// ----------------------------------------------------------------
|
||||
|
||||
@@ -910,6 +910,11 @@ BOOLEAN AddItemsToUnLoadedSector( INT16 sMapX, INT16 sMapY, INT8 bMapZ, INT32 sG
|
||||
|
||||
|
||||
pWorldItems[ cnt ].object = pObject[uiLoop1];
|
||||
|
||||
if ( (*pObject)[uiLoop1]->data.sObjectFlag & TAKEN_BY_MILITIA_TABOO_GREEN )
|
||||
pWorldItems[ cnt ].usFlags |= WORLD_ITEM_TABOO_FOR_MILITIA_EQ_GREEN;
|
||||
if ( (*pObject)[uiLoop1]->data.sObjectFlag & TAKEN_BY_MILITIA_TABOO_BLUE )
|
||||
pWorldItems[ cnt ].usFlags |= WORLD_ITEM_TABOO_FOR_MILITIA_EQ_BLUE;
|
||||
}
|
||||
|
||||
//Save the Items to the the file
|
||||
|
||||
@@ -16,7 +16,11 @@
|
||||
#define WORLD_ITEM_DROPPED_FROM_ENEMY 0x0800
|
||||
|
||||
// Flugente: when equipping militia from inventory, do not consider this item
|
||||
#define WORLD_ITEM_TABOO_FOR_MILITIA_EQ 0x1000
|
||||
#define WORLD_ITEM_TABOO_FOR_MILITIA_EQ_ELITE 0x1000
|
||||
#define WORLD_ITEM_TABOO_FOR_MILITIA_EQ_BLUE 0x2000
|
||||
#define WORLD_ITEM_TABOO_FOR_MILITIA_EQ_GREEN 0x4000
|
||||
|
||||
#define WORLD_ITEM_TABOO_FOR_MILITIA_EQ_ALL 0x7000
|
||||
|
||||
class WORLDITEM;//dnl ch33 120909
|
||||
class _OLD_WORLDITEM;//dnl ch42 280909
|
||||
|
||||
Reference in New Issue
Block a user