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:
Flugente
2012-08-02 22:30:15 +00:00
parent 832335d904
commit 3077e27d9f
65 changed files with 766 additions and 294 deletions
+6 -5
View File
@@ -746,8 +746,9 @@ INT32 RandDestWithinRange(SOLDIERTYPE *pSoldier)
INT16 sMaxLeft, sMaxRight, sMaxUp, sMaxDown, sXRange, sYRange, sXOffset, sYOffset;
INT16 sOrigX, sOrigY;
INT16 sX, sY;
UINT8 ubRoom = 0, ubTempRoom;
//DBrot: More Rooms
//UINT8 ubRoom = 0, ubTempRoom;
UINT16 usRoom = 0, usTempRoom;
sOrigX = sOrigY = -1;
sMaxLeft = sMaxRight = sMaxUp = sMaxDown = sXRange = sYRange = -1;
@@ -768,9 +769,9 @@ INT32 RandDestWithinRange(SOLDIERTYPE *pSoldier)
if ( pSoldier->aiData.bOrders <= CLOSEPATROL && (pSoldier->bTeam == CIV_TEAM || pSoldier->ubProfile != NO_PROFILE ) )
{
// any other combo uses the default of ubRoom == 0, set above
if ( !InARoom( pSoldier->aiData.sPatrolGrid[0], &ubRoom ) )
if ( !InARoom( pSoldier->aiData.sPatrolGrid[0], &usRoom ) )
{
ubRoom = 0;
usRoom = 0;
}
}
@@ -861,7 +862,7 @@ INT32 RandDestWithinRange(SOLDIERTYPE *pSoldier)
}while(!GridNoOnVisibleWorldTile(sRandDest));
}
if ( ubRoom && InARoom( sRandDest, &ubTempRoom ) && ubTempRoom != ubRoom )
if ( usRoom && InARoom( sRandDest, &usTempRoom ) && usTempRoom != usRoom )
{
// outside of room available for patrol!
sRandDest = NOWHERE;
+10 -6
View File
@@ -547,16 +547,18 @@ INT8 DecideActionSchedule( SOLDIERTYPE * pSoldier )
INT8 DecideActionBoxerEnteringRing(SOLDIERTYPE *pSoldier)
{
UINT8 ubRoom;
//DBrot: More Rooms
//UINT8 ubRoom;
UINT16 usRoom;
INT32 sDesiredMercLoc;
UINT8 ubDesiredMercDir;
#ifdef DEBUGDECISIONS
STR16 tempstr;
#endif
// boxer, should move into ring!
if ( InARoom( pSoldier->sGridNo, &ubRoom ))
if ( InARoom( pSoldier->sGridNo, &usRoom ))
{
if (ubRoom == BOXING_RING)
if (usRoom == BOXING_RING)
{
// look towards nearest player
sDesiredMercLoc = ClosestPC( pSoldier, NULL );
@@ -728,13 +730,15 @@ INT8 DecideActionGreen(SOLDIERTYPE *pSoldier)
}
else
{
UINT8 ubRoom;
//DBrot: More Rooms
//UINT8 ubRoom;
UINT16 usRoom;
UINT8 ubLoop;
// boxer... but since in status green, it's time to leave the ring!
if ( InARoom( pSoldier->sGridNo, &ubRoom ))
if ( InARoom( pSoldier->sGridNo, &usRoom ))
{
if (ubRoom == BOXING_RING)
if (usRoom == BOXING_RING)
{
for ( ubLoop = 0; ubLoop < NUM_BOXERS; ubLoop++ )
{
+5 -3
View File
@@ -2295,7 +2295,9 @@ INT32 FindClosestBoxingRingSpot( SOLDIERTYPE * pSoldier, BOOLEAN fInRing )
INT32 sGridNo, sClosestSpot = NOWHERE;
INT32 iDistance, iClosestDistance = 9999;
UINT8 ubRoom;
//DBrot: More Rooms
//UINT8 ubRoom;
UINT16 usRoom;
// set the distance limit of the square region
iSearchRange = 7;
@@ -2323,9 +2325,9 @@ INT32 FindClosestBoxingRingSpot( SOLDIERTYPE * pSoldier, BOOLEAN fInRing )
{
// calculate the next potential gridno
sGridNo = pSoldier->sGridNo + sXOffset + (MAXCOL * sYOffset);
if ( InARoom( sGridNo, &ubRoom ))
if ( InARoom( sGridNo, &usRoom ))
{
if ( (fInRing && ubRoom == BOXING_RING) || (!fInRing && ubRoom != BOXING_RING ) && LegalNPCDestination(pSoldier,sGridNo,IGNORE_PATH,NOWATER,0) )
if ( (fInRing && usRoom == BOXING_RING) || (!fInRing && usRoom != BOXING_RING ) && LegalNPCDestination(pSoldier,sGridNo,IGNORE_PATH,NOWATER,0) )
{
iDistance = abs( sXOffset ) + abs( sYOffset );
if ( iDistance < iClosestDistance && WhoIsThere2( sGridNo, 0 ) == NOBODY )
+5 -3
View File
@@ -281,12 +281,14 @@ INT32 MostImportantNoiseHeard( SOLDIERTYPE *pSoldier, INT32 *piRetValue, BOOLEAN
// make civs not walk to noises outside their room if on close patrol/onguard
if ( pSoldier->aiData.bOrders <= CLOSEPATROL && (pSoldier->bTeam == CIV_TEAM || pSoldier->ubProfile != NO_PROFILE ) )
{
UINT8 ubRoom, ubNewRoom;
//DBrot: More Rooms
//UINT8 ubRoom, ubNewRoom;
UINT16 usRoom, usNewRoom;
// any other combo uses the default of ubRoom == 0, set above
if ( InARoom( pSoldier->aiData.sPatrolGrid[0], &ubRoom ) )
if ( InARoom( pSoldier->aiData.sPatrolGrid[0], &usRoom ) )
{
if ( !InARoom( pSoldier->aiData.sPatrolGrid[0], &ubNewRoom ) || ubRoom != ubNewRoom )
if ( !InARoom( pSoldier->aiData.sPatrolGrid[0], &usNewRoom ) || usRoom != usNewRoom )
{
*pfReachable = FALSE;
}
+7 -5
View File
@@ -451,7 +451,9 @@ INT32 InternalGoAsFarAsPossibleTowards(SOLDIERTYPE *pSoldier, INT32 sDesGrid, IN
UINT16 usMaxDist;
UINT8 ubDirection,ubDirsLeft,ubDirChecked[8],fFound = FALSE;
INT8 bAPsLeft, fPathFlags;
UINT8 ubRoomRequired = 0, ubTempRoom;
//DBrot: More Rooms
//UINT8 ubRoomRequired = 0, ubTempRoom;
UINT16 usRoomRequired = 0, usTempRoom;
BOOLEAN fAllowDest = FALSE;
// 0verhaul: Make sure to clear the stored path since this always calculates a new one.
@@ -478,12 +480,12 @@ INT32 InternalGoAsFarAsPossibleTowards(SOLDIERTYPE *pSoldier, INT32 sDesGrid, IN
if ( pSoldier->aiData.bOrders <= CLOSEPATROL && (pSoldier->bTeam == CIV_TEAM || pSoldier->ubProfile != NO_PROFILE ) )
{
if ( InARoom( pSoldier->aiData.sPatrolGrid[0], &ubRoomRequired ) )
if ( InARoom( pSoldier->aiData.sPatrolGrid[0], &usRoomRequired ) )
{
// make sure this doesn't interfere with pathing for scripts
if (!TileIsOutOfBounds(pSoldier->sAbsoluteFinalDestination))
{
ubRoomRequired = 0;
usRoomRequired = 0;
}
}
}
@@ -662,9 +664,9 @@ INT32 InternalGoAsFarAsPossibleTowards(SOLDIERTYPE *pSoldier, INT32 sDesGrid, IN
break; // quit here, sGoToGrid is where we are going
if ( ubRoomRequired )
if ( usRoomRequired )
{
if ( !( InARoom( sTempDest, &ubTempRoom ) && ubTempRoom == ubRoomRequired ) )
if ( !( InARoom( sTempDest, &usTempRoom ) && usTempRoom == usRoomRequired ) )
{
// quit here, limited by room!
break;
+5 -3
View File
@@ -1152,12 +1152,14 @@ UINT8 NPCConsiderReceivingItemFromMerc( UINT8 ubNPC, UINT8 ubMerc, OBJECTTYPE *
{
// find Kingpin, if he's in his house, invoke the script to move him to the bar
SOLDIERTYPE * pKingpin;
UINT8 ubKingpinRoom;
//DBrot: More Rooms
//UINT8 ubKingpinRoom;
UINT16 usKingpinRoom;
pKingpin = FindSoldierByProfileID( KINGPIN, FALSE );
if ( pKingpin && InARoom( pKingpin->sGridNo, &ubKingpinRoom ) )
if ( pKingpin && InARoom( pKingpin->sGridNo, &usKingpinRoom ) )
{
if ( IN_KINGPIN_HOUSE( ubKingpinRoom ) )
if ( IN_KINGPIN_HOUSE( usKingpinRoom ) )
{
// first boxer, bring kingpin over
(*ppResultQuoteInfo) = &pNPCQuoteInfoArray[17];
+9 -4
View File
@@ -17,6 +17,7 @@
#include "NPC.h"
#include "Render Fun.h"
#include "Quests.h"
#include "GameSettings.h"
#endif
INT8 RTPlayerDecideAction( SOLDIERTYPE * pSoldier )
@@ -99,9 +100,11 @@ UINT16 RealtimeDelay( SOLDIERTYPE * pSoldier )
if ( pSoldier->ubCivilianGroup == KINGPIN_CIV_GROUP )
{
UINT8 ubRoom;
//DBrot: More Rooms
//UINT8 ubRoom;
UINT16 usRoom;
if ( InARoom( pSoldier->sGridNo, &ubRoom ) && IN_BROTHEL( ubRoom ) )
if ( InARoom( pSoldier->sGridNo, &usRoom ) && IN_BROTHEL( usRoom ) )
{
return( (UINT16) (REALTIME_AI_DELAY / 3) );
}
@@ -256,9 +259,11 @@ void RTHandleAI( SOLDIERTYPE * pSoldier )
pSoldier->aiData.usActionData = (UINT16) REALTIME_AI_DELAY;
if ( pSoldier->ubCivilianGroup == KINGPIN_CIV_GROUP )
{
UINT8 ubRoom;
//DBrot: More Rooms
//UINT8 ubRoom;
UINT16 usRoom;
if ( InARoom( pSoldier->sGridNo, &ubRoom ) && IN_BROTHEL( ubRoom ) )
if ( InARoom( pSoldier->sGridNo, &usRoom ) && IN_BROTHEL( usRoom ) )
{
pSoldier->aiData.usActionData /= 3;
}