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:
+29
-18
@@ -6993,15 +6993,17 @@ UINT32 sGridNo;
|
||||
INT16 sTeleportSpot;
|
||||
INT16 sDoorSpot;
|
||||
UINT8 ubDirection;
|
||||
UINT8 ubRoom, ubOldRoom;
|
||||
//DBrot: More Rooms
|
||||
//UINT8 ubRoom, ubOldRoom;
|
||||
UINT16 usRoom, usOldRoom;
|
||||
|
||||
ubID = WhoIsThere2( sGridNo, 0 );
|
||||
if ( (ubID != NOBODY) && (MercPtrs[ ubID ]->bTeam == gbPlayerNum) )
|
||||
{
|
||||
if ( InARoom( sGridNo, &ubRoom ) && InARoom( MercPtrs[ ubID ]->sOldGridNo, &ubOldRoom ) && ubOldRoom != ubRoom )
|
||||
if ( InARoom( sGridNo, &usRoom ) && InARoom( MercPtrs[ ubID ]->sOldGridNo, &usOldRoom ) && usOldRoom != usRoom )
|
||||
{
|
||||
// also require there to be a miniskirt civ in the room
|
||||
if ( HookerInRoom( ubRoom ) )
|
||||
if ( HookerInRoom( usRoom ) )
|
||||
{
|
||||
|
||||
// stop the merc...
|
||||
@@ -7073,11 +7075,12 @@ UINT32 sGridNo;
|
||||
{
|
||||
if (i == 1 ) sGridNo = lua_tointeger(L,i);
|
||||
}
|
||||
|
||||
UINT8 ubRoom;
|
||||
if ( InAHiddenRoom( sGridNo, &ubRoom ) )
|
||||
//DBrot: More Rooms
|
||||
//UINT8 ubRoom;
|
||||
UINT16 usRoom;
|
||||
if ( InAHiddenRoom( sGridNo, &usRoom ) )
|
||||
{
|
||||
RemoveRoomRoof( sGridNo, ubRoom, NULL );
|
||||
RemoveRoomRoof( sGridNo, usRoom, NULL );
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -7656,16 +7659,18 @@ static int l_PlayerInARoom (lua_State *L)
|
||||
{
|
||||
UINT8 n = lua_gettop(L);
|
||||
int i;
|
||||
UINT8 ubRoom,ubRoom2;
|
||||
//DBrot: More Rooms
|
||||
//UINT8 ubRoom,ubRoom2;
|
||||
UINT16 usRoom, usRoom2;
|
||||
UINT32 sGridNo;
|
||||
BOOLEAN Bool;
|
||||
for (i= 1; i<=n; i++ )
|
||||
{
|
||||
if (i == 1 ) sGridNo = lua_tointeger(L,i);
|
||||
if (i == 2 ) ubRoom2 = lua_tointeger(L,i);
|
||||
if (i == 2 ) usRoom2 = lua_tointeger(L,i);
|
||||
}
|
||||
|
||||
if ( InARoom( sGridNo, &ubRoom ) && ubRoom == ubRoom2 )
|
||||
if ( InARoom( sGridNo, &usRoom ) && usRoom == usRoom2 )
|
||||
{
|
||||
Bool = TRUE;
|
||||
}
|
||||
@@ -9882,17 +9887,21 @@ static int l_NPCInRoomRange (lua_State *L)
|
||||
|
||||
BOOLEAN Bool = FALSE;
|
||||
UINT8 ubProfileID = 0;
|
||||
UINT8 ubRoomID1 = 0;
|
||||
UINT8 ubRoomID2 = 0;
|
||||
//DBrot: More Rooms
|
||||
//UINT8 ubRoomID1 = 0;
|
||||
//UINT8 ubRoomID2 = 0;
|
||||
UINT16 usRoomID1 = 0;
|
||||
UINT16 usRoomID2 = 0;
|
||||
|
||||
|
||||
for (i= 1; i<=n; i++ )
|
||||
{
|
||||
if (i == 1 ) ubProfileID = lua_tointeger(L,i);
|
||||
if (i == 2 ) ubRoomID1 = lua_tointeger(L,i);
|
||||
if (i == 3 ) ubRoomID2 = lua_tointeger(L,i);
|
||||
if (i == 2 ) usRoomID1 = lua_tointeger(L,i);
|
||||
if (i == 3 ) usRoomID2 = lua_tointeger(L,i);
|
||||
}
|
||||
|
||||
Bool = NPCInRoomRange( ubProfileID, ubRoomID1,ubRoomID2 );
|
||||
Bool = NPCInRoomRange( ubProfileID, usRoomID1,usRoomID2 );
|
||||
|
||||
lua_pushboolean(L, Bool);
|
||||
|
||||
@@ -9907,15 +9916,17 @@ static int l_NPCInRoom (lua_State *L)
|
||||
|
||||
BOOLEAN Bool = FALSE;
|
||||
UINT8 ubProfileID = 0;
|
||||
UINT8 ubRoomID = 0;
|
||||
//DBrot: More Rooms
|
||||
//UINT8 ubRoomID = 0;
|
||||
UINT16 usRoomID = 0;
|
||||
|
||||
for (i= 1; i<=n; i++ )
|
||||
{
|
||||
if (i == 1 ) ubProfileID = lua_tointeger(L,i);
|
||||
if (i == 2 ) ubRoomID = lua_tointeger(L,i);
|
||||
if (i == 2 ) usRoomID = lua_tointeger(L,i);
|
||||
}
|
||||
|
||||
Bool = NPCInRoom( ubProfileID, ubRoomID );
|
||||
Bool = NPCInRoom( ubProfileID, usRoomID );
|
||||
|
||||
lua_pushboolean(L, Bool);
|
||||
|
||||
|
||||
@@ -6016,10 +6016,12 @@ BOOLEAN CanCharacterMoveInStrategic( SOLDIERTYPE *pSoldier, INT8 *pbErrorNumber
|
||||
if ( ( pSoldier->sSectorX == 12 ) && ( pSoldier->sSectorY == MAP_ROW_L ) && ( pSoldier->bSectorZ == 0 ) &&
|
||||
( !pSoldier->flags.fBetweenSectors ) && gMercProfiles[ ELDIN ].bMercStatus != MERC_IS_DEAD )
|
||||
{
|
||||
UINT8 ubRoom, cnt;
|
||||
//DBrot: More Rooms
|
||||
UINT8 /*ubRoom,*/ cnt;
|
||||
UINT16 usRoom;
|
||||
SOLDIERTYPE * pSoldier2;
|
||||
|
||||
if ( InARoom( pSoldier->sGridNo, &ubRoom ) && ubRoom >= 22 && ubRoom <= 41 )
|
||||
if ( InARoom( pSoldier->sGridNo, &usRoom ) && usRoom >= 22 && usRoom <= 41 )
|
||||
{
|
||||
|
||||
cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
|
||||
+15
-13
@@ -356,25 +356,25 @@ BOOLEAN CheckNPCIsRPC( UINT8 ubProfileID )
|
||||
}
|
||||
return( (pNPC->ubWhatKindOfMercAmI == MERC_TYPE__NPC ) );
|
||||
}
|
||||
|
||||
BOOLEAN NPCInRoom( UINT8 ubProfileID, UINT8 ubRoomID )
|
||||
//DBrot: More Rooms
|
||||
BOOLEAN NPCInRoom( UINT8 ubProfileID, UINT16 usRoomID )
|
||||
{
|
||||
SOLDIERTYPE * pNPC;
|
||||
|
||||
pNPC = FindSoldierByProfileID( ubProfileID, FALSE );
|
||||
if ( !pNPC || (gubWorldRoomInfo[ pNPC->sGridNo ] != ubRoomID) )
|
||||
if ( !pNPC || (gusWorldRoomInfo[ pNPC->sGridNo ] != usRoomID) )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
BOOLEAN NPCInRoomRange( UINT8 ubProfileID, UINT8 ubRoomID1, UINT8 ubRoomID2 )
|
||||
//DBrot: More Rooms
|
||||
BOOLEAN NPCInRoomRange( UINT8 ubProfileID, UINT16 usRoomID1, UINT16 usRoomID2 )
|
||||
{
|
||||
SOLDIERTYPE * pNPC;
|
||||
|
||||
pNPC = FindSoldierByProfileID( ubProfileID, FALSE );
|
||||
if ( !pNPC || (gubWorldRoomInfo[ pNPC->sGridNo ] < ubRoomID1) || (gubWorldRoomInfo[ pNPC->sGridNo ] > ubRoomID2) )
|
||||
if ( !pNPC || (gusWorldRoomInfo[ pNPC->sGridNo ] < usRoomID1) || (gusWorldRoomInfo[ pNPC->sGridNo ] > usRoomID2) )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
@@ -384,7 +384,9 @@ BOOLEAN NPCInRoomRange( UINT8 ubProfileID, UINT8 ubRoomID1, UINT8 ubRoomID2 )
|
||||
BOOLEAN PCInSameRoom( UINT8 ubProfileID )
|
||||
{
|
||||
SOLDIERTYPE * pNPC;
|
||||
UINT8 ubRoom;
|
||||
//DBrot: More Rooms
|
||||
//UINT8 ubRoom;
|
||||
UINT16 usRoom;
|
||||
INT8 bLoop;
|
||||
SOLDIERTYPE * pSoldier;
|
||||
|
||||
@@ -393,14 +395,14 @@ BOOLEAN PCInSameRoom( UINT8 ubProfileID )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
ubRoom = gubWorldRoomInfo[ pNPC->sGridNo ];
|
||||
usRoom = gusWorldRoomInfo[ pNPC->sGridNo ];
|
||||
|
||||
for ( bLoop = gTacticalStatus.Team[ gbPlayerNum ].bFirstID; bLoop <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; bLoop++ )
|
||||
{
|
||||
pSoldier = MercPtrs[ bLoop ];
|
||||
if ( pSoldier && pSoldier->bActive && pSoldier->bInSector )
|
||||
{
|
||||
if ( gubWorldRoomInfo[ pSoldier->sGridNo ] == ubRoom )
|
||||
if ( gusWorldRoomInfo[ pSoldier->sGridNo ] == usRoom )
|
||||
{
|
||||
return( TRUE );
|
||||
}
|
||||
@@ -790,7 +792,7 @@ BOOLEAN CheckFact( UINT16 usFact, UINT8 ubProfileID )
|
||||
gubFact[FACT_BRENDA_IN_STORE_AND_ALIVE] = FALSE;
|
||||
}
|
||||
// ensure in a building and nearby
|
||||
else if ( !(NPCInRoom( 85, 47 ) ) )
|
||||
else if ( !(NPCInRoom( 85, gModSettings.usPornShopRoomBrenda ) ) )
|
||||
{
|
||||
gubFact[FACT_BRENDA_IN_STORE_AND_ALIVE] = FALSE;
|
||||
}
|
||||
@@ -823,7 +825,7 @@ BOOLEAN CheckFact( UINT16 usFact, UINT8 ubProfileID )
|
||||
gubFact[usFact] = (NumWoundedMercsNearby( ubProfileID ) > 1);
|
||||
break;
|
||||
case FACT_HANS_AT_SPOT:
|
||||
gubFact[usFact] = CheckNPCAt( 117, 13523 );
|
||||
gubFact[usFact] = CheckNPCAt( 117, gModSettings.iHansGridNo );
|
||||
break;
|
||||
case FACT_MULTIPLE_MERCS_CLOSE:
|
||||
gubFact[usFact] = ( NumMercsNear( ubProfileID, 3 ) > 1 );
|
||||
@@ -841,7 +843,7 @@ BOOLEAN CheckFact( UINT16 usFact, UINT8 ubProfileID )
|
||||
gubFact[usFact] = CheckNPCIsEPC( SKYRIDER );
|
||||
break;
|
||||
case FACT_MARIA_ESCORTED_AT_LEATHER_SHOP:
|
||||
gubFact[usFact] = ( CheckNPCIsEPC( MARIA ) && (NPCInRoom( MARIA, 2 )) );
|
||||
gubFact[usFact] = ( CheckNPCIsEPC( MARIA ) && (NPCInRoom( MARIA, gModSettings.usLeatherShop )) );
|
||||
break;
|
||||
case FACT_PC_STRONG_AND_LESS_THAN_3_MALES_PRESENT:
|
||||
gubFact[usFact] = ( CheckTalkerStrong() && (NumMalesPresent( ubProfileID ) < 3) );
|
||||
@@ -1150,7 +1152,7 @@ BOOLEAN CheckFact( UINT16 usFact, UINT8 ubProfileID )
|
||||
break;
|
||||
|
||||
case FACT_TONY_IN_BUILDING:
|
||||
gubFact[usFact] = CheckNPCSector( TONY, 5, MAP_ROW_C, 0 ) && NPCInRoom( TONY, 50 );
|
||||
gubFact[usFact] = CheckNPCSector( TONY, 5, MAP_ROW_C, 0 ) && NPCInRoom( TONY, gModSettings.usPornShopRoomTony );
|
||||
break;
|
||||
|
||||
case FACT_SHANK_SPEAKING:
|
||||
|
||||
+11
-8
@@ -566,14 +566,14 @@ enum Facts
|
||||
#define LOST_SHIPMENT_GRIDNO 2
|
||||
|
||||
// omerta positions
|
||||
#define OMERTA_LEAVE_EQUIP_SECTOR_X 9
|
||||
#define OMERTA_LEAVE_EQUIP_SECTOR_Y 1
|
||||
#define OMERTA_LEAVE_EQUIP_SECTOR_Z 0
|
||||
#define OMERTA_LEAVE_EQUIP_GRIDNO 4868
|
||||
#define OMERTA_LEAVE_EQUIP_SECTOR_X gModSettings.ubOmertaDropOffX //9
|
||||
#define OMERTA_LEAVE_EQUIP_SECTOR_Y gModSettings.ubOmertaDropOffY //1
|
||||
#define OMERTA_LEAVE_EQUIP_SECTOR_Z gModSettings.ubOmertaDropOffZ //0
|
||||
#define OMERTA_LEAVE_EQUIP_GRIDNO gModSettings.iOmertaDropOff //4868
|
||||
|
||||
// NB brothel rooms 88-90 removed because they are the antechamber
|
||||
#define IN_BROTHEL( room ) (gWorldSectorX == 5 && gWorldSectorY == MAP_ROW_C && (room) >= 91 && (room) <= 119)
|
||||
#define IN_BROTHEL_GUARD_ROOM( room ) ( room == 110 )
|
||||
#define IN_BROTHEL( room ) (gWorldSectorX == 5 && gWorldSectorY == MAP_ROW_C && (room) >= gModSettings.usBrothelRoomRangeStart && (room) <= gModSettings.usBrothelRoomRangeEnd) //91,119
|
||||
#define IN_BROTHEL_GUARD_ROOM( room ) ( room == gModSettings.usBrothelGuardRoom ) //110
|
||||
|
||||
#define IN_KINGPIN_HOUSE( room ) ( gWorldSectorX == 5 && gWorldSectorY == MAP_ROW_D && (room) >= 30 && (room) <= 39 )
|
||||
|
||||
@@ -616,8 +616,11 @@ extern BOOLEAN CheckIfMercIsNearNPC( SOLDIERTYPE *pMerc, UINT8 ubProfileId );
|
||||
extern INT8 NumWoundedMercsNearby( UINT8 ubProfileID );
|
||||
extern INT8 NumMercsNear( UINT8 ubProfileID, UINT8 ubMaxDist );
|
||||
extern BOOLEAN CheckNPCIsEPC( UINT8 ubProfileID );
|
||||
extern BOOLEAN NPCInRoom( UINT8 ubProfileID, UINT8 ubRoomID );
|
||||
extern BOOLEAN NPCInRoomRange( UINT8 ubProfileID, UINT8 ubRoomID1, UINT8 ubRoomID2 );
|
||||
//DBrot: More Rooms
|
||||
//extern BOOLEAN NPCInRoom( UINT8 ubProfileID, UINT8 ubRoomID );
|
||||
//extern BOOLEAN NPCInRoomRange( UINT8 ubProfileID, UINT8 ubRoomID1, UINT8 ubRoomID2 );
|
||||
extern BOOLEAN NPCInRoom( UINT8 ubProfileID, UINT16 usRoomID );
|
||||
extern BOOLEAN NPCInRoomRange( UINT8 ubProfileID, UINT16 usRoomID1, UINT16 usRoomID2 );
|
||||
extern BOOLEAN PCInSameRoom( UINT8 ubProfileID );
|
||||
extern INT8 NumMalesPresent( UINT8 ubProfileID );
|
||||
extern BOOLEAN FemalePresent( UINT8 ubProfileID );
|
||||
|
||||
Reference in New Issue
Block a user