1. PItems are now variable, from 3-20 and can be set in JA2Options.ini via NUM_P_ITEMS

2. USE_XML_TILESETS moved from JA2.ini to JA2Options.ini
3. New Feature - Ctrl+Click on an item with an item in hand to auto-attach/merge them.  Attach works with stacks.  Merge only works on single items, for now at least.
4. New Feature - To accompany Quiet Training, there are now Quiet Repairing and Quiet Doctoring options.
5. Bugfix - inseparable attachments of attachments were getting lost again when using ctrl+f/the map screen button to remove attachments
6. Bugfix - INT8 overflow error causing vehicle repair to actually lower its status
7. GasMask tag in items.xml can now be applied to helmets as well as face items.
8. Bugfix - AI code was referencing hard coded GASMASK item number instead of looking for the tag
9. Bugfix - "break;" was removed in Explosion Control.cpp, thereby causing mustard gas to deal out fire damage. (Not sure if this was deliberate?  But the new implementation differs from the JA2 standard, so it should be added to JA2Options.ini at least)

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5320 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
MaddMugsy
2012-05-30 10:19:53 +00:00
parent 67fee5f14f
commit 49a590ed34
37 changed files with 427 additions and 208 deletions
+2 -2
View File
@@ -1339,7 +1339,7 @@ L02: //remove any FIRSTCLIFFHANG if on same tile already exist FIRSTCLIFF
while(pStruct)
{
// Skip cached tiles
if(pStruct->usIndex >= NUMBEROFTILES)
if(pStruct->usIndex >= giNumberOfTiles)
{
pStruct = pStruct->pNext;
continue;
@@ -1552,7 +1552,7 @@ void RaiseWorldLandOld(void)//dnl ch3 230909
while( pStruct )
{
// Skip cached tiles
if (pStruct->usIndex >= NUMBEROFTILES)
if (pStruct->usIndex >= giNumberOfTiles)
{
pStruct = pStruct->pNext;
continue;
+12
View File
@@ -231,6 +231,8 @@ BOOLEAN LoadGameSettings()
gGameSettings.fOptions[TOPTION_TRACKING_MODE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_TRACKING_MODE" , TRUE );
gGameSettings.fOptions[TOPTION_DISABLE_CURSOR_SWAP] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_DISABLE_CURSOR_SWAP" , FALSE );
gGameSettings.fOptions[TOPTION_QUIET_TRAINING] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_QUIET_TRAINING" , FALSE );
gGameSettings.fOptions[TOPTION_QUIET_REPAIRING] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_QUIET_REPAIRING" , FALSE );
gGameSettings.fOptions[TOPTION_QUIET_DOCTORING] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_QUIET_DOCTORING" , FALSE );
if (!is_networked)
gGameSettings.fOptions[TOPTION_AUTO_FAST_FORWARD_MODE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_AUTO_FAST_FORWARD_MODE" , FALSE );
@@ -397,6 +399,8 @@ BOOLEAN SaveGameSettings()
settings << "TOPTION_SHOW_TACTICAL_FACE_ICONS = " << (gGameSettings.fOptions[TOPTION_SHOW_TACTICAL_FACE_ICONS] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_DISABLE_CURSOR_SWAP = " << (gGameSettings.fOptions[TOPTION_DISABLE_CURSOR_SWAP] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_QUIET_TRAINING = " << (gGameSettings.fOptions[TOPTION_QUIET_TRAINING] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_QUIET_REPAIRING = " << (gGameSettings.fOptions[TOPTION_QUIET_REPAIRING] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_QUIET_DOCTORING = " << (gGameSettings.fOptions[TOPTION_QUIET_DOCTORING] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_AUTO_FAST_FORWARD_MODE = " << (gGameSettings.fOptions[TOPTION_AUTO_FAST_FORWARD_MODE] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_ZOMBIES = " << (gGameSettings.fOptions[TOPTION_ZOMBIES] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_CHEAT_MODE_OPTIONS_HEADER = " << (gGameSettings.fOptions[TOPTION_CHEAT_MODE_OPTIONS_HEADER] ? "TRUE" : "FALSE" ) << endl;
@@ -523,6 +527,8 @@ void InitGameSettings()
gGameSettings.fOptions[ TOPTION_DISABLE_CURSOR_SWAP ] = FALSE;
gGameSettings.fOptions[ TOPTION_QUIET_TRAINING ] = FALSE;
gGameSettings.fOptions[ TOPTION_QUIET_REPAIRING ] = FALSE;
gGameSettings.fOptions[ TOPTION_QUIET_DOCTORING ] = FALSE;
gGameSettings.fOptions[ TOPTION_AUTO_FAST_FORWARD_MODE ] = FALSE;
gGameSettings.fOptions[ TOPTION_ZOMBIES ] = FALSE; // Flugente Zombies 1.0
@@ -668,6 +674,12 @@ void LoadGameExternalOptions()
// Use "EnemyWeaponDrop.XML" etc. for determining which items are dropped?
gGameExternalOptions.ubEnemiesItemDrop = iniReader.ReadInteger("Data File Settings","USE_EXTERNALIZED_ENEMY_ITEM_DROPS", 0, 0, 1);
//Madd: use xml file for tilesets
gGameExternalOptions.fUseXmlTileSets = iniReader.ReadBoolean("Data File Settings","USE_XML_TILESETS", FALSE);
//Madd: set number of pItem files to be used
gGameExternalOptions.ubNumPItems = iniReader.ReadInteger("Data File Settings","NUM_P_ITEMS", 3, 3, 10);
//################# Merc Recruitment Settings #################
// WDS: Allow flexible numbers of IMPs of each sex
+4
View File
@@ -88,6 +88,8 @@ enum
TOPTION_DISABLE_CURSOR_SWAP, // Disable cursor swapping every second between talk and quick exchange
TOPTION_QUIET_TRAINING, //Madd: mercs don't say gained experience quote while training
TOPTION_QUIET_REPAIRING, //Madd: mercs don't say gained experience quote while repairing items
TOPTION_QUIET_DOCTORING, //Madd: mercs don't say gained experience quote while doctoring
TOPTION_AUTO_FAST_FORWARD_MODE, // automatically fast forward through AI turns
TOPTION_ZOMBIES, // Flugente Zombies 1.0: allow zombies
@@ -1106,6 +1108,8 @@ typedef struct
BOOLEAN gEncyclopedia;
UINT8 ubMapItemChanceOverride; //Madd: special map override, mostly for debugging
UINT8 ubNumPItems; //Madd: set number of PItem files to be used - default 3
BOOLEAN fUseXmlTileSets; //Madd: move this variable here, it should be mod dependent
} GAME_EXTERNAL_OPTIONS;
typedef struct
+4 -3
View File
@@ -226,7 +226,7 @@ INT32 FAR PASCAL SyncWindowProcedure(HWND hWindow, UINT16 Message, WPARAM wParam
bool s_bExportStrings = false;
extern bool g_bUseXML_Strings;// = false;
bool g_bUseXML_Structures = false;
bool g_bUseXML_Tilesets = false;
//bool g_bUseXML_Tilesets = false;
#ifdef USE_VFS
static vfs::Path sp_force_load_jsd_xml_file;
@@ -1487,8 +1487,9 @@ void GetRuntimeSettings( )
//g_bUseXML_Tilesets = true;
// WANNE: Yes, make it optional again
g_bUseXML_Tilesets = oProps.getBoolProperty(L"Ja2 Settings", L"USE_XML_TILESETS", false);
//Madd: moved to ja2_options.ini instead
//g_bUseXML_Tilesets = oProps.getBoolProperty(L"Ja2 Settings", L"USE_XML_TILESETS", false);
g_bUseXML_Strings = oProps.getBoolProperty(L"Ja2 Settings", L"USE_XML_STRINGS", false);
s_bExportStrings = oProps.getBoolProperty(L"Ja2 Settings", L"EXPORT_STRINGS", false);
+18 -1
View File
@@ -9512,7 +9512,24 @@ void MAPInvClickCallback( MOUSE_REGION *pRegion, INT32 iReason )
if ( _KeyDown(CTRL) )
{
CleanUpStack( &( pSoldier->inv[ uiHandPos ] ), gpItemPointer );
if ( pSoldier->inv[ uiHandPos ].exists() && gpItemPointer->exists() )
{
if (pSoldier->inv[ uiHandPos ].usItem == gpItemPointer->usItem)
CleanUpStack( &( pSoldier->inv[ uiHandPos ] ), gpItemPointer );
else //Madd: attach / merge object, merge only works on single objects for now
{
UINT8 cnt = pSoldier->inv[ uiHandPos ].ubNumberOfObjects;
if ( gpItemPointer->ubNumberOfObjects < cnt )
cnt = gpItemPointer->ubNumberOfObjects;
for (UINT8 i = 0; i<cnt;i++)
{
pSoldier->inv[ uiHandPos ].AttachObject(pSoldier,gpItemPointer,TRUE,i);
}
}
}
if ( gpItemPointer->exists() == false )
{
MAPEndItemPointer( );
+2 -2
View File
@@ -1654,7 +1654,7 @@ void EndLoadScreen( )
uiHundreths = (uiBuildShadeTableTime / 10) % 100;
fprintf( fp, " 1) BuildShadeTables: %d.%02d\n", uiSeconds, uiHundreths );
uiPercentage = uiNumImagesReloaded * 100 / NUMBEROFTILETYPES;
uiPercentage = uiNumImagesReloaded * 100 / giNumberOfTileTypes;
fprintf( fp, " 2) %d%% of the tileset images were actually reloaded.\n", uiPercentage );
if ( ( uiNumTablesSaved+uiNumTablesLoaded ) != 0 )
{
@@ -1717,7 +1717,7 @@ void EndLoadScreen( )
uiHundreths = (uiBuildShadeTableTime / 10) % 100;
timeResults << " 1) BuildShadeTables: " << uiSeconds << "." << uiHundreths << sgp::endl;
uiPercentage = uiNumImagesReloaded * 100 / NUMBEROFTILETYPES;
uiPercentage = uiNumImagesReloaded * 100 / giNumberOfTileTypes;
timeResults << " 2) " << uiPercentage << "% of the tileset images were actually reloaded." << sgp::endl;
if ( ( uiNumTablesSaved+uiNumTablesLoaded ) != 0 )
{
+9 -3
View File
@@ -686,9 +686,15 @@ void ChangeStat( MERCPROFILESTRUCT *pProfile, SOLDIERTYPE *pSoldier, UINT8 ubSta
{
// Pipe up with "I'm getting better at this!"
TacticalCharacterDialogueWithSpecialEventEx( pSoldier, 0, DIALOGUE_SPECIAL_EVENT_DISPLAY_STAT_CHANGE, fChangeTypeIncrease, sPtsChanged, ubStat );
if ( (ubReason != FROM_TRAINING && pSoldier->bAssignment != TRAIN_TEAMMATE ) || !gGameSettings.fOptions[TOPTION_QUIET_TRAINING] ) //Madd: option to make mercs quiet during training
TacticalCharacterDialogue( pSoldier, QUOTE_EXPERIENCE_GAIN );
//Madd: option to make mercs quiet during training / doctoring / repairing
if ( ((pSoldier->bAssignment == TRAIN_BY_OTHER || pSoldier->bAssignment == TRAIN_TEAMMATE || pSoldier->bAssignment == TRAIN_SELF ||
pSoldier->bAssignment == FACILITY_STAFF || pSoldier->bAssignment == TRAIN_TOWN || pSoldier->bAssignment == TRAIN_MOBILE )
&& !gGameSettings.fOptions[TOPTION_QUIET_TRAINING]) ||
(pSoldier->bAssignment == REPAIR && !gGameSettings.fOptions[TOPTION_QUIET_REPAIRING]) ||
(pSoldier->bAssignment == DOCTOR && !gGameSettings.fOptions[TOPTION_QUIET_DOCTORING]))
TacticalCharacterDialogue( pSoldier, QUOTE_EXPERIENCE_GAIN );
}
else
{
+4 -4
View File
@@ -368,7 +368,7 @@ void HandleEndTurnDrugAdjustments( SOLDIERTYPE *pSoldier )
/*
//////////////// STRENGTH ////////////////
// strength we would normally have right now
INT8 strength = gMercProfiles[ pSoldier->ubProfile ].bStrength - pSoldier->ubCriticalStatDamage[ DAMAGED_STAT_STRENGTH ];
INT8 strength = gMercProfiles[ pSoldier->ubProfile ].bStrength;// Madd: commenting out this part b/c it breaks doctoring! - pSoldier->ubCriticalStatDamage[ DAMAGED_STAT_STRENGTH ];
INT8 strengthmodifier = pSoldier->drugs.bDrugEffect[ DRUG_TYPE_STRENGTH ] - pSoldier->drugs.bDrugSideEffect[ DRUG_TYPE_STRENGTH ];
@@ -393,7 +393,7 @@ void HandleEndTurnDrugAdjustments( SOLDIERTYPE *pSoldier )
//////////////// DEXTERITY ////////////////
// dexterity we would normally have right now
INT8 dexterity = gMercProfiles[ pSoldier->ubProfile ].bDexterity - pSoldier->ubCriticalStatDamage[ DAMAGED_STAT_DEXTERITY ];
INT8 dexterity = gMercProfiles[ pSoldier->ubProfile ].bDexterity;// Madd: commenting out this part b/c it breaks doctoring! - pSoldier->ubCriticalStatDamage[ DAMAGED_STAT_DEXTERITY ];
INT8 dexteritymodifier = pSoldier->drugs.bDrugEffect[ DRUG_TYPE_DEXTERITY ] - pSoldier->drugs.bDrugSideEffect[ DRUG_TYPE_DEXTERITY ];
@@ -418,7 +418,7 @@ void HandleEndTurnDrugAdjustments( SOLDIERTYPE *pSoldier )
//////////////// AGILITY ////////////////
// agility we would normally have right now
INT8 agility = gMercProfiles[ pSoldier->ubProfile ].bAgility - pSoldier->ubCriticalStatDamage[ DAMAGED_STAT_AGILITY ];
INT8 agility = gMercProfiles[ pSoldier->ubProfile ].bAgility;// Madd: commenting out this part b/c it breaks doctoring! - pSoldier->ubCriticalStatDamage[ DAMAGED_STAT_AGILITY ];
INT8 agilitymodifier = pSoldier->drugs.bDrugEffect[ DRUG_TYPE_AGILITY ] - pSoldier->drugs.bDrugSideEffect[ DRUG_TYPE_AGILITY ];
@@ -443,7 +443,7 @@ void HandleEndTurnDrugAdjustments( SOLDIERTYPE *pSoldier )
//////////////// WISDOM ////////////////
// wisdom we would normally have right now
INT8 wisdom = gMercProfiles[ pSoldier->ubProfile ].bWisdom - pSoldier->ubCriticalStatDamage[ DAMAGED_STAT_WISDOM ];
INT8 wisdom = gMercProfiles[ pSoldier->ubProfile ].bWisdom;// Madd: commenting out this part b/c it breaks doctoring! - pSoldier->ubCriticalStatDamage[ DAMAGED_STAT_WISDOM ];
INT8 wisdommodifier = pSoldier->drugs.bDrugEffect[ DRUG_TYPE_WISDOM ] - pSoldier->drugs.bDrugSideEffect[ DRUG_TYPE_WISDOM ];
+9 -29
View File
@@ -9282,51 +9282,31 @@ UINT32 GetInterfaceGraphicForItem( INVTYPE *pItem )
UINT16 GetTileGraphicForItem( INVTYPE *pItem )
{
UINT16 usIndex;
UINT8 ubGraphicType = pItem->ubGraphicType;
if ( pItem->ubClassIndex >= M900 )
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, String("GetTileGraphicForItem: item %d graphic %d",pItem->ubClassIndex, pItem->ubGraphicNum));
// CHECK SUBCLASS
if ( pItem->ubGraphicType == 0 )
if ( ubGraphicType == 0 )
{
GetTileIndexFromTypeSubIndex( GUNS, (INT16)(pItem->ubGraphicNum+1), &usIndex );
}
else if ( pItem->ubGraphicType == 1 )
else if ( ubGraphicType == 1 )
{
GetTileIndexFromTypeSubIndex( P1ITEMS, (INT16)(pItem->ubGraphicNum+1), &usIndex );
}
else if ( pItem->ubGraphicType == 2 )
else if ( ubGraphicType == 2 )
{
GetTileIndexFromTypeSubIndex( P2ITEMS, (INT16)(pItem->ubGraphicNum+1), &usIndex );
}
else if ( pItem->ubGraphicType == 3 )
else if ( ubGraphicType == 3 )
{
GetTileIndexFromTypeSubIndex( P3ITEMS, (INT16)(pItem->ubGraphicNum+1), &usIndex );
}
////MM: New item tileslots start here
//else if ( pItem->ubGraphicType == 4 )
//{
// GetTileIndexFromTypeSubIndex( P4ITEMS, (INT16)(pItem->ubGraphicNum+1), &usIndex );
//}
//else if ( pItem->ubGraphicType == 5 )
//{
// GetTileIndexFromTypeSubIndex( P5ITEMS, (INT16)(pItem->ubGraphicNum+1), &usIndex );
//}
//else if ( pItem->ubGraphicType == 6 )
//{
// GetTileIndexFromTypeSubIndex( P6ITEMS, (INT16)(pItem->ubGraphicNum+1), &usIndex );
//}
//else if ( pItem->ubGraphicType == 7 )
//{
// GetTileIndexFromTypeSubIndex( P7ITEMS, (INT16)(pItem->ubGraphicNum+1), &usIndex );
//}
//else if ( pItem->ubGraphicType == 8 )
//{
// GetTileIndexFromTypeSubIndex( P8ITEMS, (INT16)(pItem->ubGraphicNum+1), &usIndex );
//}
//else
//{
// GetTileIndexFromTypeSubIndex( P9ITEMS, (INT16)(pItem->ubGraphicNum+1), &usIndex );
//}
//MM: New item tileslots start here
else
GetTileIndexFromTypeSubIndex( P4ITEMS + ubGraphicType - 4, (INT16)(pItem->ubGraphicNum+1), &usIndex );
if ( pItem->ubClassIndex >= M900 )
+17 -1
View File
@@ -3385,7 +3385,23 @@ BOOLEAN UIHandleItemPlacement( UINT8 ubHandPos, UINT16 usOldItemIndex, UINT16 us
{
if ( _KeyDown(CTRL) )
{
CleanUpStack( &( gpSMCurrentMerc->inv[ ubHandPos ] ), gpItemPointer );
if ( gpItemPointer->exists() && gpSMCurrentMerc->inv[ ubHandPos ].exists() )
{
if ( gpItemPointer->usItem == gpSMCurrentMerc->inv[ ubHandPos ].usItem )
CleanUpStack( &( gpSMCurrentMerc->inv[ ubHandPos ] ), gpItemPointer );
else // Madd: attach / merge object, merge only works on single objects for now
{
UINT8 cnt = gpSMCurrentMerc->inv[ ubHandPos ].ubNumberOfObjects;
if ( gpItemPointer->ubNumberOfObjects < cnt )
cnt = gpItemPointer->ubNumberOfObjects;
for (UINT8 i = 0; i<cnt;i++)
{
gpSMCurrentMerc->inv[ ubHandPos ].AttachObject(gpSMCurrentMerc,gpItemPointer,TRUE,i);
}
}
}
if ( gpItemPointer->exists() == false )
{
EndItemPointer( );
+2 -2
View File
@@ -3,7 +3,7 @@
#include "DEBUG.H"
#include "vobject.h"
#include "utilities.h"
#include "GameSettings.h"
#include <vfs/Core/vfs.h>
extern void WriteMessageToFile( const STR16 pString );
@@ -112,7 +112,7 @@ bool RegisterItemImages()
return false;
}
for (UINT8 ubLoop = 0; ubLoop < MAX_PITEMS; ubLoop++)
for (UINT8 ubLoop = 0; ubLoop < gGameExternalOptions.ubNumPItems; ubLoop++)
{
// LOAD INTERFACE ITEM PICTURES
if(!g_bUsePngItemImages)
+1 -1
View File
@@ -21,7 +21,7 @@ private:
extern bool g_bUsePngItemImages;
const UINT8 MAX_PITEMS = 3;
const UINT8 MAX_PITEMS = 20;
// old item image handles
extern UINT32 guiGUNSM;
extern UINT32 guiPITEMS[MAX_PITEMS];
+1 -1
View File
@@ -7899,7 +7899,7 @@ BOOLEAN OBJECTTYPE::RemoveAttachment( OBJECTTYPE* pAttachment, OBJECTTYPE * pNew
if(pNewObj != NULL)
*pNewObj = removedAttachment;
if(pAttachment->exists() && pAttachment->usItem == 0)
if(pAttachment->exists() && (pAttachment->usItem == 0 || pAttachment->usItem == removedAttachment.usItem ))
*pAttachment = removedAttachment;
if (pNewObj->exists() && Item[pNewObj->usItem].grenadelauncher )//UNDER_GLAUNCHER)
+2 -2
View File
@@ -1615,7 +1615,7 @@ void GetRTMousePositionInput( UINT32 *puiNewEvent )
// return;
// }
//
// for(uiType = 0; uiType < NUMBEROFTILETYPES; uiType++)
// for(uiType = 0; uiType < giNumberOfTileTypes; uiType++)
// {
// if( !gTilesets[ giCurrentTilesetID].TileSurfaceFilenames[ uiType ][0] )
// {
@@ -1629,7 +1629,7 @@ void GetRTMousePositionInput( UINT32 *puiNewEvent )
// }
// }
//
// if(uiType >= NUMBEROFTILETYPES)
// if(uiType >= giNumberOfTileTypes)
// return;*/
//
// if( GetMouseMapPos( &sGridNo ) )
+2 -2
View File
@@ -1839,7 +1839,7 @@ BOOLEAN DoesVehicleNeedAnyRepairs( INT32 iVehicleId )
}
INT8 RepairVehicle( INT32 iVehicleId, INT8 bRepairPtsLeft, BOOLEAN *pfNothingToRepair )
INT8 RepairVehicle( INT32 iVehicleId, UINT8 ubRepairPtsLeft, BOOLEAN *pfNothingToRepair )
{
SOLDIERTYPE *pVehicleSoldier = NULL;
INT8 bRepairPtsUsed = 0;
@@ -1869,7 +1869,7 @@ INT8 RepairVehicle( INT32 iVehicleId, INT8 bRepairPtsLeft, BOOLEAN *pfNothingToR
bOldLife = pVehicleSoldier->stats.bLife;
// Repair
pVehicleSoldier->stats.bLife += ( bRepairPtsLeft / VEHICLE_REPAIR_POINTS_DIVISOR );
pVehicleSoldier->stats.bLife += ( ubRepairPtsLeft / VEHICLE_REPAIR_POINTS_DIVISOR );
// Check
if ( pVehicleSoldier->stats.bLife > pVehicleSoldier->stats.bLifeMax )
+1 -1
View File
@@ -398,7 +398,7 @@ void SetUpArmorForVehicle( UINT8 ubID );
BOOLEAN DoesVehicleNeedAnyRepairs( INT32 iVehicleId );
// repair the vehicle
INT8 RepairVehicle( INT32 iVehicleId, INT8 bTotalPts, BOOLEAN *pfNothingToRepair );
INT8 RepairVehicle( INT32 iVehicleId, UINT8 ubTotalPts, BOOLEAN *pfNothingToRepair );
//Save all the vehicle information to the saved game file
+2 -2
View File
@@ -1880,11 +1880,11 @@ BOOLEAN WearGasMaskIfAvailable( SOLDIERTYPE * pSoldier )
{
return( FALSE );
}
if ( bSlot == HEAD1POS || bSlot == HEAD2POS )
if ( bSlot == HEAD1POS || bSlot == HEAD2POS || bSlot == HELMETPOS )
{
return( FALSE );
}
if ( pSoldier->inv[ HEAD1POS ].exists() == false)
if ( pSoldier->inv[ HEAD1POS ].exists() == false )
{
bNewSlot = HEAD1POS;
}
+3 -3
View File
@@ -1754,7 +1754,7 @@ INT32 EstimateThrowDamage( SOLDIERTYPE *pSoldier, UINT8 ubItemPos, SOLDIERTYPE *
INT8 bSlot;
if( pSoldier == NULL || pOpponent == NULL || ubItemPos > pSoldier->inv.size() || sGridNo > NUMBEROFTILES )
if( pSoldier == NULL || pOpponent == NULL || ubItemPos > pSoldier->inv.size() || sGridNo > giNumberOfTiles )
return 0;
if( pSoldier->inv[ubItemPos].exists() == false )
@@ -1807,8 +1807,8 @@ INT32 EstimateThrowDamage( SOLDIERTYPE *pSoldier, UINT8 ubItemPos, SOLDIERTYPE *
if (gpWorldLevelData[sGridNo].ubTerrainID != FLAT_FLOOR)
iBreathDamage /= 2; // reduce effective breath damage by 1/2
bSlot = FindObj( pOpponent, GASMASK );
if (bSlot == HEAD1POS || bSlot == HEAD2POS)
bSlot = FindGasMask(pOpponent); //FindObj( pOpponent, GASMASK );
if ((bSlot == HEAD1POS || bSlot == HEAD2POS || bSlot == HELMETPOS) && pSoldier->inv[bSlot][0]->data.objectStatus >= 70)
{
// take condition of the gas mask into account - it could be leaking
iBreathDamage = (iBreathDamage * (100 - pOpponent->inv[bSlot][0]->data.objectStatus)) / 100;
+1
View File
@@ -1994,6 +1994,7 @@ BOOLEAN DishOutGasDamage( SOLDIERTYPE * pSoldier, EXPLOSIVETYPE * pExplosive, IN
break;
case EXPLOSV_MUSTGAS:
pSoldier->flags.fHitByGasFlags |= HIT_BY_MUSTARDGAS;
break;
case EXPLOSV_BURNABLEGAS:
pSoldier->flags.fHitByGasFlags |= HIT_BY_BURNABLEGAS;
break;
+21 -7
View File
@@ -5,6 +5,11 @@
#include "worlddef.h"
#endif
#include "GameSettings.h"
INT32 giNumberOfTiles; //Madd: new global variables to allow for a variable number of Pitems
INT32 giNumberOfTileTypes;
INT16 gOpenDoorList[20] =
{
FIRSTDOOR1,
@@ -588,13 +593,14 @@ UINT16 gNumTilesPerType[ NUMBEROFTILETYPES ] =
THIRDMISS14 - THIRDMISS1 + 1,
WIREFRAMES15 - WIREFRAMES1 + 1,
////MM: New item tileslots start here
// P4ITEM5000 - P4ITEM1 + 1,
// P5ITEM5000 - P5ITEM1 + 1,
// P6ITEM5000 - P6ITEM1 + 1,
// P7ITEM5000 - P7ITEM1 + 1,
// P8ITEM5000 - P8ITEM1 + 1,
// P9ITEM5000 - P9ITEM1 + 1
//MM: New item tileslots start here
P4ITEM5000 - P4ITEM1 + 1,
P5ITEM5000 - P5ITEM1 + 1,
P6ITEM5000 - P6ITEM1 + 1,
P7ITEM5000 - P7ITEM1 + 1,
P8ITEM5000 - P8ITEM1 + 1,
P9ITEM5000 - P9ITEM1 + 1,
P10ITEM5000 - P10ITEM1 + 1
};
@@ -946,3 +952,11 @@ void SetSpecificDatabaseValues( UINT16 usType, UINT16 uiDatabaseElem, TILE_ELEME
}
// Madd: sets the giNumberOfTiles variable
void SetNumberOfTiles()
{
giNumberOfTiles = P4ITEM1 + ((gGameExternalOptions.ubNumPItems - 3) * 5000);
giNumberOfTileTypes = P4ITEMS + (gGameExternalOptions.ubNumPItems - 3);
}
+221 -74
View File
@@ -3014,82 +3014,216 @@ enum TileDefines
WIREFRAMES14,
WIREFRAMES15,
////MM: New item tileslots start here
//P4ITEM1,
//P4ITEM2,
//P4ITEM3,
//P4ITEM4,
//P4ITEM5,
//P4ITEM6,
//P4ITEM7,
//P4ITEM8,
//P4ITEM9,
//P4ITEM10,
//P4ITEM5000 = P4ITEM10 + 4990,
//MM: New item tileslots start here
P4ITEM1,
P4ITEM2,
P4ITEM3,
P4ITEM4,
P4ITEM5,
P4ITEM6,
P4ITEM7,
P4ITEM8,
P4ITEM9,
P4ITEM10,
P4ITEM5000 = P4ITEM10 + 4990,
//P5ITEM1,
//P5ITEM2,
//P5ITEM3,
//P5ITEM4,
//P5ITEM5,
//P5ITEM6,
//P5ITEM7,
//P5ITEM8,
//P5ITEM9,
//P5ITEM10,
//P5ITEM5000 = P5ITEM10 + 4990,
P5ITEM1,
P5ITEM2,
P5ITEM3,
P5ITEM4,
P5ITEM5,
P5ITEM6,
P5ITEM7,
P5ITEM8,
P5ITEM9,
P5ITEM10,
P5ITEM5000 = P5ITEM10 + 4990,
//P6ITEM1,
//P6ITEM2,
//P6ITEM3,
//P6ITEM4,
//P6ITEM5,
//P6ITEM6,
//P6ITEM7,
//P6ITEM8,
//P6ITEM9,
//P6ITEM10,
//P6ITEM5000 = P6ITEM10 + 4990,
P6ITEM1,
P6ITEM2,
P6ITEM3,
P6ITEM4,
P6ITEM5,
P6ITEM6,
P6ITEM7,
P6ITEM8,
P6ITEM9,
P6ITEM10,
P6ITEM5000 = P6ITEM10 + 4990,
//P7ITEM1,
//P7ITEM2,
//P7ITEM3,
//P7ITEM4,
//P7ITEM5,
//P7ITEM6,
//P7ITEM7,
//P7ITEM8,
//P7ITEM9,
//P7ITEM10,
//P7ITEM5000 = P7ITEM10 + 4990,
P7ITEM1,
P7ITEM2,
P7ITEM3,
P7ITEM4,
P7ITEM5,
P7ITEM6,
P7ITEM7,
P7ITEM8,
P7ITEM9,
P7ITEM10,
P7ITEM5000 = P7ITEM10 + 4990,
//P8ITEM1,
//P8ITEM2,
//P8ITEM3,
//P8ITEM4,
//P8ITEM5,
//P8ITEM6,
//P8ITEM7,
//P8ITEM8,
//P8ITEM9,
//P8ITEM10,
//P8ITEM5000 = P8ITEM10 + 4990,
P8ITEM1,
P8ITEM2,
P8ITEM3,
P8ITEM4,
P8ITEM5,
P8ITEM6,
P8ITEM7,
P8ITEM8,
P8ITEM9,
P8ITEM10,
P8ITEM5000 = P8ITEM10 + 4990,
//P9ITEM1,
//P9ITEM2,
//P9ITEM3,
//P9ITEM4,
//P9ITEM5,
//P9ITEM6,
//P9ITEM7,
//P9ITEM8,
//P9ITEM9,
//P9ITEM10,
//P9ITEM5000 = P9ITEM10 + 4990,
P9ITEM1,
P9ITEM2,
P9ITEM3,
P9ITEM4,
P9ITEM5,
P9ITEM6,
P9ITEM7,
P9ITEM8,
P9ITEM9,
P9ITEM10,
P9ITEM5000 = P9ITEM10 + 4990,
P10ITEM1,
P10ITEM2,
P10ITEM3,
P10ITEM4,
P10ITEM5,
P10ITEM6,
P10ITEM7,
P10ITEM8,
P10ITEM9,
P10ITEM10,
P10ITEM5000 = P10ITEM10 + 4990,
P11ITEM1,
P11ITEM2,
P11ITEM3,
P11ITEM4,
P11ITEM5,
P11ITEM6,
P11ITEM7,
P11ITEM8,
P11ITEM9,
P11ITEM10,
P11ITEM5000 = P11ITEM10 + 4990,
P12ITEM1,
P12ITEM2,
P12ITEM3,
P12ITEM4,
P12ITEM5,
P12ITEM6,
P12ITEM7,
P12ITEM8,
P12ITEM9,
P12ITEM10,
P12ITEM5000 = P12ITEM10 + 4990,
P13ITEM1,
P13ITEM2,
P13ITEM3,
P13ITEM4,
P13ITEM5,
P13ITEM6,
P13ITEM7,
P13ITEM8,
P13ITEM9,
P13ITEM10,
P13ITEM5000 = P13ITEM10 + 4990,
P14ITEM1,
P14ITEM2,
P14ITEM3,
P14ITEM4,
P14ITEM5,
P14ITEM6,
P14ITEM7,
P14ITEM8,
P14ITEM9,
P14ITEM10,
P14ITEM5000 = P14ITEM10 + 4990,
P15ITEM1,
P15ITEM2,
P15ITEM3,
P15ITEM4,
P15ITEM5,
P15ITEM6,
P15ITEM7,
P15ITEM8,
P15ITEM9,
P15ITEM10,
P15ITEM5000 = P15ITEM10 + 4990,
P16ITEM1,
P16ITEM2,
P16ITEM3,
P16ITEM4,
P16ITEM5,
P16ITEM6,
P16ITEM7,
P16ITEM8,
P16ITEM9,
P16ITEM10,
P16ITEM5000 = P16ITEM10 + 4990,
P17ITEM1,
P17ITEM2,
P17ITEM3,
P17ITEM4,
P17ITEM5,
P17ITEM6,
P17ITEM7,
P17ITEM8,
P17ITEM9,
P17ITEM10,
P17ITEM5000 = P17ITEM10 + 4990,
P18ITEM1,
P18ITEM2,
P18ITEM3,
P18ITEM4,
P18ITEM5,
P18ITEM6,
P18ITEM7,
P18ITEM8,
P18ITEM9,
P18ITEM10,
P18ITEM5000 = P18ITEM10 + 4990,
P19ITEM1,
P19ITEM2,
P19ITEM3,
P19ITEM4,
P19ITEM5,
P19ITEM6,
P19ITEM7,
P19ITEM8,
P19ITEM9,
P19ITEM10,
P19ITEM5000 = P19ITEM10 + 4990,
P20ITEM1,
P20ITEM2,
P20ITEM3,
P20ITEM4,
P20ITEM5,
P20ITEM6,
P20ITEM7,
P20ITEM8,
P20ITEM9,
P20ITEM10,
P20ITEM5000 = P20ITEM10 + 4990,
NUMBEROFTILES
};
extern INT32 giNumberOfTiles; //Madd: new global variable to allow for a variable number of Pitems
#define BLUEFLAG_GRAPHIC FIRSTSWITCHES21
// Defines for tile type identification
@@ -3290,17 +3424,29 @@ enum TileTypeDefines
WIREFRAMES,
////MM: New item tileslots start here
//P4ITEMS,
//P5ITEMS,
//P6ITEMS,
//P7ITEMS,
//P8ITEMS,
//P9ITEMS,
//MM: New item tileslots start here
P4ITEMS,
P5ITEMS,
P6ITEMS,
P7ITEMS,
P8ITEMS,
P9ITEMS,
P10ITEMS,
P11ITEMS,
P12ITEMS,
P13ITEMS,
P14ITEMS,
P15ITEMS,
P16ITEMS,
P17ITEMS,
P18ITEMS,
P19ITEMS,
P20ITEMS,
NUMBEROFTILETYPES
};
extern INT32 giNumberOfTileTypes; //Madd: for variable number of PItems
//==========================================================================
// Quick defines for finding last type entry in tile types
@@ -3345,5 +3491,6 @@ extern INT16 gOpenDoorShadowList[20];
extern INT16 gClosedDoorList[20];
extern INT16 gClosedDoorShadowList[20];
void SetNumberOfTiles(); // Madd: sets the giNumberOfTiles variable
#endif
+5 -4
View File
@@ -19,6 +19,7 @@
#include <vfs/Core/vfs_file_raii.h>
#include "XML_TileSet.hpp"
#include "XMLWriter.h"
#include "GameSettings.h"
void ExportTilesets(vfs::Path const& filename);
@@ -34,10 +35,10 @@ UINT8 gubNumSets = MAX_TILESETS;
TILESET gTilesets[ MAX_TILESETS ];
extern bool g_bUseXML_Tilesets;
//extern bool g_bUseXML_Tilesets;
void InitEngineTilesets( )
{
if(g_bUseXML_Tilesets)
if(gGameExternalOptions.fUseXmlTileSets)
{
const vfs::Path tileset_filename(L"Ja2Set.dat.xml");
if(!getVFS()->fileExists(tileset_filename))
@@ -84,7 +85,7 @@ void InitEngineTilesets( )
FileRead( hfile, &uiNumFiles, sizeof( uiNumFiles ), &uiNumBytesRead );
// COMPARE
if ( uiNumFiles != NUMBEROFTILETYPES )
if ( uiNumFiles != giNumberOfTileTypes )
{
// Report error
SET_ERROR( "Number of tilesets slots in code does not match data file" );
@@ -174,7 +175,7 @@ void ExportTilesets(vfs::Path const& filename)
FileRead( hfile, &numFiles, sizeof( numFiles ), &uiNumBytesRead );
// COMPARE
SGP_THROW_IFFALSE( numFiles == NUMBEROFTILETYPES,
SGP_THROW_IFFALSE( numFiles == giNumberOfTileTypes,
L"Number of tilesets slots in code does not match data file" );
xmlw.addAttributeToNextValue("numFiles",(int)numFiles);
+1 -1
View File
@@ -95,7 +95,7 @@ public:
TRANSITION_ENTER{
long lindex;
if(atts.getLong("index", lindex)){
SGP_THROW_IFFALSE(lindex < NUMBEROFTILETYPES,
SGP_THROW_IFFALSE(lindex < giNumberOfTileTypes,
_BS(L"tileset file index is too large : ") << lindex << _BS::wget );
T_DATA.index = lindex;
}
+12 -12
View File
@@ -596,7 +596,7 @@ UINT8 ubTravelCost;
pStruct = gpWorldLevelData[ usTileNo ].pStructHead;
while ( pStruct != NULL )
{
if ( pStruct->usIndex < NUMBEROFTILES )
if ( pStruct->usIndex < giNumberOfTiles )
{
GetTileType( pStruct->usIndex, &uiType );
@@ -886,7 +886,7 @@ BOOLEAN fFake;
pStruct = gpWorldLevelData[uiTile].pStructHead;
while(pStruct!=NULL)
{
if ( pStruct->usIndex < NUMBEROFTILES )
if ( pStruct->usIndex < giNumberOfTiles )
{
if((gTileDatabase[ pStruct->usIndex ].fType != FIRSTCLIFFHANG) || (uiFlags&LIGHT_EVERYTHING))
{
@@ -938,7 +938,7 @@ BOOLEAN fFake;
pObject = gpWorldLevelData[uiTile].pObjectHead;
while(pObject!=NULL)
{
if ( pObject->usIndex < NUMBEROFTILES )
if ( pObject->usIndex < giNumberOfTiles )
{
LightAddTileNode(pObject, uiLightType, ubShadeAdd, FALSE);
}
@@ -962,7 +962,7 @@ BOOLEAN fFake;
pRoof = gpWorldLevelData[uiTile].pRoofHead;
while(pRoof!=NULL)
{
if ( pRoof->usIndex < NUMBEROFTILES )
if ( pRoof->usIndex < giNumberOfTiles )
{
LightAddTileNode(pRoof, uiLightType, ubShadeAdd, fFake);
}
@@ -1029,7 +1029,7 @@ BOOLEAN fFake; // only passed in to land and roof layers; others get fed FALSE
pStruct = gpWorldLevelData[uiTile].pStructHead;
while(pStruct!=NULL)
{
if ( pStruct->usIndex < NUMBEROFTILES )
if ( pStruct->usIndex < giNumberOfTiles )
{
if((gTileDatabase[ pStruct->usIndex ].fType != FIRSTCLIFFHANG) || (uiFlags&LIGHT_EVERYTHING))
{
@@ -1081,7 +1081,7 @@ BOOLEAN fFake; // only passed in to land and roof layers; others get fed FALSE
pObject = gpWorldLevelData[uiTile].pObjectHead;
while(pObject!=NULL)
{
if ( pObject->usIndex < NUMBEROFTILES )
if ( pObject->usIndex < giNumberOfTiles )
{
LightSubtractTileNode(pObject, uiLightType, ubShadeSubtract, FALSE);
}
@@ -1105,7 +1105,7 @@ BOOLEAN fFake; // only passed in to land and roof layers; others get fed FALSE
pRoof = gpWorldLevelData[uiTile].pRoofHead;
while(pRoof!=NULL)
{
if ( pRoof->usIndex < NUMBEROFTILES )
if ( pRoof->usIndex < giNumberOfTiles )
{
LightSubtractTileNode(pRoof, uiLightType, ubShadeSubtract, fFake);
}
@@ -1115,7 +1115,7 @@ BOOLEAN fFake; // only passed in to land and roof layers; others get fed FALSE
pOnRoof = gpWorldLevelData[uiTile].pOnRoofHead;
while(pOnRoof!=NULL)
{
if ( pOnRoof->usIndex < NUMBEROFTILES )
if ( pOnRoof->usIndex < giNumberOfTiles )
{
LightSubtractTileNode(pOnRoof, uiLightType, ubShadeSubtract, FALSE);
}
@@ -2323,7 +2323,7 @@ BOOLEAN LightRevealWall(INT16 sX, INT16 sY, INT16 sSrcX, INT16 sSrcY)
pStruct=gpWorldLevelData[uiTile].pStructHead;
//while(pStruct!=NULL)
while(pStruct!=NULL && pStruct->usIndex<NUMBEROFTILES) //lal bugfix
while(pStruct!=NULL && pStruct->usIndex<giNumberOfTiles) //lal bugfix
{
TileElem = &(gTileDatabase[pStruct->usIndex]);
switch(TileElem->usWallOrientation)
@@ -2346,7 +2346,7 @@ BOOLEAN LightRevealWall(INT16 sX, INT16 sY, INT16 sSrcX, INT16 sSrcY)
pStruct=gpWorldLevelData[uiTile].pStructHead;
//while(pStruct!=NULL)
while(pStruct!=NULL && pStruct->usIndex<NUMBEROFTILES) //lal bugfix
while(pStruct!=NULL && pStruct->usIndex<giNumberOfTiles) //lal bugfix
{
TileElem = &(gTileDatabase[pStruct->usIndex]);
switch(TileElem->usWallOrientation)
@@ -2403,7 +2403,7 @@ TILE_ELEMENT *TileElem;
pStruct=gpWorldLevelData[uiTile].pStructHead;
//while(pStruct!=NULL)
while(pStruct!=NULL && pStruct->usIndex<NUMBEROFTILES) // lal bugfix
while(pStruct!=NULL && pStruct->usIndex<giNumberOfTiles) // lal bugfix
{
TileElem = &(gTileDatabase[pStruct->usIndex]);
switch(TileElem->usWallOrientation)
@@ -2426,7 +2426,7 @@ TILE_ELEMENT *TileElem;
pStruct=gpWorldLevelData[uiTile].pStructHead;
//while(pStruct!=NULL)
while(pStruct!=NULL && pStruct->usIndex<NUMBEROFTILES) //lal bugfix
while(pStruct!=NULL && pStruct->usIndex<giNumberOfTiles) //lal bugfix
{
TileElem = &(gTileDatabase[pStruct->usIndex]);
switch(TileElem->usWallOrientation)
+8 -8
View File
@@ -123,7 +123,7 @@ void InitNewOverheadDB( UINT8 ubTilesetID )
UINT32 dbSize = 0;
for (uiLoop = 0; uiLoop < NUMBEROFTILETYPES; uiLoop++)
for (uiLoop = 0; uiLoop < giNumberOfTileTypes; uiLoop++)
{
// Create video object
@@ -181,7 +181,7 @@ void InitNewOverheadDB( UINT8 ubTilesetID )
}
// NOW LOOP THROUGH AND CREATE DATABASE
for( cnt1 = 0; cnt1 < NUMBEROFTILETYPES; cnt1++ )
for( cnt1 = 0; cnt1 < giNumberOfTileTypes; cnt1++ )
{
// Get number of regions
s = gSmTileSurf[ cnt1 ];
@@ -241,7 +241,7 @@ void DeleteOverheadDB( )
{
INT32 cnt;
for( cnt = 0; cnt < NUMBEROFTILETYPES; cnt++ )
for( cnt = 0; cnt < giNumberOfTileTypes; cnt++ )
{
DeleteVideoObject( gSmTileSurf[ cnt ].vo );
}
@@ -991,7 +991,7 @@ void RenderOverheadMap( INT16 sStartPointX_M, INT16 sStartPointY_M, INT16 sStart
while( pNode != NULL )
{
if ( pNode->usIndex < NUMBEROFTILES )
if ( pNode->usIndex < giNumberOfTiles )
{
// Don't render itempools!
if ( !( pNode->uiFlags & LEVELNODE_ITEM ) )
@@ -1026,7 +1026,7 @@ void RenderOverheadMap( INT16 sStartPointX_M, INT16 sStartPointY_M, INT16 sStart
pNode = gpWorldLevelData[ usTileIndex ].pShadowHead;
while( pNode != NULL )
{
if ( pNode->usIndex < NUMBEROFTILES )
if ( pNode->usIndex < giNumberOfTiles )
{
pTile = &( gSmTileDB[ pNode->usIndex ] );
sX = sTempPosX_S;
@@ -1047,7 +1047,7 @@ void RenderOverheadMap( INT16 sStartPointX_M, INT16 sStartPointY_M, INT16 sStart
while( pNode != NULL )
{
if ( pNode->usIndex < NUMBEROFTILES )
if ( pNode->usIndex < giNumberOfTiles )
{
// Don't render itempools!
if ( !( pNode->uiFlags & LEVELNODE_ITEM ) )
@@ -1147,7 +1147,7 @@ void RenderOverheadMap( INT16 sStartPointX_M, INT16 sStartPointY_M, INT16 sStart
pNode = gpWorldLevelData[ usTileIndex ].pRoofHead;
while( pNode != NULL )
{
if ( pNode->usIndex < NUMBEROFTILES )
if ( pNode->usIndex < giNumberOfTiles )
{
if ( !( pNode->uiFlags & LEVELNODE_HIDDEN ) )
{
@@ -1951,7 +1951,7 @@ void CopyOverheadDBShadetablesFromTileset( )
// Loop through tileset
for (uiLoop = 0; uiLoop < NUMBEROFTILETYPES; uiLoop++)
for (uiLoop = 0; uiLoop < giNumberOfTileTypes; uiLoop++)
{
pTileSurf = ( gTileSurfaceArray[ uiLoop ] );
+9 -9
View File
@@ -648,7 +648,7 @@ void CreateTileDatabase( )
TILE_ELEMENT TileElement;
// Loop through all surfaces and tiles and build database
for( cnt1 = 0; cnt1 < NUMBEROFTILETYPES; cnt1++ )
for( cnt1 = 0; cnt1 < giNumberOfTileTypes; cnt1++ )
{
// Get number of regions
TileSurf = gTileSurfaceArray[ cnt1 ];
@@ -657,7 +657,7 @@ void CreateTileDatabase( )
{
// Build start index list
gTileTypeStartIndex[ cnt1 ] = (UINT16)gTileDatabaseSize;
gTileTypeStartIndex[ cnt1 ] = (UINT16)gTileDatabaseSize;
NumRegions = TileSurf->vo->usNumberOfObjects;
@@ -809,7 +809,7 @@ void DeallocateTileDatabase( )
{
INT32 cnt;
for( cnt = 0; cnt < NUMBEROFTILES; cnt++ )
for( cnt = 0; cnt < giNumberOfTiles; cnt++ )
{
// Check if an existing set of animated tiles are in place, remove if found
if ( gTileDatabase[ cnt ].pAnimData != NULL )
@@ -1013,7 +1013,7 @@ BOOLEAN GetTypeSubIndexFromTileIndex( UINT32 uiCheckType, UINT16 usIndex, UINT16
*pusSubIndex = 0xffff;
CHECKF ( uiCheckType < NUMBEROFTILETYPES );
CHECKF ( uiCheckType < giNumberOfTileTypes );
*pusSubIndex = usIndex - gTileTypeStartIndex[ uiCheckType ] + 1;
@@ -1026,7 +1026,7 @@ BOOLEAN GetTypeSubIndexFromTileIndexChar( UINT32 uiCheckType, UINT16 usIndex, UI
// Tile database is zero-based, Type indecies are 1-based!
CHECKF ( uiCheckType < NUMBEROFTILETYPES );
CHECKF ( uiCheckType < giNumberOfTileTypes );
*pubSubIndex = (UINT8)(usIndex - gTileTypeStartIndex[ uiCheckType ] + 1);
@@ -1039,7 +1039,7 @@ BOOLEAN GetTileIndexFromTypeSubIndex( UINT32 uiCheckType, UINT16 usSubIndex, UIN
*pusTileIndex = 0xffff;
CHECKF ( uiCheckType < NUMBEROFTILETYPES );
CHECKF ( uiCheckType < giNumberOfTileTypes );
*pusTileIndex = usSubIndex + gTileTypeStartIndex[ uiCheckType ] - 1;
@@ -1069,7 +1069,7 @@ BOOLEAN GetTileType( UINT16 usIndex, UINT32 *puiType )
*puiType = 0xffffffff;
CHECKF( usIndex != NO_TILE );
CHECKF( usIndex < NUMBEROFTILES ); //lal bugfix
CHECKF( usIndex < giNumberOfTiles ); //lal bugfix
// Get tile element
TileElem = gTileDatabase[ usIndex ];
@@ -1086,7 +1086,7 @@ BOOLEAN GetTileFlags( UINT16 usIndex, UINT32 *puiFlags )
*puiFlags = 0;
CHECKF( usIndex != NO_TILE );
CHECKF( usIndex < NUMBEROFTILES );
CHECKF( usIndex < giNumberOfTiles );
// Get tile element
TileElem = gTileDatabase[ usIndex ];
@@ -1225,7 +1225,7 @@ BOOLEAN GetWallOrientation( UINT16 usIndex, UINT16 *pusWallOrientation )
*pusWallOrientation = 0xffff;
CHECKF( usIndex != NO_TILE );
CHECKF( usIndex < NUMBEROFTILES ); //lal bugfix
CHECKF( usIndex < giNumberOfTiles ); //lal bugfix
// Get tile element
TileElem = gTileDatabase[ usIndex ];
+12 -10
View File
@@ -292,6 +292,8 @@ BOOLEAN InitializeWorld( )
giOldTilesetUsed = -1;
#endif
SetNumberOfTiles();
// DB Adds the _8 to the names if we're in 8 bit mode.
//ProcessTilesetNamesForBPP();
@@ -399,7 +401,7 @@ BOOLEAN LoadTileSurfaces( char ppTileSurfaceFilenames[][32], UINT8 ubTilesetID )
}
else
{
for (uiLoop = 0; uiLoop < NUMBEROFTILETYPES; uiLoop++)
for (uiLoop = 0; uiLoop < giNumberOfTileTypes; uiLoop++)
strcpy( TileSurfaceFilenames[uiLoop], ppTileSurfaceFilenames[uiLoop] );//(ppTileSurfaceFilenames + (65 * uiLoop)) );
}
@@ -413,7 +415,7 @@ BOOLEAN LoadTileSurfaces( char ppTileSurfaceFilenames[][32], UINT8 ubTilesetID )
//uiFillColor = Get16BPPColor(FROMRGB( 100, 0, 0 ));
// load the tile surfaces
SetRelativeStartAndEndPercentage( 0, 1, 35, L"Tile Surfaces" );
for (uiLoop = 0; uiLoop < NUMBEROFTILETYPES; uiLoop++)
for (uiLoop = 0; uiLoop < giNumberOfTileTypes; uiLoop++)
{
@@ -431,7 +433,7 @@ BOOLEAN LoadTileSurfaces( char ppTileSurfaceFilenames[][32], UINT8 ubTilesetID )
gbDefaultSurfaceUsed[ uiLoop ] = FALSE;
}
#endif
uiPercentage = (uiLoop * 100) / (NUMBEROFTILETYPES-1);
uiPercentage = (uiLoop * 100) / (giNumberOfTileTypes-1);
RenderProgressBar( 0, uiPercentage );
//uiFillColor = Get16BPPColor(FROMRGB( 100 + uiPercentage , 0, 0 ));
@@ -672,7 +674,7 @@ void BuildTileShadeTables( )
memset( gbNewTileSurfaceLoaded, 1, sizeof( gbNewTileSurfaceLoaded ) );
}
for (uiLoop = 0; uiLoop < NUMBEROFTILETYPES; uiLoop++)
for (uiLoop = 0; uiLoop < giNumberOfTileTypes; uiLoop++)
{
if ( gTileSurfaceArray[ uiLoop ] != NULL )
{
@@ -695,7 +697,7 @@ void BuildTileShadeTables( )
#ifdef JA2TESTVERSION
uiNumImagesReloaded++;
#endif
RenderProgressBar( 0, uiLoop * 100 / NUMBEROFTILETYPES );
RenderProgressBar( 0, uiLoop * 100 / giNumberOfTileTypes );
CreateTilePaletteTables( gTileSurfaceArray[ uiLoop ]->vo, uiLoop, fForceRebuildForSlot );
}
}
@@ -718,7 +720,7 @@ void DestroyTileShadeTables( )
{
UINT32 uiLoop;
for (uiLoop = 0; uiLoop < NUMBEROFTILETYPES; uiLoop++)
for (uiLoop = 0; uiLoop < giNumberOfTileTypes; uiLoop++)
{
if ( gTileSurfaceArray[ uiLoop ] != NULL )
{
@@ -742,7 +744,7 @@ void DestroyTileSurfaces( )
{
UINT32 uiLoop;
for (uiLoop = 0; uiLoop < NUMBEROFTILETYPES; uiLoop++)
for (uiLoop = 0; uiLoop < giNumberOfTileTypes; uiLoop++)
{
if ( gTileSurfaceArray[ uiLoop ] != NULL )
{
@@ -786,7 +788,7 @@ void CompileWorldTerrainIDs( void )
}
}
if (pNode == NULL || pNode->usIndex >= NUMBEROFTILES || gTileDatabase[ pNode->usIndex ].ubTerrainID == NO_TERRAIN)
if (pNode == NULL || pNode->usIndex >= giNumberOfTiles || gTileDatabase[ pNode->usIndex ].ubTerrainID == NO_TERRAIN)
{ // Try terrain instead!
pNode = gpWorldLevelData[ sGridNo ].pLandHead;
}
@@ -3618,7 +3620,7 @@ BOOLEAN SaveMapTileset( INT32 iTilesetID )
}
// Save current tile set in map file.
for ( cnt = 0; cnt < NUMBEROFTILETYPES; cnt++ )
for ( cnt = 0; cnt < giNumberOfTileTypes; cnt++ )
FileWrite( hTSet, TileSurfaceFilenames[cnt], 65, &uiBytesWritten );
FileClose( hTSet );
@@ -3953,7 +3955,7 @@ void RemoveWireFrameTiles( INT32 sGridNo )
{
pNewTopmost = pTopmost->pNext;
if ( pTopmost->usIndex < NUMBEROFTILES )
if ( pTopmost->usIndex < giNumberOfTiles )
{
pTileElement = &(gTileDatabase[ pTopmost->usIndex ]);
+22 -22
View File
@@ -130,7 +130,7 @@ BOOLEAN TypeExistsInLevel( LEVELNODE *pStartNode, UINT32 fType, UINT16 *pusIndex
while( pStartNode != NULL )
{
if ( pStartNode->usIndex != NO_TILE && pStartNode->usIndex < NUMBEROFTILES )
if ( pStartNode->usIndex != NO_TILE && pStartNode->usIndex < giNumberOfTiles )
{
GetTileType( pStartNode->usIndex, &fTileType );
@@ -369,7 +369,7 @@ BOOLEAN TypeRangeExistsInObjectLayer( INT32 iMapIndex, UINT32 fStartType, UINT32
pOldObject = pObject;
pObject = pObject->pNext;
if ( pOldObject->usIndex != NO_TILE && pOldObject->usIndex < NUMBEROFTILES )
if ( pOldObject->usIndex != NO_TILE && pOldObject->usIndex < giNumberOfTiles )
{
GetTileType( pOldObject->usIndex, &fTileType );
@@ -442,7 +442,7 @@ BOOLEAN RemoveAllObjectsOfTypeRange( INT32 iMapIndex, UINT32 fStartType, UINT32
pOldObject = pObject;
pObject = pObject->pNext;
if ( pOldObject->usIndex != NO_TILE && pOldObject->usIndex < NUMBEROFTILES )
if ( pOldObject->usIndex != NO_TILE && pOldObject->usIndex < giNumberOfTiles )
{
GetTileType( pOldObject->usIndex, &fTileType );
@@ -525,7 +525,7 @@ BOOLEAN AddLandToHead( INT32 iMapIndex, UINT16 usIndex )
pNextLand->usIndex = usIndex;
pNextLand->ubShadeLevel = LightGetAmbient();
if ( usIndex < NUMBEROFTILES )
if ( usIndex < giNumberOfTiles )
{
// Get tile element
TileElem = gTileDatabase[ usIndex ];
@@ -629,7 +629,7 @@ BOOLEAN AdjustForFullTile( INT32 iMapIndex )
while( pLand != NULL )
{
if ( pLand->usIndex < NUMBEROFTILES )
if ( pLand->usIndex < giNumberOfTiles )
{
// If this is a full tile, set new full tile
TileElem = gTileDatabase[ pLand->usIndex ];
@@ -1101,7 +1101,7 @@ LEVELNODE *AddStructToTailCommon( INT32 iMapIndex, UINT16 usIndex, BOOLEAN fAddS
if ( fAddStructDBInfo )
{
if ( usIndex < NUMBEROFTILES )
if ( usIndex < giNumberOfTiles )
{
if (gTileDatabase[usIndex].pDBStructureRef != NULL)
{
@@ -1138,7 +1138,7 @@ LEVELNODE *AddStructToTailCommon( INT32 iMapIndex, UINT16 usIndex, BOOLEAN fAddS
if ( fAddStructDBInfo )
{
if ( usIndex < NUMBEROFTILES )
if ( usIndex < giNumberOfTiles )
{
if (gTileDatabase[usIndex].pDBStructureRef != NULL)
@@ -1163,7 +1163,7 @@ LEVELNODE *AddStructToTailCommon( INT32 iMapIndex, UINT16 usIndex, BOOLEAN fAddS
}
// Check flags for tiledat and set a shadow if we have a buddy
if ( usIndex < NUMBEROFTILES )
if ( usIndex < giNumberOfTiles )
{
if ( !GridNoIndoors( iMapIndex ) && gTileDatabase[ usIndex ].uiFlags & HAS_SHADOW_BUDDY && gTileDatabase[ usIndex ].sBuddyNum != -1 )
{
@@ -1210,7 +1210,7 @@ BOOLEAN AddStructToHead( INT32 iMapIndex, UINT16 usIndex )
CHECKF( CreateLevelNode( &pNextStruct ) != FALSE );
if ( usIndex < NUMBEROFTILES )
if ( usIndex < giNumberOfTiles )
{
if (gTileDatabase[usIndex].pDBStructureRef != NULL)
{
@@ -1231,7 +1231,7 @@ BOOLEAN AddStructToHead( INT32 iMapIndex, UINT16 usIndex )
SetWorldFlagsFromNewNode( iMapIndex, pNextStruct->usIndex );
if ( usIndex < NUMBEROFTILES )
if ( usIndex < giNumberOfTiles )
{
// Check flags for tiledat and set a shadow if we have a buddy
if ( !GridNoIndoors( iMapIndex ) && gTileDatabase[ usIndex ].uiFlags & HAS_SHADOW_BUDDY && gTileDatabase[ usIndex ].sBuddyNum != -1 )
@@ -1311,7 +1311,7 @@ BOOLEAN InsertStructIndex( INT32 iMapIndex, UINT16 usIndex, UINT8 ubLevel )
return( FALSE );
}
if ( usIndex < NUMBEROFTILES )
if ( usIndex < giNumberOfTiles )
{
if (gTileDatabase[usIndex].pDBStructureRef != NULL)
{
@@ -1391,7 +1391,7 @@ BOOLEAN RemoveStructFromTailCommon( INT32 iMapIndex, BOOLEAN fRemoveStructDBInfo
MemFree( pStruct );
guiLevelNodes--;
if ( usIndex < NUMBEROFTILES )
if ( usIndex < giNumberOfTiles )
{
// Check flags for tiledat and set a shadow if we have a buddy
if ( !GridNoIndoors( iMapIndex ) && gTileDatabase[ usIndex ].uiFlags & HAS_SHADOW_BUDDY && gTileDatabase[ usIndex ].sBuddyNum != -1 )
@@ -1454,7 +1454,7 @@ BOOLEAN RemoveStruct( INT32 iMapIndex, UINT16 usIndex )
//If we have to, make sure to remove this node when we reload the map from a saved game
RemoveStructFromMapTempFile( iMapIndex, usIndex );
if ( usIndex < NUMBEROFTILES )
if ( usIndex < giNumberOfTiles )
{
// Check flags for tiledat and set a shadow if we have a buddy
if ( !GridNoIndoors( iMapIndex ) && gTileDatabase[ usIndex ].uiFlags & HAS_SHADOW_BUDDY && gTileDatabase[ usIndex ].sBuddyNum != -1 )
@@ -1515,7 +1515,7 @@ BOOLEAN RemoveStructFromLevelNode( INT32 iMapIndex, LEVELNODE *pNode )
//If we have to, make sure to remove this node when we reload the map from a saved game
RemoveStructFromMapTempFile( iMapIndex, usIndex );
if ( pNode->usIndex < NUMBEROFTILES )
if ( pNode->usIndex < giNumberOfTiles )
{
// Check flags for tiledat and set a shadow if we have a buddy
if ( !GridNoIndoors( iMapIndex ) && gTileDatabase[ usIndex ].uiFlags & HAS_SHADOW_BUDDY && gTileDatabase[ usIndex ].sBuddyNum != -1 )
@@ -1571,7 +1571,7 @@ BOOLEAN RemoveAllStructsOfTypeRange( INT32 iMapIndex, UINT32 fStartType, UINT32
usIndex = pOldStruct->usIndex;
// Remove Item
if ( usIndex < NUMBEROFTILES )
if ( usIndex < giNumberOfTiles )
{
RemoveStruct( iMapIndex, pOldStruct->usIndex );
fRetVal = TRUE;
@@ -2411,7 +2411,7 @@ LEVELNODE *AddRoofToTail( INT32 iMapIndex, UINT16 usIndex )
{
CHECKF( CreateLevelNode( &pRoof ) != FALSE );
if ( usIndex < NUMBEROFTILES )
if ( usIndex < giNumberOfTiles )
{
if (gTileDatabase[usIndex].pDBStructureRef != NULL)
{
@@ -2438,7 +2438,7 @@ LEVELNODE *AddRoofToTail( INT32 iMapIndex, UINT16 usIndex )
{
CHECKF( CreateLevelNode( &pNextRoof ) != FALSE );
if ( usIndex < NUMBEROFTILES )
if ( usIndex < giNumberOfTiles )
{
if (gTileDatabase[usIndex].pDBStructureRef != NULL)
{
@@ -2481,7 +2481,7 @@ BOOLEAN AddRoofToHead( INT32 iMapIndex, UINT16 usIndex )
CHECKF( CreateLevelNode( &pNextRoof ) != FALSE );
if ( usIndex < NUMBEROFTILES )
if ( usIndex < giNumberOfTiles )
{
if (gTileDatabase[usIndex].pDBStructureRef != NULL)
{
@@ -2769,7 +2769,7 @@ LEVELNODE *AddOnRoofToTail( INT32 iMapIndex, UINT16 usIndex )
{
CHECKF( CreateLevelNode( &pOnRoof ) != FALSE );
if ( usIndex < NUMBEROFTILES )
if ( usIndex < giNumberOfTiles )
{
if (gTileDatabase[usIndex].pDBStructureRef != NULL)
{
@@ -2798,7 +2798,7 @@ LEVELNODE *AddOnRoofToTail( INT32 iMapIndex, UINT16 usIndex )
{
CHECKF( CreateLevelNode( &pNextOnRoof ) != FALSE );
if ( usIndex < NUMBEROFTILES )
if ( usIndex < giNumberOfTiles )
{
if (gTileDatabase[usIndex].pDBStructureRef != NULL)
{
@@ -2838,7 +2838,7 @@ BOOLEAN AddOnRoofToHead( INT32 iMapIndex, UINT16 usIndex )
pOnRoof = gpWorldLevelData[ iMapIndex ].pOnRoofHead;
CHECKF( CreateLevelNode( &pNextOnRoof ) != FALSE );
if ( usIndex < NUMBEROFTILES )
if ( usIndex < giNumberOfTiles )
{
if (gTileDatabase[usIndex].pDBStructureRef != NULL)
{
@@ -3226,7 +3226,7 @@ BOOLEAN RemoveAllTopmostsOfTypeRange( INT32 iMapIndex, UINT32 fStartType, UINT32
pOldTopmost = pTopmost;
pTopmost = pTopmost->pNext;
if ( pOldTopmost->usIndex != NO_TILE && pOldTopmost->usIndex < NUMBEROFTILES )
if ( pOldTopmost->usIndex != NO_TILE && pOldTopmost->usIndex < giNumberOfTiles )
{
GetTileType( pOldTopmost->usIndex, &fTileType );
+3 -1
View File
@@ -5109,7 +5109,9 @@ STR16 zOptionsToggleText[] =
L"显示脸部装备图",
L"显示脸部装备图标",
L"禁止光标切换", // Disable Cursor Swap
L"Quiet Training", // Madd: mercs don't say quotes while training // TODO.Translate
L"Quiet Training", // Madd: mercs don't say quotes while training // TODO.Translate
L"Quiet Repairing", // Madd: mercs don't say quotes while repairing //TODO.Translate
L"Quiet Doctoring", // Madd: mercs don't say quotes while doctoring //TODO.Translate
L"自动加速敌军回合", // Automatic fast forward through AI turns
L"Allow Zombies", // TODO.Translate
//L"武器过热",
+2
View File
@@ -5109,6 +5109,8 @@ STR16 zOptionsToggleText[] =
L"Show Face gear icons",
L"Uit te schakelen Cursor Swap", // Disable Cursor Swap
L"Quiet Training", // Madd: mercs don't say quotes while training // TODO.Translate
L"Quiet Repairing", // Madd: mercs don't say quotes while repairing //TODO.Translate
L"Quiet Doctoring", // Madd: mercs don't say quotes while doctoring //TODO.Translate
L"Auto Fast Forward AI Turns", // Automatic fast forward through AI turns // TODO.Translate
L"Allow Zombies", // TODO.Translate
//L"Weapons Overheating", // TODO.Translate
+3 -1
View File
@@ -5108,6 +5108,8 @@ STR16 zOptionsToggleText[] =
L"Show Face Gear Icons",
L"Disable Cursor Swap", // Disable Cursor Swap
L"Quiet Training", // Madd: mercs don't say quotes while training
L"Quiet Repairing", // Madd: mercs don't say quotes while repairing
L"Quiet Doctoring", // Madd: mercs don't say quotes while doctoring
L"Auto Fast Forward AI Turns", // Automatic fast forward through AI turns
L"Allow Zombies", // Flugente Zombies 1.0
//L"Weapons Overheating", // TODO.Translate
@@ -5219,7 +5221,7 @@ STR16 zOptionsScreenHelpText[] =
L"When ON, the cursor will not toggle between exchange position and other actions. Press |x to initiate quick exchange.",
L"When ON, mercs will not report progress during training.",
L"When ON, AI turns will be much faster.",
L"When ON, zombies will span. Be aware!", // allow zombies
L"When ON, zombies will spawn. Be aware!", // allow zombies
//L"When ON, weapons can be overheated when firing.", // TODO.Translate
L"(text not rendered)TOPTION_CHEAT_MODE_OPTIONS_HEADER",
L"Force all pending Bobby Ray shipments",
+2
View File
@@ -5099,6 +5099,8 @@ STR16 zOptionsToggleText[] =
L"Afficher icones portraits",
L"Désactiver échange curseur", // Disable Cursor Swap
L"Quiet Training", // Madd: mercs don't say quotes while training // TODO.Translate
L"Quiet Repairing", // Madd: mercs don't say quotes while repairing //TODO.Translate
L"Quiet Doctoring", // Madd: mercs don't say quotes while doctoring //TODO.Translate
L"Auto Fast Forward AI Turns", // Automatic fast forward through AI turns // TODO.Translate
L"Allow Zombies", // Flugente Zombies 1.0
//L"Weapons Overheating", // TODO.Translate
+2
View File
@@ -4957,6 +4957,8 @@ STR16 zOptionsToggleText[] =
L"Gesichtsequipment-Icons",
L"Cursor-Wechsel deaktivieren", // Disable Cursor Swap
L"Stummes Trainieren", // Madd: mercs don't say quotes while training
L"Quiet Repairing", // Madd: mercs don't say quotes while repairing TODO.Translate
L"Quiet Doctoring", // Madd: mercs don't say quotes while doctoring TODO.Translate
L"Autom. schnelle Gegner-Züge", // Automatic fast forward through AI turns
L"Allow Zombies", // Flugente Zombies 1.0
//L"Waffen können überhitzen",
+2
View File
@@ -5094,6 +5094,8 @@ STR16 zOptionsToggleText[] =
L"Show Face gear icons",
L"Disabilita Swap Cursore", // Disable Cursor Swap
L"Quiet Training", // Madd: mercs don't say quotes while training // TODO.Translate
L"Quiet Repairing", // Madd: mercs don't say quotes while repairing //TODO.Translate
L"Quiet Doctoring", // Madd: mercs don't say quotes while doctoring //TODO.Translate
L"Auto Fast Forward AI Turns", // Automatic fast forward through AI turns // TODO.Translate
L"Allow Zombies", // Flugente Zombies 1.0
//L"Weapons Overheating", // TODO.Translate
+2
View File
@@ -5106,6 +5106,8 @@ STR16 zOptionsToggleText[] =
L"Show Face gear icons",
L"Disable Cursor Swap", // Disable Cursor Swap // TODO.Translate
L"Quiet Training", // Madd: mercs don't say quotes while training // TODO.Translate
L"Quiet Repairing", // Madd: mercs don't say quotes while repairing //TODO.Translate
L"Quiet Doctoring", // Madd: mercs don't say quotes while doctoring //TODO.Translate
L"Auto Fast Forward AI Turns", // Automatic fast forward through AI turns // TODO.Translate
L"Allow Zombies", // Flugente Zombies 1.0
//L"Weapons Overheating", // TODO.Translate
+2
View File
@@ -5089,6 +5089,8 @@ STR16 zOptionsToggleText[] =
L"Показать иконки снаряжения",
L"Disable Cursor Swap", // Disable Cursor Swap // TODO.Translate
L"Quiet Training", // Madd: mercs don't say quotes while training // TODO.Translate
L"Quiet Repairing", // Madd: mercs don't say quotes while repairing //TODO.Translate
L"Quiet Doctoring", // Madd: mercs don't say quotes while doctoring //TODO.Translate
L"Auto Fast Forward AI Turns", // Automatic fast forward through AI turns // TODO.Translate
L"Allow Zombies", // Flugente Zombies 1.0
//L"Weapons Overheating", // TODO.Translate
+2
View File
@@ -5110,6 +5110,8 @@ STR16 zOptionsToggleText[] =
L"Show Face gear icons",
L"Disable Cursor Swap", // Disable Cursor Swap
L"Quiet Training", // Madd: mercs don't say quotes while training // TODO.Translate
L"Quiet Repairing", // Madd: mercs don't say quotes while repairing //TODO.Translate
L"Quiet Doctoring", // Madd: mercs don't say quotes while doctoring //TODO.Translate
L"Auto Fast Forward AI Turns", // Automatic fast forward through AI turns // TODO.Translate
L"Allow Zombies", // Flugente Zombies 1.0
//L"Weapons Overheating", // TODO.Translate