6 Commits
Author SHA1 Message Date
Asdow 133f346cdb Remove DrawlapTopIcons()
Empty function
2024-10-04 21:16:43 +03:00
Asdow f46e3f1004 Remove dsutil.cpp & .h
Not used anywhere.
2024-08-15 22:14:37 +03:00
Asdow bba7528c76 Remove HandleLimitedNumExecutions()
Not called anywhere in the code. Plus, if we limit the amount of time 1.13 can be played to 10 starts, we'll have at least 5 angry players
2024-08-15 22:07:38 +03:00
Asdow eed4156d48 Remove useless CD check 2024-08-15 22:04:55 +03:00
Asdow 23bf32e4ad Delete Win Util.cpp & .h
Not used anywhere in the code.
2024-08-15 21:58:24 +03:00
Asdow 3bfebf6c8d Remove useless function 2024-08-15 21:55:27 +03:00
427 changed files with 9888 additions and 5880 deletions
+2 -1
View File
@@ -186,6 +186,7 @@ jobs:
merge-multiple: true merge-multiple: true
- name: Checkout Repo - name: Checkout Repo
if: github.ref == 'refs/heads/master'
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
path: source path: source
@@ -200,7 +201,6 @@ jobs:
git push --delete origin refs/tags/latest || true git push --delete origin refs/tags/latest || true
git tag latest git tag latest
git push --force origin refs/tags/latest git push --force origin refs/tags/latest
sleep 15 # make sure github can find the tag for gh release
gh release create latest ../dist/* \ gh release create latest ../dist/* \
--generate-notes \ --generate-notes \
--title "Latest (unstable)" \ --title "Latest (unstable)" \
@@ -213,6 +213,7 @@ jobs:
if: startsWith(github.ref, 'refs/tags/v') if: startsWith(github.ref, 'refs/tags/v')
working-directory: source working-directory: source
run: | run: |
exit 0
gh release upload "$GITHUB_REF_NAME" ../dist/* --clobber gh release upload "$GITHUB_REF_NAME" ../dist/* --clobber
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+2 -12
View File
@@ -54,22 +54,12 @@ jobs:
sed -i "s|@Build@|${GAME_BUILD:0:255}|" Ja2/GameVersion.cpp sed -i "s|@Build@|${GAME_BUILD:0:255}|" Ja2/GameVersion.cpp
cat Ja2/GameVersion.cpp cat Ja2/GameVersion.cpp
- name: Turn on link-time optimization?
if: fromJSON(inputs.assemble)
shell: bash
run: |
set -eux
echo "
LTO=ON
" >> $GITHUB_ENV
- name: Prepare build properties - name: Prepare build properties
shell: bash shell: bash
run: | run: |
set -eux set -eux
touch CMakePresets.json touch CMakeUserPresets.json
JA2Language=$(echo '${{ inputs.language }}' | tr '[:lower:]' '[:upper:]') JA2Language=$(echo '${{ inputs.language }}' | tr '[:lower:]' '[:upper:]')
JA2Application=$(echo '${{ matrix.application }}' | tr '[:lower:]' '[:upper:]') JA2Application=$(echo '${{ matrix.application }}' | tr '[:lower:]' '[:upper:]')
@@ -87,7 +77,7 @@ jobs:
arch: x86 arch: x86
- name: Prepare build - name: Prepare build
run: | run: |
cmake -S . -B build -GNinja -DCMAKE_BUILD_TYPE=Release -DLanguages="$Env:JA2Language" -DApplications="$Env:JA2Application" -DLTO_OPTION="$Env:LTO" cmake -S . -B build -GNinja -DCMAKE_BUILD_TYPE=Release -DLanguages="$Env:JA2Language" -DApplications="$Env:JA2Application"
- name: Build - name: Build
run: | run: |
cmake --build build/ -- -v cmake --build build/ -- -v
+1 -1
View File
@@ -6,6 +6,6 @@
/.vs/ /.vs/
/build/ /build/
/out/ /out/
/CMakePresets.json
/CMakeSettings.json /CMakeSettings.json
/CMakeUserPresets.json
/lib/ /lib/
+60 -109
View File
@@ -9,25 +9,10 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_EXTENSIONS OFF)
option(LTO_OPTION "Enable link-time optimization if supported by compiler" OFF)
include(CheckIPOSupported)
check_ipo_supported(RESULT LinkTimeOptimization OUTPUT IpoError LANGUAGES C CXX)
if(LinkTimeOptimization AND LTO_OPTION)
message(STATUS "Configuring WITH link-time optimization")
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
else()
message(STATUS "Configuring WITHOUT link-time optimization ${IpoError}")
endif()
option(ADDRESS_SANITIZER OFF) option(ADDRESS_SANITIZER OFF)
if(ADDRESS_SANITIZER) if(ADDRESS_SANITIZER)
message(STATUS "AddressSanitizer ENABLED for non-Release builds") message(STATUS "AddressSanitizer ENABLED for non-Release builds")
add_compile_options($<IF:$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>,-fsanitize=address,>) add_compile_options($<IF:$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>,-fsanitize=address,>)
endif()
if(MSVC)
add_compile_options("/wd4838")
endif() endif()
# whether we are using MSBuild as a generator # whether we are using MSBuild as a generator
@@ -38,24 +23,7 @@ set(usingMsBuild $<STREQUAL:${CMAKE_VS_PLATFORM_NAME},Win32>)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>") set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
add_compile_definitions(CINTERFACE XML_STATIC VFS_STATIC VFS_WITH_SLF VFS_WITH_7ZIP _CRT_SECURE_NO_DEPRECATE) add_compile_definitions(CINTERFACE XML_STATIC VFS_STATIC VFS_WITH_SLF VFS_WITH_7ZIP _CRT_SECURE_NO_DEPRECATE)
include_directories( include_directories(Ja2 "ext/VFS/include" Utils TileEngine TacticalAI "ModularizedTacticalAI/include" Tactical Strategic sgp "Ja2/Res" Lua Laptop Multiplayer Editor Console)
"${CMAKE_SOURCE_DIR}/Ja2"
"${CMAKE_SOURCE_DIR}/ext/VFS/include"
"${CMAKE_SOURCE_DIR}/Utils"
"${CMAKE_SOURCE_DIR}/TileEngine"
"${CMAKE_SOURCE_DIR}/TacticalAI"
"${CMAKE_SOURCE_DIR}/ModularizedTacticalAI/include"
"${CMAKE_SOURCE_DIR}/Tactical"
"${CMAKE_SOURCE_DIR}/Strategic"
"${CMAKE_SOURCE_DIR}/sgp"
"${CMAKE_SOURCE_DIR}/Ja2/Res"
"${CMAKE_SOURCE_DIR}/Lua"
"${CMAKE_SOURCE_DIR}/Laptop"
"${CMAKE_SOURCE_DIR}/Multiplayer"
"${CMAKE_SOURCE_DIR}/Editor"
"${CMAKE_SOURCE_DIR}/Console"
"${CMAKE_SOURCE_DIR}/i18n/include"
)
# external libraries # external libraries
add_subdirectory("ext/libpng") add_subdirectory("ext/libpng")
@@ -66,46 +34,32 @@ target_link_libraries(bfVFS PRIVATE 7z)
# ja2export utility # ja2export utility
add_subdirectory("ext/export/src") add_subdirectory("ext/export/src")
# static libraries whose translation units don't rely on Application preprocessor definitions. # static libraries whose source files, header files or header files included
add_subdirectory(lua) # by header files do not rely on Applications or Languages preprocessor definitions,
# and therefore only need to be compiled once. Good.
add_subdirectory(Lua)
add_subdirectory(Multiplayer) add_subdirectory(Multiplayer)
add_subdirectory(wine)
set(Ja2_Libraries # static libraries whose source files, header files or header files included
"${CMAKE_SOURCE_DIR}/binkw32.lib" # by header files rely on Application and Language preprocessor definitions, and
"${CMAKE_SOURCE_DIR}/libexpatMT.lib" # therefore need to be compiled multiple times. Very Bad.
"${CMAKE_SOURCE_DIR}/lua51.lib"
"${CMAKE_SOURCE_DIR}/lua51.vc9.lib"
"${CMAKE_SOURCE_DIR}/SMACKW32.LIB"
"Dbghelp.lib"
"Winmm.lib"
"ws2_32.lib"
bfVFS
Lua
Multiplayer
wine
)
# static libraries whose translation units rely on Application preprocessor definitions.
set(Ja2_Libs set(Ja2_Libs
Console TileEngine
Editor TacticalAI
Ja2 Utils
Laptop Strategic
ModularizedTacticalAI sgp
sgp Laptop
Strategic Editor
Tactical Console
TacticalAI Tactical
TileEngine ModularizedTacticalAI
Utils
) )
foreach(lib IN LISTS Ja2_Libs) foreach(lib IN LISTS Ja2_Libs)
add_subdirectory(${lib}) add_subdirectory(${lib})
endforeach() endforeach()
# language library relies on Application _and_ Language preprocessor definition. very bad. add_subdirectory(Ja2)
add_subdirectory(i18n)
# simple function to validate Languages and Application choices # simple function to validate Languages and Application choices
include(cmake/ValidateOptions.cmake) include(cmake/ValidateOptions.cmake)
@@ -120,50 +74,47 @@ ValidateOptions("${ValidApplications}" "Applications" "${Applications}" "Applica
# preprocessor definitions for Debug build, per the legacy MSBuild # preprocessor definitions for Debug build, per the legacy MSBuild
set(debugFlags $<IF:$<CONFIG:Debug>,JA2BETAVERSION;JA2TESTVERSION;DEBUG_ATTACKBUSY,>) set(debugFlags $<IF:$<CONFIG:Debug>,JA2BETAVERSION;JA2TESTVERSION;DEBUG_ATTACKBUSY,>)
foreach(app IN LISTS ApplicationTargets) # Due to widespread preprocessor definition abuse in the codebase, practically
set(isEditor $<STREQUAL:${app},JA2MAPEDITOR>) # every library-language-executable combination is its own compilation target
set(isUb $<STREQUAL:${app},JA2UB>) # TODO: refactor preprocessor usage onto, ideally, a single translation unit
set(isUbEditor $<STREQUAL:${app},JA2UBMAPEDITOR>) foreach(lang IN LISTS LangTargets)
set(compilationFlags foreach(exe IN LISTS ApplicationTargets)
$<IF:${isEditor},JA2EDITOR;JA2BETAVERSION,> set(Executable ${exe}_${lang})
$<IF:${isUb},JA2UB;JA2UBMAPS,>
$<IF:${isUbEditor},JA2UB;JA2UBMAPS;JA2EDITOR;JA2BETAVERSION,>
)
foreach(lib IN LISTS Ja2_Libs) # executable for an application/language combination, e.g. JA2_ENGLISH.exe
# library for an application, e.g. JA2UB_sgp add_executable(${Executable} WIN32)
set(game_library ${app}_${lib}) target_sources(${Executable} PRIVATE ${Ja2Src})
add_library(${game_library})
target_sources(${game_library} PRIVATE ${${lib}Src})
target_compile_definitions(${game_library} PRIVATE ${compilationFlags} ${debugFlags})
endforeach()
foreach(lang IN LISTS LangTargets) # Good libraries have already been built, can be simply linked here
# executable for an application/language combination, e.g. JA2_ENGLISH.exe target_link_libraries(${Executable} PRIVATE ${Ja2_Libraries} $<IF:${usingMsBuild},legacy_stdio_definitions.lib,>)
set(exe ${app}_${lang}) target_link_options(${Executable} PRIVATE $<IF:${usingMsBuild},/SAFESEH:NO,>)
add_executable(${exe} WIN32
sgp/sgp.cpp
Ja2/Res/ja2.rc
)
target_link_libraries(${exe} PRIVATE ${Ja2_Libraries} $<IF:${usingMsBuild},legacy_stdio_definitions.lib,>)
target_link_options(${exe} PRIVATE $<IF:${usingMsBuild},/SAFESEH:NO,>)
target_compile_definitions(${exe} PRIVATE ${compilationFlags} ${debugFlags})
# language library for an application, e.g. JA2MAPEDITOR_ENGLISH_i18n # for each app/lang combination, the Very Bad libraries need to be built,
set(language_library ${exe}_i18n) # with the appropriate preprocessor definitions
add_library(${language_library}) foreach(lib IN LISTS Ja2_Libs)
target_sources(${language_library} PRIVATE ${i18nSrc}) # syntactic sugar to hopefully make this more readable
target_compile_definitions(${language_library} PRIVATE ${compilationFlags} ${debugFlags} ${lang}) set(VeryBadLib ${Executable}_${lib})
target_link_libraries(${exe} PRIVATE ${language_library}) set(isEditor $<STREQUAL:${exe},JA2MAPEDITOR>)
set(isUb $<STREQUAL:${exe},JA2UB>)
set(isUbEditor $<STREQUAL:${exe},JA2UBMAPEDITOR>)
# go through all game libraries again and link them to the app/language executable # static library for an app/lang combination, e.g. JA2_ENGLISH_sgp.lib
foreach(lib IN LISTS Ja2_Libs) add_library(${VeryBadLib})
target_link_libraries(${exe} PRIVATE ${app}_${lib}) target_sources(${VeryBadLib} PRIVATE ${${lib}Src})
endforeach()
endforeach()
# for SGP only target_compile_definitions(${VeryBadLib} PUBLIC
target_link_libraries(${app}_sgp PRIVATE "ddraw.lib" "${PROJECT_SOURCE_DIR}/fmodvc.lib") $<IF:${isEditor},JA2EDITOR;JA2BETAVERSION,>
target_link_libraries(${app}_sgp PRIVATE libpng) $<IF:${isUb},JA2UB;JA2UBMAPS,>
target_compile_definitions(${app}_sgp PRIVATE NO_ZLIB_COMPRESSION) $<IF:${isUbEditor},JA2UB;JA2UBMAPS;JA2EDITOR;JA2BETAVERSION,>
${debugFlags}
${lang}
)
target_link_libraries(${Executable} PUBLIC ${VeryBadLib})
endforeach()
# for sgp only
target_link_libraries(${Executable}_sgp PRIVATE "ddraw.lib" "${PROJECT_SOURCE_DIR}/fmodvc.lib")
target_link_libraries(${Executable}_sgp PUBLIC libpng)
target_compile_definitions(${Executable}_sgp PRIVATE NO_ZLIB_COMPRESSION)
endforeach()
endforeach() endforeach()
+2 -2
View File
@@ -152,7 +152,7 @@ void EntryInitEditorItemsInfo()
item = &Item[i]; item = &Item[i];
//if( Item[i].fFlags & ITEM_NOT_EDITOR ) //if( Item[i].fFlags & ITEM_NOT_EDITOR )
// continue; // continue;
if(ItemIsNotInEditor(i)) if(item->notineditor)
continue; continue;
if( i == SWITCH || i == ACTION_ITEM ) if( i == SWITCH || i == ACTION_ITEM )
{ {
@@ -331,7 +331,7 @@ void InitEditorItemsInfo(UINT32 uiItemType)
continue; continue;
} }
item = &Item[usCounter]; item = &Item[usCounter];
if(ItemIsNotInEditor(usCounter)) if(item->notineditor)
{ {
usCounter++; usCounter++;
continue; continue;
+1 -9
View File
@@ -173,15 +173,7 @@ void LoadSaveScreenEntry()
vfs::CVirtualProfile* prof = it.value(); vfs::CVirtualProfile* prof = it.value();
memset(&FileInfo, 0, sizeof(GETFILESTRUCT)); memset(&FileInfo, 0, sizeof(GETFILESTRUCT));
strcpy(FileInfo.zFileName, "< "); strcpy(FileInfo.zFileName, "< ");
// Cut filename off if it's too long for the buffer strcat(FileInfo.zFileName, prof->cName.utf8().c_str());
if (strlen(prof->cName.utf8().c_str()) > FILENAME_BUFLEN-4)
{
strncpy(FileInfo.zFileName+1, prof->cName.utf8().c_str(), FILENAME_BUFLEN-4);
}
else
{
strcat(FileInfo.zFileName, prof->cName.utf8().c_str());
}
strcat(FileInfo.zFileName, " >"); strcat(FileInfo.zFileName, " >");
FileInfo.zFileName[FILENAME_BUFLEN] = 0; FileInfo.zFileName[FILENAME_BUFLEN] = 0;
FileInfo.uiFileAttribs = FILE_IS_DIRECTORY; FileInfo.uiFileAttribs = FILE_IS_DIRECTORY;
+1 -1
View File
@@ -1,7 +1,7 @@
#include "BuildDefines.h" #include "BuildDefines.h"
#include "Fileman.h" #include "Fileman.h"
#define FILENAME_BUFLEN (30 + 4 + 1)//dnl ch39 190909 +4 is for ".dat", +1 is for '\0' //dnl ch81 021213 #define FILENAME_BUFLEN (20 + 4 + 1)//dnl ch39 190909 +4 is for ".dat", +1 is for '\0' //dnl ch81 021213
#ifdef JA2EDITOR #ifdef JA2EDITOR
+6 -34
View File
@@ -403,42 +403,14 @@ void PlaceRoadMacroAtGridNo( INT32 iMapIndex, INT32 iMacroID )
while( gRoadMacros[ i ].sMacroID == iMacroID ) while( gRoadMacros[ i ].sMacroID == iMacroID )
{ {
// need to recalc MACROSTRUCT::sOffset 'cause it sticked to 160*160 old map size // need to recalc MACROSTRUCT::sOffset 'cause it sticked to 160*160 old map size
INT32 sdY = gRoadMacros[ i ].sOffset / (OLD_WORLD_COLS); INT32 sdX = gRoadMacros[ i ].sOffset % OLD_WORLD_COLS;
INT32 sdX = gRoadMacros[ i ].sOffset - (sdY*OLD_WORLD_COLS); INT32 sdY = gRoadMacros[ i ].sOffset / OLD_WORLD_COLS;
// Take into account the dfference between old and new row size for tiles that are shifted
// by one row due to X offset
// For example:
// {RBR, 159},
//{ RBR, -159 },
//
// Offsets for 160x160 map
// [] [] [-159]
// [] [0] []
// [159] [] []
//
// Converted to 200x200 map
// [] [] [-199]
// [] [0] []
// [199] [] []
//
// Without this the original conversion would output 159 and -159 for X coordinate
if (sdX < -OLD_WORLD_COLS/2)
{
sdX -= WORLD_COLS - OLD_WORLD_COLS;
}
else if (sdX > OLD_WORLD_COLS / 2)
{
sdX += WORLD_COLS - OLD_WORLD_COLS;
}
INT32 sOffset = sdY*WORLD_COLS + sdX; INT32 sOffset = sdY*WORLD_COLS + sdX;
INT32 newGridNo = iMapIndex + sOffset; //
AddToUndoList( iMapIndex + sOffset );
AddToUndoList( newGridNo ); RemoveAllObjectsOfTypeRange( iMapIndex + sOffset, ROADPIECES, ROADPIECES );//dnl this was but is very wrong and leading to stacking tilesets, RemoveAllObjectsOfTypeRange( i, ROADPIECES, ROADPIECES );
RemoveAllObjectsOfTypeRange( newGridNo, ROADPIECES, ROADPIECES );//dnl this was but is very wrong and leading to stacking tilesets, RemoveAllObjectsOfTypeRange( i, ROADPIECES, ROADPIECES );
GetTileIndexFromTypeSubIndex( ROADPIECES, (UINT16)(i+1) , &usTileIndex ); GetTileIndexFromTypeSubIndex( ROADPIECES, (UINT16)(i+1) , &usTileIndex );
AddObjectToHead( newGridNo, usTileIndex ); AddObjectToHead( iMapIndex + sOffset, usTileIndex );
i++; i++;
} }
} }
+5 -19
View File
@@ -1,4 +1,4 @@
#include "builddefines.h" #include "builddefines.h"
#ifdef JA2EDITOR #ifdef JA2EDITOR
@@ -1069,7 +1069,10 @@ void ShowCurrentDrawingMode( void )
// Set the color for the window's border. Blueish color = Normal, Red = Fake lighting is turned on // Set the color for the window's border. Blueish color = Normal, Red = Fake lighting is turned on
usFillColor = GenericButtonFillColors[0]; usFillColor = GenericButtonFillColors[0];
pDestBuf = LockVideoSurface( FRAME_BUFFER, &uiDestPitchBYTES ); pDestBuf = LockVideoSurface( FRAME_BUFFER, &uiDestPitchBYTES );
RectangleDraw( FALSE, iScreenWidthOffset + 0, 2 * iScreenHeightOffset + 400, iScreenWidthOffset + 99, 2 * iScreenHeightOffset + 458, usFillColor, pDestBuf ); if(gbPixelDepth==16)
RectangleDraw( FALSE, iScreenWidthOffset + 0, 2 * iScreenHeightOffset + 400, iScreenWidthOffset + 99, 2 * iScreenHeightOffset + 458, usFillColor, pDestBuf );
else if(gbPixelDepth==8)
RectangleDraw8( FALSE, iScreenWidthOffset + 0, 2 * iScreenHeightOffset + 400, iScreenWidthOffset + 99, 2 * iScreenHeightOffset + 458, usFillColor, pDestBuf );
UnLockVideoSurface( FRAME_BUFFER ); UnLockVideoSurface( FRAME_BUFFER );
@@ -2951,23 +2954,6 @@ UINT32 WaitForSelectionWindowResponse( void )
} }
} }
// Mousewheel scroll
if (_WheelValue > 0)
{
while (_WheelValue--)
{
ScrollSelWinUp();
}
}
else
{
while (_WheelValue++)
{
ScrollSelWinDown();
}
}
_WheelValue = 0;
if ( DoWindowSelection( ) ) if ( DoWindowSelection( ) )
{ {
fSelectionWindow = FALSE; fSelectionWindow = FALSE;
+36 -60
View File
@@ -29,16 +29,6 @@ extern BOOLEAN fDontUseRandom;
extern UINT16 GenericButtonFillColors[40]; extern UINT16 GenericButtonFillColors[40];
struct SelectionWindow
{
SGPRect window;
SGPPoint displayAreaStart; // Area where selectable items are drawn
SGPPoint displayAreaEnd;
SGPPoint spacing; // For displayed items
};
SelectionWindow gSelection;
BOOLEAN gfRenderSquareArea = FALSE; BOOLEAN gfRenderSquareArea = FALSE;
INT16 iStartClickX,iStartClickY; INT16 iStartClickX,iStartClickY;
INT16 iEndClickX,iEndClickY; INT16 iEndClickX,iEndClickY;
@@ -50,6 +40,7 @@ INT32 iSelectWin,iCancelWin,iScrollUp,iScrollDown,iOkWin;
BOOLEAN fAllDone=FALSE; BOOLEAN fAllDone=FALSE;
BOOLEAN fButtonsPresent=FALSE; BOOLEAN fButtonsPresent=FALSE;
SGPPoint SelWinSpacing, SelWinStartPoint, SelWinEndPoint;
//These definitions help define the start and end of the various wall indices. //These definitions help define the start and end of the various wall indices.
//This needs to be maintained if the walls change. //This needs to be maintained if the walls change.
@@ -181,30 +172,6 @@ UINT16 SelWinHilightFillColor = 0x23BA; //blue, formerly 0x000d a kind of mediu
// //
void CreateJA2SelectionWindow( INT16 sWhat ) void CreateJA2SelectionWindow( INT16 sWhat )
{ {
auto selectWinWidth = 600;
const auto selectWinHeight = SCREEN_HEIGHT - 120; // From top edge to taskbar
if (iResolution > _800x600)
{
selectWinWidth = 900;
}
auto tlX = 0;
auto tlY = 0;
auto brX = tlX + selectWinWidth;
auto brY = tlY + selectWinHeight;
gSelection.window.iLeft = tlX;
gSelection.window.iTop = tlY;
gSelection.window.iRight = brX;
gSelection.window.iBottom = brY;
gSelection.displayAreaStart.iX = tlX + 1;
gSelection.displayAreaStart.iY = tlY + 15;
gSelection.displayAreaEnd.iX = brX - 1;
gSelection.displayAreaEnd.iY= brY - 1;
gSelection.spacing.iX = 2;
gSelection.spacing.iY = 2;
iTopWinCutOff = gSelection.displayAreaStart.iY;
iBotWinCutOff = gSelection.displayAreaEnd.iY;
DisplaySpec *pDSpec; DisplaySpec *pDSpec;
UINT16 usNSpecs; UINT16 usNSpecs;
@@ -218,33 +185,32 @@ void CreateJA2SelectionWindow( INT16 sWhat )
iButtonIcons[ SEL_WIN_DOWN_ICON ] = LoadGenericButtonIcon( "EDITOR//lgDownArrow.sti" ); iButtonIcons[ SEL_WIN_DOWN_ICON ] = LoadGenericButtonIcon( "EDITOR//lgDownArrow.sti" );
iButtonIcons[ SEL_WIN_OK_ICON ] = LoadGenericButtonIcon( "EDITOR//checkmark.sti" ); iButtonIcons[ SEL_WIN_OK_ICON ] = LoadGenericButtonIcon( "EDITOR//checkmark.sti" );
iSelectWin = CreateHotSpot(0, 0, 600, 360, MSYS_PRIORITY_HIGH,
iSelectWin = CreateHotSpot(0, 0, selectWinWidth, selectWinHeight, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, SelWinClkCallback); DEFAULT_MOVE_CALLBACK, SelWinClkCallback);
iOkWin = CreateIconButton((INT16)iButtonIcons[SEL_WIN_OK_ICON], 0, iOkWin = CreateIconButton((INT16)iButtonIcons[SEL_WIN_OK_ICON], 0,
BUTTON_USE_DEFAULT, selectWinWidth, 0, BUTTON_USE_DEFAULT, 600, 0,
40, 40, BUTTON_TOGGLE, 40, 40, BUTTON_TOGGLE,
MSYS_PRIORITY_HIGH, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, OkClkCallback); DEFAULT_MOVE_CALLBACK, OkClkCallback);
SetButtonFastHelpText(iOkWin,pDisplaySelectionWindowButtonText[0]); SetButtonFastHelpText(iOkWin,pDisplaySelectionWindowButtonText[0]);
iCancelWin = CreateIconButton((INT16)iButtonIcons[SEL_WIN_CANCEL_ICON], 0, iCancelWin = CreateIconButton((INT16)iButtonIcons[SEL_WIN_CANCEL_ICON], 0,
BUTTON_USE_DEFAULT, selectWinWidth, 40, BUTTON_USE_DEFAULT, 600, 40,
40, 40, BUTTON_TOGGLE, 40, 40, BUTTON_TOGGLE,
MSYS_PRIORITY_HIGH, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, CnclClkCallback); DEFAULT_MOVE_CALLBACK, CnclClkCallback);
SetButtonFastHelpText(iCancelWin,pDisplaySelectionWindowButtonText[1]); SetButtonFastHelpText(iCancelWin,pDisplaySelectionWindowButtonText[1]);
iScrollUp = CreateIconButton((INT16)iButtonIcons[SEL_WIN_UP_ICON], 0, iScrollUp = CreateIconButton((INT16)iButtonIcons[SEL_WIN_UP_ICON], 0,
BUTTON_USE_DEFAULT, selectWinWidth, 80, BUTTON_USE_DEFAULT, 600, 80,
40, 160, BUTTON_NO_TOGGLE, 40, 160, BUTTON_NO_TOGGLE,
MSYS_PRIORITY_HIGH, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, UpClkCallback); DEFAULT_MOVE_CALLBACK, UpClkCallback);
SetButtonFastHelpText(iScrollUp,pDisplaySelectionWindowButtonText[2]); SetButtonFastHelpText(iScrollUp,pDisplaySelectionWindowButtonText[2]);
iScrollDown = CreateIconButton((INT16)iButtonIcons[SEL_WIN_DOWN_ICON], 0, iScrollDown = CreateIconButton((INT16)iButtonIcons[SEL_WIN_DOWN_ICON], 0,
BUTTON_USE_DEFAULT, selectWinWidth, 240, BUTTON_USE_DEFAULT, 600, 240,
40, 160, BUTTON_NO_TOGGLE, 40, 160, BUTTON_NO_TOGGLE,
MSYS_PRIORITY_HIGH, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, DwnClkCallback); DEFAULT_MOVE_CALLBACK, DwnClkCallback);
@@ -252,6 +218,18 @@ void CreateJA2SelectionWindow( INT16 sWhat )
fButtonsPresent = TRUE; fButtonsPresent = TRUE;
SelWinSpacing.iX = 2;
SelWinSpacing.iY = 2;
SelWinStartPoint.iX = 1;
SelWinStartPoint.iY = 15;
iTopWinCutOff = 15;
SelWinEndPoint.iX = 599;
SelWinEndPoint.iY = 359;
iBotWinCutOff = 359;
switch( sWhat ) switch( sWhat )
{ {
@@ -369,8 +347,8 @@ void CreateJA2SelectionWindow( INT16 sWhat )
return; return;
} }
BuildDisplayWindow( pDSpec, usNSpecs, &pDispList, &gSelection.displayAreaStart , &gSelection.displayAreaEnd, BuildDisplayWindow( pDSpec, usNSpecs, &pDispList, &SelWinStartPoint, &SelWinEndPoint,
&gSelection.spacing, CLEAR_BACKGROUND); &SelWinSpacing, CLEAR_BACKGROUND);
} }
@@ -871,14 +849,12 @@ void RenderSelectionWindow( void )
return; return;
ColorFillVideoSurfaceArea(FRAME_BUFFER, ColorFillVideoSurfaceArea(FRAME_BUFFER,
gSelection.window.iLeft, gSelection.window.iTop, gSelection.window.iRight, gSelection.window.iBottom, 0, 0, 600, 400,
GenericButtonFillColors[0] GenericButtonFillColors[0]);
);
DrawSelections( ); DrawSelections( );
MarkButtonsDirty(); MarkButtonsDirty();
RenderButtons( ); RenderButtons( );
// Draw selection rectangle
if ( gfRenderSquareArea ) if ( gfRenderSquareArea )
{ {
button = ButtonList[iSelectWin]; button = ButtonList[iSelectWin];
@@ -886,7 +862,7 @@ void RenderSelectionWindow( void )
return; return;
if ( (abs( iStartClickX - button->Area.MouseXPos ) > 9) || if ( (abs( iStartClickX - button->Area.MouseXPos ) > 9) ||
(abs( iStartClickY - (button->Area.MouseYPos + iTopWinCutOff - (INT16)gSelection.displayAreaStart.iY)) > 9) ) (abs( iStartClickY - (button->Area.MouseYPos + iTopWinCutOff - (INT16)SelWinStartPoint.iY)) > 9) )
{ {
// iSX = (INT32)iStartClickX; // iSX = (INT32)iStartClickX;
// iEX = (INT32)button->Area.MouseXPos; // iEX = (INT32)button->Area.MouseXPos;
@@ -894,7 +870,7 @@ void RenderSelectionWindow( void )
// iEY = (INT32)(button->Area.MouseYPos + iTopWinCutOff - (INT16)SelWinStartPoint.iY); // iEY = (INT32)(button->Area.MouseYPos + iTopWinCutOff - (INT16)SelWinStartPoint.iY);
iSX = iStartClickX; iSX = iStartClickX;
iSY = iStartClickY - iTopWinCutOff + gSelection.displayAreaStart.iY; iSY = iStartClickY - iTopWinCutOff + SelWinStartPoint.iY;
iEX = gusMouseXPos; iEX = gusMouseXPos;
iEY = gusMouseYPos; iEY = gusMouseYPos;
@@ -913,10 +889,10 @@ void RenderSelectionWindow( void )
iEY ^= iSY; iEY ^= iSY;
} }
iEX = min( gSelection.displayAreaEnd.iX, iEX); iEX = min( iEX, 600 );
iSY = max( gSelection.displayAreaStart.iY, iSY ); iSY = max( SelWinStartPoint.iY, iSY );
iEY = min( gSelection.displayAreaEnd.iY, iEY ); iEY = min( 359, iEY );
iEY = max( gSelection.displayAreaStart.iY, iEY ); iEY = max( SelWinStartPoint.iY, iEY );
usFillColor = Get16BPPColor(FROMRGB(255, usFillGreen, 0)); usFillColor = Get16BPPColor(FROMRGB(255, usFillGreen, 0));
usFillGreen += usDir; usFillGreen += usDir;
@@ -952,7 +928,7 @@ void SelWinClkCallback( GUI_BUTTON *button, INT32 reason )
return; return;
iClickX = button->Area.MouseXPos; iClickX = button->Area.MouseXPos;
iClickY = button->Area.MouseYPos + iTopWinCutOff - (INT16)gSelection.displayAreaStart.iY; iClickY = button->Area.MouseYPos + iTopWinCutOff - (INT16)SelWinStartPoint.iY;
if (reason & MSYS_CALLBACK_REASON_LBUTTON_DWN) if (reason & MSYS_CALLBACK_REASON_LBUTTON_DWN)
{ {
@@ -1059,9 +1035,9 @@ void DisplaySelectionWindowGraphicalInformation()
UINT16 y; UINT16 y;
//Determine if there is a valid picture at cursor position. //Determine if there is a valid picture at cursor position.
//iRelX = gusMouseXPos; //iRelX = gusMouseXPos;
//iRelY = gusMouseYPos + iTopWinCutOff - (INT16)gSelection.displayAreaStart.iY; //iRelY = gusMouseYPos + iTopWinCutOff - (INT16)SelWinStartPoint.iY;
y = gusMouseYPos + iTopWinCutOff - (UINT16)gSelection.displayAreaStart.iY; y = gusMouseYPos + iTopWinCutOff - (UINT16)SelWinStartPoint.iY;
pNode = pDispList; pNode = pDispList;
fDone = FALSE; fDone = FALSE;
while( (pNode != NULL) && !fDone ) while( (pNode != NULL) && !fDone )
@@ -1494,10 +1470,10 @@ void DrawSelections( void )
{ {
SGPRect ClipRect, NewRect; SGPRect ClipRect, NewRect;
NewRect.iLeft = gSelection.displayAreaStart.iX; NewRect.iLeft = SelWinStartPoint.iX;
NewRect.iTop = gSelection.displayAreaStart.iY; NewRect.iTop = SelWinStartPoint.iY;
NewRect.iRight = gSelection.displayAreaEnd.iX; NewRect.iRight = SelWinEndPoint.iX;
NewRect.iBottom = gSelection.displayAreaEnd.iY; NewRect.iBottom = SelWinEndPoint.iY;
GetClippingRect(&ClipRect); GetClippingRect(&ClipRect);
SetClippingRect(&NewRect); SetClippingRect(&NewRect);
@@ -1507,7 +1483,7 @@ void DrawSelections( void )
SetObjectShade( gvoLargeFontType1, 0 ); SetObjectShade( gvoLargeFontType1, 0 );
// SetObjectShade( gvoLargeFont, 0 ); // SetObjectShade( gvoLargeFont, 0 );
DisplayWindowFunc( pDispList, iTopWinCutOff, iBotWinCutOff, &gSelection.displayAreaStart, CLEAR_BACKGROUND ); DisplayWindowFunc( pDispList, iTopWinCutOff, iBotWinCutOff, &SelWinStartPoint, CLEAR_BACKGROUND );
SetObjectShade( gvoLargeFontType1, 4 ); SetObjectShade( gvoLargeFontType1, 4 );
+17 -2
View File
@@ -14,6 +14,7 @@ set(Ja2Src
"${CMAKE_CURRENT_SOURCE_DIR}/JA2 Splash.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/JA2 Splash.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Ja25Update.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/Ja25Update.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/jascreens.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/jascreens.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Language Defines.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Loading Screen.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/Loading Screen.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/MainMenuScreen.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/MainMenuScreen.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/MessageBoxScreen.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/MessageBoxScreen.cpp"
@@ -27,11 +28,25 @@ set(Ja2Src
"${CMAKE_CURRENT_SOURCE_DIR}/profiler.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/profiler.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/SaveLoadGame.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/SaveLoadGame.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/SaveLoadScreen.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/SaveLoadScreen.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Screens.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/SCREENS.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Sys Globals.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/Sys Globals.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/TimeLogging.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/ub_config.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/ub_config.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/XML_DifficultySettings.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/XML_DifficultySettings.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/XML_IntroFiles.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/XML_IntroFiles.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/XML_Layout_MainMenu.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/XML_Layout_MainMenu.cpp"
${CMAKE_CURRENT_SOURCE_DIR}/Res/ja2.rc
PARENT_SCOPE)
set(Ja2_Libraries
"${CMAKE_SOURCE_DIR}/libexpatMT.lib"
"Dbghelp.lib"
Lua
"${CMAKE_SOURCE_DIR}/lua51.lib"
"${CMAKE_SOURCE_DIR}/lua51.vc9.lib"
"Winmm.lib"
"${CMAKE_SOURCE_DIR}/SMACKW32.LIB"
"${CMAKE_SOURCE_DIR}/binkw32.lib"
bfVFS
"ws2_32.lib"
Multiplayer
PARENT_SCOPE) PARENT_SCOPE)
+1
View File
@@ -1,6 +1,7 @@
#ifndef _CHEATS__H_ #ifndef _CHEATS__H_
#define _CHEATS__H_ #define _CHEATS__H_
#include "Language Defines.h"
extern UINT8 gubCheatLevel; extern UINT8 gubCheatLevel;
+1
View File
@@ -1,5 +1,6 @@
#include "Types.h" #include "Types.h"
#include "Credits.h" #include "Credits.h"
#include "Language Defines.h"
#include "vsurface.h" #include "vsurface.h"
#include "mousesystem.h" #include "mousesystem.h"
#include "Text.h" #include "Text.h"
+7 -3
View File
@@ -681,9 +681,13 @@ BOOLEAN UpdateSaveBufferWithBackbuffer(void)
pSrcBuf = LockVideoSurface(FRAME_BUFFER, &uiSrcPitchBYTES); pSrcBuf = LockVideoSurface(FRAME_BUFFER, &uiSrcPitchBYTES);
pDestBuf = LockVideoSurface(guiSAVEBUFFER, &uiDestPitchBYTES); pDestBuf = LockVideoSurface(guiSAVEBUFFER, &uiDestPitchBYTES);
Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES, if(gbPixelDepth==16)
(UINT16 *)pSrcBuf, uiSrcPitchBYTES, {
0, 0, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT ); // BLIT HERE
Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES,
(UINT16 *)pSrcBuf, uiSrcPitchBYTES,
0, 0, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
}
UnLockVideoSurface(FRAME_BUFFER); UnLockVideoSurface(FRAME_BUFFER);
UnLockVideoSurface(guiSAVEBUFFER); UnLockVideoSurface(guiSAVEBUFFER);
+1
View File
@@ -26,6 +26,7 @@
#include "Text.h" #include "Text.h"
#include "Interface Control.h" #include "Interface Control.h"
#include "Message.h" #include "Message.h"
#include "Language Defines.h"
#include "Multi Language Graphic Utils.h" #include "Multi Language Graphic Utils.h"
#include "Map Information.h" #include "Map Information.h"
#include "Sys Globals.h" #include "Sys Globals.h"
+2 -2
View File
@@ -1830,7 +1830,7 @@ void BtnGIOSquadSizeSelectionRightCallback( GUI_BUTTON *btn,INT32 reason )
if( reason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT ) if( reason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT )
{ {
UINT8 maxSquadSize = GIO_SQUAD_SIZE_10; UINT8 maxSquadSize = GIO_SQUAD_SIZE_10;
if (iResolution >= _800x600 && iResolution < _1280x720) if (iResolution >= _800x600 && iResolution < _1024x768)
maxSquadSize = GIO_SQUAD_SIZE_8; maxSquadSize = GIO_SQUAD_SIZE_8;
if ( iCurrentSquadSize < maxSquadSize ) if ( iCurrentSquadSize < maxSquadSize )
@@ -1850,7 +1850,7 @@ void BtnGIOSquadSizeSelectionRightCallback( GUI_BUTTON *btn,INT32 reason )
btn->uiFlags|=(BUTTON_CLICKED_ON); btn->uiFlags|=(BUTTON_CLICKED_ON);
UINT8 maxSquadSize = GIO_SQUAD_SIZE_10; UINT8 maxSquadSize = GIO_SQUAD_SIZE_10;
if (iResolution >= _800x600 && iResolution < _1280x720 ) if (iResolution >= _800x600 && iResolution < _1024x768)
maxSquadSize = GIO_SQUAD_SIZE_8; maxSquadSize = GIO_SQUAD_SIZE_8;
if ( iCurrentSquadSize < maxSquadSize ) if ( iCurrentSquadSize < maxSquadSize )
+3 -3
View File
@@ -10,6 +10,7 @@
#include "GameVersion.h" #include "GameVersion.h"
#include "LibraryDataBase.h" #include "LibraryDataBase.h"
#include "Debug.h" #include "Debug.h"
#include "Language Defines.h"
#include "HelpScreen.h" #include "HelpScreen.h"
#include "INIReader.h" #include "INIReader.h"
#include "Shade Table Util.h" #include "Shade Table Util.h"
@@ -44,7 +45,7 @@
#include <vfs/Core/vfs_file_raii.h> #include <vfs/Core/vfs_file_raii.h>
#include <vfs/Core/File/vfs_file.h> #include <vfs/Core/File/vfs_file.h>
#define GAME_SETTINGS_FILE "Ja2_Settings.ini" #define GAME_SETTINGS_FILE "Ja2_Settings.INI"
#define FEATURE_FLAGS_FILE "Ja2_Features.ini" #define FEATURE_FLAGS_FILE "Ja2_Features.ini"
@@ -1998,7 +1999,6 @@ void LoadGameExternalOptions()
gGameExternalOptions.fFoodDecayInSectors = iniReader.ReadBoolean("Tactical Food Settings", "FOOD_DECAY_IN_SECTORS", TRUE); gGameExternalOptions.fFoodDecayInSectors = iniReader.ReadBoolean("Tactical Food Settings", "FOOD_DECAY_IN_SECTORS", TRUE);
gGameExternalOptions.sFoodDecayModificator = iniReader.ReadFloat("Tactical Food Settings", "FOOD_DECAY_MODIFICATOR", 1.0f, 0.1f, 10.0f); gGameExternalOptions.sFoodDecayModificator = iniReader.ReadFloat("Tactical Food Settings", "FOOD_DECAY_MODIFICATOR", 1.0f, 0.1f, 10.0f);
gGameExternalOptions.fFoodEatingSounds = iniReader.ReadBoolean("Tactical Food Settings", "FOOD_EATING_SOUNDS", TRUE); gGameExternalOptions.fFoodEatingSounds = iniReader.ReadBoolean("Tactical Food Settings", "FOOD_EATING_SOUNDS", TRUE);
gGameExternalOptions.fAlwaysFood = iniReader.ReadBoolean("Tactical Food Settings", "ALWAYS_FOOD", FALSE);
//################# Disease Settings ################## //################# Disease Settings ##################
gGameExternalOptions.fDisease = iniReader.ReadBoolean( "Disease Settings", "DISEASE", FALSE ); gGameExternalOptions.fDisease = iniReader.ReadBoolean( "Disease Settings", "DISEASE", FALSE );
@@ -3794,7 +3794,7 @@ void LoadCTHConstants()
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_WIS = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_WIS",1.0, 0.0, 100.0); gGameCTHConstants.RECOIL_COUNTER_ACCURACY_WIS = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_WIS",1.0, 0.0, 100.0);
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_AGI = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_AGI",1.0, 0.0, 100.0); gGameCTHConstants.RECOIL_COUNTER_ACCURACY_AGI = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_AGI",1.0, 0.0, 100.0);
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_EXP_LEVEL = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_EXP_LEVEL",2.0, 0.0, 100.0); gGameCTHConstants.RECOIL_COUNTER_ACCURACY_EXP_LEVEL = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_EXP_LEVEL",2.0, 0.0, 100.0);
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_AUTO_WEAPONS_DIVISOR = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_AUTO_WEAPONS_DIVISOR",2.0, 1.0, 100.0); gGameCTHConstants.RECOIL_COUNTER_ACCURACY_AUTO_WEAPONS_DIVISOR = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_AUTO_WEAPONS_DIVISOR",2.0, 1.0, 100.0);
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_TRACER_BONUS = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_TRACER_BONUS",10.0, -1000.0, 1000.0); gGameCTHConstants.RECOIL_COUNTER_ACCURACY_TRACER_BONUS = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_TRACER_BONUS",10.0, -1000.0, 1000.0);
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_ANTICIPATION = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_ANTICIPATION",25.0, -1000.0, 1000.0); gGameCTHConstants.RECOIL_COUNTER_ACCURACY_ANTICIPATION = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_ANTICIPATION",25.0, -1000.0, 1000.0);
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_COMPENSATION = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_COMPENSATION",2.0, 0.0, 5.0); gGameCTHConstants.RECOIL_COUNTER_ACCURACY_COMPENSATION = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_COMPENSATION",2.0, 0.0, 5.0);
-1
View File
@@ -506,7 +506,6 @@ typedef struct
FLOAT sFoodDecayModificator; FLOAT sFoodDecayModificator;
BOOLEAN fFoodEatingSounds; BOOLEAN fFoodEatingSounds;
BOOLEAN fAlwaysFood;
// Flugente: disease settings // Flugente: disease settings
BOOLEAN fDisease; BOOLEAN fDisease;
+2 -2
View File
@@ -22,7 +22,7 @@ extern CHAR16 zBuildInformation[256];
// //
// Keeps track of the saved game version. Increment the saved game version whenever // Keeps track of the saved game version. Increment the saved game version whenever
// you will invalidate the saved game file // you will invalidate the saved game file
#define MERC_PROFILE_INSERTION_DATA 185 // Bigmap support for AddProfileToMap function
#define GROWTH_MODIFIERS 184 #define GROWTH_MODIFIERS 184
#define REBELCOMMAND 183 #define REBELCOMMAND 183
#define DRAGSTRUCTURE 182 // Flugente: we can drag structures behind us #define DRAGSTRUCTURE 182 // Flugente: we can drag structures behind us
@@ -105,7 +105,7 @@ extern CHAR16 zBuildInformation[256];
#define AP100_SAVEGAME_DATATYPE_CHANGE 105 // Before this, we didn't have the 100AP structure changes #define AP100_SAVEGAME_DATATYPE_CHANGE 105 // Before this, we didn't have the 100AP structure changes
#define NIV_SAVEGAME_DATATYPE_CHANGE 102 // Before this, we used the old structure system #define NIV_SAVEGAME_DATATYPE_CHANGE 102 // Before this, we used the old structure system
#define SAVE_GAME_VERSION MERC_PROFILE_INSERTION_DATA #define SAVE_GAME_VERSION GROWTH_MODIFIERS
//#define RUSSIANGOLD //#define RUSSIANGOLD
#ifdef __cplusplus #ifdef __cplusplus
+109 -92
View File
@@ -35,6 +35,7 @@
#include "tile cache.h" #include "tile cache.h"
#include "strategicmap.h" #include "strategicmap.h"
#include "Map Information.h" #include "Map Information.h"
#include "laptop.h"
#include "Shade Table Util.h" #include "Shade Table Util.h"
#include "Exit Grids.h" #include "Exit Grids.h"
#include "Summary Info.h" #include "Summary Info.h"
@@ -50,7 +51,6 @@
#include "Multilingual Text Code Generator.h" #include "Multilingual Text Code Generator.h"
#include "editscreen.h" #include "editscreen.h"
#include "Arms Dealer Init.h" #include "Arms Dealer Init.h"
#include "Map Screen Interface Bottom.h"
#include "MPXmlTeams.hpp" #include "MPXmlTeams.hpp"
#include "Strategic Mines LUA.h" #include "Strategic Mines LUA.h"
#include "UndergroundInit.h" #include "UndergroundInit.h"
@@ -76,8 +76,7 @@
#include "AimArchives.h" #include "AimArchives.h"
#include "connect.h" #include "connect.h"
#include "DynamicDialogueWidget.h" // added by Flugente for InitMyBoxes() #include "DynamicDialogueWidget.h" // added by Flugente for InitMyBoxes()
#include "Animation Data.h" // added by Flugente
#include <language.hpp>
extern INT16 APBPConstants[TOTAL_APBP_VALUES] = {0}; extern INT16 APBPConstants[TOTAL_APBP_VALUES] = {0};
extern INT16 gubMaxActionPoints[TOTALBODYTYPES];//MAXBODYTYPES = 28... JUST GETTING IT TO WORK NOW. GOTTHARD 7/2/08 extern INT16 gubMaxActionPoints[TOTALBODYTYPES];//MAXBODYTYPES = 28... JUST GETTING IT TO WORK NOW. GOTTHARD 7/2/08
@@ -135,6 +134,34 @@ static void AddLanguagePrefix(STR fileName, const STR language)
memmove( fileComponent, language, strlen( language) ); memmove( fileComponent, language, strlen( language) );
} }
static const STR GetLanguagePrefix()
{
#ifdef ENGLISH
return "";
#endif
#ifdef GERMAN
return GERMAN_PREFIX;
#endif
#ifdef RUSSIAN
return RUSSIAN_PREFIX;
#endif
#ifdef DUTCH
return DUTCH_PREFIX;
#endif
#ifdef POLISH
return POLISH_PREFIX;
#endif
#ifdef FRENCH
return FRENCH_PREFIX;
#endif
#ifdef ITALIAN
return ITALIAN_PREFIX;
#endif
#ifdef CHINESE
return CHINESE_PREFIX;
#endif
}
static void AddLanguagePrefix(STR fileName) static void AddLanguagePrefix(STR fileName)
{ {
AddLanguagePrefix( fileName, GetLanguagePrefix()); AddLanguagePrefix( fileName, GetLanguagePrefix());
@@ -227,7 +254,7 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
strcat(fileName, AMMOFILENAME); strcat(fileName, AMMOFILENAME);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
@@ -241,9 +268,9 @@ if( g_lang != i18n::Lang::en ) {
strcat(fileName, AMMOFILENAME); strcat(fileName, AMMOFILENAME);
SGP_THROW_IFFALSE(ReadInAmmoStats(fileName),AMMOFILENAME); SGP_THROW_IFFALSE(ReadInAmmoStats(fileName),AMMOFILENAME);
} }
} else { #else
SGP_THROW_IFFALSE(ReadInAmmoStats(fileName),AMMOFILENAME); SGP_THROW_IFFALSE(ReadInAmmoStats(fileName),AMMOFILENAME);
} #endif
// Lesh: added this, begin // Lesh: added this, begin
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
@@ -267,14 +294,14 @@ if( g_lang != i18n::Lang::en ) {
// the uiIndex (for reference), szItemName, szLongItemName, szItemDesc, szBRName, and szBRDesc tags // the uiIndex (for reference), szItemName, szLongItemName, szItemDesc, szBRName, and szBRDesc tags
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInItemStats(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInItemStats(fileName,TRUE), fileName);
} }
} #endif
//if(!WriteItemStats()) //if(!WriteItemStats())
// return FALSE; // return FALSE;
@@ -339,14 +366,14 @@ if( g_lang != i18n::Lang::en ) {
strcat( fileName, DISEASEFILENAME ); strcat( fileName, DISEASEFILENAME );
SGP_THROW_IFFALSE( ReadInDiseaseStats( fileName,FALSE ), DISEASEFILENAME ); SGP_THROW_IFFALSE( ReadInDiseaseStats( fileName,FALSE ), DISEASEFILENAME );
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInDiseaseStats(fileName,TRUE), DISEASEFILENAME); SGP_THROW_IFFALSE(ReadInDiseaseStats(fileName,TRUE), DISEASEFILENAME);
} }
} #endif
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
strcat(fileName, STRUCTUREDECONSTRUCTFILENAME); strcat(fileName, STRUCTUREDECONSTRUCTFILENAME);
@@ -384,14 +411,14 @@ if( g_lang != i18n::Lang::en ) {
strcat(fileName, LOADSCREENHINTSFILENAME); strcat(fileName, LOADSCREENHINTSFILENAME);
SGP_THROW_IFFALSE(ReadInLoadScreenHints(fileName, FALSE),LOADSCREENHINTSFILENAME); SGP_THROW_IFFALSE(ReadInLoadScreenHints(fileName, FALSE),LOADSCREENHINTSFILENAME);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInLoadScreenHints(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInLoadScreenHints(fileName,TRUE), fileName);
} }
} #endif
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
strcat(fileName, ARMOURSFILENAME); strcat(fileName, ARMOURSFILENAME);
@@ -411,24 +438,22 @@ if( g_lang != i18n::Lang::en ) {
if (isMultiplayer == false) if (isMultiplayer == false)
{ {
using namespace LogicalBodyTypes; using namespace LogicalBodyTypes;
CHAR8 errorBuf[512]{"Failed loading LogicalBodyTypes external data!"}; SGP_THROW_IFFALSE(Layers::Instance().LoadFromFile(directoryName, LBT_LAYERSFILENAME), LBT_LAYERSFILENAME);
SGP_THROW_IFFALSE(PaletteDB::Instance().LoadFromFile(directoryName, LBT_PALETTESFILENAME), LBT_PALETTESFILENAME);
SGP_THROW_IFFALSE(Layers::Instance().LoadFromFile(directoryName, LBT_LAYERSFILENAME, errorBuf), errorBuf); SGP_THROW_IFFALSE(SurfaceDB::Instance().LoadFromFile(directoryName, LBT_ANIMSURFACESFILENAME), LBT_ANIMSURFACESFILENAME);
SGP_THROW_IFFALSE(PaletteDB::Instance().LoadFromFile(directoryName, LBT_PALETTESFILENAME, errorBuf), errorBuf); SGP_THROW_IFFALSE(FilterDB::Instance().LoadFromFile(directoryName, LBT_FILTERSFILENAME), LBT_FILTERSFILENAME);
SGP_THROW_IFFALSE(SurfaceDB::Instance().LoadFromFile(directoryName, LBT_ANIMSURFACESFILENAME, errorBuf), errorBuf); SGP_THROW_IFFALSE(BodyTypeDB::Instance().LoadFromFile(directoryName, LBT_BODYTYPESFILENAME), LBT_BODYTYPESFILENAME);
SGP_THROW_IFFALSE(FilterDB::Instance().LoadFromFile(directoryName, LBT_FILTERSFILENAME, errorBuf), errorBuf);
SGP_THROW_IFFALSE(BodyTypeDB::Instance().LoadFromFile(directoryName, LBT_BODYTYPESFILENAME, errorBuf), errorBuf);
} }
} }
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInLBEPocketStats(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInLBEPocketStats(fileName,TRUE), fileName);
} }
} #endif
// THE_BOB : added for pocket popup definitions // THE_BOB : added for pocket popup definitions
LBEPocketPopup.clear(); LBEPocketPopup.clear();
@@ -436,7 +461,7 @@ if( g_lang != i18n::Lang::en ) {
strcat(fileName, LBEPOCKETPOPUPFILENAME); strcat(fileName, LBEPOCKETPOPUPFILENAME);
SGP_THROW_IFFALSE(ReadInLBEPocketPopups(fileName),LBEPOCKETPOPUPFILENAME); SGP_THROW_IFFALSE(ReadInLBEPocketPopups(fileName),LBEPOCKETPOPUPFILENAME);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if (FileExists(fileName)) if (FileExists(fileName))
@@ -451,10 +476,10 @@ if( g_lang != i18n::Lang::en ) {
strcat(fileName, LBEPOCKETPOPUPFILENAME); strcat(fileName, LBEPOCKETPOPUPFILENAME);
SGP_THROW_IFFALSE(ReadInLBEPocketPopups(fileName),LBEPOCKETPOPUPFILENAME); SGP_THROW_IFFALSE(ReadInLBEPocketPopups(fileName),LBEPOCKETPOPUPFILENAME);
} }
} else { #else
// WANNE: Load english file // WANNE: Load english file
SGP_THROW_IFFALSE(ReadInLBEPocketPopups(fileName),LBEPOCKETPOPUPFILENAME); SGP_THROW_IFFALSE(ReadInLBEPocketPopups(fileName),LBEPOCKETPOPUPFILENAME);
} #endif
#ifdef JA2UB #ifdef JA2UB
@@ -470,14 +495,14 @@ if( g_lang != i18n::Lang::en ) {
strcat(fileName, MERCSTARTINGGEARFILENAME); strcat(fileName, MERCSTARTINGGEARFILENAME);
SGP_THROW_IFFALSE(ReadInMercStartingGearStats(fileName, FALSE), MERCSTARTINGGEARFILENAME); SGP_THROW_IFFALSE(ReadInMercStartingGearStats(fileName, FALSE), MERCSTARTINGGEARFILENAME);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInMercStartingGearStats(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInMercStartingGearStats(fileName,TRUE), fileName);
} }
} #endif
#endif #endif
@@ -494,14 +519,14 @@ if( g_lang != i18n::Lang::en ) {
strcat(fileName, ATTACHMENTSLOTSFILENAME); strcat(fileName, ATTACHMENTSLOTSFILENAME);
SGP_THROW_IFFALSE(ReadInAttachmentSlotsStats(fileName, FALSE),ATTACHMENTSLOTSFILENAME); SGP_THROW_IFFALSE(ReadInAttachmentSlotsStats(fileName, FALSE),ATTACHMENTSLOTSFILENAME);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInAttachmentSlotsStats(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInAttachmentSlotsStats(fileName,TRUE), fileName);
} }
} #endif
// Flugente: created separate gun and item choices for different soldier classes - read in different xmls // Flugente: created separate gun and item choices for different soldier classes - read in different xmls
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
@@ -675,14 +700,14 @@ if( g_lang != i18n::Lang::en ) {
strcat(fileName, CITYTABLEFILENAME); strcat(fileName, CITYTABLEFILENAME);
SGP_THROW_IFFALSE(ReadInMapStructure(fileName, FALSE),CITYTABLEFILENAME); SGP_THROW_IFFALSE(ReadInMapStructure(fileName, FALSE),CITYTABLEFILENAME);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInStrategicMapSectorTownNames(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInStrategicMapSectorTownNames(fileName,TRUE), fileName);
} }
} #endif
// Lesh: Strategic movement costs will be read in Strategic\Strategic Movement Costs.cpp, // Lesh: Strategic movement costs will be read in Strategic\Strategic Movement Costs.cpp,
// function BOOLEAN InitStrategicMovementCosts(); // function BOOLEAN InitStrategicMovementCosts();
@@ -733,14 +758,14 @@ if( g_lang != i18n::Lang::en ) {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInShippingDestinations(fileName, FALSE),SHIPPINGDESTINATIONSFILENAME); SGP_THROW_IFFALSE(ReadInShippingDestinations(fileName, FALSE),SHIPPINGDESTINATIONSFILENAME);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInShippingDestinations(fileName, TRUE),fileName); SGP_THROW_IFFALSE(ReadInShippingDestinations(fileName, TRUE),fileName);
} }
} #endif
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
strcat(fileName, DELIVERYMETHODSFILENAME); strcat(fileName, DELIVERYMETHODSFILENAME);
@@ -753,14 +778,14 @@ if( g_lang != i18n::Lang::en ) {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInFacilityTypes(fileName,FALSE), FACILITYTYPESFILENAME); SGP_THROW_IFFALSE(ReadInFacilityTypes(fileName,FALSE), FACILITYTYPESFILENAME);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInFacilityTypes(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInFacilityTypes(fileName,TRUE), fileName);
} }
} #endif
// HEADROCK HAM 3.4: Read in facility locations // HEADROCK HAM 3.4: Read in facility locations
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
@@ -774,14 +799,14 @@ if( g_lang != i18n::Lang::en ) {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInSectorNames(fileName,FALSE,0), SECTORNAMESFILENAME); SGP_THROW_IFFALSE(ReadInSectorNames(fileName,FALSE,0), SECTORNAMESFILENAME);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInSectorNames(fileName,TRUE, 0), fileName); SGP_THROW_IFFALSE(ReadInSectorNames(fileName,TRUE, 0), fileName);
} }
} #endif
// HEADROCK HAM 5: Read in Coolness by Sector // HEADROCK HAM 5: Read in Coolness by Sector
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
@@ -803,7 +828,7 @@ if( g_lang != i18n::Lang::en ) {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInMercProfiles(fileName, FALSE), MERCPROFILESFILENAME25); SGP_THROW_IFFALSE(ReadInMercProfiles(fileName, FALSE), MERCPROFILESFILENAME25);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
@@ -811,7 +836,7 @@ if( g_lang != i18n::Lang::en ) {
if(!ReadInMercProfiles(fileName,TRUE)) if(!ReadInMercProfiles(fileName,TRUE))
return FALSE; return FALSE;
} }
} #endif
} }
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
@@ -829,14 +854,14 @@ if( g_lang != i18n::Lang::en ) {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInMercProfiles(fileName, FALSE), MERCPROFILESFILENAME); SGP_THROW_IFFALSE(ReadInMercProfiles(fileName, FALSE), MERCPROFILESFILENAME);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInMercProfiles(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInMercProfiles(fileName,TRUE), fileName);
} }
} #endif
// HEADROCK PROFEX: Read in Merc Opinion data to replace PROF.DAT data // HEADROCK PROFEX: Read in Merc Opinion data to replace PROF.DAT data
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
@@ -899,14 +924,14 @@ if( g_lang != i18n::Lang::en ) {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInEnemyNames(fileName,FALSE), ENEMYNAMESFILENAME); SGP_THROW_IFFALSE(ReadInEnemyNames(fileName,FALSE), ENEMYNAMESFILENAME);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInEnemyNames(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInEnemyNames(fileName,TRUE), fileName);
} }
} #endif
} }
@@ -918,14 +943,14 @@ if( g_lang != i18n::Lang::en ) {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInCivGroupNamesStats(fileName,FALSE), CIVGROUPNAMESFILENAME); SGP_THROW_IFFALSE(ReadInCivGroupNamesStats(fileName,FALSE), CIVGROUPNAMESFILENAME);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInCivGroupNamesStats(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInCivGroupNamesStats(fileName,TRUE), fileName);
} }
} #endif
} }
@@ -935,14 +960,14 @@ if( g_lang != i18n::Lang::en ) {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInSenderNameList(fileName,FALSE), EMAILSENDERNAMELIST); SGP_THROW_IFFALSE(ReadInSenderNameList(fileName,FALSE), EMAILSENDERNAMELIST);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInSenderNameList(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInSenderNameList(fileName,TRUE), fileName);
} }
} #endif
if (gGameExternalOptions.fEnemyRank == TRUE) if (gGameExternalOptions.fEnemyRank == TRUE)
{ {
@@ -952,14 +977,14 @@ if( g_lang != i18n::Lang::en ) {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInEnemyRank(fileName,FALSE), ENEMYRANKFILENAME); SGP_THROW_IFFALSE(ReadInEnemyRank(fileName,FALSE), ENEMYRANKFILENAME);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInEnemyRank(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInEnemyRank(fileName,TRUE), fileName);
} }
} #endif
} }
// Flugente: backgrounds // Flugente: backgrounds
@@ -968,14 +993,14 @@ if( g_lang != i18n::Lang::en ) {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInBackgrounds(fileName,FALSE), BACKGROUNDSFILENAME); SGP_THROW_IFFALSE(ReadInBackgrounds(fileName,FALSE), BACKGROUNDSFILENAME);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInBackgrounds(fileName,TRUE), BACKGROUNDSFILENAME); SGP_THROW_IFFALSE(ReadInBackgrounds(fileName,TRUE), BACKGROUNDSFILENAME);
} }
} #endif
// Flugente: individual militia // Flugente: individual militia
strcpy( fileName, directoryName ); strcpy( fileName, directoryName );
@@ -989,14 +1014,14 @@ if( g_lang != i18n::Lang::en ) {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInCampaignStatsEvents(fileName,FALSE), CAMPAIGNSTATSEVENTSFILENAME); SGP_THROW_IFFALSE(ReadInCampaignStatsEvents(fileName,FALSE), CAMPAIGNSTATSEVENTSFILENAME);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInCampaignStatsEvents(fileName,TRUE), CAMPAIGNSTATSEVENTSFILENAME); SGP_THROW_IFFALSE(ReadInCampaignStatsEvents(fileName,TRUE), CAMPAIGNSTATSEVENTSFILENAME);
} }
} #endif
// WANNE: Only in a singleplayer game... // WANNE: Only in a singleplayer game...
// Externalised taunts // Externalised taunts
@@ -1017,14 +1042,14 @@ if( g_lang != i18n::Lang::en ) {
strcat(fileName, FileInfo.zFileName); strcat(fileName, FileInfo.zFileName);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInTaunts(fileName,FALSE), fileName); SGP_THROW_IFFALSE(ReadInTaunts(fileName,FALSE), fileName);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInTaunts(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInTaunts(fileName,TRUE), fileName);
} }
} #endif
while( GetFileNext(&FileInfo) ) while( GetFileNext(&FileInfo) )
{ {
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
@@ -1032,14 +1057,14 @@ if( g_lang != i18n::Lang::en ) {
strcat(fileName, FileInfo.zFileName); strcat(fileName, FileInfo.zFileName);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInTaunts(fileName,FALSE), fileName); SGP_THROW_IFFALSE(ReadInTaunts(fileName,FALSE), fileName);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInTaunts(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInTaunts(fileName,TRUE), fileName);
} }
} #endif
} }
GetFileClose(&FileInfo); GetFileClose(&FileInfo);
} }
@@ -1051,14 +1076,14 @@ if( g_lang != i18n::Lang::en ) {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInHistorys(fileName,FALSE), HISTORYNAMEFILENAME); SGP_THROW_IFFALSE(ReadInHistorys(fileName,FALSE), HISTORYNAMEFILENAME);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInHistorys(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInHistorys(fileName,TRUE), fileName);
} }
} #endif
// IMP Portraits List by Jazz // IMP Portraits List by Jazz
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
@@ -1066,14 +1091,14 @@ if( g_lang != i18n::Lang::en ) {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInIMPPortraits(fileName,FALSE), IMPPORTRAITS); SGP_THROW_IFFALSE(ReadInIMPPortraits(fileName,FALSE), IMPPORTRAITS);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInIMPPortraits(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInIMPPortraits(fileName,TRUE), fileName);
} }
} #endif
LoadIMPPortraitsTEMP( ); LoadIMPPortraitsTEMP( );
@@ -1158,14 +1183,14 @@ if( g_lang != i18n::Lang::en ) {
SGP_THROW_IFFALSE(ReadInFaceGear(zNewFaceGear, fileName), FACEGEARFILENAME); SGP_THROW_IFFALSE(ReadInFaceGear(zNewFaceGear, fileName), FACEGEARFILENAME);
//WriteFaceGear(); //WriteFaceGear();
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInMercAvailability(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInMercAvailability(fileName,TRUE), fileName);
} }
} #endif
UINT32 i; UINT32 i;
for(i=0; i<NUM_PROFILES; i++) for(i=0; i<NUM_PROFILES; i++)
{ {
@@ -1179,14 +1204,14 @@ if( g_lang != i18n::Lang::en ) {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInAimAvailability(fileName,FALSE), AIMAVAILABILITY); SGP_THROW_IFFALSE(ReadInAimAvailability(fileName,FALSE), AIMAVAILABILITY);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInAimAvailability(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInAimAvailability(fileName,TRUE), fileName);
} }
} #endif
//Main Menu by Jazz //Main Menu by Jazz
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
@@ -1199,7 +1224,7 @@ if( g_lang != i18n::Lang::en ) {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInActionItems(fileName,FALSE), ACTIONITEMSFILENAME); SGP_THROW_IFFALSE(ReadInActionItems(fileName,FALSE), ACTIONITEMSFILENAME);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
@@ -1207,7 +1232,7 @@ if( g_lang != i18n::Lang::en ) {
if(!ReadInActionItems(fileName,TRUE)) if(!ReadInActionItems(fileName,TRUE))
return FALSE; return FALSE;
} }
} #endif
if ( ReadXMLEmail == TRUE ) if ( ReadXMLEmail == TRUE )
{ {
@@ -1217,7 +1242,7 @@ if ( ReadXMLEmail == TRUE )
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInEmailMercAvailable(fileName,FALSE), EMAILMERCAVAILABLE); SGP_THROW_IFFALSE(ReadInEmailMercAvailable(fileName,FALSE), EMAILMERCAVAILABLE);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
@@ -1225,7 +1250,7 @@ if( g_lang != i18n::Lang::en ) {
if(!ReadInEmailMercAvailable(fileName,TRUE)) if(!ReadInEmailMercAvailable(fileName,TRUE))
return FALSE; return FALSE;
} }
} #endif
// EMAIL MERC LEVEL UP by Jazz // EMAIL MERC LEVEL UP by Jazz
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
@@ -1233,7 +1258,7 @@ if( g_lang != i18n::Lang::en ) {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInEmailMercLevelUp(fileName,FALSE), EMAILMERCLEVELUP); SGP_THROW_IFFALSE(ReadInEmailMercLevelUp(fileName,FALSE), EMAILMERCLEVELUP);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
@@ -1241,7 +1266,7 @@ if( g_lang != i18n::Lang::en ) {
if(!ReadInEmailMercLevelUp(fileName,TRUE)) if(!ReadInEmailMercLevelUp(fileName,TRUE))
return FALSE; return FALSE;
} }
} #endif
} }
/* /*
// EMAIL OTHER by Jazz // EMAIL OTHER by Jazz
@@ -1250,7 +1275,7 @@ if( g_lang != i18n::Lang::en ) {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInEmailOther(fileName,FALSE), EMAILOTHER); SGP_THROW_IFFALSE(ReadInEmailOther(fileName,FALSE), EMAILOTHER);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
@@ -1258,7 +1283,7 @@ if( g_lang != i18n::Lang::en ) {
if(!ReadInEmailOther(fileName,TRUE)) if(!ReadInEmailOther(fileName,TRUE))
return FALSE; return FALSE;
} }
} #endif
*/ */
//new vehicles by Jazz //new vehicles by Jazz
@@ -1269,7 +1294,7 @@ if( g_lang != i18n::Lang::en ) {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInNewVehicles(fileName,FALSE), VEHICLESFILENAME); SGP_THROW_IFFALSE(ReadInNewVehicles(fileName,FALSE), VEHICLESFILENAME);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
@@ -1277,9 +1302,9 @@ if( g_lang != i18n::Lang::en ) {
if(!ReadInNewVehicles(fileName,TRUE)) if(!ReadInNewVehicles(fileName,TRUE))
return FALSE; return FALSE;
} }
} #endif
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
@@ -1287,7 +1312,7 @@ if( g_lang != i18n::Lang::en ) {
if(!ReadInLanguageLocation(fileName,TRUE,zlanguageText,0)) if(!ReadInLanguageLocation(fileName,TRUE,zlanguageText,0))
return FALSE; return FALSE;
} }
} #endif
#ifdef ENABLE_BRIEFINGROOM #ifdef ENABLE_BRIEFINGROOM
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
@@ -1295,14 +1320,14 @@ if( g_lang != i18n::Lang::en ) {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInBriefingRoom(fileName,FALSE,gBriefingRoomData, 4), BRIEFINGROOMFILENAME); SGP_THROW_IFFALSE(ReadInBriefingRoom(fileName,FALSE,gBriefingRoomData, 4), BRIEFINGROOMFILENAME);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInBriefingRoom(fileName,TRUE,gBriefingRoomData, 4), fileName); SGP_THROW_IFFALSE(ReadInBriefingRoom(fileName,TRUE,gBriefingRoomData, 4), fileName);
} }
} #endif
BackupBRandEncyclopedia ( gBriefingRoomData, gBriefingRoomDataBackup, 0); BackupBRandEncyclopedia ( gBriefingRoomData, gBriefingRoomDataBackup, 0);
@@ -1314,14 +1339,14 @@ BackupBRandEncyclopedia ( gBriefingRoomData, gBriefingRoomDataBackup, 0);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInMinerals(fileName,FALSE), MINERALSFILENAME); SGP_THROW_IFFALSE(ReadInMinerals(fileName,FALSE), MINERALSFILENAME);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInMinerals(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInMinerals(fileName,TRUE), fileName);
} }
} #endif
// Old AIM Archive // Old AIM Archive
UINT8 p; UINT8 p;
@@ -1335,14 +1360,14 @@ if( g_lang != i18n::Lang::en ) {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInAimOldArchive(fileName,FALSE), OLDAIMARCHIVEFILENAME); SGP_THROW_IFFALSE(ReadInAimOldArchive(fileName,FALSE), OLDAIMARCHIVEFILENAME);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInAimOldArchive(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInAimOldArchive(fileName,TRUE), fileName);
} }
} #endif
UINT8 emptyslotsinarchives = 0; UINT8 emptyslotsinarchives = 0;
for (p=0;p<NUM_PROFILES;p++) for (p=0;p<NUM_PROFILES;p++)
{ {
@@ -1392,14 +1417,14 @@ if( g_lang != i18n::Lang::en ) {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInDifficultySettings(fileName,FALSE), DIFFICULTYFILENAME); SGP_THROW_IFFALSE(ReadInDifficultySettings(fileName,FALSE), DIFFICULTYFILENAME);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInDifficultySettings(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInDifficultySettings(fileName,TRUE), fileName);
} }
} #endif
LuaState::INIT(lua::LUA_STATE_STRATEGIC_MINES_AND_UNDERGROUND, true); LuaState::INIT(lua::LUA_STATE_STRATEGIC_MINES_AND_UNDERGROUND, true);
g_luaUnderground.LoadScript(GetLanguagePrefix()); g_luaUnderground.LoadScript(GetLanguagePrefix());
@@ -1417,7 +1442,6 @@ UINT32 InitializeJA2(void)
HandleLaserLockResult( PrepareLaserLockSystem() ); HandleLaserLockResult( PrepareLaserLockSystem() );
#endif #endif
HandleJA2CDCheck( );
gfWorldLoaded = FALSE; gfWorldLoaded = FALSE;
@@ -1447,9 +1471,6 @@ UINT32 InitializeJA2(void)
//gsRenderCenterX = 805; //gsRenderCenterX = 805;
//gsRenderCenterY = 805; //gsRenderCenterY = 805;
// Init data
InitializeSystemVideoObjects( );
// Init animation system // Init animation system
if ( !InitAnimationSystem( ) ) if ( !InitAnimationSystem( ) )
{ {
@@ -1473,10 +1494,6 @@ UINT32 InitializeJA2(void)
return( ERROR_SCREEN ); return( ERROR_SCREEN );
} }
// InitRadarScreenCoords() depend on Mapscreen Interface Bottom coordinates -> need to initiate them first
// before calling InitTacticalEngine()
InitMapScreenInterfaceBottomCoords();
// Init tactical engine // Init tactical engine
if ( !InitTacticalEngine( ) ) if ( !InitTacticalEngine( ) )
{ {
+3 -4
View File
@@ -36,7 +36,6 @@
#include "LuaInitNPCs.h" #include "LuaInitNPCs.h"
#include "XML.h" #include "XML.h"
#include <language.hpp>
BOOLEAN Style_JA = TRUE; BOOLEAN Style_JA = TRUE;
extern INT8 Test = 0; extern INT8 Test = 0;
@@ -727,11 +726,11 @@ void DisplaySirtechSplashScreen()
* (2006-10-10, Sergeant_Kolja) * (2006-10-10, Sergeant_Kolja)
*/ */
#ifdef _DEBUG #ifdef _DEBUG
if( g_lang == i18n::Lang::en ) { # if defined(ENGLISH)
AssertMsg( 0, String( "Wheter English nor German works. May be You built English - but have only German or other foreign Disk?" ) ); AssertMsg( 0, String( "Wheter English nor German works. May be You built English - but have only German or other foreign Disk?" ) );
} else if( g_lang == i18n::Lang::de ) { # elif defined(GERMAN)
AssertMsg( 0, String( "Weder Englisch noch Deutsch geht. Deutsche Version kompiliert und mit englischer CDs gestartet? Das geht nicht!" ) ); AssertMsg( 0, String( "Weder Englisch noch Deutsch geht. Deutsche Version kompiliert und mit englischer CDs gestartet? Das geht nicht!" ) );
} # endif
#endif #endif
AssertMsg( 0, String( "Failed to load %s", VObjectDesc.ImageFile ) ); AssertMsg( 0, String( "Failed to load %s", VObjectDesc.ImageFile ) );
return; return;
+4 -2
View File
@@ -12,11 +12,13 @@ void StopIntroVideo();
//enums used for when the intro screen can come up, used with 'gbIntroScreenMode' //enums used for when the intro screen can come up, used with 'gbIntroScreenMode'
enum EIntroType enum EIntroType
{ {
#ifdef JA2UB
INTRO_HELI_CRASH,
#endif
INTRO_BEGINNING, //set when viewing the intro at the begining of the game INTRO_BEGINNING, //set when viewing the intro at the begining of the game
INTRO_ENDING, //set when viewing the end game video. INTRO_ENDING, //set when viewing the end game video.
INTRO_SPLASH, INTRO_SPLASH,
// Unfinished Business
INTRO_HELI_CRASH
}; };
+3 -4
View File
@@ -5,7 +5,6 @@
#include "Timer Control.h" #include "Timer Control.h"
#include "Multi Language Graphic Utils.h" #include "Multi Language Graphic Utils.h"
#include <stdio.h> #include <stdio.h>
#include <language.hpp>
UINT32 guiSplashFrameFade = 10; UINT32 guiSplashFrameFade = 10;
UINT32 guiSplashStartTime = 0; UINT32 guiSplashStartTime = 0;
@@ -14,10 +13,10 @@ extern HVSURFACE ghFrameBuffer;
//Simply create videosurface, load image, and draw it to the screen. //Simply create videosurface, load image, and draw it to the screen.
void InitJA2SplashScreen() void InitJA2SplashScreen()
{ {
if( g_lang == i18n::Lang::en ) { #ifdef ENGLISH
ClearMainMenu(); ClearMainMenu();
} else { #else
UINT32 uiLogoID = 0; UINT32 uiLogoID = 0;
HVSURFACE hVSurface; // unused jonathanl // lalien reenabled for international versions HVSURFACE hVSurface; // unused jonathanl // lalien reenabled for international versions
VSURFACE_DESC VSurfaceDesc; //unused jonathanl // lalien reenabled for international versions VSURFACE_DESC VSurfaceDesc; //unused jonathanl // lalien reenabled for international versions
@@ -70,7 +69,7 @@ if( g_lang == i18n::Lang::en ) {
GetVideoSurface( &hVSurface, uiLogoID ); GetVideoSurface( &hVSurface, uiLogoID );
BltVideoSurfaceToVideoSurface( ghFrameBuffer, hVSurface, 0, iScreenWidthOffset, iScreenHeightOffset, 0, NULL ); BltVideoSurfaceToVideoSurface( ghFrameBuffer, hVSurface, 0, iScreenWidthOffset, iScreenHeightOffset, 0, NULL );
DeleteVideoSurfaceFromIndex( uiLogoID ); DeleteVideoSurfaceFromIndex( uiLogoID );
} // ENGLISH #endif // ENGLISH
InvalidateScreen(); InvalidateScreen();
RefreshScreen( NULL ); RefreshScreen( NULL );
+21
View File
@@ -0,0 +1,21 @@
#include "Language Defines.h"
#if defined(ENGLISH)
# pragma message(" (Language set to ENGLISH, You'll need english CDs)")
#elif defined(GERMAN)
# pragma message(" (Language set to GERMAN, You'll need Topware/german CDs)")
#elif defined(RUSSIAN)
# pragma message(" (Language set to RUSSIAN, You'll need russian CDs)")
#elif defined(DUTCH)
# pragma message(" (Language set to DUTCH, You'll need dutch CDs)")
#elif defined(POLISH)
# pragma message(" (Language set to POLISH, You'll need polish CDs)")
#elif defined(FRENCH)
# pragma message(" (Language set to FRENCH, You'll need french CDs)")
#elif defined(ITALIAN)
# pragma message(" (Language set to ITALIAN, You'll need italian CDs)")
#elif defined(CHINESE)
# pragma message(" (Language set to CHINESE, You'll need chinese CDs)")
#else
# error "At least You have to specify a Language somewhere. See comments above."
#endif
+119
View File
@@ -0,0 +1,119 @@
#ifndef __LANGUAGE_DEFINES_H
#define __LANGUAGE_DEFINES_H
#pragma once
/* ============================================================================
* ONLY ONE OF THESE LANGUAGES CAN BE DEFINED AT A TIME!
* BUT now You can define it _here_ by uncommenting one _or_ (better):
* You can comment them all out and then set it _global_ in "Preprocessor
* options" (do it for ALL projects in the workspace and both debug & release)
* _or_
* give it do Your MAKEFILE, f.i. make ENGLISH, but keep in mind that some
* weird make tools will require 'make ENGLISH=1' instead
*
* using one of the two later methods will keep this SVN file unchanged for the
* future, only Your private project files (workspace/solution) will differ
* from the SVN stuff.
* (2006-10-10, Sergeant_Kolja)
*/
/* The recommend approach for VS2010 multi-language builds is to use the command line or the ja2.props file.
By default the language is ENGLISH and the Language Prefix is EN.
There are 3 ways you can build the JA2 1.13 executable file:
// -------------------------------------------------------
// 1. Using the command line
// -------------------------------------------------------
For example, where msbuild is located in %SystemRoot%\Microsoft.NET\Framework\v4.0.30319\ if not on your path
msbuild.exe /p:Configuration=Release ja2_VS2010.sln
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=PL /p:JA2Language=POLISH ja2_VS2010.sln
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=DE /p:JA2Language=GERMAN ja2_VS2010.sln
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=RU /p:JA2Language=RUSSIAN ja2_VS2010.sln
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=NL /p:JA2Language=DUTCH ja2_VS2010.sln
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=FR /p:JA2Language=FRENCH ja2_VS2010.sln
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=IT /p:JA2Language=ITALIAN ja2_VS2010.sln
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=CN /p:JA2Language=CHINESE ja2_VS2010.sln
Note: If you want to build "Unfinished Business" version, just append the /p:JA2Config=JA2UB in the command line
msbuild.exe /p:Configuration=Release /p:JA2Config=JA2UB ja2_VS2010.sln
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=DE /p:JA2Language=GERMAN /p:JA2Config=JA2UB ja2_VS2010.sln
Note2: You can also specify the target output name with the parameter /p:TargetName
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=DE /p:JA2Language=GERMAN /p:JA2Config=JA2UB /p:TargetName="JA2UB_113" ja2_VS2010.sln
// --------------------------------------------------------
// 2. Editing the ja2.props file and then build in VS 2010
// -------------------------------------------------------
1. Open the "ja2.props" file in a text editor and set the <BuildMacro> tags to your likeing.
For example: If you want to build Russian Version (normal JA2, not UB) then set the following:
<BuildMacro Include="JA2Config">
<Value></Value>
</BuildMacro>
<BuildMacro Include="JA2LangPrefix">
<Value>RU</Value>
</BuildMacro>
<BuildMacro Include="JA2Language">
<Value>RUSSIAN</Value>
</BuildMacro>
2. Save the file
3. Build the project in Visual Studio 2010
// --------------------------------------------------------
// 3. The "old" way for building the executable
// -------------------------------------------------------
1. Enable the "#undef ENGLISH" define below, so English will not be used anymore
2. Set the desired language below
3. If you want to build "Unfinished Business" version, enable "#define JA2UB" and "#define JA2UBMAPS" in builddefines.h"
4. Build the executable in VS 2005 / 2008 / 2010
5. The output will be placed in the "Build\bin\" folder
*/
// Only enable this "undef", if you use the 3. way of building the executable!
#undef ENGLISH
#if !defined(ENGLISH) && !defined(GERMAN) && !defined(RUSSIAN) && !defined(DUTCH) && !defined(POLISH) && !defined(FRENCH) && !defined(ITALIAN) && !defined(CHINESE)
/* please set one manually here (by uncommenting) if not willingly to set Workspace wide */
#define ENGLISH
//#define GERMAN
//#define RUSSIAN
//#define DUTCH
//#define FRENCH
//#define ITALIAN
//#define POLISH
// INFO: For Chinese 1.13 version, you also have to set USE_WINFONTS = 1 in ja2.ini inside your JA2 installation directory!
//#define CHINESE
#endif
//**ddd direct link libraries
#pragma comment (lib, "user32.lib")
#pragma comment (lib, "gdi32.lib")
#pragma comment (lib, "advapi32.lib")
#pragma comment (lib, "shell32.lib")
/* ====================================================================
* Regardless of if we did it Workspace wide or by uncommenting above,
* HERE we must see, what language was selected. If one, we
*/
#if !defined(ENGLISH) && !defined(GERMAN) && !defined(RUSSIAN) && !defined(DUTCH) && !defined(POLISH) && !defined(FRENCH) && !defined(ITALIAN) && !defined(CHINESE)
# error "At least You have to specify a Language somewhere. See comments above."
#endif
//if the language represents words as single chars
/*#ifdef TAIWAN
#define SINGLE_CHAR_WORDS
#endif*/
#endif
+1
View File
@@ -29,6 +29,7 @@
#include "Text.h" #include "Text.h"
#include "Interface Control.h" #include "Interface Control.h"
#include "Message.h" #include "Message.h"
#include "Language Defines.h"
#include "Multi Language Graphic Utils.h" #include "Multi Language Graphic Utils.h"
#include "Map Information.h" #include "Map Information.h"
#include "SmokeEffects.h" #include "SmokeEffects.h"
+179 -57
View File
@@ -138,6 +138,7 @@
#include "Map Screen Interface Map Inventory.h"//dnl ch51 081009 #include "Map Screen Interface Map Inventory.h"//dnl ch51 081009
#include "Sys Globals.h"//dnl ch74 201013 #include "Sys Globals.h"//dnl ch74 201013
#include "Ambient Control.h" // added by Flugente for HandleNewSectorAmbience(...) #include "Ambient Control.h" // added by Flugente for HandleNewSectorAmbience(...)
///////////////////////////////////////////////////// /////////////////////////////////////////////////////
// //
// Local Defines // Local Defines
@@ -152,7 +153,6 @@
#endif #endif
#include "LuaInitNPCs.h" #include "LuaInitNPCs.h"
#include <language.hpp>
#ifdef JA2UB #ifdef JA2UB
@@ -177,11 +177,7 @@ extern void initMapViewAndBorderCoordinates(void);
UINT32 guiNumberOfMapTempFiles; //Test purposes UINT32 guiNumberOfMapTempFiles; //Test purposes
UINT32 guiSizeOfTempFiles; UINT32 guiSizeOfTempFiles;
CHAR gzNameOfMapTempFile[128]; CHAR gzNameOfMapTempFile[128];
#endif
//#define LOADSAVEGAME_LOGTIME 1 //#define LOADSAVEGAME_LOGTIME 1
#ifdef LOADSAVEGAME_LOGTIME
#include "TimeLogging.h"
#endif #endif
extern SOLDIERTYPE *gpSMCurrentMerc; extern SOLDIERTYPE *gpSMCurrentMerc;
@@ -1467,17 +1463,7 @@ BOOLEAN MERCPROFILESTRUCT::Load(HWFILE hFile, bool forceLoadOldVersion, bool for
numBytesRead = ReadFieldByField( hFile, &this->ubLastDateSpokenTo, sizeof(this->ubLastDateSpokenTo), sizeof(UINT8), numBytesRead); numBytesRead = ReadFieldByField( hFile, &this->ubLastDateSpokenTo, sizeof(this->ubLastDateSpokenTo), sizeof(UINT8), numBytesRead);
numBytesRead = ReadFieldByField( hFile, &this->bLastQuoteSaidWasSpecial, sizeof(this->bLastQuoteSaidWasSpecial), sizeof(UINT8), numBytesRead); numBytesRead = ReadFieldByField( hFile, &this->bLastQuoteSaidWasSpecial, sizeof(this->bLastQuoteSaidWasSpecial), sizeof(UINT8), numBytesRead);
numBytesRead = ReadFieldByField( hFile, &this->bSectorZ, sizeof(this->bSectorZ), sizeof(INT8), numBytesRead); numBytesRead = ReadFieldByField( hFile, &this->bSectorZ, sizeof(this->bSectorZ), sizeof(INT8), numBytesRead);
numBytesRead = ReadFieldByField( hFile, &this->usStrategicInsertionData, sizeof(this->usStrategicInsertionData), sizeof(UINT16), numBytesRead);
if ( guiCurrentSaveGameVersion >= MERC_PROFILE_INSERTION_DATA )
{
numBytesRead = ReadFieldByField( hFile, &this->usStrategicInsertionData, sizeof( this->usStrategicInsertionData ), sizeof( UINT32 ), numBytesRead );
}
else
{
numBytesRead = ReadFieldByField( hFile, &this->usStrategicInsertionData, sizeof(UINT16), sizeof(UINT16), numBytesRead);
buffer += 4; // To make numBytesRead check match the struct size. 2 bytes from uint32 - uint16 and 2 bytes due to struct memory layout change when usStrategicInsertionData was increased to uint32
}
numBytesRead = ReadFieldByField( hFile, &this->bFriendlyOrDirectDefaultResponseUsedRecently, sizeof(this->bFriendlyOrDirectDefaultResponseUsedRecently), sizeof(INT8), numBytesRead); numBytesRead = ReadFieldByField( hFile, &this->bFriendlyOrDirectDefaultResponseUsedRecently, sizeof(this->bFriendlyOrDirectDefaultResponseUsedRecently), sizeof(INT8), numBytesRead);
numBytesRead = ReadFieldByField( hFile, &this->bRecruitDefaultResponseUsedRecently, sizeof(this->bRecruitDefaultResponseUsedRecently), sizeof(INT8), numBytesRead); numBytesRead = ReadFieldByField( hFile, &this->bRecruitDefaultResponseUsedRecently, sizeof(this->bRecruitDefaultResponseUsedRecently), sizeof(INT8), numBytesRead);
numBytesRead = ReadFieldByField( hFile, &this->bThreatenDefaultResponseUsedRecently, sizeof(this->bThreatenDefaultResponseUsedRecently), sizeof(INT8), numBytesRead); numBytesRead = ReadFieldByField( hFile, &this->bThreatenDefaultResponseUsedRecently, sizeof(this->bThreatenDefaultResponseUsedRecently), sizeof(INT8), numBytesRead);
@@ -3602,8 +3588,14 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
alreadySaving = true; alreadySaving = true;
#ifdef LOADSAVEGAME_LOGTIME #ifdef LOADSAVEGAME_LOGTIME
TimingLogInitialize("TimeLog_LoadSavedGame.txt"); // Flugente: log how long this takes
clock_t starttime = clock();
clock_t t0;
clock_t t1 = starttime;
FILE* fp_timelog = fopen("LoadSavedGame_TimeLog.txt", "a");
#endif #endif
//clear out the save game header //clear out the save game header
memset( &SaveGameHeader, 0, sizeof( SAVED_GAME_HEADER ) ); memset( &SaveGameHeader, 0, sizeof( SAVED_GAME_HEADER ) );
@@ -3783,9 +3775,14 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
//Create the name of the file //Create the name of the file
CreateSavedGameFileNameFromNumber( ubSaveGameID, zSaveGameName ); CreateSavedGameFileNameFromNumber( ubSaveGameID, zSaveGameName );
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
TimingLogWrite("Save "); if (fp_timelog)
TimingLogWrite(zSaveGameName); {
TimingLog("\nShutdown stuff", 10); fprintf(fp_timelog, "Save savegame: %s\n", zSaveGameName);
t0 = t1;
t1 = clock();
fprintf(fp_timelog, "Shutdown stuff\t\t\t\t\t\t\t\t\t\t\t\t\t: %fs\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
}
#endif #endif
//if the file already exists, delete it //if the file already exists, delete it
@@ -3922,7 +3919,12 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
SaveGameFilePosition( FileGetPos( hFile ), "Tactical Status" ); SaveGameFilePosition( FileGetPos( hFile ), "Tactical Status" );
#endif #endif
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
TimingLog("SaveTacticalStatusToSavedGame", 6); if (fp_timelog)
{
t0 = t1;
t1 = clock();
fprintf(fp_timelog, "SaveTacticalStatusFromSavedGame done\t\t\t\t\t\t\t: %fs\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
}
#endif #endif
@@ -3964,7 +3966,12 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
SaveGameFilePosition( FileGetPos( hFile ), "Laptop Info" ); SaveGameFilePosition( FileGetPos( hFile ), "Laptop Info" );
#endif #endif
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
TimingLog("SaveLaptopInfoToSavedGame", 7); if (fp_timelog)
{
t0 = t1;
t1 = clock();
fprintf(fp_timelog, "SaveLaptopInfoFromSavedGame done\t\t\t\t\t\t\t\t: %fs\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
}
#endif #endif
// //
@@ -3996,7 +4003,12 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
SaveGameFilePosition( FileGetPos( hFile ), "Soldier Structure" ); SaveGameFilePosition( FileGetPos( hFile ), "Soldier Structure" );
#endif #endif
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
TimingLog("SaveSoldierStructure", 8); if (fp_timelog)
{
t0 = t1;
t1 = clock();
fprintf(fp_timelog, "SaveSoldierStructure done\t\t\t\t\t\t\t\t\t\t: %fs\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
}
#endif #endif
@@ -4059,7 +4071,12 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
SaveGameFilePosition( FileGetPos( hFile ), "Strategic Information" ); SaveGameFilePosition( FileGetPos( hFile ), "Strategic Information" );
#endif #endif
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
TimingLog("SaveStrategicInfoToSavedFile", 6); if (fp_timelog)
{
t0 = t1;
t1 = clock();
fprintf(fp_timelog, "SaveStrategicInfoFromSavedFile done\t\t\t\t\t\t\t\t: %fs\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
}
#endif #endif
/*// Flugente: Save the strategic supply /*// Flugente: Save the strategic supply
@@ -4109,7 +4126,12 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
SaveGameFilePosition( FileGetPos( hFile ), "Strategic Movement Groups" ); SaveGameFilePosition( FileGetPos( hFile ), "Strategic Movement Groups" );
#endif #endif
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
TimingLog("SaveStrategicMovementGroupsToSaveGameFile", 3); if (fp_timelog)
{
t0 = t1;
t1 = clock();
fprintf(fp_timelog, "SaveStrategicMovementGroupsFromSavedGameFile done\t\t\t\t: %fs\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
}
#endif #endif
@@ -4126,7 +4148,12 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
SaveGameFilePosition( FileGetPos( hFile ), "All the Map Temp files" ); SaveGameFilePosition( FileGetPos( hFile ), "All the Map Temp files" );
#endif #endif
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
TimingLog("SaveMapTempFilesToSavedGameFile", 6); if (fp_timelog)
{
t0 = t1;
t1 = clock();
fprintf(fp_timelog, "SaveMapTempFilesFromSavedGameFile done\t\t\t\t\t\t\t: %fs\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
}
#endif #endif
if( !SaveQuestInfoToSavedGameFile( hFile ) ) if( !SaveQuestInfoToSavedGameFile( hFile ) )
@@ -4292,7 +4319,12 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
SaveGameFilePosition( FileGetPos( hFile ), "Militia Movement" ); SaveGameFilePosition( FileGetPos( hFile ), "Militia Movement" );
#endif #endif
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
TimingLog("SaveMilitiaMovementInformationToSaveGameFile", 2); if (fp_timelog)
{
t0 = t1;
t1 = clock();
fprintf(fp_timelog, "SaveMilitiaMovementInformationFromSavedGameFile done\t\t\t: %fs\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
}
#endif #endif
if( !SaveBulletStructureToSaveGameFile( hFile ) ) if( !SaveBulletStructureToSaveGameFile( hFile ) )
@@ -4532,7 +4564,12 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
SaveGameFilePosition( FileGetPos( hFile ), "Lua global" ); SaveGameFilePosition( FileGetPos( hFile ), "Lua global" );
#endif #endif
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
TimingLog("SaveLuaGlobalToSaveGameFile", 7); if (fp_timelog)
{
t0 = t1;
t1 = clock();
fprintf(fp_timelog, "SaveLuaGlobalFromLoadGameFile done\t\t\t\t\t\t\t\t: %fs\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
}
#endif #endif
if( !SaveDataSaveToSaveGameFile( hFile ) ) if( !SaveDataSaveToSaveGameFile( hFile ) )
@@ -4632,7 +4669,12 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
goto FAILED_TO_SAVE; goto FAILED_TO_SAVE;
} }
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
TimingLog("File read done", 10); if (fp_timelog)
{
t0 = t1;
t1 = clock();
fprintf(fp_timelog, "File read done\t\t\t\t\t\t\t\t\t\t\t\t\t: %fs\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
}
#endif #endif
//Close the saved game file //Close the saved game file
@@ -4713,9 +4755,22 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
alreadySaving = false; alreadySaving = false;
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
TimingLog("Update functions", 9); if (fp_timelog)
TimingLogTotalTime("SaveSavedGame total", 9); {
TimingLogStop(); t0 = t1;
t1 = clock();
fprintf(fp_timelog, "Update functions\t\t\t\t\t\t\t\t\t\t\t\t: %fs\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
}
if (fp_timelog)
{
t0 = starttime;
t1 = clock();
fprintf(fp_timelog, "SaveSavedGame total\t\t\t\t\t\t\t\t\t\t\t\t: %fs\n\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
}
if (fp_timelog)
fclose(fp_timelog);
#endif #endif
return( TRUE ); return( TRUE );
@@ -4725,9 +4780,6 @@ FAILED_TO_SAVE:
#ifdef JA2BETAVERSION #ifdef JA2BETAVERSION
SaveGameFilePosition( FileGetPos( hFile ), "Failed to Save!!!" ); SaveGameFilePosition( FileGetPos( hFile ), "Failed to Save!!!" );
#endif #endif
#if LOADSAVEGAME_LOGTIME
TimingLogStop();
#endif
FileClose( hFile ); FileClose( hFile );
@@ -4773,6 +4825,8 @@ extern int gEnemyPreservedTempFileVersion[256];
extern int gCivPreservedTempFileVersion[256]; extern int gCivPreservedTempFileVersion[256];
#include "time.h"
BOOLEAN LoadSavedGame( int ubSavedGameID ) BOOLEAN LoadSavedGame( int ubSavedGameID )
{ {
HWFILE hFile; HWFILE hFile;
@@ -4791,7 +4845,12 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
#endif #endif
#ifdef LOADSAVEGAME_LOGTIME #ifdef LOADSAVEGAME_LOGTIME
TimingLogInitialize("TimeLog_LoadSavedGame.txt"); // Flugente: log how long this takes
clock_t starttime = clock();
clock_t t0;
clock_t t1 = starttime;
FILE *fp_timelog = fopen( "LoadSavedGame_TimeLog.txt", "a" );
#endif #endif
uiRelStartPerc = uiRelEndPerc =0; uiRelStartPerc = uiRelEndPerc =0;
@@ -4874,9 +4933,14 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
CreateSavedGameFileNameFromNumber( ubSavedGameID, zSaveGameName ); CreateSavedGameFileNameFromNumber( ubSavedGameID, zSaveGameName );
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
TimingLogWrite("Load "); if ( fp_timelog )
TimingLogWrite(zSaveGameName); {
TimingLog("\nShutdown stuff", 10); fprintf( fp_timelog, "Load savegame: %s\n", zSaveGameName );
t0 = t1;
t1 = clock();
fprintf( fp_timelog, "Shutdown stuff\t\t\t\t\t\t\t\t\t\t\t\t\t: %fs\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
}
#endif #endif
// open the save game file // open the save game file
@@ -4997,14 +5061,19 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
#ifdef JA2BETAVERSION #ifdef JA2BETAVERSION
LoadGameFilePosition( FileGetPos( hFile ), "Tactical Status" ); LoadGameFilePosition( FileGetPos( hFile ), "Tactical Status" );
#endif #endif
#if LOADSAVEGAME_LOGTIME
TimingLog("LoadTacticalStatusFromSavedGame", 6);
#endif
//This gets reset by the above function //This gets reset by the above function
gTacticalStatus.uiFlags |= LOADING_SAVED_GAME; gTacticalStatus.uiFlags |= LOADING_SAVED_GAME;
#if LOADSAVEGAME_LOGTIME
if ( fp_timelog )
{
t0 = t1;
t1 = clock();
fprintf( fp_timelog, "LoadTacticalStatusFromSavedGame done\t\t\t\t\t\t\t: %fs\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
}
#endif
//Load the game clock ingo //Load the game clock ingo
if( !LoadGameClock( hFile ) ) if( !LoadGameClock( hFile ) )
@@ -5125,7 +5194,12 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
#endif #endif
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
TimingLog("LoadLaptopInfoFromSavedGame", 7); if ( fp_timelog )
{
t0 = t1;
t1 = clock();
fprintf( fp_timelog, "LoadLaptopInfoFromSavedGame done\t\t\t\t\t\t\t\t: %fs\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
}
#endif #endif
uiRelEndPerc += 0; uiRelEndPerc += 0;
@@ -5168,7 +5242,12 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
#endif #endif
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
TimingLog("LoadSoldierStructure", 8); if ( fp_timelog )
{
t0 = t1;
t1 = clock();
fprintf( fp_timelog, "LoadSoldierStructure done\t\t\t\t\t\t\t\t\t\t: %fs\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
}
#endif #endif
uiRelEndPerc += 1; uiRelEndPerc += 1;
@@ -5297,7 +5376,12 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
#endif #endif
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
TimingLog("LoadStrategicInfoFromSavedFile", 6); if ( fp_timelog )
{
t0 = t1;
t1 = clock();
fprintf( fp_timelog, "LoadStrategicInfoFromSavedFile done\t\t\t\t\t\t\t\t: %fs\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
}
#endif #endif
uiRelEndPerc += 1; uiRelEndPerc += 1;
@@ -5358,7 +5442,12 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
ValidateStrategicGroups(); ValidateStrategicGroups();
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
TimingLog("LoadStrategicMovementGroupsFromSavedGameFile", 2); if ( fp_timelog )
{
t0 = t1;
t1 = clock();
fprintf( fp_timelog, "LoadStrategicMovementGroupsFromSavedGameFile done\t\t\t\t: %fs\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
}
#endif #endif
uiRelEndPerc += 30; uiRelEndPerc += 30;
@@ -5378,7 +5467,12 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
#endif #endif
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
TimingLog("LoadMapTempFilesFromSavedGameFile", 5); if ( fp_timelog )
{
t0 = t1;
t1 = clock();
fprintf( fp_timelog, "LoadMapTempFilesFromSavedGameFile done\t\t\t\t\t\t\t: %fs\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
}
#endif #endif
uiRelEndPerc += 1; uiRelEndPerc += 1;
@@ -5677,7 +5771,12 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
#endif #endif
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
TimingLog("LoadMilitiaMovementInformationFromSavedGameFile", 2); if ( fp_timelog )
{
t0 = t1;
t1 = clock();
fprintf( fp_timelog, "LoadMilitiaMovementInformationFromSavedGameFile done\t\t\t: %fs\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
}
#endif #endif
uiRelEndPerc += 1; uiRelEndPerc += 1;
@@ -6237,7 +6336,12 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
#endif #endif
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
TimingLog("LoadLuaGlobalFromLoadGameFile", 6); if ( fp_timelog )
{
t0 = t1;
t1 = clock();
fprintf( fp_timelog, "LoadLuaGlobalFromLoadGameFile done\t\t\t\t\t\t\t\t: %fs\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
}
#endif #endif
if( guiCurrentSaveGameVersion >= VEHICLES_DATATYPE_CHANGE && guiCurrentSaveGameVersion < NO_VEHICLE_SAVE) if( guiCurrentSaveGameVersion >= VEHICLES_DATATYPE_CHANGE && guiCurrentSaveGameVersion < NO_VEHICLE_SAVE)
@@ -6469,7 +6573,12 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
} }
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
TimingLog("File read done", 10); if ( fp_timelog )
{
t0 = t1;
t1 = clock();
fprintf( fp_timelog, "File read done\t\t\t\t\t\t\t\t\t\t\t\t\t: %fs\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
}
#endif #endif
// //
@@ -6914,9 +7023,22 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
gGameExternalOptions.gfAllowReinforcements = zDiffSetting[gGameOptions.ubDifficultyLevel].bAllowReinforcements; gGameExternalOptions.gfAllowReinforcements = zDiffSetting[gGameOptions.ubDifficultyLevel].bAllowReinforcements;
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
TimingLog("Update functions", 9); if ( fp_timelog )
TimingLogTotalTime("LoadSavedGame total", 9); {
TimingLogStop(); t0 = t1;
t1 = clock();
fprintf( fp_timelog, "Update functions\t\t\t\t\t\t\t\t\t\t\t\t: %fs\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
}
if ( fp_timelog )
{
t0 = starttime;
t1 = clock();
fprintf( fp_timelog, "LoadSavedGame total\t\t\t\t\t\t\t\t\t\t\t\t: %fs\n\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
}
if ( fp_timelog )
fclose( fp_timelog );
#endif #endif
DebugQuestInfo("\n--------- Game loaded ---------"); DebugQuestInfo("\n--------- Game loaded ---------");
@@ -7216,7 +7338,7 @@ BOOLEAN LoadSoldierStructure( HWFILE hFile )
} }
} }
if( g_lang == i18n::Lang::de ) { #ifdef GERMAN
// Fix neutral flags // Fix neutral flags
if ( guiCurrentSaveGameVersion < 94 ) if ( guiCurrentSaveGameVersion < 94 )
{ {
@@ -7226,7 +7348,7 @@ if( g_lang == i18n::Lang::de ) {
Menptr[ cnt].aiData.bNeutral = FALSE; Menptr[ cnt].aiData.bNeutral = FALSE;
} }
} }
} #endif
//#ifdef JA2UB //#ifdef JA2UB
//if the soldier has the NON weapon version of the merc knofe or merc umbrella //if the soldier has the NON weapon version of the merc knofe or merc umbrella
//ConvertWeapons( &Menptr[ cnt ] ); //ConvertWeapons( &Menptr[ cnt ] );
@@ -9907,9 +10029,9 @@ UINT32 CalcJA2EncryptionSet( SAVED_GAME_HEADER * pSaveGameHeader )
} }
} }
if( g_lang == i18n::Lang::de ) { #ifdef GERMAN
uiEncryptionSet *= 11; uiEncryptionSet *= 11;
} #endif
uiEncryptionSet = uiEncryptionSet % 10; uiEncryptionSet = uiEncryptionSet % 10;
-72
View File
@@ -1,72 +0,0 @@
#include "TimeLogging.h"
#include "time.h"
#include <stdio.h>
clock_t starttime;
clock_t t0;
clock_t t1;
FILE* fp_timelog = nullptr;
static void indent(int n)
{
for (int i = 0; i < n; i++)
fputc('\t', fp_timelog);
}
void TimingLogInitialize(const CHAR8* filename)
{
starttime = clock();
t1 = starttime;
if (!fp_timelog)
{
fp_timelog = fopen(filename, "a");
}
}
void TimingLog(const CHAR8* logEvent, int n)
{
if (fp_timelog)
{
t0 = t1;
t1 = clock();
fprintf(fp_timelog, "%s", logEvent);
indent(n);
fprintf(fp_timelog, ": %f s\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
}
}
void TimingLogTotalTime(const CHAR8* logEvent, int n)
{
if (fp_timelog)
{
t1 = clock();
fprintf(fp_timelog, "%s", logEvent);
indent(n);
fprintf(fp_timelog, ": %f s\n", ((float)(t1 - starttime) / CLOCKS_PER_SEC));
}
}
void TimingLogWrite(const CHAR8* text)
{
if (fp_timelog)
{
fprintf(fp_timelog, text);
}
}
void TimingLogStop()
{
if (fp_timelog)
{
fprintf(fp_timelog, "\n");
fclose(fp_timelog);
fp_timelog = nullptr;
}
}
-8
View File
@@ -1,8 +0,0 @@
#pragma once
#include "Types.h"
void TimingLogInitialize(const CHAR8* filename);
void TimingLog(const CHAR8* logEvent, int n);
void TimingLogTotalTime(const CHAR8* logEvent, int n);
void TimingLogWrite(const CHAR8* text);
void TimingLogStop();
+2
View File
@@ -1,6 +1,8 @@
#ifndef _BUILDDEFINES_H #ifndef _BUILDDEFINES_H
#define _BUILDDEFINES_H #define _BUILDDEFINES_H
#include "Language Defines.h"
//----- Briefing Room (Mission based JA2 like in JA/DG) - by Jazz ----- //----- Briefing Room (Mission based JA2 like in JA/DG) - by Jazz -----
// Once enabled here and also enabled in the ja2_options.ini (BRIEFING_ROOM), // Once enabled here and also enabled in the ja2_options.ini (BRIEFING_ROOM),
// you can access the briefing room feature from the laptop // you can access the briefing room feature from the laptop
+8 -6
View File
@@ -45,10 +45,10 @@
#include "Sound Control.h" #include "Sound Control.h"
#include "WordWrap.h" #include "WordWrap.h"
#include "text.h" #include "text.h"
#include "Language Defines.h"
#include "IniReader.h" #include "IniReader.h"
#include "sgp_logger.h" #include "sgp_logger.h"
#include <language.hpp>
#define _UNICODE #define _UNICODE
// Networking Stuff // Networking Stuff
@@ -332,7 +332,7 @@ UINT32 InitScreenHandle(void)
if ( ubCurrentScreen == 255 ) if ( ubCurrentScreen == 255 )
{ {
if( g_lang == i18n::Lang::en ) { #ifdef ENGLISH
if( gfDoneWithSplashScreen ) if( gfDoneWithSplashScreen )
{ {
ubCurrentScreen = 0; ubCurrentScreen = 0;
@@ -342,9 +342,9 @@ UINT32 InitScreenHandle(void)
SetCurrentCursorFromDatabase( VIDEO_NO_CURSOR ); SetCurrentCursorFromDatabase( VIDEO_NO_CURSOR );
return( INTRO_SCREEN ); return( INTRO_SCREEN );
} }
} else { #else
ubCurrentScreen = 0; ubCurrentScreen = 0;
} #endif
} }
if ( ubCurrentScreen == 0 ) if ( ubCurrentScreen == 0 )
@@ -397,7 +397,7 @@ UINT32 InitScreenHandle(void)
// Handle queued .ini file error messages // Handle queued .ini file error messages
int y = 40; int y = 40;
sgp::Logger_ID ini_id = sgp::Logger::instance().createLogger(); sgp::Logger_ID ini_id = sgp::Logger::instance().createLogger();
sgp::Logger::instance().connectFile(ini_id, L"iniErrorReport.log", false, sgp::Logger::FLUSH_ON_DELETE); sgp::Logger::instance().connectFile(ini_id, L"iniErrorReport.txt", false, sgp::Logger::FLUSH_ON_DELETE);
sgp::Logger::LogInstance logger = sgp::Logger::instance().logger(ini_id); sgp::Logger::LogInstance logger = sgp::Logger::instance().logger(ini_id);
while (! iniErrorMessages.empty()) { while (! iniErrorMessages.empty()) {
static BOOL iniErrorMessage_create_out_file = TRUE; static BOOL iniErrorMessage_create_out_file = TRUE;
@@ -407,7 +407,7 @@ UINT32 InitScreenHandle(void)
if (iniErrorMessage_create_out_file) if (iniErrorMessage_create_out_file)
{ {
y += 25; y += 25;
swprintf( str, L"%S", "Warning: found the following ini errors. iniErrorReport.log has been created." ); swprintf( str, L"%S", "Warning: found the following ini errors. iniErrorReport.txt has been created." );
DisplayWrappedString( 10, y, 560, 2, FONT12ARIAL, FONT_ORANGE, str, FONT_BLACK, TRUE, LEFT_JUSTIFIED ); DisplayWrappedString( 10, y, 560, 2, FONT12ARIAL, FONT_ORANGE, str, FONT_BLACK, TRUE, LEFT_JUSTIFIED );
iniErrorMessage_create_out_file = FALSE; iniErrorMessage_create_out_file = FALSE;
} }
@@ -959,6 +959,7 @@ void DoneFadeOutForDemoExitScreen( void )
// unused // unused
//extern INT8 gbFadeSpeed; //extern INT8 gbFadeSpeed;
#ifdef GERMAN
void DisplayTopwareGermanyAddress() void DisplayTopwareGermanyAddress()
{ {
VOBJECT_DESC vo_desc; VOBJECT_DESC vo_desc;
@@ -993,6 +994,7 @@ void DisplayTopwareGermanyAddress()
ExecuteBaseDirtyRectQueue(); ExecuteBaseDirtyRectQueue();
EndFrameBufferRender(); EndFrameBufferRender();
} }
#endif
UINT32 DemoExitScreenHandle(void) UINT32 DemoExitScreenHandle(void)
{ {
+1 -7
View File
@@ -238,8 +238,7 @@ void LoadGameUBOptions()
gGameUBOptions.PowergenSectorGridNo3 = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_SECTOR_GRIDNO_3", 14155); gGameUBOptions.PowergenSectorGridNo3 = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_SECTOR_GRIDNO_3", 14155);
gGameUBOptions.PowergenSectorGridNo4 = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_SECTOR_GRIDNO_4", 13980); gGameUBOptions.PowergenSectorGridNo4 = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_SECTOR_GRIDNO_4", 13980);
gGameUBOptions.PowergenSectorExitgridGridNo = iniReader.ReadInteger( "Unfinished Business Settings", "POWERGEN_SECTOR_EXITGRID_GRIDNO", 19749 ); gGameUBOptions.PowergenSectorExitgridGridNo = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_SECTOR_EXITGRID_GRIDNO", 19749);
gGameUBOptions.PowergenSectorExitgridSrcGridNo = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_SECTOR_EXITGRID_SRC_GRIDNO", 10979 );
gGameUBOptions.PowergenFanSoundGridNo1 = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_FAN_SOUND_GRIDNO_1", 10979); gGameUBOptions.PowergenFanSoundGridNo1 = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_FAN_SOUND_GRIDNO_1", 10979);
gGameUBOptions.PowergenFanSoundGridNo2 = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_FAN_SOUND_GRIDNO_2", 19749); gGameUBOptions.PowergenFanSoundGridNo2 = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_FAN_SOUND_GRIDNO_2", 19749);
gGameUBOptions.StartFanbackupAgainGridNo = iniReader.ReadInteger("Unfinished Business Settings","START_FANBACKUP_AGAIN_GRIDNO", 10980); gGameUBOptions.StartFanbackupAgainGridNo = iniReader.ReadInteger("Unfinished Business Settings","START_FANBACKUP_AGAIN_GRIDNO", 10980);
@@ -357,11 +356,6 @@ void LoadGameUBOptions()
gGameUBOptions.H10SectorPlayerQuoteZ = iniReader.ReadInteger("Unfinished Business Settings","H10_SECTOR_PLAYER_QUOTE_Z", 0); gGameUBOptions.H10SectorPlayerQuoteZ = iniReader.ReadInteger("Unfinished Business Settings","H10_SECTOR_PLAYER_QUOTE_Z", 0);
gGameUBOptions.BettyBloodCatSectorX = iniReader.ReadInteger( "Unfinished Business Settings", "BETTY_BLOODCAT_SECTOR_X", 10 );
gGameUBOptions.BettyBloodCatSectorY = iniReader.ReadInteger( "Unfinished Business Settings", "BETTY_BLOODCAT_SECTOR_Y", 9 );
gGameUBOptions.BettyBloodCatSectorZ = iniReader.ReadInteger( "Unfinished Business Settings", "BETTY_BLOODCAT_SECTOR_Z", 0 );
if ( gGameUBOptions.InGameHeli == TRUE ) if ( gGameUBOptions.InGameHeli == TRUE )
gGameUBOptions.InGameHeliCrash = FALSE; gGameUBOptions.InGameHeliCrash = FALSE;
-4
View File
@@ -67,7 +67,6 @@ typedef struct
UINT32 PowergenSectorGridNo3; UINT32 PowergenSectorGridNo3;
UINT32 PowergenSectorGridNo4; UINT32 PowergenSectorGridNo4;
UINT32 PowergenSectorExitgridGridNo; UINT32 PowergenSectorExitgridGridNo;
UINT32 PowergenSectorExitgridSrcGridNo;
UINT32 PowergenFanSoundGridNo1; UINT32 PowergenFanSoundGridNo1;
UINT32 PowergenFanSoundGridNo2; UINT32 PowergenFanSoundGridNo2;
UINT32 StartFanbackupAgainGridNo; UINT32 StartFanbackupAgainGridNo;
@@ -221,9 +220,6 @@ typedef struct
UINT8 MaxNumberOfMercs; UINT8 MaxNumberOfMercs;
INT16 BettyBloodCatSectorX;
INT16 BettyBloodCatSectorY;
INT8 BettyBloodCatSectorZ;
} GAME_UB_OPTIONS; } GAME_UB_OPTIONS;
extern GAME_UB_OPTIONS gGameUBOptions; extern GAME_UB_OPTIONS gGameUBOptions;
+22 -98
View File
@@ -36,6 +36,7 @@
#include "Strategic Status.h" #include "Strategic Status.h"
#include "Merc Contract.h" #include "Merc Contract.h"
#include "Strategic Merc Handler.h" #include "Strategic Merc Handler.h"
#include "Language Defines.h"
#include "Assignments.h" #include "Assignments.h"
#include "Sound Control.h" #include "Sound Control.h"
#include "Quests.h" #include "Quests.h"
@@ -49,7 +50,6 @@
#include "Encrypted File.h" #include "Encrypted File.h"
#include "InterfaceItemImages.h" #include "InterfaceItemImages.h"
#include <sstream> #include <sstream>
#include <language.hpp>
// //
//****** Defines ****** //****** Defines ******
@@ -148,16 +148,10 @@
#define FEE_X PRICE_X + 7 #define FEE_X PRICE_X + 7
#define FEE_Y NAME_Y #define FEE_Y NAME_Y
#define FEE_WIDTH 37 #define FEE_WIDTH 37
#define FEE_X_UB PRICE_X + 40
#define FEE_Y_UB STATS_Y + 28
#define FEE_Y_UB_NSGI STATS_Y
#define AIM_CONTRACT_X PRICE_X + 51 #define AIM_CONTRACT_X PRICE_X + 51
#define AIM_CONTRACT_Y FEE_Y #define AIM_CONTRACT_Y FEE_Y
#define AIM_CONTRACT_WIDTH 59 #define AIM_CONTRACT_WIDTH 59
#define AIM_CONTRACT_X_UB PRICE_X + 19
#define AIM_OFFER_X PRICE_X + 3
#define AIM_OFFER_WIDTH 110
#define ONEDAY_X AIM_CONTRACT_X #define ONEDAY_X AIM_CONTRACT_X
#define ONEWEEK_X AIM_CONTRACT_X #define ONEWEEK_X AIM_CONTRACT_X
@@ -1126,13 +1120,7 @@ BOOLEAN RenderAIMMembers()
UpdateMercInfo(); UpdateMercInfo();
//Display AIM Member text
DrawTextToScreen(CharacterInfo[AIM_MEMBER_ACTIVE_MEMBERS], AIM_MEMBER_ACTIVE_TEXT_X_NSGI, AIM_MEMBER_ACTIVE_TEXT_Y_NSGI, AIM_MEMBER_ACTIVE_TEXT_WIDTH_NSGI, AIM_MAINTITLE_FONT, AIM_M_ACTIVE_MEMBER_TITLE_COLOR, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
//Draw fee & contract //Draw fee & contract
#ifdef JA2UB
DrawTextToScreen(CharacterInfo[AIM_MEMBER_UB_MISSION_FEE], AIM_CONTRACT_X_UB, AIM_CONTRACT_Y_NSGI, 0, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
#else
DrawTextToScreen(CharacterInfo[AIM_MEMBER_FEE], FEE_X_NSGI, FEE_Y_NSGI, 0, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); DrawTextToScreen(CharacterInfo[AIM_MEMBER_FEE], FEE_X_NSGI, FEE_Y_NSGI, 0, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
DrawTextToScreen(CharacterInfo[AIM_MEMBER_CONTRACT], AIM_CONTRACT_X_NSGI, AIM_CONTRACT_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED ); DrawTextToScreen(CharacterInfo[AIM_MEMBER_CONTRACT], AIM_CONTRACT_X_NSGI, AIM_CONTRACT_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
@@ -1141,6 +1129,9 @@ BOOLEAN RenderAIMMembers()
DrawTextToScreen(CharacterInfo[AIM_MEMBER_1_WEEK], ONEWEEK_X_NSGI, MARKSMAN_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED ); DrawTextToScreen(CharacterInfo[AIM_MEMBER_1_WEEK], ONEWEEK_X_NSGI, MARKSMAN_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
DrawTextToScreen(CharacterInfo[AIM_MEMBER_2_WEEKS], TWOWEEK_X_NSGI, MECHANAICAL_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED ); DrawTextToScreen(CharacterInfo[AIM_MEMBER_2_WEEKS], TWOWEEK_X_NSGI, MECHANAICAL_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
//Display AIM Member text
DrawTextToScreen(CharacterInfo[AIM_MEMBER_ACTIVE_MEMBERS], AIM_MEMBER_ACTIVE_TEXT_X_NSGI, AIM_MEMBER_ACTIVE_TEXT_Y_NSGI, AIM_MEMBER_ACTIVE_TEXT_WIDTH_NSGI, AIM_MAINTITLE_FONT, AIM_M_ACTIVE_MEMBER_TITLE_COLOR, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
//Display Option Gear Cost text //Display Option Gear Cost text
DrawTextToScreen(CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR_NSGI], AIM_MEMBER_OPTIONAL_GEAR_X_NSGI, EXPLOSIVE_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED ); DrawTextToScreen(CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR_NSGI], AIM_MEMBER_OPTIONAL_GEAR_X_NSGI, EXPLOSIVE_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
@@ -1149,7 +1140,6 @@ BOOLEAN RenderAIMMembers()
InsertDollarSignInToString( wTemp ); InsertDollarSignInToString( wTemp );
uiPosX = AIM_MEMBER_OPTIONAL_GEAR_X_NSGI + StringPixLength( CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR_NSGI], AIM_M_FONT_STATIC_TEXT) + 5; uiPosX = AIM_MEMBER_OPTIONAL_GEAR_X_NSGI + StringPixLength( CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR_NSGI], AIM_M_FONT_STATIC_TEXT) + 5;
DrawTextToScreen(wTemp, AIM_MEMBER_OPTIONAL_GEAR_COST_X_NSGI, EXPLOSIVE_Y_NSGI, FEE_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_DYNAMIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED ); DrawTextToScreen(wTemp, AIM_MEMBER_OPTIONAL_GEAR_COST_X_NSGI, EXPLOSIVE_Y_NSGI, FEE_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_DYNAMIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
#endif // JA2UB
} }
else else
{ {
@@ -1173,12 +1163,6 @@ BOOLEAN RenderAIMMembers()
UpdateMercInfo(); UpdateMercInfo();
//Display AIM Member text
DrawTextToScreen(CharacterInfo[AIM_MEMBER_ACTIVE_MEMBERS], AIM_MEMBER_ACTIVE_TEXT_X, AIM_MEMBER_ACTIVE_TEXT_Y, AIM_MEMBER_ACTIVE_TEXT_WIDTH, AIM_MAINTITLE_FONT, AIM_M_ACTIVE_MEMBER_TITLE_COLOR, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
#ifdef JA2UB
DrawTextToScreen(CharacterInfo[AIM_MEMBER_UB_MISSION_FEE], AIM_CONTRACT_X_UB, AIM_CONTRACT_Y, 0, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
#else
//Draw fee & contract //Draw fee & contract
DrawTextToScreen(CharacterInfo[AIM_MEMBER_FEE], FEE_X, FEE_Y, 0, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); DrawTextToScreen(CharacterInfo[AIM_MEMBER_FEE], FEE_X, FEE_Y, 0, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
DrawTextToScreen(CharacterInfo[AIM_MEMBER_CONTRACT], AIM_CONTRACT_X, AIM_CONTRACT_Y, AIM_CONTRACT_WIDTH, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED ); DrawTextToScreen(CharacterInfo[AIM_MEMBER_CONTRACT], AIM_CONTRACT_X, AIM_CONTRACT_Y, AIM_CONTRACT_WIDTH, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
@@ -1188,6 +1172,9 @@ BOOLEAN RenderAIMMembers()
DrawTextToScreen(CharacterInfo[AIM_MEMBER_1_WEEK], ONEWEEK_X, MARKSMAN_Y, AIM_CONTRACT_WIDTH, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED ); DrawTextToScreen(CharacterInfo[AIM_MEMBER_1_WEEK], ONEWEEK_X, MARKSMAN_Y, AIM_CONTRACT_WIDTH, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
DrawTextToScreen(CharacterInfo[AIM_MEMBER_2_WEEKS], TWOWEEK_X, MECHANAICAL_Y, AIM_CONTRACT_WIDTH, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED ); DrawTextToScreen(CharacterInfo[AIM_MEMBER_2_WEEKS], TWOWEEK_X, MECHANAICAL_Y, AIM_CONTRACT_WIDTH, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
//Display AIM Member text
DrawTextToScreen(CharacterInfo[AIM_MEMBER_ACTIVE_MEMBERS], AIM_MEMBER_ACTIVE_TEXT_X, AIM_MEMBER_ACTIVE_TEXT_Y, AIM_MEMBER_ACTIVE_TEXT_WIDTH, AIM_MAINTITLE_FONT, AIM_M_ACTIVE_MEMBER_TITLE_COLOR, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
//Display Option Gear Cost text //Display Option Gear Cost text
DrawTextToScreen(CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR], AIM_MEMBER_OPTIONAL_GEAR_X, AIM_MEMBER_OPTIONAL_GEAR_Y, 0, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); DrawTextToScreen(CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR], AIM_MEMBER_OPTIONAL_GEAR_X, AIM_MEMBER_OPTIONAL_GEAR_Y, 0, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
@@ -1196,7 +1183,6 @@ BOOLEAN RenderAIMMembers()
InsertDollarSignInToString( wTemp ); InsertDollarSignInToString( wTemp );
uiPosX = AIM_MEMBER_OPTIONAL_GEAR_X + StringPixLength( CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR], AIM_M_FONT_STATIC_TEXT) + 5; uiPosX = AIM_MEMBER_OPTIONAL_GEAR_X + StringPixLength( CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR], AIM_M_FONT_STATIC_TEXT) + 5;
DrawTextToScreen(wTemp, uiPosX, AIM_MEMBER_OPTIONAL_GEAR_Y, 0, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_DYNAMIC_TEXT, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); DrawTextToScreen(wTemp, uiPosX, AIM_MEMBER_OPTIONAL_GEAR_Y, 0, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_DYNAMIC_TEXT, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
#endif
} }
DisableAimButton(); DisableAimButton();
@@ -1323,10 +1309,6 @@ BOOLEAN UpdateMercInfo(void)
if(gGameExternalOptions.gfUseNewStartingGearInterface) if(gGameExternalOptions.gfUseNewStartingGearInterface)
{ {
#ifdef JA2UB
DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].uiWeeklySalary, FEE_WIDTH, FEE_X_UB, FEE_Y_UB_NSGI, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT);
DisplayWrappedString(AIM_OFFER_X, AGILITY_Y_NSGI, AIM_OFFER_WIDTH, 2, AIM_M_FONT_DYNAMIC_TEXT, AIM_FONT_MCOLOR_WHITE, zNewTacticalMessages[TACT_MSG__AIMMEMBER_FEE_TEXT], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
#else
//Display the salaries //Display the salaries
DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].sSalary, FEE_WIDTH_NSGI, FEE_X_NSGI, HEALTH_Y_NSGI, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT ); DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].sSalary, FEE_WIDTH_NSGI, FEE_X_NSGI, HEALTH_Y_NSGI, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT );
DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].uiWeeklySalary, FEE_WIDTH_NSGI, FEE_X_NSGI, AGILITY_Y_NSGI, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT ); DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].uiWeeklySalary, FEE_WIDTH_NSGI, FEE_X_NSGI, AGILITY_Y_NSGI, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT );
@@ -1353,8 +1335,6 @@ BOOLEAN UpdateMercInfo(void)
else else
DisplayWrappedString(AIM_MEDICAL_DEPOSIT_X_NSGI, AIM_MEDICAL_DEPOSIT_Y_NSGI, AIM_MEDICAL_DEPOSIT_WIDTH_NSGI, 2, AIM_FONT12ARIAL, AIM_M_COLOR_DYNAMIC_TEXT, sMedicalString, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED); DisplayWrappedString(AIM_MEDICAL_DEPOSIT_X_NSGI, AIM_MEDICAL_DEPOSIT_Y_NSGI, AIM_MEDICAL_DEPOSIT_WIDTH_NSGI, 2, AIM_FONT12ARIAL, AIM_M_COLOR_DYNAMIC_TEXT, sMedicalString, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
} }
#endif // JA2UB
if(!g_bUseXML_Strings) if(!g_bUseXML_Strings)
{ {
// LoadMercBioInfo( gbCurrentSoldier, MercInfoString, AdditionalInfoString); // LoadMercBioInfo( gbCurrentSoldier, MercInfoString, AdditionalInfoString);
@@ -1383,10 +1363,6 @@ BOOLEAN UpdateMercInfo(void)
} }
else else
{ {
#ifdef JA2UB
DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].uiWeeklySalary, FEE_WIDTH, FEE_X_UB, FEE_Y_UB, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT);
DisplayWrappedString(AIM_OFFER_X, AGILITY_Y, AIM_OFFER_WIDTH, 2, AIM_M_FONT_DYNAMIC_TEXT, AIM_FONT_MCOLOR_WHITE, zNewTacticalMessages[TACT_MSG__AIMMEMBER_FEE_TEXT], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
#else
//Display the salaries //Display the salaries
DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].sSalary, FEE_WIDTH, FEE_X, HEALTH_Y, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT ); DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].sSalary, FEE_WIDTH, FEE_X, HEALTH_Y, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT );
DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].uiWeeklySalary, FEE_WIDTH, FEE_X, AGILITY_Y, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT ); DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].uiWeeklySalary, FEE_WIDTH, FEE_X, AGILITY_Y, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT );
@@ -1413,7 +1389,6 @@ BOOLEAN UpdateMercInfo(void)
else else
DisplayWrappedString(AIM_MEDICAL_DEPOSIT_X, AIM_MEDICAL_DEPOSIT_Y, AIM_MEDICAL_DEPOSIT_WIDTH, 2, AIM_FONT12ARIAL, AIM_M_COLOR_DYNAMIC_TEXT, sMedicalString, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED); DisplayWrappedString(AIM_MEDICAL_DEPOSIT_X, AIM_MEDICAL_DEPOSIT_Y, AIM_MEDICAL_DEPOSIT_WIDTH, 2, AIM_FONT12ARIAL, AIM_M_COLOR_DYNAMIC_TEXT, sMedicalString, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
} }
#endif
if(!g_bUseXML_Strings) if(!g_bUseXML_Strings)
{ {
// LoadMercBioInfo( gbCurrentSoldier, MercInfoString, AdditionalInfoString); // LoadMercBioInfo( gbCurrentSoldier, MercInfoString, AdditionalInfoString);
@@ -2553,21 +2528,6 @@ BOOLEAN DisplayVideoConferencingDisplay()
DisplayMercChargeAmount(); DisplayMercChargeAmount();
#ifdef JA2UB
if (gubVideoConferencingMode == AIM_VIDEO_HIRE_MERC_MODE)
{
CHAR16 offerText[190];
swprintf(offerText, zNewTacticalMessages[TACT_MSG__AIMMEMBER_ONE_TIME_FEE], gMercProfiles[gbCurrentSoldier].zNickname);
const auto xCoord = AIM_MEMBER_VIDEO_CONF_TERMINAL_X + 115;
const auto yCoord = AIM_MEMBER_VIDEO_CONF_TERMINAL_Y + 45;
const auto textAreaWidth = 245;
SetFontShadow(AIM_M_VIDEO_NAME_SHADOWCOLOR);
DisplayWrappedString(xCoord, yCoord, textAreaWidth, 2, AIM_M_FONT_DYNAMIC_TEXT, FONT_MCOLOR_BLACK, offerText, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
SetFontShadow(DEFAULT_SHADOW);
}
#endif // JA2UB
// if( gfMercIsTalking && !gfIsAnsweringMachineActive) // if( gfMercIsTalking && !gfIsAnsweringMachineActive)
if( gfMercIsTalking && gGameSettings.fOptions[ TOPTION_SUBTITLES ] ) if( gfMercIsTalking && gGameSettings.fOptions[ TOPTION_SUBTITLES ] )
{ {
@@ -2617,9 +2577,6 @@ BOOLEAN DisplayMercsVideoFace()
void DisplaySelectLights(BOOLEAN fContractDown, BOOLEAN fBuyEquipDown) void DisplaySelectLights(BOOLEAN fContractDown, BOOLEAN fBuyEquipDown)
{ {
#ifdef JA2UB
return;
#else
UINT16 i, usPosY, usPosX; UINT16 i, usPosY, usPosX;
//First draw the select light for the contract length buttons //First draw the select light for the contract length buttons
@@ -2673,8 +2630,6 @@ void DisplaySelectLights(BOOLEAN fContractDown, BOOLEAN fBuyEquipDown)
usPosY += AIM_MEMBER_BUY_EQUIPMENT_GAP; usPosY += AIM_MEMBER_BUY_EQUIPMENT_GAP;
} }
InvalidateRegion(LAPTOP_SCREEN_UL_X,LAPTOP_SCREEN_WEB_UL_Y,LAPTOP_SCREEN_LR_X,LAPTOP_SCREEN_WEB_LR_Y); InvalidateRegion(LAPTOP_SCREEN_UL_X,LAPTOP_SCREEN_WEB_UL_Y,LAPTOP_SCREEN_LR_X,LAPTOP_SCREEN_WEB_LR_Y);
#endif // JA2UB
} }
@@ -2698,10 +2653,7 @@ UINT32 DisplayMercChargeAmount()
giContractAmount = 0; giContractAmount = 0;
//the contract charge amount //the contract charge amount
#ifdef JA2UB
// Special offer for a limited time! Act fast!
giContractAmount = gMercProfiles[gbCurrentSoldier].uiWeeklySalary;
#else
// Get the salary rate // Get the salary rate
if( gubContractLength == AIM_CONTRACT_LENGTH_ONE_DAY) if( gubContractLength == AIM_CONTRACT_LENGTH_ONE_DAY)
giContractAmount = gMercProfiles[gbCurrentSoldier].sSalary; giContractAmount = gMercProfiles[gbCurrentSoldier].sSalary;
@@ -2723,7 +2675,6 @@ UINT32 DisplayMercChargeAmount()
{ {
giContractAmount += gMercProfiles[gbCurrentSoldier].usOptionalGearCost; giContractAmount += gMercProfiles[gbCurrentSoldier].usOptionalGearCost;
} }
#endif
} }
@@ -2734,15 +2685,10 @@ UINT32 DisplayMercChargeAmount()
//if the merc hasnt just been hired //if the merc hasnt just been hired
// if( FindSoldierByProfileID( gbCurrentSoldier, TRUE ) == NULL ) // if( FindSoldierByProfileID( gbCurrentSoldier, TRUE ) == NULL )
{ {
#ifdef JA2UB
// Don't even have to pay for medical insurance! What a DEAL!
swprintf(wTemp, L"%s", wDollarTemp);
#else
if( gMercProfiles[ gbCurrentSoldier ].bMedicalDeposit ) if( gMercProfiles[ gbCurrentSoldier ].bMedicalDeposit )
swprintf(wTemp, L"%s %s", wDollarTemp, VideoConfercingText[AIM_MEMBER_WITH_MEDICAL] ); swprintf(wTemp, L"%s %s", wDollarTemp, VideoConfercingText[AIM_MEMBER_WITH_MEDICAL] );
else else
swprintf(wTemp, L"%s", wDollarTemp ); swprintf(wTemp, L"%s", wDollarTemp );
#endif // JA2UB
DrawTextToScreen(wTemp, AIM_CONTRACT_CHARGE_AMOUNNT_X+1, AIM_CONTRACT_CHARGE_AMOUNNT_Y+3, 0, AIM_M_VIDEO_CONTRACT_AMOUNT_FONT, AIM_M_VIDEO_CONTRACT_AMOUNT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED); DrawTextToScreen(wTemp, AIM_CONTRACT_CHARGE_AMOUNNT_X+1, AIM_CONTRACT_CHARGE_AMOUNNT_Y+3, 0, AIM_M_VIDEO_CONTRACT_AMOUNT_FONT, AIM_M_VIDEO_CONTRACT_AMOUNT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
} }
@@ -3941,14 +3887,14 @@ BOOLEAN InitDeleteVideoConferencePopUp( )
MSYS_DisableRegion(&gSelectedShutUpMercRegion); MSYS_DisableRegion(&gSelectedShutUpMercRegion);
//Enable the ability to click on the BIG face to go to different screen //Enable the ability to click on the BIG face to go to different screen
MSYS_EnableRegion(&gSelectedFaceRegion); MSYS_EnableRegion(&gSelectedFaceRegion);
// EnableDisableCurrentVideoConferenceButtons(FALSE); // EnableDisableCurrentVideoConferenceButtons(FALSE);
if( gubVideoConferencingPreviousMode == AIM_VIDEO_HIRE_MERC_MODE ) if( gubVideoConferencingPreviousMode == AIM_VIDEO_HIRE_MERC_MODE )
{ {
// Enable the current video conference buttons // Enable the current video conference buttons
EnableDisableCurrentVideoConferenceButtons(FALSE); EnableDisableCurrentVideoConferenceButtons(FALSE);
} }
fVideoConferenceCreated = FALSE; fVideoConferenceCreated = FALSE;
@@ -4139,22 +4085,6 @@ BOOLEAN InitDeleteVideoConferencePopUp( )
// InitVideoFaceTalking(gbCurrentSoldier, QUOTE_LENGTH_OF_CONTRACT); // InitVideoFaceTalking(gbCurrentSoldier, QUOTE_LENGTH_OF_CONTRACT);
DelayMercSpeech( gbCurrentSoldier, QUOTE_LENGTH_OF_CONTRACT, 750, TRUE, FALSE ); DelayMercSpeech( gbCurrentSoldier, QUOTE_LENGTH_OF_CONTRACT, 750, TRUE, FALSE );
#ifdef JA2UB
// Disable and hide contract length & gear purchase buttons
gfBuyEquipment = TRUE;
for (size_t i = 0; i < 3; i++)
{
DisableButton(giContractLengthButton[i]);
HideButton(giContractLengthButton[i]);
if (i < 2)
{
DisableButton(giBuyEquipmentButton[i]);
HideButton(giBuyEquipmentButton[i]);
}
}
#endif // JA2UB
} }
@@ -5367,17 +5297,11 @@ BOOLEAN DisplayShadedStretchedMercFace( UINT8 ubMercID, UINT16 usPosX, UINT16 us
void DemoHiringOfMercs( ) void DemoHiringOfMercs( )
{ {
INT16 i; INT16 i;
UINT8 MercID[5]; #ifdef GERMAN
MercID[0] = 7; UINT8 MercID[]={ 7, 10, 4, 14, 50 };
MercID[1] = 10; #else
MercID[2] = 4; UINT8 MercID[]={ 7, 10, 4, 42, 33 };
if( g_lang == i18n::Lang::de ) { #endif
MercID[3] = 14;
MercID[4] = 50;
} else {
MercID[3] = 42;
MercID[4] = 33;
}
MERC_HIRE_STRUCT HireMercStruct; MERC_HIRE_STRUCT HireMercStruct;
static BOOLEAN fHaveCalledBefore=FALSE; static BOOLEAN fHaveCalledBefore=FALSE;
@@ -5468,20 +5392,20 @@ void DisplayPopUpBoxExplainingMercArrivalLocationAndTime( )
//create the string to display to the user, looks like.... //create the string to display to the user, looks like....
// L"%s should arrive at the designated drop-off point ( sector %d:%d %s ) on day %d, at approximately %s.", //first %s is mercs name, next is the sector location and name where they will be arriving in, lastely is the day an the time of arrival // L"%s should arrive at the designated drop-off point ( sector %d:%d %s ) on day %d, at approximately %s.", //first %s is mercs name, next is the sector location and name where they will be arriving in, lastely is the day an the time of arrival
if( g_lang == i18n::Lang::de ) { #ifdef GERMAN
//Germans version has a different argument order //Germans version has a different argument order
swprintf( szLocAndTime, pMessageStrings[ MSG_JUST_HIRED_MERC_ARRIVAL_LOCATION_POPUP ], swprintf( szLocAndTime, pMessageStrings[ MSG_JUST_HIRED_MERC_ARRIVAL_LOCATION_POPUP ],
gMercProfiles[ pSoldier->ubProfile ].zNickname, gMercProfiles[ pSoldier->ubProfile ].zNickname,
LaptopSaveInfo.sLastHiredMerc.uiArrivalTime / 1440, LaptopSaveInfo.sLastHiredMerc.uiArrivalTime / 1440,
zTimeString, zTimeString,
zSectorIDString ); zSectorIDString );
} else { #else
swprintf( szLocAndTime, pMessageStrings[ MSG_JUST_HIRED_MERC_ARRIVAL_LOCATION_POPUP ], swprintf( szLocAndTime, pMessageStrings[ MSG_JUST_HIRED_MERC_ARRIVAL_LOCATION_POPUP ],
gMercProfiles[ pSoldier->ubProfile ].zNickname, gMercProfiles[ pSoldier->ubProfile ].zNickname,
zSectorIDString, zSectorIDString,
LaptopSaveInfo.sLastHiredMerc.uiArrivalTime / 1440, LaptopSaveInfo.sLastHiredMerc.uiArrivalTime / 1440,
zTimeString ); zTimeString );
} #endif
+1 -1
View File
@@ -627,7 +627,7 @@ TestTable::Display( )
{ {
MSYS_DefineRegion( &it->mMouseRegion[i - mFirstEntryShown], MSYS_DefineRegion( &it->mMouseRegion[i - mFirstEntryShown],
usPosX, usPosY, usPosX + it->GetRequiredLength(), usPosY + heightperrow, usPosX, usPosY, usPosX + it->GetRequiredLength(), usPosY + heightperrow,
MSYS_PRIORITY_HIGHEST-3, CURSOR_WWW, MSYS_PRIORITY_HIGHEST, CURSOR_WWW,
MSYS_NO_CALLBACK, ( *it ).RegionClickCallBack ); MSYS_NO_CALLBACK, ( *it ).RegionClickCallBack );
MSYS_AddRegion( &it->mMouseRegion[i - mFirstEntryShown] ); MSYS_AddRegion( &it->mMouseRegion[i - mFirstEntryShown] );
+20 -21
View File
@@ -20,7 +20,6 @@
// HEADROCK HAM 4 // HEADROCK HAM 4
#include "input.h" #include "input.h"
#include "Encyclopedia_new.h" //update encyclopedia item visibility when viewing that item #include "Encyclopedia_new.h" //update encyclopedia item visibility when viewing that item
#include <language.hpp>
#define BOBBYR_DEFAULT_MENU_COLOR 255 #define BOBBYR_DEFAULT_MENU_COLOR 255
@@ -116,7 +115,11 @@
#define BOBBYR_ITEM_QTY_NUM_X BOBBYR_GRIDLOC_X + 105//BOBBYR_ITEM_COST_TEXT_X + 1 #define BOBBYR_ITEM_QTY_NUM_X BOBBYR_GRIDLOC_X + 105//BOBBYR_ITEM_COST_TEXT_X + 1
#define BOBBYR_ITEM_QTY_NUM_Y BOBBYR_ITEM_QTY_TEXT_Y//BOBBYR_ITEM_COST_TEXT_Y + 40 #define BOBBYR_ITEM_QTY_NUM_Y BOBBYR_ITEM_QTY_TEXT_Y//BOBBYR_ITEM_COST_TEXT_Y + 40
#define BOBBYR_ITEMS_BOUGHT_X BOBBYR_GRIDLOC_X + 105 - BOBBYR_ORDER_NUM_WIDTH//BOBBYR_ITEM_QTY_NUM_X #ifdef CHINESE
#define BOBBYR_ITEMS_BOUGHT_X BOBBYR_GRIDLOC_X + 105 - BOBBYR_ORDER_NUM_WIDTH - 10 //BOBBYR_ITEM_QTY_NUM_X
#else
#define BOBBYR_ITEMS_BOUGHT_X BOBBYR_GRIDLOC_X + 105 - BOBBYR_ORDER_NUM_WIDTH//BOBBYR_ITEM_QTY_NUM_X
#endif
#define BOBBY_RAY_NOT_PURCHASED 255 #define BOBBY_RAY_NOT_PURCHASED 255
#define BOBBY_RAY_MAX_AMOUNT_OF_ITEMS_TO_PURCHASE 200 #define BOBBY_RAY_MAX_AMOUNT_OF_ITEMS_TO_PURCHASE 200
@@ -1762,11 +1765,11 @@ BOOLEAN DisplayItemInfo(UINT32 uiItemClass, INT32 iFilter, INT32 iSubFilter)
{ {
if ( iSubFilter > -1 ) // Madd: new BR filters if ( iSubFilter > -1 ) // Madd: new BR filters
{ {
if (ItemIsAttachment(usItemIndex) && Item[usItemIndex].attachmentclass & iSubFilter ) if (Item[usItemIndex].attachment && Item[usItemIndex].attachmentclass & iSubFilter )
bAddItem = TRUE; bAddItem = TRUE;
else if (iSubFilter == BR_MISC_FILTER_OTHER_ATTACHMENTS && !(Item[usItemIndex].attachmentclass & BR_MISC_FILTER_STD_ATTACHMENTS) && ItemIsAttachment(usItemIndex)) else if (iSubFilter == BR_MISC_FILTER_OTHER_ATTACHMENTS && !(Item[usItemIndex].attachmentclass & BR_MISC_FILTER_STD_ATTACHMENTS) && Item[usItemIndex].attachment)
bAddItem = TRUE; bAddItem = TRUE;
else if (iSubFilter == BR_MISC_FILTER_NO_ATTACHMENTS && !ItemIsAttachment(usItemIndex)) else if (iSubFilter == BR_MISC_FILTER_NO_ATTACHMENTS && !Item[usItemIndex].attachment)
bAddItem = TRUE; bAddItem = TRUE;
} }
else else
@@ -2503,11 +2506,7 @@ void DisplayItemNameAndInfo(UINT16 usPosY, UINT16 usIndex, UINT16 usBobbyIndex,
if( ubPurchaseNumber != BOBBY_RAY_NOT_PURCHASED) if( ubPurchaseNumber != BOBBY_RAY_NOT_PURCHASED)
{ {
swprintf(sTemp, L"% 4d", BobbyRayPurchases[ ubPurchaseNumber ].ubNumberPurchased); swprintf(sTemp, L"% 4d", BobbyRayPurchases[ ubPurchaseNumber ].ubNumberPurchased);
auto bobbyRItemsBoughtX{ BOBBYR_ITEMS_BOUGHT_X }; DrawTextToScreen(sTemp, BOBBYR_ITEMS_BOUGHT_X, (UINT16)usPosY, 0, FONT14ARIAL, BOBBYR_ITEM_DESC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
if (g_lang == i18n::Lang::zh) {
bobbyRItemsBoughtX -= 10;
}
DrawTextToScreen(sTemp, bobbyRItemsBoughtX, (UINT16)usPosY, 0, FONT14ARIAL, BOBBYR_ITEM_DESC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
} }
} }
@@ -2517,11 +2516,11 @@ void DisplayItemNameAndInfo(UINT16 usPosY, UINT16 usIndex, UINT16 usBobbyIndex,
//if it's a used item, display how damaged the item is //if it's a used item, display how damaged the item is
if( fUsed ) if( fUsed )
{ {
if ( g_lang == i18n::Lang::zh ) { #ifdef CHINESE
swprintf( sTemp, ChineseSpecString2, LaptopSaveInfo.BobbyRayUsedInventory[ usBobbyIndex ].ubItemQuality );//zww swprintf( sTemp, ChineseSpecString2, LaptopSaveInfo.BobbyRayUsedInventory[ usBobbyIndex ].ubItemQuality );//zww
} else { #else
swprintf( sTemp, L"*%3d%%%%", LaptopSaveInfo.BobbyRayUsedInventory[ usBobbyIndex ].ubItemQuality ); swprintf( sTemp, L"*%3d%%%%", LaptopSaveInfo.BobbyRayUsedInventory[ usBobbyIndex ].ubItemQuality );
} #endif
DrawTextToScreen(sTemp, (UINT16)(BOBBYR_ITEM_NAME_X-2), (UINT16)(usPosY - BOBBYR_ORDER_NUM_Y_OFFSET), BOBBYR_ORDER_NUM_WIDTH, BOBBYR_ITEM_NAME_TEXT_FONT, BOBBYR_ITEM_NAME_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED); DrawTextToScreen(sTemp, (UINT16)(BOBBYR_ITEM_NAME_X-2), (UINT16)(usPosY - BOBBYR_ORDER_NUM_Y_OFFSET), BOBBYR_ORDER_NUM_WIDTH, BOBBYR_ITEM_NAME_TEXT_FONT, BOBBYR_ITEM_NAME_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
} }
@@ -2654,11 +2653,11 @@ void SetFirstLastPagesForNew( UINT32 uiClassMask, INT32 iFilter, INT32 iSubFilte
{ {
if (iSubFilter > -1 ) if (iSubFilter > -1 )
{ {
if (ItemIsAttachment(usItemIndex) && Item[usItemIndex].attachmentclass & iSubFilter) if (Item[usItemIndex].attachment && Item[usItemIndex].attachmentclass & iSubFilter)
bCntNumItems = TRUE; bCntNumItems = TRUE;
else if (iSubFilter == BR_MISC_FILTER_OTHER_ATTACHMENTS && !(Item[usItemIndex].attachmentclass & BR_MISC_FILTER_STD_ATTACHMENTS) && ItemIsAttachment(usItemIndex)) else if (iSubFilter == BR_MISC_FILTER_OTHER_ATTACHMENTS && !(Item[usItemIndex].attachmentclass & BR_MISC_FILTER_STD_ATTACHMENTS) && Item[usItemIndex].attachment)
bCntNumItems = TRUE; bCntNumItems = TRUE;
else if (iSubFilter == BR_MISC_FILTER_NO_ATTACHMENTS && !ItemIsAttachment(usItemIndex)) else if (iSubFilter == BR_MISC_FILTER_NO_ATTACHMENTS && !Item[usItemIndex].attachment )
bCntNumItems = TRUE; bCntNumItems = TRUE;
} }
else else
@@ -3642,11 +3641,11 @@ void CalcFirstIndexForPage( STORE_INVENTORY *pInv, UINT32 uiItemClass )
{ {
if (guiCurrentMiscSubFilterMode > -1) // Madd: new BR filter options if (guiCurrentMiscSubFilterMode > -1) // Madd: new BR filter options
{ {
if (ItemIsAttachment(usItemIndex) && Item[usItemIndex].attachmentclass & guiCurrentMiscSubFilterMode) if (Item[usItemIndex].attachment && Item[usItemIndex].attachmentclass & guiCurrentMiscSubFilterMode)
bCntItem = TRUE; bCntItem = TRUE;
else if (guiCurrentMiscSubFilterMode == BR_MISC_FILTER_OTHER_ATTACHMENTS && !(Item[usItemIndex].attachmentclass & BR_MISC_FILTER_STD_ATTACHMENTS) && ItemIsAttachment(usItemIndex)) else if (guiCurrentMiscSubFilterMode == BR_MISC_FILTER_OTHER_ATTACHMENTS && !(Item[usItemIndex].attachmentclass & BR_MISC_FILTER_STD_ATTACHMENTS) && Item[usItemIndex].attachment)
bCntItem = TRUE; bCntItem = TRUE;
else if (guiCurrentMiscSubFilterMode == BR_MISC_FILTER_NO_ATTACHMENTS && !ItemIsAttachment(usItemIndex)) else if (guiCurrentMiscSubFilterMode == BR_MISC_FILTER_NO_ATTACHMENTS && !Item[usItemIndex].attachment)
bCntItem = TRUE; bCntItem = TRUE;
} }
else else
@@ -4182,7 +4181,7 @@ void GetHelpTextForItemInLaptop( STR16 pzStr, UINT16 usItemNumber )
for (it = range.first; it != range.second; it++) for (it = range.first; it != range.second; it++)
{ {
UINT16 attachmentId = it->second.attachmentIndex; UINT16 attachmentId = it->second.attachmentIndex;
if (!ItemIsHiddenAddon(attachmentId) && !ItemIsHiddenAttachment(attachmentId) && ItemIsLegal(attachmentId, TRUE)) if (!Item[attachmentId].hiddenaddon && !Item[attachmentId].hiddenattachment && ItemIsLegal(attachmentId, TRUE))
{ {
fAttachmentsFound = TRUE; fAttachmentsFound = TRUE;
if (DecorateAppendString(attachStr3, ATTACHMENTS_STRBUF_SIZE, Item[attachmentId].szItemName) == FALSE) if (DecorateAppendString(attachStr3, ATTACHMENTS_STRBUF_SIZE, Item[attachmentId].szItemName) == FALSE)
@@ -4195,7 +4194,7 @@ void GetHelpTextForItemInLaptop( STR16 pzStr, UINT16 usItemNumber )
for (UINT32 itemId = 1; itemId < gMAXITEMS_READ; itemId++) for (UINT32 itemId = 1; itemId < gMAXITEMS_READ; itemId++)
{ {
// If the attachment is not hidden and attachable to the gun (usItemNumber) // If the attachment is not hidden and attachable to the gun (usItemNumber)
if (!ItemIsHiddenAddon(itemId) && !ItemIsHiddenAttachment(itemId) && if (!Item[itemId].hiddenaddon && !Item[itemId].hiddenattachment &&
ItemIsLegal(itemId, TRUE) && IsAttachmentPointAvailable(Item[usItemNumber].uiIndex, itemId)) ItemIsLegal(itemId, TRUE) && IsAttachmentPointAvailable(Item[usItemNumber].uiIndex, itemId))
{ {
fAttachmentsFound = TRUE; fAttachmentsFound = TRUE;
+6 -7
View File
@@ -30,7 +30,6 @@
#include "GameSettings.h" #include "GameSettings.h"
#include <vfs/Core/vfs.h> #include <vfs/Core/vfs.h>
#include <vfs/Core/File/vfs_file.h> #include <vfs/Core/File/vfs_file.h>
#include <language.hpp>
/* /*
typedef struct typedef struct
@@ -489,11 +488,11 @@ BOOLEAN EnterBobbyRMailOrder()
SetButtonCursor(guiBobbyRClearOrder, CURSOR_LAPTOP_SCREEN); SetButtonCursor(guiBobbyRClearOrder, CURSOR_LAPTOP_SCREEN);
SpecifyDisabledButtonStyle( guiBobbyRClearOrder, DISABLED_STYLE_NONE ); SpecifyDisabledButtonStyle( guiBobbyRClearOrder, DISABLED_STYLE_NONE );
//inshy: fix position of text for buttons //inshy: fix position of text for buttons
if(g_lang == i18n::Lang::fr) { #ifdef FRENCH
SpecifyButtonTextOffsets( guiBobbyRClearOrder, 13, 10, TRUE ); SpecifyButtonTextOffsets( guiBobbyRClearOrder, 13, 10, TRUE );
} else { #else
SpecifyButtonTextOffsets( guiBobbyRClearOrder, 39, 10, TRUE ); SpecifyButtonTextOffsets( guiBobbyRClearOrder, 39, 10, TRUE );
} #endif
// Accept Order button // Accept Order button
guiBobbyRAcceptOrderImage = LoadButtonImage("LAPTOP\\AcceptOrderButton.sti", 2,0,-1,1,-1 ); guiBobbyRAcceptOrderImage = LoadButtonImage("LAPTOP\\AcceptOrderButton.sti", 2,0,-1,1,-1 );
@@ -505,11 +504,11 @@ if(g_lang == i18n::Lang::fr) {
DEFAULT_MOVE_CALLBACK, BtnBobbyRAcceptOrderCallback); DEFAULT_MOVE_CALLBACK, BtnBobbyRAcceptOrderCallback);
SetButtonCursor( guiBobbyRAcceptOrder, CURSOR_LAPTOP_SCREEN); SetButtonCursor( guiBobbyRAcceptOrder, CURSOR_LAPTOP_SCREEN);
//inshy: fix position of text for buttons //inshy: fix position of text for buttons
if(g_lang == i18n::Lang::fr) { #ifdef FRENCH
SpecifyButtonTextOffsets( guiBobbyRAcceptOrder, 15, 24, TRUE ); SpecifyButtonTextOffsets( guiBobbyRAcceptOrder, 15, 24, TRUE );
} else { #else
SpecifyButtonTextOffsets( guiBobbyRAcceptOrder, 43, 24, TRUE ); SpecifyButtonTextOffsets( guiBobbyRAcceptOrder, 43, 24, TRUE );
} #endif
SpecifyDisabledButtonStyle( guiBobbyRAcceptOrder, DISABLED_STYLE_SHADED ); SpecifyDisabledButtonStyle( guiBobbyRAcceptOrder, DISABLED_STYLE_SHADED );
if( gbSelectedCity == -1 ) if( gbSelectedCity == -1 )
+13 -9
View File
@@ -24,7 +24,6 @@
#include "text.h" #include "text.h"
#include "LaptopSave.h" #include "LaptopSave.h"
#include <language.hpp>
#define FULL_NAME_CURSOR_Y LAPTOP_SCREEN_WEB_UL_Y + 138 #define FULL_NAME_CURSOR_Y LAPTOP_SCREEN_WEB_UL_Y + 138
#define NICK_NAME_CURSOR_Y LAPTOP_SCREEN_WEB_UL_Y + 195 #define NICK_NAME_CURSOR_Y LAPTOP_SCREEN_WEB_UL_Y + 195
@@ -553,14 +552,14 @@ void HandleBeginScreenTextEvent( UINT32 uiKey )
//Heinz (18.01.2009): Russian layout //Heinz (18.01.2009): Russian layout
// ViSoR (07.01.2012) : Russian and Belarussian layouts // ViSoR (07.01.2012) : Russian and Belarussian layouts
// //
if(g_lang == i18n::Lang::ru) { #if defined(RUSSIAN) || defined(BELARUSSIAN)
// ViSoR (02.02.2013): Fix for Cyrillic layouts // ViSoR (02.02.2013): Fix for Cyrillic layouts
DWORD threadId = GetWindowThreadProcessId( ghWindow, 0 ); DWORD threadId = GetWindowThreadProcessId( ghWindow, 0 );
DWORD layout = (DWORD)GetKeyboardLayout( threadId ) & 0xFFFF; DWORD layout = (DWORD)GetKeyboardLayout( threadId ) & 0xFFFF;
if( layout == 0x419 ) // Russian if( layout == 0x419 ) // Russian
{ {
unsigned char TranslationTable[] = unsigned char TranslationTable[] =
" #Ý####ý####á-þ.0123456789ÆæÁ#Þ,#ÔÈÑÂÓÀÏÐØÎËÄÜÒÙÇÉÊÛÅÃÌÖ×Íßõ#ú#_¸ôèñâóàïðøîëäüòùçéêûåãìö÷íÿÕ#Ú¨ "; " #Ý####ý####á-þ.0123456789ÆæÁ#Þ,#ÔÈÑÂÓÀÏÐØÎËÄÜÒÙÇÉÊÛÅÃÌÖ×Íßõ#ú#_¸ôèñâóàïðøîëäüòùçéêûåãìö÷íÿÕ#Ú¨";
uiKey = TranslateKey( uiKey, TranslationTable ); uiKey = TranslateKey( uiKey, TranslationTable );
uiKey = GetCyrillicUnicodeChar( uiKey ); uiKey = GetCyrillicUnicodeChar( uiKey );
@@ -568,23 +567,28 @@ if(g_lang == i18n::Lang::ru) {
else if( layout == 0x423 ) // Belarussian else if( layout == 0x423 ) // Belarussian
{ {
unsigned char TranslationTable[] = unsigned char TranslationTable[] =
" #Ý####ý####á-þ.0123456789ÆæÁ#Þ,#Ô²ÑÂÓÀÏÐØÎËÄÜÒ¡ÇÉÊÛÅÃÌÖ×Íßõ#'#_¸ô³ñâóàïðøîëäüò¢çéêûåãìö÷íÿÕ#'¨ "; " #Ý####ý####á-þ.0123456789ÆæÁ#Þ,#Ô²ÑÂÓÀÏÐØÎËÄÜÒ¡ÇÉÊÛÅÃÌÖ×Íßõ#'#_¸ô³ñâóàïðøîëäüò¢çéêûåãìö÷íÿÕ#'¨";
uiKey = TranslateKey( uiKey, TranslationTable ); uiKey = TranslateKey( uiKey, TranslationTable );
uiKey = GetCyrillicUnicodeChar( uiKey ); uiKey = GetCyrillicUnicodeChar( uiKey );
} }
else if( !CheckIsKeyValid( uiKey ) ) else if( !CheckIsKeyValid( uiKey ) )
uiKey = '#'; uiKey = '#';
}
if( (g_lang != i18n::Lang::ru && if( uiKey != '#')
uiKey >= 'A' && uiKey <= 'Z' || #else
#ifndef USE_CODE_PAGE
if( uiKey >= 'A' && uiKey <= 'Z' ||
uiKey >= 'a' && uiKey <= 'z' || uiKey >= 'a' && uiKey <= 'z' ||
uiKey >= '0' && uiKey <= '9' || uiKey >= '0' && uiKey <= '9' ||
uiKey == '_' || uiKey == '.' || uiKey == '_' || uiKey == '.' ||
uiKey == ' ' || uiKey == '"' || uiKey == ' ' || uiKey == '"' ||
uiKey == 39 // This is ' which cannot be written explicitly here of course uiKey == 39 // This is ' which cannot be written explicitly here of course
) || )
uiKey != '#') #else
if( charSet::IsFromSet( uiKey, charSet::CS_SPACE|charSet::CS_ALPHA_NUM|charSet::CS_SPECIAL_ALPHA ) )
#endif
#endif
{ {
// if the current string position is at max or great, do nothing // if the current string position is at max or great, do nothing
switch( ubTextEnterMode ) switch( ubTextEnterMode )
+5 -5
View File
@@ -526,7 +526,7 @@ void DistributeInitialGear(MERCPROFILESTRUCT *pProfile)
if(iOrder[i]!=-1) if(iOrder[i]!=-1)
{ {
// skip if this item is an attachment // skip if this item is an attachment
if(ItemIsAttachment(tInv[iOrder[i]].inv)) if(Item[tInv[iOrder[i]].inv].attachment)
continue; continue;
iSet = FALSE; iSet = FALSE;
number = tInv[iOrder[i]].iNumber; number = tInv[iOrder[i]].iNumber;
@@ -1103,7 +1103,7 @@ INT32 SpecificFreePocket(MERCPROFILESTRUCT *pProfile, UINT16 usItem, UINT8 ubHow
return HELMETPOS; return HELMETPOS;
if ( pProfile->inv[VESTPOS] == NONE && Armour[Item[usItem].ubClassIndex].ubArmourClass == ARMOURCLASS_VEST ) if ( pProfile->inv[VESTPOS] == NONE && Armour[Item[usItem].ubClassIndex].ubArmourClass == ARMOURCLASS_VEST )
return VESTPOS; return VESTPOS;
if ( pProfile->inv[LEGPOS] == NONE && Armour[Item[usItem].ubClassIndex].ubArmourClass == ARMOURCLASS_LEGGINGS && !ItemIsAttachment(usItem) ) if ( pProfile->inv[LEGPOS] == NONE && Armour[Item[usItem].ubClassIndex].ubArmourClass == ARMOURCLASS_LEGGINGS && !(Item[usItem].attachment))
return LEGPOS; return LEGPOS;
break; break;
case IC_BLADE: case IC_BLADE:
@@ -1132,7 +1132,7 @@ INT32 SpecificFreePocket(MERCPROFILESTRUCT *pProfile, UINT16 usItem, UINT8 ubHow
case IC_GUN: case IC_GUN:
if ( pProfile->inv[HANDPOS] == NONE ) if ( pProfile->inv[HANDPOS] == NONE )
return HANDPOS; return HANDPOS;
if ( pProfile->inv[SECONDHANDPOS] == NONE && !(ItemIsTwoHanded(pProfile->inv[HANDPOS]))) if ( pProfile->inv[SECONDHANDPOS] == NONE && !(Item[pProfile->inv[HANDPOS]].twohanded))
return SECONDHANDPOS; return SECONDHANDPOS;
if((UsingNewInventorySystem() == true)) if((UsingNewInventorySystem() == true))
if ( pProfile->inv[GUNSLINGPOCKPOS] == NONE && pProfile->inv[BPACKPOCKPOS] == NONE && LBEPocketType[1].ItemCapacityPerSize[Item[usItem].ItemSize]!=0) if ( pProfile->inv[GUNSLINGPOCKPOS] == NONE && pProfile->inv[BPACKPOCKPOS] == NONE && LBEPocketType[1].ItemCapacityPerSize[Item[usItem].ItemSize]!=0)
@@ -1681,7 +1681,7 @@ void GiveIMPRandomItems( MERCPROFILESTRUCT *pProfile, UINT8 typeIndex )
// give ammo for guns // give ammo for guns
Assert( usItem < gMAXITEMS_READ ); Assert( usItem < gMAXITEMS_READ );
if ( Item[usItem].usItemClass == IC_GUN && !ItemIsRocketLauncher(usItem) ) if ( Item[usItem].usItemClass == IC_GUN && !Item[usItem].rocketlauncher )
{ {
usItem = DefaultMagazine(usItem); usItem = DefaultMagazine(usItem);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("GiveIMPRandomItems: give ammo typeIndex = %d, usItem = %d ",typeIndex, usItem )); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("GiveIMPRandomItems: give ammo typeIndex = %d, usItem = %d ",typeIndex, usItem ));
@@ -1726,7 +1726,7 @@ void GiveIMPItems( MERCPROFILESTRUCT *pProfile, INT8 abilityValue, UINT8 typeInd
MakeProfileInvItemAnySlot(pProfile,usItem,100,1); MakeProfileInvItemAnySlot(pProfile,usItem,100,1);
// give ammo for guns // give ammo for guns
if ( Item[usItem].usItemClass == IC_GUN && !ItemIsRocketLauncher(usItem) ) if ( Item[usItem].usItemClass == IC_GUN && !Item[usItem].rocketlauncher )
{ {
usItem = DefaultMagazine(usItem); usItem = DefaultMagazine(usItem);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("GiveIMPItems: give ammo typeIndex = %d, usItem = %d",typeIndex, usItem )); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("GiveIMPItems: give ammo typeIndex = %d, usItem = %d",typeIndex, usItem ));
+1 -1
View File
@@ -1285,7 +1285,7 @@ void DistributePossibleItemsToVectors(void)
{ {
gIMPPossibleItems[HANDPOS].push_back(std::make_pair(usItem, Item[usItem].szItemName)); gIMPPossibleItems[HANDPOS].push_back(std::make_pair(usItem, Item[usItem].szItemName));
if (ItemIsTwoHanded(usItem)) { if (Item[usItem].twohanded) {
gIMPPossibleItems[GUNSLINGPOCKPOS].push_back(std::make_pair(usItem, Item[usItem].szItemName)); gIMPPossibleItems[GUNSLINGPOCKPOS].push_back(std::make_pair(usItem, Item[usItem].szItemName));
} }
else { else {
+3 -4
View File
@@ -38,7 +38,6 @@
#include "GameSettings.h" #include "GameSettings.h"
#endif #endif
#include <language.hpp>
#define IMP_SEEK_AMOUNT 5 * 80 * 2 #define IMP_SEEK_AMOUNT 5 * 80 * 2
@@ -205,18 +204,18 @@ void PrintImpText( void )
LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 81, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_6, FONT14ARIAL, FONT_BLACK, FALSE, 0); LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 81, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_6, FONT14ARIAL, FONT_BLACK, FALSE, 0);
//inshy (18.01.2009): fix position for russian text //inshy (18.01.2009): fix position for russian text
if( g_lang == i18n::Lang::ru ) { #ifdef RUSSIAN
// male // male
LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 225, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_10, FONT14ARIAL, FONT_BLACK, FALSE, 0); LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 225, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_10, FONT14ARIAL, FONT_BLACK, FALSE, 0);
// female // female
LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 335, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_11, FONT14ARIAL, FONT_BLACK, FALSE, 0); LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 335, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_11, FONT14ARIAL, FONT_BLACK, FALSE, 0);
} else { #else
// male // male
LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 240, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_10, FONT14ARIAL, FONT_BLACK, FALSE, 0); LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 240, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_10, FONT14ARIAL, FONT_BLACK, FALSE, 0);
// female // female
LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 360, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_11, FONT14ARIAL, FONT_BLACK, FALSE, 0); LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 360, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_11, FONT14ARIAL, FONT_BLACK, FALSE, 0);
} #endif
break; break;
case ( IMP_PERSONALITY ): case ( IMP_PERSONALITY ):
-78
View File
@@ -670,13 +670,6 @@ void AddCustomEmail(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender,
// add message to list // add message to list
AddEmailMessage(iMessageOffset,iMessageLength, pSubject, iDate, ubSender, FALSE, 0, 0, iCurrentIMPPosition, iCurrentShipmentDestinationID, EmailType, TYPE_E_NONE ); AddEmailMessage(iMessageOffset,iMessageLength, pSubject, iDate, ubSender, FALSE, 0, 0, iCurrentIMPPosition, iCurrentShipmentDestinationID, EmailType, TYPE_E_NONE );
// if we are in fact int he laptop, redraw icons, might be change in mail status
if( fCurrentlyInLaptop )
{
// redraw icons, might be new mail
DrawLapTopIcons();
}
} }
//-- //--
@@ -721,14 +714,6 @@ void AddEmailWithSpecialData(INT32 iMessageOffset, INT32 iMessageLength, UINT8 u
// add message to list // add message to list
AddEmailMessage(iMessageOffset,iMessageLength, pSubject, iDate, ubSender, FALSE, iFirstData, uiSecondData, -1 , -1, EmailType, EmailAIM ); AddEmailMessage(iMessageOffset,iMessageLength, pSubject, iDate, ubSender, FALSE, iFirstData, uiSecondData, -1 , -1, EmailType, EmailAIM );
// if we are in fact int he laptop, redraw icons, might be change in mail status
if( fCurrentlyInLaptop == TRUE )
{
// redraw icons, might be new mail
DrawLapTopIcons();
}
return; return;
} }
@@ -761,14 +746,6 @@ void AddEmailWithSpecialDataXML(INT32 iMessageOffset, INT32 iMessageLength, UINT
// add message to list // add message to list
AddEmailMessage(iMessageOffset,iMessageLength, pSubject, iDate, ubSender, FALSE, iFirstData, uiSecondData, -1 , -1, EmailType, EmailAIM); AddEmailMessage(iMessageOffset,iMessageLength, pSubject, iDate, ubSender, FALSE, iFirstData, uiSecondData, -1 , -1, EmailType, EmailAIM);
// if we are in fact int he laptop, redraw icons, might be change in mail status
if( fCurrentlyInLaptop == TRUE )
{
// redraw icons, might be new mail
DrawLapTopIcons();
}
return; return;
} }
@@ -792,13 +769,6 @@ void AddPreReadEmailTypeXML( INT32 iMessageOffset, INT32 iMessageLength, UINT8 u
// add message to list // add message to list
AddEmailMessage( iMessageOffset,iMessageLength, pSubject, iDate, ubSender, TRUE, 0, 0, -1, -1 , EmailType, TYPE_E_NONE ); AddEmailMessage( iMessageOffset,iMessageLength, pSubject, iDate, ubSender, TRUE, 0, 0, -1, -1 , EmailType, TYPE_E_NONE );
// if we are in fact int he laptop, redraw icons, might be change in mail status
if( fCurrentlyInLaptop )
{
// redraw icons, might be new mail
DrawLapTopIcons();
}
} }
void AddEmailTypeXML( INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, INT32 iCurrentIMPPosition, UINT8 EmailType ) void AddEmailTypeXML( INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, INT32 iCurrentIMPPosition, UINT8 EmailType )
@@ -830,13 +800,6 @@ void AddEmailTypeXML( INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender
} }
AddEmailMessage(iMessageOffset,iMessageLength, pSubject, iDate, ubSender, FALSE, 0, 0, iCurrentIMPPosition, -1, EmailType, TYPE_E_NONE); AddEmailMessage(iMessageOffset,iMessageLength, pSubject, iDate, ubSender, FALSE, 0, 0, iCurrentIMPPosition, -1, EmailType, TYPE_E_NONE);
// if we are in fact int he laptop, redraw icons, might be change in mail status
if( fCurrentlyInLaptop )
{
// redraw icons, might be new mail
DrawLapTopIcons();
}
} }
#ifdef JA2UB #ifdef JA2UB
@@ -853,14 +816,6 @@ void AddBobbyREmailJA2(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSende
// add message to list // add message to list
AddEmailMessage(iMessageOffset,iMessageLength, pSubject, iDate, ubSender, FALSE, 0, 0, iCurrentIMPPosition, iCurrentShipmentDestinationID, EmailType, TYPE_EMAIL_BOBBY_R_L1); AddEmailMessage(iMessageOffset,iMessageLength, pSubject, iDate, ubSender, FALSE, 0, 0, iCurrentIMPPosition, iCurrentShipmentDestinationID, EmailType, TYPE_EMAIL_BOBBY_R_L1);
// if we are in fact int he laptop, redraw icons, might be change in mail status
if( fCurrentlyInLaptop == TRUE )
{
// redraw icons, might be new mail
DrawLapTopIcons();
}
return; return;
} }
#endif #endif
@@ -884,14 +839,6 @@ void AddEmailWFMercAvailable(INT32 iMessageOffset, INT32 iMessageLength, UINT8 u
AddEmailMessage(iMessageOffset,iMessageLength, pSubject, iDate, ubSender, FALSE, 0, 0, iCurrentIMPPosition, -1 , EmailType, TYPE_E_NONE); AddEmailMessage(iMessageOffset,iMessageLength, pSubject, iDate, ubSender, FALSE, 0, 0, iCurrentIMPPosition, -1 , EmailType, TYPE_E_NONE);
// if we are in fact int he laptop, redraw icons, might be change in mail status
if( fCurrentlyInLaptop == TRUE )
{
// redraw icons, might be new mail
DrawLapTopIcons();
}
return; return;
} }
@@ -931,14 +878,6 @@ void AddEmail(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32
// add message to list // add message to list
AddEmailMessage(iMessageOffset,iMessageLength, pSubject, iDate, ubSender, FALSE, 0, 0, iCurrentIMPPosition, iCurrentShipmentDestinationID, EmailType, TYPE_E_NONE); AddEmailMessage(iMessageOffset,iMessageLength, pSubject, iDate, ubSender, FALSE, 0, 0, iCurrentIMPPosition, iCurrentShipmentDestinationID, EmailType, TYPE_E_NONE);
// if we are in fact int he laptop, redraw icons, might be change in mail status
if( fCurrentlyInLaptop == TRUE )
{
// redraw icons, might be new mail
DrawLapTopIcons();
}
return; return;
} }
@@ -968,13 +907,6 @@ void AddPreReadEmail(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender,
// add message to list // add message to list
AddEmailMessage( iMessageOffset,iMessageLength, pSubject, iDate, ubSender, TRUE, 0, 0, -1, -1 , EmailType, TYPE_E_NONE ); AddEmailMessage( iMessageOffset,iMessageLength, pSubject, iDate, ubSender, TRUE, 0, 0, -1, -1 , EmailType, TYPE_E_NONE );
// if we are in fact int he laptop, redraw icons, might be change in mail status
if( fCurrentlyInLaptop == TRUE )
{
// redraw icons, might be new mail
DrawLapTopIcons();
}
return; return;
} }
@@ -1956,9 +1888,6 @@ void BtnMessageXCallback(GUI_BUTTON *btn,INT32 reason)
// reset page being displayed // reset page being displayed
giMessagePage = 0; giMessagePage = 0;
// redraw icons
DrawLapTopIcons();
// force update of entire screen // force update of entire screen
fPausedReDrawScreenFlag=TRUE; fPausedReDrawScreenFlag=TRUE;
@@ -2421,7 +2350,6 @@ BOOLEAN DisplayNewMailBox( void )
// printf warning string // printf warning string
mprintf(EMAIL_WARNING_X + 60, EMAIL_WARNING_Y + 63, pNewMailStrings[0] ); mprintf(EMAIL_WARNING_X + 60, EMAIL_WARNING_Y + 63, pNewMailStrings[0] );
DrawLapTopIcons( );
// invalidate region // invalidate region
InvalidateRegion( EMAIL_WARNING_X, EMAIL_WARNING_Y, EMAIL_WARNING_X + 270, EMAIL_WARNING_Y + 200 ); InvalidateRegion( EMAIL_WARNING_X, EMAIL_WARNING_Y, EMAIL_WARNING_X + 270, EMAIL_WARNING_Y + 200 );
@@ -2883,9 +2811,6 @@ void DeleteEmail()
// upadte list // upadte list
PlaceMessagesinPages(); PlaceMessagesinPages();
// redraw icons (if deleted message was last unread, remove checkmark)
DrawLapTopIcons();
// if all of a sudden we are beyond last page, move back one // if all of a sudden we are beyond last page, move back one
if(iCurrentPage > iLastPage) if(iCurrentPage > iLastPage)
iCurrentPage=iLastPage; iCurrentPage=iLastPage;
@@ -3037,9 +2962,6 @@ void ViewMessageRegionCallBack( MOUSE_REGION * pRegion, INT32 iReason )
// reset page being displayed // reset page being displayed
giMessagePage = 0; giMessagePage = 0;
// redraw icons
DrawLapTopIcons();
// force update of entire screen // force update of entire screen
fPausedReDrawScreenFlag=TRUE; fPausedReDrawScreenFlag=TRUE;
-7
View File
@@ -837,13 +837,6 @@ BOOLEAN InitLaptopAndLaptopScreens()
} }
UINT32
DrawLapTopIcons()
{
return (TRUE);
}
UINT32 UINT32
DrawLapTopText() DrawLapTopText()
{ {
-2
View File
@@ -15,7 +15,6 @@ void ExitLaptop();
void RenderLaptop(); void RenderLaptop();
UINT32 ExitLaptopMode(UINT32 uiMode); UINT32 ExitLaptopMode(UINT32 uiMode);
void EnterNewLaptopMode(); void EnterNewLaptopMode();
UINT32 DrawLapTopIcons();
UINT32 DrawLapTopText(); UINT32 DrawLapTopText();
void ReDrawHighLight(); void ReDrawHighLight();
void DrawButtonText(); void DrawButtonText();
@@ -26,7 +25,6 @@ BOOLEAN IsBookMarkSet( INT32 iBookId );
BOOLEAN LeaveLapTopScreen( ); BOOLEAN LeaveLapTopScreen( );
void SetLaptopExitScreen( UINT32 uiExitScreen ); void SetLaptopExitScreen( UINT32 uiExitScreen );
void SetLaptopNewGameFlag( ); void SetLaptopNewGameFlag( );
UINT32 DrawLapTopIcons( );
void LapTopScreenCallBack(MOUSE_REGION * pRegion, INT32 iReason ); void LapTopScreenCallBack(MOUSE_REGION * pRegion, INT32 iReason );
void HandleRightButtonUpEvent( void ); void HandleRightButtonUpEvent( void );
+40 -116
View File
@@ -418,34 +418,6 @@ BOOLEAN EnterMercsFiles()
return( TRUE ); return( TRUE );
} }
static void TryToHireMERC()
{
if ( (gMercProfiles[GetAvailableMercIDFromMERCArray( gubCurMercIndex )].ubMiscFlags & PROFILE_MISC_FLAG_ALREADY_USED_ITEMS) && !gGameExternalOptions.fGearKitsAlwaysAvailable )
{
//bought gear before
fMercBuyEquipment = 0;
MercProcessHireAfterGear();
}
else
{
#ifdef JA2UB
if ( gSelectedMercKit == 0 ) // First kit is free, due to M.E.R.C special offer
{
fMercBuyEquipment = 1;
MercProcessHireAfterGear();
}
else
{
//prompt to buy gear
DoLapTopMessageBox( MSG_BOX_BLUE_ON_GREY, MercInfo[MERC_FILES_BUY_GEAR], LAPTOP_SCREEN, MSG_BOX_FLAG_YESNO, MercHireButtonGearYesNoCallback );
}
#else
//prompt to buy gear
DoLapTopMessageBox( MSG_BOX_BLUE_ON_GREY, MercInfo[MERC_FILES_BUY_GEAR], LAPTOP_SCREEN, MSG_BOX_FLAG_YESNO, MercHireButtonGearYesNoCallback );
#endif // JA2UB
}
}
void SelectMercsFaceRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason ) void SelectMercsFaceRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason )
{ {
if (iReason & MSYS_CALLBACK_REASON_RBUTTON_UP) if (iReason & MSYS_CALLBACK_REASON_RBUTTON_UP)
@@ -470,7 +442,15 @@ void SelectMercsFaceRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason )
//else try to hire the merc //else try to hire the merc
else else
{ {
TryToHireMERC(); if ( (gMercProfiles[ GetAvailableMercIDFromMERCArray( gubCurMercIndex ) ].ubMiscFlags & PROFILE_MISC_FLAG_ALREADY_USED_ITEMS) && !gGameExternalOptions.fGearKitsAlwaysAvailable )
{
//bought gear before
fMercBuyEquipment = 0;
MercProcessHireAfterGear();
}
else
//prompt to buy gear
DoLapTopMessageBox( MSG_BOX_BLUE_ON_GREY, MercInfo[ MERC_FILES_BUY_GEAR ], LAPTOP_SCREEN, MSG_BOX_FLAG_YESNO, MercHireButtonGearYesNoCallback );
} }
} }
} }
@@ -721,7 +701,15 @@ void BtnMercHireButtonCallback(GUI_BUTTON *btn,INT32 reason)
//else try to hire the merc //else try to hire the merc
else else
{ {
TryToHireMERC(); if ( (gMercProfiles[ GetAvailableMercIDFromMERCArray( gubCurMercIndex ) ].ubMiscFlags & PROFILE_MISC_FLAG_ALREADY_USED_ITEMS) && !gGameExternalOptions.fGearKitsAlwaysAvailable )
{
//bought gear before
fMercBuyEquipment = 0;
MercProcessHireAfterGear();
}
else
//prompt to buy gear
DoLapTopMessageBox( MSG_BOX_BLUE_ON_GREY, MercInfo[ MERC_FILES_BUY_GEAR ], LAPTOP_SCREEN, MSG_BOX_FLAG_YESNO, MercHireButtonGearYesNoCallback );
} }
InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY); InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY);
@@ -1052,25 +1040,14 @@ void DisplayMercsStats( UINT8 ubMercID )
DrawNumeralsToScreen(gMercProfiles[ ubMercID ].bMedical, 3, MERC_STATS_SECOND_NUM_COL_X, usPosY, MERC_STATS_FONT, ubColor); DrawNumeralsToScreen(gMercProfiles[ ubMercID ].bMedical, 3, MERC_STATS_SECOND_NUM_COL_X, usPosY, MERC_STATS_FONT, ubColor);
usPosY += MERC_SPACE_BN_LINES; usPosY += MERC_SPACE_BN_LINES;
//Merc Salary //Daily Salary
#ifdef JA2UB DrawTextToScreen( MercInfo[MERC_FILES_SALARY], MERC_STATS_SECOND_COL_X, usPosY, 0, MERC_STATS_FONT, MERC_STATIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
// One time "Fee" instead of "Salary" per day
DrawTextToScreen( CharacterInfo[AIM_MEMBER_FEE], MERC_STATS_SECOND_COL_X, usPosY, 0, MERC_TITLE_FONT, MERC_TITLE_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
usPosX = MERC_STATS_SECOND_COL_X + StringPixLength( CharacterInfo[AIM_MEMBER_FEE], MERC_NAME_FONT ); usPosX = MERC_STATS_SECOND_COL_X + StringPixLength(MercInfo[MERC_FILES_SALARY], MERC_NAME_FONT);
swprintf( sString, L"%d", gMercProfiles[ubMercID].uiWeeklySalary ); swprintf(sString, L"%d", gMercProfiles[ ubMercID ].sSalary);
InsertCommasForDollarFigure( sString ); InsertCommasForDollarFigure( sString );
InsertDollarSignInToString( sString ); InsertDollarSignInToString( sString );
#else swprintf(sTemp, L" %s", MercInfo[MERC_FILES_PER_DAY]);
DrawTextToScreen( MercInfo[MERC_FILES_SALARY], MERC_STATS_SECOND_COL_X, usPosY, 0, MERC_STATS_FONT, MERC_STATIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
usPosX = MERC_STATS_SECOND_COL_X + StringPixLength( MercInfo[MERC_FILES_SALARY], MERC_NAME_FONT );
swprintf( sString, L"%d", gMercProfiles[ubMercID].sSalary );
InsertCommasForDollarFigure( sString );
InsertDollarSignInToString( sString );
swprintf( sTemp, L" %s", MercInfo[MERC_FILES_PER_DAY] );
#endif // JA2UB
wcscat( sString, sTemp ); wcscat( sString, sTemp );
DrawTextToScreen( sString, usPosX, usPosY, 95, MERC_NAME_FONT, MERC_DYNAMIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED); DrawTextToScreen( sString, usPosX, usPosY, 95, MERC_NAME_FONT, MERC_DYNAMIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
@@ -1082,27 +1059,14 @@ void DisplayMercsStats( UINT8 ubMercID )
if (gubCurMercFilesTogglePage == MERC_FILES_INV_PAGE) if (gubCurMercFilesTogglePage == MERC_FILES_INV_PAGE)
{ {
//Gear Cost //Gear Cost
usPosY = usPosY + 148; usPosY = usPosY + 145;
DrawTextToScreen( MercInfo[MERC_FILES_GEAR], MERC_STATS_SECOND_COL_X, usPosY, 0, MERC_STATS_FONT, MERC_STATIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED); DrawTextToScreen( MercInfo[MERC_FILES_GEAR], MERC_STATS_SECOND_COL_X, usPosY, 0, MERC_STATS_FONT, MERC_STATIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
if ( (gMercProfiles[ubMercID].ubMiscFlags & PROFILE_MISC_FLAG_ALREADY_USED_ITEMS) if ( (gMercProfiles[ ubMercID ].ubMiscFlags & PROFILE_MISC_FLAG_ALREADY_USED_ITEMS )
&& (!(gMercProfiles[ubMercID].ubMiscFlags2 & PROFILE_MISC_FLAG2_MERC_GEARKIT_UNPAID) || gGameExternalOptions.fGearKitsAlwaysAvailable) ) && ( !(gMercProfiles[ ubMercID ].ubMiscFlags2 & PROFILE_MISC_FLAG2_MERC_GEARKIT_UNPAID) || gGameExternalOptions.fGearKitsAlwaysAvailable ) )
{
gMercProfiles[ ubMercID ].usOptionalGearCost = 0; gMercProfiles[ ubMercID ].usOptionalGearCost = 0;
}
#ifdef JA2UB
if ( gSelectedMercKit == 0 ) // First kit is free, due to M.E.R.C special offer
{
gMercProfiles[ubMercID].usOptionalGearCost = 0;
// Special offer text above the gear cost swprintf(NsString, L"+ ");
const auto y = usPosY - MERC_SPACE_BN_LINES + 2;
swprintf( NsString, MercInfo[MERC_FILES_SPECIAL_OFFER] );
DrawTextToScreen( NsString, usPosX, y, 95, MERC_TITLE_FONT, MERC_TITLE_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
}
#endif // JA2UB
swprintf( NsString, L"+ " );
swprintf(sTemp, L"%d",gMercProfiles[ ubMercID ].usOptionalGearCost); swprintf(sTemp, L"%d",gMercProfiles[ ubMercID ].usOptionalGearCost);
InsertCommasForDollarFigure( sTemp ); InsertCommasForDollarFigure( sTemp );
InsertDollarSignInToString( sTemp ); InsertDollarSignInToString( sTemp );
@@ -1114,11 +1078,7 @@ void DisplayMercsStats( UINT8 ubMercID )
DrawTextToScreen( MercInfo[MERC_FILES_TOTAL], MERC_STATS_SECOND_COL_X, usPosY, 0, MERC_NAME_FONT, MERC_STATIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED); DrawTextToScreen( MercInfo[MERC_FILES_TOTAL], MERC_STATS_SECOND_COL_X, usPosY, 0, MERC_NAME_FONT, MERC_STATIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
swprintf(N2sString, L"= "); swprintf(N2sString, L"= ");
#ifdef JA2UB
swprintf( sTemp, L"%d", gMercProfiles[ubMercID].usOptionalGearCost + gMercProfiles[ubMercID].uiWeeklySalary );
#else
swprintf(sTemp, L"%d",gMercProfiles[ ubMercID ].usOptionalGearCost+gMercProfiles[ ubMercID ].sSalary); swprintf(sTemp, L"%d",gMercProfiles[ ubMercID ].usOptionalGearCost+gMercProfiles[ ubMercID ].sSalary);
#endif
InsertCommasForDollarFigure( sTemp ); InsertCommasForDollarFigure( sTemp );
InsertDollarSignInToString( sTemp ); InsertDollarSignInToString( sTemp );
wcscat( N2sString, sTemp ); wcscat( N2sString, sTemp );
@@ -1215,22 +1175,6 @@ BOOLEAN MercFilesHireMerc(UINT8 ubMercID)
return(FALSE);//not enough big ones $$$sATMText return(FALSE);//not enough big ones $$$sATMText
} }
#ifdef JA2UB
Namount = 0;
Namount += gMercProfiles[ubMercID].uiWeeklySalary;
if ( gSelectedMercKit > 0 )
{
Namount += gMercProfiles[ubMercID].usOptionalGearCost;
}
if ( Namount > LaptopSaveInfo.iCurrentBalance )
{
DoLapTopMessageBox( MSG_BOX_LAPTOP_DEFAULT, sATMText[4], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL );
return(FALSE);//not enough big ones $$$sATMText
}
#endif // JA2UB
bReturnCode = HireMerc( &HireMercStruct ); bReturnCode = HireMerc( &HireMercStruct );
//already have limit of mercs on the team //already have limit of mercs on the team
@@ -1252,25 +1196,16 @@ BOOLEAN MercFilesHireMerc(UINT8 ubMercID)
AddTransactionToPlayersBook( HIRED_MERC, ubMercID, GetWorldTotalMin(), Namount ); AddTransactionToPlayersBook( HIRED_MERC, ubMercID, GetWorldTotalMin(), Namount );
} }
#ifdef JA2UB #ifdef JA2UB
//add an entry in the finacial page for the hiring of the merc //add an entry in the finacial page for the hiring of the merc
INT32 totalCost = gMercProfiles[ubMercID].uiWeeklySalary; AddTransactionToPlayersBook(PAY_SPECK_FOR_MERC, ubMercID, GetWorldTotalMin(), -(INT32)( gMercProfiles[ubMercID].uiWeeklySalary ) );
if ( gSelectedMercKit > 0 ) // First kit is included in the initial fee #endif
{
totalCost += gMercProfiles[ubMercID].usOptionalGearCost;
}
AddTransactionToPlayersBook(PAY_SPECK_FOR_MERC, ubMercID, GetWorldTotalMin(), -totalCost );
#endif
//JMich_MMG: Setting the flag that we bought the gear and still haven't paid for it if we succesfully hired the merc //JMich_MMG: Setting the flag that we bought the gear and still haven't paid for it if we succesfully hired the merc
if ( fMercBuyEquipment ) if ( fMercBuyEquipment )
{ {
gMercProfiles[ ubMercID ].ubMiscFlags |= PROFILE_MISC_FLAG_ALREADY_USED_ITEMS; gMercProfiles[ ubMercID ].ubMiscFlags |= PROFILE_MISC_FLAG_ALREADY_USED_ITEMS;
#ifdef JA2UB
// Gear cost gets added to initial hiring fee in UB
#else
gMercProfiles[ ubMercID ].ubMiscFlags2 |= PROFILE_MISC_FLAG2_MERC_GEARKIT_UNPAID; gMercProfiles[ ubMercID ].ubMiscFlags2 |= PROFILE_MISC_FLAG2_MERC_GEARKIT_UNPAID;
#endif // JA2UB
} }
return(TRUE); return(TRUE);
@@ -1370,7 +1305,15 @@ void HandleMercsFilesKeyBoardInput( )
//else try to hire the merc //else try to hire the merc
else else
{ {
TryToHireMERC(); //bought gear before
if ( (gMercProfiles[ GetAvailableMercIDFromMERCArray( gubCurMercIndex ) ].ubMiscFlags & PROFILE_MISC_FLAG_ALREADY_USED_ITEMS) && !gGameExternalOptions.fGearKitsAlwaysAvailable )
{
fMercBuyEquipment = 0;
MercProcessHireAfterGear();
}
//prompt to buy gear
else
DoLapTopMessageBox( MSG_BOX_BLUE_ON_GREY, MercInfo[ MERC_FILES_BUY_GEAR ], LAPTOP_SCREEN, MSG_BOX_FLAG_YESNO, MercHireButtonGearYesNoCallback );
} }
} }
break; break;
@@ -1840,22 +1783,11 @@ void MercWeaponKitSelectionUpdate(UINT8 selectedInventory)
void MercHireButtonGearYesNoCallback (UINT8 bExitValue) void MercHireButtonGearYesNoCallback (UINT8 bExitValue)
{ {
//yes, buy gear //yes, buy gear
if ( bExitValue == MSG_BOX_RETURN_YES ) if( bExitValue == MSG_BOX_RETURN_YES )
{
fMercBuyEquipment = 1; fMercBuyEquipment = 1;
}
//no, no gear //no, no gear
else else
{
#ifdef JA2UB
// Switch to the free, first kit
gSelectedMercKit = 0;
MercWeaponKitSelectionUpdate( gSelectedMercKit );
fMercBuyEquipment = 1;
#else
fMercBuyEquipment = 0; fMercBuyEquipment = 0;
#endif // JA2UB
}
MercProcessHireAfterGear(); MercProcessHireAfterGear();
} }
@@ -1878,10 +1810,6 @@ void MercProcessHireAfterGear()
void NextMercMember() void NextMercMember()
{ {
// Reset selected kit, cannot assume next merc has more than 1 kit
gSelectedMercKit = 0;
MercWeaponKitSelectionUpdate( gSelectedMercKit );
if (gfKeyState [ CTRL ]) if (gfKeyState [ CTRL ])
gubCurMercIndex = LaptopSaveInfo.gubLastMercIndex; gubCurMercIndex = LaptopSaveInfo.gubLastMercIndex;
else if (gfKeyState [ SHIFT ]) else if (gfKeyState [ SHIFT ])
@@ -1912,10 +1840,6 @@ void NextMercMember()
void PrevMercMember() void PrevMercMember()
{ {
// Reset selected kit, cannot assume next merc has more than 1 kit
gSelectedMercKit = 0;
MercWeaponKitSelectionUpdate( gSelectedMercKit );
if (gfKeyState [ CTRL ]) if (gfKeyState [ CTRL ])
gubCurMercIndex = 0; gubCurMercIndex = 0;
else if (gfKeyState [ SHIFT ]) else if (gfKeyState [ SHIFT ])
+1 -1
View File
@@ -15,7 +15,7 @@
#include "../../TileEngine/Isometric Utils.h" // defines NOWHERE #include "../../TileEngine/Isometric Utils.h" // defines NOWHERE
#include "../../Utils/Debug Control.h" // LiveMessage #include "../../Utils/Debug Control.h" // LiveMessage
#include "../../Utils/Font Control.h" // ScreenMsg about deadlock #include "../../Utils/Font Control.h" // ScreenMsg about deadlock
#include <Text.h> // Sniper warning #include "../../Utils/Text.h" // Sniper warning
#include "../../Utils/message.h" // ditto #include "../../Utils/message.h" // ditto
+2 -2
View File
@@ -1198,7 +1198,7 @@ void EnemyHeliMANPADSCheck( INT16 id )
if ( pObj ) if ( pObj )
{ {
// abort if this is a launcher without ammo // abort if this is a launcher without ammo
if (ItemIsRocketLauncher(pObj->usItem) && !ItemIsSingleShotRocketLauncher(pObj->usItem)) if ( Item[pObj->usItem].rocketlauncher && !Item[pObj->usItem].singleshotrocketlauncher )
{ {
OBJECTTYPE* pAttachment = FindAttachmentByClass( pObj, IC_GRENADE ); OBJECTTYPE* pAttachment = FindAttachmentByClass( pObj, IC_GRENADE );
if ( !pAttachment->exists( ) ) if ( !pAttachment->exists( ) )
@@ -1227,7 +1227,7 @@ void EnemyHeliMANPADSCheck( INT16 id )
MapScreenMessage( FONT_MCOLOR_LTRED, MSG_INTERFACE, szEnemyHeliText[7], pSoldier->GetName( ), Item[pObj->usItem].szItemName, pStrSectorName ); MapScreenMessage( FONT_MCOLOR_LTRED, MSG_INTERFACE, szEnemyHeliText[7], pSoldier->GetName( ), Item[pObj->usItem].szItemName, pStrSectorName );
// 'fire' (remove shot) // 'fire' (remove shot)
if (ItemIsSingleShotRocketLauncher(pObj->usItem)) if ( Item[pObj->usItem].singleshotrocketlauncher )
{ {
CreateItem( Item[pObj->usItem].discardedlauncheritem, (*pObj)[0]->data.objectStatus, pObj ); CreateItem( Item[pObj->usItem].discardedlauncheritem, (*pObj)[0]->data.objectStatus, pObj );
+12 -12
View File
@@ -1562,7 +1562,7 @@ BOOLEAN CanCharacterPatient( SOLDIERTYPE *pSoldier )
return ( TRUE ); return ( TRUE );
// Flugente: stats can also be damaged // Flugente: stats can also be damaged
if ( !UsingFoodSystem() || ( pSoldier->bFoodLevel >= FoodMoraleMods[FOOD_NORMAL].bThreshold && pSoldier->bDrinkLevel >= FoodMoraleMods[FOOD_NORMAL].bThreshold ) ) if ( !UsingFoodSystem() || ( pSoldier->bFoodLevel > FoodMoraleMods[FOOD_NORMAL].bThreshold && pSoldier->bDrinkLevel > FoodMoraleMods[FOOD_NORMAL].bThreshold ) )
{ {
if ( pSoldier->usStarveDamageHealth > 0 || pSoldier->usStarveDamageStrength > 0 ) if ( pSoldier->usStarveDamageHealth > 0 || pSoldier->usStarveDamageStrength > 0 )
return ( TRUE ); return ( TRUE );
@@ -3349,7 +3349,7 @@ UINT8 CalculateRepairPointsForRepairman(SOLDIERTYPE *pSoldier, UINT16 *pusMaxPts
} }
// can't repair at all without a toolkit // can't repair at all without a toolkit
if (!ItemIsToolkit(pSoldier->inv[HANDPOS].usItem)) if (!Item[pSoldier->inv[HANDPOS].usItem].toolkit )
{ {
*pusMaxPts = 0; *pusMaxPts = 0;
return(0); return(0);
@@ -4063,7 +4063,7 @@ UINT16 ToolKitPoints(SOLDIERTYPE *pSoldier)
// CHRISL: Changed to dynamically determine max inventory locations. // CHRISL: Changed to dynamically determine max inventory locations.
for (int ubPocket=HANDPOS; ubPocket < NUM_INV_SLOTS; ++ubPocket) for (int ubPocket=HANDPOS; ubPocket < NUM_INV_SLOTS; ++ubPocket)
{ {
if(ItemIsToolkit(pSoldier->inv[ ubPocket ].usItem)) if( Item[pSoldier->inv[ ubPocket ].usItem].toolkit )
{ {
usKitpts += TotalPoints( &( pSoldier->inv[ ubPocket ] ) ); usKitpts += TotalPoints( &( pSoldier->inv[ ubPocket ] ) );
} }
@@ -5138,7 +5138,7 @@ void DoActualRepair( SOLDIERTYPE * pSoldier, UINT16 usItem, INT16 * pbStatus, IN
// repairs on electronic items take twice as long if the guy doesn't have the skill // repairs on electronic items take twice as long if the guy doesn't have the skill
// Technician/Electronic traits - repairing electronic items - SANDRO // Technician/Electronic traits - repairing electronic items - SANDRO
if (ItemIsElectronic(usItem)) if ( Item[ usItem ].electronic )
{ {
if (gGameOptions.fNewTraitSystem) if (gGameOptions.fNewTraitSystem)
{ {
@@ -5745,7 +5745,7 @@ void HandleRepairBySoldier( SOLDIERTYPE *pSoldier )
BOOLEAN IsItemRepairable(SOLDIERTYPE* pSoldier, UINT16 usItem, INT16 bStatus, INT16 bThreshold ) BOOLEAN IsItemRepairable(SOLDIERTYPE* pSoldier, UINT16 usItem, INT16 bStatus, INT16 bThreshold )
{ {
// check to see if item can/needs to be repaired // check to see if item can/needs to be repaired
if ( ( bStatus < 100) && ItemIsRepairable(usItem) ) if ( ( bStatus < 100) && ( Item[ usItem ].repairable ) )
{ {
if ( gGameExternalOptions.fAdvRepairSystem ) if ( gGameExternalOptions.fAdvRepairSystem )
{ {
@@ -10459,7 +10459,7 @@ BOOLEAN MakeSureToolKitIsInHand( SOLDIERTYPE *pSoldier )
INT8 bPocket = 0, bonus = -101, bToolkitPocket = NO_SLOT; INT8 bPocket = 0, bonus = -101, bToolkitPocket = NO_SLOT;
// if there isn't a toolkit in his hand // if there isn't a toolkit in his hand
if(ItemIsToolkit(pSoldier->inv[ HANDPOS].usItem)) if( Item[pSoldier->inv[ HANDPOS].usItem].toolkit )
{ {
bonus = Item[pSoldier->inv[ HANDPOS].usItem].RepairModifier; bonus = Item[pSoldier->inv[ HANDPOS].usItem].RepairModifier;
bToolkitPocket = HANDPOS; bToolkitPocket = HANDPOS;
@@ -10469,7 +10469,7 @@ BOOLEAN MakeSureToolKitIsInHand( SOLDIERTYPE *pSoldier )
// CHRISL: Changed to dynamically determine max inventory locations. // CHRISL: Changed to dynamically determine max inventory locations.
for (bPocket = SECONDHANDPOS; bPocket < NUM_INV_SLOTS; ++bPocket) for (bPocket = SECONDHANDPOS; bPocket < NUM_INV_SLOTS; ++bPocket)
{ {
if(ItemIsToolkit(pSoldier->inv[ bPocket ].usItem) && Item[pSoldier->inv[ bPocket ].usItem].RepairModifier > bonus) if( Item[pSoldier->inv[ bPocket ].usItem].toolkit && Item[pSoldier->inv[ bPocket ].usItem].RepairModifier > bonus)
{ {
bonus = Item[pSoldier->inv[ bPocket ].usItem].RepairModifier; bonus = Item[pSoldier->inv[ bPocket ].usItem].RepairModifier;
bToolkitPocket = bPocket; bToolkitPocket = bPocket;
@@ -10503,7 +10503,7 @@ BOOLEAN MakeSureMedKitIsInHand( SOLDIERTYPE *pSoldier , bool bAllow1stAidKit)
fTeamPanelDirty = TRUE; fTeamPanelDirty = TRUE;
// if there is a MEDICAL BAG in his hand, we're set // if there is a MEDICAL BAG in his hand, we're set
if (ItemIsMedicalKit(pSoldier->inv[ HANDPOS ].usItem)) if ( Item[pSoldier->inv[ HANDPOS ].usItem].medicalkit )
{ {
return(TRUE); return(TRUE);
} }
@@ -10511,7 +10511,7 @@ BOOLEAN MakeSureMedKitIsInHand( SOLDIERTYPE *pSoldier , bool bAllow1stAidKit)
// run through rest of inventory looking 1st for MEDICAL BAGS, swap the first one into hand if found // run through rest of inventory looking 1st for MEDICAL BAGS, swap the first one into hand if found
for (bPocket = SECONDHANDPOS; bPocket < NUM_INV_SLOTS; ++bPocket) for (bPocket = SECONDHANDPOS; bPocket < NUM_INV_SLOTS; ++bPocket)
{ {
if (ItemIsMedicalKit(pSoldier->inv[ bPocket ].usItem)) if ( Item[pSoldier->inv[ bPocket ].usItem].medicalkit )
{ {
medkit_found = true; medkit_found = true;
can_swap = true; can_swap = true;
@@ -10579,7 +10579,7 @@ BOOLEAN MakeSureMedKitIsInHand( SOLDIERTYPE *pSoldier , bool bAllow1stAidKit)
return FALSE; return FALSE;
// we didn't find a medical bag, so settle for a FIRST AID KIT // we didn't find a medical bag, so settle for a FIRST AID KIT
if (ItemIsFirstAidKit(pSoldier->inv[ HANDPOS ].usItem)) if ( Item[pSoldier->inv[ HANDPOS ].usItem].firstaidkit )
{ {
return(TRUE); return(TRUE);
} }
@@ -10588,10 +10588,10 @@ BOOLEAN MakeSureMedKitIsInHand( SOLDIERTYPE *pSoldier , bool bAllow1stAidKit)
// CHRISL: Changed to dynamically determine max inventory locations. // CHRISL: Changed to dynamically determine max inventory locations.
for (bPocket = SECONDHANDPOS; bPocket < NUM_INV_SLOTS; ++bPocket) for (bPocket = SECONDHANDPOS; bPocket < NUM_INV_SLOTS; ++bPocket)
{ {
if (ItemIsFirstAidKit(pSoldier->inv[ bPocket ].usItem)) if ( Item[pSoldier->inv[ bPocket ].usItem].firstaidkit )
{ {
// CHRISL: This needs to start with the first "non-big" pocket. // CHRISL: This needs to start with the first "non-big" pocket.
if( (ItemIsTwoHanded(pSoldier->inv[HANDPOS].usItem) && (bPocket >= SMALLPOCKSTART))) if( ( Item[ pSoldier -> inv[ HANDPOS ].usItem ].twohanded ) && ( bPocket >= SMALLPOCKSTART ) )
{ {
// first move from hand to second hand // first move from hand to second hand
SwapObjs( pSoldier, HANDPOS, SECONDHANDPOS, TRUE ); SwapObjs( pSoldier, HANDPOS, SECONDHANDPOS, TRUE );
+2 -2
View File
@@ -4257,7 +4257,7 @@ BOOLEAN FireTankCannon( SOLDIERCELL *pAttacker )
{ {
pItem = &pSoldier->inv[i]; pItem = &pSoldier->inv[i];
if (ItemIsCannon(pItem->usItem)) if ( Item[pItem->usItem].cannon )
{ {
PlayAutoResolveSample( Weapon[pItem->usItem].sSound, RATE_11025, 50, 1, MIDDLEPAN ); PlayAutoResolveSample( Weapon[pItem->usItem].sSound, RATE_11025, 50, 1, MIDDLEPAN );
@@ -4291,7 +4291,7 @@ BOOLEAN FireAntiTankWeapon( SOLDIERCELL *pAttacker )
{ {
pItem = &pSoldier->inv[i]; pItem = &pSoldier->inv[i];
if ( Item[pItem->usItem].usItemClass == IC_LAUNCHER || ItemIsCannon(pItem->usItem)) if ( Item[pItem->usItem].usItemClass == IC_LAUNCHER || Item[pItem->usItem].cannon )
{ {
pAttacker->bWeaponSlot = (INT8)i; pAttacker->bWeaponSlot = (INT8)i;
if ( gpAR->fUnlimitedAmmo ) if ( gpAR->fUnlimitedAmmo )
+1 -1
View File
@@ -627,7 +627,7 @@ void HourlySmokerUpdate( )
INT8 invsize = (INT8)pSoldier->inv.size( ); // remember inventorysize, so we don't call size() repeatedly INT8 invsize = (INT8)pSoldier->inv.size( ); // remember inventorysize, so we don't call size() repeatedly
for ( INT8 bLoop = 0; bLoop < invsize; ++bLoop ) // ... for all items in our inventory ... for ( INT8 bLoop = 0; bLoop < invsize; ++bLoop ) // ... for all items in our inventory ...
{ {
if ( pSoldier->inv[bLoop].exists( ) && ItemIsCigarette(pSoldier->inv[bLoop].usItem) ) if ( pSoldier->inv[bLoop].exists( ) && Item[pSoldier->inv[bLoop].usItem].cigarette )
{ {
pObj = &(pSoldier->inv[bLoop]); pObj = &(pSoldier->inv[bLoop]);
+20 -2
View File
@@ -96,7 +96,6 @@ extern "C" {
#include "Merc Contract.h" #include "Merc Contract.h"
#include "message.h" #include "message.h"
#include "Town Militia.h" #include "Town Militia.h"
#include <language.hpp>
extern UINT8 gubWaitingForAllMercsToExitCode; extern UINT8 gubWaitingForAllMercsToExitCode;
@@ -13209,7 +13208,26 @@ static int l_GetUsedLanguage( lua_State *L )
{ {
if ( lua_gettop( L ) ) if ( lua_gettop( L ) )
{ {
INT32 val = static_cast<INT32>(g_lang); INT32 val = 0;
#if defined(ENGLISH)
val = 0;
#elif defined(GERMAN)
val = 1;
#elif defined(RUSSIAN)
val = 2;
#elif defined(DUTCH)
val = 3;
#elif defined(POLISH)
val = 4;
#elif defined(FRENCH)
val = 5;
#elif defined(ITALIAN)
val = 6;
#elif defined(CHINESE)
val = 7;
#endif
lua_pushinteger( L, val ); lua_pushinteger( L, val );
} }
+2 -1
View File
@@ -1278,7 +1278,8 @@ void LandHelicopter( void )
else else
{ {
#ifdef JA2UB #ifdef JA2UB
//No meanwhiles in UB Assert( 0 );
//No meanwhiles
#else #else
// play meanwhile scene if it hasn't been used yet // play meanwhile scene if it hasn't been used yet
HandleKillChopperMeanwhileScene(); HandleKillChopperMeanwhileScene();
+1 -1
View File
@@ -50,11 +50,11 @@
#include "Ja25 Strategic Ai.h" #include "Ja25 Strategic Ai.h"
#include "MapScreen Quotes.h" #include "MapScreen Quotes.h"
#include "SaveLoadGame.h" #include "SaveLoadGame.h"
#include "strategicmap.h"
#endif #endif
#include "connect.h" #include "connect.h"
#include <language.hpp>
struct UILayout_BottomButtons struct UILayout_BottomButtons
{ {
+6
View File
@@ -4,6 +4,12 @@
#include "types.h" #include "types.h"
#include "Soldier Control.h" #include "Soldier Control.h"
#ifdef CHINESE //zwwoooooo: Chinese fonts relatively high , so to reduce the number of rows
#define MAX_MESSAGES_ON_MAP_BOTTOM 6
#else
#define MAX_MESSAGES_ON_MAP_BOTTOM 9
#endif
#ifdef JA2UB #ifdef JA2UB
extern INT8 gbExitingMapScreenToWhere; extern INT8 gbExitingMapScreenToWhere;
#endif #endif
@@ -1481,7 +1481,7 @@ void MapInvenPoolSlots(MOUSE_REGION * pRegion, INT32 iReason )
} }
else else
{ {
if ( _KeyDown(SHIFT) && gpItemPointer == NULL && Item[twItem->object.usItem].usItemClass == IC_GUN && (twItem->object)[0]->data.gun.ubGunShotsLeft && !ItemIsSingleShotRocketLauncher(twItem->object.usItem)) if ( _KeyDown(SHIFT) && gpItemPointer == NULL && Item[twItem->object.usItem].usItemClass == IC_GUN && (twItem->object)[0]->data.gun.ubGunShotsLeft && !(Item[twItem->object.usItem].singleshotrocketlauncher))
{ {
EmptyWeaponMagazine( &twItem->object, &gItemPointer ); EmptyWeaponMagazine( &twItem->object, &gItemPointer );
InternalMAPBeginItemPointer( MercPtrs[gCharactersList[bSelectedInfoChar].usSolID] ); InternalMAPBeginItemPointer( MercPtrs[gCharactersList[bSelectedInfoChar].usSolID] );
@@ -6009,7 +6009,7 @@ void HandleItemCooldownFunctions( OBJECTTYPE* itemStack, INT32 deltaSeconds, BOO
//original code by flugente, renamed variables to fit here, removed "min (OVERHEATING_MAX_TEMPERATURE, newValue)" for dirt to allow to go beyond maximum and deduct later the same amount if neccessary. //original code by flugente, renamed variables to fit here, removed "min (OVERHEATING_MAX_TEMPERATURE, newValue)" for dirt to allow to go beyond maximum and deduct later the same amount if neccessary.
// ... if we use overheating and item is a gun, a launcher or a barrel ... // ... if we use overheating and item is a gun, a launcher or a barrel ...
if ( gGameExternalOptions.fWeaponOverheating && ( Item[itemStack->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) || ItemIsBarrel(itemStack->usItem) ) ) if ( gGameExternalOptions.fWeaponOverheating && ( Item[itemStack->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) || Item[itemStack->usItem].barrel == TRUE ) )
{ {
for(INT16 i = 0; i < itemStack->ubNumberOfObjects; ++i) // ... there might be multiple items here (item stack), so for each one ... for(INT16 i = 0; i < itemStack->ubNumberOfObjects; ++i) // ... there might be multiple items here (item stack), so for each one ...
{ {
@@ -6017,7 +6017,7 @@ void HandleItemCooldownFunctions( OBJECTTYPE* itemStack, INT32 deltaSeconds, BOO
FLOAT cooldownfactor = GetItemCooldownFactor(itemStack); // ... get item cooldown factor provided of attachments ... FLOAT cooldownfactor = GetItemCooldownFactor(itemStack); // ... get item cooldown factor provided of attachments ...
if (ItemIsBarrel(itemStack->usItem)) // ... a barrel lying around cools down a bit faster ... if ( Item[itemStack->usItem].barrel == TRUE ) // ... a barrel lying around cools down a bit faster ...
cooldownfactor *= gGameExternalOptions.iCooldownModificatorLonelyBarrel; cooldownfactor *= gGameExternalOptions.iCooldownModificatorLonelyBarrel;
FLOAT newguntemperature = max(0.0f, guntemperature - tickspassed * cooldownfactor ); // ... calculate new temperature ... FLOAT newguntemperature = max(0.0f, guntemperature - tickspassed * cooldownfactor ); // ... calculate new temperature ...
+10 -11
View File
@@ -56,7 +56,6 @@
#include "MilitiaSquads.h" #include "MilitiaSquads.h"
#include "LaptopSave.h" #include "LaptopSave.h"
#include <language.hpp>
// added by Flugente // added by Flugente
extern CHAR16 gzSectorNames[256][4][MAX_SECTOR_NAME_LENGTH]; extern CHAR16 gzSectorNames[256][4][MAX_SECTOR_NAME_LENGTH];
@@ -1200,11 +1199,11 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Map Screen1");
// don't show loyalty string until loyalty tracking for that town has been started // don't show loyalty string until loyalty tracking for that town has been started
if( gTownLoyalty[ bTown ].fStarted && gfTownUsesLoyalty[ bTown ]) if( gTownLoyalty[ bTown ].fStarted && gfTownUsesLoyalty[ bTown ])
{ {
if ( g_lang == i18n::Lang::zh ) { #ifdef CHINESE
swprintf( sStringA, L"%d%£¥%% %s", gTownLoyalty[ bTown ].ubRating, gsLoyalString[ 0 ]); swprintf( sStringA, L"%d%£¥%% %s", gTownLoyalty[ bTown ].ubRating, gsLoyalString[ 0 ]);
} else { #else
swprintf( sStringA, L"%d%%%% %s", gTownLoyalty[ bTown ].ubRating, gsLoyalString[ 0 ]); swprintf( sStringA, L"%d%%%% %s", gTownLoyalty[ bTown ].ubRating, gsLoyalString[ 0 ]);
} #endif
// if loyalty is too low to train militia, and militia training is allowed here // if loyalty is too low to train militia, and militia training is allowed here
if ( ( gTownLoyalty[ bTown ].ubRating < iMinLoyaltyToTrain ) && MilitiaTrainingAllowedInTown( bTown ) ) if ( ( gTownLoyalty[ bTown ].ubRating < iMinLoyaltyToTrain ) && MilitiaTrainingAllowedInTown( bTown ) )
@@ -4874,11 +4873,11 @@ void BlitMineText( INT16 sMapX, INT16 sMapY )
// if potential is not nil, show percentage of the two // if potential is not nil, show percentage of the two
if (GetMaxPeriodicRemovalFromMine(ubMineIndex) > 0) if (GetMaxPeriodicRemovalFromMine(ubMineIndex) > 0)
{ {
if ( g_lang == i18n::Lang::zh ) { #ifdef CHINESE
swprintf( wSubString, L" (%d%£¥%%)", (PredictDailyIncomeFromAMine(ubMineIndex, TRUE) * 100 ) / GetMaxDailyRemovalFromMine(ubMineIndex) ); swprintf( wSubString, L" (%d%£¥%%)", (PredictDailyIncomeFromAMine(ubMineIndex, TRUE) * 100 ) / GetMaxDailyRemovalFromMine(ubMineIndex) );
} else { #else
swprintf( wSubString, L" (%d%%%%)", (PredictDailyIncomeFromAMine(ubMineIndex, TRUE) * 100 ) / GetMaxDailyRemovalFromMine(ubMineIndex) ); swprintf( wSubString, L" (%d%%%%)", (PredictDailyIncomeFromAMine(ubMineIndex, TRUE) * 100 ) / GetMaxDailyRemovalFromMine(ubMineIndex) );
} #endif
wcscat( wString, wSubString ); wcscat( wString, wSubString );
} }
@@ -5283,12 +5282,12 @@ BOOLEAN LoadMilitiaPopUpBox( void )
// load the militia pop up box // load the militia pop up box
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE; VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
if ( isWidescreenUI() || iResolution >= _1024x768) if (iResolution >= _640x480 && iResolution < _800x600)
FilenameForBPP("INTERFACE\\Militia_1024x768.sti", VObjectDesc.ImageFile); FilenameForBPP("INTERFACE\\Militia.sti", VObjectDesc.ImageFile);
else if (iResolution >= _800x600) else if (iResolution < _1024x768)
FilenameForBPP("INTERFACE\\Militia_800x600.sti", VObjectDesc.ImageFile); FilenameForBPP("INTERFACE\\Militia_800x600.sti", VObjectDesc.ImageFile);
else else
FilenameForBPP("INTERFACE\\Militia.sti", VObjectDesc.ImageFile); FilenameForBPP("INTERFACE\\Militia_1024x768.sti", VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiMilitia)); CHECKF(AddVideoObject(&VObjectDesc, &guiMilitia));
+1 -1
View File
@@ -864,7 +864,7 @@ void EndMeanwhile( )
{ {
// We leave this sector open for our POWs to escape! // We leave this sector open for our POWs to escape!
// Set music mode to enemy present! // Set music mode to enemy present!
CheckForZombieMusic(); UseCreatureMusic(HostileZombiesPresent());
SetMusicMode( MUSIC_TACTICAL_ENEMYPRESENT ); SetMusicMode( MUSIC_TACTICAL_ENEMYPRESENT );
+1 -1
View File
@@ -342,8 +342,8 @@ BOOLEAN SetThisSectorAsPlayerControlled( INT16 sMapX, INT16 sMapY, INT8 bMapZ, B
// Ja25: no loyalty // Ja25: no loyalty
#else #else
HandleGlobalLoyaltyEvent( GLOBAL_LOYALTY_GAIN_SAM, sMapX, sMapY, bMapZ ); HandleGlobalLoyaltyEvent( GLOBAL_LOYALTY_GAIN_SAM, sMapX, sMapY, bMapZ );
#endif
UpdateAirspaceControl( ); UpdateAirspaceControl( );
#endif
// if Skyrider has been delivered to chopper, and already mentioned Drassen SAM site, but not used this quote yet // if Skyrider has been delivered to chopper, and already mentioned Drassen SAM site, but not used this quote yet
if ( IsHelicopterPilotAvailable( ) && ( guiHelicopterSkyriderTalkState >= 1 ) && ( !gfSkyriderSaidCongratsOnTakingSAM ) ) if ( IsHelicopterPilotAvailable( ) && ( guiHelicopterSkyriderTalkState >= 1 ) && ( !gfSkyriderSaidCongratsOnTakingSAM ) )
{ {
+1 -1
View File
@@ -1071,7 +1071,7 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI )
//Disable the options button when the auto resolve screen comes up //Disable the options button when the auto resolve screen comes up
EnableDisAbleMapScreenOptionsButton( FALSE ); EnableDisAbleMapScreenOptionsButton( FALSE );
CheckForZombieMusic(); UseCreatureMusic(HostileZombiesPresent());
#ifdef NEWMUSIC #ifdef NEWMUSIC
GlobalSoundID = MusicSoundValues[ SECTOR( gubPBSectorX, gubPBSectorY ) ].SoundTacticalTensor[gubPBSectorZ]; GlobalSoundID = MusicSoundValues[ SECTOR( gubPBSectorX, gubPBSectorY ) ].SoundTacticalTensor[gubPBSectorZ];
+1 -1
View File
@@ -3171,7 +3171,7 @@ BOOLEAN CheckPendingNonPlayerTeam( UINT8 usTeam )
void HandleBloodCatDeaths( SECTORINFO *pSector ) void HandleBloodCatDeaths( SECTORINFO *pSector )
{ {
//if the current sector is the first part of the town //if the current sector is the first part of the town
if( gWorldSectorX == BETTY_BLOODCAT_SECTOR_X && gWorldSectorY == BETTY_BLOODCAT_SECTOR_Y && gbWorldSectorZ == BETTY_BLOODCAT_SECTOR_Z ) if( gWorldSectorX == 10 && gWorldSectorY == 9 && gbWorldSectorZ == 0 )
{ {
//if ALL the bloodcats are killed //if ALL the bloodcats are killed
if( pSector->bBloodCats == 0 ) if( pSector->bBloodCats == 0 )
+6 -6
View File
@@ -4417,16 +4417,16 @@ void SetupInfo()
// (Item[i].usItemClass & IC_AMMO) && (Magazine[ Item[i].ubClassIndex ].ubMagType == AMMO_BOX or AMMO_CRATE?) // (Item[i].usItemClass & IC_AMMO) && (Magazine[ Item[i].ubClassIndex ].ubMagType == AMMO_BOX or AMMO_CRATE?)
for (UINT16 i = 0; i < MAXITEMS; ++i) for (UINT16 i = 0; i < MAXITEMS; ++i)
{ {
if (ItemIsGascan(i)) ItemIdCache::gasCans.push_back(i); if (Item[i].gascan) ItemIdCache::gasCans.push_back(i);
else if (ItemIsFirstAidKit(i)) ItemIdCache::firstAidKits.push_back(i); else if (Item[i].firstaidkit) ItemIdCache::firstAidKits.push_back(i);
else if (ItemIsMedicalKit(i)) ItemIdCache::medKits.push_back(i); else if (Item[i].medicalkit) ItemIdCache::medKits.push_back(i);
else if (ItemIsToolkit(i)) ItemIdCache::toolKits.push_back(i); else if (Item[i].toolkit) ItemIdCache::toolKits.push_back(i);
else if (Item[i].usItemClass & IC_AMMO) else if (Item[i].usItemClass & IC_AMMO)
{ {
if (Magazine[Item[i].ubClassIndex].ubMagType == AMMO_BOX) if (Magazine[Item[i].ubClassIndex].ubMagType == AMMO_BOX)
{ {
if ((gGameOptions.fGunNut || !ItemIsOnlyInTonsOfGuns(i)) if ((gGameOptions.fGunNut || !Item[i].biggunlist)
&& (gGameOptions.ubGameStyle == STYLE_SCIFI || !ItemIsOnlyInScifi(i))) && (gGameOptions.ubGameStyle == STYLE_SCIFI || !Item[i].scifi))
{ {
// coolness runs from 1-10, so apply offset // coolness runs from 1-10, so apply offset
const UINT8 coolness = min(max(1, Item[i].ubCoolness), 10); const UINT8 coolness = min(max(1, Item[i].ubCoolness), 10);
+18 -55
View File
@@ -1610,11 +1610,6 @@ void InitStrategicAI()
case 1: case 1:
if( ubPicked[0] != ubSector && ubPicked[1] != ubSector ) if( ubPicked[0] != ubSector && ubPicked[1] != ubSector )
{ {
// (0,0) coordinates signify a not used cache sector
if ( gModSettings.ubWeaponCache1X == 0 || gModSettings.ubWeaponCache1Y == 0 )
{
break;
}
pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache1X, gModSettings.ubWeaponCache1Y ) ]; //SEC_E11 pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache1X, gModSettings.ubWeaponCache1Y ) ]; //SEC_E11
pSector->uiFlags |= SF_USE_ALTERNATE_MAP; pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops1 * 2); pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops1 * 2);
@@ -1633,10 +1628,6 @@ void InitStrategicAI()
case 2: case 2:
if( ubPicked[0] != ubSector && ubPicked[1] != ubSector ) if( ubPicked[0] != ubSector && ubPicked[1] != ubSector )
{ {
if ( gModSettings.ubWeaponCache2X == 0 || gModSettings.ubWeaponCache2Y == 0 )
{
break;
}
pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache2X, gModSettings.ubWeaponCache2Y ) ]; //SEC_H5 pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache2X, gModSettings.ubWeaponCache2Y ) ]; //SEC_H5
pSector->uiFlags |= SF_USE_ALTERNATE_MAP; pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops2 * 2); pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops2 * 2);
@@ -1655,10 +1646,6 @@ void InitStrategicAI()
case 3: case 3:
if( ubPicked[0] != ubSector && ubPicked[1] != ubSector ) if( ubPicked[0] != ubSector && ubPicked[1] != ubSector )
{ {
if ( gModSettings.ubWeaponCache3X == 0 || gModSettings.ubWeaponCache3Y == 0 )
{
break;
}
pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache3X, gModSettings.ubWeaponCache3Y ) ]; //SEC_H10 pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache3X, gModSettings.ubWeaponCache3Y ) ]; //SEC_H10
pSector->uiFlags |= SF_USE_ALTERNATE_MAP; pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops3 * 2); pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops3 * 2);
@@ -1677,10 +1664,6 @@ void InitStrategicAI()
case 4: case 4:
if( ubPicked[0] != ubSector && ubPicked[1] != ubSector ) if( ubPicked[0] != ubSector && ubPicked[1] != ubSector )
{ {
if ( gModSettings.ubWeaponCache4X == 0 || gModSettings.ubWeaponCache4Y == 0 )
{
break;
}
pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache4X, gModSettings.ubWeaponCache4Y ) ]; //SEC_J12 pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache4X, gModSettings.ubWeaponCache4Y ) ]; //SEC_J12
pSector->uiFlags |= SF_USE_ALTERNATE_MAP; pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops4 * 2); pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops4 * 2);
@@ -1699,10 +1682,6 @@ void InitStrategicAI()
case 5: case 5:
if( ubPicked[0] != ubSector && ubPicked[1] != ubSector ) if( ubPicked[0] != ubSector && ubPicked[1] != ubSector )
{ {
if ( gModSettings.ubWeaponCache5X == 0 || gModSettings.ubWeaponCache5Y == 0 )
{
break;
}
pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache5X, gModSettings.ubWeaponCache5Y ) ]; //SEC_M9 pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache5X, gModSettings.ubWeaponCache5Y ) ]; //SEC_M9
pSector->uiFlags |= SF_USE_ALTERNATE_MAP; pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops5 * 2); pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops5 * 2);
@@ -1727,40 +1706,25 @@ void InitStrategicAI()
} }
else else
{ {
if ( gModSettings.ubWeaponCache1X != 0 && gModSettings.ubWeaponCache1Y != 0 ) pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache1X, gModSettings.ubWeaponCache1Y ) ]; //SEC_E11
{ pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
pSector = &SectorInfo[SECTOR( gModSettings.ubWeaponCache1X, gModSettings.ubWeaponCache1Y )]; //SEC_E11 pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops1 * 2);
pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops1 * 2);
}
if ( gModSettings.ubWeaponCache2X != 0 && gModSettings.ubWeaponCache2Y != 0 ) pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache2X, gModSettings.ubWeaponCache2Y ) ]; //SEC_H5
{ pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
pSector = &SectorInfo[SECTOR( gModSettings.ubWeaponCache2X, gModSettings.ubWeaponCache2Y )]; //SEC_H5 pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops2 * 2);
pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops2 * 2);
}
if ( gModSettings.ubWeaponCache3X != 0 && gModSettings.ubWeaponCache3Y != 0 ) pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache3X, gModSettings.ubWeaponCache3Y ) ]; //SEC_H10
{ pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
pSector = &SectorInfo[SECTOR( gModSettings.ubWeaponCache3X, gModSettings.ubWeaponCache3Y )]; //SEC_H10 pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops3 * 2);
pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops3 * 2);
}
if ( gModSettings.ubWeaponCache4X != 0 && gModSettings.ubWeaponCache4Y != 0 ) pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache4X, gModSettings.ubWeaponCache4Y ) ]; //SEC_J12
{ pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
pSector = &SectorInfo[SECTOR( gModSettings.ubWeaponCache4X, gModSettings.ubWeaponCache4Y )]; //SEC_J12 pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops4 * 2);
pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops4 * 2);
}
if ( gModSettings.ubWeaponCache5X != 0 && gModSettings.ubWeaponCache5Y != 0 ) pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache5X, gModSettings.ubWeaponCache5Y ) ]; //SEC_M9
{ pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
pSector = &SectorInfo[SECTOR( gModSettings.ubWeaponCache5X, gModSettings.ubWeaponCache5Y )]; //SEC_M9 pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops5 * 2);
pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops5 * 2);
}
/* /*
pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache1X, gModSettings.ubWeaponCache1Y ) ]; //SEC_E11 pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache1X, gModSettings.ubWeaponCache1Y ) ]; //SEC_E11
@@ -7151,16 +7115,15 @@ void InitializeGroup( const GROUP_TYPE groupType, const UINT8 groupSize, UINT8 &
tankCount++; tankCount++;
} }
if ( troopCount > 0 && gGameExternalOptions.fASDAssignsJeeps && ASDSoldierUpgradeToJeep( ) ) if ( gGameExternalOptions.fASDAssignsJeeps && ASDSoldierUpgradeToJeep( ) )
{ {
troopCount--; troopCount--;
jeepCount++; jeepCount++;
} }
if ( troopCount > 0 && gGameExternalOptions.fASDAssignsRobots && ASDSoldierUpgradeToRobot() ) if ( gGameExternalOptions.fASDAssignsRobots && ASDSoldierUpgradeToRobot() )
{ {
// Limit amount of robots, if randomized difficulty bonus would cause us to go over the troopCount amount const int numRobots = 1 + Random(difficultyMod);
const int numRobots = min( (1 + Random(difficultyMod)), troopCount);
troopCount -= numRobots; troopCount -= numRobots;
robotCount += numRobots; robotCount += numRobots;
} }
+1 -1
View File
@@ -1334,7 +1334,7 @@ void CheckForMissingHospitalSupplies( void )
} }
} }
#endif//obsoleteCode #endif//obsoleteCode
if (ItemIsFirstAidKit(pObj->usItem) || ItemIsMedicalKit(pObj->usItem) || pObj->usItem == REGEN_BOOSTER || pObj->usItem == ADRENALINE_BOOSTER ) if ( Item[pObj->usItem].firstaidkit || Item[pObj->usItem].medicalkit || pObj->usItem == REGEN_BOOSTER || pObj->usItem == ADRENALINE_BOOSTER )
{ {
for (StackedObjects::iterator iter = pObj->objectStack.begin(); iter != pObj->objectStack.end(); ++iter) { for (StackedObjects::iterator iter = pObj->objectStack.begin(); iter != pObj->objectStack.end(); ++iter) {
if ( iter->data.objectStatus > 60 ) if ( iter->data.objectStatus > 60 )
+2 -3
View File
@@ -1085,7 +1085,7 @@ void PrepareForPreBattleInterface( GROUP *pPlayerDialogGroup, GROUP *pInitiating
} }
//Set music //Set music
CheckForZombieMusic(); UseCreatureMusic(HostileZombiesPresent());
#ifdef NEWMUSIC #ifdef NEWMUSIC
GlobalSoundID = MusicSoundValues[ SECTOR( gWorldSectorX, gWorldSectorY ) ].SoundTacticalTensor[gbWorldSectorZ]; GlobalSoundID = MusicSoundValues[ SECTOR( gWorldSectorX, gWorldSectorY ) ].SoundTacticalTensor[gbWorldSectorZ];
@@ -2644,7 +2644,6 @@ BOOLEAN PossibleToCoordinateSimultaneousGroupArrivals( GROUP *pFirstGroup )
{ {
if ( pGroup != pFirstGroup && (pGroup->usGroupTeam == OUR_TEAM || pGroup->usGroupTeam == MILITIA_TEAM) && pGroup->fBetweenSectors && if ( pGroup != pFirstGroup && (pGroup->usGroupTeam == OUR_TEAM || pGroup->usGroupTeam == MILITIA_TEAM) && pGroup->fBetweenSectors &&
pGroup->ubNextX == pFirstGroup->ubSectorX && pGroup->ubNextY == pFirstGroup->ubSectorY && pGroup->ubNextX == pFirstGroup->ubSectorX && pGroup->ubNextY == pFirstGroup->ubSectorY &&
pFirstGroup->ubSectorZ == pGroup->ubSectorZ &&
!(pGroup->uiFlags & GROUPFLAG_SIMULTANEOUSARRIVAL_CHECKED) && !(pGroup->uiFlags & GROUPFLAG_SIMULTANEOUSARRIVAL_CHECKED) &&
!IsGroupTheHelicopterGroup( pGroup ) ) !IsGroupTheHelicopterGroup( pGroup ) )
{ {
@@ -5138,7 +5137,7 @@ void AddFuelToVehicle( SOLDIERTYPE *pSoldier, SOLDIERTYPE *pVehicle )
OBJECTTYPE *pItem; OBJECTTYPE *pItem;
INT16 sFuelNeeded, sFuelAvailable, sFuelAdded; INT16 sFuelNeeded, sFuelAvailable, sFuelAdded;
pItem = &pSoldier->inv[ HANDPOS ]; pItem = &pSoldier->inv[ HANDPOS ];
if( !ItemIsGascan(pItem->usItem)) if( !Item[pItem->usItem].gascan )
{ {
#ifdef JA2BETAVERSION #ifdef JA2BETAVERSION
CHAR16 str[ 100 ]; CHAR16 str[ 100 ];
+3 -4
View File
@@ -40,7 +40,6 @@
#include "Luaglobal.h" #include "Luaglobal.h"
#include "LuaInitNPCs.h" #include "LuaInitNPCs.h"
#include "Interface.h" #include "Interface.h"
#include <language.hpp>
#include "GameInitOptionsScreen.h" #include "GameInitOptionsScreen.h"
extern WorldItems gAllWorldItems; extern WorldItems gAllWorldItems;
@@ -1632,12 +1631,12 @@ void AdjustLoyaltyForCivsEatenByMonsters( INT16 sSectorX, INT16 sSectorY, UINT8
swprintf( str, gpStrategicString[STR_PB_BANDIT_KILLCIVS_IN_SECTOR], ubHowMany, pSectorString ); swprintf( str, gpStrategicString[STR_PB_BANDIT_KILLCIVS_IN_SECTOR], ubHowMany, pSectorString );
else else
{ {
if( g_lang == i18n::Lang::zh ) { #ifdef CHINESE
//diffrent order of words in Chinese //diffrent order of words in Chinese
swprintf( str, gpStrategicString[STR_DIALOG_CREATURES_KILL_CIVILIANS], pSectorString, ubHowMany ); swprintf( str, gpStrategicString[STR_DIALOG_CREATURES_KILL_CIVILIANS], pSectorString, ubHowMany );
} else { #else
swprintf( str, gpStrategicString[STR_DIALOG_CREATURES_KILL_CIVILIANS], ubHowMany, pSectorString ); swprintf( str, gpStrategicString[STR_DIALOG_CREATURES_KILL_CIVILIANS], ubHowMany, pSectorString );
} #endif
} }
DoScreenIndependantMessageBox( str, MSG_BOX_FLAG_OK, MapScreenDefaultOkBoxCallback ); DoScreenIndependantMessageBox( str, MSG_BOX_FLAG_OK, MapScreenDefaultOkBoxCallback );
+12 -12
View File
@@ -500,18 +500,18 @@ void UpdateTransportGroupInventory()
if (!ItemIsLegal(i, TRUE)) continue; if (!ItemIsLegal(i, TRUE)) continue;
if ((Item[i].usItemClass & IC_AMMO) == 0 && (Item[i].iTransportGroupMaxProgress == 0 || Item[i].iTransportGroupMinProgress > progress || progress > Item[i].iTransportGroupMaxProgress)) continue; if ((Item[i].usItemClass & IC_AMMO) == 0 && (Item[i].iTransportGroupMaxProgress == 0 || Item[i].iTransportGroupMinProgress > progress || progress > Item[i].iTransportGroupMaxProgress)) continue;
if (ItemIsMedical(i)) if (Item[i].medical)
{ {
if (ItemIsFirstAidKit(i)) itemMap[MEDICAL_FIRSTAIDKITS].push_back(i); if (Item[i].firstaidkit) itemMap[MEDICAL_FIRSTAIDKITS].push_back(i);
else if (ItemIsMedicalKit(i)) itemMap[MEDICAL_MEDKITS].push_back(i); else if (Item[i].medicalkit) itemMap[MEDICAL_MEDKITS].push_back(i);
else itemMap[MEDICAL_OTHER].push_back(i); else itemMap[MEDICAL_OTHER].push_back(i);
} }
else if (ItemIsGascan(i)) itemMap[GAS_CANS].push_back(i); else if (Item[i].gascan) itemMap[GAS_CANS].push_back(i);
else if (ItemIsToolkit(i)) itemMap[TOOL_KITS].push_back(i); else if (Item[i].toolkit) itemMap[TOOL_KITS].push_back(i);
else if (HasItemFlag(i, RADIO_SET)) itemMap[RADIOS].push_back(i); else if (HasItemFlag(i, RADIO_SET)) itemMap[RADIOS].push_back(i);
else if (Item[i].usItemClass & IC_GRENADE) else if (Item[i].usItemClass & IC_GRENADE)
{ {
if (!ItemIsGLgrenade(i) if (Item[i].glgrenade == 0
&& Item[i].attachmentclass != AC_GRENADE // not for a grenade launcher && Item[i].attachmentclass != AC_GRENADE // not for a grenade launcher
&& Item[i].attachmentclass != AC_ROCKET) // not for a rocket launcher && Item[i].attachmentclass != AC_ROCKET) // not for a rocket launcher
itemMap[GRENADE_THROWN].push_back(i); itemMap[GRENADE_THROWN].push_back(i);
@@ -523,7 +523,7 @@ void UpdateTransportGroupInventory()
itemMap[BACKPACKS].push_back(i); itemMap[BACKPACKS].push_back(i);
} }
} }
else if (ItemIsCamoKit(i)) itemMap[CAMO_KITS].push_back(i); else if (Item[i].camouflagekit) itemMap[CAMO_KITS].push_back(i);
else if (Item[i].usItemClass & IC_MISC) else if (Item[i].usItemClass & IC_MISC)
{ {
switch (Item[i].attachmentclass) switch (Item[i].attachmentclass)
@@ -555,11 +555,11 @@ void UpdateTransportGroupInventory()
{ {
itemMap[GUNS].push_back(i); itemMap[GUNS].push_back(i);
} }
else if (ItemIsGrenadeLauncher(i)) else if (Item[i].grenadelauncher)
{ {
itemMap[GRENADELAUNCHERS].push_back(i); itemMap[GRENADELAUNCHERS].push_back(i);
} }
else if (ItemIsRocketLauncher(i)) else if (Item[i].rocketlauncher)
{ {
itemMap[ROCKETLAUNCHERS].push_back(i); itemMap[ROCKETLAUNCHERS].push_back(i);
} }
@@ -713,7 +713,7 @@ void UpdateTransportGroupInventory()
case ROCKETLAUNCHERS: case ROCKETLAUNCHERS:
{ {
addItemToInventory(pSoldier, id, ItemIsSingleShotRocketLauncher(id) ? 3 : 1); addItemToInventory(pSoldier, id, Item[id].singleshotrocketlauncher ? 3 : 1);
const UINT16 launchableId = PickARandomLaunchable(id); const UINT16 launchableId = PickARandomLaunchable(id);
if (launchableId == 0) continue; // no launchable matches, skip if (launchableId == 0) continue; // no launchable matches, skip
@@ -773,7 +773,7 @@ void UpdateTransportGroupInventory()
for (int i = 0; i < pSoldier->inv.size(); ++i) for (int i = 0; i < pSoldier->inv.size(); ++i)
{ {
OBJECTTYPE* item = &pSoldier->inv[i]; OBJECTTYPE* item = &pSoldier->inv[i];
if (item->exists() && ItemIsUndroppableByDefault(item->usItem) == FALSE) if (item->exists() && Item[item->usItem].defaultundroppable == FALSE)
{ {
item->fFlags &= ~OBJECT_UNDROPPABLE; item->fFlags &= ~OBJECT_UNDROPPABLE;
} }
@@ -861,7 +861,7 @@ void UpdateTransportGroupInventory()
for (int i = 0; i < pSoldier->inv.size(); ++i) for (int i = 0; i < pSoldier->inv.size(); ++i)
{ {
OBJECTTYPE* item = &pSoldier->inv[i]; OBJECTTYPE* item = &pSoldier->inv[i];
if (item->exists() && ItemIsUndroppableByDefault(item->usItem) == FALSE) if (item->exists() && Item[item->usItem].defaultundroppable == FALSE)
{ {
item->fFlags &= ~OBJECT_UNDROPPABLE; item->fFlags &= ~OBJECT_UNDROPPABLE;
} }
-1
View File
@@ -64,7 +64,6 @@ BOOLEAN LuaUnderground::InitializeSectorList()
.TableOpen() .TableOpen()
.TParam("difficultyLevel", int(gGameOptions.ubDifficultyLevel)) .TParam("difficultyLevel", int(gGameOptions.ubDifficultyLevel))
.TParam("gameStyle", int(gGameOptions.ubGameStyle)) .TParam("gameStyle", int(gGameOptions.ubGameStyle))
.TParam("maxTacticalEnemies", int(gGameExternalOptions.ubGameMaximumNumberOfEnemies))
.TableClose(); .TableClose();
SGP_THROW_IFFALSE(initsectorlist_func.Call(1), "call to lua function BuildUndergroundSectorList failed"); SGP_THROW_IFFALSE(initsectorlist_func.Call(1), "call to lua function BuildUndergroundSectorList failed");
+30 -18
View File
@@ -11,8 +11,10 @@
#include "font.h" #include "font.h"
#include "screenids.h" #include "screenids.h"
#include "screens.h" #include "screens.h"
#include "gameloop.h"
#include "overhead.h" #include "overhead.h"
#include "sysutil.h" #include "sysutil.h"
#include "input.h"
#include "Event Pump.h" #include "Event Pump.h"
#include "Font Control.h" #include "Font Control.h"
#include "Timer Control.h" #include "Timer Control.h"
@@ -42,15 +44,18 @@
#include "PopUpBox.h" #include "PopUpBox.h"
#include "Game Clock.h" #include "Game Clock.h"
#include "items.h" #include "items.h"
#include "vobject.h"
#include "Cursor Control.h" #include "Cursor Control.h"
#include "text.h" #include "text.h"
#include "strategic.h" #include "strategic.h"
#include "strategicmap.h" #include "strategicmap.h"
#include "interface.h"
#include "strategic pathing.h" #include "strategic pathing.h"
#include "Map Screen Interface Bottom.h" #include "Map Screen Interface Bottom.h"
#include "Map Screen Interface Border.h" #include "Map Screen Interface Border.h"
#include "Map Screen Interface Map.h" #include "Map Screen Interface Map.h"
#include "Map Screen Interface.h" #include "Map Screen Interface.h"
#include "Strategic Pathing.h"
#include "Assignments.h" #include "Assignments.h"
#include "points.h" #include "points.h"
#include "Squads.h" #include "Squads.h"
@@ -109,7 +114,7 @@
#include "connect.h" //hayden #include "connect.h" //hayden
#include "InterfaceItemImages.h" #include "InterfaceItemImages.h"
#include <language.hpp> #include "vobject.h"
#ifdef JA2UB #ifdef JA2UB
#include "laptop.h" #include "laptop.h"
@@ -4787,6 +4792,9 @@ UINT32 MapScreenHandle(void)
InitPreviousPaths(); InitPreviousPaths();
// HEADROCK HAM 3.6: Init coordinates for new variable-sized message window
InitMapScreenInterfaceBottomCoords();
// if arrival sector is invalid, reset to A9 // if arrival sector is invalid, reset to A9
if ( ( gsMercArriveSectorX < 1 ) || ( gsMercArriveSectorY < 1 ) || if ( ( gsMercArriveSectorX < 1 ) || ( gsMercArriveSectorY < 1 ) ||
( gsMercArriveSectorX > 16 ) || ( gsMercArriveSectorY > 16 ) ) ( gsMercArriveSectorX > 16 ) || ( gsMercArriveSectorY > 16 ) )
@@ -9048,8 +9056,12 @@ void RenderMapHighlight( INT16 sMapX, INT16 sMapY, UINT16 usLineColor, BOOLEAN f
// clip to view region // clip to view region
ClipBlitsToMapViewRegionForRectangleAndABit( uiDestPitchBYTES ); ClipBlitsToMapViewRegionForRectangleAndABit( uiDestPitchBYTES );
RectangleDraw( TRUE, sScreenX, sScreenY - 1, sScreenX + UI_MAP.GridSize.iX, sScreenY + UI_MAP.GridSize.iY - 1, usLineColor, pDestBuf ); if(gbPixelDepth==16)
InvalidateRegion( sScreenX, sScreenY - 2, sScreenX + UI_MAP.GridSize.iX + 1 + 1, sScreenY + UI_MAP.GridSize.iY + 1 - 1 ); {
// DB Need to add a radar color for 8-bit
RectangleDraw( TRUE, sScreenX, sScreenY - 1, sScreenX + UI_MAP.GridSize.iX, sScreenY + UI_MAP.GridSize.iY - 1, usLineColor, pDestBuf );
InvalidateRegion( sScreenX, sScreenY - 2, sScreenX + UI_MAP.GridSize.iX + 1 + 1, sScreenY + UI_MAP.GridSize.iY + 1 - 1 );
}
RestoreClipRegionToFullScreenForRectangle( uiDestPitchBYTES ); RestoreClipRegionToFullScreenForRectangle( uiDestPitchBYTES );
UnLockVideoSurface( FRAME_BUFFER ); UnLockVideoSurface( FRAME_BUFFER );
@@ -9652,27 +9664,27 @@ void BltCharInvPanel()
// print armor/weight/camo labels // print armor/weight/camo labels
mprintf(UI_CHARINV.Text.ArmorLabel.iX, UI_CHARINV.Text.ArmorLabel.iY, pInvPanelTitleStrings[ 0 ] ); mprintf(UI_CHARINV.Text.ArmorLabel.iX, UI_CHARINV.Text.ArmorLabel.iY, pInvPanelTitleStrings[ 0 ] );
if( g_lang == i18n::Lang::zh ) { #ifdef CHINESE
mprintf(UI_CHARINV.Text.ArmorPercent.iX, UI_CHARINV.Text.ArmorPercent.iY, ChineseSpecString1 ); mprintf(UI_CHARINV.Text.ArmorPercent.iX, UI_CHARINV.Text.ArmorPercent.iY, ChineseSpecString1 );
} else { #else
mprintf(UI_CHARINV.Text.ArmorPercent.iX, UI_CHARINV.Text.ArmorPercent.iY, L"%%" ); mprintf(UI_CHARINV.Text.ArmorPercent.iX, UI_CHARINV.Text.ArmorPercent.iY, L"%%" );
} #endif
mprintf(UI_CHARINV.Text.WeightLabel.iX, UI_CHARINV.Text.WeightLabel.iY, pInvPanelTitleStrings[ 1 ] ); mprintf(UI_CHARINV.Text.WeightLabel.iX, UI_CHARINV.Text.WeightLabel.iY, pInvPanelTitleStrings[ 1 ] );
if( g_lang == i18n::Lang::zh ) { #ifdef CHINESE
mprintf(UI_CHARINV.Text.WeightPercent.iX, UI_CHARINV.Text.WeightPercent.iY, ChineseSpecString1 ); mprintf(UI_CHARINV.Text.WeightPercent.iX, UI_CHARINV.Text.WeightPercent.iY, ChineseSpecString1 );
} else { #else
mprintf(UI_CHARINV.Text.WeightPercent.iX, UI_CHARINV.Text.WeightPercent.iY, L"%%" ); mprintf(UI_CHARINV.Text.WeightPercent.iX, UI_CHARINV.Text.WeightPercent.iY, L"%%" );
} #endif
mprintf(UI_CHARINV.Text.CamoLabel.iX, UI_CHARINV.Text.CamoLabel.iY, pInvPanelTitleStrings[ 2 ] ); mprintf(UI_CHARINV.Text.CamoLabel.iX, UI_CHARINV.Text.CamoLabel.iY, pInvPanelTitleStrings[ 2 ] );
if( g_lang == i18n::Lang::zh ) { #ifdef CHINESE
mprintf(UI_CHARINV.Text.CamoPercent.iX, UI_CHARINV.Text.CamoPercent.iY, ChineseSpecString1 ); mprintf(UI_CHARINV.Text.CamoPercent.iX, UI_CHARINV.Text.CamoPercent.iY, ChineseSpecString1 );
} else { #else
mprintf(UI_CHARINV.Text.CamoPercent.iX, UI_CHARINV.Text.CamoPercent.iY, L"%%" ); mprintf(UI_CHARINV.Text.CamoPercent.iX, UI_CHARINV.Text.CamoPercent.iY, L"%%" );
} #endif
const auto width = UI_CHARINV.Text.PercentWidth; const auto width = UI_CHARINV.Text.PercentWidth;
const auto height = UI_CHARINV.Text.PercentHeight; const auto height = UI_CHARINV.Text.PercentHeight;
@@ -9785,12 +9797,12 @@ void BltCharInvPanel()
UINT32 fontColour = FONT_MCOLOR_RED; UINT32 fontColour = FONT_MCOLOR_RED;
// robot targeting bonus // robot targeting bonus
if (ItemProvidesRobotLaserBonus(pSoldier->inv[ROBOT_TARGETING_SLOT].usItem)) if (Item[pSoldier->inv[ROBOT_TARGETING_SLOT].usItem].fProvidesRobotLaserBonus)
{ {
swprintf(text, szRobotText[ROBOT_TEXT_LASER]); swprintf(text, szRobotText[ROBOT_TEXT_LASER]);
fontColour = FONT_MCOLOR_LTGREEN; fontColour = FONT_MCOLOR_LTGREEN;
} }
else if (ItemProvidesRobotNightvision(pSoldier->inv[ROBOT_TARGETING_SLOT].usItem)) else if (Item[pSoldier->inv[ROBOT_TARGETING_SLOT].usItem].fProvidesRobotNightVision)
{ {
swprintf(text, szRobotText[ROBOT_TEXT_NIGHT_VISION]); swprintf(text, szRobotText[ROBOT_TEXT_NIGHT_VISION]);
fontColour = FONT_MCOLOR_LTGREEN; fontColour = FONT_MCOLOR_LTGREEN;
@@ -9813,7 +9825,7 @@ void BltCharInvPanel()
swprintf(text, szRobotText[ROBOT_TEXT_STAT_BONUSES]); swprintf(text, szRobotText[ROBOT_TEXT_STAT_BONUSES]);
fontColour = FONT_MCOLOR_LTGREEN; fontColour = FONT_MCOLOR_LTGREEN;
} }
else if (ItemProvidesRobotCamo(pSoldier->inv[ROBOT_CHASSIS_SLOT].usItem)) else if (Item[pSoldier->inv[ROBOT_CHASSIS_SLOT].usItem].fProvidesRobotCamo)
{ {
swprintf(text, szRobotText[ROBOT_TEXT_CAMO]); swprintf(text, szRobotText[ROBOT_TEXT_CAMO]);
fontColour = FONT_MCOLOR_LTGREEN; fontColour = FONT_MCOLOR_LTGREEN;
@@ -9846,12 +9858,12 @@ void BltCharInvPanel()
swprintf(text, L"%s", szRobotText[ROBOT_TEXT_RADIO]); swprintf(text, L"%s", szRobotText[ROBOT_TEXT_RADIO]);
fontColour = FONT_MCOLOR_LTGREEN; fontColour = FONT_MCOLOR_LTGREEN;
} }
else if (ItemIsMetalDetector(pSoldier->inv[ROBOT_UTILITY_SLOT].usItem)) else if (Item[pSoldier->inv[ROBOT_UTILITY_SLOT].usItem].metaldetector == 1)
{ {
swprintf(text, L"%s", szRobotText[ROBOT_TEXT_METAL_DETECTOR]); swprintf(text, L"%s", szRobotText[ROBOT_TEXT_METAL_DETECTOR]);
fontColour = FONT_MCOLOR_LTGREEN; fontColour = FONT_MCOLOR_LTGREEN;
} }
else if (ItemHasXRay(pSoldier->inv[ROBOT_UTILITY_SLOT].usItem)) else if (Item[pSoldier->inv[ROBOT_UTILITY_SLOT].usItem].xray == 1)
{ {
swprintf(text, L"%s", szRobotText[ROBOT_TEXT_XRAY]); swprintf(text, L"%s", szRobotText[ROBOT_TEXT_XRAY]);
fontColour = FONT_MCOLOR_LTGREEN; fontColour = FONT_MCOLOR_LTGREEN;
@@ -10430,7 +10442,7 @@ void MAPInvClickCallback( MOUSE_REGION *pRegion, INT32 iReason )
{ {
if ( !InItemDescriptionBox( ) ) if ( !InItemDescriptionBox( ) )
{ {
if ( _KeyDown(SHIFT) && gpItemPointer == NULL && Item[pSoldier->inv[ uiHandPos ].usItem].usItemClass == IC_GUN && (pSoldier->inv[ uiHandPos ])[uiHandPos]->data.gun.ubGunShotsLeft > 0 && !ItemIsSingleShotRocketLauncher(pSoldier->inv[ uiHandPos ].usItem) ) if ( _KeyDown(SHIFT) && gpItemPointer == NULL && Item[pSoldier->inv[ uiHandPos ].usItem].usItemClass == IC_GUN && (pSoldier->inv[ uiHandPos ])[uiHandPos]->data.gun.ubGunShotsLeft > 0 && !(Item[pSoldier->inv[ uiHandPos ].usItem].singleshotrocketlauncher) )
{ {
EmptyWeaponMagazine( &(pSoldier->inv[ uiHandPos ]), &gItemPointer, uiHandPos ); EmptyWeaponMagazine( &(pSoldier->inv[ uiHandPos ]), &gItemPointer, uiHandPos );
InternalMAPBeginItemPointer( pSoldier ); InternalMAPBeginItemPointer( pSoldier );
+13 -12
View File
@@ -6665,16 +6665,18 @@ BOOLEAN CheckAndHandleUnloadingOfCurrentWorld( )
if ( guiCurrentScreen == AUTORESOLVE_SCREEN ) if ( guiCurrentScreen == AUTORESOLVE_SCREEN )
{ {
//Yes, this is and looks like a hack. The conditions of this if statement doesn't work inside if ( gWorldSectorX == sBattleSectorX && gWorldSectorY == sBattleSectorY && gbWorldSectorZ == sBattleSectorZ )
//TrashWorld() or more specifically, TacticalRemoveSoldier() from within TrashWorld(). Because { //Yes, this is and looks like a hack. The conditions of this if statement doesn't work inside
//we are in the autoresolve screen, soldiers are internally created different (from pointers instead of //TrashWorld() or more specifically, TacticalRemoveSoldier() from within TrashWorld(). Because
//the MercPtrs[]). It keys on the fact that we are in the autoresolve screen. So, by switching the //we are in the autoresolve screen, soldiers are internally created different (from pointers instead of
//screen, it'll delete the soldiers in the loaded world properly, then later on, once autoresolve is //the MercPtrs[]). It keys on the fact that we are in the autoresolve screen. So, by switching the
//complete, it'll delete the autoresolve soldiers properly. As you can now see, the above if conditions //screen, it'll delete the soldiers in the loaded world properly, then later on, once autoresolve is
//don't change throughout this whole process which makes it necessary to do it this way. //complete, it'll delete the autoresolve soldiers properly. As you can now see, the above if conditions
guiCurrentScreen = MAP_SCREEN; //don't change throughout this whole process which makes it necessary to do it this way.
TrashWorld( ); guiCurrentScreen = MAP_SCREEN;
guiCurrentScreen = AUTORESOLVE_SCREEN; TrashWorld( );
guiCurrentScreen = AUTORESOLVE_SCREEN;
}
} }
else else
{ {
@@ -7778,7 +7780,6 @@ void HandleMovingEnemiesCloseToEntranceInSecondTunnelMap( )
void HandlePowerGenFanSoundModification( ) void HandlePowerGenFanSoundModification( )
{ {
extern UINT32 POWERGENSECTOREXITGRID_SRC_GRIDNO;
SetTileAnimCounter( TILE_ANIM__FAST_SPEED ); SetTileAnimCounter( TILE_ANIM__FAST_SPEED );
switch ( gJa25SaveStruct.ubStateOfFanInPowerGenSector ) switch ( gJa25SaveStruct.ubStateOfFanInPowerGenSector )
@@ -7787,7 +7788,7 @@ void HandlePowerGenFanSoundModification( )
HandleAddingPowerGenFanSound( ); HandleAddingPowerGenFanSound( );
//MAKE SURE the fan does not have an exit grid //MAKE SURE the fan does not have an exit grid
RemoveExitGridFromWorld( POWERGENSECTOREXITGRID_SRC_GRIDNO ); RemoveExitGridFromWorld( PGF__FAN_EXIT_GRID_GRIDNO );
break; break;
case PGF__STOPPED: case PGF__STOPPED:
-5
View File
@@ -1,5 +0,0 @@
# stuff that needs doing
# priority (LOW,HIGH) and description
LOW readd the C4838 (https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4838) warning to CMakeLists.txt once they're all fixed in the code
HIGH get rid of ENGLISH, GERMAN, etc preprocessor definitions completely. that way i18n can be built just once and language can be changed in the options screen pending game restart (hotloading will likely require more work)
+5 -5
View File
@@ -4297,10 +4297,10 @@ UINT16 DetermineSoldierAnimationSurface( SOLDIERTYPE *pSoldier, UINT16 usAnimSta
// ADJUST BASED ON ITEM IN HAND.... // ADJUST BASED ON ITEM IN HAND....
usItem = pSoldier->inv[ HANDPOS ].usItem; usItem = pSoldier->inv[ HANDPOS ].usItem;
if ( ( Item[ usItem ].usItemClass == IC_GUN || Item[ usItem ].usItemClass == IC_LAUNCHER ) && !ItemIsRocketLauncher(usItem) ) if ( ( Item[ usItem ].usItemClass == IC_GUN || Item[ usItem ].usItemClass == IC_LAUNCHER ) && !Item[usItem].rocketlauncher)
{ {
// if ( (Item[ usItem ].fFlags & ITEM_TWO_HANDED) ) // if ( (Item[ usItem ].fFlags & ITEM_TWO_HANDED) )
if (ItemIsTwoHanded(usItem)) if ( (Item[ usItem ].twohanded ) )
{ {
ubWaterHandIndex = 0; ubWaterHandIndex = 0;
} }
@@ -4321,7 +4321,7 @@ UINT16 DetermineSoldierAnimationSurface( SOLDIERTYPE *pSoldier, UINT16 usAnimSta
// ADJUST BASED ON ITEM IN HAND.... // ADJUST BASED ON ITEM IN HAND....
usItem = pSoldier->inv[ HANDPOS ].usItem; usItem = pSoldier->inv[ HANDPOS ].usItem;
if ( !(Item[ usItem ].usItemClass == IC_GUN ) && !(Item[ usItem ].usItemClass == IC_LAUNCHER ) || ItemIsRocketLauncher(usItem) ) if ( !(Item[ usItem ].usItemClass == IC_GUN ) && !(Item[ usItem ].usItemClass == IC_LAUNCHER ) || Item[usItem].rocketlauncher )
{ {
if ( usAnimState == STANDING ) if ( usAnimState == STANDING )
{ {
@@ -4342,10 +4342,10 @@ UINT16 DetermineSoldierAnimationSurface( SOLDIERTYPE *pSoldier, UINT16 usAnimSta
else else
{ {
// CHECK FOR HANDGUN // CHECK FOR HANDGUN
if ( ( Item[ usItem ].usItemClass == IC_GUN || Item[ usItem ].usItemClass == IC_LAUNCHER ) && !ItemIsRocketLauncher(usItem) ) if ( ( Item[ usItem ].usItemClass == IC_GUN || Item[ usItem ].usItemClass == IC_LAUNCHER ) && !Item[usItem].rocketlauncher )
{ {
// if ( !(Item[ usItem ].fFlags & ITEM_TWO_HANDED) ) // if ( !(Item[ usItem ].fFlags & ITEM_TWO_HANDED) )
if ( !ItemIsTwoHanded(usItem) ) if ( !(Item[ usItem ].twohanded ) )
{ {
// SANDRO - new anim for running with pistol by PasHancock // SANDRO - new anim for running with pistol by PasHancock
if ( usAnimState == RUNNING ) if ( usAnimState == RUNNING )
+50 -19
View File
@@ -71,6 +71,7 @@ void GuaranteeAtLeastXItemsOfIndex( UINT8 ubArmsDealer, UINT16 usItemIndex, UIN
void GuaranteeAtMostNumOfItemsForItem( UINT8 ubArmsDealer, INT16 sItemIndex, UINT8 ubAtMostNumItems ); void GuaranteeAtMostNumOfItemsForItem( UINT8 ubArmsDealer, INT16 sItemIndex, UINT8 ubAtMostNumItems );
void ArmsDealerGetsFreshStock( UINT8 ubArmsDealer, UINT16 usItemIndex, UINT8 ubNumItems ); void ArmsDealerGetsFreshStock( UINT8 ubArmsDealer, UINT16 usItemIndex, UINT8 ubNumItems );
BOOLEAN ItemContainsLiquid( UINT16 usItemIndex );
UINT8 DetermineDealerItemCondition( UINT8 ubArmsDealer, UINT16 usItemIndex ); UINT8 DetermineDealerItemCondition( UINT8 ubArmsDealer, UINT16 usItemIndex );
BOOLEAN DoesItemAppearInDealerInventoryList( UINT8 ubArmsDealer, UINT16 usItemIndex, BOOLEAN fPurchaseFromPlayer ); BOOLEAN DoesItemAppearInDealerInventoryList( UINT8 ubArmsDealer, UINT16 usItemIndex, BOOLEAN fPurchaseFromPlayer );
@@ -84,6 +85,8 @@ BOOLEAN CanThisItemBeSoldToSimulatedCustomer( UINT8 ubArmsDealerID, UINT16 usIte
void GuaranteeMinimumAlcohol( UINT8 ubArmsDealer ); void GuaranteeMinimumAlcohol( UINT8 ubArmsDealer );
BOOLEAN ItemIsARocketRifle( INT16 sItemIndex );
BOOLEAN GetArmsDealerShopHours( UINT8 ubArmsDealer, UINT32 *puiOpeningTime, UINT32 *puiClosingTime ); BOOLEAN GetArmsDealerShopHours( UINT8 ubArmsDealer, UINT32 *puiOpeningTime, UINT32 *puiClosingTime );
ARMS_DEALER_STATUS& ARMS_DEALER_STATUS::operator=(const OLD_ARMS_DEALER_STATUS_101& status) ARMS_DEALER_STATUS& ARMS_DEALER_STATUS::operator=(const OLD_ARMS_DEALER_STATUS_101& status)
@@ -958,7 +961,7 @@ UINT32 GetArmsDealerItemTypeFromItemNumber( UINT16 usItem )
return( ARMS_DEALER_HANDGUNCLASS ); return( ARMS_DEALER_HANDGUNCLASS );
break; break;
case RIFLECLASS: case RIFLECLASS:
if (ItemHasFingerPrintID( usItem ) ) if ( ItemIsARocketRifle( usItem ) )
return( ARMS_DEALER_ROCKET_RIFLE ); return( ARMS_DEALER_ROCKET_RIFLE );
else else
return( ARMS_DEALER_RIFLECLASS ); return( ARMS_DEALER_RIFLECLASS );
@@ -1007,15 +1010,15 @@ UINT32 GetArmsDealerItemTypeFromItemNumber( UINT16 usItem )
{ {
if ( Item [usItem].alcohol > 0.0f ) if ( Item [usItem].alcohol > 0.0f )
return( ARMS_DEALER_ALCOHOL ); return( ARMS_DEALER_ALCOHOL );
else if (ItemIsElectronic(usItem)) else if ( Item [usItem].electronic )
return( ARMS_DEALER_ELECTRONICS ); return( ARMS_DEALER_ELECTRONICS );
else if (ItemIsHardware(usItem)) else if ( Item [usItem].hardware )
return( ARMS_DEALER_HARDWARE ); return( ARMS_DEALER_HARDWARE );
else if (ItemIsMedical(usItem)) else if ( Item [usItem].medical )
return( ARMS_DEALER_MEDICAL ); return( ARMS_DEALER_MEDICAL );
else if (ItemIsAttachment(usItem)) else if ( Item [usItem].attachment )
return( ARMS_DEALER_ATTACHMENTS ); return( ARMS_DEALER_ATTACHMENTS );
else if ( IsAttachmentClass( usItem, (AC_DETONATOR | AC_REMOTEDET) ) || ItemIsRemoteTrigger(usItem)) else if ( Item [usItem].detonator || Item [usItem].remotedetonator || Item [usItem].remotetrigger )
return( ARMS_DEALER_DETONATORS ); return( ARMS_DEALER_DETONATORS );
else else
return( ARMS_DEALER_MISC ); return( ARMS_DEALER_MISC );
@@ -1073,7 +1076,7 @@ UINT32 GetArmsDealerItemTypeFromItemNumber( UINT16 usItem )
return( ARMS_DEALER_AMMO ); return( ARMS_DEALER_AMMO );
break; break;
case IC_FACE: case IC_FACE:
if (ItemIsElectronic(usItem)) if (Item[usItem].electronic )
return ARMS_DEALER_ELECTRONICS; return ARMS_DEALER_ELECTRONICS;
else else
return ARMS_DEALER_FACE; return ARMS_DEALER_FACE;
@@ -1275,7 +1278,8 @@ BOOLEAN CanDealerRepairItem( UINT8 ubArmsDealer, UINT16 usItemIndex )
// uiFlags = Item[ usItemIndex ].fFlags; // uiFlags = Item[ usItemIndex ].fFlags;
// can't repair anything that's not repairable! // can't repair anything that's not repairable!
if ( !ItemIsRepairable(usItemIndex) ) // if ( !( uiFlags & ITEM_REPAIRABLE ) )
if ( !( Item[ usItemIndex ].repairable ) )
{ {
return(FALSE); return(FALSE);
} }
@@ -1293,7 +1297,8 @@ BOOLEAN CanDealerRepairItem( UINT8 ubArmsDealer, UINT16 usItemIndex )
case ARMS_DEALER_PERKO: case ARMS_DEALER_PERKO:
#endif #endif
// repairs ANYTHING non-electronic // repairs ANYTHING non-electronic
if ( !ItemIsElectronic(usItemIndex) ) // if ( !( uiFlags & ITEM_ELECTRONIC ) )
if ( !( Item[ usItemIndex ].electronic ) )
{ {
return(TRUE); return(TRUE);
} }
@@ -1301,7 +1306,8 @@ BOOLEAN CanDealerRepairItem( UINT8 ubArmsDealer, UINT16 usItemIndex )
case ARMS_DEALER_FREDO: case ARMS_DEALER_FREDO:
// repairs ONLY electronics // repairs ONLY electronics
if (ItemIsElectronic(usItemIndex)) // if ( uiFlags & ITEM_ELECTRONIC )
if ( Item[ usItemIndex ].electronic )
{ {
return(TRUE); return(TRUE);
} }
@@ -1312,7 +1318,7 @@ BOOLEAN CanDealerRepairItem( UINT8 ubArmsDealer, UINT16 usItemIndex )
// Flugente: if we set this guy to be a repairguy, and this item is NOT electronic, well, we can // Flugente: if we set this guy to be a repairguy, and this item is NOT electronic, well, we can
if ( armsDealerInfo[ubArmsDealer].ubTypeOfArmsDealer == ARMS_DEALER_REPAIRS ) if ( armsDealerInfo[ubArmsDealer].ubTypeOfArmsDealer == ARMS_DEALER_REPAIRS )
{ {
if ( !ItemIsElectronic(usItemIndex) ) if ( !( Item[ usItemIndex ].electronic ) )
return(TRUE); return(TRUE);
else else
return(FALSE); return(FALSE);
@@ -1363,7 +1369,7 @@ UINT8 DetermineDealerItemCondition( UINT8 ubArmsDealer, UINT16 usItemIndex )
// if it's a damagable item, and not a liquid (those are always sold full) // if it's a damagable item, and not a liquid (those are always sold full)
// if ( ( Item[ usItemIndex ].fFlags & ITEM_DAMAGEABLE ) && !ItemContainsLiquid( usItemIndex ) ) // if ( ( Item[ usItemIndex ].fFlags & ITEM_DAMAGEABLE ) && !ItemContainsLiquid( usItemIndex ) )
if (ItemIsDamageable(usItemIndex) && !ItemContainsLiquid(usItemIndex)) if ( ( Item[ usItemIndex ].damageable ) && !ItemContainsLiquid( usItemIndex ) )
{ {
// if he ONLY has used items, or 50% of the time if he carries both used & new items // if he ONLY has used items, or 50% of the time if he carries both used & new items
if ( ( armsDealerInfo[ ubArmsDealer ].uiFlags & ARMS_DEALER_ONLY_USED_ITEMS ) || if ( ( armsDealerInfo[ ubArmsDealer ].uiFlags & ARMS_DEALER_ONLY_USED_ITEMS ) ||
@@ -1377,6 +1383,25 @@ UINT8 DetermineDealerItemCondition( UINT8 ubArmsDealer, UINT16 usItemIndex )
return( ubCondition); return( ubCondition);
} }
BOOLEAN ItemContainsLiquid( UINT16 usItemIndex )
{
return Item[usItemIndex].containsliquid;
//switch ( usItemIndex )
//{
// case CANTEEN:
// case BEER:
// case ALCOHOL:
// case JAR_HUMAN_BLOOD:
// case JAR_CREATURE_BLOOD:
// case JAR_QUEEN_CREATURE_BLOOD:
// case JAR_ELIXIR:
// case GAS_CAN:
// return( TRUE );
//}
//return( FALSE );
}
bool ItemIsSpecial(DEALER_SPECIAL_ITEM& item) bool ItemIsSpecial(DEALER_SPECIAL_ITEM& item)
{ {
@@ -1814,7 +1839,7 @@ void MakeObjectOutOfDealerItems( DEALER_SPECIAL_ITEM *pSpclItemInfo, OBJECTTYPE
// they don't have ammo for by selling them to Tony & buying them right back fully loaded! One could repeat this // they don't have ammo for by selling them to Tony & buying them right back fully loaded! One could repeat this
// ad nauseum (empty the gun between visits) as a (really expensive) way to get unlimited special ammo like rockets. // ad nauseum (empty the gun between visits) as a (really expensive) way to get unlimited special ammo like rockets.
//CHRISL: If we're working with a SingleShotRocketLauncher, we need ubGunShotsLeft to equal 1 //CHRISL: If we're working with a SingleShotRocketLauncher, we need ubGunShotsLeft to equal 1
if(ItemIsSingleShotRocketLauncher(pObject->usItem)) if(Item[pObject->usItem].singleshotrocketlauncher == TRUE)
(*pObject)[subObject]->data.gun.ubGunShotsLeft = 1; (*pObject)[subObject]->data.gun.ubGunShotsLeft = 1;
else else
(*pObject)[subObject]->data.gun.ubGunShotsLeft = 0; (*pObject)[subObject]->data.gun.ubGunShotsLeft = 0;
@@ -1838,7 +1863,7 @@ void GiveObjectToArmsDealerForRepair( UINT8 ubArmsDealer, OBJECTTYPE *pObject, U
Assert( CanDealerRepairItem( ubArmsDealer, pObject->usItem ) ); Assert( CanDealerRepairItem( ubArmsDealer, pObject->usItem ) );
// c) Actually damaged, or a rocket rifle (being reset) // c) Actually damaged, or a rocket rifle (being reset)
Assert( ( (*pObject)[0]->data.objectStatus < 100 ) || ItemHasFingerPrintID( pObject->usItem ) ); Assert( ( (*pObject)[0]->data.objectStatus < 100 ) || ItemIsARocketRifle( pObject->usItem ) );
/* ARM: Can now repair with removeable attachments still attached... /* ARM: Can now repair with removeable attachments still attached...
// d) Already stripped of all *detachable* attachments // d) Already stripped of all *detachable* attachments
@@ -1873,7 +1898,7 @@ void GiveItemToArmsDealerforRepair( UINT8 ubArmsDealer, OBJECTTYPE* pObject, UIN
Assert( DoesDealerDoRepairs( ubArmsDealer ) ); Assert( DoesDealerDoRepairs( ubArmsDealer ) );
Assert( (*pObject)[0]->data.objectStatus > 0 ); Assert( (*pObject)[0]->data.objectStatus > 0 );
Assert( ( (*pObject)[0]->data.objectStatus < 100 ) || ItemHasFingerPrintID( pObject->usItem ) ); Assert( ( (*pObject)[0]->data.objectStatus < 100 ) || ItemIsARocketRifle( pObject->usItem ) );
// figure out the earliest the repairman will be free to start repairing this item // figure out the earliest the repairman will be free to start repairing this item
uiTimeWhenFreeToStartIt = WhenWillRepairmanBeAllDoneRepairing( ubArmsDealer ); uiTimeWhenFreeToStartIt = WhenWillRepairmanBeAllDoneRepairing( ubArmsDealer );
@@ -1970,7 +1995,8 @@ UINT32 CalculateSimpleItemRepairTime( UINT8 ubArmsDealer, UINT16 usItemIndex, IN
// repairs on electronic items take twice as long if the guy doesn't have the skill // repairs on electronic items take twice as long if the guy doesn't have the skill
// for dealers, this means anyone but Fredo the Electronics guy takes twice as long (but doesn't charge double) // for dealers, this means anyone but Fredo the Electronics guy takes twice as long (but doesn't charge double)
// (Mind you, current he's the ONLY one who CAN repair Electronics at all! Oh well.) // (Mind you, current he's the ONLY one who CAN repair Electronics at all! Oh well.)
if( ItemIsElectronic(usItemIndex) && ( ubArmsDealer != ARMS_DEALER_FREDO ) ) // if( ( Item[ usItemIndex ].fFlags & ITEM_ELECTRONIC ) && ( ubArmsDealer != ARMS_DEALER_FREDO ) )
if( ( Item[ usItemIndex ].electronic ) && ( ubArmsDealer != ARMS_DEALER_FREDO ) )
{ {
uiTimeToRepair *= 2; uiTimeToRepair *= 2;
} }
@@ -2039,7 +2065,7 @@ UINT32 CalculateSimpleItemRepairCost( UINT8 ubArmsDealer, UINT16 usItemIndex, IN
} }
*/ */
if (ItemHasFingerPrintID( usItemIndex ) ) if ( ItemIsARocketRifle( usItemIndex ) )
{ {
// resetting imprinting for a rocket rifle costs something extra even if rifle is at 100% // resetting imprinting for a rocket rifle costs something extra even if rifle is at 100%
uiRepairCost += 100; uiRepairCost += 100;
@@ -2141,7 +2167,7 @@ UINT16 CalcValueOfItemToDealer( UINT8 ubArmsDealer, UINT16 usItemIndex, BOOLEAN
// the rest of this function applies only to the "general" dealers ( Jake, Keith, and Franz ) // the rest of this function applies only to the "general" dealers ( Jake, Keith, and Franz )
// Micky & Gabby specialize in creature parts & such, the others don't buy these at all (exception: jars) // Micky & Gabby specialize in creature parts & such, the others don't buy these at all (exception: jars)
if ( ( !ItemIsJar(usItemIndex)) && if ( ( !Item[usItemIndex].jar ) &&
( DoesItemAppearInDealerInventoryList( ARMS_DEALER_MICKY, usItemIndex, TRUE ) || ( DoesItemAppearInDealerInventoryList( ARMS_DEALER_MICKY, usItemIndex, TRUE ) ||
DoesItemAppearInDealerInventoryList( ARMS_DEALER_GABBY, usItemIndex, TRUE ) ) ) DoesItemAppearInDealerInventoryList( ARMS_DEALER_GABBY, usItemIndex, TRUE ) ) )
{ {
@@ -2188,7 +2214,7 @@ UINT16 CalcValueOfItemToDealer( UINT8 ubArmsDealer, UINT16 usItemIndex, BOOLEAN
{ {
// exception: Gas (Jake's) // exception: Gas (Jake's)
// if ( usItemIndex != GAS_CAN ) // if ( usItemIndex != GAS_CAN )
if ( !ItemIsGascan(usItemIndex)) if ( !Item[usItemIndex].gascan )
{ {
// they pay only 1/3 of true value! // they pay only 1/3 of true value!
usValueToThisDealer /= 3; usValueToThisDealer /= 3;
@@ -2218,6 +2244,11 @@ void GuaranteeMinimumAlcohol( UINT8 ubArmsDealer )
GuaranteeAtLeastXItemsOfIndex( ubArmsDealer, ALCOHOL, ( UINT8 ) ( GetDealersMaxItemAmount( ubArmsDealer, ALCOHOL ) / 3 ) ); GuaranteeAtLeastXItemsOfIndex( ubArmsDealer, ALCOHOL, ( UINT8 ) ( GetDealersMaxItemAmount( ubArmsDealer, ALCOHOL ) / 3 ) );
} }
BOOLEAN ItemIsARocketRifle( INT16 sItemIndex )
{
return( Item[sItemIndex].fingerprintid );
}
BOOLEAN GetArmsDealerShopHours( UINT8 ubArmsDealer, UINT32 *puiOpeningTime, UINT32 *puiClosingTime ) BOOLEAN GetArmsDealerShopHours( UINT8 ubArmsDealer, UINT32 *puiOpeningTime, UINT32 *puiClosingTime )
{ {
SOLDIERTYPE *pSoldier; SOLDIERTYPE *pSoldier;
+5 -3
View File
@@ -944,7 +944,8 @@ UINT8 GetCurrentSuitabilityForItem( INT8 bArmsDealer, UINT16 usItemIndex, BOOLEA
} }
// items normally not sold at shops are unsuitable // items normally not sold at shops are unsuitable
if (ItemIsNotBuyable(usItemIndex)) // if ( Item[ usItemIndex ].fFlags & ITEM_NOT_BUYABLE )
if ( Item[ usItemIndex ].notbuyable )
{ {
return(ITEM_SUITABILITY_NONE); return(ITEM_SUITABILITY_NONE);
} }
@@ -970,7 +971,7 @@ UINT8 GetCurrentSuitabilityForItem( INT8 bArmsDealer, UINT16 usItemIndex, BOOLEA
// case JAR: // case JAR:
// case JAR_ELIXIR: // case JAR_ELIXIR:
// case JAR_CREATURE_BLOOD: // case JAR_CREATURE_BLOOD:
if (ItemIsMedical(usItemIndex) || ItemIsCanteen(usItemIndex) || ItemIsMedicalKit(usItemIndex) || ItemIsLocksmithKit(usItemIndex) || ItemIsToolkit(usItemIndex) || ItemIsCrowbar(usItemIndex) || ItemIsJar(usItemIndex) ) if ( Item[usItemIndex].medical || Item[usItemIndex].canteen || Item[usItemIndex].medicalkit || Item[usItemIndex].locksmithkit || Item[usItemIndex].toolkit || Item[usItemIndex].crowbar || Item[usItemIndex].jar )
return(ITEM_SUITABILITY_ALWAYS); return(ITEM_SUITABILITY_ALWAYS);
//} //}
@@ -1454,7 +1455,8 @@ UINT8 GetDealerItemCategoryNumber( UINT16 usItemIndex )
BOOLEAN CanDealerItemBeSoldUsed( UINT16 usItemIndex ) BOOLEAN CanDealerItemBeSoldUsed( UINT16 usItemIndex )
{ {
if ( !ItemIsDamageable(usItemIndex) ) // if ( !( Item[ usItemIndex ].fFlags & ITEM_DAMAGEABLE ) )
if ( !( Item[ usItemIndex ].damageable ) )
return(FALSE); return(FALSE);
// certain items, although they're damagable, shouldn't be sold in a used condition // certain items, although they're damagable, shouldn't be sold in a used condition
+5 -6
View File
@@ -67,7 +67,6 @@
#include "ub_config.h" #include "ub_config.h"
#include "history.h" #include "history.h"
#include <language.hpp>
//forward declarations of common classes to eliminate includes //forward declarations of common classes to eliminate includes
class OBJECTTYPE; class OBJECTTYPE;
@@ -1345,10 +1344,10 @@ void HandleDialogue( )
{ {
HandleEveryoneDoneTheirEndGameQuotes(); HandleEveryoneDoneTheirEndGameQuotes();
} }
else if ( QItem.uiSpecialEventData & MULTIPURPOSE_SPECIAL_EVENT_GETUP_AFTER_HELI_CRASH ) else
{ {
// grab soldier ptr from profile ID // grab soldier ptr from profile ID
pSoldier = FindSoldierByProfileID( (UINT8)QItem.uiSpecialEventData2, FALSE ); pSoldier = FindSoldierByProfileID( (UINT8)QItem.uiSpecialEventData, FALSE );
// FindSoldier was returning a lot of nullptrs which would crash the game very quickly after Jerry gets up. This check is here to circumvent that. // FindSoldier was returning a lot of nullptrs which would crash the game very quickly after Jerry gets up. This check is here to circumvent that.
if (pSoldier != nullptr) if (pSoldier != nullptr)
@@ -2408,8 +2407,8 @@ CHAR8 *GetDialogueDataFilename( UINT8 ubCharacterNum, UINT16 usQuoteNum, BOOLEAN
{ {
if ( fWavFile ) if ( fWavFile )
{ {
if ( g_lang == i18n::Lang::ru && #ifdef RUSSIAN
( gMercProfiles[ubCharacterNum].Type == PROFILETYPE_RPC || if ( ( gMercProfiles[ubCharacterNum].Type == PROFILETYPE_RPC ||
gMercProfiles[ubCharacterNum].Type == PROFILETYPE_NPC || gMercProfiles[ubCharacterNum].Type == PROFILETYPE_NPC ||
gMercProfiles[ubCharacterNum].Type == PROFILETYPE_VEHICLE ) && gMercProfiles[ ubCharacterNum ].ubMiscFlags & PROFILE_MISC_FLAG_RECRUITED ) gMercProfiles[ubCharacterNum].Type == PROFILETYPE_VEHICLE ) && gMercProfiles[ ubCharacterNum ].ubMiscFlags & PROFILE_MISC_FLAG_RECRUITED )
{ {
@@ -2427,7 +2426,7 @@ CHAR8 *GetDialogueDataFilename( UINT8 ubCharacterNum, UINT16 usQuoteNum, BOOLEAN
#endif #endif
} }
else else
#endif
{ {
// build name of wav file (characternum + quotenum) // build name of wav file (characternum + quotenum)
sprintf( zFileNameHelper, "SPEECH\\%03d_%03d", usVoiceSet, usQuoteNum ); sprintf( zFileNameHelper, "SPEECH\\%03d_%03d", usVoiceSet, usQuoteNum );
-1
View File
@@ -262,7 +262,6 @@ enum DialogQuoteIDs
#ifdef JA2UB #ifdef JA2UB
#define MULTIPURPOSE_SPECIAL_EVENT_TEAM_MEMBERS_DONE_TALKING 0x20000000 #define MULTIPURPOSE_SPECIAL_EVENT_TEAM_MEMBERS_DONE_TALKING 0x20000000
#define MULTIPURPOSE_SPECIAL_EVENT_DONE_KILLING_DEIDRANNA 0x10000000 #define MULTIPURPOSE_SPECIAL_EVENT_DONE_KILLING_DEIDRANNA 0x10000000
#define MULTIPURPOSE_SPECIAL_EVENT_GETUP_AFTER_HELI_CRASH 0x08000000
#else #else
#define MULTIPURPOSE_SPECIAL_EVENT_DONE_KILLING_DEIDRANNA 0x00000001 #define MULTIPURPOSE_SPECIAL_EVENT_DONE_KILLING_DEIDRANNA 0x00000001
#define MULTIPURPOSE_SPECIAL_EVENT_TEAM_MEMBERS_DONE_TALKING 0x00000002 #define MULTIPURPOSE_SPECIAL_EVENT_TEAM_MEMBERS_DONE_TALKING 0x00000002
+3 -3
View File
@@ -1274,7 +1274,7 @@ void DetermineMineDisplayInTile( INT32 sGridNo, INT8 bLevel, INT8& bOverlayType,
{ {
case MINES_DRAW_PLAYERTEAM_NETWORKS: case MINES_DRAW_PLAYERTEAM_NETWORKS:
{ {
if (ItemIsTripwire(pObj->usItem)) if ( Item[pObj->usItem].tripwire == 1 )
{ {
// if we're already marked as MINE_BOMB, switch to MINE_BOMB_AND_WIRE // if we're already marked as MINE_BOMB, switch to MINE_BOMB_AND_WIRE
if ( bOverlayType == MINE_BOMB ) if ( bOverlayType == MINE_BOMB )
@@ -1314,7 +1314,7 @@ void DetermineMineDisplayInTile( INT32 sGridNo, INT8 bLevel, INT8& bOverlayType,
case MINES_DRAW_NETWORKCOLOURING: case MINES_DRAW_NETWORKCOLOURING:
{ {
if (ItemIsTripwire(pObj->usItem)) if ( Item[pObj->usItem].tripwire == 1 )
{ {
// determine if wire is of the network we're searching for // determine if wire is of the network we're searching for
// determine this tripwire's flag // determine this tripwire's flag
@@ -1342,7 +1342,7 @@ void DetermineMineDisplayInTile( INT32 sGridNo, INT8 bLevel, INT8& bOverlayType,
case MINES_DRAW_NET_C: case MINES_DRAW_NET_C:
case MINES_DRAW_NET_D: case MINES_DRAW_NET_D:
{ {
if (ItemIsTripwire(pObj->usItem)) if ( Item[pObj->usItem].tripwire == 1 )
{ {
UINT32 specificnet = 0; UINT32 specificnet = 0;
switch ( gubDrawMode ) switch ( gubDrawMode )
+1 -1
View File
@@ -205,7 +205,7 @@ BOOLEAN ApplyDrugs_New( SOLDIERTYPE *pSoldier, UINT16 usItem, UINT16 uStatusUsed
gMercProfiles[pSoldier->ubProfile].ubNumTimesDrugUseInLifetime++; gMercProfiles[pSoldier->ubProfile].ubNumTimesDrugUseInLifetime++;
} }
if (ItemIsCigarette(usItem)) if ( Item[usItem].cigarette )
{ {
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[MSG_MERC_TOOK_CIGARETTE], pSoldier->GetName( ), ShortItemNames[usItem] ); ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[MSG_MERC_TOOK_CIGARETTE], pSoldier->GetName( ), ShortItemNames[usItem] );
} }
+3 -3
View File
@@ -1950,7 +1950,7 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE
// check first face slot // check first face slot
if (uiFaceItemOne != NONE) if (uiFaceItemOne != NONE)
{ {
if (ItemIsGasmask(uiFaceItemOne)) if (Item[uiFaceItemOne].gasmask)
uiFaceItemOne = 1; uiFaceItemOne = 1;
else if (Item[uiFaceItemOne].nightvisionrangebonus > 0) else if (Item[uiFaceItemOne].nightvisionrangebonus > 0)
uiFaceItemOne = 2; uiFaceItemOne = 2;
@@ -1965,7 +1965,7 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE
// check second face slot // check second face slot
if (uiFaceItemTwo != NONE) if (uiFaceItemTwo != NONE)
{ {
if (ItemIsGasmask(uiFaceItemTwo)) if (Item[uiFaceItemTwo].gasmask)
uiFaceItemTwo = 21; uiFaceItemTwo = 21;
else if (Item[uiFaceItemTwo].nightvisionrangebonus > 0) else if (Item[uiFaceItemTwo].nightvisionrangebonus > 0)
uiFaceItemTwo = 42; uiFaceItemTwo = 42;
@@ -2250,7 +2250,7 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE
sIconIndex_Assignment = 0; sIconIndex_Assignment = 0;
fDoIcon_Assignment = TRUE; fDoIcon_Assignment = TRUE;
// Show repair points if merc has a toolkit in his hand. Otherwise show cleaning points. // Show repair points if merc has a toolkit in his hand. Otherwise show cleaning points.
if (ItemIsToolkit(pSoldier->inv[HANDPOS].usItem)) if (Item[pSoldier->inv[HANDPOS].usItem].toolkit)
sPtsAvailable = CalculateRepairPointsForRepairman(MercPtrs[pFace->ubSoldierID], &usMaximumPts, FALSE); sPtsAvailable = CalculateRepairPointsForRepairman(MercPtrs[pFace->ubSoldierID], &usMaximumPts, FALSE);
else else
sPtsAvailable = CalculateCleaningPointsForRepairman(MercPtrs[pFace->ubSoldierID], &usMaximumPts); sPtsAvailable = CalculateCleaningPointsForRepairman(MercPtrs[pFace->ubSoldierID], &usMaximumPts);
+12 -12
View File
@@ -174,7 +174,7 @@ BOOLEAN ApplyFood( SOLDIERTYPE *pSoldier, OBJECTTYPE *pObject, UINT16 usPointsTo
return( FALSE); return( FALSE);
// workaround: canteens with 1% status are treated as 'empty'. They cannot be consumed, but refilled // workaround: canteens with 1% status are treated as 'empty'. They cannot be consumed, but refilled
if (ItemIsCanteen(pObject->usItem) && (*pObject)[0]->data.objectStatus == 1 ) if ( Item[pObject->usItem].canteen == TRUE && (*pObject)[0]->data.objectStatus == 1 )
return( FALSE); return( FALSE);
// do we eat or drink this stuff? // do we eat or drink this stuff?
@@ -693,7 +693,7 @@ void EatFromInventory( SOLDIERTYPE *pSoldier, BOOLEAN fcanteensonly )
// if fcanteensonly is TRUE, omit everything that is not a canteen // if fcanteensonly is TRUE, omit everything that is not a canteen
if ( fcanteensonly ) if ( fcanteensonly )
{ {
if ( !ItemIsCanteen(pObj->usItem)) if ( Item[pObj->usItem].canteen == FALSE )
continue; continue;
} }
else else
@@ -707,7 +707,7 @@ void EatFromInventory( SOLDIERTYPE *pSoldier, BOOLEAN fcanteensonly )
if ( foodcondition < FOOD_BAD_THRESHOLD ) if ( foodcondition < FOOD_BAD_THRESHOLD )
continue; continue;
if (ItemIsCanteen(pObj->usItem)) if ( Item[pObj->usItem].canteen == TRUE )
continue; continue;
} }
@@ -741,7 +741,7 @@ void EatFromInventory( SOLDIERTYPE *pSoldier, BOOLEAN fcanteensonly )
// if fcanteensonly is TRUE, omit everything that is not a canteen // if fcanteensonly is TRUE, omit everything that is not a canteen
if ( fcanteensonly ) if ( fcanteensonly )
{ {
if (!ItemIsCanteen(pObj->usItem)) if ( Item[pObj->usItem].canteen == FALSE )
continue; continue;
} }
@@ -846,7 +846,7 @@ void SectorFillCanteens( void )
for ( INT8 bLoop = 0; bLoop < invsize; ++bLoop) // ... for all items in our inventory ... for ( INT8 bLoop = 0; bLoop < invsize; ++bLoop) // ... for all items in our inventory ...
{ {
// ... if Item exists and is canteen (that can have drink points) ... // ... if Item exists and is canteen (that can have drink points) ...
if (pSoldier->inv[bLoop].exists() == true && ItemIsCanteen(pSoldier->inv[bLoop].usItem) && Food[Item[pSoldier->inv[bLoop].usItem].foodtype].bDrinkPoints > 0) if (pSoldier->inv[bLoop].exists() == true && Item[pSoldier->inv[bLoop].usItem].canteen && Food[Item[pSoldier->inv[bLoop].usItem].foodtype].bDrinkPoints > 0)
{ {
OBJECTTYPE* pObj = &(pSoldier->inv[bLoop]); // ... get pointer for this item ... OBJECTTYPE* pObj = &(pSoldier->inv[bLoop]); // ... get pointer for this item ...
@@ -878,7 +878,7 @@ void SectorFillCanteens( void )
if( gWorldItems[ uiCount ].fExists ) // ... if item exists ... if( gWorldItems[ uiCount ].fExists ) // ... if item exists ...
{ {
// ... if Item exists and is a canteen (only those are refillable) ... // ... if Item exists and is a canteen (only those are refillable) ...
if (ItemIsCanteen(gWorldItems[ uiCount ].object.usItem) && Food[Item[gWorldItems[ uiCount ].object.usItem].foodtype].bDrinkPoints > 0) if ( Item[gWorldItems[ uiCount ].object.usItem].canteen && Food[Item[gWorldItems[ uiCount ].object.usItem].foodtype].bDrinkPoints > 0)
{ {
OBJECTTYPE* pObj = &(gWorldItems[ uiCount ].object); // ... get pointer for this item ... OBJECTTYPE* pObj = &(gWorldItems[ uiCount ].object); // ... get pointer for this item ...
@@ -920,7 +920,7 @@ void SectorFillCanteens( void )
for ( INT8 bLoop = 0; bLoop < invsize; ++bLoop) // ... for all items in our inventory ... for ( INT8 bLoop = 0; bLoop < invsize; ++bLoop) // ... for all items in our inventory ...
{ {
// ... if Item exists and is canteen and is NOT a water drum... // ... if Item exists and is canteen and is NOT a water drum...
if (pSoldier->inv[bLoop].exists() == true && ItemIsCanteen(pSoldier->inv[bLoop].usItem) && (Food[Item[pSoldier->inv[bLoop].usItem].foodtype].bDrinkPoints > 0) && !HasItemFlag(pSoldier->inv[bLoop].usItem, (WATER_DRUM))) if (pSoldier->inv[bLoop].exists() == true && Item[pSoldier->inv[bLoop].usItem].canteen && (Food[Item[pSoldier->inv[bLoop].usItem].foodtype].bDrinkPoints > 0) && !HasItemFlag(pSoldier->inv[bLoop].usItem, (WATER_DRUM)))
{ {
OBJECTTYPE* pObj = &(pSoldier->inv[bLoop]); // ... get pointer for this item ... OBJECTTYPE* pObj = &(pSoldier->inv[bLoop]); // ... get pointer for this item ...
@@ -973,7 +973,7 @@ void SectorFillCanteens( void )
if( gWorldItems[ uiCount ].fExists ) // ... if item exists ... if( gWorldItems[ uiCount ].fExists ) // ... if item exists ...
{ {
// ... if Item exists and is a canteen (only those are refillable) ... // ... if Item exists and is a canteen (only those are refillable) ...
if (ItemIsCanteen(gWorldItems[ uiCount ].object.usItem)) if ( Item[gWorldItems[ uiCount ].object.usItem].canteen )
{ {
OBJECTTYPE* pObj = &(gWorldItems[ uiCount ].object); // ... get pointer for this item ... OBJECTTYPE* pObj = &(gWorldItems[ uiCount ].object); // ... get pointer for this item ...
@@ -1031,7 +1031,7 @@ OBJECTTYPE* GetUsableWaterDrumInSector( void )
if( gWorldItems[ uiCount ].fExists ) // ... if item exists ... if( gWorldItems[ uiCount ].fExists ) // ... if item exists ...
{ {
// ... if Item exists and is a canteen (only those are refillable) ... // ... if Item exists and is a canteen (only those are refillable) ...
if (ItemIsCanteen(gWorldItems[ uiCount ].object.usItem)) if ( Item[gWorldItems[ uiCount ].object.usItem].canteen )
{ {
OBJECTTYPE* pObj = &(gWorldItems[ uiCount ].object); // ... get pointer for this item ... OBJECTTYPE* pObj = &(gWorldItems[ uiCount ].object); // ... get pointer for this item ...
@@ -1077,7 +1077,7 @@ void SoldierAutoFillCanteens(SOLDIERTYPE *pSoldier)
for ( INT8 bLoop = 0; bLoop < invsize; ++bLoop) // ... for all items in our inventory ... for ( INT8 bLoop = 0; bLoop < invsize; ++bLoop) // ... for all items in our inventory ...
{ {
// ... if Item exists and is canteen (that can have drink points) ... // ... if Item exists and is canteen (that can have drink points) ...
if (pSoldier->inv[bLoop].exists() == true && ItemIsCanteen(pSoldier->inv[bLoop].usItem) && Food[Item[pSoldier->inv[bLoop].usItem].foodtype].bDrinkPoints > 0) if (pSoldier->inv[bLoop].exists() == true && Item[pSoldier->inv[bLoop].usItem].canteen && Food[Item[pSoldier->inv[bLoop].usItem].foodtype].bDrinkPoints > 0)
{ {
OBJECTTYPE* pObj = &(pSoldier->inv[bLoop]); // ... get pointer for this item ... OBJECTTYPE* pObj = &(pSoldier->inv[bLoop]); // ... get pointer for this item ...
@@ -1118,7 +1118,7 @@ BOOLEAN HasFoodInInventory( SOLDIERTYPE *pSoldier, BOOLEAN fCheckFood, BOOLEAN f
if ( fCheckDrink && Food[Item[pSoldier->inv[bLoop].usItem].foodtype].bDrinkPoints ) if ( fCheckDrink && Food[Item[pSoldier->inv[bLoop].usItem].foodtype].bDrinkPoints )
{ {
if (ItemIsCanteen(pSoldier->inv[bLoop].usItem)) if ( Item[pSoldier->inv[bLoop].usItem].canteen )
{ {
// empty canteens retain 1% status, so check ether something is in them // empty canteens retain 1% status, so check ether something is in them
if ( pSoldier->inv[bLoop][0]->data.objectStatus > 1 ) if ( pSoldier->inv[bLoop][0]->data.objectStatus > 1 )
@@ -1170,7 +1170,7 @@ void DrinkFromWaterTap( SOLDIERTYPE* pSoldier )
for (INT8 bLoop = 0; bLoop < invsize; ++bLoop) // ... for all items in our inventory ... for (INT8 bLoop = 0; bLoop < invsize; ++bLoop) // ... for all items in our inventory ...
{ {
// ... if Item exists and is canteen (that can have drink points) ... // ... if Item exists and is canteen (that can have drink points) ...
if (pSoldier->inv[bLoop].exists() == true && ItemIsCanteen(pSoldier->inv[bLoop].usItem) && Food[Item[pSoldier->inv[bLoop].usItem].foodtype].bDrinkPoints > 0) if (pSoldier->inv[bLoop].exists() == true && Item[pSoldier->inv[bLoop].usItem].canteen && Food[Item[pSoldier->inv[bLoop].usItem].foodtype].bDrinkPoints > 0)
{ {
OBJECTTYPE* pObj = &(pSoldier->inv[bLoop]); // ... get pointer for this item ... OBJECTTYPE* pObj = &(pSoldier->inv[bLoop]); // ... get pointer for this item ...
+3 -4
View File
@@ -33,7 +33,6 @@
#include "GameSettings.h" #include "GameSettings.h"
#include "fresh_header.h" #include "fresh_header.h"
#include "connect.h" #include "connect.h"
#include <language.hpp>
#ifdef JA2UB #ifdef JA2UB
#include "Explosion Control.h" #include "Explosion Control.h"
@@ -1493,7 +1492,7 @@ void SetDoorString( INT32 sGridNo )
// ATE: If here, we try to say, opened or closed... // ATE: If here, we try to say, opened or closed...
if ( gfUIIntTileLocation2 == FALSE ) if ( gfUIIntTileLocation2 == FALSE )
{ {
if( g_lang == i18n::Lang::de ) { #ifdef GERMAN
wcscpy( gzIntTileLocation2, TacticalStr[ DOOR_DOOR_MOUSE_DESCRIPTION ] ); wcscpy( gzIntTileLocation2, TacticalStr[ DOOR_DOOR_MOUSE_DESCRIPTION ] );
gfUIIntTileLocation2 = TRUE; gfUIIntTileLocation2 = TRUE;
@@ -1536,7 +1535,7 @@ if( g_lang == i18n::Lang::de ) {
gfUIIntTileLocation = TRUE; gfUIIntTileLocation = TRUE;
} }
} }
} else { #else
// Try to get doors status here... // Try to get doors status here...
pDoorStatus = GetDoorStatus( sGridNo ); pDoorStatus = GetDoorStatus( sGridNo );
@@ -1577,7 +1576,7 @@ if( g_lang == i18n::Lang::de ) {
} }
} }
} #endif
} }
} }
+34 -33
View File
@@ -319,7 +319,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
pSoldier->ubProfile != NO_PROFILE && pSoldier->ubProfile != NO_PROFILE &&
pTargetSoldier && pTargetSoldier &&
Item[usHandItem].usItemClass != IC_MEDKIT && Item[usHandItem].usItemClass != IC_MEDKIT &&
!ItemIsGascan(usHandItem) && !Item[usHandItem].gascan &&
!ItemCanBeAppliedToOthers(usHandItem) && !ItemCanBeAppliedToOthers(usHandItem) &&
!HasItemFlag(usHandItem, EMPTY_BLOOD_BAG) && !HasItemFlag(usHandItem, EMPTY_BLOOD_BAG) &&
!HasItemFlag( usHandItem, MEDICAL_SPLINT ) ) !HasItemFlag( usHandItem, MEDICAL_SPLINT ) )
@@ -473,8 +473,8 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
if ( Item[ usHandItem ].usItemClass == IC_GUN || Item[ usHandItem ].usItemClass == IC_THROWING_KNIFE ) if ( Item[ usHandItem ].usItemClass == IC_GUN || Item[ usHandItem ].usItemClass == IC_THROWING_KNIFE )
{ {
// WEAPONS // WEAPONS
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("HandleItem: checking for fingerprintID, item id = %d,id required = %d, imprint id = %d, soldier id = %d",usHandItem, ItemHasFingerPrintID(usHandItem), pSoldier->inv[ pSoldier->ubAttackingHand ][0]->data.ubImprintID,pSoldier->ubProfile)); DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("HandleItem: checking for fingerprintID, item id = %d,id required = %d, imprint id = %d, soldier id = %d",usHandItem,Item[usHandItem].fingerprintid,pSoldier->inv[ pSoldier->ubAttackingHand ][0]->data.ubImprintID,pSoldier->ubProfile));
if (ItemHasFingerPrintID(usHandItem)) if ( Item[usHandItem].fingerprintid )
{ {
// check imprint ID // check imprint ID
// NB not-imprinted value is NO_PROFILE // NB not-imprinted value is NO_PROFILE
@@ -807,7 +807,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
} }
// ATE: Here to make cursor go back to move after LAW shot... // ATE: Here to make cursor go back to move after LAW shot...
if ( fFromUI && ItemIsSingleShotRocketLauncher(usHandItem) ) if ( fFromUI && Item[usHandItem].singleshotrocketlauncher)
{ {
guiPendingOverrideEvent = A_CHANGE_TO_MOVE; guiPendingOverrideEvent = A_CHANGE_TO_MOVE;
} }
@@ -969,7 +969,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
BOOLEAN fCorpse = FALSE; BOOLEAN fCorpse = FALSE;
if(pCorpse != NULL) if(pCorpse != NULL)
fCorpse = IsValidDecapitationCorpse( pCorpse ); fCorpse = IsValidDecapitationCorpse( pCorpse );
if (ItemIsWirecutters(usHandItem) && pTargetSoldier == NULL && !pCorpse ) // Madd: quick fix to allow wirecutter/knives if ( Item[usHandItem].wirecutters && pTargetSoldier == NULL && !pCorpse ) // Madd: quick fix to allow wirecutter/knives
{ {
// See if we can get there to stab // See if we can get there to stab
sActionGridNo = FindAdjacentGridEx( pSoldier, sGridNo, &ubDirection, &sAdjustedGridNo, TRUE, FALSE ); sActionGridNo = FindAdjacentGridEx( pSoldier, sGridNo, &ubDirection, &sAdjustedGridNo, TRUE, FALSE );
@@ -1025,7 +1025,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
} }
} }
if (ItemIsToolkit(usHandItem)) if ( Item[usHandItem].toolkit )
{ {
UINT8 ubMercID; UINT8 ubMercID;
BOOLEAN fVehicle = FALSE; BOOLEAN fVehicle = FALSE;
@@ -1098,7 +1098,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
} }
} }
if (ItemIsGascan(usHandItem)) if ( Item[usHandItem].gascan )
{ {
UINT8 ubMercID; UINT8 ubMercID;
INT32 sVehicleGridNo=-1; INT32 sVehicleGridNo=-1;
@@ -1170,7 +1170,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
} }
if (ItemIsJar(usHandItem)) if ( Item[usHandItem].jar )
{ {
sActionGridNo = FindAdjacentGridEx( pSoldier, sGridNo, &ubDirection, &sAdjustedGridNo, TRUE, FALSE ); sActionGridNo = FindAdjacentGridEx( pSoldier, sGridNo, &ubDirection, &sAdjustedGridNo, TRUE, FALSE );
@@ -1614,7 +1614,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
} }
} }
if (ItemIsCanAndString(usHandItem)) if ( Item[usHandItem].canandstring )
{ {
STRUCTURE *pStructure; STRUCTURE *pStructure;
LEVELNODE *pIntTile; LEVELNODE *pIntTile;
@@ -1686,7 +1686,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
if ( EnoughPoints( pSoldier, sAPCost, 0, fFromUI ) ) if ( EnoughPoints( pSoldier, sAPCost, 0, fFromUI ) )
{ {
DeductPoints( pSoldier, sAPCost, 0 ); DeductPoints( pSoldier, sAPCost, 0 );
if (ItemHasXRay(usHandItem)) if ( Item[usHandItem].xray )
{ {
PlayJA2Sample( USE_X_RAY_MACHINE, RATE_11025, SoundVolume( HIGHVOLUME, pSoldier->sGridNo ), 1, SoundDir( pSoldier->sGridNo ) ); PlayJA2Sample( USE_X_RAY_MACHINE, RATE_11025, SoundVolume( HIGHVOLUME, pSoldier->sGridNo ), 1, SoundDir( pSoldier->sGridNo ) );
@@ -1867,7 +1867,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
sAPCost = MinAPsToAttack( pSoldier, sTargetGridNo, TRUE, pSoldier->aiData.bAimTime, 0 ); sAPCost = MinAPsToAttack( pSoldier, sTargetGridNo, TRUE, pSoldier->aiData.bAimTime, 0 );
// Check if these is room to place mortar! // Check if these is room to place mortar!
if (ItemIsMortar(usHandItem)) if ( Item[usHandItem].mortar )
{ {
ubDirection = (UINT8)GetDirectionFromGridNo( sTargetGridNo, pSoldier ); ubDirection = (UINT8)GetDirectionFromGridNo( sTargetGridNo, pSoldier );
@@ -1881,7 +1881,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
//pSoldier->flags.fDontChargeAPsForStanceChange = TRUE;//dnl ch72 270913 no reason why not charge for stance change //pSoldier->flags.fDontChargeAPsForStanceChange = TRUE;//dnl ch72 270913 no reason why not charge for stance change
} }
else if (ItemIsGrenadeLauncher(usHandItem))//usHandItem == GLAUNCHER || usHandItem == UNDER_GLAUNCHER ) else if ( Item[usHandItem].grenadelauncher )//usHandItem == GLAUNCHER || usHandItem == UNDER_GLAUNCHER )
{ {
GetAPChargeForShootOrStabWRTGunRaises( pSoldier, sTargetGridNo, TRUE, &fAddingTurningCost, &fAddingRaiseGunCost, pSoldier->aiData.bAimTime ); GetAPChargeForShootOrStabWRTGunRaises( pSoldier, sTargetGridNo, TRUE, &fAddingTurningCost, &fAddingRaiseGunCost, pSoldier->aiData.bAimTime );
usTurningCost = CalculateTurningCost(pSoldier, usHandItem, fAddingTurningCost); usTurningCost = CalculateTurningCost(pSoldier, usHandItem, fAddingTurningCost);
@@ -1960,7 +1960,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
if ( Item[ usHandItem ].ubCursor == INVALIDCURS ) if ( Item[ usHandItem ].ubCursor == INVALIDCURS )
{ {
// Found detonator... // Found detonator...
if ( HasAttachmentOfClass( &(pSoldier->inv[pSoldier->ubAttackingHand]), (AC_DETONATOR | AC_REMOTEDET | AC_DEFUSE) ) || ItemIsTripwire(usHandItem)) if ( HasAttachmentOfClass( &(pSoldier->inv[pSoldier->ubAttackingHand]), (AC_DETONATOR | AC_REMOTEDET | AC_DEFUSE) ) || Item[usHandItem].tripwire )
{ {
StartBombMessageBox( pSoldier, sGridNo ); StartBombMessageBox( pSoldier, sGridNo );
@@ -1980,7 +1980,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
void HandleSoldierDropBomb( SOLDIERTYPE *pSoldier, INT32 sGridNo ) void HandleSoldierDropBomb( SOLDIERTYPE *pSoldier, INT32 sGridNo )
{ {
// Does this have detonator that needs info? // Does this have detonator that needs info?
if ( HasAttachmentOfClass( &(pSoldier->inv[ HANDPOS ] ), (AC_DETONATOR | AC_REMOTEDET | AC_DEFUSE) ) || ItemIsTripwire((&(pSoldier->inv[ HANDPOS ] ))->usItem) ) if ( HasAttachmentOfClass( &(pSoldier->inv[ HANDPOS ] ), (AC_DETONATOR | AC_REMOTEDET | AC_DEFUSE) ) || Item[ (&(pSoldier->inv[ HANDPOS ] ))->usItem ].tripwire == 1)
{ {
StartBombMessageBox( pSoldier, sGridNo ); StartBombMessageBox( pSoldier, sGridNo );
} }
@@ -2003,7 +2003,7 @@ void HandleSoldierDropBomb( SOLDIERTYPE *pSoldier, INT32 sGridNo )
if ( iResult >= 0 ) if ( iResult >= 0 )
{ {
// Less explosives gain for placing tripwire // Less explosives gain for placing tripwire
if (ItemIsTripwire(pSoldier->inv[ HANDPOS ].usItem)) if ( Item[ pSoldier->inv[ HANDPOS ].usItem ].tripwire )
StatChange( pSoldier, EXPLODEAMT, 1, FALSE ); StatChange( pSoldier, EXPLODEAMT, 1, FALSE );
else if ( HasItemFlag( (pSoldier->inv[HANDPOS]).usItem, BEARTRAP ) ) else if ( HasItemFlag( (pSoldier->inv[HANDPOS]).usItem, BEARTRAP ) )
StatChange( pSoldier, MECHANAMT, 10, FALSE ); StatChange( pSoldier, MECHANAMT, 10, FALSE );
@@ -2027,7 +2027,7 @@ void HandleSoldierDropBomb( SOLDIERTYPE *pSoldier, INT32 sGridNo )
pSoldier->inv[ HANDPOS ][0]->data.bTrap++; pSoldier->inv[ HANDPOS ][0]->data.bTrap++;
// anv: additional tile properties - modify trap level depending on its placement // anv: additional tile properties - modify trap level depending on its placement
if(gGameExternalOptions.fAdditionalTileProperties && !ItemIsTripwire(pSoldier->inv[ HANDPOS ].usItem)) if(gGameExternalOptions.fAdditionalTileProperties && Item[ pSoldier->inv[ HANDPOS ].usItem ].tripwire != 1 )
{ {
ADDITIONAL_TILE_PROPERTIES_VALUES zAllTileValues = GetAllAdditonalTilePropertiesForGrid( sGridNo, pSoldier->pathing.bLevel ); ADDITIONAL_TILE_PROPERTIES_VALUES zAllTileValues = GetAllAdditonalTilePropertiesForGrid( sGridNo, pSoldier->pathing.bLevel );
pSoldier->inv[ HANDPOS ][0]->data.bTrap += zAllTileValues.bTrapBonus; pSoldier->inv[ HANDPOS ][0]->data.bTrap += zAllTileValues.bTrapBonus;
@@ -2072,7 +2072,7 @@ void HandleSoldierDropBomb( SOLDIERTYPE *pSoldier, INT32 sGridNo )
StatChange( pSoldier, EXPLODEAMT, 10, FROM_FAILURE ); StatChange( pSoldier, EXPLODEAMT, 10, FROM_FAILURE );
// oops! How badly did we screw up? // oops! How badly did we screw up?
if ( iResult < -20 && !ItemIsTripwire(pSoldier->inv[ HANDPOS ].usItem) ) if ( iResult < -20 && Item[ pSoldier->inv[ HANDPOS ].usItem ].tripwire != 1 )
{ {
// OOPS! ... BOOM! // OOPS! ... BOOM!
IgniteExplosion( NOBODY, pSoldier->sX, pSoldier->sY, (INT16) (gpWorldLevelData[pSoldier->sGridNo].sHeight), pSoldier->sGridNo, pSoldier->inv[ HANDPOS ].usItem, pSoldier->pathing.bLevel, pSoldier->ubDirection, &pSoldier->inv[ HANDPOS ] ); IgniteExplosion( NOBODY, pSoldier->sX, pSoldier->sY, (INT16) (gpWorldLevelData[pSoldier->sGridNo].sHeight), pSoldier->sGridNo, pSoldier->inv[ HANDPOS ].usItem, pSoldier->pathing.bLevel, pSoldier->ubDirection, &pSoldier->inv[ HANDPOS ] );
@@ -2576,7 +2576,7 @@ void SoldierGetItemFromWorld( SOLDIERTYPE *pSoldier, INT32 iItemIndex, INT32 sGr
if ( ItemExistsAtLocation( sGridNo, iItemIndex, pSoldier->pathing.bLevel ) ) if ( ItemExistsAtLocation( sGridNo, iItemIndex, pSoldier->pathing.bLevel ) )
{ {
// Flugente: if item is tripwireactivated and is a planted bomb, call the defuse dialogue. We obviously know about the items' existence already... // Flugente: if item is tripwireactivated and is a planted bomb, call the defuse dialogue. We obviously know about the items' existence already...
if ( gWorldItems[ iItemIndex ].object.exists() && gWorldItems[ iItemIndex ].object.fFlags & OBJECT_ARMED_BOMB && ItemHasTripwireActivation(gWorldItems[ iItemIndex ].object.usItem) ) if ( gWorldItems[ iItemIndex ].object.exists() && gWorldItems[ iItemIndex ].object.fFlags & OBJECT_ARMED_BOMB && Item[gWorldItems[ iItemIndex ].object.usItem].tripwireactivation == 1 )
{ {
gpBoobyTrapItemPool = GetItemPoolForIndex( sGridNo, iItemIndex, pSoldier->pathing.bLevel ); gpBoobyTrapItemPool = GetItemPoolForIndex( sGridNo, iItemIndex, pSoldier->pathing.bLevel );
gpBoobyTrapSoldier = pSoldier; gpBoobyTrapSoldier = pSoldier;
@@ -2998,7 +2998,8 @@ OBJECTTYPE* InternalAddItemToPool( INT32 *psGridNo, OBJECTTYPE *pObject, INT8 bV
if ( TERRAIN_IS_WATER( bTerrainID) ) if ( TERRAIN_IS_WATER( bTerrainID) )
{ {
if (ItemSinks(pObject->usItem)) // if ( Item[ pObject->usItem ].fFlags & ITEM_SINKS )
if ( Item[ pObject->usItem ].sinks )
{ {
return( NULL ); return( NULL );
} }
@@ -3339,7 +3340,7 @@ BOOLEAN MarblesExistAtLocation( INT32 sGridNo, UINT8 ubLevel, INT32 * piItemInde
pItemPoolTemp = pItemPool; pItemPoolTemp = pItemPool;
while( pItemPoolTemp != NULL ) while( pItemPoolTemp != NULL )
{ {
if (ItemIsMarbles(gWorldItems[ pItemPoolTemp->iItemIndex ].object.usItem)) if ( Item[gWorldItems[ pItemPoolTemp->iItemIndex ].object.usItem].marbles )
{ {
if ( piItemIndex ) if ( piItemIndex )
{ {
@@ -5153,7 +5154,7 @@ void StartBombMessageBox( SOLDIERTYPE * pSoldier, INT32 sGridNo )
gpTempSoldier = pSoldier; gpTempSoldier = pSoldier;
gsTempGridNo = sGridNo; gsTempGridNo = sGridNo;
if (ItemIsRemoteTrigger(pSoldier->inv[HANDPOS].usItem)) if (Item[ pSoldier->inv[HANDPOS].usItem].remotetrigger )
{ {
wcscpy( gzUserDefinedButton[0], L"1" ); wcscpy( gzUserDefinedButton[0], L"1" );
wcscpy( gzUserDefinedButton[1], L"2" ); wcscpy( gzUserDefinedButton[1], L"2" );
@@ -5248,7 +5249,7 @@ void StartBombMessageBox( SOLDIERTYPE * pSoldier, INT32 sGridNo )
{ {
DoMessageBox( MSG_BOX_BASIC_SMALL_BUTTONS, TacticalStr[ CHOOSE_REMOTE_FREQUENCY_STR ], GAME_SCREEN, MSG_BOX_FLAG_FOUR_NUMBERED_BUTTONS, BombMessageBoxCallBack, NULL ); DoMessageBox( MSG_BOX_BASIC_SMALL_BUTTONS, TacticalStr[ CHOOSE_REMOTE_FREQUENCY_STR ], GAME_SCREEN, MSG_BOX_FLAG_FOUR_NUMBERED_BUTTONS, BombMessageBoxCallBack, NULL );
} }
else if (ItemIsTripwire((&(pSoldier->inv[HANDPOS]))->usItem)) else if ( Item[ (&(pSoldier->inv[HANDPOS]))->usItem ].tripwire == 1 )
{ {
wcscpy( gzUserDefinedButton[0], L"1-A" ); wcscpy( gzUserDefinedButton[0], L"1-A" );
wcscpy( gzUserDefinedButton[1], L"1-B" ); wcscpy( gzUserDefinedButton[1], L"1-B" );
@@ -5572,10 +5573,10 @@ void BombMessageBoxCallBack( UINT8 ubExitValue )
if (gpTempSoldier) if (gpTempSoldier)
{ {
// sevenfm: remember last tripwire network settings // sevenfm: remember last tripwire network settings
if(ItemIsTripwire(gpTempSoldier->inv[HANDPOS].usItem)) if(Item[ gpTempSoldier->inv[HANDPOS].usItem ].tripwire )
gubLastTripwire = ubExitValue; gubLastTripwire = ubExitValue;
if (ItemIsRemoteTrigger(gpTempSoldier->inv[HANDPOS].usItem)) if (Item[ gpTempSoldier->inv[HANDPOS].usItem ].remotetrigger )
{ {
// Flugente: jamming can prevent bomb activation // Flugente: jamming can prevent bomb activation
if ( !gSkillTraitValues.fVOJammingBlocksRemoteBombs || !SectorJammed() ) if ( !gSkillTraitValues.fVOJammingBlocksRemoteBombs || !SectorJammed() )
@@ -5601,7 +5602,7 @@ void BombMessageBoxCallBack( UINT8 ubExitValue )
if ( iResult >= 0 ) if ( iResult >= 0 )
{ {
// Less explosives gain for placing tripwire // Less explosives gain for placing tripwire
if (ItemIsTripwire(gpTempSoldier->inv[ HANDPOS ].usItem)) if ( Item[ gpTempSoldier->inv[ HANDPOS ].usItem ].tripwire == 1 )
StatChange( gpTempSoldier, EXPLODEAMT, 5, FALSE ); StatChange( gpTempSoldier, EXPLODEAMT, 5, FALSE );
else if ( HasItemFlag( (gpTempSoldier->inv[HANDPOS]).usItem, BEARTRAP ) ) else if ( HasItemFlag( (gpTempSoldier->inv[HANDPOS]).usItem, BEARTRAP ) )
StatChange( gpTempSoldier, MECHANAMT, 10, FALSE ); StatChange( gpTempSoldier, MECHANAMT, 10, FALSE );
@@ -5642,7 +5643,7 @@ void BombMessageBoxCallBack( UINT8 ubExitValue )
else else
{ {
// we can't blow up tripwire, no matter how bad we fail // we can't blow up tripwire, no matter how bad we fail
if ( !ItemIsTripwire(gpTempSoldier->inv[ HANDPOS ].usItem)) if ( Item[ gpTempSoldier->inv[ HANDPOS ].usItem ].tripwire != 1 )
{ {
// OOPS! ... BOOM! // OOPS! ... BOOM!
IgniteExplosion( NOBODY, gpTempSoldier->sX, gpTempSoldier->sY, (INT16) (gpWorldLevelData[gpTempSoldier->sGridNo].sHeight), gpTempSoldier->sGridNo, gpTempSoldier->inv[ HANDPOS ].usItem, gpTempSoldier->pathing.bLevel, gpTempSoldier->ubDirection, &gpTempSoldier->inv[ HANDPOS ] ); IgniteExplosion( NOBODY, gpTempSoldier->sX, gpTempSoldier->sY, (INT16) (gpWorldLevelData[gpTempSoldier->sGridNo].sHeight), gpTempSoldier->sGridNo, gpTempSoldier->inv[ HANDPOS ].usItem, gpTempSoldier->pathing.bLevel, gpTempSoldier->ubDirection, &gpTempSoldier->inv[ HANDPOS ] );
@@ -5698,7 +5699,7 @@ void BombMessageBoxCallBack( UINT8 ubExitValue )
gTempObject[0]->data.ubDirection = gpTempSoldier->ubDirection; // Flugente: direction of bomb is direction of soldier gTempObject[0]->data.ubDirection = gpTempSoldier->ubDirection; // Flugente: direction of bomb is direction of soldier
// Flugente: tripwire was called through a messagebox, but has to be buried nevertheless // Flugente: tripwire was called through a messagebox, but has to be buried nevertheless
if (ItemIsTripwire((&gTempObject)->usItem)) if ( Item[ (&gTempObject)->usItem ].tripwire == 1 )
{ {
AddItemToPool( gsTempGridNo, &gTempObject, BURIED, gpTempSoldier->pathing.bLevel, WORLD_ITEM_ARMED_BOMB, 0 ); AddItemToPool( gsTempGridNo, &gTempObject, BURIED, gpTempSoldier->pathing.bLevel, WORLD_ITEM_ARMED_BOMB, 0 );
// sevenfm: set flag only if planting tripwire // sevenfm: set flag only if planting tripwire
@@ -5838,7 +5839,7 @@ BOOLEAN HandItemWorks( SOLDIERTYPE *pSoldier, INT8 bSlot )
// shape to be usable, and doesn't break during use. // shape to be usable, and doesn't break during use.
// Exception: land mines. You can bury them broken, they just won't blow! // Exception: land mines. You can bury them broken, they just won't blow!
// if ( (Item[ pObj->usItem ].fFlags & ITEM_DAMAGEABLE) && (pObj->usItem != MINE) && (Item[ pObj->usItem ].usItemClass != IC_MEDKIT) && pObj->usItem != GAS_CAN ) // if ( (Item[ pObj->usItem ].fFlags & ITEM_DAMAGEABLE) && (pObj->usItem != MINE) && (Item[ pObj->usItem ].usItemClass != IC_MEDKIT) && pObj->usItem != GAS_CAN )
if (ItemIsDamageable(pObj->usItem) && !ItemIsMine(pObj->usItem) && (Item[pObj->usItem].usItemClass != IC_MEDKIT) && !ItemIsGascan(pObj->usItem) && !IsStructureConstructItem( pObj->usItem, pSoldier->sGridNo, NULL ) ) if ( Item[pObj->usItem].damageable && !Item[pObj->usItem].mine && (Item[pObj->usItem].usItemClass != IC_MEDKIT) && !Item[pObj->usItem].gascan && !IsStructureConstructItem( pObj->usItem, pSoldier->sGridNo, NULL ) )
{ {
// if it's still usable, check whether it breaks // if it's still usable, check whether it breaks
if ( (*pObj)[0]->data.objectStatus >= USABLE) if ( (*pObj)[0]->data.objectStatus >= USABLE)
@@ -6102,7 +6103,7 @@ void BoobyTrapMessageBoxCallBack( UINT8 ubExitValue )
CreateItem(gTempObject[0]->data.misc.usBombItem, gTempObject[0]->data.misc.bBombStatus, &TempObject); CreateItem(gTempObject[0]->data.misc.usBombItem, gTempObject[0]->data.misc.bBombStatus, &TempObject);
// also spawn attached guns/explosives // also spawn attached guns/explosives
if (gTempObject.usItem != ACTION_ITEM && (ItemIsTripwire(gTempObject.usItem) || Item[gTempObject.usItem].usItemClass & IC_EXPLOSV)) if (gTempObject.usItem != ACTION_ITEM && (Item[gTempObject.usItem].tripwire || Item[gTempObject.usItem].usItemClass & IC_EXPLOSV))
{ {
// search for attached items // search for attached items
OBJECTTYPE* pAttItem = NULL; OBJECTTYPE* pAttItem = NULL;
@@ -6989,7 +6990,7 @@ INT32 FindNearestAvailableGridNoForItem( INT32 sSweetGridNo, INT8 ubRadius )
BOOLEAN CanPlayerUseRocketRifle( SOLDIERTYPE *pSoldier, BOOLEAN fDisplay ) BOOLEAN CanPlayerUseRocketRifle( SOLDIERTYPE *pSoldier, BOOLEAN fDisplay )
{ {
if (ItemHasFingerPrintID(pSoldier->inv[ pSoldier->ubAttackingHand ].usItem)) if ( Item[pSoldier->inv[ pSoldier->ubAttackingHand ].usItem].fingerprintid )
{ {
// check imprint ID // check imprint ID
// NB not-imprinted value is NO_PROFILE // NB not-imprinted value is NO_PROFILE
@@ -7041,7 +7042,7 @@ UINT8 StealItems(SOLDIERTYPE* pSoldier,SOLDIERTYPE* pOpponent, UINT8* ubIndexRet
fStealItem = FALSE; fStealItem = FALSE;
pObject=&pOpponent->inv[i]; pObject=&pOpponent->inv[i];
if ((pObject->exists() == true) && !ItemIsUndroppableByDefault(pObject->usItem)) // CHECK! Undroppable items cannot be stolen - SANDRO if ((pObject->exists() == true) && !(Item[pObject->usItem].defaultundroppable )) // CHECK! Undroppable items cannot be stolen - SANDRO
{ {
// Is the enemy collapsed // Is the enemy collapsed
if ( pOpponent->stats.bLife < OKLIFE || pOpponent->bCollapsed ) if ( pOpponent->stats.bLife < OKLIFE || pOpponent->bCollapsed )
@@ -9854,7 +9855,7 @@ void ReadEquipmentTable( SOLDIERTYPE* pSoldier, std::string name )
} }
} }
// if we want to equip a two-handed item in our first hand, also drop whatever we have in the second hand // if we want to equip a two-handed item in our first hand, also drop whatever we have in the second hand
else if ( node.slot == HANDPOS && ItemIsTwoHanded(node.item) && pSoldier->inv[SECONDHANDPOS].exists( ) ) else if ( node.slot == HANDPOS && Item[node.item].twohanded && pSoldier->inv[SECONDHANDPOS].exists( ) )
{ {
AutoPlaceObjectInInventoryStash( &pSoldier->inv[SECONDHANDPOS], pSoldier->sGridNo, pSoldier->pathing.bLevel ); AutoPlaceObjectInInventoryStash( &pSoldier->inv[SECONDHANDPOS], pSoldier->sGridNo, pSoldier->pathing.bLevel );
DeleteObj( &pSoldier->inv[SECONDHANDPOS] ); DeleteObj( &pSoldier->inv[SECONDHANDPOS] );
@@ -10267,7 +10268,7 @@ void ReadEquipmentTable( SOLDIERTYPE* pSoldier, std::string name )
} }
// if there is water in this sector, refill canteens // if there is water in this sector, refill canteens
if ( refillwaterfromsector && ItemIsCanteen(pSoldier->inv[slot].usItem) && Food[Item[(pSoldier->inv[slot]).usItem].foodtype].bDrinkPoints > 0 ) if ( refillwaterfromsector && Item[(pSoldier->inv[slot]).usItem].canteen && Food[Item[(pSoldier->inv[slot]).usItem].foodtype].bDrinkPoints > 0 )
{ {
OBJECTTYPE* pObj = &(pSoldier->inv[slot]); OBJECTTYPE* pObj = &(pSoldier->inv[slot]);
+9 -10
View File
@@ -2988,12 +2988,11 @@ UINT32 UIHandleCAMercShoot( UI_EVENT *pUIEvent )
if ( pTSoldier != NULL ) if ( pTSoldier != NULL )
{ {
// If this is one of our own guys.....pop up requiester... // If this is one of our own guys.....pop up requiester...
UINT16 usItem = pSoldier->inv[HANDPOS].usItem;
if ( ( pTSoldier->bTeam == gbPlayerNum || pTSoldier->bTeam == MILITIA_TEAM ) if ( ( pTSoldier->bTeam == gbPlayerNum || pTSoldier->bTeam == MILITIA_TEAM )
&& Item[ usItem ].usItemClass != IC_MEDKIT && Item[ pSoldier->inv[ HANDPOS ].usItem ].usItemClass != IC_MEDKIT
&& !ItemIsGascan(usItem) && !Item[pSoldier->inv[ HANDPOS ].usItem].gascan
&& !ItemIsToolkit(usItem) && !Item[pSoldier->inv[HANDPOS].usItem].toolkit
&& !ItemCanBeAppliedToOthers( usItem ) && !ItemCanBeAppliedToOthers( pSoldier->inv[ HANDPOS ].usItem )
&& gTacticalStatus.ubLastRequesterTargetID != pTSoldier->ubProfile && gTacticalStatus.ubLastRequesterTargetID != pTSoldier->ubProfile
&& ( pTSoldier->ubID != pSoldier->ubID ) ) && ( pTSoldier->ubID != pSoldier->ubID ) )
{ {
@@ -3011,7 +3010,7 @@ UINT32 UIHandleCAMercShoot( UI_EVENT *pUIEvent )
} }
//////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////
// SANDRO - Should we ask if we really want to do the surgery? // SANDRO - Should we ask if we really want to do the surgery?
else if (ItemIsMedicalKit(usItem) && (NUM_SKILL_TRAITS( pSoldier, DOCTOR_NT ) >= gSkillTraitValues.ubDONumberTraitsNeededForSurgery) else if (Item[ pSoldier->inv[ HANDPOS ].usItem ].medicalkit && (NUM_SKILL_TRAITS( pSoldier, DOCTOR_NT ) >= gSkillTraitValues.ubDONumberTraitsNeededForSurgery)
&& (pTSoldier->bTeam == OUR_TEAM || pTSoldier->bTeam == MILITIA_TEAM) && (pTSoldier->bTeam == OUR_TEAM || pTSoldier->bTeam == MILITIA_TEAM)
&& (IS_MERC_BODY_TYPE( pTSoldier ) || IS_CIV_BODY_TYPE( pTSoldier )) && (IS_MERC_BODY_TYPE( pTSoldier ) || IS_CIV_BODY_TYPE( pTSoldier ))
&& gGameOptions.fNewTraitSystem && pTSoldier->iHealableInjury >= 100 && gGameOptions.fNewTraitSystem && pTSoldier->iHealableInjury >= 100
@@ -3895,7 +3894,7 @@ void UIHandleSoldierStanceChange( UINT8 ubSoldierID, INT8 bNewStance )
gGameExternalOptions.ubAllowAlternativeWeaponHolding && gGameExternalOptions.ubAllowAlternativeWeaponHolding &&
pSoldier->inv[HANDPOS].exists() && pSoldier->inv[HANDPOS].exists() &&
Weapon[pSoldier->inv[HANDPOS].usItem].HeavyGun && Weapon[pSoldier->inv[HANDPOS].usItem].HeavyGun &&
ItemIsTwoHanded(pSoldier->inv[HANDPOS].usItem) && Item[pSoldier->inv[HANDPOS].usItem].twohanded &&
bNewStance == ANIM_STAND) bNewStance == ANIM_STAND)
{ {
ChangeScopeMode(pSoldier, NOWHERE); ChangeScopeMode(pSoldier, NOWHERE);
@@ -3938,7 +3937,7 @@ void UIHandleSoldierStanceChange( UINT8 ubSoldierID, INT8 bNewStance )
gGameExternalOptions.ubAllowAlternativeWeaponHolding && gGameExternalOptions.ubAllowAlternativeWeaponHolding &&
pSoldier->inv[HANDPOS].exists() && pSoldier->inv[HANDPOS].exists() &&
Weapon[pSoldier->inv[HANDPOS].usItem].HeavyGun && Weapon[pSoldier->inv[HANDPOS].usItem].HeavyGun &&
ItemIsTwoHanded(pSoldier->inv[HANDPOS].usItem) && Item[pSoldier->inv[HANDPOS].usItem].twohanded &&
bNewStance == ANIM_STAND) bNewStance == ANIM_STAND)
{ {
ChangeScopeMode(pSoldier, NOWHERE); ChangeScopeMode(pSoldier, NOWHERE);
@@ -4629,7 +4628,7 @@ INT8 DrawUIMovementPath( SOLDIERTYPE *pSoldier, INT32 usMapPos, UINT32 uiFlags )
} }
else if ( uiFlags == MOVEUI_TARGET_BOMB ) else if ( uiFlags == MOVEUI_TARGET_BOMB )
{ {
if(ItemIsMine(pSoldier->inv[HANDPOS].usItem)) if(Item[pSoldier->inv[HANDPOS].usItem].mine == 1)
sAPCost += GetAPsToPlantMine( pSoldier ); sAPCost += GetAPsToPlantMine( pSoldier );
else else
sAPCost += GetAPsToDropBomb( pSoldier ); sAPCost += GetAPsToDropBomb( pSoldier );
@@ -5015,7 +5014,7 @@ BOOLEAN UIMouseOnValidAttackLocation( SOLDIERTYPE *pSoldier )
} }
// SANDRO - doctor with medical bag trying to do the surgery // SANDRO - doctor with medical bag trying to do the surgery
if ((NUM_SKILL_TRAITS( pSoldier, DOCTOR_NT ) >= gSkillTraitValues.ubDONumberTraitsNeededForSurgery) && ItemIsMedicalKit(pSoldier->inv[ HANDPOS ].usItem) && gGameOptions.fNewTraitSystem if ((NUM_SKILL_TRAITS( pSoldier, DOCTOR_NT ) >= gSkillTraitValues.ubDONumberTraitsNeededForSurgery) && Item[pSoldier->inv[ HANDPOS ].usItem].medicalkit && gGameOptions.fNewTraitSystem
&& (pTSoldier->stats.bLife != pTSoldier->stats.bLifeMax) && (pTSoldier->iHealableInjury >= 100)) && (pTSoldier->stats.bLife != pTSoldier->stats.bLifeMax) && (pTSoldier->iHealableInjury >= 100))
{ {
// should come a question first if you really want to do the surgery // should come a question first if you really want to do the surgery
+2 -3
View File
@@ -2353,8 +2353,7 @@ void HandleNPCDoAction( UINT8 ubTargetNPC, UINT16 usActionCode, UINT8 ubQuoteNum
break; break;
case NPC_ACTION_HAVE_PACOS_FOLLOW: case NPC_ACTION_HAVE_PACOS_FOLLOW:
pSoldier = FindSoldierByProfileID( 114, FALSE ); pSoldier = FindSoldierByProfileID( 114, FALSE );
sGridNo = 8537; //dnl!!! sGridNo = 18193; //dnl!!!
//kitty: changed gridno from 18193 to 8537, that's at entrance door to rebel basement, where Fatima and Dimitri dialogue happens
if (pSoldier) if (pSoldier)
{ {
if (NewOKDestination( pSoldier, sGridNo, TRUE, 0 ) ) if (NewOKDestination( pSoldier, sGridNo, TRUE, 0 ) )
@@ -4332,7 +4331,7 @@ void HandleNPCDoAction( UINT8 ubTargetNPC, UINT16 usActionCode, UINT8 ubQuoteNum
case NPC_ACTION_PUT_PACOS_IN_BASEMENT: case NPC_ACTION_PUT_PACOS_IN_BASEMENT:
gMercProfiles[ PACOS ].sSectorX = 10; gMercProfiles[ PACOS ].sSectorX = 10;
gMercProfiles[ PACOS ].sSectorY = MAP_ROW_A; gMercProfiles[ PACOS ].sSectorY = MAP_ROW_A;
gMercProfiles[ PACOS ].bSectorZ = 1; //kitty: fixed - first level underground is 1, not 0 gMercProfiles[ PACOS ].bSectorZ = 0;
break; break;
case NPC_ACTION_HISTORY_ASSASSIN: case NPC_ACTION_HISTORY_ASSASSIN:
AddHistoryToPlayersLog( HISTORY_ASSASSIN, 0, GetWorldTotalMin(), gWorldSectorX, gWorldSectorY ); AddHistoryToPlayersLog( HISTORY_ASSASSIN, 0, GetWorldTotalMin(), gWorldSectorX, gWorldSectorY );
File diff suppressed because it is too large Load Diff
+94 -214
View File
@@ -57,6 +57,7 @@
#include "game clock.h" #include "game clock.h"
#include "squads.h" #include "squads.h"
#include "MessageBoxScreen.h" #include "MessageBoxScreen.h"
#include "Language Defines.h"
#include "GameSettings.h" #include "GameSettings.h"
#include "Map Screen Interface Map Inventory.h" #include "Map Screen Interface Map Inventory.h"
#include "Quests.h" #include "Quests.h"
@@ -82,7 +83,6 @@
#include "Sound Control.h" #include "Sound Control.h"
#include "Multi Language Graphic Utils.h" #include "Multi Language Graphic Utils.h"
#include <language.hpp>
#ifdef JA2UB #ifdef JA2UB
#include "Ja25_Tactical.h" #include "Ja25_Tactical.h"
@@ -168,7 +168,7 @@ INT16 ITEMDESC_DONE_Y;
#define DOTDOTDOT L"..." #define DOTDOTDOT L"..."
#define COMMA_AND_SPACE L", " #define COMMA_AND_SPACE L", "
#define ITEM_PROS_AND_CONS( usItem ) ( ( Item[ usItem ].usItemClass & IC_GUN && !ItemIsRocketLauncher(usItem) ) ) #define ITEM_PROS_AND_CONS( usItem ) ( ( Item[ usItem ].usItemClass & IC_GUN && !Item[ usItem ].rocketlauncher ) )
#define ITEMDESC_ITEM_STATUS_WIDTH 2 #define ITEMDESC_ITEM_STATUS_WIDTH 2
#define ITEMDESC_ITEM_WIDTH 117 #define ITEMDESC_ITEM_WIDTH 117
@@ -2666,7 +2666,7 @@ void INVRenderINVPanelItem( SOLDIERTYPE *pSoldier, INT16 sPocket, UINT8 fDirtyLe
} }
// IF it's the second hand and this hand cannot contain anything, remove the second hand position graphic // IF it's the second hand and this hand cannot contain anything, remove the second hand position graphic
if (sPocket == SECONDHANDPOS && ItemIsTwoHanded(pSoldier->inv[HANDPOS].usItem)) if (sPocket == SECONDHANDPOS && Item[pSoldier->inv[HANDPOS].usItem].twohanded )
{ {
// CHRISL: Change coords for STI that covers 2nd hand location when carrying a 2handed weapon // CHRISL: Change coords for STI that covers 2nd hand location when carrying a 2handed weapon
if( guiCurrentItemDescriptionScreen != MAP_SCREEN ) if( guiCurrentItemDescriptionScreen != MAP_SCREEN )
@@ -2710,7 +2710,7 @@ void INVRenderINVPanelItem( SOLDIERTYPE *pSoldier, INT16 sPocket, UINT8 fDirtyLe
fHatchItOut = TRUE; fHatchItOut = TRUE;
} }
// CHRISL: Don't hatch second hand position if we're holding a two handed item // CHRISL: Don't hatch second hand position if we're holding a two handed item
else if ( sPocket == SECONDHANDPOS && ItemIsTwoHanded(pSoldier->inv[HANDPOS].usItem) ) else if ( sPocket == SECONDHANDPOS && Item[pSoldier->inv[HANDPOS].usItem].twohanded )
{ {
fHatchItOut = FALSE; fHatchItOut = FALSE;
} }
@@ -2832,8 +2832,8 @@ BOOLEAN CompatibleItemForApplyingOnMerc(OBJECTTYPE *pTestObject)
//Shadooow: rewritten to use new item flags and check canteen not empty //Shadooow: rewritten to use new item flags and check canteen not empty
if (((HasItemFlag(usItem, CAMO_REMOVAL) && gGameExternalOptions.fCamoRemoving) || ItemIsCamoKit(usItem) || usItem == JAR_ELIXIR || if (((HasItemFlag(usItem, CAMO_REMOVAL) && gGameExternalOptions.fCamoRemoving) || Item[usItem].camouflagekit || usItem == JAR_ELIXIR ||
Item[usItem].clothestype || Item[usItem].drugtype || Item[usItem].foodtype) && (!ItemIsCanteen(usItem) || (*pTestObject)[0]->data.objectStatus > 1)) Item[usItem].clothestype || Item[usItem].drugtype || Item[usItem].foodtype) && (!Item[usItem].canteen || (*pTestObject)[0]->data.objectStatus > 1))
{ {
return( TRUE ); return( TRUE );
} }
@@ -3010,14 +3010,14 @@ BOOLEAN HandleCompatibleAmmoUIForMapScreen( SOLDIERTYPE *pSoldier, INT32 bInvPos
UINT32 invsize = pSoldier->inv.size(); UINT32 invsize = pSoldier->inv.size();
// First test attachments, which almost any type of item can have.... // First test attachments, which almost any type of item can have....
if ( !(ItemIsHiddenAddon(pTestObject->usItem)) ) if ( !(Item[ pTestObject->usItem ].hiddenaddon ) )
{ {
for ( cnt = 0; cnt < invsize; ++cnt ) for ( cnt = 0; cnt < invsize; ++cnt )
{ {
pObject = &(pSoldier->inv[ cnt ]); pObject = &(pSoldier->inv[ cnt ]);
if (pObject == pTestObject || ItemIsHiddenAddon(pObject->usItem) || (!ItemIsAttachment(pObject->usItem) && if (pObject == pTestObject || Item[pObject->usItem].hiddenaddon || (!Item[pObject->usItem].attachment &&
!Item[pObject->usItem].attachmentclass && !Item[pObject->usItem].nasAttachmentClass && !ItemIsAttachment(pTestObject->usItem) && !Item[pObject->usItem].attachmentclass && !Item[pObject->usItem].nasAttachmentClass && !Item[pTestObject->usItem].attachment &&
!Item[pTestObject->usItem].attachmentclass && !Item[pTestObject->usItem].nasAttachmentClass)) !Item[pTestObject->usItem].attachmentclass && !Item[pTestObject->usItem].nasAttachmentClass))
{ {
// don't consider for UI purposes // don't consider for UI purposes
@@ -3116,14 +3116,14 @@ BOOLEAN HandleCompatibleAmmoUIForMapInventory(SOLDIERTYPE *pSoldier, INT32 bInvP
} }
// First test attachments, which almost any type of item can have.... // First test attachments, which almost any type of item can have....
if (!(ItemIsHiddenAddon(pTestObject->usItem))) if (!(Item[pTestObject->usItem].hiddenaddon))
{ {
for (cnt = 0; cnt < MAP_INVENTORY_POOL_SLOT_COUNT; ++cnt) for (cnt = 0; cnt < MAP_INVENTORY_POOL_SLOT_COUNT; ++cnt)
{ {
pObject = &(pInventoryPoolList[iStartSlotNumber + cnt].object); pObject = &(pInventoryPoolList[iStartSlotNumber + cnt].object);
if (pObject == pTestObject || ItemIsHiddenAddon(pObject->usItem) || (!ItemIsAttachment(pObject->usItem) && if (pObject == pTestObject || Item[pObject->usItem].hiddenaddon || (!Item[pObject->usItem].attachment &&
!Item[pObject->usItem].attachmentclass && !Item[pObject->usItem].nasAttachmentClass && !ItemIsAttachment(pTestObject->usItem) && !Item[pObject->usItem].attachmentclass && !Item[pObject->usItem].nasAttachmentClass && !Item[pTestObject->usItem].attachment &&
!Item[pTestObject->usItem].attachmentclass && !Item[pTestObject->usItem].nasAttachmentClass)) !Item[pTestObject->usItem].attachmentclass && !Item[pTestObject->usItem].nasAttachmentClass))
{ {
// don't consider for UI purposes // don't consider for UI purposes
@@ -3270,14 +3270,14 @@ BOOLEAN InternalHandleCompatibleAmmoUI( SOLDIERTYPE *pSoldier, OBJECTTYPE *pTest
UINT32 invsize = pSoldier->inv.size(); UINT32 invsize = pSoldier->inv.size();
// First test attachments, which almost any type of item can have.... // First test attachments, which almost any type of item can have....
if (!(ItemIsHiddenAddon(pTestObject->usItem))) if (!(Item[pTestObject->usItem].hiddenaddon))
{ {
for (cnt = 0; cnt < invsize; ++cnt) for (cnt = 0; cnt < invsize; ++cnt)
{ {
pObject = &(pSoldier->inv[cnt]); pObject = &(pSoldier->inv[cnt]);
if (pObject == pTestObject || ItemIsHiddenAddon(pObject->usItem) || (!ItemIsAttachment(pObject->usItem) && if (pObject == pTestObject || Item[pObject->usItem].hiddenaddon || (!Item[pObject->usItem].attachment &&
!Item[pObject->usItem].attachmentclass && !Item[pObject->usItem].nasAttachmentClass && !ItemIsAttachment(pTestObject->usItem) && !Item[pObject->usItem].attachmentclass && !Item[pObject->usItem].nasAttachmentClass && !Item[pTestObject->usItem].attachment &&
!Item[pTestObject->usItem].attachmentclass && !Item[pTestObject->usItem].nasAttachmentClass)) !Item[pTestObject->usItem].attachmentclass && !Item[pTestObject->usItem].nasAttachmentClass))
{ {
// don't consider for UI purposes // don't consider for UI purposes
@@ -3302,7 +3302,7 @@ BOOLEAN InternalHandleCompatibleAmmoUI( SOLDIERTYPE *pSoldier, OBJECTTYPE *pTest
} }
} }
//if the test object is hidden addon or attachment, it won't be ammunition or gun so skip this //if the test object is hidden addon or attachment, it won't be ammunition or gun so skip this
if (!ItemIsHiddenAddon(pTestObject->usItem) && !ItemIsAttachment(pTestObject->usItem)) if (!Item[pTestObject->usItem].hiddenaddon && !Item[pTestObject->usItem].attachment)
{ {
if( ( Item [ pTestObject->usItem ].usItemClass & IC_GUN ) ) if( ( Item [ pTestObject->usItem ].usItemClass & IC_GUN ) )
{ {
@@ -3816,7 +3816,7 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec
} }
} }
if ( pItem->usItemClass == IC_GUN && !ItemIsRocketLauncher(pObject->usItem) ) if ( pItem->usItemClass == IC_GUN && !Item[pObject->usItem].rocketlauncher )
{ {
sNewY = sY + sHeight - 10; sNewY = sY + sHeight - 10;
sNewX = sX + 1; sNewX = sX + 1;
@@ -3872,7 +3872,7 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec
} }
} }
if ( pItemShown->usItemClass == IC_GUN && !ItemIsRocketLauncher(pObjShown->usItem) ) if ( pItemShown->usItemClass == IC_GUN && !Item[pObjShown->usItem].rocketlauncher )
{ {
SetRGBFontForeground( AmmoTypes[( *pObjShown )[iter]->data.gun.ubGunAmmoType].red, SetRGBFontForeground( AmmoTypes[( *pObjShown )[iter]->data.gun.ubGunAmmoType].red,
AmmoTypes[( *pObjShown )[iter]->data.gun.ubGunAmmoType].green, AmmoTypes[( *pObjShown )[iter]->data.gun.ubGunAmmoType].green,
@@ -3950,7 +3950,7 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec
} }
// Flugente: overheating // Flugente: overheating
if ( gGameExternalOptions.fWeaponOverheating && ( pItem->usItemClass & (IC_GUN | IC_LAUNCHER) || ItemIsBarrel(pObject->usItem)) ) if ( gGameExternalOptions.fWeaponOverheating && ( pItem->usItemClass & (IC_GUN | IC_LAUNCHER) || Item[pObject->usItem].barrel ) )
{ {
OBJECTTYPE* pObjShown = pObject; OBJECTTYPE* pObjShown = pObject;
@@ -4201,7 +4201,7 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec
} }
if ( ( ( pSoldier->bWeaponMode == WM_ATTACHED_GL || pSoldier->bWeaponMode == WM_ATTACHED_GL_BURST || pSoldier->bWeaponMode == WM_ATTACHED_GL_AUTO ) || if ( ( ( pSoldier->bWeaponMode == WM_ATTACHED_GL || pSoldier->bWeaponMode == WM_ATTACHED_GL_BURST || pSoldier->bWeaponMode == WM_ATTACHED_GL_AUTO ) ||
( Item[pSoldier->inv[HANDPOS].usItem].usItemClass & IC_LAUNCHER && !ItemIsRocketLauncher(pSoldier->inv[HANDPOS].usItem)) ) && ( Item[pSoldier->inv[HANDPOS].usItem].usItemClass & IC_LAUNCHER && !Item[pSoldier->inv[HANDPOS].usItem].rocketlauncher ) ) &&
pSoldier->usGLDelayMode ) pSoldier->usGLDelayMode )
{ {
wcscat( pStr, New113Message[MSG113_FIREMODE_GL_DELAYED] ); wcscat( pStr, New113Message[MSG113_FIREMODE_GL_DELAYED] );
@@ -4231,7 +4231,7 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec
if ( pSoldier && pObject == &(pSoldier->inv[SECONDHANDPOS] ) && if ( pSoldier && pObject == &(pSoldier->inv[SECONDHANDPOS] ) &&
(pSoldier->bWeaponMode == WM_BURST || pSoldier->bWeaponMode == WM_AUTOFIRE) && (pSoldier->bWeaponMode == WM_BURST || pSoldier->bWeaponMode == WM_AUTOFIRE) &&
Item[pSoldier->inv[HANDPOS].usItem].usItemClass & IC_GUN && Item[pSoldier->inv[HANDPOS].usItem].usItemClass & IC_GUN &&
!ItemIsTwoHanded(pSoldier->inv[HANDPOS].usItem) && !(Item[ pSoldier->inv[HANDPOS ].usItem ].twohanded ) &&
pSoldier->IsValidSecondHandBurst() ) pSoldier->IsValidSecondHandBurst() )
{ {
sNewY = sY + 13; // rather arbitrary sNewY = sY + 13; // rather arbitrary
@@ -4565,7 +4565,7 @@ void MAPINVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pOb
} }
//////////////////// GUN DATA ////////////////// //////////////////// GUN DATA //////////////////
if ( pItem->usItemClass & IC_GUN && !ItemIsRocketLauncher(pObject->usItem) ) if ( pItem->usItemClass & IC_GUN && !Item[pObject->usItem].rocketlauncher )
{ {
//////////////// AMMO REMAINING //////////////// AMMO REMAINING
@@ -4804,7 +4804,7 @@ void MAPINVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pOb
} }
iCurAsterisk = ATTACHMENT_GENERAL; iCurAsterisk = ATTACHMENT_GENERAL;
if (ItemIsGrenadeLauncher(iter->usItem)) if (Item[iter->usItem].grenadelauncher )
{ {
//iCurAsterisk = ATTACHMENT_GL; //iCurAsterisk = ATTACHMENT_GL;
uiNumAttachmentsGL++; uiNumAttachmentsGL++;
@@ -5233,7 +5233,7 @@ BOOLEAN InternalInitItemDescriptionBox( OBJECTTYPE *pObject, INT16 sX, INT16 sY,
} }
// Add ammo eject button for GUN type objects. // Add ammo eject button for GUN type objects.
if ( (Item[ pObject->usItem ].usItemClass & IC_GUN) && !ItemIsRocketLauncher(pObject->usItem) ) if ( (Item[ pObject->usItem ].usItemClass & IC_GUN) && !Item[pObject->usItem].rocketlauncher )
{ {
if ( GetMagSize(gpItemDescObject) <= 99 ) if ( GetMagSize(gpItemDescObject) <= 99 )
{ {
@@ -5610,7 +5610,7 @@ BOOLEAN InternalInitItemDescriptionBox( OBJECTTYPE *pObject, INT16 sX, INT16 sY,
} }
// if ( !(Item[ pObject->usItem ].fFlags & ITEM_HIDDEN_ADDON) && ( ValidAttachment( gpItemPointer->usItem, pObject->usItem ) || ValidLaunchable( gpItemPointer->usItem, pObject->usItem ) || ValidMerge( gpItemPointer->usItem, pObject->usItem ) ) ) // if ( !(Item[ pObject->usItem ].fFlags & ITEM_HIDDEN_ADDON) && ( ValidAttachment( gpItemPointer->usItem, pObject->usItem ) || ValidLaunchable( gpItemPointer->usItem, pObject->usItem ) || ValidMerge( gpItemPointer->usItem, pObject->usItem ) ) )
if ( !(ItemIsHiddenAddon(pObject->usItem)) && ( ValidAttachment( gpItemPointer->usItem, pObject ) || ValidLaunchable( gpItemPointer->usItem, pObject->usItem ) || ValidMerge( gpItemPointer->usItem, pObject->usItem ) ) ) if ( !(Item[ pObject->usItem ].hiddenaddon ) && ( ValidAttachment( gpItemPointer->usItem, pObject ) || ValidLaunchable( gpItemPointer->usItem, pObject->usItem ) || ValidMerge( gpItemPointer->usItem, pObject->usItem ) ) )
{ {
SetUpFastHelpListRegions( SetUpFastHelpListRegions(
gItemDescHelpText.iXPosition, gItemDescHelpText.iXPosition,
@@ -5750,7 +5750,7 @@ void UpdateAttachmentTooltips(OBJECTTYPE *pObject, UINT8 ubStatusIndex)
if (Item[usLoop].nasAttachmentClass & AttachmentSlots[usLoopSlotID].nasAttachmentClass && IsAttachmentPointAvailable(point, usLoop, TRUE)) if (Item[usLoop].nasAttachmentClass & AttachmentSlots[usLoopSlotID].nasAttachmentClass && IsAttachmentPointAvailable(point, usLoop, TRUE))
{ {
usAttachment = usLoop; usAttachment = usLoop;
if (!ItemIsHiddenAddon(usAttachment) && !ItemIsHiddenAttachment(usAttachment) && ItemIsLegal(usAttachment)) if (!Item[usAttachment].hiddenaddon && !Item[usAttachment].hiddenattachment && ItemIsLegal(usAttachment))
{ {
if (std::find(attachList.begin(), attachList.end(), usAttachment) == attachList.end()) if (std::find(attachList.begin(), attachList.end(), usAttachment) == attachList.end())
{ {
@@ -5786,7 +5786,7 @@ void UpdateAttachmentTooltips(OBJECTTYPE *pObject, UINT8 ubStatusIndex)
} }
} }
if (usAttachment > 0 && !ItemIsHiddenAddon(usAttachment) && !ItemIsHiddenAttachment(usAttachment) && ItemIsLegal(usAttachment)) if (usAttachment > 0 && !Item[usAttachment].hiddenaddon && !Item[usAttachment].hiddenattachment && ItemIsLegal(usAttachment))
{ {
if (std::find(attachList.begin(), attachList.end(), usAttachment) == attachList.end()) if (std::find(attachList.begin(), attachList.end(), usAttachment) == attachList.end())
{ {
@@ -5822,7 +5822,7 @@ void UpdateAttachmentTooltips(OBJECTTYPE *pObject, UINT8 ubStatusIndex)
} }
} }
if (usAttachment > 0 && !ItemIsHiddenAddon(usAttachment) && !ItemIsHiddenAttachment(usAttachment) && ItemIsLegal(usAttachment)) if (usAttachment > 0 && !Item[usAttachment].hiddenaddon && !Item[usAttachment].hiddenattachment && ItemIsLegal(usAttachment))
{ {
if (std::find(attachList.begin(), attachList.end(), usAttachment) == attachList.end()) if (std::find(attachList.begin(), attachList.end(), usAttachment) == attachList.end())
{ {
@@ -5895,7 +5895,7 @@ void UpdateAttachmentTooltips(OBJECTTYPE *pObject, UINT8 ubStatusIndex)
for(UINT16 loop = 0; loop < attachList.size(); loop++){ for(UINT16 loop = 0; loop < attachList.size(); loop++){
usAttachment = attachList[loop]; usAttachment = attachList[loop];
// If the attachment is not hidden // If the attachment is not hidden
if (usAttachment > 0 && !ItemIsHiddenAddon(usAttachment) && !ItemIsHiddenAttachment(usAttachment)) if (usAttachment > 0 && !Item[ usAttachment ].hiddenaddon && !Item[ usAttachment ].hiddenattachment)
{ {
if (wcslen( attachStr3 ) + wcslen(Item[usAttachment].szItemName) > 3600) if (wcslen( attachStr3 ) + wcslen(Item[usAttachment].szItemName) > 3600)
{ {
@@ -7021,7 +7021,8 @@ void RenderItemDescriptionBox( )
//WarmSteel - This hatches out attachment slots one by one, instead of all of em. //WarmSteel - This hatches out attachment slots one by one, instead of all of em.
for(cnt = 0; cnt < (INT32)(*gpItemDescObject)[gubItemDescStatusIndex]->attachments.size(); cnt++) for(cnt = 0; cnt < (INT32)(*gpItemDescObject)[gubItemDescStatusIndex]->attachments.size(); cnt++)
{ {
if (ItemIsHiddenAddon(gpItemPointer->usItem) || //if ( ( Item[ gpItemPointer->usItem ].fFlags & ITEM_HIDDEN_ADDON ) ||
if ( ( Item[ gpItemPointer->usItem ].hiddenaddon ) ||
( !ValidItemAttachmentSlot( gpItemDescObject, gpItemPointer->usItem, FALSE, FALSE, gubItemDescStatusIndex, cnt, FALSE, NULL, usAttachmentSlotIndexVector) && ( !ValidItemAttachmentSlot( gpItemDescObject, gpItemPointer->usItem, FALSE, FALSE, gubItemDescStatusIndex, cnt, FALSE, NULL, usAttachmentSlotIndexVector) &&
!ValidMerge( gpItemPointer->usItem, gpItemDescObject->usItem ) ) ) !ValidMerge( gpItemPointer->usItem, gpItemDescObject->usItem ) ) )
@@ -7037,7 +7038,8 @@ void RenderItemDescriptionBox( )
} else { } else {
for(cnt = 0; cnt < OLD_MAX_ATTACHMENTS_101; cnt++) for(cnt = 0; cnt < OLD_MAX_ATTACHMENTS_101; cnt++)
{ {
if (ItemIsHiddenAddon(gpItemPointer->usItem) || //if ( ( Item[ gpItemPointer->usItem ].fFlags & ITEM_HIDDEN_ADDON ) ||
if ( ( Item[ gpItemPointer->usItem ].hiddenaddon ) ||
( !ValidItemAttachment( gpItemDescObject, gpItemPointer->usItem, FALSE, FALSE, gubItemDescStatusIndex, usAttachmentSlotIndexVector) && ( !ValidItemAttachment( gpItemDescObject, gpItemPointer->usItem, FALSE, FALSE, gubItemDescStatusIndex, usAttachmentSlotIndexVector) &&
!ValidMerge( gpItemPointer->usItem, gpItemDescObject->usItem ) && !ValidLaunchable( gpItemPointer->usItem, gpItemDescObject->usItem ) ) ) !ValidMerge( gpItemPointer->usItem, gpItemDescObject->usItem ) && !ValidLaunchable( gpItemPointer->usItem, gpItemDescObject->usItem ) ) )
@@ -7069,7 +7071,7 @@ void RenderItemDescriptionBox( )
DrawItemUIBarEx( gpItemDescObject, (UINT8)(DRAW_ITEM_STATUS_ATTACHMENT1 + cnt), sCenX, sCenY, ITEM_BAR_WIDTH, ITEM_BAR_HEIGHT, Get16BPPColor( STATUS_BAR ), Get16BPPColor( STATUS_BAR_SHADOW ), TRUE , guiSAVEBUFFER, gubItemDescStatusIndex ); DrawItemUIBarEx( gpItemDescObject, (UINT8)(DRAW_ITEM_STATUS_ATTACHMENT1 + cnt), sCenX, sCenY, ITEM_BAR_WIDTH, ITEM_BAR_HEIGHT, Get16BPPColor( STATUS_BAR ), Get16BPPColor( STATUS_BAR_SHADOW ), TRUE , guiSAVEBUFFER, gubItemDescStatusIndex );
// Flugente: overheating // Flugente: overheating
if ( gGameExternalOptions.fWeaponOverheating && ( Item[ (iter)->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) || ItemIsBarrel((iter)->usItem)) ) // Flugente if ( gGameExternalOptions.fWeaponOverheating && ( Item[ (iter)->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) || Item[ (iter)->usItem ].barrel == TRUE) ) // Flugente
{ {
FLOAT overheatjampercentage = GetGunOverheatDisplayPercentage( &(*iter)); FLOAT overheatjampercentage = GetGunOverheatDisplayPercentage( &(*iter));
@@ -7217,7 +7219,7 @@ void RenderItemDescriptionBox( )
SetFontForeground( FONT_BLACK ); SetFontForeground( FONT_BLACK );
SetFontShadow( ITEMDESC_FONTSHADOW2 ); SetFontShadow( ITEMDESC_FONTSHADOW2 );
// Caliber // Caliber
if ( ItemHasFingerPrintID(gpItemDescObject->usItem) && (*gpItemDescObject)[gubItemDescStatusIndex]->data.ubImprintID < NO_PROFILE ) if ( (Item[gpItemDescObject->usItem].fingerprintid ) && (*gpItemDescObject)[gubItemDescStatusIndex]->data.ubImprintID < NO_PROFILE )
{ {
// Fingerprint ID // Fingerprint ID
swprintf( pStr, L"%s %s (%s)", AmmoCaliber[ Weapon[ gpItemDescObject->usItem ].ubCalibre ], WeaponType[ Weapon[ gpItemDescObject->usItem ].ubWeaponType ], gMercProfiles[ (*gpItemDescObject)[gubItemDescStatusIndex]->data.ubImprintID ].zNickname ); swprintf( pStr, L"%s %s (%s)", AmmoCaliber[ Weapon[ gpItemDescObject->usItem ].ubCalibre ], WeaponType[ Weapon[ gpItemDescObject->usItem ].ubWeaponType ], gMercProfiles[ (*gpItemDescObject)[gubItemDescStatusIndex]->data.ubImprintID ].zNickname );
@@ -7282,7 +7284,7 @@ void RenderItemDescriptionBox( )
} }
// Flugente: display temperature string // Flugente: display temperature string
if ( gGameExternalOptions.fWeaponOverheating && ( Item[ gpItemDescObject->usItem ].usItemClass == IC_GUN || Item[gpItemDescObject->usItem].usItemClass == IC_LAUNCHER || ItemIsBarrel(gpItemDescObject->usItem) ) ) if ( gGameExternalOptions.fWeaponOverheating && ( Item[ gpItemDescObject->usItem ].usItemClass == IC_GUN || Item[gpItemDescObject->usItem].usItemClass == IC_LAUNCHER || Item[gpItemDescObject->usItem].barrel == TRUE ) )
{ {
// UDB system displays a string with colored condition text. // UDB system displays a string with colored condition text.
int regionindex = 8; int regionindex = 8;
@@ -7410,11 +7412,11 @@ void RenderItemDescriptionBox( )
FindFontRightCoordinates( gODBItemDescRegions[0][0].sLeft, gODBItemDescRegions[0][0].sTop, gODBItemDescRegions[0][0].sRight - gODBItemDescRegions[0][0].sLeft, gODBItemDescRegions[0][0].sBottom - gODBItemDescRegions[0][0].sTop ,pStr, BLOCKFONT2, &usX, &usY); FindFontRightCoordinates( gODBItemDescRegions[0][0].sLeft, gODBItemDescRegions[0][0].sTop, gODBItemDescRegions[0][0].sRight - gODBItemDescRegions[0][0].sLeft, gODBItemDescRegions[0][0].sBottom - gODBItemDescRegions[0][0].sTop ,pStr, BLOCKFONT2, &usX, &usY);
} }
if( g_lang == i18n::Lang::zh ) { #ifdef CHINESE
wcscat( pStr, ChineseSpecString1 ); wcscat( pStr, ChineseSpecString1 );
} else { #else
wcscat( pStr, L"%%" ); wcscat( pStr, L"%%" );
} #endif
mprintf( usX, usY, pStr ); mprintf( usX, usY, pStr );
} }
@@ -7610,7 +7612,7 @@ void RenderItemDescriptionBox( )
FindFontRightCoordinates( gODBItemDescRegions[2][7].sLeft, gODBItemDescRegions[2][7].sTop, gODBItemDescRegions[2][7].sRight - gODBItemDescRegions[2][7].sLeft, gODBItemDescRegions[2][7].sBottom - gODBItemDescRegions[2][7].sTop ,pStr, BLOCKFONT2, &usX, &usY); FindFontRightCoordinates( gODBItemDescRegions[2][7].sLeft, gODBItemDescRegions[2][7].sTop, gODBItemDescRegions[2][7].sRight - gODBItemDescRegions[2][7].sLeft, gODBItemDescRegions[2][7].sBottom - gODBItemDescRegions[2][7].sTop ,pStr, BLOCKFONT2, &usX, &usY);
mprintf( usX, usY, pStr ); mprintf( usX, usY, pStr );
} }
if ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_PUNCH|IC_BLADE|IC_THROWING_KNIFE) && !ItemIsSingleShotRocketLauncher(gpItemDescObject->usItem) ) if ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_PUNCH|IC_BLADE|IC_THROWING_KNIFE) && !Item[ gpItemDescObject->usItem ].singleshotrocketlauncher )
{ {
// DAMAGE // DAMAGE
SetFontForeground( 6 ); SetFontForeground( 6 );
@@ -8363,7 +8365,7 @@ void DeleteItemDescriptionBox( )
} }
if (Item[gpItemDescObject->usItem].usItemClass == IC_LAUNCHER && ValidLaunchable(newIter->usItem, gpItemDescObject->usItem) || if (Item[gpItemDescObject->usItem].usItemClass == IC_LAUNCHER && ValidLaunchable(newIter->usItem, gpItemDescObject->usItem) ||
ItemIsCannon(gpItemDescObject->usItem)) Item[gpItemDescObject->usItem].cannon)
{ {
//lalien: changed to charge AP's for reloading a GL/RL //lalien: changed to charge AP's for reloading a GL/RL
ubAPCost = GetAPsToReload(gpItemDescObject); ubAPCost = GetAPsToReload(gpItemDescObject);
@@ -10710,7 +10712,7 @@ void ItemPopupRegionCallback( MOUSE_REGION * pRegion, INT32 iReason )
} }
else else
{ {
if ( _KeyDown(SHIFT) && gpItemPointer == NULL && Item[gpItemPopupObject->usItem].usItemClass == IC_GUN && (*gpItemPopupObject)[uiItemPos]->data.gun.ubGunShotsLeft > 0 && !ItemIsSingleShotRocketLauncher(gpItemPopupObject->usItem) ) if ( _KeyDown(SHIFT) && gpItemPointer == NULL && Item[gpItemPopupObject->usItem].usItemClass == IC_GUN && (*gpItemPopupObject)[uiItemPos]->data.gun.ubGunShotsLeft > 0 && !(Item[gpItemPopupObject->usItem].singleshotrocketlauncher) )
{ {
EmptyWeaponMagazine( gpItemPopupObject, &gItemPointer, uiItemPos ); EmptyWeaponMagazine( gpItemPopupObject, &gItemPointer, uiItemPos );
InternalMAPBeginItemPointer( gpItemPopupSoldier ); InternalMAPBeginItemPointer( gpItemPopupSoldier );
@@ -10721,7 +10723,7 @@ void ItemPopupRegionCallback( MOUSE_REGION * pRegion, INT32 iReason )
} }
else else
{ {
if ( _KeyDown(SHIFT) && gpItemPointer == NULL && Item[gpItemPopupObject->usItem].usItemClass == IC_GUN && (*gpItemPopupObject)[uiItemPos]->data.gun.ubGunShotsLeft > 0 && !ItemIsSingleShotRocketLauncher(gpItemPopupObject->usItem) && !( guiTacticalInterfaceFlags & INTERFACE_SHOPKEEP_INTERFACE ) ) if ( _KeyDown(SHIFT) && gpItemPointer == NULL && Item[gpItemPopupObject->usItem].usItemClass == IC_GUN && (*gpItemPopupObject)[uiItemPos]->data.gun.ubGunShotsLeft > 0 && !(Item[gpItemPopupObject->usItem].singleshotrocketlauncher) && !( guiTacticalInterfaceFlags & INTERFACE_SHOPKEEP_INTERFACE ) )
{ {
EmptyWeaponMagazine( gpItemPopupObject, &gItemPointer, uiItemPos ); EmptyWeaponMagazine( gpItemPopupObject, &gItemPointer, uiItemPos );
gpItemPointer = &gItemPointer; gpItemPointer = &gItemPointer;
@@ -11179,11 +11181,11 @@ void SetupPickupPage( INT8 bPage )
} }
else else
{ {
if( g_lang == i18n::Lang::zh ) { #ifdef CHINESE
swprintf( pStr, ChineseSpecString3, sValue ); swprintf( pStr, ChineseSpecString3, sValue );
} else { #else
swprintf( pStr, L"%d%%", sValue ); swprintf( pStr, L"%d%%", sValue );
} #endif
} }
SetRegionFastHelpText( &(gItemPickupMenu.Regions[ cnt - iStart ]), pStr ); SetRegionFastHelpText( &(gItemPickupMenu.Regions[ cnt - iStart ]), pStr );
@@ -12281,28 +12283,12 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
if ( gGameExternalOptions.fAdvRepairSystem && sThreshold < 100 ) if ( gGameExternalOptions.fAdvRepairSystem && sThreshold < 100 )
{ {
if( g_lang == i18n::Lang::zh ) { #ifdef CHINESE
swprintf( pStr, ChineseSpecString11, swprintf( pStr, ChineseSpecString11,
ItemNames[ usItem ], #else
AmmoCaliber[ Weapon[ usItem ].ubCalibre ],
sValue,
sThreshold,
gWeaponStatsDesc[ 9 ], //Accuracy String
accuracy,
gWeaponStatsDesc[ 11 ], //Damage String
GetDamage(pObject),
gWeaponStatsDesc[ 10 ], //Range String
gGameSettings.fOptions[ TOPTION_SHOW_WEAPON_RANGE_IN_TILES ] ? GunRange( pObject, NULL )/10 : GunRange( pObject, NULL ), // SANDRO - added argument //Modified Range
gGameSettings.fOptions[ TOPTION_SHOW_WEAPON_RANGE_IN_TILES ] ? GetModifiedGunRange(usItem)/10 : GetModifiedGunRange(usItem), //Gun Range
gWeaponStatsDesc[ 6 ], //AP String
(Weapon[ usItem ].ubReadyTime * (100 - GetPercentReadyTimeAPReduction( pObject )) / 100), // Ready AP's
apStr, //AP's
gWeaponStatsDesc[ 12 ], //Weight String
fWeight, //Weight
GetWeightUnitString() //Weight units
);
} else {
swprintf( pStr, L"%s (%s) [%d%%(%d%%)]\n%s %d\n%s %d\n%s %d (%d)\n%s (%d) %s\n%s %1.1f %s", swprintf( pStr, L"%s (%s) [%d%%(%d%%)]\n%s %d\n%s %d\n%s %d (%d)\n%s (%d) %s\n%s %1.1f %s",
#endif
ItemNames[ usItem ], ItemNames[ usItem ],
AmmoCaliber[ Weapon[ usItem ].ubCalibre ], AmmoCaliber[ Weapon[ usItem ].ubCalibre ],
sValue, sValue,
@@ -12321,32 +12307,16 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
fWeight, //Weight fWeight, //Weight
GetWeightUnitString() //Weight units GetWeightUnitString() //Weight units
); );
}
} }
else else
{ {
if( g_lang == i18n::Lang::zh ) { #ifdef CHINESE
swprintf( pStr, ChineseSpecString4, swprintf( pStr, ChineseSpecString4,
ItemNames[ usItem ], #else
AmmoCaliber[ Weapon[ usItem ].ubCalibre ],
sValue,
gWeaponStatsDesc[ 9 ], //Accuracy String
accuracy,
gWeaponStatsDesc[ 11 ], //Damage String
GetDamage(pObject),
gWeaponStatsDesc[ 10 ], //Range String
gGameSettings.fOptions[ TOPTION_SHOW_WEAPON_RANGE_IN_TILES ] ? GunRange( pObject, NULL )/10 : GunRange( pObject, NULL ), // SANDRO - added argument //Modified Range
gGameSettings.fOptions[ TOPTION_SHOW_WEAPON_RANGE_IN_TILES ] ? GetModifiedGunRange(usItem)/10 : GetModifiedGunRange(usItem), //Gun Range
gWeaponStatsDesc[ 6 ], //AP String
(Weapon[ usItem ].ubReadyTime * (100 - GetPercentReadyTimeAPReduction( pObject )) / 100), // Ready AP's
apStr, //AP's
gWeaponStatsDesc[ 12 ], //Weight String
fWeight, //Weight
GetWeightUnitString() //Weight units
);
} else {
swprintf( pStr, L"%s (%s) [%d%%]\n%s %d\n%s %d\n%s %d (%d)\n%s (%d) %s\n%s %1.1f %s", swprintf( pStr, L"%s (%s) [%d%%]\n%s %d\n%s %d\n%s %d (%d)\n%s (%d) %s\n%s %1.1f %s",
#endif
ItemNames[ usItem ], ItemNames[ usItem ],
AmmoCaliber[ Weapon[ usItem ].ubCalibre ], AmmoCaliber[ Weapon[ usItem ].ubCalibre ],
sValue, sValue,
@@ -12364,8 +12334,6 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
fWeight, //Weight fWeight, //Weight
GetWeightUnitString() //Weight units GetWeightUnitString() //Weight units
); );
}
} }
} }
break; break;
@@ -12414,27 +12382,12 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
if ( gGameExternalOptions.fAdvRepairSystem && sThreshold < 100 ) if ( gGameExternalOptions.fAdvRepairSystem && sThreshold < 100 )
{ {
if( g_lang == i18n::Lang::zh ) { #ifdef CHINESE
swprintf( pStr, L"%s [%d%£¥(%d%£¥)]\n%s %d\n%s %d\n%s %d (%d)\n%s (%d) %s\n%s %1.1f %s", swprintf( pStr, L"%s [%d%£¥(%d%£¥)]\n%s %d\n%s %d\n%s %d (%d)\n%s (%d) %s\n%s %1.1f %s",
ItemNames[ usItem ], #else
sValue,
sThreshold,
gWeaponStatsDesc[ 9 ], //Accuracy String
accuracy,
gWeaponStatsDesc[ 11 ], //Damage String
GetDamage(pObject),
gWeaponStatsDesc[ 10 ], //Range String
gGameSettings.fOptions[ TOPTION_SHOW_WEAPON_RANGE_IN_TILES ] ? GunRange( pObject, NULL )/10 : GunRange( pObject, NULL ), // SANDRO - added argument //Modified Range
gGameSettings.fOptions[ TOPTION_SHOW_WEAPON_RANGE_IN_TILES ] ? GetModifiedGunRange(usItem)/10 : GetModifiedGunRange(usItem), //Gun Range
gWeaponStatsDesc[ 6 ], //AP String
(Weapon[ usItem ].ubReadyTime * (100 - GetPercentReadyTimeAPReduction( pObject )) / 100), // Ready AP's
apStr, //AP's
gWeaponStatsDesc[ 12 ], //Weight String
fWeight, //Weight
GetWeightUnitString() //Weight units
);
} else {
swprintf( pStr, L"%s [%d%%(%d%%)]\n%s %d\n%s %d\n%s %d (%d)\n%s (%d) %s\n%s %1.1f %s", swprintf( pStr, L"%s [%d%%(%d%%)]\n%s %d\n%s %d\n%s %d (%d)\n%s (%d) %s\n%s %1.1f %s",
#endif
ItemNames[ usItem ], ItemNames[ usItem ],
sValue, sValue,
sThreshold, sThreshold,
@@ -12452,30 +12405,15 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
fWeight, //Weight fWeight, //Weight
GetWeightUnitString() //Weight units GetWeightUnitString() //Weight units
); );
}
} }
else else
{ {
if( g_lang == i18n::Lang::zh ) { #ifdef CHINESE
swprintf( pStr, L"%s [%d%£¥]\n%s %d\n%s %d\n%s %d (%d)\n%s (%d) %s\n%s %1.1f %s", swprintf( pStr, L"%s [%d%£¥]\n%s %d\n%s %d\n%s %d (%d)\n%s (%d) %s\n%s %1.1f %s",
ItemNames[ usItem ], #else
sValue,
gWeaponStatsDesc[ 9 ], //Accuracy String
accuracy,
gWeaponStatsDesc[ 11 ], //Damage String
GetDamage(pObject),
gWeaponStatsDesc[ 10 ], //Range String
gGameSettings.fOptions[ TOPTION_SHOW_WEAPON_RANGE_IN_TILES ] ? GunRange( pObject, NULL )/10 : GunRange( pObject, NULL ), // SANDRO - added argument //Modified Range
gGameSettings.fOptions[ TOPTION_SHOW_WEAPON_RANGE_IN_TILES ] ? GetModifiedGunRange(usItem)/10 : GetModifiedGunRange(usItem), //Gun Range
gWeaponStatsDesc[ 6 ], //AP String
(Weapon[ usItem ].ubReadyTime * (100 - GetPercentReadyTimeAPReduction( pObject )) / 100), // Ready AP's
apStr, //AP's
gWeaponStatsDesc[ 12 ], //Weight String
fWeight, //Weight
GetWeightUnitString() //Weight units
);
} else {
swprintf( pStr, L"%s [%d%%]\n%s %d\n%s %d\n%s %d (%d)\n%s (%d) %s\n%s %1.1f %s", swprintf( pStr, L"%s [%d%%]\n%s %d\n%s %d\n%s %d (%d)\n%s (%d) %s\n%s %1.1f %s",
#endif
ItemNames[ usItem ], ItemNames[ usItem ],
sValue, sValue,
gWeaponStatsDesc[ 9 ], //Accuracy String gWeaponStatsDesc[ 9 ], //Accuracy String
@@ -12492,7 +12430,6 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
fWeight, //Weight fWeight, //Weight
GetWeightUnitString() //Weight units GetWeightUnitString() //Weight units
); );
}
} }
} }
break; break;
@@ -12503,22 +12440,13 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
{ {
if ( gGameExternalOptions.fAdvRepairSystem && sThreshold < 100 ) if ( gGameExternalOptions.fAdvRepairSystem && sThreshold < 100 )
{ {
if( g_lang == i18n::Lang::zh ) { #ifdef CHINESE
swprintf( pStr, ChineseSpecString9, swprintf( pStr, ChineseSpecString9,
ItemNames[ usItem ], #else
sValue,
sThreshold,
gWeaponStatsDesc[ 11 ], //Damage String
GetDamage(pObject), //Melee damage
gWeaponStatsDesc[ 6 ], //AP String
BaseAPsToShootOrStab( APBPConstants[DEFAULT_APS], APBPConstants[DEFAULT_AIMSKILL], pObject, pSoldier ), //AP's
gWeaponStatsDesc[ 12 ], //Weight String
fWeight, //Weight
GetWeightUnitString() //Weight units
);
} else {
swprintf( pStr, L"%s [%d%%(%d%%)]\n%s %d\n%s %d\n%s %1.1f %s", swprintf( pStr, L"%s [%d%%(%d%%)]\n%s %d\n%s %d\n%s %1.1f %s",
ItemNames[ usItem ], #endif
ItemNames[ usItem ],
sValue, sValue,
sThreshold, sThreshold,
gWeaponStatsDesc[ 11 ], //Damage String gWeaponStatsDesc[ 11 ], //Damage String
@@ -12529,25 +12457,16 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
fWeight, //Weight fWeight, //Weight
GetWeightUnitString() //Weight units GetWeightUnitString() //Weight units
); );
}
} }
else else
{ {
if( g_lang == i18n::Lang::zh ) { #ifdef CHINESE
swprintf( pStr, ChineseSpecString5, swprintf( pStr, ChineseSpecString5,
ItemNames[ usItem ], #else
sValue,
gWeaponStatsDesc[ 11 ], //Damage String
GetDamage(pObject), //Melee damage
gWeaponStatsDesc[ 6 ], //AP String
BaseAPsToShootOrStab( APBPConstants[DEFAULT_APS], APBPConstants[DEFAULT_AIMSKILL], pObject, pSoldier ), //AP's
gWeaponStatsDesc[ 12 ], //Weight String
fWeight, //Weight
GetWeightUnitString() //Weight units
);
} else {
swprintf( pStr, L"%s [%d%%]\n%s %d\n%s %d\n%s %1.1f %s", swprintf( pStr, L"%s [%d%%]\n%s %d\n%s %d\n%s %1.1f %s",
ItemNames[ usItem ], #endif
ItemNames[ usItem ],
sValue, sValue,
gWeaponStatsDesc[ 11 ], //Damage String gWeaponStatsDesc[ 11 ], //Damage String
GetDamage(pObject), //Melee damage GetDamage(pObject), //Melee damage
@@ -12557,7 +12476,6 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
fWeight, //Weight fWeight, //Weight
GetWeightUnitString() //Weight units GetWeightUnitString() //Weight units
); );
}
} }
} }
break; break;
@@ -12597,21 +12515,13 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
UINT16 explDamage = (UINT16) GetModifiedExplosiveDamage( Explosive[Item[ usItem ].ubClassIndex].ubDamage, 0 ); UINT16 explDamage = (UINT16) GetModifiedExplosiveDamage( Explosive[Item[ usItem ].ubClassIndex].ubDamage, 0 );
UINT16 explStunDamage = (UINT16) GetModifiedExplosiveDamage( Explosive[Item[ usItem ].ubClassIndex].ubStunDamage, 1 ); UINT16 explStunDamage = (UINT16) GetModifiedExplosiveDamage( Explosive[Item[ usItem ].ubClassIndex].ubStunDamage, 1 );
if( g_lang == i18n::Lang::zh ) { #ifdef CHINESE
swprintf( pStr, ChineseSpecString5, swprintf( pStr, ChineseSpecString5,
ItemNames[ usItem ], #else
sValue,
gWeaponStatsDesc[ 11 ], //Damage String
explDamage,
gWeaponStatsDesc[ 13 ], //Stun Damage String
explStunDamage, //Stun Damage
gWeaponStatsDesc[ 12 ], //Weight String
fWeight, //Weight
GetWeightUnitString() //Weight units
);
} else {
swprintf( pStr, L"%s [%d%%]\n%s %d\n%s %d\n%s %1.1f %s", swprintf( pStr, L"%s [%d%%]\n%s %d\n%s %d\n%s %1.1f %s",
ItemNames[ usItem ], #endif
ItemNames[ usItem ],
sValue, sValue,
gWeaponStatsDesc[ 11 ], //Damage String gWeaponStatsDesc[ 11 ], //Damage String
explDamage, explDamage,
@@ -12621,7 +12531,6 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
fWeight, //Weight fWeight, //Weight
GetWeightUnitString() //Weight units GetWeightUnitString() //Weight units
); );
}
} }
break; break;
@@ -12651,23 +12560,12 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
if ( gGameExternalOptions.fAdvRepairSystem && sThreshold < 100 ) if ( gGameExternalOptions.fAdvRepairSystem && sThreshold < 100 )
{ {
if( g_lang == i18n::Lang::zh ) { #ifdef CHINESE
swprintf( pStr, ChineseSpecString10, swprintf( pStr, ChineseSpecString10,
ItemNames[ usItem ], //Item long name #else
sValue, //Item condition
sThreshold, //repair threshold
pInvPanelTitleStrings[ 4 ], //Protection string
iProtection, //Protection rating in % based on best armor
Armour[ Item[ usItem ].ubClassIndex ].ubProtection * sValue / 100,
Armour[ Item[ usItem ].ubClassIndex ].ubProtection, //Protection (raw data)
pInvPanelTitleStrings[ 3 ], //Camo string
GetCamoBonus(pObject)+GetUrbanCamoBonus(pObject)+GetDesertCamoBonus(pObject)+GetSnowCamoBonus(pObject), //Camo bonus
gWeaponStatsDesc[ 12 ], //Weight string
fWeight, //Weight
GetWeightUnitString() //Weight units
);
} else {
swprintf( pStr, L"%s [%d%%(%d%%)]\n%s %d%% (%d/%d)\n%s %d%%\n%s %1.1f %s", swprintf( pStr, L"%s [%d%%(%d%%)]\n%s %d%% (%d/%d)\n%s %d%%\n%s %1.1f %s",
#endif
ItemNames[ usItem ], //Item long name ItemNames[ usItem ], //Item long name
sValue, //Item condition sValue, //Item condition
sThreshold, //repair threshold sThreshold, //repair threshold
@@ -12681,26 +12579,15 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
fWeight, //Weight fWeight, //Weight
GetWeightUnitString() //Weight units GetWeightUnitString() //Weight units
); );
}
} }
else else
{ {
if( g_lang == i18n::Lang::zh ) { #ifdef CHINESE
swprintf( pStr, ChineseSpecString6, swprintf( pStr, ChineseSpecString6,
ItemNames[ usItem ], //Item long name #else
sValue, //Item condition
pInvPanelTitleStrings[ 4 ], //Protection string
iProtection, //Protection rating in % based on best armor
Armour[ Item[ usItem ].ubClassIndex ].ubProtection * sValue / 100,
Armour[ Item[ usItem ].ubClassIndex ].ubProtection, //Protection (raw data)
pInvPanelTitleStrings[ 3 ], //Camo string
GetCamoBonus(pObject)+GetUrbanCamoBonus(pObject)+GetDesertCamoBonus(pObject)+GetSnowCamoBonus(pObject), //Camo bonus
gWeaponStatsDesc[ 12 ], //Weight string
fWeight, //Weight
GetWeightUnitString() //Weight units
);
} else {
swprintf( pStr, L"%s [%d%%]\n%s %d%% (%d/%d)\n%s %d%%\n%s %1.1f %s", swprintf( pStr, L"%s [%d%%]\n%s %d%% (%d/%d)\n%s %d%%\n%s %1.1f %s",
#endif
ItemNames[ usItem ], //Item long name ItemNames[ usItem ], //Item long name
sValue, //Item condition sValue, //Item condition
pInvPanelTitleStrings[ 4 ], //Protection string pInvPanelTitleStrings[ 4 ], //Protection string
@@ -12713,7 +12600,6 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
fWeight, //Weight fWeight, //Weight
GetWeightUnitString() //Weight units GetWeightUnitString() //Weight units
); );
}
} }
} }
break; break;
@@ -12726,30 +12612,24 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
default: default:
{ {
// The final, and typical case, is that of an item with a percent status // The final, and typical case, is that of an item with a percent status
if( g_lang == i18n::Lang::zh ) { #ifdef CHINESE
swprintf( pStr, ChineseSpecString7, swprintf( pStr, ChineseSpecString7,
ItemNames[ usItem ], //Item long name #else
sValue, //Item condition
gWeaponStatsDesc[ 12 ], //Weight String
fWeight, //Weight
GetWeightUnitString() //Weight units
);
} else {
swprintf( pStr, L"%s [%d%%]\n%s %1.1f %s", swprintf( pStr, L"%s [%d%%]\n%s %1.1f %s",
#endif
ItemNames[ usItem ], //Item long name ItemNames[ usItem ], //Item long name
sValue, //Item condition sValue, //Item condition
gWeaponStatsDesc[ 12 ], //Weight String gWeaponStatsDesc[ 12 ], //Weight String
fWeight, //Weight fWeight, //Weight
GetWeightUnitString() //Weight units GetWeightUnitString() //Weight units
); );
}
} }
break; break;
} }
// Fingerprint ID (Soldier Name) // Fingerprint ID (Soldier Name)
if ( ItemHasFingerPrintID(pObject->usItem) && (*pObject)[subObject]->data.ubImprintID < NO_PROFILE ) if ( ( Item[pObject->usItem].fingerprintid ) && (*pObject)[subObject]->data.ubImprintID < NO_PROFILE )
{ {
CHAR16 pStr2[20]; CHAR16 pStr2[20];
swprintf( pStr2, L" [%s]", gMercProfiles[ (*pObject)[subObject]->data.ubImprintID ].zNickname ); swprintf( pStr2, L" [%s]", gMercProfiles[ (*pObject)[subObject]->data.ubImprintID ].zNickname );
@@ -13936,7 +13816,7 @@ void BombInventoryMessageBoxCallBack( UINT8 ubExitValue )
if (gpItemDescSoldier) if (gpItemDescSoldier)
{ {
// no planting tripwire in our inventory... // no planting tripwire in our inventory...
if (ItemIsTripwire(gpItemDescObject->usItem)) if ( Item[ gpItemDescObject->usItem ].tripwire == 1 )
return; return;
INT32 iResult; INT32 iResult;
@@ -14085,14 +13965,14 @@ void BombInventoryDisArmMessageBoxCallBack( UINT8 ubExitValue )
if ( (*gpItemDescObject)[0]->data.misc.ubBombOwner > 1 && ( (INT32)(*gpItemDescObject)[0]->data.misc.ubBombOwner - 2 >= gTacticalStatus.Team[ OUR_TEAM ].bFirstID && (*gpItemDescObject)[0]->data.misc.ubBombOwner - 2 <= gTacticalStatus.Team[ OUR_TEAM ].bLastID ) ) if ( (*gpItemDescObject)[0]->data.misc.ubBombOwner > 1 && ( (INT32)(*gpItemDescObject)[0]->data.misc.ubBombOwner - 2 >= gTacticalStatus.Team[ OUR_TEAM ].bFirstID && (*gpItemDescObject)[0]->data.misc.ubBombOwner - 2 <= gTacticalStatus.Team[ OUR_TEAM ].bLastID ) )
{ {
// Flugente: get a tripwire-related bonus if we have a wire cutter in our hands // Flugente: get a tripwire-related bonus if we have a wire cutter in our hands
if ( ( (&gpItemDescSoldier->inv[HANDPOS])->exists() && ItemIsWirecutters(gpItemDescSoldier->inv[HANDPOS].usItem) ) || ( (&gpItemDescSoldier->inv[SECONDHANDPOS])->exists() && ItemIsWirecutters(gpItemDescSoldier->inv[SECONDHANDPOS].usItem) ) ) if ( ( (&gpItemDescSoldier->inv[HANDPOS])->exists() && Item[ gpItemDescSoldier->inv[HANDPOS].usItem ].wirecutters == 1 ) || ( (&gpItemDescSoldier->inv[SECONDHANDPOS])->exists() && Item[ gpItemDescSoldier->inv[SECONDHANDPOS].usItem ].wirecutters == 1 ) )
{ {
// + 10 if item gets activated by tripwire // + 10 if item gets activated by tripwire
if (ItemHasTripwireActivation(gpItemDescObject->usItem)) if ( Item[gpItemDescObject->usItem].tripwireactivation == 1 )
diff += 10; diff += 10;
// + 10 if item is tripwire // + 10 if item is tripwire
if (ItemIsTripwire(gpItemDescObject->usItem)) if ( Item[gpItemDescObject->usItem].tripwire == 1 )
diff += 10; diff += 10;
} }
+17 -20
View File
@@ -73,8 +73,6 @@
//legion by Jazz //legion by Jazz
#include "Interface Utils.h" #include "Interface Utils.h"
#include <language.hpp>
//forward declarations of common classes to eliminate includes //forward declarations of common classes to eliminate includes
class OBJECTTYPE; class OBJECTTYPE;
class SOLDIERTYPE; class SOLDIERTYPE;
@@ -2749,27 +2747,27 @@ void RenderSMPanel( BOOLEAN *pfDirty )
mprintf( SM_ARMOR_LABEL_X - StringPixLength( pInvPanelTitleStrings[0], BLOCKFONT2 ) / 2, SM_ARMOR_LABEL_Y, pInvPanelTitleStrings[ 0 ] ); mprintf( SM_ARMOR_LABEL_X - StringPixLength( pInvPanelTitleStrings[0], BLOCKFONT2 ) / 2, SM_ARMOR_LABEL_Y, pInvPanelTitleStrings[ 0 ] );
if( g_lang == i18n::Lang::zh ) { #ifdef CHINESE
mprintf( SM_ARMOR_PERCENT_X, SM_ARMOR_PERCENT_Y, ChineseSpecString1 ); mprintf( SM_ARMOR_PERCENT_X, SM_ARMOR_PERCENT_Y, ChineseSpecString1 );
} else { #else
mprintf( SM_ARMOR_PERCENT_X, SM_ARMOR_PERCENT_Y, L"%%" ); mprintf( SM_ARMOR_PERCENT_X, SM_ARMOR_PERCENT_Y, L"%%" );
} #endif
mprintf( SM_WEIGHT_LABEL_X - StringPixLength( pInvPanelTitleStrings[1], BLOCKFONT2 ), SM_WEIGHT_LABEL_Y, pInvPanelTitleStrings[ 1 ] ); mprintf( SM_WEIGHT_LABEL_X - StringPixLength( pInvPanelTitleStrings[1], BLOCKFONT2 ), SM_WEIGHT_LABEL_Y, pInvPanelTitleStrings[ 1 ] );
if( g_lang == i18n::Lang::zh ) { #ifdef CHINESE
mprintf( SM_WEIGHT_PERCENT_X, SM_WEIGHT_PERCENT_Y, ChineseSpecString1 ); mprintf( SM_WEIGHT_PERCENT_X, SM_WEIGHT_PERCENT_Y, ChineseSpecString1 );
} else { #else
mprintf( SM_WEIGHT_PERCENT_X, SM_WEIGHT_PERCENT_Y, L"%%" ); mprintf( SM_WEIGHT_PERCENT_X, SM_WEIGHT_PERCENT_Y, L"%%" );
} #endif
mprintf( SM_CAMMO_LABEL_X - StringPixLength( pInvPanelTitleStrings[2], BLOCKFONT2 ), SM_CAMMO_LABEL_Y, pInvPanelTitleStrings[ 2 ] ); mprintf( SM_CAMMO_LABEL_X - StringPixLength( pInvPanelTitleStrings[2], BLOCKFONT2 ), SM_CAMMO_LABEL_Y, pInvPanelTitleStrings[ 2 ] );
if( g_lang == i18n::Lang::zh ) { #ifdef CHINESE
mprintf( SM_CAMMO_PERCENT_X, SM_CAMMO_PERCENT_Y, ChineseSpecString1 ); mprintf( SM_CAMMO_PERCENT_X, SM_CAMMO_PERCENT_Y, ChineseSpecString1 );
} else { #else
mprintf( SM_CAMMO_PERCENT_X, SM_CAMMO_PERCENT_Y, L"%%" ); mprintf( SM_CAMMO_PERCENT_X, SM_CAMMO_PERCENT_Y, L"%%" );
} #endif
UpdateStatColor( gpSMCurrentMerc->timeChanges.uiChangeAgilityTime, (BOOLEAN)(gpSMCurrentMerc->usValueGoneUp & AGIL_INCREASE ? TRUE : FALSE), (BOOLEAN)((gGameOptions.fNewTraitSystem && (gpSMCurrentMerc->ubCriticalStatDamage[DAMAGED_STAT_AGILITY] > 0)) ? TRUE : FALSE), gpSMCurrentMerc->bExtraAgility != 0 ); // SANDRO UpdateStatColor( gpSMCurrentMerc->timeChanges.uiChangeAgilityTime, (BOOLEAN)(gpSMCurrentMerc->usValueGoneUp & AGIL_INCREASE ? TRUE : FALSE), (BOOLEAN)((gGameOptions.fNewTraitSystem && (gpSMCurrentMerc->ubCriticalStatDamage[DAMAGED_STAT_AGILITY] > 0)) ? TRUE : FALSE), gpSMCurrentMerc->bExtraAgility != 0 ); // SANDRO
@@ -3375,7 +3373,7 @@ BOOLEAN HandleNailsVestFetish( SOLDIERTYPE *pSoldier, UINT32 uiHandPos, UINT16 u
else else
{ {
// Do we have nothing or the leather vest or kevlar leather vest? // Do we have nothing or the leather vest or kevlar leather vest?
if (ItemIsLeatherJacket(usReplaceItem) || if ( Item[usReplaceItem].leatherjacket ||
usReplaceItem == COMPOUND18 || usReplaceItem == COMPOUND18 ||
usReplaceItem == JAR_QUEEN_CREATURE_BLOOD ) usReplaceItem == JAR_QUEEN_CREATURE_BLOOD )
{ {
@@ -4046,7 +4044,7 @@ void SMInvClickCallback( MOUSE_REGION * pRegion, INT32 iReason )
{ {
if ( !InItemDescriptionBox( ) ) if ( !InItemDescriptionBox( ) )
{ {
if ( _KeyDown(SHIFT) && gpItemPointer == NULL && Item[gpSMCurrentMerc->inv[ uiHandPos ].usItem].usItemClass == IC_GUN && (gpSMCurrentMerc->inv[ uiHandPos ])[uiHandPos]->data.gun.ubGunShotsLeft > 0 && !ItemIsSingleShotRocketLauncher(gpSMCurrentMerc->inv[ uiHandPos ].usItem) && !( guiTacticalInterfaceFlags & INTERFACE_SHOPKEEP_INTERFACE ) ) if ( _KeyDown(SHIFT) && gpItemPointer == NULL && Item[gpSMCurrentMerc->inv[ uiHandPos ].usItem].usItemClass == IC_GUN && (gpSMCurrentMerc->inv[ uiHandPos ])[uiHandPos]->data.gun.ubGunShotsLeft > 0 && !(Item[gpSMCurrentMerc->inv[ uiHandPos ].usItem].singleshotrocketlauncher) && !( guiTacticalInterfaceFlags & INTERFACE_SHOPKEEP_INTERFACE ) )
{ {
EmptyWeaponMagazine( &(gpSMCurrentMerc->inv[ uiHandPos ]), &gItemPointer, uiHandPos ); EmptyWeaponMagazine( &(gpSMCurrentMerc->inv[ uiHandPos ]), &gItemPointer, uiHandPos );
gpItemPointer = &gItemPointer; gpItemPointer = &gItemPointer;
@@ -7098,23 +7096,22 @@ void CheckForAndAddMercToTeamPanel( SOLDIERTYPE *pSoldier )
void CleanUpStack( OBJECTTYPE * pObj, OBJECTTYPE * pCursorObj ) void CleanUpStack( OBJECTTYPE * pObj, OBJECTTYPE * pCursorObj )
{ {
INT16 bMaxPoints; INT16 bMaxPoints;
UINT16 usItem = pObj->usItem;
if ( !(Item[usItem].usItemClass & IC_AMMO || Item[usItem].usItemClass & IC_KIT || Item[usItem].usItemClass & IC_MEDKIT || ItemIsCanteen(usItem) || ItemIsGascan(usItem) || Item[usItem].alcohol > 0.0f) ) if ( !(Item[pObj->usItem].usItemClass & IC_AMMO || Item[pObj->usItem].usItemClass & IC_KIT || Item[pObj->usItem].usItemClass & IC_MEDKIT || Item[pObj->usItem].canteen || Item[pObj->usItem].gascan || Item[pObj->usItem].alcohol > 0.0f) )
{ {
return; return;
} }
if ( Item[ usItem ].usItemClass & IC_AMMO ) if ( Item[ pObj->usItem ].usItemClass & IC_AMMO )
{ {
bMaxPoints = Magazine[ Item[ usItem ].ubClassIndex ].ubMagSize; bMaxPoints = Magazine[ Item[ pObj->usItem ].ubClassIndex ].ubMagSize;
} }
else else
{ {
bMaxPoints = 100; bMaxPoints = 100;
} }
if ( pCursorObj && pCursorObj->usItem == usItem ) if ( pCursorObj && pCursorObj->usItem == pObj->usItem )
{ {
DistributeStatus(pCursorObj, pObj, bMaxPoints); DistributeStatus(pCursorObj, pObj, bMaxPoints);
} }
@@ -7123,13 +7120,13 @@ void CleanUpStack( OBJECTTYPE * pObj, OBJECTTYPE * pCursorObj )
// Flugente: one of the items on the stack might not be full. Make sure it is the first one, so the player can see what is missing at a glance // Flugente: one of the items on the stack might not be full. Make sure it is the first one, so the player can see what is missing at a glance
if ( pObj->ubNumberOfObjects > 1 ) if ( pObj->ubNumberOfObjects > 1 )
{ {
if ( Item[usItem].usItemClass & IC_AMMO ) if ( Item[pObj->usItem].usItemClass & IC_AMMO )
{ {
UINT16 shots_first = (*pObj)[0]->data.ubShotsLeft; UINT16 shots_first = (*pObj)[0]->data.ubShotsLeft;
(*pObj)[0]->data.ubShotsLeft = (*pObj)[pObj->ubNumberOfObjects - 1]->data.ubShotsLeft; (*pObj)[0]->data.ubShotsLeft = (*pObj)[pObj->ubNumberOfObjects - 1]->data.ubShotsLeft;
(*pObj)[pObj->ubNumberOfObjects - 1]->data.ubShotsLeft = shots_first; (*pObj)[pObj->ubNumberOfObjects - 1]->data.ubShotsLeft = shots_first;
} }
else if ( Item[usItem].usItemClass & IC_MAPFILTER_KIT ) else if ( Item[pObj->usItem].usItemClass & IC_MAPFILTER_KIT )
{ {
INT16 status_first = (*pObj)[0]->data.objectStatus; INT16 status_first = (*pObj)[0]->data.objectStatus;
(*pObj)[0]->data.objectStatus = (*pObj)[pObj->ubNumberOfObjects - 1]->data.objectStatus; (*pObj)[0]->data.objectStatus = (*pObj)[pObj->ubNumberOfObjects - 1]->data.objectStatus;
+20 -7
View File
@@ -461,7 +461,14 @@ BOOLEAN InitializeTacticalInterface( )
// failing the CHECKF after this will cause you to lose your mouse // failing the CHECKF after this will cause you to lose your mouse
strcpy( vs_desc.ImageFile, "INTERFACE\\IN_TEXT.STI" ); if ( GETPIXELDEPTH() == 8 )
{
strcpy( vs_desc.ImageFile, "INTERFACE\\IN_TEXT_8.pcx" );
}
else if ( GETPIXELDEPTH() == 16 )
{
strcpy( vs_desc.ImageFile, "INTERFACE\\IN_TEXT.STI" );
}
if( !AddVideoSurface( &vs_desc, &guiINTEXT ) ) if( !AddVideoSurface( &vs_desc, &guiINTEXT ) )
AssertMsg( 0, "Missing INTERFACE\\In_text.sti"); AssertMsg( 0, "Missing INTERFACE\\In_text.sti");
@@ -971,12 +978,12 @@ void PopupMovementMenu( UI_EVENT *pUIEvent )
} }
else else
{ {
if (ItemIsToolkit(pSoldier->inv[ HANDPOS ].usItem)) if ( Item[pSoldier->inv[ HANDPOS ].usItem].toolkit )
{ {
uiActionImages = TOOLKITACTIONC_IMAGES; uiActionImages = TOOLKITACTIONC_IMAGES;
swprintf( zActionString, TacticalStr[ NOT_APPLICABLE_POPUPTEXT ] ); swprintf( zActionString, TacticalStr[ NOT_APPLICABLE_POPUPTEXT ] );
} }
else if (ItemIsWirecutters(pSoldier->inv[ HANDPOS ].usItem)) else if ( Item[pSoldier->inv[ HANDPOS ].usItem].wirecutters )
{ {
uiActionImages = WIRECUTACTIONC_IMAGES; uiActionImages = WIRECUTACTIONC_IMAGES;
swprintf( zActionString, TacticalStr[ NOT_APPLICABLE_POPUPTEXT ] ); swprintf( zActionString, TacticalStr[ NOT_APPLICABLE_POPUPTEXT ] );
@@ -3555,7 +3562,10 @@ void DrawBarsInUIBox( SOLDIERTYPE *pSoldier , INT16 sXPos, INT16 sYPos, INT16 sW
} }
if ( pSoldier->ubID == gusSelectedSoldier ) if ( pSoldier->ubID == gusSelectedSoldier )
{ {
RectangleDraw( TRUE, sXPos+1, sYPos-1, sXPos+sWidth+3, sYPos+1+interval*3, color16, pDestBuf); if(gbPixelDepth==16)
RectangleDraw( TRUE, sXPos+1, sYPos-1, sXPos+sWidth+3, sYPos+1+interval*3, color16, pDestBuf);
else
RectangleDraw8( TRUE, sXPos+1, sYPos-1, sXPos+sWidth+3, sYPos+1+interval*3, color8, pDestBuf);
} }
} }
@@ -5802,7 +5812,10 @@ void DrawBar( INT32 x, INT32 y, INT32 width, INT32 height, UINT16 color8, UINT16
{ {
for( INT32 i=0; i < height; i++ ) for( INT32 i=0; i < height; i++ )
{ {
LineDraw( TRUE, x, y+i, x+width-1, y+i, color16, pDestBuf ); if(gbPixelDepth==16)
LineDraw( TRUE, x, y+i, x+width-1, y+i, color16, pDestBuf );
else if(gbPixelDepth==8)
LineDraw8( TRUE, x, y+i, x+width-1, y+i, color8, pDestBuf );
} }
} }
} }
@@ -6030,7 +6043,7 @@ void GetEnemyInfoString( SOLDIERTYPE* pSelectedSoldier, SOLDIERTYPE* pTargetSold
} }
else else
{ // show general name { // show general name
if(ItemIsGasmask(pTargetSoldier->inv[HEAD1POS].usItem)) if( Item[pTargetSoldier->inv[HEAD1POS].usItem].gasmask )
wcscat( NameStr, TacticalStr[ GENERAL_INFO_MASK ] ); wcscat( NameStr, TacticalStr[ GENERAL_INFO_MASK ] );
else if( Item[pTargetSoldier->inv[HEAD1POS].usItem].nightvisionrangebonus || Item[pTargetSoldier->inv[HEAD1POS].usItem].cavevisionrangebonus ) else if( Item[pTargetSoldier->inv[HEAD1POS].usItem].nightvisionrangebonus || Item[pTargetSoldier->inv[HEAD1POS].usItem].cavevisionrangebonus )
wcscat( NameStr, TacticalStr[ GENERAL_INFO_NVG ] ); wcscat( NameStr, TacticalStr[ GENERAL_INFO_NVG ] );
@@ -6046,7 +6059,7 @@ void GetEnemyInfoString( SOLDIERTYPE* pSelectedSoldier, SOLDIERTYPE* pTargetSold
} }
else else
{ // show general name { // show general name
if(ItemIsGasmask(pTargetSoldier->inv[HEAD1POS].usItem)) if( Item[pTargetSoldier->inv[HEAD1POS].usItem].gasmask )
wcscat( NameStr, TacticalStr[ GENERAL_INFO_MASK ] ); wcscat( NameStr, TacticalStr[ GENERAL_INFO_MASK ] );
else if( Item[pTargetSoldier->inv[HEAD1POS].usItem].nightvisionrangebonus || Item[pTargetSoldier->inv[HEAD1POS].usItem].cavevisionrangebonus ) else if( Item[pTargetSoldier->inv[HEAD1POS].usItem].nightvisionrangebonus || Item[pTargetSoldier->inv[HEAD1POS].usItem].cavevisionrangebonus )
wcscat( NameStr, TacticalStr[ GENERAL_INFO_NVG ] ); wcscat( NameStr, TacticalStr[ GENERAL_INFO_NVG ] );
+7 -7
View File
@@ -738,7 +738,7 @@ void GenerateRandomEquipment( SOLDIERCREATE_STRUCT *pp, INT8 bSoldierClass, INT8
switch( Item[ pItem->usItem ].usItemClass ) switch( Item[ pItem->usItem ].usItemClass )
{ {
case IC_GUN: case IC_GUN:
if ( !ItemIsRocketLauncher(pItem->usItem) ) if ( !Item[pItem->usItem].rocketlauncher )
{ {
bWeaponClass *= -1; bWeaponClass *= -1;
} }
@@ -873,7 +873,7 @@ void ChooseWeaponForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp, INT8 bWeaponC
pp->Inv[ i ][0]->data.gun.ubGunAmmoType = Magazine[Item[usAmmoIndex].ubClassIndex].ubAmmoType; pp->Inv[ i ][0]->data.gun.ubGunAmmoType = Magazine[Item[usAmmoIndex].ubClassIndex].ubAmmoType;
pp->Inv[ i ][0]->data.gun.usGunAmmoItem = usAmmoIndex; pp->Inv[ i ][0]->data.gun.usGunAmmoItem = usAmmoIndex;
if (ItemHasFingerPrintID(usGunIndex)) if ( Item[usGunIndex].fingerprintid )
{ {
pp->Inv[ i ][0]->data.ubImprintID = (NO_PROFILE + 1); pp->Inv[ i ][0]->data.ubImprintID = (NO_PROFILE + 1);
} }
@@ -951,7 +951,7 @@ void ChooseWeaponForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp, INT8 bWeaponC
pp->Inv[ HANDPOS ].fFlags |= OBJECT_UNDROPPABLE; pp->Inv[ HANDPOS ].fFlags |= OBJECT_UNDROPPABLE;
// Rocket Rifles must come pre-imprinted, in case carrier gets killed without getting a shot off // Rocket Rifles must come pre-imprinted, in case carrier gets killed without getting a shot off
if (ItemHasFingerPrintID(usGunIndex)) if ( Item[usGunIndex].fingerprintid )
{ {
pp->Inv[ HANDPOS ][0]->data.ubImprintID = (NO_PROFILE + 1); pp->Inv[ HANDPOS ][0]->data.ubImprintID = (NO_PROFILE + 1);
} }
@@ -3144,7 +3144,7 @@ void ReplaceExtendedGuns( SOLDIERCREATE_STRUCT *pp, INT8 bSoldierClass )
{ {
usItem = pp->Inv[ uiLoop ].usItem; usItem = pp->Inv[ uiLoop ].usItem;
if ( ( Item[ usItem ].usItemClass & IC_GUN ) && ItemIsOnlyInTonsOfGuns( usItem ) ) if ( ( Item[ usItem ].usItemClass & IC_GUN ) && ExtendedGunListGun( usItem ) )
{ {
if ( bSoldierClass == SOLDIER_CLASS_NONE ) if ( bSoldierClass == SOLDIER_CLASS_NONE )
{ {
@@ -3528,7 +3528,7 @@ UINT32 ItemFitness( OBJECTTYPE* pObj, UINT8 idx )
} }
else if ( Item[ pObj->usItem ].usItemClass & IC_FACE ) else if ( Item[ pObj->usItem ].usItemClass & IC_FACE )
{ {
if (ItemIsGasmask(pObj->usItem)) if ( Item[ pObj->usItem ].gasmask )
value = (*pObj)[idx]->data.objectStatus; value = (*pObj)[idx]->data.objectStatus;
else if ( Item[ pObj->usItem ].hearingrangebonus ) else if ( Item[ pObj->usItem ].hearingrangebonus )
{ {
@@ -4186,7 +4186,7 @@ void TakeMilitiaEquipmentfromSector( INT16 sMapX, INT16 sMapY, INT8 sMapZ, SOLDI
else if ( Item[pWorldItem[ uiCount ].object.usItem].usItemClass & IC_FACE && (!si[SI_SIGHT].done || !si[SI_FACE2].done || !si[SI_FACE_SPARESIGHT].done || !si[SI_GASMASK].done) ) else if ( Item[pWorldItem[ uiCount ].object.usItem].usItemClass & IC_FACE && (!si[SI_SIGHT].done || !si[SI_FACE2].done || !si[SI_FACE_SPARESIGHT].done || !si[SI_GASMASK].done) )
{ {
// gasmasks are reserved for a special slot and will only be worn if we do not have 2 face items. items that increase our vision (NVGs adn sungooggles) get to slot 1, everything else in 2 // gasmasks are reserved for a special slot and will only be worn if we do not have 2 face items. items that increase our vision (NVGs adn sungooggles) get to slot 1, everything else in 2
if (ItemIsGasmask(pWorldItem[ uiCount ].object.usItem)) if ( Item[ pWorldItem[ uiCount ].object.usItem ].gasmask )
EvaluateObjForItem( pWorldItem, pObj, uiCount, &si[SI_GASMASK] ); EvaluateObjForItem( pWorldItem, pObj, uiCount, &si[SI_GASMASK] );
else if ( Item[ pWorldItem[ uiCount ].object.usItem ].nightvisionrangebonus > 0 ) else if ( Item[ pWorldItem[ uiCount ].object.usItem ].nightvisionrangebonus > 0 )
{ {
@@ -4265,7 +4265,7 @@ void TakeMilitiaEquipmentfromSector( INT16 sMapX, INT16 sMapY, INT8 sMapZ, SOLDI
if ( fnd == launcherhelpmap.end() ) if ( fnd == launcherhelpmap.end() )
{ {
LauncherHelpStruct tmp; LauncherHelpStruct tmp;
tmp.fNeedsAmmo = !ItemIsSingleShotRocketLauncher(pWorldItem[ uiCount ].object.usItem); tmp.fNeedsAmmo = !Item[pWorldItem[ uiCount ].object.usItem].singleshotrocketlauncher;
launcherhelpmap[ pWorldItem[ uiCount ].object.usItem ] = tmp; launcherhelpmap[ pWorldItem[ uiCount ].object.usItem ] = tmp;
} }
} }
+1 -1
View File
@@ -1595,7 +1595,7 @@ OBJECTTYPE& OBJECTTYPE::operator=(const OLD_OBJECTTYPE_101& src)
} }
else if ( EXPLOSIVE_GUN( this->usItem ) ) else if ( EXPLOSIVE_GUN( this->usItem ) )
{ {
if (ItemIsSingleShotRocketLauncher(this->usItem)) if ( Item[this->usItem].singleshotrocketlauncher )
{ {
(*this)[0]->data.gun.ubGunShotsLeft = 1; (*this)[0]->data.gun.ubGunShotsLeft = 1;
} }
+258 -221
View File
@@ -738,18 +738,18 @@ extern OBJECTTYPE gTempObject;
// note that these should not be used to determine what kind of an attachment an item is, that is determined by attachmentclass and the AC_xxx flags above // note that these should not be used to determine what kind of an attachment an item is, that is determined by attachmentclass and the AC_xxx flags above
#define BLOOD_BAG 0x00000001 //1 // this item is a blood bag can can be used to boost surgery #define BLOOD_BAG 0x00000001 //1 // this item is a blood bag can can be used to boost surgery
#define MANPAD 0x00000002 //2 // this item is a MAn-Portable Air-Defense System #define MANPAD 0x00000002 //2 // this item is a MAn-Portable Air-Defense System
#define BEARTRAP 0x00000004 //4 // a mechanical trap that does no explosion, but causes leg damage to whoever activates it #define BEARTRAP 0x00000004 //4 // a mechanical trap that does no explosion, but causes leg damage to whoever activates it
#define CAMERA 0x00000008 //8 #define CAMERA 0x00000008 //8
#define WATER_DRUM 0x00000010 //16 // water drums allow to refill canteens in the sector they are in #define WATER_DRUM 0x00000010 //16 // water drums allow to refill canteens in the sector they are in
#define MEAT_BLOODCAT 0x00000020 //32 // retrieve this by gutting a bloodcat #define MEAT_BLOODCAT 0x00000020 //32 // retrieve this by gutting a bloodcat
#define MEAT_COW 0x00000040 //64 // retrieve this by gutting a cow #define MEAT_COW 0x00000040 //64 // retrieve this by gutting a cow
#define BELT_FED 0x00000080 //128 // item can be fed externally #define BELT_FED 0x00000080 //128 // item can be fed externally
#define AMMO_BELT 0x00000100 //256 // this item can be used to feed externally #define AMMO_BELT 0x00000100 //256 // this item can be used to feed externally
#define AMMO_BELT_VEST 0x00000200 //512 // this is a vest that can contain AMMO_BELT items in its medium slots #define AMMO_BELT_VEST 0x00000200 //512 // this is a vest that can contain AMMO_BELT items in its medium slots
#define CAMO_REMOVAL 0x00000400 //1024 // item can be used to remove camo #define CAMO_REMOVAL 0x00000400 //1024 // item can be used to remove camo
#define CLEANING_KIT 0x00000800 //2048 // weapon cleaning kit #define CLEANING_KIT 0x00000800 //2048 // weapon cleaning kit
#define ATTENTION_ITEM 0x00001000 //4096 // this item is 'interesting' to the AI. Dumb soldiers may try to pick it up #define ATTENTION_ITEM 0x00001000 //4096 // this item is 'interesting' to the AI. Dumb soldiers may try to pick it up
#define GAROTTE 0x00002000 //8192 // this item is a garotte #define GAROTTE 0x00002000 //8192 // this item is a garotte
@@ -758,18 +758,18 @@ extern OBJECTTYPE gTempObject;
#define SKIN_BLOODCAT 0x00010000 //65536 // retrieve this by skinning (=decapitating) a bloodcat #define SKIN_BLOODCAT 0x00010000 //65536 // retrieve this by skinning (=decapitating) a bloodcat
#define NO_METAL_DETECTION 0x00020000 //131072 // a planted bomb with this flag can NOT be detected via metal detector. Use sparingly! #define NO_METAL_DETECTION 0x00020000 //131072 // a planted bomb with this flag can NOT be detected via metal detector. Use sparingly!
#define JUMP_GRENADE 0x00040000 //262144 // add +25 heigth to explosion, used for bouncing grenades and jumping mines #define JUMP_GRENADE 0x00040000 //262144 // add +25 heigth to explosion, used for bouncing grenades and jumping mines
#define HANDCUFFS 0x00080000 //524288 // item can be used to capture soldiers #define HANDCUFFS 0x00080000 //524288 // item can be used to capture soldiers
#define TASER 0x00100000 //1048576 // item is a taser, melee hits with this will drain breath (if batteries are supplied) #define TASER 0x00100000 //1048576 // item is a taser, melee hits with this will drain breath (if batteries are supplied)
#define SCUBA_BOTTLE 0x00200000 //2097152 // item is a scuba gear air bottle #define SCUBA_BOTTLE 0x00200000 //2097152 // item is a scuba gear air bottle
#define SCUBA_MASK 0x00400000 //4194304 // item is a scuba gear breathing mask #define SCUBA_MASK 0x00400000 //4194304 // item is a scuba gear breathing mask
#define SCUBA_FINS 0x00800000 //8388608 // this item speed up swimming, but slows walking and running #define SCUBA_FINS 0x00800000 //8388608 // this item speed up swimming, but slows walking and running
#define TRIPWIREROLL 0x01000000 //16777216 // this item is a tripwire roll #define TRIPWIREROLL 0x01000000 //16777216 // this item is a tripwire roll
#define RADIO_SET 0x02000000 //33554432 // item can be used to radio militia/squads in other sectors #define RADIO_SET 0x02000000 //33554432 // item can be used to radio militia/squads in other sectors
#define SIGNAL_SHELL 0x04000000 //67108864 // this is a signal shell that precedes artillery barrages #define SIGNAL_SHELL 0x04000000 //67108864 // this is a signal shell that precedes artillery barrages
#define SODA 0x08000000 //134217728 // item is a can of soda, sold in vending machines #define SODA 0x08000000 //134217728 // item is a can of soda, sold in vending machines
#define ROOF_COLLAPSE_ITEM 0x10000000 //268435456 // this item is required in the collapsing of roof tiles. It is used internally and should never be seen by the player #define ROOF_COLLAPSE_ITEM 0x10000000 //268435456 // this item is required in the collapsing of roof tiles. It is used internally and should never be seen by the player
#define DISEASEPROTECTION_1 0x20000000 //536870912 // this item protects us from getting diseases by human contact if kept in inventory #define DISEASEPROTECTION_1 0x20000000 //536870912 // this item protects us from getting diseases by human contact if kept in inventory
@@ -779,98 +779,6 @@ extern OBJECTTYPE gTempObject;
// extended flagmask to UINT64 // extended flagmask to UINT64
#define EMPTY_BLOOD_BAG 0x0000000100000000 // this item is a empty blood bag #define EMPTY_BLOOD_BAG 0x0000000100000000 // this item is a empty blood bag
#define MEDICAL_SPLINT 0x0000000200000000 // this item is a medical splint that can be applied to some diseases #define MEDICAL_SPLINT 0x0000000200000000 // this item is a medical splint that can be applied to some diseases
#define ITEM_damageable 0x0000000400000000
#define ITEM_repairable 0x0000000800000000
#define ITEM_waterdamages 0x0000001000000000
#define ITEM_metal 0x0000002000000000
#define ITEM_sinks 0x0000004000000000
#define ITEM_showstatus 0x0000008000000000
#define ITEM_hiddenaddon 0x0000010000000000
#define ITEM_twohanded 0x0000020000000000
#define ITEM_notbuyable 0x0000040000000000
#define ITEM_attachment 0x0000080000000000
#define ITEM_hiddenattachment 0x0000100000000000
#define ITEM_biggunlist 0x0000200000000000
#define ITEM_notineditor 0x0000400000000000
#define ITEM_defaultundroppable 0x0000800000000000
#define ITEM_unaerodynamic 0x0001000000000000
#define ITEM_electronic 0x0002000000000000
#define ITEM_cannon 0x0004000000000000
#define ITEM_rocketrifle 0x0008000000000000
#define ITEM_fingerprintid 0x0010000000000000
#define ITEM_metaldetector 0x0020000000000000
#define ITEM_gasmask 0x0040000000000000
#define ITEM_lockbomb 0x0080000000000000
#define ITEM_flare 0x0100000000000000
#define ITEM_grenadelauncher 0x0200000000000000
#define ITEM_mortar 0x0400000000000000
#define ITEM_duckbill 0x0800000000000000
//UNUSED #define ITEM_detonator 0x1000000000000000
//UNUSED #define ITEM_remotedetonator 0x2000000000000000
#define ITEM_hidemuzzleflash 0x4000000000000000
#define ITEM_rocketlauncher 0x8000000000000000
// New UINT64 Item Flag => usItemFlag2
#define ITEM_singleshotrocketlauncher 0x00000001
#define ITEM_brassknuckles 0x00000002
#define ITEM_crowbar 0x00000004
#define ITEM_glgrenade 0x00000008
#define ITEM_flakjacket 0x00000010
#define ITEM_leatherjacket 0x00000020
#define ITEM_batteries 0x00000040
#define ITEM_needsbatteries 0x00000080
#define ITEM_xray 0x00000100
#define ITEM_wirecutters 0x00000200
#define ITEM_toolkit 0x00000400
#define ITEM_firstaidkit 0x00000800
#define ITEM_medicalkit 0x00001000
#define ITEM_canteen 0x00002000
#define ITEM_jar 0x00004000
#define ITEM_canandstring 0x00008000
#define ITEM_marbles 0x00010000
#define ITEM_walkman 0x00020000
#define ITEM_remotetrigger 0x00040000
#define ITEM_robotremotecontrol 0x00080000
#define ITEM_camouflagekit 0x00100000
#define ITEM_locksmithkit 0x00200000
#define ITEM_mine 0x00400000
#define ITEM_antitankmine 0x00800000
#define ITEM_hardware 0x01000000
#define ITEM_medical 0x02000000
#define ITEM_gascan 0x04000000
#define ITEM_containsliquid 0x08000000
#define ITEM_rock 0x10000000
#define ITEM_thermaloptics 0x20000000
#define ITEM_scifi 0x40000000
#define ITEM_newinv 0x80000000
#define ITEM_DiseaseSystemExclusive 0x0000000100000000 // kitty: item exclusively available with disease feature
#define ITEM_barrel 0x0000000200000000 // item can be used on some guns as an exchange barrel
#define ITEM_tripwireactivation 0x0000000400000000 // item (mine) can be activated by nearby tripwire
#define ITEM_tripwire 0x0000000800000000 // item is tripwire
#define ITEM_directional 0x0000001000000000 // item is a directional mine/bomb (actual direction is set upon planting)
#define ITEM_blockironsight 0x0000002000000000 // if a gun or any attachment have this property, the iron sight won't be usable (if there is at least one other usable sight)
#define ITEM_fAllowClimbing 0x0000004000000000 // JMich: BackpackClimb does item allow climbing while wearing it
#define ITEM_cigarette 0x0000008000000000 // Flugente: this item can be smoked
#define ITEM_fProvidesRobotCamo 0x0000010000000000 // rftr: robot attachments
#define ITEM_fProvidesRobotNightVision 0x0000020000000000 // rftr: robot attachments
#define ITEM_fProvidesRobotLaserBonus 0x0000040000000000 // rftr: robot attachments
// ---------------------------------------------------------------- // ----------------------------------------------------------------
@@ -1039,48 +947,160 @@ extern OBJECTTYPE gTempObject;
// autofiretohitbonus, // autofiretohitbonus,
// bursttohitbonus // bursttohitbonus
typedef struct typedef struct
{ {
CHAR16 szItemDesc[400]; UINT32 usItemClass;
CHAR16 szBRDesc[400]; UINT64 nasAttachmentClass; //CHRISL: Identify the class of attachment
UINT64 nasLayoutClass;
//Madd: Common Attachment Framework: attach items based on matching connection points rather than using the old long attachmentinfo method
UINT64 ulAvailableAttachmentPoint;
UINT64 ulAttachmentPoint;
UINT8 ubAttachToPointAPCost; // cost to attach to any matching point
UINT16 ubClassIndex;
UINT8 ubCursor;
INT8 bSoundType;
UINT8 ubGraphicType;
UINT16 ubGraphicNum;
UINT16 ubWeight; //2 units per kilogram; roughly 1 unit per pound
UINT8 ubPerPocket;
UINT16 ItemSize;
UINT16 usPrice;
UINT8 ubCoolness;
INT8 bReliability;
INT8 bRepairEase;
UINT16 fFlags;
UINT32 uiIndex; // added
CHAR16 szItemName[80]; //+1 for the null terminator //added CHAR16 szItemName[80]; //+1 for the null terminator //added
BOOLEAN damageable;
BOOLEAN repairable;
BOOLEAN waterdamages;
BOOLEAN metal;
BOOLEAN sinks;
BOOLEAN showstatus;
BOOLEAN hiddenaddon;
BOOLEAN twohanded;
BOOLEAN notbuyable;
BOOLEAN attachment;
BOOLEAN hiddenattachment;
BOOLEAN biggunlist;
BOOLEAN notineditor;
BOOLEAN defaultundroppable;
BOOLEAN unaerodynamic;
BOOLEAN electronic;
UINT8 inseparable; //Madd:Normally, an inseparable attachment can never be removed.
//But now we will make it so that these items can be replaced, but still not removed directly.
//0 = removeable (as before)
//1 = inseparable (as before)
//2 = inseparable, but replaceable
CHAR16 szLongItemName[80]; CHAR16 szLongItemName[80];
CHAR16 szItemDesc[400];
CHAR16 szBRName[80]; CHAR16 szBRName[80];
CHAR16 szBRDesc[400];
//TODO: quest items, boosters, money
// special item/attachment functions:
BOOLEAN cannon;
BOOLEAN rocketrifle;
BOOLEAN fingerprintid;
BOOLEAN metaldetector;
BOOLEAN gasmask;
BOOLEAN lockbomb;
BOOLEAN flare;
INT16 percentnoisereduction;
INT16 bipod;
INT16 tohitbonus;
INT16 bestlaserrange;
INT16 rangebonus;
INT16 percentrangebonus;
INT16 aimbonus;
INT16 minrangeforaimbonus;
INT16 percentapreduction;
INT16 percentstatusdrainreduction;
BOOLEAN grenadelauncher;
BOOLEAN mortar;
BOOLEAN duckbill;
BOOLEAN detonator;
BOOLEAN remotedetonator;
BOOLEAN hidemuzzleflash;
BOOLEAN rocketlauncher;
BOOLEAN singleshotrocketlauncher;
UINT16 discardedlauncheritem;
BOOLEAN brassknuckles;
//*** ddd UINT16 bloodieditem;
INT16 bloodieditem;
BOOLEAN crowbar;
BOOLEAN glgrenade;
BOOLEAN flakjacket;
INT16 hearingrangebonus;
INT16 visionrangebonus;
INT16 nightvisionrangebonus;
INT16 dayvisionrangebonus;
INT16 cavevisionrangebonus;
INT16 brightlightvisionrangebonus;
INT16 itemsizebonus;
BOOLEAN leatherjacket;
BOOLEAN batteries;
BOOLEAN needsbatteries;
BOOLEAN xray;
BOOLEAN wirecutters;
BOOLEAN toolkit;
BOOLEAN firstaidkit;
BOOLEAN medicalkit;
BOOLEAN canteen;
BOOLEAN jar;
BOOLEAN canandstring;
BOOLEAN marbles;
BOOLEAN walkman;
BOOLEAN remotetrigger;
BOOLEAN robotremotecontrol;
BOOLEAN camouflagekit;
BOOLEAN locksmithkit;
BOOLEAN mine;
BOOLEAN antitankmine;
FLOAT alcohol;
BOOLEAN hardware;
BOOLEAN medical;
BOOLEAN gascan;
BOOLEAN containsliquid;
BOOLEAN rock;
INT16 damagebonus;
INT16 meleedamagebonus;
INT16 magsizebonus;
INT16 percentautofireapreduction;
INT16 autofiretohitbonus;
INT16 APBonus;
INT16 rateoffirebonus;
INT16 burstsizebonus;
INT16 bursttohitbonus;
INT16 percentreadytimeapreduction;
INT16 bulletspeedbonus;
BOOLEAN thermaloptics;
UINT8 percenttunnelvision;
INT16 percentreloadtimeapreduction;
INT16 percentburstfireapreduction;
INT16 camobonus;
INT16 stealthbonus;
INT16 urbanCamobonus;
INT16 desertCamobonus;
INT16 snowCamobonus;
BOOLEAN scifi; // item only available in scifi mode
BOOLEAN newinv; // item only available in new inventory mode
UINT8 ubAttachmentSystem; //Item availability per attachment system: 0 = both, 1 = OAS, 2 = NAS
UINT16 defaultattachments[MAX_DEFAULT_ATTACHMENTS]; //Need more default attachments, chose an array to do so. (no vector / list just to keep this all plain data) UINT16 defaultattachments[MAX_DEFAULT_ATTACHMENTS]; //Need more default attachments, chose an array to do so. (no vector / list just to keep this all plain data)
UINT64 nasAttachmentClass; //CHRISL: Identify the class of attachment
UINT64 nasLayoutClass;
UINT64 ulAvailableAttachmentPoint;
UINT64 ulAttachmentPoint;
UINT64 usItemFlag; // bitflags to store various item properties (better than introducing 64 BOOLEAN values). If I only had thought of this earlier....
UINT64 usItemFlag2; // bitflags to store various item properties
UINT32 uiIndex;
UINT32 usItemClass;
UINT32 attachmentclass; // attachmentclass used
UINT32 drugtype; // this flagmask determines what different components are used in a drug, which results in different effects
UINT32 foodtype;
UINT32 usActionItemFlag; // Flugente: a flag that is necessary for transforming action items to objects with new abilities (for now, tripwire networks and directional explosives)
UINT32 clothestype; // Flugente: clothes type that 'links' to an entry in Clothes.xml
//zilpin: pellet spread patterns externalized in XML //zilpin: pellet spread patterns externalized in XML
INT32 spreadPattern; INT32 spreadPattern;
FLOAT alcohol;
// HEADROCK HAM 4: New modifiers that do not require a stance array, since they affect the gun objectively, not
// subjectively.
FLOAT RecoilModifierX;
FLOAT RecoilModifierY;
FLOAT scopemagfactor;
FLOAT projectionfactor;
FLOAT usOverheatingCooldownFactor; // every turn/5 seconds, a gun's temperature is lowered by this amount
FLOAT overheatTemperatureModificator; // percentage modifier of heat a shot generates (read from attachments)
FLOAT overheatCooldownModificator; // percentage modifier of cooldown amount (read from attachments, applies to guns & barrels)
FLOAT overheatJamThresholdModificator; // percentage modifier of a gun's jam threshold (read from attachments)
FLOAT overheatDamageThresholdModificator; // percentage modifier of a gun's damage threshold (read from attachments)
FLOAT dirtIncreaseFactor; // Flugente: advanced repair/dirt system. One shot causes this much dirt on a gun
FLOAT fRobotDamageReductionModifier; // rftr: robot attachments
// HEADROCK HAM 4: New variable arrays for the New CTH system. // HEADROCK HAM 4: New variable arrays for the New CTH system.
INT16 flatbasemodifier[3]; INT16 flatbasemodifier[3];
INT16 percentbasemodifier[3]; INT16 percentbasemodifier[3];
@@ -1093,98 +1113,115 @@ typedef struct
INT16 counterforceaccuracymodifier[3]; INT16 counterforceaccuracymodifier[3];
INT16 targettrackingmodifier[3]; INT16 targettrackingmodifier[3];
INT16 aimlevelsmodifier[3]; INT16 aimlevelsmodifier[3];
// HEADROCK HAM 4: New modifiers that do not require a stance array, since they affect the gun objectively, not
//Madd: Common Attachment Framework: attach items based on matching connection points rather than using the old long attachmentinfo method // subjectively.
UINT16 ubClassIndex; FLOAT RecoilModifierX;
UINT16 ubGraphicNum; FLOAT RecoilModifierY;
UINT16 ubWeight; //2 units per kilogram; roughly 1 unit per pound
UINT16 ItemSize;
UINT16 usPrice;
UINT16 discardedlauncheritem;
UINT16 randomitem; // Flugente: a link to RandomItemsClass.xml. Out of such an item, a random object is created, depending on the entries in the xml
UINT16 usBuddyItem; // Flugente: item is connected to another item. Type of connection depends on item specifics
UINT16 usRiotShieldStrength; // Flugente: riot shields. strength of shield
UINT16 usRiotShieldGraphic; // Flugente: riot shields. graphic of shield (when deployed in tactical, taken from Tilecache/riotshield.sti)
INT16 percentnoisereduction;
INT16 bipod;
INT16 tohitbonus;
INT16 bestlaserrange;
INT16 rangebonus;
INT16 percentrangebonus;
INT16 aimbonus;
INT16 minrangeforaimbonus;
INT16 percentapreduction;
INT16 percentstatusdrainreduction;
INT16 bloodieditem;
INT16 hearingrangebonus;
INT16 visionrangebonus;
INT16 nightvisionrangebonus;
INT16 dayvisionrangebonus;
INT16 cavevisionrangebonus;
INT16 brightlightvisionrangebonus;
INT16 itemsizebonus;
INT16 damagebonus;
INT16 meleedamagebonus;
INT16 magsizebonus;
INT16 percentautofireapreduction;
INT16 autofiretohitbonus;
INT16 APBonus;
INT16 rateoffirebonus;
INT16 burstsizebonus;
INT16 bursttohitbonus;
INT16 percentreadytimeapreduction;
INT16 bulletspeedbonus;
INT16 percentreloadtimeapreduction;
INT16 percentburstfireapreduction;
INT16 camobonus;
INT16 stealthbonus;
INT16 urbanCamobonus;
INT16 desertCamobonus;
INT16 snowCamobonus;
INT16 PercentRecoilModifier; INT16 PercentRecoilModifier;
INT16 percentaccuracymodifier; INT16 percentaccuracymodifier;
INT16 usSpotting; // Flugente: spotting effectiveness FLOAT scopemagfactor;
INT16 sBackpackWeightModifier; // JMich: BackpackClimb modifier to weight calculation to climb. FLOAT projectionfactor;
INT16 sFireResistance; BOOLEAN speeddot;
UINT8 ubAttachToPointAPCost; // cost to attach to any matching point // Flugente
UINT8 ubCursor; BOOLEAN barrel; // item can be used on some guns as an exchange barrel
UINT8 ubGraphicType; FLOAT usOverheatingCooldownFactor; // every turn/5 seconds, a gun's temperature is lowered by this amount
UINT8 ubPerPocket; FLOAT overheatTemperatureModificator; // percentage modifier of heat a shot generates (read from attachments)
UINT8 ubCoolness; FLOAT overheatCooldownModificator; // percentage modifier of cooldown amount (read from attachments, applies to guns & barrels)
UINT8 percenttunnelvision; FLOAT overheatJamThresholdModificator; // percentage modifier of a gun's jam threshold (read from attachments)
UINT8 ubAttachmentSystem; //Item availability per attachment system: 0 = both, 1 = OAS, 2 = NAS FLOAT overheatDamageThresholdModificator; // percentage modifier of a gun's damage threshold (read from attachments)
UINT8 CrowbarModifier;
UINT8 DisarmModifier;
UINT8 usHackingModifier;
UINT8 usBurialModifier; // Flugente: a modifier for burial effectiveness
UINT8 usDamageChance; // Flugente: advanced repair/dirt system. Chance that damage to the status will also damage the repair threshold
UINT8 usFlashLightRange; // Flugente: range of a flashlight (an item with usFlashLightRange > 0 is deemed a flashlight)
UINT8 usItemChoiceTimeSetting; // Flugente: determine wether the AI should pick this item for its choices only at certain times
UINT8 ubSleepModifier; // silversurfer: item provides breath regeneration bonus while resting
UINT8 usPortionSize; // Flugente: for consumables: how much of this item is consumed at once
UINT8 usAdministrationModifier; // Flugente: a modifier for administration effectiveness
UINT8 inseparable; //Madd:Normally, an inseparable attachment can never be removed.
//But now we will make it so that these items can be replaced, but still not removed directly.
//0 = removeable (as before)
//1 = inseparable (as before)
//2 = inseparable, but replaceable
INT8 bSoundType; UINT32 attachmentclass; // attachmentclass used
INT8 bReliability;
INT8 bRepairEase; BOOLEAN tripwireactivation; // item (mine) can be activated by nearby tripwire
INT8 LockPickModifier; BOOLEAN tripwire; // item is tripwire
INT8 RepairModifier; BOOLEAN directional; // item is a directional mine/bomb (actual direction is set upon planting)
INT8 randomitemcoolnessmodificator; // Flugente: a link to RandomItemsClass.xml. alters the allowed maximum coolness a random item can have
INT8 bRobotStrBonus; // rftr: robot attachments UINT32 drugtype; // this flagmask determines what different components are used in a drug, which results in different effects
INT8 bRobotAgiBonus; // rftr: robot attachments
INT8 bRobotDexBonus; // rftr: robot attachments BOOLEAN blockironsight; // if a gun or any attachment have this property, the iron sight won't be usable (if there is at least one other usable sight)
INT8 bRobotTargetingSkillGrant; // rftr: robot attachments
INT8 bRobotChassisSkillGrant; // rftr: robot attachments UINT64 usItemFlag; // bitflags to store various item properties (better than introducing 32 BOOLEAN values). If I only had thought of this earlier....
INT8 bRobotUtilitySkillGrant; // rftr: robot attachments
INT8 iTransportGroupMinProgress; // rftr: the progress bounds that allow a transport group to drop an item // Flugente: food type
INT8 iTransportGroupMaxProgress; // rftr: the progress bounds that allow a transport group to drop an item UINT32 foodtype;
//JMich_SkillModifiers: Adding new skill modifiers
INT8 LockPickModifier;
UINT8 CrowbarModifier;
UINT8 DisarmModifier;
INT8 RepairModifier;
// Flugente: a modifier to hacking
UINT8 usHackingModifier;
// Flugente: a modifier for burial effectiveness
UINT8 usBurialModifier;
// Flugente: advanced repair/dirt system
UINT8 usDamageChance; // chance that damage to the status will also damage the repair threshold
FLOAT dirtIncreaseFactor; // one shot causes this much dirt on a gun
// Flugente: a flag that is necessary for transforming action items to objects with new abilities (for now, tripwire networks and directional explosives)
UINT32 usActionItemFlag;
// Flugente: clothes type that 'links' to an entry in Clothes.xml
UINT32 clothestype;
// Flugente: a link to RandomItemsClass.xml. Out of such an item, a random object is created, depending on the entries in the xml
UINT16 randomitem;
INT8 randomitemcoolnessmodificator; // alters the allowed maximum coolness a random item can have
// Flugente: range of a flashlight (an item with usFlashLightRange > 0 is deemed a flashlight)
UINT8 usFlashLightRange;
// Flugente: determine wether the AI should pick this item for its choices only at certain times
UINT8 usItemChoiceTimeSetting;
// Flugente: item is connected to another item. Type of connection depends on item specifics
UINT16 usBuddyItem;
// silversurfer: item provides breath regeneration bonus while resting
UINT8 ubSleepModifier;
// Flugente: spotting effectiveness
INT16 usSpotting;
//JMich.BackpackClimb
INT16 sBackpackWeightModifier; //modifier to weight calculation to climb.
BOOLEAN fAllowClimbing; //does item allow climbing while wearing it
BOOLEAN cigarette; // Flugente: this item can be smoked
UINT8 usPortionSize; // Flugente: for consumables: how much of this item is consumed at once
// Flugente: riot shields
UINT16 usRiotShieldStrength; // strength of shield
UINT16 usRiotShieldGraphic; // graphic of shield (when deployed in tactical, taken from Tilecache/riotshield.sti)
// Flugente: fire resistance
INT16 sFireResistance;
// Flugente: a modifier for administration effectiveness
UINT8 usAdministrationModifier;
// rftr: robot attachments
FLOAT fRobotDamageReductionModifier;
INT8 bRobotStrBonus;
INT8 bRobotAgiBonus;
INT8 bRobotDexBonus;
INT8 bRobotTargetingSkillGrant;
INT8 bRobotChassisSkillGrant;
INT8 bRobotUtilitySkillGrant;
BOOLEAN fProvidesRobotCamo;
BOOLEAN fProvidesRobotNightVision;
BOOLEAN fProvidesRobotLaserBonus;
// kitty: item exclusively available with disease feature
BOOLEAN DiseaseSystemExclusive;
// rftr: the progress bounds that allow a transport group to drop an item
INT8 iTransportGroupMinProgress;
INT8 iTransportGroupMaxProgress;
} INVTYPE; } INVTYPE;
+170 -240
View File
File diff suppressed because it is too large Load Diff
+4 -72
View File
@@ -179,76 +179,8 @@ BOOLEAN ValidAttachmentClass( UINT16 usAttachment, UINT16 usItem );
//Determines if it is possible to equip this weapon with this ammo. //Determines if it is possible to equip this weapon with this ammo.
BOOLEAN ValidAmmoType( UINT16 usItem, UINT16 usAmmoType ); BOOLEAN ValidAmmoType( UINT16 usItem, UINT16 usAmmoType );
BOOLEAN ItemIsDamageable(UINT16 usItem); //Determines if this item is a two handed item.
BOOLEAN ItemIsRepairable(UINT16 usItem); BOOLEAN TwoHandedItem( UINT16 usItem );
BOOLEAN ItemIsDamagedByWater(UINT16 usItem);
BOOLEAN ItemIsMetal(UINT16 usItem);
BOOLEAN ItemSinks(UINT16 usItem);
BOOLEAN ItemIsTwoHanded(UINT16 usItem);
BOOLEAN ItemIsHiddenAddon(UINT16 usItem);
BOOLEAN ItemIsNotBuyable(UINT16 usItem);
BOOLEAN ItemIsAttachment(UINT16 usItem);
BOOLEAN ItemIsHiddenAttachment(UINT16 usItem);
BOOLEAN ItemIsOnlyInTonsOfGuns(UINT16 usItem);
BOOLEAN ItemIsNotInEditor(UINT16 usItem);
BOOLEAN ItemIsUndroppableByDefault(UINT16 usItem);
BOOLEAN ItemIsUnaerodynamic(UINT16 usItem);
BOOLEAN ItemIsElectronic(UINT16 usItem);
BOOLEAN ItemIsCannon(UINT16 usItem);
BOOLEAN ItemIsRocketRifle(UINT16 usItem);
BOOLEAN ItemHasFingerPrintID(UINT16 usItem);
BOOLEAN ItemIsMetalDetector(UINT16 usItem);
BOOLEAN ItemIsGasmask(UINT16 usItem);
BOOLEAN ItemIsLockBomb(UINT16 usItem);
BOOLEAN ItemIsFlare(UINT16 usItem);
BOOLEAN ItemIsGrenadeLauncher(UINT16 usItem);
BOOLEAN ItemIsMortar(UINT16 usItem);
BOOLEAN ItemIsDuckbill(UINT16 usItem);
BOOLEAN ItemHasHiddenMuzzleFlash(UINT16 usItem);
BOOLEAN ItemIsRocketLauncher(UINT16 usItem);
BOOLEAN ItemIsSingleShotRocketLauncher(UINT16 usItem);
BOOLEAN ItemIsBrassKnuckles(UINT16 usItem);
BOOLEAN ItemIsCrowbar(UINT16 usItem);
BOOLEAN ItemIsGLgrenade(UINT16 usItem);
BOOLEAN ItemIsFlakJacket(UINT16 usItem);
BOOLEAN ItemIsLeatherJacket(UINT16 usItem);
BOOLEAN ItemIsBatteries(UINT16 usItem);
BOOLEAN ItemNeedsBatteries(UINT16 usItem);
BOOLEAN ItemHasXRay(UINT16 usItem);
BOOLEAN ItemIsWirecutters(UINT16 usItem);
BOOLEAN ItemIsToolkit(UINT16 usItem);
BOOLEAN ItemIsFirstAidKit(UINT16 usItem);
BOOLEAN ItemIsMedicalKit(UINT16 usItem);
BOOLEAN ItemIsCanteen(UINT16 usItem);
BOOLEAN ItemIsJar(UINT16 usItem);
BOOLEAN ItemIsCanAndString(UINT16 usItem);
BOOLEAN ItemIsMarbles(UINT16 usItem);
BOOLEAN ItemIsWalkman(UINT16 usItem);
BOOLEAN ItemIsRemoteTrigger(UINT16 usItem);
BOOLEAN ItemIsRobotRemote(UINT16 usItem);
BOOLEAN ItemIsCamoKit(UINT16 usItem);
BOOLEAN ItemIsLocksmithKit(UINT16 usItem);
BOOLEAN ItemIsMine(UINT16 usItem);
BOOLEAN ItemIsATMine(UINT16 usItem);
BOOLEAN ItemIsHardware(UINT16 usItem);
BOOLEAN ItemIsMedical(UINT16 usItem);
BOOLEAN ItemIsGascan(UINT16 usItem);
BOOLEAN ItemContainsLiquid(UINT16 usItem);
BOOLEAN ItemIsRock(UINT16 usItem);
BOOLEAN ItemIsThermalOptics(UINT16 usItem);
BOOLEAN ItemIsOnlyInScifi(UINT16 usItem);
BOOLEAN ItemIsOnlyInNIV(UINT16 usItem);
BOOLEAN ItemIsBarrel(UINT16 usItem);
BOOLEAN ItemHasTripwireActivation(UINT16 usItem);
BOOLEAN ItemIsTripwire(UINT16 usItem);
BOOLEAN ItemIsDirectional(UINT16 usItem);
BOOLEAN ItemBlocksIronsight(UINT16 usItem);
BOOLEAN ItemAllowsClimbing(UINT16 usItem);
BOOLEAN ItemIsCigarette(UINT16 usItem);
BOOLEAN ItemIsOnlyInDisease(UINT16 usItem);
BOOLEAN ItemProvidesRobotCamo(UINT16 usItem);
BOOLEAN ItemProvidesRobotNightvision(UINT16 usItem);
BOOLEAN ItemProvidesRobotLaserBonus(UINT16 usItem);
//Existing functions without header def's, added them here, just incase I'll need to call //Existing functions without header def's, added them here, just incase I'll need to call
//them from the editor. //them from the editor.
@@ -290,6 +222,7 @@ UINT8 ConvertObjectTypeMoneyValueToProfileMoneyValue( UINT32 uiMoneyAmount );
BOOLEAN CheckForChainReaction( UINT16 usItem, INT16 bStatus, INT16 bDamage, BOOLEAN fOnGround ); BOOLEAN CheckForChainReaction( UINT16 usItem, INT16 bStatus, INT16 bDamage, BOOLEAN fOnGround );
BOOLEAN ItemIsLegal( UINT16 usItemIndex, BOOLEAN fIgnoreCoolness = FALSE ); BOOLEAN ItemIsLegal( UINT16 usItemIndex, BOOLEAN fIgnoreCoolness = FALSE );
BOOLEAN ExtendedGunListGun( UINT16 usGun );
UINT16 StandardGunListReplacement( UINT16 usGun ); UINT16 StandardGunListReplacement( UINT16 usGun );
UINT16 FindReplacementMagazine( UINT8 ubCalibre, UINT16 ubMagSize, UINT8 ubAmmoType); UINT16 FindReplacementMagazine( UINT8 ubCalibre, UINT16 ubMagSize, UINT8 ubAmmoType);
UINT16 FindReplacementMagazineIfNecessary( UINT16 usOldGun, UINT16 usOldAmmo, UINT16 usNewGun ); UINT16 FindReplacementMagazineIfNecessary( UINT16 usOldGun, UINT16 usOldAmmo, UINT16 usNewGun );
@@ -564,8 +497,7 @@ UINT64 GetAvailableAttachmentPoint ( OBJECTTYPE * pObject, UINT8 subObject );
void CheckBombSpecifics( OBJECTTYPE * pObj, INT8* detonatortype, INT8* setting, INT8* defusefrequency ); void CheckBombSpecifics( OBJECTTYPE * pObj, INT8* detonatortype, INT8* setting, INT8* defusefrequency );
// Flugente: check for specific flags // Flugente: check for specific flags
BOOLEAN HasItemFlag(UINT16 usItem, UINT64 aFlag); BOOLEAN HasItemFlag( UINT16 usItem, UINT64 aFlag );
BOOLEAN HasItemFlag2(UINT16 usItem, UINT64 aFlag);
// Flugente: get first item number that has this flag. Use with caution, as we search in all items // Flugente: get first item number that has this flag. Use with caution, as we search in all items
BOOLEAN GetFirstItemWithFlag( UINT16* pusItem, UINT64 aFlag ); BOOLEAN GetFirstItemWithFlag( UINT16* pusItem, UINT64 aFlag );
+17 -29
View File
@@ -293,8 +293,7 @@ UINT32 POWERGENSECTOR_GRIDNO1 = 15100;
UINT32 POWERGENSECTOR_GRIDNO2 = 12220; UINT32 POWERGENSECTOR_GRIDNO2 = 12220;
UINT32 POWERGENSECTOR_GRIDNO3 = 14155; UINT32 POWERGENSECTOR_GRIDNO3 = 14155;
UINT32 POWERGENSECTOR_GRIDNO4 = 13980; UINT32 POWERGENSECTOR_GRIDNO4 = 13980;
UINT32 POWERGENSECTOREXITGRID_SRC_GRIDNO = 10979; UINT32 POWERGENSECTOREXITGRID_GRIDNO1 = 19749;
UINT32 POWERGENSECTOREXITGRID_DST_GRIDNO = 19749;
UINT32 POWERGENFANSOUND_GRIDNO1 = 10979; UINT32 POWERGENFANSOUND_GRIDNO1 = 10979;
UINT32 POWERGENFANSOUND_GRIDNO2 = 19749; UINT32 POWERGENFANSOUND_GRIDNO2 = 19749;
UINT32 STARTFANBACKUPAGAIN_GRIDNO = 10980; UINT32 STARTFANBACKUPAGAIN_GRIDNO = 10980;
@@ -305,22 +304,17 @@ UINT32 SECTOR_LAUNCH_MISSLES_Y = 12;
UINT32 SECTOR_LAUNCH_MISSLES_Z = 3; UINT32 SECTOR_LAUNCH_MISSLES_Z = 3;
//J13-0 //J13-0
UINT32 SECTOR_FAN_X = 13; UINT32 SECTOR_FAN_X = 13;
UINT32 SECTOR_FAN_Y = 10; UINT32 SECTOR_FAN_Z = 10;
UINT32 SECTOR_FAN_Z = 0; UINT32 SECTOR_FAN_Y = 0;
//K14-1 //K14-1
UINT32 SECTOR_OPEN_GATE_IN_TUNNEL_X = 14; UINT32 SECTOR_OPEN_GATE_IN_TUNNEL_X = 14;
UINT32 SECTOR_OPEN_GATE_IN_TUNNEL_Y = 11; UINT32 SECTOR_OPEN_GATE_IN_TUNNEL_Y = 11;
UINT32 SECTOR_OPEN_GATE_IN_TUNNEL_Z = 1; UINT32 SECTOR_OPEN_GATE_IN_TUNNEL_Z = 1;
// Destination sector for fan exitgrid
//J14-1 //J14-1
UINT32 EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_X = 14; UINT32 EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_X = 14;
UINT32 EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_Y = 10; UINT32 EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_Y = 10;
UINT32 EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_Z = 1; UINT32 EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_Z = 1;
INT16 BETTY_BLOODCAT_SECTOR_X = 10;
INT16 BETTY_BLOODCAT_SECTOR_Y = 9;
INT8 BETTY_BLOODCAT_SECTOR_Z = 0;
void InitGridNoUB() void InitGridNoUB()
{ {
SWITCHINMORRISAREA_GRIDNO = gGameUBOptions.SwitchInMorrisAreaGridNo; //= 15231; SWITCHINMORRISAREA_GRIDNO = gGameUBOptions.SwitchInMorrisAreaGridNo; //= 15231;
@@ -332,8 +326,7 @@ void InitGridNoUB()
POWERGENSECTOR_GRIDNO2 = gGameUBOptions.PowergenSectorGridNo2; //= 12220; POWERGENSECTOR_GRIDNO2 = gGameUBOptions.PowergenSectorGridNo2; //= 12220;
POWERGENSECTOR_GRIDNO3 = gGameUBOptions.PowergenSectorGridNo3; //= 14155; POWERGENSECTOR_GRIDNO3 = gGameUBOptions.PowergenSectorGridNo3; //= 14155;
POWERGENSECTOR_GRIDNO4 = gGameUBOptions.PowergenSectorGridNo4; //= 13980; POWERGENSECTOR_GRIDNO4 = gGameUBOptions.PowergenSectorGridNo4; //= 13980;
POWERGENSECTOREXITGRID_SRC_GRIDNO = gGameUBOptions.PowergenSectorExitgridSrcGridNo; //= 10979; // Exitgrid location in the sector it is created in POWERGENSECTOREXITGRID_GRIDNO1 = gGameUBOptions.PowergenSectorExitgridGridNo; // = 19749;
POWERGENSECTOREXITGRID_DST_GRIDNO = gGameUBOptions.PowergenSectorExitgridGridNo; // = 19749; // Exitgrid location in the destination sector
POWERGENFANSOUND_GRIDNO1 = gGameUBOptions.PowergenFanSoundGridNo1; //= 10979; POWERGENFANSOUND_GRIDNO1 = gGameUBOptions.PowergenFanSoundGridNo1; //= 10979;
POWERGENFANSOUND_GRIDNO2 = gGameUBOptions.PowergenFanSoundGridNo2; //= 19749; POWERGENFANSOUND_GRIDNO2 = gGameUBOptions.PowergenFanSoundGridNo2; //= 19749;
STARTFANBACKUPAGAIN_GRIDNO = gGameUBOptions.StartFanbackupAgainGridNo; //= 10980; STARTFANBACKUPAGAIN_GRIDNO = gGameUBOptions.StartFanbackupAgainGridNo; //= 10980;
@@ -345,8 +338,8 @@ void InitGridNoUB()
SECTOR_LAUNCH_MISSLES_Z = gGameUBOptions.SectorLaunchMisslesZ; //3; SECTOR_LAUNCH_MISSLES_Z = gGameUBOptions.SectorLaunchMisslesZ; //3;
//J13-0 //J13-0
SECTOR_FAN_X = gGameUBOptions.SectorFanX; //13; SECTOR_FAN_X = gGameUBOptions.SectorFanX; //13;
SECTOR_FAN_Y = gGameUBOptions.SectorFanY; //10; SECTOR_FAN_Z = gGameUBOptions.SectorFanY; //10;
SECTOR_FAN_Z = gGameUBOptions.SectorFanZ; //0; SECTOR_FAN_Y = gGameUBOptions.SectorFanZ; //0;
//K14-1 //K14-1
SECTOR_OPEN_GATE_IN_TUNNEL_X = gGameUBOptions.SectorOpenGateInTunnelX; //14; SECTOR_OPEN_GATE_IN_TUNNEL_X = gGameUBOptions.SectorOpenGateInTunnelX; //14;
SECTOR_OPEN_GATE_IN_TUNNEL_Y = gGameUBOptions.SectorOpenGateInTunnelY; //11; SECTOR_OPEN_GATE_IN_TUNNEL_Y = gGameUBOptions.SectorOpenGateInTunnelY; //11;
@@ -356,11 +349,6 @@ void InitGridNoUB()
EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_Y = gGameUBOptions.ExitForFanToPowerGenSectorY; //10; EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_Y = gGameUBOptions.ExitForFanToPowerGenSectorY; //10;
EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_Z = gGameUBOptions.ExitForFanToPowerGenSectorZ; //1; EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_Z = gGameUBOptions.ExitForFanToPowerGenSectorZ; //1;
BETTY_BLOODCAT_SECTOR_X = gGameUBOptions.BettyBloodCatSectorX;
BETTY_BLOODCAT_SECTOR_Y = gGameUBOptions.BettyBloodCatSectorY;
BETTY_BLOODCAT_SECTOR_Z = gGameUBOptions.BettyBloodCatSectorZ;
MANUEL_UB = gGameUBOptions.ubMANUEL_UB; MANUEL_UB = gGameUBOptions.ubMANUEL_UB;
BIGGENS_UB = gGameUBOptions.ubBIGGENS_UB; BIGGENS_UB = gGameUBOptions.ubBIGGENS_UB;
JOHN_K_UB = gGameUBOptions.ubJOHN_K_UB; JOHN_K_UB = gGameUBOptions.ubJOHN_K_UB;
@@ -658,7 +646,7 @@ void HandleWhenCertainPercentageOfEnemiesDie()
UINT32 uiPercentEnemiesKilled; UINT32 uiPercentEnemiesKilled;
UINT8 ubSectorID; UINT8 ubSectorID;
//if there isn't enemies in the sector //if there isnt enemies in the sector
if( ( gTacticalStatus.Team[ ENEMY_TEAM ].bMenInSector + gTacticalStatus.ubArmyGuysKilled ) == 0 ) if( ( gTacticalStatus.Team[ ENEMY_TEAM ].bMenInSector + gTacticalStatus.ubArmyGuysKilled ) == 0 )
{ {
//get out //get out
@@ -675,7 +663,7 @@ void HandleWhenCertainPercentageOfEnemiesDie()
switch( ubSectorID ) switch( ubSectorID )
{ {
case SEC_K15: case SEC_K15:
//all enemies are dead and if the quote hasn't been said yet //all enemies are dead and if the quote hasnt been said yet
if( uiPercentEnemiesKilled >= 100 && !( gJa25SaveStruct.uiJa25GeneralFlags & JA_GF__ALL_DEAD_TOP_LEVEL_OF_COMPLEX ) ) if( uiPercentEnemiesKilled >= 100 && !( gJa25SaveStruct.uiJa25GeneralFlags & JA_GF__ALL_DEAD_TOP_LEVEL_OF_COMPLEX ) )
{ {
INT16 bProfile = RandomProfileIdFromNewMercsOnPlayerTeam(); INT16 bProfile = RandomProfileIdFromNewMercsOnPlayerTeam();
@@ -715,7 +703,7 @@ void StopPowerGenFan()
return; return;
} }
//Remember how the player got through //Remeber how the player got through
SetJa25GeneralFlag( JA_GF__POWER_GEN_FAN_HAS_BEEN_STOPPED ); SetJa25GeneralFlag( JA_GF__POWER_GEN_FAN_HAS_BEEN_STOPPED );
gJa25SaveStruct.ubStateOfFanInPowerGenSector = PGF__STOPPED; gJa25SaveStruct.ubStateOfFanInPowerGenSector = PGF__STOPPED;
@@ -733,7 +721,7 @@ void StopPowerGenFan()
//Turn off the power gen fan sound //Turn off the power gen fan sound
HandleRemovingPowerGenFanSound(); HandleRemovingPowerGenFanSound();
//remember which turn the fan stopped on //remeber which turn the fan stopped on
gJa25SaveStruct.uiTurnPowerGenFanWentDown = gJa25SaveStruct.uiTacticalTurnCounter; gJa25SaveStruct.uiTurnPowerGenFanWentDown = gJa25SaveStruct.uiTacticalTurnCounter;
@@ -741,7 +729,7 @@ void StopPowerGenFan()
// Replace the Fan graphic // Replace the Fan graphic
// //
// Turn on permanent changes.... // Turn on permenant changes....
ApplyMapChangesToMapTempFile( TRUE ); ApplyMapChangesToMapTempFile( TRUE );
//Add the exit grid to the power gen fan //Add the exit grid to the power gen fan
@@ -796,7 +784,7 @@ void StartFanBackUpAgain()
return; return;
} }
//Remember how the player got through //Remeber how the player got through
gJa25SaveStruct.ubStateOfFanInPowerGenSector = PGF__RUNNING_NORMALLY; gJa25SaveStruct.ubStateOfFanInPowerGenSector = PGF__RUNNING_NORMALLY;
@@ -808,7 +796,7 @@ void StartFanBackUpAgain()
// Replace the Fan graphic // Replace the Fan graphic
// //
// Turn on permanent changes.... // Turn on permenant changes....
ApplyMapChangesToMapTempFile( TRUE ); ApplyMapChangesToMapTempFile( TRUE );
// Remove it! // Remove it!
@@ -833,7 +821,7 @@ void StartFanBackUpAgain()
gTacticalStatus.uiFlags |= NOHIDE_REDUNDENCY; gTacticalStatus.uiFlags |= NOHIDE_REDUNDENCY;
//Remove the exit grid //Remove the exit grid
RemoveExitGridFromWorld( POWERGENSECTOREXITGRID_SRC_GRIDNO ); RemoveExitGridFromWorld( PGF__FAN_EXIT_GRID_GRIDNO );
// FOR THE NEXT RENDER LOOP, RE-EVALUATE REDUNDENT TILES // FOR THE NEXT RENDER LOOP, RE-EVALUATE REDUNDENT TILES
SetRenderFlags(RENDER_FLAG_FULL); SetRenderFlags(RENDER_FLAG_FULL);
@@ -926,7 +914,7 @@ void HandleAddingPowerGenFanSound()
sGridNo = POWERGENFANSOUND_GRIDNO2; sGridNo = POWERGENFANSOUND_GRIDNO2;
//Create the new ambient fan sound //Create the new ambient fan sound
gJa25SaveStruct.iPowerGenFanPositionSndID = NewPositionSnd( sGridNo, POSITION_SOUND_STATIONATY_OBJECT, 0, POWER_GEN_FAN_SOUND, 30 ); //gJa25SaveStruct.iPowerGenFanPositionSndID = NewPositionSnd( sGridNo, POSITION_SOUND_STATIONATY_OBJECT, 0, POWER_GEN_FAN_SOUND );
SetPositionSndsInActive( ); SetPositionSndsInActive( );
SetPositionSndsActive( ); SetPositionSndsActive( );
@@ -954,10 +942,10 @@ void AddExitGridForFanToPowerGenSector()
ExitGrid.ubGotoSectorX = EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_X; //14; ExitGrid.ubGotoSectorX = EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_X; //14;
ExitGrid.ubGotoSectorY = EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_Y; //MAP_ROW_J; ExitGrid.ubGotoSectorY = EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_Y; //MAP_ROW_J;
ExitGrid.ubGotoSectorZ = EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_Z; //1; ExitGrid.ubGotoSectorZ = EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_Z; //1;
ExitGrid.usGridNo = POWERGENSECTOREXITGRID_DST_GRIDNO; ExitGrid.usGridNo = POWERGENSECTOREXITGRID_GRIDNO1;
//Add the exit grid when the fan is either stopped or blown up //Add the exit grid when the fan is either stopped or blown up
AddExitGridToWorld( POWERGENSECTOREXITGRID_SRC_GRIDNO, &ExitGrid ); AddExitGridToWorld( PGF__FAN_EXIT_GRID_GRIDNO, &ExitGrid );
} }
BOOLEAN HandlePlayerSayingQuoteWhenFailingToOpenGateInTunnel( SOLDIERTYPE *pSoldierAtDoor, BOOLEAN fSayQuoteOnlyOnce ) BOOLEAN HandlePlayerSayingQuoteWhenFailingToOpenGateInTunnel( SOLDIERTYPE *pSoldierAtDoor, BOOLEAN fSayQuoteOnlyOnce )
+1 -4
View File
@@ -5,6 +5,7 @@
#include "MapScreen Quotes.h" #include "MapScreen Quotes.h"
#define PGF__FAN_EXIT_GRID_GRIDNO 10979
#define NUM_MERCS_WITH_NEW_QUOTES 20//7 #define NUM_MERCS_WITH_NEW_QUOTES 20//7
@@ -143,10 +144,6 @@ extern UINT8 RAUL_UB;
extern UINT8 MORRIS_UB; extern UINT8 MORRIS_UB;
extern UINT8 RUDY_UB; extern UINT8 RUDY_UB;
extern INT16 BETTY_BLOODCAT_SECTOR_X;
extern INT16 BETTY_BLOODCAT_SECTOR_Y;
extern INT8 BETTY_BLOODCAT_SECTOR_Z;
extern void Old_UB_Inventory (); extern void Old_UB_Inventory ();
extern void New_UB_Inventory (); extern void New_UB_Inventory ();
+16 -16
View File
@@ -4840,15 +4840,15 @@ INT8 FireBulletGivenTargetNCTH( SOLDIERTYPE * pFirer, FLOAT dEndX, FLOAT dEndY,
{ {
usBulletFlags |= BULLET_FLAG_KNIFE; usBulletFlags |= BULLET_FLAG_KNIFE;
} }
else if (ItemIsRocketLauncher(usHandItem)) else if ( Item[usHandItem].rocketlauncher )
{ {
usBulletFlags |= BULLET_FLAG_MISSILE; usBulletFlags |= BULLET_FLAG_MISSILE;
} }
else if (ItemIsCannon(usHandItem)) else if ( Item[usHandItem].cannon )
{ {
usBulletFlags |= BULLET_FLAG_TANK_CANNON; usBulletFlags |= BULLET_FLAG_TANK_CANNON;
} }
else if (ItemIsRocketRifle(usHandItem)) else if ( Item[usHandItem].rocketrifle )
{ {
usBulletFlags |= BULLET_FLAG_SMALL_MISSILE; usBulletFlags |= BULLET_FLAG_SMALL_MISSILE;
} }
@@ -5237,7 +5237,7 @@ INT8 FireBulletGivenTargetNCTH( SOLDIERTYPE * pFirer, FLOAT dEndX, FLOAT dEndY,
if( !fFake && ( pFirer->ubProfile != NO_PROFILE ) && ( pFirer->bTeam == gbPlayerNum ) ) if( !fFake && ( pFirer->ubProfile != NO_PROFILE ) && ( pFirer->bTeam == gbPlayerNum ) )
{ {
// another shot fired // another shot fired
if ( Item[usHandItem].usItemClass == IC_LAUNCHER || ItemIsGrenadeLauncher(usHandItem) || ItemIsRocketLauncher(usHandItem) || ItemIsSingleShotRocketLauncher(usHandItem) || ItemIsMortar(usHandItem)) if ( Item[usHandItem].usItemClass == IC_LAUNCHER || Item[usHandItem].grenadelauncher || Item[usHandItem].rocketlauncher || Item[usHandItem].singleshotrocketlauncher || Item[usHandItem].mortar)
gMercProfiles[ pFirer->ubProfile ].records.usMissilesLaunched++; gMercProfiles[ pFirer->ubProfile ].records.usMissilesLaunched++;
else if ( Item[usHandItem].usItemClass == IC_THROWING_KNIFE ) else if ( Item[usHandItem].usItemClass == IC_THROWING_KNIFE )
gMercProfiles[ pFirer->ubProfile ].records.usKnivesThrown++; gMercProfiles[ pFirer->ubProfile ].records.usKnivesThrown++;
@@ -5335,15 +5335,15 @@ INT8 FireBulletGivenTarget( SOLDIERTYPE * pFirer, FLOAT dEndX, FLOAT dEndY, FLOA
{ {
usBulletFlags |= BULLET_FLAG_KNIFE; usBulletFlags |= BULLET_FLAG_KNIFE;
} }
else if (ItemIsRocketLauncher(usHandItem)) else if ( Item[usHandItem].rocketlauncher )
{ {
usBulletFlags |= BULLET_FLAG_MISSILE; usBulletFlags |= BULLET_FLAG_MISSILE;
} }
else if (ItemIsCannon(usHandItem)) else if ( Item[usHandItem].cannon )
{ {
usBulletFlags |= BULLET_FLAG_TANK_CANNON; usBulletFlags |= BULLET_FLAG_TANK_CANNON;
} }
else if (ItemIsRocketRifle(usHandItem)) else if ( Item[usHandItem].rocketrifle )
{ {
usBulletFlags |= BULLET_FLAG_SMALL_MISSILE; usBulletFlags |= BULLET_FLAG_SMALL_MISSILE;
} }
@@ -5753,7 +5753,7 @@ INT8 FireBulletGivenTarget( SOLDIERTYPE * pFirer, FLOAT dEndX, FLOAT dEndY, FLOA
if( !fFake && ( pFirer->ubProfile != NO_PROFILE ) && ( pFirer->bTeam == gbPlayerNum ) ) if( !fFake && ( pFirer->ubProfile != NO_PROFILE ) && ( pFirer->bTeam == gbPlayerNum ) )
{ {
// another shot fired // another shot fired
if ( Item[usHandItem].usItemClass == IC_LAUNCHER || ItemIsGrenadeLauncher(usHandItem) || ItemIsRocketLauncher(usHandItem) || ItemIsSingleShotRocketLauncher(usHandItem) || ItemIsMortar(usHandItem)) if ( Item[usHandItem].usItemClass == IC_LAUNCHER || Item[usHandItem].grenadelauncher || Item[usHandItem].rocketlauncher || Item[usHandItem].singleshotrocketlauncher || Item[usHandItem].mortar)
gMercProfiles[ pFirer->ubProfile ].records.usMissilesLaunched++; gMercProfiles[ pFirer->ubProfile ].records.usMissilesLaunched++;
else if ( Item[usHandItem].usItemClass == IC_THROWING_KNIFE ) else if ( Item[usHandItem].usItemClass == IC_THROWING_KNIFE )
gMercProfiles[ pFirer->ubProfile ].records.usKnivesThrown++; gMercProfiles[ pFirer->ubProfile ].records.usKnivesThrown++;
@@ -6007,15 +6007,15 @@ INT8 FireBulletGivenTargetTrapOnly( SOLDIERTYPE* pThrower, OBJECTTYPE* pObj, INT
{ {
usBulletFlags |= BULLET_FLAG_KNIFE; usBulletFlags |= BULLET_FLAG_KNIFE;
} }
else if (ItemIsRocketLauncher(usItem)) else if ( Item[usItem].rocketlauncher )
{ {
usBulletFlags |= BULLET_FLAG_MISSILE; usBulletFlags |= BULLET_FLAG_MISSILE;
} }
else if (ItemIsCannon(usItem)) else if ( Item[usItem].cannon )
{ {
usBulletFlags |= BULLET_FLAG_TANK_CANNON; usBulletFlags |= BULLET_FLAG_TANK_CANNON;
} }
else if (ItemIsRocketRifle(usItem)) else if ( Item[usItem].rocketrifle )
{ {
usBulletFlags |= BULLET_FLAG_SMALL_MISSILE; usBulletFlags |= BULLET_FLAG_SMALL_MISSILE;
} }
@@ -6594,15 +6594,15 @@ INT8 FireBulletGivenTarget_NoObjectNoSoldier( UINT16 usItem, UINT8 ammotype, UIN
{ {
usBulletFlags |= BULLET_FLAG_KNIFE; usBulletFlags |= BULLET_FLAG_KNIFE;
} }
else if (ItemIsRocketLauncher(usItem)) else if ( Item[usItem].rocketlauncher )
{ {
usBulletFlags |= BULLET_FLAG_MISSILE; usBulletFlags |= BULLET_FLAG_MISSILE;
} }
else if (ItemIsCannon(usItem)) else if ( Item[usItem].cannon )
{ {
usBulletFlags |= BULLET_FLAG_TANK_CANNON; usBulletFlags |= BULLET_FLAG_TANK_CANNON;
} }
else if (ItemIsRocketRifle(usItem)) else if ( Item[usItem].rocketrifle )
{ {
usBulletFlags |= BULLET_FLAG_SMALL_MISSILE; usBulletFlags |= BULLET_FLAG_SMALL_MISSILE;
} }
@@ -6923,7 +6923,7 @@ INT8 ChanceToGetThrough(SOLDIERTYPE * pFirer, FLOAT dEndX, FLOAT dEndY, FLOAT dE
// sevenfm: check that weapon exists! // sevenfm: check that weapon exists!
if (pObjHand->exists() && if (pObjHand->exists() &&
pObjHand->usItem == pFirer->usAttackingWeapon && pObjHand->usItem == pFirer->usAttackingWeapon &&
(Item[pFirer->usAttackingWeapon].usItemClass == IC_GUN || Item[pFirer->usAttackingWeapon].usItemClass == IC_THROWING_KNIFE || ItemIsRocketLauncher(pFirer->usAttackingWeapon))) (Item[pFirer->usAttackingWeapon].usItemClass == IC_GUN || Item[pFirer->usAttackingWeapon].usItemClass == IC_THROWING_KNIFE || Item[pFirer->usAttackingWeapon].rocketlauncher))
{ {
BOOLEAN fBuckShot = FALSE; BOOLEAN fBuckShot = FALSE;
@@ -8643,7 +8643,7 @@ void AdjustTargetCenterPoint( SOLDIERTYPE *pShooter, INT32 iTargetGridNo, FLOAT
//INT32 iLaserRange = GetBestLaserRange(&(pShooter->inv[pSoldier->ubAttackingHand])); //INT32 iLaserRange = GetBestLaserRange(&(pShooter->inv[pSoldier->ubAttackingHand]));
INT16 sLaserRange = GetBestLaserRange(pWeapon); INT16 sLaserRange = GetBestLaserRange(pWeapon);
if (AM_A_ROBOT(pShooter) && ItemProvidesRobotLaserBonus(pShooter->inv[ROBOT_TARGETING_SLOT].usItem)) if (AM_A_ROBOT(pShooter) && Item[pShooter->inv[ROBOT_TARGETING_SLOT].usItem].fProvidesRobotLaserBonus)
{ {
sLaserRange = max(sLaserRange, GetBestLaserRange(&pShooter->inv[ROBOT_TARGETING_SLOT])); sLaserRange = max(sLaserRange, GetBestLaserRange(&pShooter->inv[ROBOT_TARGETING_SLOT]));
} }
@@ -24,15 +24,14 @@ AbstractXMLLoader::ParseData* AbstractXMLLoader::MakeParseData(XML_Parser* parse
return new ParseData(parser); return new ParseData(parser);
} }
bool AbstractXMLLoader::LoadFromFile(const char* directoryName, const char* fileName, CHAR8* errorBuf) { bool AbstractXMLLoader::LoadFromFile(const char* directoryName, const char* fileName) {
HWFILE hFile; HWFILE hFile;
UINT32 uiBytesRead; UINT32 uiBytesRead;
UINT32 uiFSize; UINT32 uiFSize;
CHAR8* lpcBuffer; CHAR8* lpcBuffer;
char fileNameFull[MAX_PATH + 1]; char fileNameFull[MAX_PATH + 1];
if (strlen(fileName) + strlen(directoryName) >= MAX_PATH) { if (strlen(fileName) + strlen(directoryName) >= MAX_PATH) {
sprintf(errorBuf, "Can't load file %s%s, Concatenated filename too long for buffer!", directoryName, fileName); LiveMessage("Can't load file. Concatinated filename too long for buffer!");
LiveMessage(errorBuf);
return false; return false;
} }
SetDirectoryName(directoryName); SetDirectoryName(directoryName);
@@ -47,14 +46,12 @@ bool AbstractXMLLoader::LoadFromFile(const char* directoryName, const char* file
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, msg.c_str()); DebugMsg(TOPIC_JA2, DBG_LEVEL_3, msg.c_str());
hFile = FileOpen(fileNameFull, FILE_ACCESS_READ, FALSE); hFile = FileOpen(fileNameFull, FILE_ACCESS_READ, FALSE);
if (!hFile) { if (!hFile) {
sprintf(errorBuf, "Can't open %s", fileNameFull);
delete data; delete data;
return false; return false;
} }
uiFSize = FileGetSize(hFile); uiFSize = FileGetSize(hFile);
lpcBuffer = (CHAR8*)MemAlloc(uiFSize + 1); lpcBuffer = (CHAR8*)MemAlloc(uiFSize + 1);
if (!FileRead(hFile, lpcBuffer, uiFSize, &uiBytesRead)) { if (!FileRead(hFile, lpcBuffer, uiFSize, &uiBytesRead)) {
sprintf(errorBuf, "Error reading %s to buffer", fileNameFull);
MemFree(lpcBuffer); MemFree(lpcBuffer);
delete data; delete data;
return false; return false;
@@ -75,6 +72,7 @@ bool AbstractXMLLoader::LoadFromFile(const char* directoryName, const char* file
try { try {
if (!XML_Parse(parser, lpcBuffer, uiFSize, TRUE)) { if (!XML_Parse(parser, lpcBuffer, uiFSize, TRUE)) {
CHAR8 errorBuf[512];
sprintf(errorBuf, "XML Parser Error in %s[%d]: %s", fileNameFull, XML_GetCurrentLineNumber(parser), XML_ErrorString(XML_GetErrorCode(parser))); sprintf(errorBuf, "XML Parser Error in %s[%d]: %s", fileNameFull, XML_GetCurrentLineNumber(parser), XML_ErrorString(XML_GetErrorCode(parser)));
LiveMessage(errorBuf); LiveMessage(errorBuf);
MemFree(lpcBuffer); MemFree(lpcBuffer);
@@ -82,6 +80,7 @@ bool AbstractXMLLoader::LoadFromFile(const char* directoryName, const char* file
return false; return false;
} }
} catch (XMLParseException e) { } catch (XMLParseException e) {
CHAR8 errorBuf[512];
sprintf(errorBuf, "XML Parser Exception in %s[%d]: %s", fileNameFull, e._LINE, e.what()); sprintf(errorBuf, "XML Parser Exception in %s[%d]: %s", fileNameFull, e._LINE, e.what());
LiveMessage(errorBuf); LiveMessage(errorBuf);
MemFree(lpcBuffer); MemFree(lpcBuffer);
@@ -55,7 +55,7 @@ private:
public: public:
AbstractXMLLoader(XML_StartElementHandler startHandler, XML_EndElementHandler endHandler, XML_CharacterDataHandler charHandler, ParseDataFactoryFunc parseDataFactF = MakeParseData); AbstractXMLLoader(XML_StartElementHandler startHandler, XML_EndElementHandler endHandler, XML_CharacterDataHandler charHandler, ParseDataFactoryFunc parseDataFactF = MakeParseData);
~AbstractXMLLoader(void); ~AbstractXMLLoader(void);
bool LoadFromFile(const char* directoryName, const char* fileName, CHAR8* errorBuf); bool LoadFromFile(const char* directoryName, const char* fileName);
const char* GetFileName(); const char* GetFileName();
const char* GetDirectoryName(); const char* GetDirectoryName();
void SetFileName(const char* fileName); void SetFileName(const char* fileName);
+2 -14
View File
@@ -214,10 +214,10 @@ bool Filter::Match(SOLDIERTYPE* pSoldier) {
cmp_val = Weapon[pSoldier->inv[HANDPOS].usItem].ubCalibre; cmp_val = Weapon[pSoldier->inv[HANDPOS].usItem].ubCalibre;
break; break;
case REQ_WEAPON_TWOHANDED: case REQ_WEAPON_TWOHANDED:
cmp_val = ItemIsTwoHanded(pSoldier->inv[HANDPOS].usItem); cmp_val = TwoHandedItem(pSoldier->inv[HANDPOS].usItem);
break; break;
case REQ_LEFT_WEAPON_TWOHANDED: case REQ_LEFT_WEAPON_TWOHANDED:
cmp_val = ItemIsTwoHanded(pSoldier->inv[SECONDHANDPOS].usItem); cmp_val = TwoHandedItem(pSoldier->inv[SECONDHANDPOS].usItem);
break; break;
case REQ_VEST_AMOR_PROTECTION: case REQ_VEST_AMOR_PROTECTION:
cmp_val = Armour[Item[pSoldier->inv[VESTPOS].usItem].ubClassIndex].ubProtection; cmp_val = Armour[Item[pSoldier->inv[VESTPOS].usItem].ubClassIndex].ubProtection;
@@ -258,18 +258,6 @@ bool Filter::Match(SOLDIERTYPE* pSoldier) {
case REQ_LEGPOSATTACHMENT3: case REQ_LEGPOSATTACHMENT3:
cmp_val = CompareAttachment(pSoldier, LEGPOS, 3); cmp_val = CompareAttachment(pSoldier, LEGPOS, 3);
break; break;
case REQ_VESTPOSATTACHMENT0:
cmp_val = CompareAttachment( pSoldier, VESTPOS, 0 );
break;
case REQ_VESTPOSATTACHMENT1:
cmp_val = CompareAttachment( pSoldier, VESTPOS, 1 );
break;
case REQ_VESTPOSATTACHMENT2:
cmp_val = CompareAttachment( pSoldier, VESTPOS, 2 );
break;
case REQ_VESTPOSATTACHMENT3:
cmp_val = CompareAttachment( pSoldier, VESTPOS, 3 );
break;
default: default:
if (q < NUM_REQTYPESINV) { if (q < NUM_REQTYPESINV) {
cmp_val = pSoldier->inv[q].usItem; cmp_val = pSoldier->inv[q].usItem;
-4
View File
@@ -75,10 +75,6 @@ public:
REQ_LEGPOSATTACHMENT1, REQ_LEGPOSATTACHMENT1,
REQ_LEGPOSATTACHMENT2, REQ_LEGPOSATTACHMENT2,
REQ_LEGPOSATTACHMENT3, REQ_LEGPOSATTACHMENT3,
REQ_VESTPOSATTACHMENT0,
REQ_VESTPOSATTACHMENT1,
REQ_VESTPOSATTACHMENT2,
REQ_VESTPOSATTACHMENT3,
NUM_REQTYPES, NUM_REQTYPES,
// 3rd byte is for operator flags // 3rd byte is for operator flags
_REQ_BTWN = 0x20000, _REQ_BTWN = 0x20000,
+2 -6
View File
@@ -270,7 +270,7 @@ namespace LogicalBodyTypes {
/***************************************** /*****************************************
Filter enum criterion types Filter enum criterion types
******************************************/ ******************************************/
LOGBT_ENUMDB_ADD("IntegerFilterCriterionTypes", 47, LOGBT_ENUMDB_ADD("IntegerFilterCriterionTypes", 43,
Filter::REQ_HELMETPOS, Filter::REQ_HELMETPOS,
Filter::REQ_VESTPOS, Filter::REQ_VESTPOS,
Filter::REQ_LEGPOS, Filter::REQ_LEGPOS,
@@ -313,11 +313,7 @@ namespace LogicalBodyTypes {
Filter::REQ_LEGPOSATTACHMENT0, Filter::REQ_LEGPOSATTACHMENT0,
Filter::REQ_LEGPOSATTACHMENT1, Filter::REQ_LEGPOSATTACHMENT1,
Filter::REQ_LEGPOSATTACHMENT2, Filter::REQ_LEGPOSATTACHMENT2,
Filter::REQ_LEGPOSATTACHMENT3, Filter::REQ_LEGPOSATTACHMENT3
Filter::REQ_VESTPOSATTACHMENT0,
Filter::REQ_VESTPOSATTACHMENT1,
Filter::REQ_VESTPOSATTACHMENT2,
Filter::REQ_VESTPOSATTACHMENT3
); );
/***************************************** /*****************************************

Some files were not shown because too many files have changed in this diff Show More