mirror of
https://github.com/1dot13/source.git
synced 2026-08-26 14:30:26 +02:00
New feature (by DepressivesBrot): Molle Items
- individual LBE gear can be created via MOLLE items. For each LBE item, there's a definition which pockets may be changed and how much space the new pockets may take up in total. - If there's a free pocket slot and enough space -> attach item and enable pocket. - for further description, see Doc/Design Document- MOLLE.txt git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5441 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+16
-8
@@ -39,7 +39,9 @@ extern void RecalculateOppCntsDueToBecomingNeutral( SOLDIERTYPE * pSoldier );
|
||||
|
||||
void ExitBoxing( void )
|
||||
{
|
||||
UINT8 ubRoom;
|
||||
//DBrot: More Rooms
|
||||
//UINT8 ubRoom;
|
||||
UINT16 usRoom;
|
||||
SOLDIERTYPE * pSoldier;
|
||||
UINT32 uiLoop;
|
||||
UINT8 ubPass;
|
||||
@@ -57,7 +59,7 @@ void ExitBoxing( void )
|
||||
|
||||
if ( pSoldier != NULL )
|
||||
{
|
||||
if ( ( pSoldier->flags.uiStatusFlags & SOLDIER_BOXER ) && InARoom( pSoldier->sGridNo, &ubRoom ) && ubRoom == BOXING_RING )
|
||||
if ( ( pSoldier->flags.uiStatusFlags & SOLDIER_BOXER ) && InARoom( pSoldier->sGridNo, &usRoom ) && usRoom == BOXING_RING )
|
||||
{
|
||||
if ( pSoldier->flags.uiStatusFlags & SOLDIER_PC )
|
||||
{
|
||||
@@ -182,7 +184,9 @@ UINT8 CountPeopleInBoxingRing( void )
|
||||
{
|
||||
SOLDIERTYPE * pSoldier;
|
||||
UINT32 uiLoop;
|
||||
UINT8 ubRoom;
|
||||
//DBrot: More Rooms
|
||||
//UINT8 ubRoom;
|
||||
UINT16 usRoom;
|
||||
UINT8 ubTotalInRing = 0;
|
||||
|
||||
for ( uiLoop = 0; uiLoop < guiNumMercSlots; uiLoop++ )
|
||||
@@ -191,7 +195,7 @@ UINT8 CountPeopleInBoxingRing( void )
|
||||
|
||||
if ( pSoldier != NULL )
|
||||
{
|
||||
if ( InARoom( pSoldier->sGridNo, &ubRoom ) && ubRoom == BOXING_RING)
|
||||
if ( InARoom( pSoldier->sGridNo, &usRoom ) && usRoom == BOXING_RING)
|
||||
{
|
||||
ubTotalInRing++;
|
||||
}
|
||||
@@ -205,7 +209,9 @@ void CountPeopleInBoxingRingAndDoActions( void )
|
||||
{
|
||||
UINT32 uiLoop;
|
||||
UINT8 ubTotalInRing = 0;
|
||||
UINT8 ubRoom;
|
||||
//DBrot: More Rooms
|
||||
//UINT8 ubRoom;
|
||||
UINT16 usRoom;
|
||||
UINT8 ubPlayersInRing = 0;
|
||||
SOLDIERTYPE * pSoldier;
|
||||
SOLDIERTYPE * pInRing[2] = { NULL, NULL };
|
||||
@@ -217,7 +223,7 @@ void CountPeopleInBoxingRingAndDoActions( void )
|
||||
|
||||
if ( pSoldier != NULL )
|
||||
{
|
||||
if ( InARoom( pSoldier->sGridNo, &ubRoom ) && ubRoom == BOXING_RING)
|
||||
if ( InARoom( pSoldier->sGridNo, &usRoom ) && usRoom == BOXING_RING)
|
||||
{
|
||||
if ( ubTotalInRing < 2 )
|
||||
{
|
||||
@@ -488,9 +494,11 @@ BOOLEAN AnotherFightPossible( void )
|
||||
|
||||
void BoxingMovementCheck( SOLDIERTYPE * pSoldier )
|
||||
{
|
||||
UINT8 ubRoom;
|
||||
//DBrot: More Rooms
|
||||
//UINT8 ubRoom;
|
||||
UINT16 usRoom;
|
||||
|
||||
if ( InARoom( pSoldier->sGridNo, &ubRoom ) && ubRoom == BOXING_RING)
|
||||
if ( InARoom( pSoldier->sGridNo, &usRoom ) && usRoom == BOXING_RING)
|
||||
{
|
||||
// someone moving in/into the ring
|
||||
CountPeopleInBoxingRingAndDoActions();
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "ai.h"
|
||||
#include "Soldier macros.h"
|
||||
#include "Event Pump.h"
|
||||
#include "GameSettings.h"
|
||||
#endif
|
||||
#include "fresh_header.h"
|
||||
#include "connect.h"
|
||||
@@ -433,10 +434,12 @@ void InteractWithOpenableStruct( SOLDIERTYPE *pSoldier, STRUCTURE *pStructure, U
|
||||
|
||||
void ProcessImplicationsOfPCMessingWithDoor( SOLDIERTYPE * pSoldier )
|
||||
{
|
||||
UINT8 ubRoom;
|
||||
//DBrot: More Rooms
|
||||
//UINT8 ubRoom;
|
||||
UINT16 usRoom;
|
||||
SOLDIERTYPE * pGoon;
|
||||
// if player is hacking at a door in the brothel and a kingpin guy can see him
|
||||
if ( (InARoom( pSoldier->sGridNo, &ubRoom ) && IN_BROTHEL( ubRoom )) || (gWorldSectorX == 5 && gWorldSectorY == MAP_ROW_D && gbWorldSectorZ == 0 && (pSoldier->sGridNo == 11010 || pSoldier->sGridNo == 11177 || pSoldier->sGridNo == 11176 ) ) )
|
||||
if ( (InARoom( pSoldier->sGridNo, &usRoom ) && IN_BROTHEL( usRoom )) || (gWorldSectorX == 5 && gWorldSectorY == MAP_ROW_D && gbWorldSectorZ == 0 && (pSoldier->sGridNo == gModSettings.iBrothelDoor1 || pSoldier->sGridNo == gModSettings.iBrothelDoor2 || pSoldier->sGridNo == gModSettings.iBrothelDoor3 ) ) )//11010,11177,11176
|
||||
{
|
||||
UINT8 ubLoop;
|
||||
|
||||
|
||||
@@ -4410,7 +4410,9 @@ INT32 AdjustGridNoForItemPlacement( SOLDIERTYPE *pSoldier, INT32 sGridNo )
|
||||
|
||||
void StartBombMessageBox( SOLDIERTYPE * pSoldier, INT32 sGridNo )
|
||||
{
|
||||
UINT8 ubRoom;
|
||||
//DBrot: More Rooms
|
||||
//UINT8 ubRoom;
|
||||
UINT16 usRoom;
|
||||
|
||||
gpTempSoldier = pSoldier;
|
||||
gsTempGridNo = sGridNo;
|
||||
@@ -4436,7 +4438,7 @@ void StartBombMessageBox( SOLDIERTYPE * pSoldier, INT32 sGridNo )
|
||||
// Check what sector we are in....
|
||||
if ( gWorldSectorX == 3 && gWorldSectorY == MAP_ROW_O && gbWorldSectorZ == 0 )
|
||||
{
|
||||
if ( InARoom( pSoldier->sGridNo, &ubRoom ) && ubRoom == 4 )
|
||||
if ( InARoom( pSoldier->sGridNo, &usRoom ) && usRoom == 4 )
|
||||
{
|
||||
pSoldier->DoMercBattleSound( BATTLE_SOUND_OK1 );
|
||||
|
||||
|
||||
@@ -986,7 +986,9 @@ void SetUIMouseCursor( )
|
||||
if ( gfUIShowExitExitGrid )
|
||||
{
|
||||
INT32 usMapPos;
|
||||
UINT8 ubRoomNum;
|
||||
//DBrot: More Rooms
|
||||
//UINT8 ubRoomNum;
|
||||
UINT16 usRoomNum;
|
||||
|
||||
gfUIDisplayActionPoints = FALSE;
|
||||
ErasePath( TRUE );
|
||||
@@ -996,7 +998,7 @@ void SetUIMouseCursor( )
|
||||
if ( gusSelectedSoldier != NOBODY && MercPtrs[ gusSelectedSoldier ]->pathing.bLevel == 0 )
|
||||
{
|
||||
// ATE: Is this place revealed?
|
||||
if ( !InARoom( usMapPos, &ubRoomNum ) || ( InARoom( usMapPos, &ubRoomNum ) && gpWorldLevelData[ usMapPos ].uiFlags & MAPELEMENT_REVEALED ) )
|
||||
if ( !InARoom( usMapPos, &usRoomNum ) || ( InARoom( usMapPos, &usRoomNum ) && gpWorldLevelData[ usMapPos ].uiFlags & MAPELEMENT_REVEALED ) )
|
||||
{
|
||||
if ( sOldExitGridNo != usMapPos )
|
||||
{
|
||||
|
||||
@@ -1876,7 +1876,7 @@ void HandleNPCDoAction( UINT8 ubTargetNPC, UINT16 usActionCode, UINT8 ubQuoteNum
|
||||
SetGroupSectorValue( gModSettings.ubHideoutSectorX, gModSettings.ubHideoutSectorY, gModSettings.ubHideoutSectorZ, pSoldier->ubGroupID );
|
||||
|
||||
// Set insertion gridno
|
||||
if ( bNumDone < 6 )
|
||||
if ( bNumDone < 10 )
|
||||
{
|
||||
// Set next sectore
|
||||
//DBrot: Grids
|
||||
@@ -2167,7 +2167,7 @@ void HandleNPCDoAction( UINT8 ubTargetNPC, UINT16 usActionCode, UINT8 ubQuoteNum
|
||||
SetGroupSectorValue( gModSettings.ubHideoutSurfaceX, gModSettings.ubHideoutSurfaceY, gModSettings.ubHideoutSurfaceZ, pSoldier->ubGroupID );
|
||||
|
||||
// Set insertion gridno
|
||||
if ( bNumDone < 8 )
|
||||
if ( bNumDone < 12 )
|
||||
{
|
||||
// Set next sectore
|
||||
pSoldier->sSectorX = gModSettings.ubHideoutSurfaceX;
|
||||
@@ -2511,25 +2511,25 @@ void HandleNPCDoAction( UINT8 ubTargetNPC, UINT16 usActionCode, UINT8 ubQuoteNum
|
||||
case NPC_ACTION_OPEN_CARLAS_DOOR:
|
||||
if (usActionCode == NPC_ACTION_OPEN_CARLAS_DOOR )
|
||||
{
|
||||
sGridNo = 12290; //dnl!!!
|
||||
sGridNo = gModSettings.iCarlaDoorGridNo; //12290; //dnl!!!
|
||||
}
|
||||
// fall through
|
||||
case NPC_ACTION_OPEN_CINDYS_DOOR:
|
||||
if (usActionCode == NPC_ACTION_OPEN_CINDYS_DOOR )
|
||||
{
|
||||
sGridNo = 13413; //dnl!!!
|
||||
sGridNo = gModSettings.iCindyDoorGridNo; //13413; //dnl!!!
|
||||
}
|
||||
// fall through
|
||||
case NPC_ACTION_OPEN_BAMBIS_DOOR:
|
||||
if (usActionCode == NPC_ACTION_OPEN_BAMBIS_DOOR )
|
||||
{
|
||||
sGridNo = 11173; //dnl!!!
|
||||
sGridNo = gModSettings.iBambiDoorGridNo; //11173; //dnl!!!
|
||||
}
|
||||
// fall through
|
||||
case NPC_ACTION_OPEN_MARIAS_DOOR:
|
||||
if (usActionCode == NPC_ACTION_OPEN_MARIAS_DOOR )
|
||||
{
|
||||
sGridNo = 10852; //dnl!!!
|
||||
sGridNo = gModSettings.iMariaDoorGridNo; //10852; //dnl!!!
|
||||
}
|
||||
// JA3Gold: unlock the doors instead of opening them
|
||||
{
|
||||
@@ -3235,9 +3235,11 @@ void HandleNPCDoAction( UINT8 ubTargetNPC, UINT16 usActionCode, UINT8 ubQuoteNum
|
||||
pSoldier = FindSoldierByProfileID( KINGPIN, FALSE );
|
||||
if (pSoldier)
|
||||
{
|
||||
UINT8 ubRoom;
|
||||
//DBrot: More Rooms
|
||||
//UINT8 ubRoom;
|
||||
UINT16 usRoom;
|
||||
|
||||
if ( InARoom( pSoldier->sGridNo, &ubRoom ) && (ubRoom == 1 || ubRoom == 2 || ubRoom == 3 ) )
|
||||
if ( InARoom( pSoldier->sGridNo, &usRoom ) && (usRoom == 1 || usRoom == 2 || usRoom == 3 ) )
|
||||
{ // Kingpin is in the club
|
||||
TriggerNPCRecord( DARREN, 31 );
|
||||
break;
|
||||
@@ -4286,9 +4288,11 @@ void HandleNPCDoAction( UINT8 ubTargetNPC, UINT16 usActionCode, UINT8 ubQuoteNum
|
||||
{
|
||||
if ( gpSrcSoldier )
|
||||
{
|
||||
UINT8 ubRoom;
|
||||
//DBrot: More Rooms
|
||||
//UINT8 ubRoom;
|
||||
UINT16 usRoom;
|
||||
|
||||
if ( InARoom( gpSrcSoldier->sGridNo, &ubRoom ) && (ubRoom == 49) )
|
||||
if ( InARoom( gpSrcSoldier->sGridNo, &usRoom ) && (usRoom == gModSettings.usPornShopRoomHans) )
|
||||
{
|
||||
TriggerNPCRecord( HANS, 18 );
|
||||
}
|
||||
|
||||
@@ -742,11 +742,13 @@ void InitDescStatCoords(OBJECTTYPE *pObject)
|
||||
//Loop throught the attachments and get their slot id's
|
||||
for (UINT8 x = 0; x < usAttachmentSlotIndexVector.size(); x++){
|
||||
//WarmSteel - Tell this slot where it's supposed to be.
|
||||
|
||||
if(AttachmentSlots[usAttachmentSlotIndexVector[x]].fBigSlot){
|
||||
SetupItemDescAttachmentsXY(x, AttachmentSlots[usAttachmentSlotIndexVector[x]].usDescPanelPosX, AttachmentSlots[usAttachmentSlotIndexVector[x]].usDescPanelPosY, SM_INV_SLOT_HEIGHT, ATTACH_SLOT_BIG_WIDTH, INV_BAR_DX-9, INV_BAR_DY);
|
||||
} else {
|
||||
SetupItemDescAttachmentsXY(x, AttachmentSlots[usAttachmentSlotIndexVector[x]].usDescPanelPosX, AttachmentSlots[usAttachmentSlotIndexVector[x]].usDescPanelPosY, SM_INV_SLOT_HEIGHT, ATTACH_SLOT_WIDTH, INV_BAR_DX-9, INV_BAR_DY);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
//Not a valid item for NAS, use default
|
||||
@@ -766,11 +768,13 @@ void InitDescStatCoords(OBJECTTYPE *pObject)
|
||||
{
|
||||
for (UINT8 x = 0; x < usAttachmentSlotIndexVector.size(); x++){
|
||||
//WarmSteel - Tell this slot where it's supposed to be.
|
||||
|
||||
if(AttachmentSlots[usAttachmentSlotIndexVector[x]].fBigSlot){
|
||||
SetupItemDescAttachmentsXY(x, AttachmentSlots[usAttachmentSlotIndexVector[x]].usDescPanelPosX, AttachmentSlots[usAttachmentSlotIndexVector[x]].usDescPanelPosY, SM_INV_SLOT_HEIGHT, ATTACH_SLOT_BIG_WIDTH, INV_BAR_DX-9, INV_BAR_DY);
|
||||
} else {
|
||||
SetupItemDescAttachmentsXY(x, AttachmentSlots[usAttachmentSlotIndexVector[x]].usDescPanelPosX, AttachmentSlots[usAttachmentSlotIndexVector[x]].usDescPanelPosY, SM_INV_SLOT_HEIGHT, ATTACH_SLOT_WIDTH, INV_BAR_DX-9, INV_BAR_DY);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
//Not a valid item for NAS, use default
|
||||
|
||||
@@ -1041,7 +1041,7 @@ void GenerateConsString( STR16 zItemCons, OBJECTTYPE * pObject, UINT32 uiPixLimi
|
||||
BOOLEAN UseNASDesc(OBJECTTYPE *pObject){
|
||||
if(pObject->exists() == FALSE)
|
||||
return FALSE;
|
||||
if(guiCurrentScreen == MAP_SCREEN && Item[pObject->usItem].usItemClass == IC_LBEGEAR && UsingNewAttachmentSystem()==true)
|
||||
if(guiCurrentScreen == MAP_SCREEN && Item[pObject->usItem].usItemClass == IC_LBEGEAR && UsingNewAttachmentSystem()==true && gGameSettings.fOptions[TOPTION_SHOW_LBE_CONTENT])
|
||||
return FALSE; // the map screen can't support NAS and LBEGEAR.
|
||||
return (/*Item[pObject->usItem].usItemClass != IC_LBEGEAR && Item[pObject->usItem].usItemClass != IC_MONEY && */UsingNewAttachmentSystem()==true);
|
||||
}
|
||||
@@ -2521,10 +2521,15 @@ void INVRenderINVPanelItem( SOLDIERTYPE *pSoldier, INT16 sPocket, UINT8 fDirtyLe
|
||||
case VEST_PACK:
|
||||
case COMBAT_PACK:
|
||||
case BACKPACK:
|
||||
lbePocket =
|
||||
(pSoldier->inv[icLBE[sPocket]].exists() == false)
|
||||
? LoadBearingEquipment[Item[icDefault[sPocket]].ubClassIndex].lbePocketIndex[icPocket[sPocket]]
|
||||
: LoadBearingEquipment[Item[pSoldier->inv[icLBE[sPocket]].usItem].ubClassIndex].lbePocketIndex[icPocket[sPocket]];
|
||||
|
||||
if(pSoldier->inv[icLBE[sPocket]].exists() == false){
|
||||
lbePocket = LoadBearingEquipment[Item[icDefault[sPocket]].ubClassIndex].lbePocketIndex[icPocket[sPocket]];
|
||||
}else{
|
||||
lbePocket = LoadBearingEquipment[Item[pSoldier->inv[icLBE[sPocket]].usItem].ubClassIndex].lbePocketIndex[icPocket[sPocket]];
|
||||
if( lbePocket == 0 && LoadBearingEquipment[Item[pSoldier->inv[icLBE[sPocket]].usItem].ubClassIndex].lbePocketsAvailable & (UINT16)pow((double)2, icPocket[sPocket])){
|
||||
lbePocket = GetPocketFromAttachment(&pSoldier->inv[icLBE[sPocket]], icPocket[sPocket]);
|
||||
}
|
||||
}
|
||||
iClass = Item[pSoldier->inv[sPocket].usItem].usItemClass;
|
||||
if(icLBE[sPocket] == BPACKPOCKPOS && !(pSoldier->flags.ZipperFlag) && (gTacticalStatus.uiFlags & INCOMBAT))
|
||||
lbePocket = 0;
|
||||
@@ -6305,6 +6310,9 @@ INT8 DetermineShowLBE( )
|
||||
if (iResolution >= _640x480 && iResolution < _800x600)
|
||||
return -1;
|
||||
|
||||
if(!gGameSettings.fOptions[TOPTION_SHOW_LBE_CONTENT] && guiCurrentItemDescriptionScreen == MAP_SCREEN)
|
||||
return -1;
|
||||
|
||||
if(!UsingNewInventorySystem())
|
||||
{
|
||||
return -1;
|
||||
@@ -6684,8 +6692,9 @@ void RenderItemDescriptionBox( )
|
||||
|
||||
// CHRISL: This block will display misc information for items stored in LBE Pockets
|
||||
// Display LBENODE attached items
|
||||
if(UsingNewInventorySystem() == true && Item[gpItemDescObject->usItem].usItemClass == IC_LBEGEAR)
|
||||
if(UsingNewInventorySystem() == true && Item[gpItemDescObject->usItem].usItemClass == IC_LBEGEAR && (gGameSettings.fOptions[TOPTION_SHOW_LBE_CONTENT] || guiCurrentItemDescriptionScreen != MAP_SCREEN))
|
||||
{
|
||||
|
||||
RenderLBENODEItems( gpItemDescObject, gubItemDescStatusIndex );
|
||||
}
|
||||
|
||||
|
||||
+11
-2
@@ -657,7 +657,7 @@ extern OBJECTTYPE gTempObject;
|
||||
#define AC_DEFUSE 0x00200000 //2097152 // defuse item for bombs
|
||||
#define AC_IRONSIGHT 0x00400000 //4194304 // for attachable Iron Sights
|
||||
#define AC_FEEDER 0x00800000 //8388608 // allow external feeding
|
||||
#define AC_MISC13 0x01000000 //16777216
|
||||
#define AC_MODPOUCH 0x01000000 //16777216 // for new modular pouches
|
||||
#define AC_MISC14 0x02000000 //33554432
|
||||
#define AC_MISC15 0x04000000 //67108864
|
||||
#define AC_MISC16 0x08000000 //134217728
|
||||
@@ -1027,8 +1027,12 @@ public:
|
||||
UINT32 lbeClass;
|
||||
UINT32 lbeCombo;
|
||||
UINT8 lbeFilledSize;
|
||||
//DBrot: MOLLE
|
||||
UINT8 lbeAvailableVolume;
|
||||
UINT16 lbePocketsAvailable;
|
||||
char POD;
|
||||
std::vector<UINT8> lbePocketIndex;
|
||||
|
||||
};
|
||||
#define SIZEOF_LBETYPE offsetof( LBETYPE, POD )
|
||||
extern std::vector<LBETYPE> LoadBearingEquipment;
|
||||
@@ -1039,7 +1043,8 @@ typedef enum eLBE_CLASS // Designation of lbeClass
|
||||
COMBAT_PACK,
|
||||
BACKPACK,
|
||||
LBE_POCKET,
|
||||
OTHER_POCKET
|
||||
OTHER_POCKET,
|
||||
MOD_POCKET //DBrot: added mod_pocket to identify modular pouches
|
||||
};
|
||||
|
||||
|
||||
@@ -1054,6 +1059,8 @@ public:
|
||||
UINT8 pSilhouette;
|
||||
UINT16 pType;
|
||||
UINT32 pRestriction;
|
||||
//DBrot: MOLLE
|
||||
UINT8 pVolume;
|
||||
char POD;
|
||||
std::vector<UINT8> ItemCapacityPerSize;
|
||||
};
|
||||
@@ -1541,6 +1548,8 @@ typedef struct
|
||||
UINT16 usDescPanelPosY;
|
||||
BOOLEAN fMultiShot;
|
||||
BOOLEAN fBigSlot;
|
||||
//DBrot: MOLLE
|
||||
UINT8 ubPocketMapping;
|
||||
} AttachmentSlotStruct;
|
||||
|
||||
extern AttachmentSlotStruct AttachmentSlots[MAXITEMS+1];
|
||||
|
||||
+60
-2
@@ -1489,8 +1489,11 @@ UINT8 ItemSlotLimit( OBJECTTYPE * pObject, INT16 bSlot, SOLDIERTYPE *pSoldier, B
|
||||
}
|
||||
else {
|
||||
pIndex = LoadBearingEquipment[Item[pSoldier->inv[icLBE[bSlot]].usItem].ubClassIndex].lbePocketIndex[icPocket[bSlot]];
|
||||
if( pIndex == 0 && LoadBearingEquipment[Item[pSoldier->inv[icLBE[bSlot]].usItem].ubClassIndex].lbePocketsAvailable & (UINT16)pow((double)2, icPocket[bSlot])){
|
||||
pIndex = GetPocketFromAttachment(&pSoldier->inv[icLBE[bSlot]], icPocket[bSlot]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//We need to actually check the size of the largest stored item as well as the size of the current item
|
||||
if(cntAttach == TRUE)
|
||||
@@ -2243,7 +2246,7 @@ UINT8 AttachmentAPCost( UINT16 usAttachment, OBJECTTYPE * pObj, SOLDIERTYPE * pS
|
||||
//in the slot we're trying to attach to.
|
||||
BOOLEAN ValidItemAttachmentSlot( OBJECTTYPE * pObj, UINT16 usAttachment, BOOLEAN fAttemptingAttachment, BOOLEAN fDisplayMessage, UINT8 subObject, INT16 slotCount, BOOLEAN fIgnoreAttachmentInSlot, OBJECTTYPE ** ppAttachInSlot, std::vector<UINT16> usAttachmentSlotIndexVector)
|
||||
{
|
||||
BOOLEAN fSimilarItems = FALSE, fSameItem = FALSE;
|
||||
BOOLEAN fSimilarItems = FALSE, fSameItem = FALSE, fNoSpace = FALSE;
|
||||
UINT16 usSimilarItem = NOTHING;
|
||||
INT16 ubSlotIndex = 0;
|
||||
INT32 iLoop2 = 0;
|
||||
@@ -2275,11 +2278,18 @@ BOOLEAN ValidItemAttachmentSlot( OBJECTTYPE * pObj, UINT16 usAttachment, BOOLEAN
|
||||
{
|
||||
for(int i = 0;i<sizeof(IncompatibleAttachments);i++)
|
||||
{
|
||||
if ( FindAttachment(pObj, usAttachment, subObject) != 0 && !IsAttachmentClass(usAttachment, AC_GRENADE|AC_ROCKET ) )
|
||||
if ( FindAttachment(pObj, usAttachment, subObject) != 0 && !IsAttachmentClass(usAttachment, AC_GRENADE|AC_ROCKET|AC_MODPOUCH ) )
|
||||
{//Search for identical attachments unless we're dealing with rifle grenades
|
||||
//DBrot: or pouches
|
||||
fSameItem = TRUE;
|
||||
break;
|
||||
}
|
||||
if (Item[pObj->usItem].usItemClass == IC_LBEGEAR && Item[usAttachment].usItemClass == IC_LBEGEAR){
|
||||
if(LoadBearingEquipment[Item[pObj->usItem].ubClassIndex].lbeAvailableVolume < (GetVolumeAlreadyTaken(pObj) + LBEPocketType[LoadBearingEquipment[Item[usAttachment].ubClassIndex].lbePocketIndex[0]].pVolume)){
|
||||
fNoSpace = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ( IncompatibleAttachments[i][0] == NONE )
|
||||
break;
|
||||
if ( IncompatibleAttachments[i][0] == usAttachment && FindAttachment (pObj,IncompatibleAttachments[i][1],subObject) != 0 )
|
||||
@@ -2363,6 +2373,11 @@ BOOLEAN ValidItemAttachmentSlot( OBJECTTYPE * pObj, UINT16 usAttachment, BOOLEAN
|
||||
if (fDisplayMessage) ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_UI_FEEDBACK, Message[ STR_ATTACHMENT_ALREADY ] );
|
||||
return( FALSE );
|
||||
}
|
||||
else if (fNoSpace)
|
||||
{ //DBrot: TODO - temporary string
|
||||
if (fDisplayMessage) ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_UI_FEEDBACK, Message[ STR_ATTACHMENT_ALREADY ] );
|
||||
return( FALSE );
|
||||
}
|
||||
else if ( !foundValidAttachment && fDisplayMessage && !ValidMerge( usAttachment, pObj->usItem ) )
|
||||
{
|
||||
//We don't want a message if we might be merging this little thingey later.
|
||||
@@ -5361,7 +5376,15 @@ std::vector<UINT16> GetItemSlots(OBJECTTYPE* pObj, UINT8 subObject, BOOLEAN fAtt
|
||||
magSize--;
|
||||
else if(AttachmentSlots[sCount].fMultiShot)
|
||||
continue;
|
||||
|
||||
if(Item[pObj->usItem].usItemClass == IC_LBEGEAR && AttachmentSlots[sCount].ubPocketMapping > 0){
|
||||
if(LoadBearingEquipment[Item[pObj->usItem].ubClassIndex].lbePocketsAvailable & (UINT16)pow((double)2, AttachmentSlots[sCount].ubPocketMapping - 1)){
|
||||
tempItemSlots.push_back(AttachmentSlots[sCount].uiSlotIndex);
|
||||
}
|
||||
}else{
|
||||
tempItemSlots.push_back(AttachmentSlots[sCount].uiSlotIndex);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if(slotSize == tempItemSlots.size()){ //we didn't find a layout specific slot so try to find a default layout slot
|
||||
@@ -5991,6 +6014,10 @@ BOOLEAN CanItemFitInPosition( SOLDIERTYPE *pSoldier, OBJECTTYPE *pObj, INT8 bPos
|
||||
if(icLBE[bPos] == BPACKPOCKPOS && (!(pSoldier->flags.ZipperFlag) || (pSoldier->flags.ZipperFlag && gAnimControl[pSoldier->usAnimState].ubEndHeight == ANIM_STAND)) && (gTacticalStatus.uiFlags & INCOMBAT))
|
||||
return( FALSE );
|
||||
lbePocket = (pSoldier->inv[icLBE[bPos]].exists() == false) ? LoadBearingEquipment[Item[icDefault[bPos]].ubClassIndex].lbePocketIndex[icPocket[bPos]] : LoadBearingEquipment[Item[pSoldier->inv[icLBE[bPos]].usItem].ubClassIndex].lbePocketIndex[icPocket[bPos]];
|
||||
if( lbePocket == 0 && LoadBearingEquipment[Item[pSoldier->inv[icLBE[bPos]].usItem].ubClassIndex].lbePocketsAvailable & (UINT16)pow((double)2, icPocket[bPos])){
|
||||
lbePocket = GetPocketFromAttachment(&pSoldier->inv[icLBE[bPos]], icPocket[bPos]);
|
||||
}
|
||||
|
||||
pRestrict = LBEPocketType[lbePocket].pRestriction;
|
||||
if(pRestrict != 0)
|
||||
if(!(pRestrict & Item[pObj->usItem].usItemClass))
|
||||
@@ -13570,6 +13597,37 @@ BOOLEAN HasAttachmentOfClass( OBJECTTYPE * pObj, UINT32 aFlag )
|
||||
|
||||
return( FALSE );
|
||||
}
|
||||
//DBrot: calculate the volume already taken up by other pouches attached to this carrier
|
||||
UINT8 GetVolumeAlreadyTaken(OBJECTTYPE * pObj){
|
||||
UINT8 sum=0;
|
||||
if ( pObj->exists() )
|
||||
{
|
||||
// check all attachments
|
||||
attachmentList::iterator iterend = (*pObj)[0]->attachments.end();
|
||||
for (attachmentList::iterator iter = (*pObj)[0]->attachments.begin(); iter != iterend; ++iter)
|
||||
{
|
||||
if ( iter->exists() && Item[iter->usItem].usItemClass == IC_LBEGEAR){
|
||||
sum += LBEPocketType[LoadBearingEquipment[Item[iter->usItem].ubClassIndex].lbePocketIndex[0]].pVolume;
|
||||
}
|
||||
}
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
//DBrot: search the attachments for a pocket
|
||||
INT16 GetPocketFromAttachment(OBJECTTYPE * pObj, UINT8 pMap){
|
||||
std::vector<UINT16> usAttachmentSlotIndexVector = GetItemSlots(pObj);
|
||||
OBJECTTYPE* pAttachment; // = (*pObject)[ubStatusIndex]->GetAttachmentAtIndex(slotCount);
|
||||
UINT16 slotCount;
|
||||
for (slotCount = 0; slotCount < usAttachmentSlotIndexVector.size(); slotCount++ ){
|
||||
if(AttachmentSlots[usAttachmentSlotIndexVector[slotCount]].ubPocketMapping -1 == pMap){
|
||||
pAttachment = (*pObj)[0]->GetAttachmentAtIndex(slotCount);
|
||||
if(pAttachment->exists() && Item[pAttachment->usItem].usItemClass == IC_LBEGEAR){
|
||||
return(LoadBearingEquipment[Item[pAttachment->usItem].ubClassIndex].lbePocketIndex[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
extern void HandleSight(SOLDIERTYPE *pSoldier, UINT8 ubSightFlags);
|
||||
|
||||
@@ -478,4 +478,7 @@ OBJECTTYPE* GetExternalFeedingObject(SOLDIERTYPE* pSoldier, OBJECTTYPE * pObject
|
||||
|
||||
BOOLEAN DeductBulletViaExternalFeeding(SOLDIERTYPE* pSoldier, OBJECTTYPE * pObject);
|
||||
|
||||
//DBrot: get the volume of all attached pouches
|
||||
UINT8 GetVolumeAlreadyTaken(OBJECTTYPE * pObj);
|
||||
INT16 GetPocketFromAttachment(OBJECTTYPE * pObj, UINT8 pMap);
|
||||
#endif
|
||||
|
||||
@@ -172,8 +172,9 @@ extern void SetSoldierAniSpeed( SOLDIERTYPE *pSoldier );
|
||||
extern void HandleExplosionQueue( void );
|
||||
extern void UpdateForContOverPortrait( SOLDIERTYPE *pSoldier, BOOLEAN fOn );
|
||||
extern void HandleSystemNewAISituation( SOLDIERTYPE *pSoldier, BOOLEAN fResetABC );
|
||||
|
||||
extern BOOLEAN NPCInRoom( UINT8 ubProfileID, UINT8 ubRoomID );
|
||||
//DBrot: More Rooms
|
||||
//extern BOOLEAN NPCInRoom( UINT8 ubProfileID, UINT8 ubRoomID );
|
||||
extern BOOLEAN NPCInRoom( UINT8 ubProfileID, UINT16 usRoomID );
|
||||
|
||||
extern INT8 gbInvalidPlacementSlot[ NUM_INV_SLOTS ];
|
||||
|
||||
|
||||
@@ -2971,6 +2971,9 @@ INT16 GetAPsToReadyWeapon( SOLDIERTYPE *pSoldier, UINT16 usAnimState )
|
||||
//{
|
||||
//return( APBPConstants[AP_READY_DUAL] );
|
||||
//}
|
||||
if ( AM_A_ROBOT( pSoldier ) && gGameExternalOptions.fRobotNoReadytime);
|
||||
return 0;
|
||||
|
||||
if ( pSoldier->IsValidSecondHandShot( ) )
|
||||
{
|
||||
//Madd: return the greater of the two weapons + 1:
|
||||
|
||||
@@ -1122,10 +1122,11 @@ void AddCrowToCorpse( ROTTING_CORPSE *pCorpse )
|
||||
INT32 sGridNo;
|
||||
UINT8 ubDirection;
|
||||
SOLDIERTYPE *pSoldier;
|
||||
UINT8 ubRoomNum;
|
||||
|
||||
//DBrot: More Rooms
|
||||
//UINT8 ubRoomNum;
|
||||
UINT16 usRoomNum;
|
||||
// No crows inside :(
|
||||
if ( InARoom( pCorpse->def.sGridNo, &ubRoomNum ) )
|
||||
if ( InARoom( pCorpse->def.sGridNo, &usRoomNum ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -948,7 +948,9 @@ INT32 FindRandomGridNoFromSweetSpot( SOLDIERTYPE *pSoldier, INT32 sSweetGridNo,
|
||||
INT32 sTop, sBottom;
|
||||
INT32 sLeft, sRight;
|
||||
INT32 cnt1, cnt2;
|
||||
UINT8 ubRoomNum;
|
||||
//DBrot: More Rooms
|
||||
//UINT8 ubRoomNum;
|
||||
UINT16 usRoomNum;
|
||||
|
||||
//Save AI pathing vars. changing the distlimit restricts how
|
||||
//far away the pathing will consider.
|
||||
@@ -1006,7 +1008,7 @@ INT32 FindRandomGridNoFromSweetSpot( SOLDIERTYPE *pSoldier, INT32 sSweetGridNo,
|
||||
// If we are a crow, we need this additional check
|
||||
if ( pSoldier->ubBodyType == CROW )
|
||||
{
|
||||
if ( !InARoom( sGridNo, &ubRoomNum ) )
|
||||
if ( !InARoom( sGridNo, &usRoomNum ) )
|
||||
{
|
||||
fFound = TRUE;
|
||||
}
|
||||
|
||||
@@ -1272,7 +1272,7 @@ MERCPROFILESTRUCT& MERCPROFILESTRUCT::operator=(const OLD_MERCPROFILESTRUCT_101&
|
||||
|
||||
memcpy( &(this->bBuddy), &(src.bBuddy), 5 * sizeof (UINT8));
|
||||
memcpy( &(this->bHated), &(src.bHated), 5 * sizeof (UINT8));
|
||||
memcpy( &(this->ubRoomRangeStart), &(src.ubRoomRangeStart), 2 * sizeof (UINT8));
|
||||
memcpy( &(this->usRoomRangeStart), &(src.ubRoomRangeStart), 2 * sizeof (UINT8));
|
||||
memcpy( &(this->bMercTownReputation), &(src.bMercTownReputation), 20 * sizeof (INT8));
|
||||
memcpy( &(this->usApproachFactor), &(src.usApproachFactor), 4 * sizeof (UINT16));
|
||||
|
||||
@@ -1282,7 +1282,7 @@ MERCPROFILESTRUCT& MERCPROFILESTRUCT::operator=(const OLD_MERCPROFILESTRUCT_101&
|
||||
|
||||
memcpy( &(this->usStatChangeChances), &(src.usStatChangeChances), 12 * sizeof (UINT16));// used strictly for balancing, never shown!
|
||||
memcpy( &(this->usStatChangeSuccesses), &(src.usStatChangeSuccesses), 12 * sizeof (UINT16));// used strictly for balancing, never shown!
|
||||
memcpy( &(this->ubRoomRangeEnd), &(src.ubRoomRangeEnd), 2 * sizeof (UINT8));
|
||||
memcpy( &(this->usRoomRangeEnd), &(src.ubRoomRangeEnd), 2 * sizeof (UINT8));
|
||||
memcpy( &(this->bHatedTime), &(src.bHatedTime), 5 * sizeof (INT8));
|
||||
memcpy( &(this->bHatedCount), &(src.bHatedCount), 5 * sizeof (INT8));
|
||||
|
||||
|
||||
@@ -661,7 +661,9 @@ BOOLEAN AddPlacementToWorld( SOLDIERINITNODE *curr, GROUP *pGroup = NULL )
|
||||
// quest-related overrides
|
||||
if ( gWorldSectorX == 5 && gWorldSectorY == MAP_ROW_C )
|
||||
{
|
||||
UINT8 ubRoom;
|
||||
//DBrot: More rooms
|
||||
//UINT8 ubRoom;
|
||||
UINT16 usRoom;
|
||||
|
||||
// Kinpin guys might be guarding Tony
|
||||
if ( tempDetailedPlacement.ubCivilianGroup == KINGPIN_CIV_GROUP && ( gTacticalStatus.fCivGroupHostile[ KINGPIN_CIV_GROUP ] == CIV_GROUP_WILL_BECOME_HOSTILE || ( (gubQuest[ QUEST_KINGPIN_MONEY ] == QUESTINPROGRESS) && (CheckFact( FACT_KINGPIN_CAN_SEND_ASSASSINS, KINGPIN )) ) ) )
|
||||
@@ -700,7 +702,7 @@ BOOLEAN AddPlacementToWorld( SOLDIERINITNODE *curr, GROUP *pGroup = NULL )
|
||||
// she shouldn't be here!
|
||||
return( TRUE );
|
||||
}
|
||||
else if ( tempDetailedPlacement.ubProfile == NO_PROFILE && InARoom( tempDetailedPlacement.sInsertionGridNo, &ubRoom ) && IN_BROTHEL( ubRoom ) )
|
||||
else if ( tempDetailedPlacement.ubProfile == NO_PROFILE && InARoom( tempDetailedPlacement.sInsertionGridNo, &usRoom ) && IN_BROTHEL( usRoom ) )
|
||||
{
|
||||
// must be a hooker, shouldn't be there
|
||||
return( TRUE );
|
||||
|
||||
@@ -2235,12 +2235,14 @@ SOLDIERTYPE * SwapLarrysProfiles( SOLDIERTYPE * pSoldier )
|
||||
|
||||
BOOLEAN DoesNPCOwnBuilding( SOLDIERTYPE *pSoldier, INT32 sGridNo )
|
||||
{
|
||||
UINT8 ubRoomInfo;
|
||||
//DBrot: More Rooms
|
||||
//UINT8 ubRoomInfo;
|
||||
UINT16 usRoomInfo;
|
||||
|
||||
// Get room info
|
||||
ubRoomInfo = gubWorldRoomInfo[ sGridNo ];
|
||||
usRoomInfo = gusWorldRoomInfo[ sGridNo ];
|
||||
|
||||
if ( ubRoomInfo == NO_ROOM )
|
||||
if ( usRoomInfo == NO_ROOM )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
@@ -2252,14 +2254,14 @@ BOOLEAN DoesNPCOwnBuilding( SOLDIERTYPE *pSoldier, INT32 sGridNo )
|
||||
}
|
||||
|
||||
// OK, check both ranges
|
||||
if ( ubRoomInfo >= gMercProfiles[ pSoldier->ubProfile ].ubRoomRangeStart[ 0 ] &&
|
||||
ubRoomInfo <= gMercProfiles[ pSoldier->ubProfile ].ubRoomRangeEnd[ 0 ] )
|
||||
if ( usRoomInfo >= gMercProfiles[ pSoldier->ubProfile ].usRoomRangeStart[ 0 ] &&
|
||||
usRoomInfo <= gMercProfiles[ pSoldier->ubProfile ].usRoomRangeEnd[ 0 ] )
|
||||
{
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
if ( ubRoomInfo >= gMercProfiles[ pSoldier->ubProfile ].ubRoomRangeStart[ 1 ] &&
|
||||
ubRoomInfo <= gMercProfiles[ pSoldier->ubProfile ].ubRoomRangeEnd[ 1 ] )
|
||||
if ( usRoomInfo >= gMercProfiles[ pSoldier->ubProfile ].usRoomRangeStart[ 1 ] &&
|
||||
usRoomInfo <= gMercProfiles[ pSoldier->ubProfile ].usRoomRangeEnd[ 1 ] )
|
||||
{
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ attachmentslotStartElementHandle(void *userData, const XML_Char *name, const XML
|
||||
|
||||
pData->maxReadDepth++; //we are not skipping this element
|
||||
}
|
||||
//DBrot: MOLLE new tag
|
||||
else if(pData->curElement == ELEMENT &&
|
||||
(strcmp(name, "uiSlotIndex") == 0 ||
|
||||
strcmp(name, "szSlotName") == 0 ||
|
||||
@@ -58,6 +59,7 @@ attachmentslotStartElementHandle(void *userData, const XML_Char *name, const XML
|
||||
strcmp(name, "usDescPanelPosX") == 0 ||
|
||||
strcmp(name, "usDescPanelPosY") == 0 ||
|
||||
strcmp(name, "fMultiShot") == 0 ||
|
||||
strcmp(name, "ubPocketMapping") == 0 ||
|
||||
strcmp(name, "fBigSlot") == 0 ))
|
||||
{
|
||||
pData->curElement = ELEMENT_PROPERTY;
|
||||
@@ -139,6 +141,12 @@ attachmentslotEndElementHandle(void *userData, const XML_Char *name)
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curAttachmentSlot.usDescPanelPosY = (UINT16) atol(pData->szCharData);
|
||||
}
|
||||
//DBrot: MOLLE
|
||||
else if(strcmp(name, "ubPocketMapping") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curAttachmentSlot.ubPocketMapping = (UINT8) atol(pData->szCharData);
|
||||
}
|
||||
else if(strcmp(name, "fMultiShot") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
@@ -252,8 +260,10 @@ BOOLEAN WriteAttachmentSlotsStats()
|
||||
FilePrintf(hFile,"\t\t<usDescPanelPosX>%d</usDescPanelPosX>\r\n", AttachmentSlots[cnt].usDescPanelPosX );
|
||||
FilePrintf(hFile,"\t\t<usDescPanelPosY>%d</usDescPanelPosY>\r\n", AttachmentSlots[cnt].usDescPanelPosY );
|
||||
FilePrintf(hFile,"\t\t<fMultiShot>%d</fMultiShot>\r\n", AttachmentSlots[cnt].fMultiShot );
|
||||
//DBrot: MOLLE
|
||||
FilePrintf(hFile,"\t\t<ubPocketMapping>%d</ubPocketMapping>\r\n", AttachmentSlots[cnt].ubPocketMapping );
|
||||
FilePrintf(hFile,"\t\t<fBigSlot>%d</fBigSlot>\r\n", AttachmentSlots[cnt].fBigSlot );
|
||||
|
||||
|
||||
FilePrintf(hFile,"\t</ATTACHMENTSLOT>\r\n");
|
||||
}
|
||||
FilePrintf(hFile,"</ATTACHMENTSLOTLIST>\r\n");
|
||||
|
||||
@@ -93,13 +93,14 @@ lbepocketStartElementHandle(void *userData, const XML_Char *name, const XML_Char
|
||||
pData->curLBEPocket = POCKETTYPE();
|
||||
|
||||
pData->maxReadDepth++; //we are not skipping this element
|
||||
}
|
||||
}//DBrot: MOLLE added tag
|
||||
else if(pData->curElement == ELEMENT &&
|
||||
(strcmp(name, "pIndex") == 0 ||
|
||||
strcmp(name, "pName") == 0 ||
|
||||
strcmp(name, "pSilhouette") == 0 ||
|
||||
strcmp(name, "pType") == 0 ||
|
||||
strcmp(name, "pRestriction") == 0 ||
|
||||
strcmp(name, "pVolume") == 0 ||
|
||||
lbepocketStartElementHandleLoop(name, pData)))
|
||||
/* JMich - These are no longer needed
|
||||
strcmp(name, "ItemCapacityPerSize.0") == 0 || strcmp(name, "ItemCapacityPerSize0") == 0 ||
|
||||
@@ -219,7 +220,13 @@ lbepocketParseData * pData = (lbepocketParseData *)userData;
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curLBEPocket.pRestriction = (UINT32) atol(pData->szCharData);
|
||||
} //Tais fixed this.
|
||||
} //DBrot: MOLLE added tag
|
||||
else if(strcmp(name, "pVolume") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curLBEPocket.pVolume = (UINT8) atol(pData->szCharData);
|
||||
}
|
||||
//Tais fixed this.
|
||||
else
|
||||
{ //DBrot: Enhanced parsing routine to avoid excessive load times for larger (~1000) numbers of item sizes
|
||||
//-test the prefix if we have an "ItemCapacityPerSize###" tag
|
||||
@@ -543,6 +550,8 @@ BOOLEAN WriteLBEPocketEquipmentStats()
|
||||
FilePrintf(hFile,"\t\t<pSilhouette>%d</pSilhouette>\r\n", LBEPocketType[cnt].pSilhouette );
|
||||
FilePrintf(hFile,"\t\t<pType>%d</pType>\r\n", LBEPocketType[cnt].pType );
|
||||
FilePrintf(hFile,"\t\t<pRestriction>%d</pRestriction>\r\n", LBEPocketType[cnt].pRestriction );
|
||||
//DBrot: MOLLE
|
||||
FilePrintf(hFile,"\t\t<pVolume>%d</pVolume>\r\n", LBEPocketType[cnt].pVolume );
|
||||
for(i=0;i<=gGameExternalOptions.guiMaxItemSize;i++) //JMich
|
||||
{
|
||||
FilePrintf(hFile,"\t\t<ItemCapacityPerSize%d>%d</ItemCapacityPerSize%d>\r\n", i,LBEPocketType[cnt].ItemCapacityPerSize[i],i );
|
||||
|
||||
@@ -40,12 +40,13 @@ lbeStartElementHandle(void *userData, const XML_Char *name, const XML_Char **att
|
||||
pData->curLBE = LBETYPE();
|
||||
|
||||
pData->maxReadDepth++; //we are not skipping this element
|
||||
}
|
||||
}//DBrot: MOLLE added tag
|
||||
else if(pData->curElement == ELEMENT &&
|
||||
(strcmp(name, "lbeIndex") == 0 ||
|
||||
strcmp(name, "lbeClass") == 0 ||
|
||||
strcmp(name, "lbeCombo") == 0 ||
|
||||
strcmp(name, "lbeFilledSize") == 0 ||
|
||||
strcmp(name, "lbeAvailableVolume") == 0 ||
|
||||
strcmp(name, "lbePocketIndex.1") == 0 || strcmp(name, "lbePocketIndex1") == 0 ||
|
||||
strcmp(name, "lbePocketIndex.2") == 0 || strcmp(name, "lbePocketIndex2") == 0 ||
|
||||
strcmp(name, "lbePocketIndex.3") == 0 || strcmp(name, "lbePocketIndex3") == 0 ||
|
||||
@@ -57,7 +58,9 @@ lbeStartElementHandle(void *userData, const XML_Char *name, const XML_Char **att
|
||||
strcmp(name, "lbePocketIndex.9") == 0 || strcmp(name, "lbePocketIndex9") == 0 ||
|
||||
strcmp(name, "lbePocketIndex.10") == 0 || strcmp(name, "lbePocketIndex10") == 0 ||
|
||||
strcmp(name, "lbePocketIndex.11") == 0 || strcmp(name, "lbePocketIndex11") == 0 ||
|
||||
strcmp(name, "lbePocketIndex.12") == 0 || strcmp(name, "lbePocketIndex12") == 0 ))
|
||||
strcmp(name, "lbePocketIndex.12") == 0 || strcmp(name, "lbePocketIndex12") == 0 ||
|
||||
|
||||
strcmp(name, "lbePocketsAvailable") == 0))
|
||||
{
|
||||
pData->curElement = ELEMENT_PROPERTY;
|
||||
|
||||
@@ -120,6 +123,12 @@ lbeEndElementHandle(void *userData, const XML_Char *name)
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curLBE.lbeFilledSize = (UINT8) atol(pData->szCharData);
|
||||
}
|
||||
//DBrot: MOLLE
|
||||
else if(strcmp(name, "lbeAvailableVolume") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curLBE.lbeAvailableVolume = (UINT8) atol(pData->szCharData);
|
||||
}
|
||||
else if(strcmp(name, "lbePocketIndex.1") == 0 || strcmp(name, "lbePocketIndex1") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
@@ -180,7 +189,14 @@ lbeEndElementHandle(void *userData, const XML_Char *name)
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curLBE.lbePocketIndex[11] = (UINT8) atol(pData->szCharData);
|
||||
}
|
||||
|
||||
|
||||
|
||||
else if(strcmp(name, "lbePocketsAvailable") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curLBE.lbePocketsAvailable = (UINT16) atol(pData->szCharData);
|
||||
}
|
||||
|
||||
pData->maxReadDepth--;
|
||||
}
|
||||
|
||||
@@ -269,13 +285,14 @@ BOOLEAN WritelbeEquipmentStats()
|
||||
FilePrintf(hFile,"<LOADBEARINGEQUIPMENTLIST>\r\n");
|
||||
for(cnt = 0;cnt < MAXITEMS;cnt++)
|
||||
{
|
||||
|
||||
//DBrot: MOLLE
|
||||
FilePrintf(hFile,"\t<LOADBEARINGEQUIPMENT>\r\n");
|
||||
|
||||
FilePrintf(hFile,"\t\t<lbeIndex>%d</lbeIndex>\r\n", cnt );
|
||||
FilePrintf(hFile,"\t\t<lbeClass>%d</lbeClass>\r\n", LoadBearingEquipment[cnt].lbeClass );
|
||||
FilePrintf(hFile,"\t\t<lbeCombo>%d</lbeCombo>\r\n", LoadBearingEquipment[cnt].lbeCombo );
|
||||
FilePrintf(hFile,"\t\t<lbeFilledSize>%d</lbeFilledSize>\r\n", LoadBearingEquipment[cnt].lbeFilledSize );
|
||||
FilePrintf(hFile,"\t\t<lbeAvailableVolume>%d</lbeAvailableVolume>\r\n", LoadBearingEquipment[cnt].lbeAvailableVolume );
|
||||
FilePrintf(hFile,"\t\t<lbePocketIndex1>%d</lbePocketIndex1>\r\n", LoadBearingEquipment[cnt].lbePocketIndex[0] );
|
||||
FilePrintf(hFile,"\t\t<lbePocketIndex2>%d</lbePocketIndex2>\r\n", LoadBearingEquipment[cnt].lbePocketIndex[1] );
|
||||
FilePrintf(hFile,"\t\t<lbePocketIndex3>%d</lbePocketIndex3>\r\n", LoadBearingEquipment[cnt].lbePocketIndex[2] );
|
||||
@@ -289,6 +306,8 @@ BOOLEAN WritelbeEquipmentStats()
|
||||
FilePrintf(hFile,"\t\t<lbePocketIndex11>%d</lbePocketIndex11>\r\n", LoadBearingEquipment[cnt].lbePocketIndex[10] );
|
||||
FilePrintf(hFile,"\t\t<lbePocketIndex12>%d</lbePocketIndex12>\r\n", LoadBearingEquipment[cnt].lbePocketIndex[11] );
|
||||
|
||||
FilePrintf(hFile,"\t\t<lbePocketsAvailable>%d</lbePocketsAvailable>\r\n", LoadBearingEquipment[cnt].lbePocketsAvailable);
|
||||
|
||||
FilePrintf(hFile,"\t</LOADBEARINGEQUIPMENT>\r\n");
|
||||
}
|
||||
FilePrintf(hFile,"</LOADBEARINGEQUIPMENTLIST>\r\n");
|
||||
|
||||
+7
-5
@@ -301,7 +301,9 @@ void RevealRoofsAndItems(SOLDIERTYPE *pSoldier, UINT32 itemsToo, BOOLEAN fShowLo
|
||||
INT8 nextDir=0;
|
||||
UINT8 who; //,itemIndex; // for each square checked
|
||||
UINT8 dir,range,Path2;
|
||||
UINT8 ubRoomNo;
|
||||
//DBrot: More Rooms
|
||||
//UINT8 ubRoomNo;
|
||||
UINT16 usRoomNo;
|
||||
BOOLEAN fCheckForRooms = FALSE;
|
||||
ITEM_POOL *pItemPool;
|
||||
BOOLEAN fHiddenStructVisible;
|
||||
@@ -841,7 +843,7 @@ void RevealRoofsAndItems(SOLDIERTYPE *pSoldier, UINT32 itemsToo, BOOLEAN fShowLo
|
||||
// OK, if we are underground, we don't want to reveal stuff if
|
||||
// 1 ) there is a roof over us and
|
||||
// 2 ) we are not in a room
|
||||
if ( gubWorldRoomInfo[ marker ] == NO_ROOM && TypeRangeExistsInRoofLayer( marker, FIRSTROOF, FOURTHROOF, &usIndex ) )
|
||||
if ( gusWorldRoomInfo[ marker ] == NO_ROOM && TypeRangeExistsInRoofLayer( marker, FIRSTROOF, FOURTHROOF, &usIndex ) )
|
||||
{
|
||||
int i = 0;
|
||||
}
|
||||
@@ -862,10 +864,10 @@ void RevealRoofsAndItems(SOLDIERTYPE *pSoldier, UINT32 itemsToo, BOOLEAN fShowLo
|
||||
// CHECK FOR ROOMS
|
||||
//if ( fCheckForRooms )
|
||||
{
|
||||
if ( InAHiddenRoom( marker, &ubRoomNo ) )
|
||||
if ( InAHiddenRoom( marker, &usRoomNo ) )
|
||||
{
|
||||
RemoveRoomRoof( marker, ubRoomNo, pSoldier );
|
||||
if ( ubRoomNo == ROOM_SURROUNDING_BOXING_RING && gWorldSectorX == BOXING_SECTOR_X && gWorldSectorY == BOXING_SECTOR_Y && gbWorldSectorZ == BOXING_SECTOR_Z )
|
||||
RemoveRoomRoof( marker, usRoomNo, pSoldier );
|
||||
if ( usRoomNo == ROOM_SURROUNDING_BOXING_RING && gWorldSectorX == BOXING_SECTOR_X && gWorldSectorY == BOXING_SECTOR_Y && gbWorldSectorZ == BOXING_SECTOR_Z )
|
||||
{
|
||||
// reveal boxing ring at same time
|
||||
RemoveRoomRoof( marker, BOXING_RING, pSoldier );
|
||||
|
||||
+15
-9
@@ -1784,9 +1784,11 @@ void HandleManNoLongerSeen( SOLDIERTYPE * pSoldier, SOLDIERTYPE * pOpponent, INT
|
||||
|
||||
if ( (pSoldier->ubCivilianGroup == KINGPIN_CIV_GROUP) && (pOpponent->bTeam == gbPlayerNum ) )
|
||||
{
|
||||
UINT8 ubRoom;
|
||||
//DBrot: More Rooms
|
||||
//UINT8 ubRoom;
|
||||
UINT16 usRoom;
|
||||
|
||||
if ( InARoom( pOpponent->sGridNo, &ubRoom ) && IN_BROTHEL( ubRoom ) && ( IN_BROTHEL_GUARD_ROOM( ubRoom ) ) )
|
||||
if ( InARoom( pOpponent->sGridNo, &usRoom ) && IN_BROTHEL( usRoom ) && ( IN_BROTHEL_GUARD_ROOM( usRoom ) ) )
|
||||
{
|
||||
// unauthorized!
|
||||
// make guard run to block guard room
|
||||
@@ -2256,12 +2258,14 @@ void ManSeesMan(SOLDIERTYPE *pSoldier, SOLDIERTYPE *pOpponent, INT32 sOppGridNo,
|
||||
case ELDIN:
|
||||
if ( pSoldier->aiData.bNeutral )
|
||||
{
|
||||
UINT8 ubRoom = 0;
|
||||
//DBrot: More Rooms
|
||||
//UINT8 ubRoom = 0;
|
||||
UINT16 usRoom = 0;
|
||||
// if player is in behind the ropes of the museum display
|
||||
// or if alarm has gone off (status red)
|
||||
InARoom( pOpponent->sGridNo, &ubRoom );
|
||||
InARoom( pOpponent->sGridNo, &usRoom );
|
||||
|
||||
if ( ( CheckFact( FACT_MUSEUM_OPEN, 0 ) == FALSE && ubRoom >= 22 && ubRoom <= 41 ) || CheckFact( FACT_MUSEUM_ALARM_WENT_OFF, 0 ) || ( ubRoom == 39 || ubRoom == 40 ) || ( FindObj( pOpponent, CHALICE ) != NO_SLOT ) )
|
||||
if ( ( CheckFact( FACT_MUSEUM_OPEN, 0 ) == FALSE && usRoom >= 22 && usRoom <= 41 ) || CheckFact( FACT_MUSEUM_ALARM_WENT_OFF, 0 ) || ( usRoom == 39 || usRoom == 40 ) || ( FindObj( pOpponent, CHALICE ) != NO_SLOT ) )
|
||||
{
|
||||
SetFactTrue( FACT_MUSEUM_ALARM_WENT_OFF );
|
||||
AddToShouldBecomeHostileOrSayQuoteList( pSoldier->ubID );
|
||||
@@ -2375,11 +2379,13 @@ void ManSeesMan(SOLDIERTYPE *pSoldier, SOLDIERTYPE *pOpponent, INT32 sOppGridNo,
|
||||
}
|
||||
else
|
||||
{
|
||||
UINT8 ubRoom;
|
||||
//DBrot: More Rooms
|
||||
//UINT8 ubRoom;
|
||||
UINT16 usRoom;
|
||||
|
||||
// JA2 Gold: only go hostile if see player IN guard room
|
||||
//if ( InARoom( pOpponent->sGridNo, &ubRoom ) && IN_BROTHEL( ubRoom ) && ( gMercProfiles[ MADAME ].bNPCData == 0 || IN_BROTHEL_GUARD_ROOM( ubRoom ) ) )
|
||||
if ( InARoom( pOpponent->sGridNo, &ubRoom ) && IN_BROTHEL_GUARD_ROOM( ubRoom ) )
|
||||
if ( InARoom( pOpponent->sGridNo, &usRoom ) && IN_BROTHEL_GUARD_ROOM( usRoom ) )
|
||||
{
|
||||
// unauthorized!
|
||||
MakeCivHostile( pSoldier, 2 );
|
||||
@@ -4318,12 +4324,12 @@ void DebugSoldierPage2( )
|
||||
ubLine++;
|
||||
}
|
||||
|
||||
if (gubWorldRoomInfo[ usMapPos ] != NO_ROOM )
|
||||
if (gusWorldRoomInfo[ usMapPos ] != NO_ROOM )
|
||||
{
|
||||
SetFontColors(COLOR2);
|
||||
mprintf( 0, LINE_HEIGHT * ubLine, L"Room Number" );
|
||||
SetFontColors(COLOR2);
|
||||
mprintf( 150, LINE_HEIGHT * ubLine, L"%d", gubWorldRoomInfo[ usMapPos ] );
|
||||
mprintf( 150, LINE_HEIGHT * ubLine, L"%d", gusWorldRoomInfo[ usMapPos ] );
|
||||
ubLine++;
|
||||
}
|
||||
|
||||
|
||||
@@ -724,7 +724,9 @@ public:
|
||||
INT8 bMechanical;
|
||||
|
||||
UINT8 ubInvUndroppable;
|
||||
UINT8 ubRoomRangeStart[2];
|
||||
//DBrot: More Rooms
|
||||
//UINT8 ubRoomRangeStart[2];
|
||||
UINT16 usRoomRangeStart[2];
|
||||
INT8 bMercTownReputation[ 20 ];
|
||||
|
||||
UINT16 usStatChangeChances[ 12 ]; // used strictly for balancing, never shown!
|
||||
@@ -732,7 +734,8 @@ public:
|
||||
|
||||
UINT8 ubStrategicInsertionCode;
|
||||
|
||||
UINT8 ubRoomRangeEnd[2];
|
||||
//UINT8 ubRoomRangeEnd[2];
|
||||
UINT16 usRoomRangeEnd[2];
|
||||
|
||||
UINT8 ubLastQuoteSaid;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user