Author SHA1 Message Date
majcostaandGitHub 3be0ca3f38 Change CMake build type from Release to RelWithDebInfo 2025-12-04 14:37:43 -03:00
268 changed files with 5320 additions and 4870 deletions
+27 -166
View File
@@ -9,6 +9,11 @@ on:
# allows to manually trigger a build
workflow_dispatch:
inputs:
build_all_languages:
description: build all languages
required: false
default: false
type: boolean
assemble_release:
description: create release
required: false
@@ -22,6 +27,7 @@ jobs:
workflow_setup:
runs-on: ubuntu-latest
outputs:
languages_json_array: ${{ steps.global_vars.outputs.languages_json_array }}
assemble_release: ${{ steps.global_vars.outputs.assemble_release }}
steps:
- id: global_vars
@@ -31,6 +37,15 @@ jobs:
full_release='${{ ( github.repository == '1dot13/source' && github.ref_name == 'master' ) || startsWith(github.ref, 'refs/tags/v') }}'
if [[ '${{ inputs.build_all_languages }}' == 'true' || ( '${{ inputs.build_all_languages }}' == '' && "$full_release" == 'true' ) ]]
then
languages_json_array='["Chinese", "German", "English", "French", "Polish", "Italian", "Dutch", "Russian"]';
else
# English + some other language for compilation testing
languages_json_array='["German", "English"]'
fi
echo "languages_json_array=$languages_json_array" >> $GITHUB_OUTPUT
if [[ '${{ inputs.assemble_release }}' == 'true' || ( '${{ inputs.assemble_release }}' == '' && "$full_release" == 'true' ) ]]
then
assemble_release='true'
@@ -139,193 +154,39 @@ jobs:
cat dist/versions.env
- name: Upload
uses: actions/upload-artifact@v7
uses: actions/upload-artifact@v4
with:
name: versions.env
path: dist/
# every executable contains all languages and picks one at runtime, so one build serves every package
compile:
build:
needs: [ workflow_setup ]
runs-on: windows-latest # required for the MSVC toolchain
strategy:
fail-fast: false
matrix:
application: [ja2, ja2mapeditor, ja2ub, ja2ubmapeditor]
steps:
- name: Checkout source
uses: actions/checkout@v7
- name: Download versions.env
uses: actions/download-artifact@v8
with:
name: versions.env
path: artifacts
- name: Restore versions.env
shell: bash
run: cat artifacts/versions.env >> $GITHUB_ENV
# TODO: Move this into CMake, just taking the GitHub Actions parameters as -D variables
- name: Update GameVersion.cpp
shell: bash
run: |
set -eux
GAME_VERSION=$(echo "$GAME_VERSION" | tr -cd '[:print:]' | tr -d '"\\')
GAME_BUILD=$(echo "$GAME_BUILD_INFORMATION" | tr -cd '[:print:]' | tr -d '"\\')
sed -i "s|@Version@|${GAME_VERSION:0:15}|" Ja2/GameVersion.cpp
sed -i "s|@Build@|${GAME_BUILD:0:255}|" Ja2/GameVersion.cpp
cat Ja2/GameVersion.cpp
- name: Prepare build properties
shell: bash
run: |
set -eux
touch CMakePresets.json
JA2Application=$(echo '${{ matrix.application }}' | tr '[:lower:]' '[:upper:]')
echo "
JA2Application=$JA2Application
" >> $GITHUB_ENV
- uses: egor-tensin/vs-shell@v2
with:
arch: x86
- name: Prepare build
run: |
cmake -S . -B build -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DApplications="$Env:JA2Application"
- name: Build
run: |
cmake --build build/ -- -v
- name: List build artifacts
shell: bash
run: |
find build/
- name: Upload
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.application }}
path: build/*.exe
# only the game data differs per language, every package gets the same executables
assemble:
needs: [ workflow_setup, compile ]
if: needs.workflow_setup.outputs.assemble_release == 'true'
runs-on: windows-latest # required for case-insensitive filesystem handling
# at least English has to work
continue-on-error: ${{ matrix.language != 'English' }}
strategy:
fail-fast: false
matrix:
language: [Chinese, German, English, French, Polish, Italian, Dutch, Russian]
steps:
- name: Download versions.env
uses: actions/download-artifact@v8
with:
name: versions.env
path: artifacts
- name: Restore versions.env
shell: bash
run: cat artifacts/versions.env >> $GITHUB_ENV
- name: Checkout gamedir
uses: actions/checkout@v7
with:
repository: ${{ env.GAMEDIR_REPOSITORY }}
ref: ${{ env.GAMEDIR_COMMIT_SHA }}
path: gamedir
- name: Checkout gamedir-languages
if: matrix.language != 'English'
uses: actions/checkout@v7
with:
repository: ${{ env.GAMEDIR_LANGUAGES_REPOSITORY }}
ref: ${{ env.GAMEDIR_LANGUAGES_COMMIT_SHA }}
path: gamedir-languages
- name: Copy gamedir-languages files to gamedir
if: matrix.language != 'English'
shell: bash
run: |
set -eux
cp -a gamedir-languages/${{ matrix.language }}_Version/* gamedir/
- name: Download applications
uses: actions/download-artifact@v8
with:
pattern: ja2*
path: artifacts
- name: Copy application files to gamedir
shell: bash
run: |
set -eux
for APP in ja2 ja2mapeditor ja2ub ja2ubmapeditor
do
mv artifacts/${APP}/*.exe gamedir/${APP}.exe
done
- name: Create version information file
shell: bash
run: |
set -eux
# "-" separates words, "_" combines words, see double-click behavior
DIST_PREFIX='JA2_113'
DIST_NAME="${DIST_PREFIX}-${GAME_VERSION}-G${GAMEDIR_COMMIT_SHA:0:4}L${GAMEDIR_LANGUAGES_COMMIT_SHA:0:4}-${{ matrix.language }}"
echo "DIST_NAME=$DIST_NAME" >> $GITHUB_ENV
echo "If you encounter problems during gameplay, please provide the following version information:
Distribution Name: $DIST_NAME
Game Version: $GAME_VERSION
Language: ${{ matrix.language }}
Build Information: $GAME_BUILD_INFORMATION
Source Repository: $GITHUB_REPOSITORY
Source Commit SHA: $GITHUB_SHA
Source Commit Date: $SOURCE_COMMIT_DATETIME
Gamedir Repository: $GAMEDIR_REPOSITORY
Gamedir Commit SHA: $GAMEDIR_COMMIT_SHA
Gamedir Commit Date: $GAMEDIR_COMMIT_DATETIME
Gamedir Languages Repository: $GAMEDIR_LANGUAGES_REPOSITORY
Gamedir Languages Commit SHA: $GAMEDIR_LANGUAGES_COMMIT_SHA
Gamedir Languages Commit Date: $GAMEDIR_LANGUAGES_COMMIT_DATETIME
" > "gamedir/${DIST_PREFIX}-Version.txt"
cat "gamedir/${DIST_PREFIX}-Version.txt"
- name: Create release archive
shell: bash
run: |
set -eux
mkdir dist/
cd gamedir/
7z a -bb -xr'!.*' "../dist/${DIST_NAME}.7z" .
- name: Upload
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.language }}_release
path: dist/
compression-level: 0
language: ${{ fromJson(needs.workflow_setup.outputs.languages_json_array) }}
uses: ./.github/workflows/build_language.yml
with:
language: ${{ matrix.language }}
assemble: ${{ needs.workflow_setup.outputs.assemble_release == 'true' }}
# at least English and some other lang have to work
continue-on-error: ${{ matrix.language != 'English' && matrix.language != 'German' }}
release:
needs: [ workflow_setup, assemble ]
needs: [ workflow_setup, build ]
if: needs.workflow_setup.outputs.assemble_release == 'true'
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v8
uses: actions/download-artifact@v4
with:
path: dist
pattern: '*_release'
merge-multiple: true
- name: Checkout Repo
uses: actions/checkout@v7
uses: actions/checkout@v4
with:
path: source
fetch-depth: 1
+206
View File
@@ -0,0 +1,206 @@
name: build language
on:
workflow_call:
inputs:
language:
description: 'any of Chinese German English French Polish Italian Dutch Russian'
required: true
default: 'English'
type: string
assemble:
description: 'assemble full package'
required: true
default: true
type: boolean
continue-on-error:
description: 'allows a language to fail, used when building all languages'
required: false
default: false
type: boolean
jobs:
compile:
runs-on: windows-latest # required for msbuild
continue-on-error: ${{ inputs.continue-on-error }}
strategy:
fail-fast: false
matrix:
application: [ja2, ja2mapeditor, ja2ub, ja2ubmapeditor]
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Download versions.env
uses: actions/download-artifact@v4
with:
name: versions.env
path: artifacts
- name: Restore versions.env
shell: bash
run: cat artifacts/versions.env >> $GITHUB_ENV
# TODO: Move this into CMake, just taking the GitHub Actions parameters as -D variables
- name: Update GameVersion.cpp
shell: bash
run: |
set -eux
INPUTS_LANGUAGE=${{ inputs.language }}
GAME_VERSION=$(echo "$GAME_VERSION" | tr -cd '[:print:]' | tr -d '"\\')
GAME_BUILD="${INPUTS_LANGUAGE:0:2} $GAME_BUILD_INFORMATION"
GAME_BUILD=$(echo "$GAME_BUILD" | tr -cd '[:print:]' | tr -d '"\\')
sed -i "s|@Version@|${GAME_VERSION:0:15}|" Ja2/GameVersion.cpp
sed -i "s|@Build@|${GAME_BUILD:0:255}|" Ja2/GameVersion.cpp
cat Ja2/GameVersion.cpp
- name: Prepare build properties
shell: bash
run: |
set -eux
touch CMakePresets.json
JA2Language=$(echo '${{ inputs.language }}' | tr '[:lower:]' '[:upper:]')
JA2Application=$(echo '${{ matrix.application }}' | tr '[:lower:]' '[:upper:]')
echo "
JA2Language=$JA2Language
JA2Application=$JA2Application
" >> $GITHUB_ENV
- uses: microsoft/setup-msbuild@v2
with:
msbuild-architecture: x86
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: x86
- name: Prepare build
run: |
cmake -S . -B build -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLanguages="$Env:JA2Language" -DApplications="$Env:JA2Application"
- name: Build
run: |
cmake --build build/ -- -v
- name: List build artifacts
shell: bash
run: |
find build/
- name: Upload
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.language }}_${{ matrix.application }}
path: build/*.exe
assemble:
needs: [ compile ]
if: inputs.assemble
runs-on: windows-latest # required for case-insensitive filesystem handling
continue-on-error: ${{ inputs.continue-on-error }}
steps:
- name: Download versions.env
uses: actions/download-artifact@v4
with:
name: versions.env
path: artifacts
- name: Restore versions.env
shell: bash
run: cat artifacts/versions.env >> $GITHUB_ENV
- name: Checkout gamedir
uses: actions/checkout@v4
with:
repository: ${{ env.GAMEDIR_REPOSITORY }}
ref: ${{ env.GAMEDIR_COMMIT_SHA }}
path: gamedir
- name: Checkout gamedir-languages
if: inputs.language != 'English'
uses: actions/checkout@v4
with:
repository: ${{ env.GAMEDIR_LANGUAGES_REPOSITORY }}
ref: ${{ env.GAMEDIR_LANGUAGES_COMMIT_SHA }}
path: gamedir-languages
- name: Copy gamedir-languages files to gamedir
if: inputs.language != 'English'
shell: bash
run: |
set -eux
cp -a gamedir-languages/${{ inputs.language }}_Version/* gamedir/
- name: Download ja2
uses: actions/download-artifact@v4
with:
name: ${{ inputs.language }}_ja2
path: artifacts/ja2
- name: Download ja2mapeditor
uses: actions/download-artifact@v4
with:
name: ${{ inputs.language }}_ja2mapeditor
path: artifacts/ja2mapeditor
- name: Download ja2ub
uses: actions/download-artifact@v4
with:
name: ${{ inputs.language }}_ja2ub
path: artifacts/ja2ub
- name: Download ja2ubmapeditor
uses: actions/download-artifact@v4
with:
name: ${{ inputs.language }}_ja2ubmapeditor
path: artifacts/ja2ubmapeditor
- name: Copy application files to gamedir
shell: bash
run: |
set -eux
for APP in ja2 ja2mapeditor ja2ub ja2ubmapeditor
do
mv artifacts/${APP}/*.exe gamedir/${APP}.exe
done
- name: Create version information file
shell: bash
run: |
set -eux
# "-" separates words, "_" combines words, see double-click behavior
DIST_PREFIX='JA2_113'
DIST_NAME="${DIST_PREFIX}-${GAME_VERSION}-G${GAMEDIR_COMMIT_SHA:0:4}L${GAMEDIR_LANGUAGES_COMMIT_SHA:0:4}-${{ inputs.language }}"
echo "DIST_NAME=$DIST_NAME" >> $GITHUB_ENV
echo "If you encounter problems during gameplay, please provide the following version information:
Distribution Name: $DIST_NAME
Game Version: $GAME_VERSION
Language: ${{ inputs.language }}
Build Information: $GAME_BUILD_INFORMATION
Source Repository: $GITHUB_REPOSITORY
Source Commit SHA: $GITHUB_SHA
Source Commit Date: $SOURCE_COMMIT_DATETIME
Gamedir Repository: $GAMEDIR_REPOSITORY
Gamedir Commit SHA: $GAMEDIR_COMMIT_SHA
Gamedir Commit Date: $GAMEDIR_COMMIT_DATETIME
Gamedir Languages Repository: $GAMEDIR_LANGUAGES_REPOSITORY
Gamedir Languages Commit SHA: $GAMEDIR_LANGUAGES_COMMIT_SHA
Gamedir Languages Commit Date: $GAMEDIR_LANGUAGES_COMMIT_DATETIME
" > "gamedir/${DIST_PREFIX}-Version.txt"
cat "gamedir/${DIST_PREFIX}-Version.txt"
- name: Create release archive
shell: bash
run: |
set -eux
mkdir dist/
cd gamedir/
7z a -bb -xr'!.*' "../dist/${DIST_NAME}.7z" .
- name: Upload
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.language }}_release
path: dist/
compression-level: 0
+27 -29
View File
@@ -27,11 +27,7 @@ if(ADDRESS_SANITIZER)
endif()
if(MSVC)
# TODO: fix the warnings here and turn them on
# https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warnings-c4000-through-c4199
add_compile_options("/wd4838") # silence implicit narrowing conversion warnings
# add_compile_options("/w14061")
# add_compile_options("/w14062")
add_compile_options("/wd4838")
endif()
# whether we are using MSBuild as a generator
@@ -106,13 +102,15 @@ foreach(lib IN LISTS Ja2_Libs)
add_subdirectory(${lib})
endforeach()
# language library relies on Application preprocessor definition; compiled once per app
# with all 8 languages built in and selected at runtime (docs/plans/language-design.md).
# language library relies on Application _and_ Language preprocessor definition. very bad.
add_subdirectory(i18n)
# simple function to validate the Application choice
# simple function to validate Languages and Application choices
include(cmake/ValidateOptions.cmake)
set(ValidLanguages CHINESE DUTCH ENGLISH FRENCH GERMAN ITALIAN POLISH RUSSIAN)
ValidateOptions("${ValidLanguages}" "Languages" "${Languages}" "LangTargets")
set(ValidApplications JA2 JA2MAPEDITOR JA2UB JA2UBMAPEDITOR)
ValidateOptions("${ValidApplications}" "Applications" "${Applications}" "ApplicationTargets")
@@ -138,32 +136,32 @@ foreach(app IN LISTS ApplicationTargets)
target_compile_definitions(${game_library} PRIVATE ${compilationFlags} ${debugFlags})
endforeach()
# executable for the application, e.g. JA2.exe
set(exe ${app})
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})
foreach(lang IN LISTS LangTargets)
# executable for an application/language combination, e.g. JA2_ENGLISH.exe
set(exe ${app}_${lang})
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 the application, e.g. JA2MAPEDITOR_i18n — one per app, all 8
# languages compiled in, selected at runtime by BindLanguageStrings
set(language_library ${exe}_i18n)
add_library(${language_library})
target_sources(${language_library} PRIVATE ${i18nSrc})
target_compile_definitions(${language_library} PRIVATE ${compilationFlags} ${debugFlags})
target_compile_options(${language_library} PRIVATE /w14062)
target_link_libraries(${exe} PRIVATE ${language_library})
# language library for an application, e.g. JA2MAPEDITOR_ENGLISH_i18n
set(language_library ${exe}_i18n)
add_library(${language_library})
target_sources(${language_library} PRIVATE ${i18nSrc})
target_compile_definitions(${language_library} PRIVATE ${compilationFlags} ${debugFlags} ${lang})
target_link_libraries(${exe} PRIVATE ${language_library})
# go through all game libraries again and link them to the app executable
foreach(lib IN LISTS Ja2_Libs)
target_link_libraries(${exe} PRIVATE ${app}_${lib})
# go through all game libraries again and link them to the app/language executable
foreach(lib IN LISTS Ja2_Libs)
target_link_libraries(${exe} PRIVATE ${app}_${lib})
endforeach()
endforeach()
# for SGP only
target_link_libraries(${app}_sgp PRIVATE "ddraw.lib" "${PROJECT_SOURCE_DIR}/fmodvc.lib")
target_link_libraries(${app}_sgp PRIVATE libpng)
target_compile_definitions(${app}_sgp PRIVATE ${compilationFlags} ${debugFlags} NO_ZLIB_COMPRESSION)
target_compile_definitions(${app}_sgp PRIVATE NO_ZLIB_COMPRESSION)
endforeach()
+2 -2
View File
@@ -29,7 +29,7 @@ void IncreaseSelectionDensity();
void DecreaseSelectionDensity();
void RemoveCursors();
extern STR16 *wszSelType;
extern STR16 wszSelType[6];
extern BOOLEAN gfCurrentSelectionWithRightButton;
@@ -40,4 +40,4 @@ extern BOOLEAN gfCurrentSelectionWithRightButton;
#endif
#endif
#endif
+1 -1
View File
@@ -325,7 +325,7 @@ extern UINT8 gubCurrMercMode, gubPrevMercMode;
#define NUM_DIFF_LVLS 5
extern STR16 *zDiffNames;
extern STR16 zDiffNames[NUM_DIFF_LVLS];
extern INT16 sCurBaseDiff;
extern INT16 gsSelectedMercID;
extern INT32 gsSelectedMercGridNo;
+1 -1
View File
@@ -40,7 +40,7 @@ MOUSE_REGION popupRegion;
UINT16 gusEntryHeight;
BOOLEAN fWaitingForLButtonRelease = FALSE;
extern CHAR16 (*gszScheduleActions)[20]; // NUM_SCHEDULE_ACTIONS entries
extern CHAR16 gszScheduleActions[ NUM_SCHEDULE_ACTIONS ][20];
//Finds the string for any popup menu in JA2 -- the strings are stored
//in different ways in each instance.
-1
View File
@@ -2749,7 +2749,6 @@ void LoadSkillTraitsExternalSettings()
gSkillTraitValues.ubTERepairRobotPenaltyReduction = iniReader.ReadInteger("Technician","REPAIR_SPEED_ROBOT_PENALTY_REDUCTION", 30, 0, 100);
if (gSkillTraitValues.ubTETraitsNumToRepairRobot == 2) {gSkillTraitValues.ubTERepairRobotPenaltyReduction /= 2; }
gSkillTraitValues.fTETraitsCanRestoreItemThreshold = iniReader.ReadBoolean( "Technician", "MERCS_CAN_DO_ADVANCED_REPAIRS", FALSE );
gSkillTraitValues.ubTechLevelNeededForAdvancedRepair = iniReader.ReadInteger("Technician", "TECH_LEVEL_NEEDED_FOR_ADVANCED_REPAIR", 2, 1, 2);
// DOCTOR
gSkillTraitValues.ubDONumberTraitsNeededForSurgery = iniReader.ReadInteger("Doctor","NUMBER_OF_TRAITS_NEEDED_FOR_SURGERY", 1, 0, 2);
-3
View File
@@ -8,10 +8,8 @@
#include "Campaign Types.h"
#include "environment.h"
#include <string_view>
#define GAME_INI_FILE "Ja2.ini"
constexpr std::string_view LANGUAGE_INI_FILE{"Language.ini"};
//If you add any options, MAKE sure you add the corresponding string to the Options Screen string array.
// look up : zOptionsScreenHelpText , zOptionsToggleText
//Also, define its initialization and add its load/save to INI lines in : InitGameSettings() , SaveGameSettings() , LoadGameSettings()
@@ -2147,7 +2145,6 @@ typedef struct
UINT8 ubTERepairRobotPenaltyReduction;
UINT8 ubTETraitsNumToRepairRobot;
BOOLEAN fTETraitsCanRestoreItemThreshold;
UINT8 ubTechLevelNeededForAdvancedRepair; // if we have a high enough technician level, we can repair items above the normal threshold (1 for technician, 2 for engineer)
// DOCTOR
UINT8 ubDONumberTraitsNeededForSurgery;
+30 -53
View File
@@ -1184,61 +1184,40 @@ if( g_lang != i18n::Lang::en ) {
}
}
if ( ReadXMLEmail == TRUE )
{
// Externalized emails
strcpy(fileName, directoryName);
strcat(fileName, EMAILSFILENAME);
// Only load external emails if we find the file
if ( FileExists(fileName) )
{
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInExternalizedEmails(fileName, FALSE), EMAILSFILENAME);
if ( g_lang != i18n::Lang::en )
{
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
{
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, String("LoadExternalGameplayData, fileName = %s", fileName));
if ( !ReadInExternalizedEmails(fileName, TRUE) )
return FALSE;
}
}
}
if ( ReadXMLEmail == TRUE )
{
// EMAIL MERC AVAILABLE by Jazz
strcpy(fileName, directoryName);
strcat(fileName, EMAILMERCAVAILABLE);
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInEmailMercAvailable(fileName, FALSE), EMAILMERCAVAILABLE);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInEmailMercAvailable(fileName,FALSE), EMAILMERCAVAILABLE);
if ( g_lang != i18n::Lang::en )
if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
{
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
{
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, String("LoadExternalGameplayData, fileName = %s", fileName));
if ( !ReadInEmailMercAvailable(fileName, TRUE) )
return FALSE;
}
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
if(!ReadInEmailMercAvailable(fileName,TRUE))
return FALSE;
}
}
// EMAIL MERC LEVEL UP by Jazz
strcpy(fileName, directoryName);
strcat(fileName, EMAILMERCLEVELUP);
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInEmailMercLevelUp(fileName, FALSE), EMAILMERCLEVELUP);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInEmailMercLevelUp(fileName,FALSE), EMAILMERCLEVELUP);
if ( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
{
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, String("LoadExternalGameplayData, fileName = %s", fileName));
if ( !ReadInEmailMercLevelUp(fileName, TRUE) )
return FALSE;
}
if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
{
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
if(!ReadInEmailMercLevelUp(fileName,TRUE))
return FALSE;
}
}
}
/*
// EMAIL OTHER by Jazz
strcpy(fileName, directoryName);
@@ -1246,18 +1225,16 @@ if( g_lang != i18n::Lang::en ) {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInEmailOther(fileName,FALSE), EMAILOTHER);
if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
{
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
if(!ReadInEmailOther(fileName,TRUE))
return FALSE;
}
if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
{
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
if(!ReadInEmailOther(fileName,TRUE))
return FALSE;
}
}
*/
}
//new vehicles by Jazz
InitNewVehicles ();
+1 -1
View File
@@ -174,7 +174,7 @@ private:
static VideoPlayer s_VP(VideoPlayer::VT_SMK | VideoPlayer::VT_BINK);
extern STR16* gzIntroScreen;
extern STR16 gzIntroScreen[];
extern HVSURFACE ghFrameBuffer;
enum
+1 -1
View File
@@ -89,7 +89,7 @@ extern BOOLEAN gfDontOverRideSaveBuffer; //this variable can be unset if u
extern void HandleTacticalUILoseCursorFromOtherScreen( );
extern STR16* pUpdatePanelButtons;
extern STR16 pUpdatePanelButtons[];
#define NUM_CHAT_TOGGLES 2
+1 -1
View File
@@ -69,7 +69,7 @@ BOOLEAN gfStartedFromMapScreen = FALSE;
BOOLEAN fRestoreBackgroundForMessageBox = FALSE;
BOOLEAN gfDontOverRideSaveBuffer = TRUE; //this variable can be unset if ur in a non gamescreen and DONT want the msg box to use the save buffer
extern void HandleTacticalUILoseCursorFromOtherScreen( );
extern STR16* pUpdatePanelButtons;
extern STR16 pUpdatePanelButtons[];
CHAR16 gzUserDefinedButton1[ 128 ];
CHAR16 gzUserDefinedButton2[ 128 ];
+1 -1
View File
@@ -1822,7 +1822,7 @@ void HandleHighLightedText( BOOLEAN fHighLight )
bLastRegion = -1;
}
if( bHighLight != -1 && toggle_box_array[bHighLight] != -1)
if( bHighLight != -1 )
{
if( bHighLight < OPT_FIRST_COLUMN_TOGGLE_CUT_OFF )
{
+2 -5
View File
@@ -108,7 +108,6 @@
#include "connect.h"
#include "Map Screen Interface Map Inventory.h"//dnl ch51 081009
#include "Ambient Control.h" // added by Flugente for HandleNewSectorAmbience(...)
#include "WorldDat.h"
/////////////////////////////////////////////////////
//
// Local Defines
@@ -6296,10 +6295,8 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
#ifdef JA2UB
#else
if ( !fBookMark && !fEmail )
{
AddEmail(MERC_INTRO, MERC_INTRO_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_SPECK_INTRO);
}
if(!fBookMark && !fEmail)
AddEmail(MERC_INTRO, MERC_INTRO_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin( ), -1, -1 , TYPE_EMAIL_EMAIL_EDT);
#endif
}
+50
View File
@@ -1468,6 +1468,31 @@ BOOLEAN LoadMercBioInfo(UINT8 ubIndex, STR16 pInfoString, STR16 pAddInfo)
//{
// if( pInfoString[i] > 33 )
// pInfoString[i] -= 1;
// #ifdef POLISH
// switch( pInfoString[ i ] )
// {
// case 260: pInfoString[ i ] = 165; break;
// case 262: pInfoString[ i ] = 198; break;
// case 280: pInfoString[ i ] = 202; break;
// case 321: pInfoString[ i ] = 163; break;
// case 323: pInfoString[ i ] = 209; break;
// case 211: pInfoString[ i ] = 211; break;
// case 346: pInfoString[ i ] = 338; break;
// case 379: pInfoString[ i ] = 175; break;
// case 377: pInfoString[ i ] = 143; break;
// case 261: pInfoString[ i ] = 185; break;
// case 263: pInfoString[ i ] = 230; break;
// case 281: pInfoString[ i ] = 234; break;
// case 322: pInfoString[ i ] = 179; break;
// case 324: pInfoString[ i ] = 241; break;
// case 243: pInfoString[ i ] = 243; break;
// case 347: pInfoString[ i ] = 339; break;
// case 380: pInfoString[ i ] = 191; break;
// case 378: pInfoString[ i ] = 376; break;
// }
// #endif
//}
DecodeString(pInfoString, SIZE_MERC_BIO_INFO);
@@ -1489,6 +1514,31 @@ BOOLEAN LoadMercBioInfo(UINT8 ubIndex, STR16 pInfoString, STR16 pAddInfo)
//{
// if( pAddInfo[i] > 33 )
// pAddInfo[i] -= 1;
// #ifdef POLISH
// switch( pAddInfo[ i ] )
// {
// case 260: pAddInfo[ i ] = 165; break;
// case 262: pAddInfo[ i ] = 198; break;
// case 280: pAddInfo[ i ] = 202; break;
// case 321: pAddInfo[ i ] = 163; break;
// case 323: pAddInfo[ i ] = 209; break;
// case 211: pAddInfo[ i ] = 211; break;
// case 346: pAddInfo[ i ] = 338; break;
// case 379: pAddInfo[ i ] = 175; break;
// case 377: pAddInfo[ i ] = 143; break;
// case 261: pAddInfo[ i ] = 185; break;
// case 263: pAddInfo[ i ] = 230; break;
// case 281: pAddInfo[ i ] = 234; break;
// case 322: pAddInfo[ i ] = 179; break;
// case 324: pAddInfo[ i ] = 241; break;
// case 243: pAddInfo[ i ] = 243; break;
// case 347: pAddInfo[ i ] = 339; break;
// case 380: pAddInfo[ i ] = 191; break;
// case 378: pAddInfo[ i ] = 376; break;
// }
// #endif
//}
DecodeString(pAddInfo, SIZE_MERC_BIO_INFO);
+1 -1
View File
@@ -75,7 +75,7 @@ extern INT32 iAddExplosives ;
extern INT32 iAddMechanical ;
// pop up strings
extern STR16* pImpPopUpStrings;
extern STR16 pImpPopUpStrings[];
//extern BOOLEAN fIMPCompletedFlag;
+2 -2
View File
@@ -7,6 +7,6 @@ void RenderIMPPersonalityEntrance( void );
void ExitIMPPersonalityEntrance( void );
void HandleIMPPersonalityEntrance( void );
extern STR16* pSkillTraitBeginIMPStrings;
STR16 pSkillTraitBeginIMPStrings[];
#endif
#endif
+4 -4
View File
@@ -9,13 +9,13 @@ void PrintImpText( void );
void PrintIMPPersonalityQuizQuestionAndAnsers( void );
// buttons text
extern STR16* pImpButtonText;
extern STR16 pImpButtonText[];
// extra strings not found in IMP Text Document
extern STR16* pExtraIMPStrings;
extern STR16 pExtraIMPStrings[];
extern STR16* pSkillTraitBeginIMPStrings; // added - SANDRO
extern STR16 pSkillTraitBeginIMPStrings[]; // added - SANDRO
enum{
IMP_HOME_1,
@@ -145,4 +145,4 @@ enum{
};
#endif
#endif
+11 -21
View File
@@ -565,35 +565,25 @@ BOOLEAN CPostalService::DeliverShipment(UINT16 usShipmentID)
StopTimeCompression();
#ifdef JA2UB
//no UB
if ( gGameUBOptions.fBobbyRSite == TRUE )
{
// Shipment from Bobby Ray
if ( shs.sSenderID == BOBBYR_SENDER_ID )
{
if ( gEmails.size() > 0 )
{
AddEmailFromXML(XML_BR_SHIPMENTARRIVAL, GetWorldTotalMin(), -1, gusCurShipmentDestinationID, false, -1, -1, 198, -1, -1, -1);
}
else
{
AddBobbyREmailJA2(198, 4, BOBBY_R, GetWorldTotalMin(), -1, gusCurShipmentDestinationID, TYPE_EMAIL_BOBBY_R_EMAIL_JA2_EDT);
if (shs.sSenderID == BOBBYR_SENDER_ID)
AddBobbyREmailJA2( 198, 4, BOBBY_R, GetWorldTotalMin(), -1, gusCurShipmentDestinationID, TYPE_EMAIL_BOBBY_R_EMAIL_JA2_EDT);
// Shipment from John Kulba
//else
// AddEmail( JOHN_KULBA_GIFT_IN_DRASSEN, JOHN_KULBA_GIFT_IN_DRASSEN_LENGTH, JOHN_KULBA, GetWorldTotalMin(), -1, gusCurShipmentDestinationID, TYPE_EMAIL_EMAIL_EDT);
}
}
}
#else
// Shipment from Bobby Ray
if ( shs.sSenderID == BOBBYR_SENDER_ID )
{
AddEmail(BOBBYR_SHIPMENT_ARRIVED, BOBBYR_SHIPMENT_ARRIVED_LENGTH, BOBBY_R, GetWorldTotalMin(), -1, gusCurShipmentDestinationID, TYPE_EMAIL_EMAIL_EDT, XML_BR_SHIPMENTARRIVAL);
}
// Shipment from John Kulba
else
{
AddEmail(JOHN_KULBA_GIFT_IN_DRASSEN, JOHN_KULBA_GIFT_IN_DRASSEN_LENGTH, JOHN_KULBA, GetWorldTotalMin(), -1, gusCurShipmentDestinationID, TYPE_EMAIL_EMAIL_EDT, XML_JOHNKULBA_SENTGUNS);
}
// Shipment from Bobby Ray
if (shs.sSenderID == BOBBYR_SENDER_ID)
AddEmail( BOBBYR_SHIPMENT_ARRIVED, BOBBYR_SHIPMENT_ARRIVED_LENGTH, BOBBY_R, GetWorldTotalMin(), -1, gusCurShipmentDestinationID, TYPE_EMAIL_EMAIL_EDT);
// Shipment from John Kulba
else
AddEmail( JOHN_KULBA_GIFT_IN_DRASSEN, JOHN_KULBA_GIFT_IN_DRASSEN_LENGTH, JOHN_KULBA, GetWorldTotalMin(), -1, gusCurShipmentDestinationID, TYPE_EMAIL_EMAIL_EDT);
#endif
}
+246 -155
View File
@@ -1,204 +1,295 @@
#include "sgp.h"
#include "Debug Control.h"
#include "expat.h"
#include "XML.h"
#include "Interface.h"
#include "LuaInitNPCs.h"
#include "email.h"
#include "sgp.h"
#include "Debug Control.h"
#include "expat.h"
#include "XML.h"
#include "Interface.h"
#include "LuaInitNPCs.h"
#include "email.h"
struct
{
PARSE_STAGE curElement;
PARSE_STAGE curElement;
CHAR8 szCharData[MAIL_STRING_SIZE + 1];
CHAR16 currentMessage[MAIL_STRING_SIZE];
UINT16 currentEmailIndex;
UINT16 currentMessageIndex;
CHAR8 szCharData[MAIL_STRING_SIZE+1];
EMAIL_OTHER_VALUES curEmailOther;
UINT32 maxArraySize;
UINT32 curIndex;
UINT32 currentDepth;
UINT32 maxReadDepth;
} typedef EmailXMLParseData;
UINT32 maxArraySize;
UINT32 curIndex;
UINT32 currentDepth;
UINT32 maxReadDepth;
}
BOOLEAN Emails_TextOnly;
typedef EmailOtherParseData;
BOOLEAN EmailOther_TextOnly;
static void XMLCALL
EmailOtherStartElementHandle(void* userData, const XML_Char* name, const XML_Char** atts)
EmailOtherStartElementHandle(void *userData, const XML_Char *name, const XML_Char **atts)
{
EmailXMLParseData* pData = (EmailXMLParseData*)userData;
EmailOtherParseData * pData = (EmailOtherParseData *)userData;
if (pData->currentDepth <= pData->maxReadDepth) //are we reading this element?
{
if (strcmp(name, "EMAILS") == 0 && pData->curElement == ELEMENT_NONE)
{
pData->curElement = ELEMENT_LIST;
if(pData->currentDepth <= pData->maxReadDepth) //are we reading this element?
{
if(strcmp(name, "NEW_EMAIL") == 0 && pData->curElement == ELEMENT_NONE)
{
pData->curElement = ELEMENT_LIST;
pData->maxReadDepth++; //we are not skipping this element
}
else if (strcmp(name, "EMAIL") == 0 && pData->curElement == ELEMENT_LIST)
{
pData->curElement = ELEMENT;
pData->maxReadDepth++; //we are not skipping this element
}
else if(strcmp(name, "EMAIL") == 0 && pData->curElement == ELEMENT_LIST)
{
pData->curElement = ELEMENT;
pData->maxReadDepth++; //we are not skipping this element
}
else if (pData->curElement == ELEMENT &&
(strcmp(name, "Index") == 0 ||
strcmp(name, "Sender") == 0 ||
strcmp(name, "Subject") == 0 ||
strcmp(name, "Message") == 0))
{
pData->curElement = ELEMENT_PROPERTY;
pData->maxReadDepth++; //we are not skipping this element
}
else if(pData->curElement == ELEMENT &&
(strcmp(name, "uiIndex") == 0 ||
strcmp(name, "Subject") == 0 ||
strcmp(name, "Message0") == 0 ||
strcmp(name, "Message1") == 0 ||
strcmp(name, "Message2") == 0 ||
strcmp(name, "Message3") == 0 ||
strcmp(name, "Message4") == 0 ||
strcmp(name, "Message5") == 0 ||
strcmp(name, "Message6") == 0 ||
strcmp(name, "Message7") == 0 ||
strcmp(name, "Message8") == 0 ||
strcmp(name, "Message9") == 0 ||
strcmp(name, "Message10") == 0 ||
strcmp(name, "Message11") == 0 ||
strcmp(name, "Message12") == 0 ||
strcmp(name, "Message13") == 0 ||
strcmp(name, "Message14") == 0 ||
strcmp(name, "Message15") == 0 ||
strcmp(name, "Message16") == 0 ||
strcmp(name, "Message17") == 0 ||
strcmp(name, "Message18") == 0 ||
strcmp(name, "Message19") == 0 ||
strcmp(name, "Message20") == 0 ||
strcmp(name, "Message21") == 0 ||
strcmp(name, "Message22") == 0 ||
strcmp(name, "Message23") == 0 ||
strcmp(name, "Message24") == 0 ||
strcmp(name, "Message25") == 0 ||
strcmp(name, "Message26") == 0 ||
strcmp(name, "Message27") == 0 ||
strcmp(name, "Message28") == 0 ||
strcmp(name, "Message29") == 0 ))
{
pData->curElement = ELEMENT_PROPERTY;
pData->maxReadDepth++; //we are not skipping this element
}
pData->maxReadDepth++; //we are not skipping this element
}
pData->szCharData[0] = '\0';
}
pData->szCharData[0] = '\0';
}
pData->currentDepth++;
pData->currentDepth++;
}
static void XMLCALL
EmailOtherCharacterDataHandle(void* userData, const XML_Char* str, int len)
EmailOtherCharacterDataHandle(void *userData, const XML_Char *str, int len)
{
EmailXMLParseData* pData = (EmailXMLParseData*)userData;
EmailOtherParseData * pData = (EmailOtherParseData *)userData;
if ((pData->currentDepth <= pData->maxReadDepth) &&
(strlen(pData->szCharData) < MAX_CHAR_DATA_LENGTH)
) {
strncat(pData->szCharData, str, __min((unsigned int)len, MAX_CHAR_DATA_LENGTH - strlen(pData->szCharData)));
}
if( (pData->currentDepth <= pData->maxReadDepth) &&
(strlen(pData->szCharData) < MAX_CHAR_DATA_LENGTH)
){
strncat(pData->szCharData,str,__min((unsigned int)len,MAX_CHAR_DATA_LENGTH-strlen(pData->szCharData)));
}
}
static void XMLCALL
EmailOtherEndElementHandle(void* userData, const XML_Char* name)
EmailOtherEndElementHandle(void *userData, const XML_Char *name)
{
EmailXMLParseData* pData = (EmailXMLParseData*)userData;
EmailOtherParseData * pData = (EmailOtherParseData *)userData;
if (pData->currentDepth <= pData->maxReadDepth)
{
if (strcmp(name, "EMAILS") == 0)
{
pData->curElement = ELEMENT_NONE;
}
else if (strcmp(name, "EMAIL") == 0)
{
pData->curElement = ELEMENT_LIST;
if ( Emails_TextOnly )
{
pData->currentEmailIndex += 1;
pData->currentMessageIndex = 0;
}
}
else if (strcmp(name, "Sender") == 0)
{
pData->curElement = ELEMENT;
if ( !Emails_TextOnly )
{
gEmails.push_back(EMAIL_XML {});
gEmails.back().Sender = atol(pData->szCharData);
}
}
else if (strcmp(name, "Subject") == 0)
{
pData->curElement = ELEMENT;
if ( !Emails_TextOnly )
{
MultiByteToWideChar(CP_UTF8, 0, pData->szCharData, -1, gEmails.back().Subject, sizeof(gEmails.back().Subject) / sizeof(gEmails.back().Subject[0]));
}
else
{
// Replace existing text with localized version
const auto i = pData->currentEmailIndex;
MultiByteToWideChar(CP_UTF8, 0, pData->szCharData, -1, gEmails[i].Subject, sizeof(gEmails[i].Subject) / sizeof(gEmails[i].Subject[0]));
}
}
else if (strcmp(name, "Message") == 0)
{
pData->curElement = ELEMENT;
MultiByteToWideChar(CP_UTF8, 0, pData->szCharData, -1, pData->currentMessage, sizeof(pData->currentMessage) / sizeof(pData->currentMessage[0]));
if(pData->currentDepth <= pData->maxReadDepth)
{
if(strcmp(name, "NEW_EMAIL") == 0)
{
pData->curElement = ELEMENT_NONE;
}
else if(strcmp(name, "EMAIL") == 0)
{
pData->curElement = ELEMENT_LIST;
if (!EmailOther_TextOnly)
{
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szSubject, pData->curEmailOther.szSubject);
// L"12345678901234567890123456789" <- max lenght (szMessage[30])
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[0], L"1. sdssdsfs dfg fdgd fg test" ); //pData-curEmailOther.szMessage[0]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[1], L"2. sdssdsfs dfg fgfgffds test" );
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[2], L"3. sdssdsfsd gdfg fdfgsf test" );
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[3], L"4. sdssdsf dgdfg dgsfdsf test" );
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[4], L"5. sdssdsfdgdfg dgfddsf test" );
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[5], L"6. sdssdsfsffdsf test" );
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[6], L"7. sdssdsfsffdsf test" );
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[7], L"8. sdssdsfsfdgdgfgfdsf test" );
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[8], L"9. sdssdsfsff dg gdg dsf test" );
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[9], L"10. sdssdsfsfgdsgdfgfdsf test" );
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[10], L"11. sdssdsfsff dgfgd dsf test" );
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[11], L"12. sdssdsfsf dfgdfg dsf test" );
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[12], L"13. sdssdsfsf dfgg gfdsf test" );
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[13], L"14. sdssdsf dgdf gsffdsf test" );
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[14], L"15. sdssdsf dgdf f ffdsf test" );
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[15], L"16. sdssdsfs dgdf gffdsf test" );
if ( !Emails_TextOnly )
{
gEmails.back().Messages.emplace_back(pData->currentMessage);
}
else
{
// Replace existing text with localized version
const auto i = pData->currentEmailIndex;
const auto j = pData->currentMessageIndex;
gEmails[i].Messages[j] = pData->currentMessage;
/*
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[1], pData->curEmailOther.szMessage[1]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[2], pData->curEmailOther.szMessage[2]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[3], pData->curEmailOther.szMessage[3]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[4], pData->curEmailOther.szMessage[4]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[5], pData->curEmailOther.szMessage[5]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[6], pData->curEmailOther.szMessage[6]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[7], pData->curEmailOther.szMessage[7]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[8], pData->curEmailOther.szMessage[8]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[9], pData->curEmailOther.szMessage[9]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[10], pData->curEmailOther.szMessage[10]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[11], pData->curEmailOther.szMessage[11]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[12], pData->curEmailOther.szMessage[12]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[13], pData->curEmailOther.szMessage[13]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[14], pData->curEmailOther.szMessage[14]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[15], pData->curEmailOther.szMessage[15]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[16], pData->curEmailOther.szMessage[16]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[17], pData->curEmailOther.szMessage[17]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[18], pData->curEmailOther.szMessage[18]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[19], pData->curEmailOther.szMessage[19]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[20], pData->curEmailOther.szMessage[20]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[21], pData->curEmailOther.szMessage[21]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[22], pData->curEmailOther.szMessage[22]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[23], pData->curEmailOther.szMessage[23]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[24], pData->curEmailOther.szMessage[24]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[25], pData->curEmailOther.szMessage[25]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[26], pData->curEmailOther.szMessage[26]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[27], pData->curEmailOther.szMessage[27]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[28], pData->curEmailOther.szMessage[28]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[29], pData->curEmailOther.szMessage[29]);
*/
}
else
{
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szSubject, pData->curEmailOther.szSubject);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[0], L"sdssdsfsffdsf test" ); //pData->curEmailOther.szMessage[0]);
/*
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[1], pData->curEmailOther.szMessage[1]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[2], pData->curEmailOther.szMessage[2]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[3], pData->curEmailOther.szMessage[3]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[4], pData->curEmailOther.szMessage[4]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[5], pData->curEmailOther.szMessage[5]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[6], pData->curEmailOther.szMessage[6]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[7], pData->curEmailOther.szMessage[7]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[8], pData->curEmailOther.szMessage[8]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[9], pData->curEmailOther.szMessage[9]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[10], pData->curEmailOther.szMessage[10]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[11], pData->curEmailOther.szMessage[11]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[12], pData->curEmailOther.szMessage[12]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[13], pData->curEmailOther.szMessage[13]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[14], pData->curEmailOther.szMessage[14]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[15], pData->curEmailOther.szMessage[15]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[16], pData->curEmailOther.szMessage[16]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[17], pData->curEmailOther.szMessage[17]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[18], pData->curEmailOther.szMessage[18]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[19], pData->curEmailOther.szMessage[19]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[20], pData->curEmailOther.szMessage[20]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[21], pData->curEmailOther.szMessage[21]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[22], pData->curEmailOther.szMessage[22]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[23], pData->curEmailOther.szMessage[23]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[24], pData->curEmailOther.szMessage[24]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[25], pData->curEmailOther.szMessage[25]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[26], pData->curEmailOther.szMessage[26]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[27], pData->curEmailOther.szMessage[27]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[28], pData->curEmailOther.szMessage[28]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[29], pData->curEmailOther.szMessage[29]);
*/
}
}
else if(strcmp(name, "uiIndex") == 0)
{
pData->curElement = ELEMENT;
pData->curEmailOther.uiIndex = (UINT8) atol(pData->szCharData);
}
else if(strcmp(name, "Subject") == 0 )
{
pData->curElement = ELEMENT;
pData->currentMessageIndex++;
}
}
MultiByteToWideChar( CP_UTF8, 0, pData->szCharData, -1, pData->curEmailOther.szSubject, sizeof(pData->curEmailOther.szSubject)/sizeof(pData->curEmailOther.szSubject[0]) );
pData->curEmailOther.szSubject[sizeof(pData->curEmailOther.szSubject)/sizeof(pData->curEmailOther.szSubject[0]) - 1] = '\0';
}
/*
else if(strcmp(name, "Message0") == 0 )
{
pData->curElement = ELEMENT;
pData->maxReadDepth--;
}
pData->currentDepth--;
MultiByteToWideChar( CP_UTF8, 0, pData->szCharData, -1, pData->curEmailOther.szMessage[0], sizeof(pData->curEmailOther.szMessage[0])/sizeof(pData->curEmailOther.szMessage[0]) );
pData->curEmailOther.szMessage[sizeof(pData->curEmailOther.szMessage[0])/sizeof(pData->curEmailOther.szMessage[0]) - 1][0] = '\0';
}
*/
pData->maxReadDepth--;
}
pData->currentDepth--;
}
BOOLEAN ReadInExternalizedEmails(STR fileName, BOOLEAN localizedVersion)
BOOLEAN ReadInEmailOther(STR fileName, BOOLEAN localizedVersion)
{
HWFILE hFile;
UINT32 uiBytesRead;
UINT32 uiFSize;
CHAR8* lpcBuffer;
XML_Parser parser = XML_ParserCreate(NULL);
HWFILE hFile;
UINT32 uiBytesRead;
UINT32 uiFSize;
CHAR8 * lpcBuffer;
XML_Parser parser = XML_ParserCreate(NULL);
EmailXMLParseData pData;
EmailOtherParseData pData;
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, "Loading Emails.xml");
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, "Loading EmailOther.xml" );
Emails_TextOnly = localizedVersion;
EmailOther_TextOnly = localizedVersion;
// Open file
hFile = FileOpen( fileName, FILE_ACCESS_READ, FALSE );
if ( !hFile )
return( localizedVersion );
// Open file
hFile = FileOpen(fileName, FILE_ACCESS_READ, FALSE);
if (!hFile)
return(localizedVersion);
uiFSize = FileGetSize(hFile);
lpcBuffer = (CHAR8 *) MemAlloc(uiFSize+1);
uiFSize = FileGetSize(hFile);
lpcBuffer = (CHAR8*)MemAlloc(uiFSize + 1);
//Read in block
if ( !FileRead( hFile, lpcBuffer, uiFSize, &uiBytesRead ) )
{
MemFree(lpcBuffer);
return( FALSE );
}
//Read in block
if (!FileRead(hFile, lpcBuffer, uiFSize, &uiBytesRead))
{
MemFree(lpcBuffer);
return(FALSE);
}
lpcBuffer[uiFSize] = 0; //add a null terminator
lpcBuffer[uiFSize] = 0; //add a null terminator
FileClose(hFile);
FileClose( hFile );
XML_SetElementHandler(parser, EmailOtherStartElementHandle, EmailOtherEndElementHandle);
XML_SetCharacterDataHandler(parser, EmailOtherCharacterDataHandle);
XML_SetElementHandler(parser, EmailOtherStartElementHandle, EmailOtherEndElementHandle);
XML_SetCharacterDataHandler(parser, EmailOtherCharacterDataHandle);
memset(&pData, 0, sizeof(pData));
XML_SetUserData(parser, &pData);
gEmails.reserve(XML_JA2UB_SPECK_DISMISSALREFUND);
if (!XML_Parse(parser, lpcBuffer, uiFSize, TRUE))
{
CHAR8 errorBuf[511];
sprintf(errorBuf, "XML Parser Error in Emails.xml: %s at line %d", XML_ErrorString(XML_GetErrorCode(parser)), XML_GetCurrentLineNumber(parser));
LiveMessage(errorBuf);
MemFree(lpcBuffer);
return FALSE;
}
MemFree(lpcBuffer);
memset(&pData,0,sizeof(pData));
XML_SetUserData(parser, &pData);
XML_ParserFree(parser);
if(!XML_Parse(parser, lpcBuffer, uiFSize, TRUE))
{
CHAR8 errorBuf[511];
sprintf(errorBuf, "XML Parser Error in EmailOther.xml: %s at line %d", XML_ErrorString(XML_GetErrorCode(parser)), XML_GetCurrentLineNumber(parser));
LiveMessage(errorBuf);
MemFree(lpcBuffer);
return FALSE;
}
MemFree(lpcBuffer);
return(TRUE);
XML_ParserFree(parser);
return( TRUE );
}
+511 -518
View File
File diff suppressed because it is too large Load Diff
+19 -97
View File
@@ -5,7 +5,8 @@
#include "soldier profile type.h"
// defines
#define MAX_MESSAGES_PAGE 18 // max number of emails per page in inbox
#define MAX_EMAIL_LINES 10 //max number of lines can be shown in a message
#define MAX_MESSAGES_PAGE 18 // max number of messages per page
//---ja25 ub
#ifdef JA2UB
@@ -566,10 +567,11 @@ void RenderEmail();
// message manipulation
void AddEmailMessage(INT32 iMessageOffset, INT32 iMessageLength,STR16 pSubject, INT32 iDate, UINT8 ubSender, BOOLEAN fAlreadyRead, INT32 iFirstData, UINT32 uiSecondData, INT32 iThirdData, INT32 iFourthData, UINT32 uiFifthData, UINT32 uiSixData, INT32 iCurrentIMPPosition, INT16 iCurrentShipmentDestinationID, UINT8 EmailType, UINT32 EmailAIM );
void AddEmailMessage(INT32 iMessageOffset, INT32 iMessageLength,STR16 pSubject, INT32 iDate, UINT8 ubSender, BOOLEAN fAlreadyRead, INT32 uiFirstData, UINT32 uiSecondData, INT32 iCurrentIMPPosition, INT16 iCurrentShipmentDestinationID, UINT8 EmailType, UINT32 EmailAIM );
void RemoveEmailMessage(INT32 iId);
EmailPtr GetEmailMessage(INT32 iId);
void LookForUnread();
void AddEmail(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, INT32 iCurrentIMPPosition, INT16 iCurrentShipmentDestinationID, UINT8 EmailType);
// WANNE: For the new WF merc, when they available again
void AddEmailWFMercAvailable(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, INT32 iCurrentIMPPosition, UINT8 EmailType);
@@ -584,19 +586,14 @@ void ReDrawNewMailBox( void );
void ReDisplayBoxes( void );
void ShutDownEmailList();
void AddMessageToPages(INT32 iMessageId);
void AddEmailWithSpecialData(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, INT32 iFirstData, UINT32 uiSecondData, UINT8 EmailType, UINT32 EmailAIM );
void AddCustomEmail(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, INT32 iCurrentIMPPosition, INT16 iCurrentShipmentDestinationID, UINT8 EmailType);
#ifdef JA2BETAVERSION
void AddAllEmails();
#endif
typedef struct
{
UINT8 Sender;
CHAR16 Subject[EMAIL_SUBJECT_LENGTH];
std::vector<std::wstring> Messages;
} EMAIL_XML;
extern std::vector<EMAIL_XML> gEmails;
typedef struct
{
UINT8 uiIndex;
@@ -677,8 +674,8 @@ enum {
TYPE_EMAIL_KING_PIN,
TYPE_EMAIL_JOHN_KULBA,
TYPE_EMAIL_AIM_SITE,
//Read message from Email\Emails.xml and sender read from Email\EmailSenderNameList.xml
TYPE_EMAIL_XML,
TYPE_EMAIL_OTHER,
};
enum {
@@ -700,96 +697,15 @@ enum {
TYPE_EMAIL_BOBBY_R_L1 = 11,
};
enum {
XML_NOEMAIL = -1,
XML_ENRICO_INQUIRY = 0,
XML_ENRICO_FOLLOWUP,
XML_ENRICO_CONFIRMED,
XML_ENRICO_GOODLUCK,
XML_ENRICO_GREATNEWS,
XML_ENRICO_PROGRESS,
XML_ENRICO_GOODWORK,
XML_ENRICO_FINALPUSH,
XML_ENRICO_SETBACK,
XML_ENRICO_BADNEWS,
XML_ENRICO_CREPITUS,
XML_ENRICO_CONCERNED,
XML_ENRICO_WORRIED,
XML_ENRICO_DISAPPOINTED,
XML_ENRICO_MILITIA_WEBSITE,
XML_ENRICO_INTEL,
XML_IMP_INTRO,
XML_IMP_INTROAGAIN,
XML_SPECK_INTRO,
XML_SPECK_NEWSITE,
XML_SPECK_NOTICE,
XML_SPECK_NEWPERSONNEL,
XML_SPECK_PLEASEPAY,
XML_SPECK_DELINQUENT,
XML_RISREPORT,
XML_INSURANCE_APPROVED,
XML_INSURANCE_SUSPICIOUS,
XML_INSURANCE_COMPLETED,
XML_INSURANCE_INVESTIGATION,
XML_INSURANCE_REFUSED,
XML_INSURANCE_POLICYVIOLATION,
XML_BR_VISITEDSITE,
XML_BR_SHIPMENTARRIVAL,
XML_BR_MEDUNA,
XML_KINGPIN_STOLEMONEY,
XML_KINGPIN_JOBOPPORTUNITY,
XML_KINGPIN_WELLDONE,
XML_KINGPIN_FAILURE,
XML_KINGPIN_FAILUREOBSTACLES,
XML_JOHNKULBA_SENTGUNS,
XML_JOHNKULBA_MISSEDTRANSFERFLIGHT,
XML_JOHNKULBA_CRASHLANDEDHELI,
XML_JOHNKULBA_AMBUSHEDBYCATS,
XML_AIM_NOTICE_OF_DEATH,
XML_AIM_REFUND,
XML_AIM_PARTIALREFUND,
XML_AIM_NOREFUND,
XML_KERBERUS_OFFER,
XML_DASILVA_THANKYOU,
XML_JA2UB_ENRICO_HELP,
XML_JA2UB_ENRICO_INQUIRY,
XML_JA2UB_ENRICO_STILLNOWORD,
XML_JA2UB_ENRICO_GOODNEWS,
XML_JA2UB_ENRICO_CONCERNED,
XML_JA2UB_ENRICO_URGENT,
XML_JA2UB_ENRICO_RECEIVEDEMAIL,
XML_JA2UB_ENRICO_RECEIVEDEMAILMONEY,
XML_JA2UB_ENRICO_PILOTFOUND,
XML_JA2UB_ENRICO_CONGRATS,
XML_JA2UB_ENRICO_CONGRATS_MIGUELSICK,
XML_JA2UB_ENRICO_CONGRATS_MIGUELSICK_MANUELDEAD,
XML_JA2UB_ENRICO_CONGRATS_MIGUELSICK_MANUELALIVE,
XML_JA2UB_ENRICO_CONGRATS_MANUELDEAD,
XML_JA2UB_ENRICO_CONGRATS_MANUELALIVE,
XML_JA2UB_IMP_INTRO,
XML_JA2UB_IMP_INTROAGAIN,
XML_JA2UB_MIGUEL_HELLO,
XML_JA2UB_MIGUEL_SORRY,
XML_JA2UB_MIGUEL_SORRY_HIREDMANUEL,
XML_JA2UB_MIGUEL_SICK,
XML_JA2UB_MIGUEL_CIGARETTES,
XML_JA2UB_AIM_SPECIALOFFER,
XML_JA2UB_AIM_BONUSOFFER,
XML_JA2UB_AIM_SPECIALBONUSOFFER,
XML_JA2UB_AIM_DISMISSALREFUND,
XML_JA2UB_SPECK_EVENBETTEROFFER,
XML_JA2UB_SPECK_DISMISSALREFUND
};
void AddEmail(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, INT32 iCurrentIMPPosition, INT16 iCurrentShipmentDestinationID, UINT8 EmailType, UINT16 EnumEmailXML = XML_NOEMAIL);
void AddEmailWithSpecialData(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, INT32 iFirstData, UINT32 uiSecondData, UINT8 EmailType, UINT32 EmailAIM, UINT16 EnumEmailXML = XML_NOEMAIL);
extern EMAIL_MERC_AVAILABLE_VALUES EmailMercAvailableText[NUM_PROFILES];
extern EMAIL_MERC_LEVEL_UP_VALUES EmailMercLevelUpText[NUM_PROFILES];
extern EMAIL_MERC_INSURANCE_VALUES EmailInsuranceText[NUM_PROFILES];
extern EMAIL_OTHER_VALUES EmailOtherText[EMAIL_INDEX];
extern BOOLEAN ReadXMLEmail;
extern void AddEmailTypeXML( INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, INT32 iCurrentIMPPosition, UINT8 EmailType );
extern void AddPreReadEmailTypeXML( INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, UINT8 EmailType );
extern void AddEmailFromXML(INT32 iMessageOffset, INT32 iDate, INT32 iCurrentIMPPosition, INT16 iCurrentShipmentDestinationID, BOOLEAN alreadyRead, INT32 iFirstData, UINT32 uiSecondData, INT32 iThirdData, INT32 iFourthData, UINT32 uiFifthData, UINT32 uiSixData);
extern void AddEmailWithSpecialDataXML(INT32 iMessageOffset, INT32 iDate, INT32 iCurrentIMPPosition, INT16 iCurrentShipmentDestinationID, BOOLEAN alreadyRead, INT32 iFirstData, UINT32 uiSecondData, INT32 iThirdData, INT32 iFourthData, UINT32 uiFifthData, UINT32 uiSixData);
extern void AddEmailWithSpecialDataXML(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, INT32 iFirstData, UINT32 uiSecondData, UINT8 EmailTyp, UINT32 EmailAIMe );
extern BOOLEAN SaveNewEmailDataToSaveGameFile( HWFILE hFile );
extern BOOLEAN LoadNewEmailDataFromLoadGameFile( HWFILE hFile );
@@ -798,3 +714,9 @@ extern void AddBobbyREmailJA2(INT32 iMessageOffset, INT32 iMessageLength, UINT8
#endif
#endif
+25 -40
View File
@@ -1350,8 +1350,7 @@ BOOLEAN AddLifeInsurancePayout( SOLDIERTYPE *pSoldier )
void StartInsuranceInvestigation( UINT16 ubPayoutID )
{
const auto mercID = LaptopSaveInfo.pLifeInsurancePayouts[ubPayoutID].ubMercID;
const auto payoutPrice = LaptopSaveInfo.pLifeInsurancePayouts[ubPayoutID].iPayOutPrice;
UINT8 ubDays;
// send an email telling player an investigation is taking place
if (gStrategicStatus.ubInsuranceInvestigationsCnt == 0)
@@ -1362,12 +1361,10 @@ void StartInsuranceInvestigation( UINT16 ubPayoutID )
if( gubQuest[ QUEST_FIX_LAPTOP ] == QUESTDONE || gGameUBOptions.LaptopQuestEnabled == FALSE )
{
if ( gGameUBOptions.LaptopLinkInsurance == TRUE )
{
AddEmailWithSpecialData(173, INSUR_SUSPIC_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), payoutPrice, mercID, TYPE_EMAIL_INSURANCE_COMPANY_EMAIL_JA2_EDT, TYPE_E_INSURANCE_L4, XML_INSURANCE_SUSPICIOUS);
}
AddEmailWithSpecialData( 173, INSUR_SUSPIC_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID, TYPE_EMAIL_INSURANCE_COMPANY_EMAIL_JA2_EDT, TYPE_E_INSURANCE_L4 );
}
#else
AddEmailWithSpecialData(INSUR_SUSPIC, INSUR_SUSPIC_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), payoutPrice, mercID, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE, XML_INSURANCE_SUSPICIOUS);
AddEmailWithSpecialData( INSUR_SUSPIC, INSUR_SUSPIC_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE );
#endif
}
else
@@ -1378,17 +1375,14 @@ void StartInsuranceInvestigation( UINT16 ubPayoutID )
if( gubQuest[ QUEST_FIX_LAPTOP ] == QUESTDONE || gGameUBOptions.LaptopQuestEnabled == FALSE )
{
if ( gGameUBOptions.LaptopLinkInsurance == TRUE )
{
AddEmailWithSpecialData(179, INSUR_SUSPIC_2_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), payoutPrice, mercID, TYPE_EMAIL_INSURANCE_COMPANY_EMAIL_JA2_EDT, TYPE_E_INSURANCE_L5, XML_INSURANCE_INVESTIGATION);
}
AddEmailWithSpecialData( 179, INSUR_SUSPIC_2_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID, TYPE_EMAIL_INSURANCE_COMPANY_EMAIL_JA2_EDT, TYPE_E_INSURANCE_L5 );
}
#else
AddEmailWithSpecialData(INSUR_SUSPIC_2, INSUR_SUSPIC_2_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), payoutPrice, mercID, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE, XML_INSURANCE_INVESTIGATION);
AddEmailWithSpecialData( INSUR_SUSPIC_2, INSUR_SUSPIC_2_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE );
#endif
}
UINT8 ubDays;
if ( gMercProfiles[ mercID ].ubSuspiciousDeath == VERY_SUSPICIOUS_DEATH )
if ( gMercProfiles[ LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID ].ubSuspiciousDeath == VERY_SUSPICIOUS_DEATH )
{
// the fact that you tried to cheat them gets realized very quickly. :-)
ubDays = 1;
@@ -1409,47 +1403,42 @@ void StartInsuranceInvestigation( UINT16 ubPayoutID )
void EndInsuranceInvestigation( UINT16 ubPayoutID )
{
const auto mercID = LaptopSaveInfo.pLifeInsurancePayouts[ubPayoutID].ubMercID;
const auto payoutPrice = LaptopSaveInfo.pLifeInsurancePayouts[ubPayoutID].iPayOutPrice;
// send an email telling player the investigation is over
if ( gMercProfiles[ mercID ].ubSuspiciousDeath == VERY_SUSPICIOUS_DEATH )
if ( gMercProfiles[ LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID ].ubSuspiciousDeath == VERY_SUSPICIOUS_DEATH )
{
// fraud, no payout!
#ifdef JA2UB
if ( gubQuest[QUEST_FIX_LAPTOP] == QUESTDONE || gGameUBOptions.LaptopQuestEnabled == FALSE )
{
if ( gGameUBOptions.LaptopLinkInsurance == TRUE )
{
AddEmailWithSpecialData(INSUR_1HOUR_FRAUD, INSUR_1HOUR_FRAUD_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), payoutPrice, mercID, TYPE_EMAIL_INSURANCE_COMPANY_EMAIL_JA2_EDT, TYPE_E_INSURANCE_L2, XML_INSURANCE_REFUSED);
}
}
// no UB
if( gubQuest[ QUEST_FIX_LAPTOP ] == QUESTDONE || gGameUBOptions.LaptopQuestEnabled == FALSE )
{
if ( gGameUBOptions.LaptopLinkInsurance == TRUE )
AddEmailWithSpecialData( INSUR_1HOUR_FRAUD, INSUR_1HOUR_FRAUD_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID, TYPE_EMAIL_INSURANCE_COMPANY_EMAIL_JA2_EDT, TYPE_E_INSURANCE_L2 );
}
#else
AddEmailWithSpecialData(INSUR_1HOUR_FRAUD, INSUR_1HOUR_FRAUD_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), payoutPrice, mercID, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE, XML_INSURANCE_REFUSED);
AddEmailWithSpecialData( INSUR_1HOUR_FRAUD, INSUR_1HOUR_FRAUD_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE );
#endif
}
// Flugente: also don't pay out if the death was suspicious. I mean, we get this if there were no enemies of the player straight up shot the guy...
else if ( gMercProfiles[mercID].ubSuspiciousDeath == SUSPICIOUS_DEATH )
else if ( gMercProfiles[LaptopSaveInfo.pLifeInsurancePayouts[ubPayoutID].ubMercID].ubSuspiciousDeath == SUSPICIOUS_DEATH )
{
#ifdef JA2UB
// WANNE: I really don't know if we should call something here. At least it fixed the compilation error when compiling UB version.
#else
// fraud, no payout!
AddEmailWithSpecialData(INSUR_CHEAT_FRAUD, INSUR_CHEAT_FRAUD_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), payoutPrice, mercID, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE, XML_INSURANCE_POLICYVIOLATION);
AddEmailWithSpecialData( INSUR_CHEAT_FRAUD, INSUR_CHEAT_FRAUD_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ubPayoutID].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ubPayoutID].ubMercID, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE );
#endif
}
else
{
#ifdef JA2UB
// No UB
if( gubQuest[ QUEST_FIX_LAPTOP ] == QUESTDONE || gGameUBOptions.LaptopQuestEnabled == FALSE )
{
if ( gGameUBOptions.LaptopLinkInsurance == TRUE )
{
AddEmailWithSpecialData(176, INSUR_INVEST_OVER_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), payoutPrice, mercID, TYPE_EMAIL_INSURANCE_COMPANY_EMAIL_JA2_EDT, TYPE_E_INSURANCE_L6, XML_INSURANCE_COMPLETED);
}
AddEmailWithSpecialData( 176, INSUR_INVEST_OVER_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID, TYPE_EMAIL_INSURANCE_COMPANY_EMAIL_JA2_EDT, TYPE_E_INSURANCE_L6 );
}
#else
AddEmailWithSpecialData(INSUR_INVEST_OVER, INSUR_INVEST_OVER_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), payoutPrice, mercID, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE, XML_INSURANCE_COMPLETED);
AddEmailWithSpecialData( INSUR_INVEST_OVER, INSUR_INVEST_OVER_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE );
#endif
// only now make a payment (immediately)
@@ -1461,9 +1450,6 @@ void EndInsuranceInvestigation( UINT16 ubPayoutID )
//void InsuranceContractPayLifeInsuranceForDeadMerc( LIFE_INSURANCE_PAYOUT *pPayoutStruct )
void InsuranceContractPayLifeInsuranceForDeadMerc( UINT16 ubPayoutID )
{
const auto mercID = LaptopSaveInfo.pLifeInsurancePayouts[ubPayoutID].ubMercID;
const auto payoutPrice = LaptopSaveInfo.pLifeInsurancePayouts[ubPayoutID].iPayOutPrice;
//if the mercs id number is the same what is in the soldier array
if( LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubSoldierID == LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubSoldierID->ubID )
{
@@ -1473,25 +1459,24 @@ void InsuranceContractPayLifeInsuranceForDeadMerc( UINT16 ubPayoutID )
}
//add transaction to players account
AddTransactionToPlayersBook( INSURANCE_PAYOUT, mercID, GetWorldTotalMin(), payoutPrice );
AddTransactionToPlayersBook( INSURANCE_PAYOUT, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice );
//add to the history log the fact that the we paid the insurance claim
AddHistoryToPlayersLog( HISTORY_INSURANCE_CLAIM_PAYOUT, mercID, GetWorldTotalMin(), -1, -1 );
AddHistoryToPlayersLog( HISTORY_INSURANCE_CLAIM_PAYOUT, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID, GetWorldTotalMin(), -1, -1 );
//if there WASNT an investigation
if( gMercProfiles[ mercID ].ubSuspiciousDeath == 0 )
if( gMercProfiles[ LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID ].ubSuspiciousDeath == 0 )
{
//Add an email telling the user that he received an insurance payment
#ifdef JA2UB
// no UB
if( gubQuest[ QUEST_FIX_LAPTOP ] == QUESTDONE || gGameUBOptions.LaptopQuestEnabled == FALSE )
{
if ( gGameUBOptions.LaptopLinkInsurance == TRUE )
{
AddEmailWithSpecialData(170, INSUR_PAYMENT_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), payoutPrice, mercID, TYPE_EMAIL_INSURANCE_COMPANY_EMAIL_JA2_EDT, TYPE_E_INSURANCE_L3, XML_INSURANCE_APPROVED);
}
AddEmailWithSpecialData( 170, INSUR_PAYMENT_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID, TYPE_EMAIL_INSURANCE_COMPANY_EMAIL_JA2_EDT, TYPE_E_INSURANCE_L3 );
}
#else
AddEmailWithSpecialData(INSUR_PAYMENT, INSUR_PAYMENT_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), payoutPrice, mercID, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE, XML_INSURANCE_APPROVED);
AddEmailWithSpecialData( INSUR_PAYMENT, INSUR_PAYMENT_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE );
#endif
}
+1 -1
View File
@@ -3294,7 +3294,7 @@ void HaventMadeImpMercEmailCallBack()
if( ( LaptopSaveInfo.fIMPCompletedFlag == FALSE ) && ( LaptopSaveInfo.fSentImpWarningAlready == FALSE ) )
{
LaptopSaveInfo.fSentImpWarningAlready = TRUE;
AddEmail(IMP_EMAIL_AGAIN,IMP_EMAIL_AGAIN_LENGTH,1, GetWorldTotalMin( ), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_IMP_INTROAGAIN);
AddEmail(IMP_EMAIL_AGAIN,IMP_EMAIL_AGAIN_LENGTH,1, GetWorldTotalMin( ), -1, -1, TYPE_EMAIL_EMAIL_EDT );
}
#endif
}
+6 -5
View File
@@ -1039,7 +1039,7 @@ void DailyUpdateOfMercSite( UINT16 usDate)
LaptopSaveInfo.gubPlayersMercAccountStatus = MERC_ACCOUNT_INVALID;
if( IsSpeckComAvailable() )
{
AddEmail(MERC_INVALID, MERC_INVALID_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_SPECK_NOTICE);
AddEmail( MERC_INVALID, MERC_INVALID_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT);
}
else
{
@@ -1055,7 +1055,7 @@ void DailyUpdateOfMercSite( UINT16 usDate)
LaptopSaveInfo.gubPlayersMercAccountStatus = MERC_ACCOUNT_SUSPENDED;
if( IsSpeckComAvailable() )
{
AddEmail(MERC_WARNING, MERC_WARNING_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_SPECK_DELINQUENT);
AddEmail( MERC_WARNING, MERC_WARNING_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT);
// Have speck complain next time player come to site
LaptopSaveInfo.uiSpeckQuoteFlags |= SPECK_QUOTE__SENT_EMAIL_ABOUT_LACK_OF_PAYMENT;
@@ -1074,7 +1074,7 @@ void DailyUpdateOfMercSite( UINT16 usDate)
LaptopSaveInfo.gubPlayersMercAccountStatus = MERC_ACCOUNT_VALID_FIRST_WARNING;
if( IsSpeckComAvailable() )
{
AddEmail(MERC_FIRST_WARNING, MERC_FIRST_WARNING_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_SPECK_PLEASEPAY);
AddEmail( MERC_FIRST_WARNING, MERC_FIRST_WARNING_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT);
// Have speck complain next time player come to site
LaptopSaveInfo.uiSpeckQuoteFlags |= SPECK_QUOTE__SENT_EMAIL_ABOUT_LACK_OF_PAYMENT;
@@ -2899,7 +2899,8 @@ void GetMercSiteBackOnline()
if( IsSpeckComAvailable() )
{
//Add an email telling the user the site is back up
AddEmail(MERC_NEW_SITE_ADDRESS, MERC_NEW_SITE_ADDRESS_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_SPECK_NEWSITE);
AddEmail( MERC_NEW_SITE_ADDRESS, MERC_NEW_SITE_ADDRESS_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1 , TYPE_EMAIL_EMAIL_EDT);
//Set a flag indicating that the server just went up ( so speck can make a comment when the player next visits the site )
LaptopSaveInfo.fFirstVisitSinceServerWentDown = TRUE;
}
@@ -3212,7 +3213,7 @@ void NewMercsAvailableAtMercSiteCallBack()
if (!sentNewMercsEmail)
{
sentNewMercsEmail = true;
AddEmail(NEW_MERCS_AT_MERC, NEW_MERCS_AT_MERC_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_SPECK_NEWPERSONNEL);
AddEmail(NEW_MERCS_AT_MERC, NEW_MERCS_AT_MERC_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT);
}
//new mercs are available
+1 -1
View File
@@ -1,5 +1,5 @@
#pragma once
#include "Event Pump.h"
//time for a new header :)
extern int readyteamreg[10];
+2
View File
@@ -8,6 +8,7 @@
#include "vsurface.h"
#include "Button System.h"
#include "Font Control.h"
#include "Editor Taskbar Utils.h"
#include "line.h"
#include "input.h"
#include "vobject_blitters.h"
@@ -15,6 +16,7 @@
#include "mousesystem.h"
#include "strategicmap.h"
#include "FileMan.h"
#include "Map Information.h"
#include "Render Dirty.h"
#include "Game Clock.h"
#include "Campaign Types.h"
+21 -1
View File
@@ -6,18 +6,35 @@
#include <math.h>
#include "ASD.h"
#include "strategic.h"
#include "WCheck.h"
#include "Utilities.h"
#include "WordWrap.h"
#include "Cursors.h"
#include "line.h"
#include "Insurance Text.h"
#include "Encrypted File.h"
#include "Text.h"
#include "Multi Language Graphic Utils.h"
#include "random.h"
#include "Interface.h"
#include "Soldier Add.h"
#include "Soldier Profile.h"
#include "Overhead.h"
#include <Font Control.h>
#include "Map Screen Interface.h"
#include "finances.h"
#include "Game Clock.h"
#include "SaveLoadGame.h"
#include "GameVersion.h"
#include "message.h"
#include "Game Event Hook.h"
#include "Militia Control.h"
#include "Town Militia.h"
#include "Strategic Town Loyalty.h"
#include "Map Information.h"
#include "Campaign.h"
#include "random.h"
#include "Explosion Control.h"
#include "Strategic AI.h"
#include "Strategic Mines.h"
#include "Reinforcement.h"
@@ -25,6 +42,9 @@
#include "Queen Command.h"
#include "Map Screen Helicopter.h"
#include "Points.h"
#include "worldman.h"
#include "Map Information.h"
#include "opplist.h"
#include "Dialogue Control.h"
#include "Sound Control.h"
#include "renderworld.h"
+5 -10
View File
@@ -186,7 +186,7 @@ REPAIR_PASS_SLOTS_TYPE gRepairPassSlotList[ NUM_REPAIR_PASS_TYPES ] =
{ /* HEADROCK HAM B2.8: LBE Slot pass */ 0, 5, VESTPOCKPOS, LTHIGHPOCKPOS, RTHIGHPOCKPOS, CPACKPOCKPOS, BPACKPOCKPOS, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
};
extern STR16* sRepairsDoneString;
extern STR16 sRepairsDoneString[];
// PopUp Box Handles
INT32 ghAssignmentBox = -1;
@@ -4948,7 +4948,7 @@ static void CollectRepairableItems(SOLDIERTYPE* pRepairSoldier, SOLDIERTYPE* pSo
// Check for attachments (are there stackable items that can take attachments though?)
UINT8 attachmentIndex = 0;
for (attachmentList::const_iterator iter = (*pObj)[stackIndex]->attachments.begin(); iter != (*pObj)[stackIndex]->attachments.end(); ++iter, ++attachmentIndex) {
if ( iter->exists() && IsItemRepairable(pRepairSoldier, iter->usItem, (*iter)[attachmentIndex]->data.objectStatus, (*iter)[attachmentIndex]->data.sRepairThreshold )) {
if (IsItemRepairable(pRepairSoldier, iter->usItem, (*iter)[attachmentIndex]->data.objectStatus, (*iter)[attachmentIndex]->data.sRepairThreshold )) {
// Send the main item, not the attachment
RepairItem item(pObj, pSoldier, (INVENTORY_SLOT) pocketIndex);
itemsToFix.push(item);
@@ -5081,7 +5081,7 @@ OBJECTTYPE* FindRepairableItemInSpecificPocket(SOLDIERTYPE * pSoldier, OBJECTTYP
// have to check for attachments after...
for (attachmentList::iterator iter = (*pObj)[subObject]->attachments.begin(); iter != (*pObj)[subObject]->attachments.end(); ++iter) {
// if it's repairable and NEEDS repairing
if ( iter->exists() && IsItemRepairable( pSoldier, iter->usItem, (*iter)[subObject]->data.objectStatus, (*iter)[subObject]->data.sRepairThreshold ) ) {
if ( IsItemRepairable( pSoldier, iter->usItem, (*iter)[subObject]->data.objectStatus, (*iter)[subObject]->data.sRepairThreshold ) && iter->exists() ) {
return( &(*iter) );
}
}
@@ -5171,12 +5171,8 @@ BOOLEAN RepairObject( SOLDIERTYPE * pSoldier, SOLDIERTYPE * pOwner, OBJECTTYPE *
INT16 threshold = 100;
if ( gGameExternalOptions.fAdvRepairSystem && (Item[pObj->usItem].usItemClass & (IC_WEAPON|IC_ARMOUR)) )
{
if (gSkillTraitValues.fTETraitsCanRestoreItemThreshold && NUM_SKILL_TRAITS(pSoldier, TECHNICIAN_NT) >= gSkillTraitValues.ubTechLevelNeededForAdvancedRepair) // Greysa: added skill check for advanced repair. If we have a high enough technician level, we can repair items above the normal threshold (1 for technician, 2 for engineer)
if ( !gSkillTraitValues.fTETraitsCanRestoreItemThreshold || !HAS_SKILL_TRAIT( pSoldier, TECHNICIAN_NT ) )
{
threshold = 100;
}
else
{
threshold = (*pObj)[ubLoop]->data.sRepairThreshold;
}
}
@@ -11089,8 +11085,7 @@ void DetermineWhichAssignmentMenusCanBeShown( void )
CreateDestroyMouseRegionForFacilityMenu();
CreateDestroyMouseRegionsForFacilityAssignmentMenu();
const auto selectedCharacter = gCharactersList[bSelectedInfoChar].usSolID;
if( selectedCharacter < NOBODY && ( (selectedCharacter->stats.bLife == 0 )||(selectedCharacter->bAssignment == ASSIGNMENT_POW ) ) && ( (guiTacticalInterfaceFlags & INTERFACE_MAPSCREEN ) ) )
if( ( ( gCharactersList[ bSelectedInfoChar ].usSolID->stats.bLife == 0 )||( gCharactersList[bSelectedInfoChar].usSolID->bAssignment == ASSIGNMENT_POW ) ) && ( (guiTacticalInterfaceFlags & INTERFACE_MAPSCREEN ) ) )
{
// show basic assignment menu
ShowBox( ghRemoveMercAssignBox );
+5 -13
View File
@@ -2481,12 +2481,6 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Autoresolve2");
DeleteVideoObjectFromIndex( gpAR->iIndent );
DeleteVideoSurfaceFromIndex( gpAR->iInterfaceBuffer );
// Load necessary mapinfo to place corpses
CHAR8 bFilename[50];
INT32 worldRows, worldCols;
GetMapFileName(gpAR->ubSectorX, gpAR->ubSectorY, 0, bFilename, TRUE, TRUE);
LoadWorldInfoForAutoResolve(bFilename, worldRows, worldCols);
if( fDeleteForGood )
{ //Delete the soldier instances -- done when we are completely finished.
@@ -2525,7 +2519,7 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Autoresolve2");
RemoveCharacterFromSquads( gpMercs[ i ].pSoldier );
ChangeSoldiersAssignment( gpMercs[ i ].pSoldier, ASSIGNMENT_DEAD );
AddDeadSoldierToUnLoadedSector( gpAR->ubSectorX, gpAR->ubSectorY, 0, gpMercs[ i ].pSoldier, RandomGridNoUnloadedSector(worldRows, worldCols), ADD_DEAD_SOLDIER_TO_SWEETSPOT );
AddDeadSoldierToUnLoadedSector( gpAR->ubSectorX, gpAR->ubSectorY, 0, gpMercs[ i ].pSoldier, RandomGridNo(), ADD_DEAD_SOLDIER_TO_SWEETSPOT );
}
else if( gpAR->ubBattleStatus == BATTLE_SURRENDERED || gpAR->ubBattleStatus == BATTLE_CAPTURED )
{
@@ -2630,8 +2624,7 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Autoresolve2");
}
// Flugente: drop sector equipment
const auto gridno = RandomGridNoUnloadedSector(worldRows, worldCols);
gpCivs[ i ].pSoldier->DropSectorEquipment(gridno);
gpCivs[ i ].pSoldier->DropSectorEquipment();
if( fDeleteForGood && gpCivs[ i ].pSoldier->stats.bLife < OKLIFE/2 )
{
@@ -2656,7 +2649,7 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Autoresolve2");
UpdateMilitia( militia );
}
AddDeadSoldierToUnLoadedSector( gpAR->ubSectorX, gpAR->ubSectorY, 0, gpCivs[ i ].pSoldier, gridno, ADD_DEAD_SOLDIER_TO_SWEETSPOT );
AddDeadSoldierToUnLoadedSector( gpAR->ubSectorX, gpAR->ubSectorY, 0, gpCivs[ i ].pSoldier, RandomGridNo(), ADD_DEAD_SOLDIER_TO_SWEETSPOT );
StrategicRemoveMilitiaFromSector( gpCivs[ i ].pSoldier->sSectorX, gpCivs[ i ].pSoldier->sSectorY, ubCurrentRank, 1 );
if( ProcessLoyalty() )
@@ -2688,8 +2681,7 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Autoresolve2");
TrackEnemiesKilled( ENEMY_KILLED_IN_AUTO_RESOLVE, gpEnemies[ i ].pSoldier->ubSoldierClass ); //add casualty to some statistic
if( ProcessLoyalty() )HandleGlobalLoyaltyEvent( GLOBAL_LOYALTY_ENEMY_KILLED, gpAR->ubSectorX, gpAR->ubSectorY, 0 );
ProcessQueenCmdImplicationsOfDeath( gpEnemies[ i ].pSoldier );
const auto gridno = RandomGridNoUnloadedSector(worldRows, worldCols);
AddDeadSoldierToUnLoadedSector( gpAR->ubSectorX, gpAR->ubSectorY, 0, gpEnemies[ i ].pSoldier, gridno, ADD_DEAD_SOLDIER_TO_SWEETSPOT);
AddDeadSoldierToUnLoadedSector( gpAR->ubSectorX, gpAR->ubSectorY, 0, gpEnemies[ i ].pSoldier, RandomGridNo(), ADD_DEAD_SOLDIER_TO_SWEETSPOT );
}
}
}
@@ -6015,7 +6007,7 @@ void AutoResolveMilitiaDropAndPromote()
}
// Flugente: drop sector equipment
gpCivs[i].pSoldier->DropSectorEquipment( NOWHERE );
gpCivs[i].pSoldier->DropSectorEquipment( );
if ( gpCivs[i].pSoldier->stats.bLife < OKLIFE / 2 )
{
+4
View File
@@ -249,6 +249,10 @@ void AdvanceClock( UINT8 ubWarpCode )
guiDay = ( guiGameClock / NUM_SEC_IN_DAY );
guiHour = ( guiGameClock - ( guiDay * NUM_SEC_IN_DAY ) ) / NUM_SEC_IN_HOUR;
guiMin = ( guiGameClock - ( ( guiDay * NUM_SEC_IN_DAY ) + ( guiHour * NUM_SEC_IN_HOUR ) ) ) / NUM_SEC_IN_MIN;
uiHourLua = guiHour;
uiDayLua = guiDay;
uiMinLua = guiMin;
swprintf( WORLDTIMESTR, L"%s %d, %02d:%02d", gpGameClockString[ STR_GAMECLOCK_DAY_NAME ], guiDay, guiHour, guiMin );
+13 -9
View File
@@ -4,6 +4,7 @@
#include "environment.h"
#include "Ambient Control.h"
#include "Quests.h"
// #include "Sound Control.h"
#include "AimMembers.h"
#include "Strategic Event Handler.h"
#include "BobbyR.h"
@@ -210,7 +211,7 @@ BOOLEAN ExecuteStrategicEvent( STRATEGICEVENT *pEvent )
#ifdef JA2UB
//No JA25 UB
#else
AddEmail(MERC_INTRO, MERC_INTRO_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_SPECK_INTRO);
AddEmail(MERC_INTRO, MERC_INTRO_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin( ), -1, -1 ,TYPE_EMAIL_EMAIL_EDT );
#endif
}
break;
@@ -487,7 +488,7 @@ BOOLEAN ExecuteStrategicEvent( STRATEGICEVENT *pEvent )
// No PCM in UB
#else
case EVENT_PMC_EMAIL:
AddEmail(PMC_INTRO, PMC_INTRO_LENGTH, PMC, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_KERBERUS_OFFER);
AddEmail( PMC_INTRO, PMC_INTRO_LENGTH, PMC, GetWorldTotalMin( ), -1, -1, TYPE_EMAIL_EMAIL_EDT );
break;
#endif
@@ -503,14 +504,16 @@ BOOLEAN ExecuteStrategicEvent( STRATEGICEVENT *pEvent )
gMercProfiles[MARIA].bMercStatus != MERC_IS_DEAD && gMercProfiles[ANGEL].bMercStatus != MERC_IS_DEAD )
{
StartQuest( QUEST_KINGPIN_ANGEL_MARIA, gWorldSectorX, gWorldSectorY );
AddEmail(KINGPIN_BOUNTY_INITIAL, KINGPIN_BOUNTY_INITIAL_LENGTH, KING_PIN, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_KINGPIN_JOBOPPORTUNITY);
AddEmail( KINGPIN_BOUNTY_INITIAL, KINGPIN_BOUNTY_INITIAL_LENGTH, KING_PIN, GetWorldTotalMin( ), -1, -1, TYPE_EMAIL_EMAIL_EDT );
}
break;
case EVENT_KINGPIN_BOUNTY_END_KILLEDTHEM:
if ( gMercProfiles[KINGPIN].bMercStatus != MERC_IS_DEAD && !CheckFact( FACT_KINGPIN_DEAD, NO_PROFILE ) && !CheckFact( FACT_KINGPIN_IS_ENEMY, NO_PROFILE ) )
{
AddEmail(KINGPIN_BOUNTY_KINGPIN_REWARD, KINGPIN_BOUNTY_KINGPIN_REWARD_LENGTH, KING_PIN, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_KINGPIN_WELLDONE);
AddEmail( KINGPIN_BOUNTY_KINGPIN_REWARD, KINGPIN_BOUNTY_KINGPIN_REWARD_LENGTH, KING_PIN, GetWorldTotalMin( ), -1, -1, TYPE_EMAIL_EMAIL_EDT );
// also authorise payment from kingpin to the player
AddTransactionToPlayersBook( ANONYMOUS_DEPOSIT, 0, GetWorldTotalMin( ), 10000 );
}
@@ -526,13 +529,14 @@ BOOLEAN ExecuteStrategicEvent( STRATEGICEVENT *pEvent )
if ( gMercProfiles[MARIA].bMercStatus != MERC_IS_DEAD && gMercProfiles[ANGEL].bMercStatus != MERC_IS_DEAD
&& CheckFact( FACT_BOUNTYHUNTER_KILLED_1, NO_PROFILE ) && CheckFact( FACT_BOUNTYHUNTER_KILLED_2, NO_PROFILE ) )
{
AddEmail(KINGPIN_BOUNTY_ANGEL_THANKS, KINGPIN_BOUNTY_ANGEL_THANKS_LENGTH, ANGEL_DASILVA, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_DASILVA_THANKYOU);
AddEmail(KINGPIN_BOUNTY_TARGET_GOTAWAY, KINGPIN_BOUNTY_TARGET_GOTAWAY_LENGTH, KING_PIN, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_KINGPIN_FAILUREOBSTACLES);
AddEmail( KINGPIN_BOUNTY_ANGEL_THANKS, KINGPIN_BOUNTY_ANGEL_THANKS_LENGTH, ANGEL_DASILVA, GetWorldTotalMin( ), -1, -1, TYPE_EMAIL_EMAIL_EDT );
AddEmail( KINGPIN_BOUNTY_TARGET_GOTAWAY, KINGPIN_BOUNTY_TARGET_GOTAWAY_LENGTH, KING_PIN, GetWorldTotalMin( ), -1, -1, TYPE_EMAIL_EMAIL_EDT );
}
// we can assume that the bounty hunters for to them first - Kingpin sends an email and states that someone else finished the job
else if ( gMercProfiles[KINGPIN].bMercStatus != MERC_IS_DEAD && !CheckFact( FACT_KINGPIN_DEAD, NO_PROFILE ) && !CheckFact( FACT_KINGPIN_IS_ENEMY, NO_PROFILE ) )
{
AddEmail(KINGPIN_BOUNTY_BH_GOTTARGET, KINGPIN_BOUNTY_BH_GOTTARGET_LENGTH, KING_PIN, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_KINGPIN_FAILURE);
AddEmail( KINGPIN_BOUNTY_BH_GOTTARGET, KINGPIN_BOUNTY_BH_GOTTARGET_LENGTH, KING_PIN, GetWorldTotalMin( ), -1, -1, TYPE_EMAIL_EMAIL_EDT );
}
// in any case, this quest is now over
@@ -598,7 +602,7 @@ BOOLEAN ExecuteStrategicEvent( STRATEGICEVENT *pEvent )
#ifndef JA2UB
case EVENT_MILITIAROSTER_EMAIL:
AddEmail(MILITIAROSTER_INTRO, MILITIAROSTER_INTRO_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_ENRICO_MILITIA_WEBSITE);
AddEmail( MILITIAROSTER_INTRO, MILITIAROSTER_INTRO_LENGTH, MAIL_ENRICO, GetWorldTotalMin( ), -1, -1, TYPE_EMAIL_EMAIL_EDT );
break;
#endif
@@ -625,7 +629,7 @@ BOOLEAN ExecuteStrategicEvent( STRATEGICEVENT *pEvent )
#ifndef JA2UB
case EVENT_INTEL_ENRICO_EMAIL:
AddEmail(INTEL_ENRICO_INTRO, INTEL_ENRICO_INTRO_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_ENRICO_INTEL);
AddEmail( INTEL_ENRICO_INTRO, INTEL_ENRICO_INTRO_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT );
break;
#endif
+2 -2
View File
@@ -9,9 +9,9 @@
#include "Soldier Profile.h"
#include "strategicmap.h"
#include "Game Init.h"
#include "finances.h"
#include "finances.h"
#include "Soldier Create.h"
#include "strategic.h"
#include "strategic.h"
#include "history.h"
#include "merc entering.h"
#include "Squads.h"
+1 -4
View File
@@ -158,6 +158,7 @@ CHAR16 zString[128];
HourlyDrugUpdate();
RebelCommand::HourlyUpdate();
// WANNE: This check should avoid the resaving of a loaded auto-save game, when entering tactical
BOOLEAN doAutoSave = TRUE;
@@ -168,10 +169,6 @@ CHAR16 zString[128];
if (doAutoSave)
{
// We're also using the doAutoSave check to prevent RebelCommand::DailyUpdate() from running a second time when loading an autosave at 00:00
RebelCommand::HourlyUpdate();
if ( AutoSaveToSlot[1] == FALSE && AutoSaveToSlot[2] == FALSE && AutoSaveToSlot[3] == FALSE && AutoSaveToSlot[4] == FALSE )
AutoSaveToSlot[0] = TRUE;
+1 -1
View File
@@ -1,4 +1,3 @@
#ifdef JA2UB
#include "builddefines.h"
#include "strategicmap.h"
@@ -69,6 +68,7 @@
#include "Auto Resolve.h"
#include "Cursors.h"
#ifdef JA2UB
#include "Soldier Init List.h"
#include "Dialogue Control.h"
#include "Game Clock.h"
+40 -70
View File
@@ -112,6 +112,8 @@ static int l_CheckMission(lua_State* L);
void FatigueCharacter(SOLDIERTYPE* pSoldier);
static int l_AddCustomEmail(lua_State* L);
static int l_SetDefaultArrivalSector(lua_State* L);
static int l_GetDefaultArrivalSector(lua_State* L);
static int l_SetMercArrivalLocation(lua_State* L);
@@ -403,9 +405,9 @@ static int l_AddToShouldBecomeHostileOrSayQuoteList(lua_State* L);
static int l_AddPreReadEmail(lua_State* L);
static int l_AddEmail(lua_State* L);
static int l_AddEmailMercAvailableXML(lua_State* L);
static int l_AddEmailXML(lua_State* L);
static int l_AddEmailXML2(lua_State* L);
static int l_AddEmailLevelUpXML(lua_State* L);
static int l_AddEmailFromXML(lua_State* L);
static int l_EVENT_SoldierGotHit(lua_State* L);
static int l_EVENT_InitNewSoldierAnim(lua_State* L);
@@ -859,7 +861,6 @@ static int l_PlayerTeamFull(lua_State* L);
static int l_ProfilesStrategicInsertionData(lua_State* L);
static int l_HealBoxers(lua_State* L);
static int l_ResetBoxers(lua_State* L);
static int l_AddVolunteers(lua_State* L);
@@ -913,6 +914,9 @@ static int l_SetIntelAndQuestMapDataForSector(lua_State* L);
using namespace std;
UINT16 idProfil;
UINT32 uiHourLua;
UINT32 uiDayLua;
UINT32 uiMinLua;
UINT16 PROFILLUA_sSectorX;
UINT16 PROFILLUA_sSectorY;
@@ -1023,9 +1027,9 @@ static void IniFunction(lua_State* L, BOOLEAN bQuests)
lua_register(L, "AddPreReadEmail", l_AddPreReadEmail);
lua_register(L, "AddEmail", l_AddEmail);
lua_register(L, "AddEmailMercAvailableXML", l_AddEmailMercAvailableXML);
lua_register(L, "AddEmailMercAvailableXML", l_AddEmailXML);
lua_register(L, "AddEmailMercLevelUpXML", l_AddEmailLevelUpXML);
lua_register(L, "AddEmailFromXML", l_AddEmailFromXML);
lua_register(L, "AddEmailXML", l_AddEmailXML2);
//------Time------
@@ -1187,7 +1191,6 @@ static void IniFunction(lua_State* L, BOOLEAN bQuests)
lua_register(L, "TacticalCharacterDialogueWithSpecialEvent", l_TacticalCharacterDialogueWithSpecialEvent);
lua_register(L, "SetSalary", l_MercSalary);
lua_register(L, "SetProfileStrategicInsertionData", l_ProfilesStrategicInsertionData);
lua_register(L, "HealBoxers", l_HealBoxers);
//Get merc
lua_register(L, "GetDirection", l_GetDirection); //new
@@ -1639,6 +1642,8 @@ static void IniFunction(lua_State* L, BOOLEAN bQuests)
lua_register(L, "ReStartingGame", l_ReStartingGame);
lua_register(L, "AddCustomEmail", l_AddCustomEmail);
lua_register(L, "SetDefaultArrivalSector", l_SetDefaultArrivalSector);
lua_register(L, "GetDefaultArrivalSector", l_GetDefaultArrivalSector);
lua_register(L, "SetDefaultArrivalGridNo", l_SetMercArrivalLocation);
@@ -1997,6 +2002,20 @@ static int l_SetHandleGlobalLoyaltyEvent(lua_State* L)
return 0;
}
static int l_AddCustomEmail(lua_State* L)
{
if (lua_gettop(L) >= 3)
{
INT32 iMessageOffset = lua_tointeger(L, 1);
INT32 iMessageLength = lua_tointeger(L, 2);
UINT8 ubSender = lua_tointeger(L, 3);
AddCustomEmail(iMessageOffset, iMessageLength, ubSender, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_OTHER);
}
return 0;
}
static int l_gMercProfileGearset(lua_State* L)
{
if (lua_gettop(L) >= 8)
@@ -7429,9 +7448,23 @@ static int l_ExecuteStrategicAIAction(lua_State* L)
return 0;
}
//AddEmailXML
static int l_AddEmailXML2(lua_State* L)
{
if (lua_gettop(L) >= 3)
{
INT32 offset = lua_tointeger(L, 1);
INT32 messagelength = lua_tointeger(L, 2);
UINT8 sender = lua_tointeger(L, 3);
AddEmailTypeXML(offset, messagelength, sender, GetWorldTotalMin(), -1, TYPE_EMAIL_OTHER);
}
return 0;
}
//AddEmailXML
static int l_AddEmailMercAvailableXML(lua_State* L)
static int l_AddEmailXML(lua_State* L)
{
if (lua_gettop(L))
{
@@ -7498,48 +7531,6 @@ static int l_AddPreReadEmail(lua_State* L)
return 0;
}
// New externalized emails
//AddEmail
static int l_AddEmailFromXML(lua_State* L)
{
if (lua_gettop(L))
{
UINT8 index = lua_tointeger(L, 1);
bool preReadMail = false;
INT32 iCurrentIMPPosition = -1;
INT16 iCurrentShipmentDestinationID = -1;
INT32 specialData1 = -1;
UINT32 specialData2 = -1;
INT32 specialData3 = -1;
INT32 specialData4 = -1;
UINT32 specialData5 = -1;
UINT32 specialData6 = -1;
if ( lua_gettop(L) >= 2 )
{
preReadMail = lua_toboolean(L, 2);
}
if ( lua_gettop(L) >= 7 )
{
iCurrentIMPPosition = lua_tointeger(L, 3);
iCurrentShipmentDestinationID = lua_tointeger(L, 4);
specialData1 = lua_tointeger(L, 5);
specialData2 = lua_tointeger(L, 6);
specialData3 = lua_tointeger(L, 7);
}
if ( specialData1 != -1 || specialData2 != -1 )
{
AddEmailWithSpecialDataXML(index, GetWorldTotalMin(), iCurrentIMPPosition, iCurrentShipmentDestinationID, preReadMail, specialData1, specialData2, specialData3, specialData4, specialData5, specialData6);
}
else
{
AddEmailFromXML(index, GetWorldTotalMin(), iCurrentIMPPosition, iCurrentShipmentDestinationID, preReadMail, specialData1, specialData2, specialData3, specialData4, specialData5, specialData6);
}
}
return 0;
}
//gfBoxerFought
static int l_SetgfBoxerFought(lua_State* L)
{
@@ -9314,27 +9305,6 @@ static int l_ResetBoxers(lua_State* L)
return 0;
}
// heal boxers back to max health in case the player stays in sector while the boxers are resting
static int l_HealBoxers(lua_State* L)
{
for (UINT8 i = 0; i < NUM_BOXERS; ++i)
{
// Get breath back
gubBoxerID[i]->bBreath = gubBoxerID[i]->bBreathMax;
gubBoxerID[i]->sBreathRed = 0;
// Get life back
gubBoxerID[i]->stats.bLife = gubBoxerID[i]->stats.bLifeMax;
gubBoxerID[i]->bBleeding = 0;
// erase insta-healable injury
gubBoxerID[i]->iHealableInjury = 0;
DebugQuestInfo(String("Lua: healed gubBoxerID[%d] %d back to full health", i, gubBoxerID[i]));
}
return 0;
}
//Set character to sector Y
static int l_SetCharacterSectorY(lua_State* L)
{
+3
View File
@@ -26,6 +26,9 @@ typedef struct
extern ACTION_ITEM_VALUES ActionItemsValues[500];
extern UINT32 uiHourLua;
extern UINT32 uiDayLua;
extern UINT32 uiMinLua;
extern UINT16 PROFILLUA_sSectorX;
extern UINT16 PROFILLUA_sSectorY;
extern UINT8 PROFILLUA_bSectorZ;
+9 -10
View File
@@ -510,6 +510,15 @@ void IniGlobalGameSetting(lua_State *L)
lua_pushinteger(L, gubBoxingMatchesWon);
lua_setglobal(L, "gubBoxingMatchesWon");
lua_pushinteger(L, uiHourLua);
lua_setglobal(L, "cHour");
lua_pushinteger(L, uiDayLua);
lua_setglobal(L, "cDay");
lua_pushinteger(L, uiMinLua);
lua_setglobal(L, "cMin");
lua_pushinteger(L, gbPlayerNum);
lua_setglobal(L, "gbPlayerNum");
@@ -581,16 +590,6 @@ void IniGlobalGameSetting(lua_State *L)
lua_pushinteger(L, guiMin);
lua_setglobal(L, "guiMin");
lua_pushinteger(L, guiDay);
lua_setglobal(L, "cDay");
lua_pushinteger(L, guiHour);
lua_setglobal(L, "cHour");
lua_pushinteger(L, guiMin);
lua_setglobal(L, "cMin");
lua_pushinteger(L, guiCurrentScreen);
lua_setglobal(L, "guiCurrentScreen");
@@ -11,16 +11,21 @@
#include "mapscreen.h"
#include "Render Dirty.h"
#include "Map Screen Interface Map.h"
#include "Map Screen Interface Border.h"
#include "Map Screen Interface.h"
#include "Map Screen Interface Map Inventory.h"
#include "Map Screen Helicopter.h"
#include "Text.h"
#include "Campaign Types.h"
#include "Strategic Town Loyalty.h"
#include "strategicmap.h"
#include "Assignments.h"
// HEADROCK HAM 4: Now accepts INI settings
#include "GameSettings.h"
// Also include Quests, for checking whether a fact is true.
#include "Quests.h"
// HEADROCK HAM 5: Required for inventory filter popup
#include "popup_callback.h"
#include "popup_class.h"
#include "Queen Command.h" // added by Flugente
@@ -22,8 +22,10 @@
#include "Options Screen.h"
#include "Cursor Control.h"
#include "gameloop.h"
#include "ai.h"
#include "Tactical Save.h"
#include "Campaign Types.h"
#include "Air Raid.h"
#include "finances.h"
#include "LaptopSave.h"
#include "Interface Items.h"
@@ -1,6 +1,7 @@
#include "Map Screen Interface Map Inventory.h"
#include "Render Dirty.h"
#include "vobject.h"
#include "Utilities.h"
#include "WCheck.h"
#include "sysutil.h"
#include "Map Screen Interface Border.h"
@@ -27,6 +28,7 @@
#include "WordWrap.h"
#include "Soldier macros.h"
#include "rt time defines.h"
#include "Encyclopedia_new.h" //Moa: item visibility
#include "Town Militia.h" // added by Flugente
#include "ShopKeeper Interface.h"
@@ -34,7 +36,10 @@
#include <algorithm>
#include "InterfaceItemImages.h"
#include "SaveLoadGame.h"//dnl ch51 081009
#include "Map Information.h"//dnl ch51 091009
#include "Interface Items.h"
#include "Food.h" // added by Flugente
#include "Campaign Types.h" // added by Flugente
#include "mapscreen.h"
//forward declarations of common classes to eliminate includes
@@ -1133,12 +1138,8 @@ void SaveSeenAndUnseenItems( void )
if(pipl->fExists && pipl->object.ubNumberOfObjects)
{
uiTotalNumberOfVisibleItems += pipl->object.ubNumberOfObjects;
if (i > uiNumberOfSeenItems)
{
if(i > uiNumberOfSeenItems)
pInventoryPoolList[uiNumberOfSeenItems] = *pipl;
pipl->fExists = FALSE;
}
uiNumberOfSeenItems++;
}
}
+5
View File
@@ -19,6 +19,7 @@
#include "Squads.h"
#include "message.h"
#include "Soldier Profile.h"
#include "Player Command.h"
#include "Strategic Movement.h"
#include "Queen Command.h"
#include "Campaign Types.h"
@@ -27,6 +28,7 @@
#include "Vehicles.h"
#include "Map Screen Helicopter.h"
#include "Game Clock.h"
#include "finances.h"
#include "line.h"
#include "english.h"
#include "PreBattle Interface.h"
@@ -37,6 +39,7 @@
#include "Tactical Save.h"
#include "Map Information.h"
#include "Air Raid.h"
#include "Auto Resolve.h"
#include "ASD.h" // added by Flugente
#include "MilitiaIndividual.h" // added by Flugente
#include "Map Screen Interface Map Inventory.h" // added by Flugente
@@ -47,8 +50,10 @@
#include "Quests.h"
#include "connect.h"
#include "Strategic Mines.h"
// HEADROCK HAM 3.5: included for detectionlevels
#include "Facilities.h"
#include "MilitiaSquads.h"
#include "LaptopSave.h"
#include <language.hpp>
@@ -5,15 +5,19 @@
#include "Queen Command.h"
#include "Player Command.h"
#include "Font Control.h"
#include "Font.h"
#include "Text.h"
#include "Map Screen Interface Map.h"
#include "Map Screen Interface Border.h"
#include "Handle UI.h"
#include "NPC.h"
#include "Strategic Town Loyalty.h"
#include "Strategic Mines.h"
#include "finances.h"
#include "Map Screen Interface Map Inventory.h"
#include "strategic.h"
#include "Utilities.h"
#include <vsurface.h>
#include "video.h"
#include "Town Militia.h"
#include "HelpScreen.h"
#include "Map Screen Helicopter.h"
@@ -21,7 +25,10 @@
#include "GameSettings.h"
#include "DEBUG.H"
#include "Overhead.h" // added by Flugente
#include "Game Clock.h" // added by Flugente
#include "Game Event Hook.h" // added by Flugente
#include "Strategic Mines.h"
#define BOX_BUTTON_WIDTH 100
#define BOX_BUTTON_HEIGHT 20
+6 -2
View File
@@ -1,4 +1,5 @@
#include "Map Screen Interface.h"
#include "string.h"
#include "Map Screen Interface Map.h"
#include "Render Dirty.h"
#include "Font Control.h"
@@ -27,6 +28,7 @@
#include "Vehicles.h"
#include "line.h"
#include "Text.h"
#include "gameloop.h"
#include "Map Screen Helicopter.h"
#include "PreBattle Interface.h"
#include "WordWrap.h"
@@ -44,9 +46,11 @@
#include "Game Init.h"
#include "Strategic Mines.h"
#include "finances.h"
#include "strategic.h"
#include "Air Raid.h"
#include "Queen Command.h"
#include "Render Fun.h"
#include "Food.h"
#include "personnel.h"
#include "mapscreen.h"
@@ -194,7 +198,7 @@ INT32 iHeightOfInitFastHelpText = 0;
extern INT32 giMapContractButton;
extern INT32 giCharInfoButton[];
extern STR16* pUpdatePanelButtons;
extern STR16 pUpdatePanelButtons[];
// the list of soldiers that are moving
SOLDIERTYPE * pSoldierMovingList[ CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS ];
@@ -6162,7 +6166,7 @@ BOOLEAN HandleTimeCompressWithTeamJackedInAndGearedToGo( void )
//no ja25 UB
#else
// Add e-mail message
AddEmail(ENRICO_CONGRATS, ENRICO_CONGRATS_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_ENRICO_GOODLUCK);
AddEmail(ENRICO_CONGRATS,ENRICO_CONGRATS_LENGTH,MAIL_ENRICO, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT);
#endif
return( TRUE );
+2 -2
View File
@@ -1,5 +1,4 @@
#ifdef JA2UB
#include "Map Screen Interface.h"
#include "Map Screen Interface.h"
#include "string.h"
#include "Map Screen Interface Map.h"
#include "Font Control.h"
@@ -48,6 +47,7 @@
#include "connect.h"
#ifdef JA2UB
#include "Ja25 Strategic Ai.h"
#include "Ja25_Tactical.h"
+2
View File
@@ -13,6 +13,8 @@
#include "Soldier Profile.h"
#include "Overhead.h"
#include "Dialogue Control.h"
#include "gameloop.h"
#include "NPC.h"
#include "Assignments.h"
#include "strategic.h"
#include "Text.h"
+13 -22
View File
@@ -9,6 +9,8 @@
#include "Soldier Add.h"
#include "Dialogue Control.h"
#include "Soldier Create.h"
#include "message.h"
#include "Font Control.h"
#include "personnel.h"
#include "LaptopSave.h"
#include "Map Screen Interface.h"
@@ -16,7 +18,8 @@
#include "strategicmap.h"
#include "Quests.h"
#include "worlddef.h"
#include <Overhead.h>
#include "Animation Control.h"
#include "Tactical Save.h"
#include "Interface Control.h"
#include "gamescreen.h"
#include "jascreens.h"
@@ -24,8 +27,10 @@
#include "Assignments.h"
#include "Strategic Movement.h"
#include "Squads.h"
#include "gameloop.h"
#include "Text.h"
#include "Strategic Status.h"
#include "mercs.h"
#include "insurance Contract.h"
#include "Vehicles.h"
#include "email.h"
@@ -904,16 +909,7 @@ BOOLEAN BeginStrategicRemoveMerc( SOLDIERTYPE *pSoldier, BOOLEAN fAddRehireButto
else
{
if (!is_networked)
{
#ifdef JA2UB
// Leave equipment to merc's current sector by default in UB
HandleLeavingOfEquipmentInCurrentSector(pSoldier->ubID);
StrategicRemoveMerc(pSoldier);
pLeaveSoldier = NULL;
#else
NotifyPlayerOfMercDepartureAndPromptEquipmentPlacement( pSoldier, fAddRehireButton );
#endif
}
else
{
// WANNE - MP: Skip all the dialog boxes that appear. Just dismiss the merc
@@ -1111,12 +1107,10 @@ void CalculateMedicalDepositRefund( SOLDIERTYPE *pSoldier )
if( gubQuest[ QUEST_FIX_LAPTOP ] == QUESTDONE || gGameUBOptions.LaptopQuestEnabled == FALSE )
{
if ( gGameUBOptions.fDeadMerc == TRUE )
{
AddEmailWithSpecialData(27, AIM_MEDICAL_DEPOSIT_REFUND_LENGTH, AIM_SITE, GetWorldTotalMin(), pSoldier->usMedicalDeposit, pSoldier->ubProfile, TYPE_EMAIL_DEAD_MERC_AIM_SITE_EMAIL_JA2_EDT, TYPE_E_AIM_L2, XML_AIM_REFUND);
}
AddEmailWithSpecialData( 27, AIM_MEDICAL_DEPOSIT_REFUND_LENGTH, AIM_SITE, GetWorldTotalMin(), pSoldier->usMedicalDeposit, pSoldier->ubProfile, TYPE_EMAIL_DEAD_MERC_AIM_SITE_EMAIL_JA2_EDT, TYPE_E_AIM_L2 );
}
#else
AddEmailWithSpecialData(AIM_MEDICAL_DEPOSIT_REFUND, AIM_MEDICAL_DEPOSIT_REFUND_LENGTH, AIM_SITE, GetWorldTotalMin(), pSoldier->usMedicalDeposit, pSoldier->ubProfile, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE, XML_AIM_REFUND);
AddEmailWithSpecialData( AIM_MEDICAL_DEPOSIT_REFUND, AIM_MEDICAL_DEPOSIT_REFUND_LENGTH, AIM_SITE, GetWorldTotalMin(), pSoldier->usMedicalDeposit, pSoldier->ubProfile, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE );
#endif
}
//else if the merc is a dead, refund NOTHING!!
@@ -1127,15 +1121,14 @@ void CalculateMedicalDepositRefund( SOLDIERTYPE *pSoldier )
//add an email
#ifdef JA2UB
//no UB
if( gubQuest[ QUEST_FIX_LAPTOP ] == QUESTDONE || gGameUBOptions.LaptopQuestEnabled == FALSE )
{
if ( gGameUBOptions.fDeadMerc == TRUE )
{
AddEmailWithSpecialData(217, AIM_MEDICAL_DEPOSIT_NO_REFUND_LENGTH, AIM_SITE, GetWorldTotalMin(), pSoldier->usMedicalDeposit, pSoldier->ubProfile, TYPE_EMAIL_DEAD_MERC_AIM_SITE_EMAIL_JA2_EDT, TYPE_E_AIM_L3, XML_AIM_NOREFUND);
}
AddEmailWithSpecialData( 217, AIM_MEDICAL_DEPOSIT_NO_REFUND_LENGTH, AIM_SITE, GetWorldTotalMin(), pSoldier->usMedicalDeposit, pSoldier->ubProfile, TYPE_EMAIL_DEAD_MERC_AIM_SITE_EMAIL_JA2_EDT, TYPE_E_AIM_L3 );
}
#else
AddEmailWithSpecialData(AIM_MEDICAL_DEPOSIT_NO_REFUND, AIM_MEDICAL_DEPOSIT_NO_REFUND_LENGTH, AIM_SITE, GetWorldTotalMin(), pSoldier->usMedicalDeposit, pSoldier->ubProfile, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE, XML_AIM_NOREFUND);
AddEmailWithSpecialData( AIM_MEDICAL_DEPOSIT_NO_REFUND, AIM_MEDICAL_DEPOSIT_NO_REFUND_LENGTH, AIM_SITE, GetWorldTotalMin(), pSoldier->usMedicalDeposit, pSoldier->ubProfile, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE );
#endif
}
//else the player is injured, refund a partial amount
@@ -1153,12 +1146,10 @@ void CalculateMedicalDepositRefund( SOLDIERTYPE *pSoldier )
if( gubQuest[ QUEST_FIX_LAPTOP ] == QUESTDONE || gGameUBOptions.LaptopQuestEnabled == FALSE )
{
if ( gGameUBOptions.fDeadMerc == TRUE )
{
AddEmailWithSpecialData(214, AIM_MEDICAL_DEPOSIT_PARTIAL_REFUND_LENGTH, AIM_SITE, GetWorldTotalMin(), iRefundAmount, pSoldier->ubProfile, TYPE_EMAIL_DEAD_MERC_AIM_SITE_EMAIL_JA2_EDT, TYPE_E_AIM_L4, XML_AIM_PARTIALREFUND);
}
AddEmailWithSpecialData( 214, AIM_MEDICAL_DEPOSIT_PARTIAL_REFUND_LENGTH, AIM_SITE, GetWorldTotalMin(), iRefundAmount, pSoldier->ubProfile, TYPE_EMAIL_DEAD_MERC_AIM_SITE_EMAIL_JA2_EDT, TYPE_E_AIM_L4 );
}
#else
AddEmailWithSpecialData(AIM_MEDICAL_DEPOSIT_PARTIAL_REFUND, AIM_MEDICAL_DEPOSIT_PARTIAL_REFUND_LENGTH, AIM_SITE, GetWorldTotalMin(), iRefundAmount, pSoldier->ubProfile, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE, XML_AIM_PARTIALREFUND);
AddEmailWithSpecialData( AIM_MEDICAL_DEPOSIT_PARTIAL_REFUND, AIM_MEDICAL_DEPOSIT_PARTIAL_REFUND_LENGTH, AIM_SITE, GetWorldTotalMin(), iRefundAmount, pSoldier->ubProfile, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE );
#endif
}
}
+11 -1
View File
@@ -4,15 +4,25 @@
#include "strategic.h"
#include "strategicmap.h"
#include "Overhead.h"
#include "Strategic Town Loyalty.h"
#include "Utilities.h"
#include "random.h"
#include "Text.h"
#include <Font Control.h>
#include "Map Screen Interface.h"
#include "Interface.h"
#include "LaptopSave.h"
#include "Game Clock.h"
#include "Assignments.h"
#include "Squads.h"
#include "Soldier Create.h"
#include "Dialogue Control.h"
#include "GameSettings.h"
#include "Queen Command.h"
#include "math.h"
#include "Auto Resolve.h"
#include "Vehicles.h"
#include "Tactical Save.h"
#include "Campaign.h"
#include "message.h"
#include "mapscreen.h"
#include "Strategic Pathing.h"
+6 -1
View File
@@ -37,19 +37,24 @@ to call into.
#include "strategicmap.h"
#include "Strategic Movement.h"
#include "Strategic Town Loyalty.h"
#include "Text.h"
#include "Town Militia.h"
#include "Vehicles.h"
extern "C" {
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
}
#include <lua.h>
#include <lua_function.h>
#include <lua_state.h>
#include <lua_table.h>
extern CHAR16 gzUserDefinedButton1[ 128 ];
extern CHAR16 gzUserDefinedButton2[ 128 ];
extern CHAR16 (*pTownNames)[MAX_TOWN_NAME_LENGHT];
extern CHAR16 pTownNames[MAX_TOWNS][MAX_TOWN_NAME_LENGHT];
static size_t MAX_BUTTON_LENGTH = 60;
static size_t MAX_BODY_LENGTH = 450;
+4 -1
View File
@@ -8,6 +8,7 @@
#include "LaptopSave.h"
#include "Quests.h"
#include "Morale.h"
#include "Overhead.h"
#include "strategicmap.h"
#include "Map Screen Helicopter.h"
#include "Game Clock.h"
@@ -19,6 +20,8 @@
#include "PreBattle Interface.h"
#include "Map Screen Interface.h"
#include "Tactical Save.h"
#include "interface Dialogue.h"
#include "random.h"
// HEADROCK HAM 3.6: Added for facility string printing...
#include "PopUpBox.h"
#include "CampaignStats.h" // added by Flugente
@@ -249,7 +252,7 @@ BOOLEAN SetThisSectorAsPlayerControlled( INT16 sMapX, INT16 sMapY, INT8 bMapZ, B
#ifdef JA2UB
// no UB
#else
AddEmail(BOBBYR_NOW_OPEN, BOBBYR_NOW_OPEN_LENGTH, BOBBY_R, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_BR_VISITEDSITE);
AddEmail( BOBBYR_NOW_OPEN, BOBBYR_NOW_OPEN_LENGTH, BOBBY_R, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT);
#endif
LaptopSaveInfo.ubHaveBeenToBobbyRaysAtLeastOnceWhileUnderConstruction = BOBBYR_ALREADY_SENT_EMAIL;
}
+5 -1
View File
@@ -16,6 +16,7 @@
#include "Strategic Pathing.h"
#include "Text.h"
#include "PopUpBox.h"
#include "Player Command.h"
#include "Cursors.h"
#include "Auto Resolve.h"
#include "Sound Control.h"
@@ -23,6 +24,7 @@
#include "Map Screen Interface Bottom.h"
#include "Overhead.h"
#include "Tactical Placement GUI.h"
#include "Town Militia.h"
#include "Campaign.h"
#include "GameSettings.h"
#include "random.h"
@@ -39,13 +41,15 @@
#include "Soldier macros.h"
#include "history.h"
#include "Cheats.h"
// added by SANDRO
#include "Tactical Save.h"
#include "message.h"
#include "CampaignStats.h" // added by Flugente
#include "MilitiaSquads.h" // added by Flugente
#include "SkillCheck.h" // added by Flugente
#include "Strategic Transport Groups.h"
#include "Utilities.h"
#ifdef JA2UB
#include "ub_config.h"
#endif
+3 -1
View File
@@ -1,6 +1,7 @@
//Queen Command.c
#include "Queen Command.h"
#include "Strategic Event Handler.h"
#include "Overhead Types.h"
#include "strategicmap.h"
#include "Soldier Init List.h"
@@ -8,7 +9,7 @@
#include "random.h"
#include "Strategic Movement.h"
#include "Overhead.h"
#include <Vehicles.h>
#include "Strategic Pathing.h"
#include "strategic.h"
#include "message.h"
#include "Map Edgepoints.h"
@@ -32,6 +33,7 @@
#include "Animation Data.h"
#include "Game Clock.h"
#include "renderworld.h"
#include "Town Militia.h"
#include "Dialogue Control.h"
#include "Campaign Init.h"
#include "Meanwhile.h"
+2
View File
@@ -22,11 +22,13 @@
#include "Soldier Add.h"
#include "opplist.h"
#include "Handle Items.h"
#include "Game Clock.h"
#include "environment.h"
#include "Dialogue Control.h"
//#include "Soldier Control.h"
#include "Overhead.h"
#include "MessageBoxScreen.h"
#include "stdio.h"
#include "english.h"
#include "line.h"
#include "Keys.h"
+2 -2
View File
@@ -2,8 +2,8 @@
#define _QUEST_TEXT_H_
extern STR16 *QuestDescText;
extern STR16 *FactDescText;
STR16 QuestDescText[];
STR16 FactDescText[];
#endif
+3
View File
@@ -8,10 +8,12 @@
#include "Handle Items.h"
#include "Overhead.h"
#include "interface Dialogue.h"
#include "Soldier Profile.h"
#include "Isometric Utils.h"
#include "Render Fun.h"
#include "history.h"
#include "Map Screen Helicopter.h"
#include "Overhead.h"
#include "Strategic Mines.h"
#include "Boxing.h"
#include "Campaign Types.h"
@@ -20,6 +22,7 @@
#include "Campaign.h"
#include "GameSettings.h"
#include "Arms Dealer Init.h"
#include "GameSettings.h"
#include "random.h"
#include "Assignments.h"
#include "strategic.h"
+10 -1
View File
@@ -1,11 +1,20 @@
#include "Town Militia.h"
#include "Militia Control.h"
#include "Campaign Types.h"
#include "mapscreen.h"
#include "strategic.h"
#include "strategicmap.h"
#include "Overhead.h"
#include "Strategic Town Loyalty.h"
#include "Utilities.h"
#include "random.h"
#include "Text.h"
#include "Map Screen Interface.h"
#include "Interface.h"
#include "LaptopSave.h"
#include "Assignments.h"
#include "Squads.h"
#include "Soldier Create.h"
#include "Dialogue Control.h"
#include "Queen Command.h"
#include "GameSettings.h"
#include "Soldier Init List.h"
+2 -1
View File
@@ -1,3 +1,4 @@
#include <memory.h>
#include "FileMan.h"
#include "types.h"
#include "Scheduling.h"
@@ -31,7 +32,7 @@ class SOLDIERTYPE;
#ifdef JA2EDITOR
extern CHAR16 (*gszScheduleActions)[20]; // NUM_SCHEDULE_ACTIONS entries
extern CHAR16 gszScheduleActions[ NUM_SCHEDULE_ACTIONS ][20];
#endif
BOOLEAN GetEarliestMorningScheduleEvent( SCHEDULENODE *pSchedule, UINT32 * puiTime );
+7 -3
View File
@@ -13,6 +13,7 @@
#include "strategicmap.h"
#include "Game Clock.h"
#include "strategic.h"
#include "Explosion Control.h"
#include "Town Militia.h"
#include "Overhead.h"
#include "Squads.h"
@@ -25,12 +26,15 @@
#include "Campaign Init.h"
#include "Game Init.h"
#include "PreBattle Interface.h"
#include "Quests.h"
#include "Soldier Profile.h"
#include "Scheduling.h"
#include "Map Information.h"
#include "interface Dialogue.h"
#include "ASD.h" // added by Flugente
#include "Rebel Command.h"
#include "Game Event Hook.h"
#include "Strategic Town Loyalty.h"
#include "Strategic Transport Groups.h"
#include "GameInitOptionsScreen.h"
@@ -4881,14 +4885,14 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
}
// depending on which cities the player currently holds, we send out attack on multiple cities. We try to make these attacks occur simultaneously, so the player will have to fend off
// multiple gigantic attacks on different cities. Ideally, the attacks will be timed so well that the player cannot use a squad in both battles, even with use of the helicopter
// multiple gigantic attacks on different cities. Ideally, the attacks will be timed so well that the player cannot use a sqaud in both battles, even with use of the helicopter
// we first have to check which cities we have to attack. For that, we simply check wether there are troops in the target sector. If not, we will attack here
BOOLEAN fAttack_Grumm = !(SectorInfo[ SEC_H3 ].ubNumTroops > 0);
BOOLEAN fAttack_Cambria = !(SectorInfo[ SEC_H8 ].ubNumTroops > 0);
BOOLEAN fCambriaSAMOccupied = !(SectorInfo[ SEC_I8 ].ubNumTroops > 0);
BOOLEAN fAttack_Alma = !(SectorInfo[ SEC_I13 ].ubNumTroops > 0);
BOOLEAN fAttack_Alma = !(SectorInfo[ SEC_I13 ].ubNumTroops > 0);
BOOLEAN fAttack_Balime = !(SectorInfo[ SEC_L11 ].ubNumTroops > 0);
BOOLEAN fAttack_Chitzena = !(SectorInfo[ SEC_B2 ].ubNumTroops > 0);
BOOLEAN fAttack_Chitzena = !(SectorInfo[ SEC_L11 ].ubNumTroops > 0);
ubNumSoldiers = (UINT8)( gubMinEnemyGroupSize + difficultyMod * 3);
+12 -3
View File
@@ -1,7 +1,9 @@
#include "Strategic Event Handler.h"
#include <Windows.h>
#include "MemMan.h"
#include "message.h"
#include "Items.h"
#include "Handle Items.h"
#include "LaptopSave.h"
#include "Tactical Save.h"
#include "strategicmap.h"
#include "Quests.h"
@@ -12,6 +14,12 @@
#include "random.h"
#include "Overhead.h"
#include "Strategic Town Loyalty.h"
#include "Soldier Init List.h"
#include "SaveLoadMap.h"
#include "Soldier Create.h"
#include "Soldier Add.h"
#include "renderworld.h"
#include "Soldier Profile.h"
#include "email.h"
#include "strategic.h"
#include "GameSettings.h"
@@ -22,6 +30,7 @@
#include "Rebel Command.h"
#include "Luaglobal.h"
#include "connect.h"
#include "LuaInitNPCs.h"
//forward declarations of common classes to eliminate includes
@@ -689,7 +698,7 @@ void HandleNPCSystemEvent( UINT32 uiEvent )
#ifdef JA2UB
// no UB
#else
AddEmail(KING_PIN_LETTER, KING_PIN_LETTER_LENGTH, KING_PIN, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_KINGPIN_STOLEMONEY);
AddEmail( KING_PIN_LETTER, KING_PIN_LETTER_LENGTH, KING_PIN, GetWorldTotalMin(), -1, -1 , TYPE_EMAIL_EMAIL_EDT );
#endif
StartQuest( QUEST_KINGPIN_MONEY, gMercProfiles[ KINGPIN ].sSectorX, gMercProfiles[ KINGPIN ].sSectorY );
// add event to send terrorists two days from now
@@ -795,7 +804,7 @@ void HandleNPCSystemEvent( UINT32 uiEvent )
#ifdef JA2UB
// no UB
#else
AddEmail(ENRICO_MIGUEL, ENRICO_MIGUEL_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_ENRICO_GREATNEWS);
AddEmail( ENRICO_MIGUEL, ENRICO_MIGUEL_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1 , TYPE_EMAIL_EMAIL_EDT);
#endif
break;
+7
View File
@@ -16,6 +16,7 @@
#include "mercs.h"
#include "Mapscreen.h"
#include "Weapons.h"
#include "personnel.h"
#include "Strategic Movement.h"
#include "LaptopSave.h"
#include "message.h"
@@ -24,17 +25,23 @@
#include "strategic.h"
#include "strategicmap.h"
#include "Strategic Status.h"
#include "aim.h"
#include "email.h"
#include "Map Screen Interface.h"
#include "Campaign.h"
#include "Soldier Add.h"
#include "screenids.h"
#include "gameloop.h"
#include "jascreens.h"
#include "Soldier macros.h"
#include "finances.h"
#include "GameSettings.h"
#include "Quests.h"
// HEADROCK HAM B1: Additional Include for Dynamic Roaming Restrictions
#include "MilitiaSquads.h"
// HEADROCK HAM 3.6: Additional include for Facility Operating Deby
#include "Facilities.h"
// HEADROCK HAM 3.6: And another include, for militia upkeep costs.
#include "Town Militia.h"
#include "DynamicDialogue.h" // added by Flugente for HandleDynamicOpinionsDailyRefresh()
+1
View File
@@ -13,6 +13,7 @@
#include "Strategic Mines.h"
#include "Strategic Mines LUA.h"
#include "UndergroundInit.h"
#include <vfs/Core/vfs_debug.h> // for CBasicException
#include "connect.h"
+4
View File
@@ -1,15 +1,18 @@
#include <string.h>
#include "Strategic Mines.h"
#include "finances.h"
#include "Strategic Town Loyalty.h"
#include "strategic.h"
#include "Game Clock.h"
#include "strategicmap.h"
#include "random.h"
#include "Soldier Profile.h"
#include "Dialogue Control.h"
#include "Map Screen Interface.h"
#include "Quests.h"
#include "Creature Spreading.h"
#include "message.h"
#include "Text.h"
#include "Game Event Hook.h"
#include "GameSettings.h"
#include "Strategic AI.h"
@@ -19,6 +22,7 @@
#include "ASD.h" // added by Flugente
#include "Rebel Command.h"
#include "GameInitOptionsScreen.h"
#include "Strategic Mines LUA.h"
#include <vector>
+3
View File
@@ -1,5 +1,6 @@
#include "builddefines.h"
#include <stdlib.h>
#include <memory.h>
#include "Strategic Movement.h"
#include "MemMan.h"
#include "DEBUG.H"
@@ -33,6 +34,7 @@
#include "Tactical Save.h"
#include "Player Command.h"
#include "Strategic AI.h"
#include "Town Militia.h"
#include "Music Control.h"
#include "Campaign.h"
#include "Isometric Utils.h"
@@ -51,6 +53,7 @@
#include "Strategic Transport Groups.h"
#include "MilitiaSquads.h"
#include "Vehicles.h"
#ifdef JA2UB
#include "Ja25Update.h"
+7 -1
View File
@@ -1,18 +1,24 @@
#include <stdio.h>
#include <time.h>
#include "types.h"
#include "worlddef.h"
#include <DEBUG.H>
#include "sgp.h"
#include "strategic.h"
#include "mapscreen.h"
#include "Overhead.h"
#include "strategicmap.h"
#include "Strategic Pathing.h"
#include "Map Screen Interface Border.h"
#include "Game Clock.h"
#include "Strategic Movement.h"
#include "Campaign Types.h"
#include "Assignments.h"
#include "Squads.h"
#include "Vehicles.h"
#include "Map Screen Helicopter.h"
#include "input.h"
#include "english.h"
#include "Map Screen Interface.h"
#include "Game Event Hook.h"
#include "Strategic AI.h"
#include "Queen Command.h" // added by Flugente
+9 -9
View File
@@ -253,7 +253,7 @@ void HandleEnricoEmail(void)
// if creatures have attacked a mine (doesn't care if they're still there or not at the moment)
if (HasAnyMineBeenAttackedByMonsters() && !(gStrategicStatus.usEnricoEmailFlags & ENRICO_EMAIL_SENT_CREATURES))
{
AddEmail(ENRICO_CREATURES, ENRICO_CREATURES_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_ENRICO_CREPITUS);
AddEmail(ENRICO_CREATURES, ENRICO_CREATURES_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT);
gStrategicStatus.usEnricoEmailFlags |= ENRICO_EMAIL_SENT_CREATURES;
return; // avoid any other E-mail at the same time
}
@@ -261,21 +261,21 @@ void HandleEnricoEmail(void)
if ((ubCurrentProgress >= SOME_PROGRESS_THRESHOLD) && !(gStrategicStatus.usEnricoEmailFlags & ENRICO_EMAIL_SENT_SOME_PROGRESS))
{
AddEmail(ENRICO_PROG_20, ENRICO_PROG_20_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_ENRICO_PROGRESS);
AddEmail(ENRICO_PROG_20, ENRICO_PROG_20_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT);
gStrategicStatus.usEnricoEmailFlags |= ENRICO_EMAIL_SENT_SOME_PROGRESS;
return; // avoid any setback E-mail at the same time
}
if ((ubCurrentProgress >= ABOUT_HALFWAY_THRESHOLD) && !(gStrategicStatus.usEnricoEmailFlags & ENRICO_EMAIL_SENT_ABOUT_HALFWAY))
{
AddEmail(ENRICO_PROG_55, ENRICO_PROG_55_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_ENRICO_GOODWORK);
AddEmail(ENRICO_PROG_55, ENRICO_PROG_55_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT);
gStrategicStatus.usEnricoEmailFlags |= ENRICO_EMAIL_SENT_ABOUT_HALFWAY;
return; // avoid any setback E-mail at the same time
}
if ((ubCurrentProgress >= NEARLY_DONE_THRESHOLD) && !(gStrategicStatus.usEnricoEmailFlags & ENRICO_EMAIL_SENT_NEARLY_DONE))
{
AddEmail(ENRICO_PROG_80, ENRICO_PROG_80_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_ENRICO_FINALPUSH);
AddEmail(ENRICO_PROG_80, ENRICO_PROG_80_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT);
gStrategicStatus.usEnricoEmailFlags |= ENRICO_EMAIL_SENT_NEARLY_DONE;
return; // avoid any setback E-mail at the same time
}
@@ -285,7 +285,7 @@ void HandleEnricoEmail(void)
(((ubHighestProgress - ubCurrentProgress) >= MINOR_SETBACK_THRESHOLD) && (gStrategicStatus.usEnricoEmailFlags & ENRICO_EMAIL_FLAG_SETBACK_OVER))) &&
!(gStrategicStatus.usEnricoEmailFlags & ENRICO_EMAIL_SENT_MAJOR_SETBACK))
{
AddEmail(ENRICO_SETBACK, ENRICO_SETBACK_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_ENRICO_BADNEWS);
AddEmail(ENRICO_SETBACK, ENRICO_SETBACK_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT);
gStrategicStatus.usEnricoEmailFlags |= ENRICO_EMAIL_SENT_MAJOR_SETBACK;
}
else
@@ -293,7 +293,7 @@ void HandleEnricoEmail(void)
if (((ubHighestProgress - ubCurrentProgress) >= MINOR_SETBACK_THRESHOLD) &&
!(gStrategicStatus.usEnricoEmailFlags & (ENRICO_EMAIL_SENT_MINOR_SETBACK | ENRICO_EMAIL_SENT_MAJOR_SETBACK)))
{
AddEmail(ENRICO_SETBACK_2, ENRICO_SETBACK_2_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_ENRICO_SETBACK);
AddEmail(ENRICO_SETBACK_2, ENRICO_SETBACK_2_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT);
gStrategicStatus.usEnricoEmailFlags |= ENRICO_EMAIL_SENT_MINOR_SETBACK;
}
else
@@ -356,15 +356,15 @@ void HandleEnricoEmail(void)
switch( bComplaint )
{
case 3:
AddEmail(LACK_PLAYER_PROGRESS_3, LACK_PLAYER_PROGRESS_3_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_ENRICO_DISAPPOINTED);
AddEmail(LACK_PLAYER_PROGRESS_3, LACK_PLAYER_PROGRESS_3_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT);
gStrategicStatus.usEnricoEmailFlags |= ENRICO_EMAIL_SENT_LACK_PROGRESS3;
break;
case 2:
AddEmail(LACK_PLAYER_PROGRESS_2, LACK_PLAYER_PROGRESS_2_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_ENRICO_WORRIED);
AddEmail(LACK_PLAYER_PROGRESS_2, LACK_PLAYER_PROGRESS_2_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT);
gStrategicStatus.usEnricoEmailFlags |= ENRICO_EMAIL_SENT_LACK_PROGRESS2;
break;
default:
AddEmail(LACK_PLAYER_PROGRESS_1, LACK_PLAYER_PROGRESS_1_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_ENRICO_CONCERNED);
AddEmail(LACK_PLAYER_PROGRESS_1, LACK_PLAYER_PROGRESS_1_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT);
gStrategicStatus.usEnricoEmailFlags |= ENRICO_EMAIL_SENT_LACK_PROGRESS1;
break;
+7 -1
View File
@@ -8,6 +8,7 @@
#include "Queen Command.h"
#include "Animation Data.h"
#include "Quests.h"
#include "Font.h"
#include "message.h"
#include "LOS.h"
#include "World Items.h"
@@ -17,7 +18,9 @@
#include "random.h"
#include "Strategic Movement.h"
#include "Strategic Pathing.h"
#include "Vehicles.h"
#include "Game Clock.h"
#include "Game Event Hook.h"
#include "Morale.h"
#include "GameSettings.h"
#include "Text.h"
@@ -26,6 +29,9 @@
#include "history.h"
#include "Meanwhile.h"
#include "Strategic Status.h"
// HEADROCK HAM B1: Added include for Dynamic Roaming Militia
#include "MilitiaSquads.h"
// HEADROCK HAM 3.6: Include for Facility Debt
#include "Facilities.h"
#include "CampaignStats.h" // added by Flugente
#include "DynamicDialogue.h" // added by Flugente
@@ -180,7 +186,7 @@ INT16 sWorldSectorLocationOfFirstBattle = 0;
// preprocess sector for mercs in it
extern BOOLEAN fSectorsWithSoldiers[ MAP_WORLD_X * MAP_WORLD_X ][ 4 ];
extern CHAR16 (*pTownNames)[MAX_TOWN_NAME_LENGHT];
extern CHAR16 pTownNames[MAX_TOWNS][MAX_TOWN_NAME_LENGHT];
+12 -2
View File
@@ -1,12 +1,22 @@
#include "sgp.h"
#include "Game Clock.h"
#include "Font Control.h"
#include "Timer Control.h"
#include "Overhead.h"
#include <Overhead Types.h>
#include "Game Clock.h"
#include "message.h"
#include "worlddef.h"
#include "Soldier Create.h"
#include "Soldier Add.h"
#include "Strategic Turns.h"
#include "Isometric Utils.h"
#include "Animation Data.h"
#include "Animation Control.h"
#include "Tactical Turns.h"
#include "Strategic Turns.h"
#include "rt time defines.h"
#include "Assignments.h"
+4
View File
@@ -7,6 +7,7 @@
#include "strategicmap.h"
#include "Overhead.h"
#include "Strategic Town Loyalty.h"
#include "Utilities.h"
#include "random.h"
#include "Text.h"
#include "Map Screen Interface.h"
@@ -15,6 +16,8 @@
#include "finances.h"
#include "Game Clock.h"
#include "Assignments.h"
#include "Squads.h"
#include "Soldier Create.h"
#include "Dialogue Control.h"
#include "GameSettings.h"
#include "Queen Command.h"
@@ -36,6 +39,7 @@
#include "Soldier Control.h"
#include "soldier profile type.h"
#include "MilitiaSquads.h"
#define SIZE_OF_MILITIA_COMPLETED_TRAINING_LIST 50
// temporary local global variables
+2
View File
@@ -9,6 +9,8 @@
extern "C" {
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
}
#include "lua_state.h"
+1
View File
@@ -7,6 +7,7 @@
#include "FileMan.h"
#include "MemMan.h"
#include "Debug Control.h"
#include "mapscreen.h"
#define MAX_CHAR_DATA_LENGTH 500
+1 -1
View File
@@ -11,7 +11,7 @@
#include "sgp.h"
#include "Debug Control.h"
#include "expat.h"
#include <Item Types.h>
#include "GameSettings.h"
#include "XML.h"
#include "FileMan.h"
#include "Campaign Types.h"
+1
View File
@@ -16,6 +16,7 @@
#include "XML.h"
#include "FileMan.h"
#include "Campaign Types.h"
#include "Facilities.h"
FACILITYTYPE gFacilityTypes[ MAX_NUM_FACILITY_TYPES ];
UINT16 NUM_FACILITY_TYPES = 0;
+1
View File
@@ -2,6 +2,7 @@
#include "Debug Control.h"
#include "expat.h"
#include "XML.h"
#include "Interface.h"
#include "Map Screen Interface Map.h"
struct
+2 -1
View File
@@ -1,5 +1,6 @@
#include "sgp.h"
#include <FileMan.h>
#include "Map Screen Interface.h"
#include "Overhead.h"
#include "Debug Control.h"
#include "expat.h"
#include "XML.h"
+2
View File
@@ -13,9 +13,11 @@
#include "XML.h"
#include "expat.h"
#include "string.h"
#include "Campaign Types.h"
#include "FileMan.h"
#include "MemMan.h"
#include "Debug Control.h"
#include "mapscreen.h"
#define MAX_CHAR_DATA_LENGTH 500
+17 -24
View File
@@ -1,6 +1,7 @@
#include "mapscreen.h"
#include <stdio.h>
#include <stdarg.h>
#include <time.h>
#include "gameloop.h"
#include "sgp.h"
#include "vobject.h"
@@ -16,9 +17,12 @@
#include "Font Control.h"
#include "Timer Control.h"
#include "Interface.h"
#include "Handle UI.h"
#include "Interface Items.h"
#include "Interface Utils.h"
#include "lighting.h"
#include <wchar.h>
#include <tchar.h>
#include "Cursors.h"
#include "Soldier Profile.h"
#include "Interface Panels.h"
@@ -56,6 +60,7 @@
#include "Dialogue Control.h"
#include "Map Screen Interface TownMine Info.h"
#include "PreBattle Interface.h"
#include "personnel.h"
#include "Animated ProgressBar.h"
#include "Queen Command.h"
#include "LaptopSave.h"
@@ -69,9 +74,11 @@
#include "Strategic Mines.h"
#include "SaveLoadScreen.h"
#include "Options Screen.h"
#include "Auto Resolve.h"
#include "Meanwhile.h"
#include "Campaign.h"
#include "random.h"
#include "Air Raid.h"
#include "Quests.h"
#include "Town Militia.h"
#include "Weapons.h"
@@ -91,8 +98,13 @@
#include "Strategic Status.h"
#include "Soldier Create.h"
#include "Animation Control.h"
// HEADROCK HAM 3.6: Include facilities for assignment display
#include "Facilities.h"
// HEADROCK HAM 4: Include Militia Squads for Manual Militia Restrictions toggle.
#include "MilitiaSquads.h"
#include "Auto Bandage.h" // added by Flugente
#include "Food.h" // added by Flugente
#include "Drugs And Alcohol.h" // added by Flugente
#include "WordWrap.h"
#include "connect.h" //hayden
@@ -613,8 +625,8 @@ extern BOOLEAN gfAutoAIAware;
extern void HandlePreBattleInterfaceStates();
// the title for the contract button on the character info panel in the upper left portion of the mapscreen
extern STR16* pContractButtonString;
extern STR16* pBullseyeStrings;
extern STR16 pContractButtonString[];
extern STR16 pBullseyeStrings[];
extern OBJECTTYPE *gpItemDescObject;
@@ -8472,12 +8484,6 @@ void GetMapKeyboardInput( UINT32 *puiNewEvent )
if ( HandleNailsVestFetish( pSoldier, i, NOTHING ) )
continue;
// tais: never strip Madlab's robot of its installed components (ammo,
// targeting, chassis/armour, utility) - the player can't re-install them
// and the robot would be left defenceless. Only its cargo slot may be emptied.
if ( AM_A_ROBOT( pSoldier ) && i != ROBOT_INVENTORY_SLOT )
continue;
AutoPlaceObjectInInventoryStash(&pSoldier->inv[i], pSoldier->sGridNo, pSoldier->pathing.bLevel);
DeleteObj(&pSoldier->inv[i]);
}
@@ -11729,6 +11735,7 @@ void TeamListDestinationRegionBtnCallBack(MOUSE_REGION *pRegion, INT32 iReason )
// if he's in the helicopter
if( gCharactersList[ iValue + FIRSTmercTOdisplay ].usSolID->iVehicleId == iHelicopterVehicleId )
{
TurnOnAirSpaceMode( );
if( RequestGiveSkyriderNewDestination( ) == FALSE )
{
// not allowed to change destination of the helicopter
@@ -12748,10 +12755,6 @@ void HandleShadingOfLinesForContractMenu( void )
SOLDIERTYPE* pSoldier = gCharactersList[ bSelectedContractChar ].usSolID;
const bool multipleMercsSelected = (gSelectedSoldiers.size() > 0) ? true : false;
#ifdef JA2UB
// No contract renewal in UB
const bool atLeastOneAIMmerc = false;
#else
bool atLeastOneAIMmerc = false;
if (pSoldier->ubWhatKindOfMercAmI == MERC_TYPE__AIM_MERC)
{
@@ -12769,7 +12772,6 @@ void HandleShadingOfLinesForContractMenu( void )
}
}
}
#endif // JA2UB
// is guy in AIM? and well enough to talk and make such decisions?
if( (atLeastOneAIMmerc) && ( pSoldier->stats.bLife >= OKLIFE ) )
@@ -15377,10 +15379,7 @@ BOOLEAN CanExtendContractForCharSlot( INT16 bCharNumber )
// if a vehicle, in transit, or a POW
if( /*( pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE ) ||*/
#ifndef JA2UB
// Allow contract box in UB before helicopter ride, so mercs can be dismissed if player has hired more than 6 mercs
( pSoldier->bAssignment == IN_TRANSIT ) ||
#endif
( pSoldier->bAssignment == ASSIGNMENT_POW ) )
{
// can't extend contracts at this time
@@ -16026,14 +16025,8 @@ void MakeMapModesSuitableForDestPlotting( INT8 bCharNumber )
{
if ( gusMapDisplayColourMode == MAP_DISPLAY_AIRSPACE || gusMapDisplayColourMode == MAP_DISPLAY_AIRSPACE_COLOURED_SAMS )
{
// turn airspace OFF
gusMapDisplayColourMode = MAP_DISPLAY_NORMAL;
MapBorderButtonOff(MAP_BORDER_AIRSPACE_BTN);
// dirty regions
fMapPanelDirty = TRUE;
fTeamPanelDirty = TRUE;
fCharacterInfoPanelDirty = TRUE;
fMapScreenBottomDirty = TRUE;
// turn off airspace mode automatically
ToggleAirspaceMode();
}
}
+2
View File
@@ -1,7 +1,9 @@
#include "types.h"
#include "strategic town reputation.h"
#include "soldier profile type.h"
#include "Game Event Hook.h"
#include "Soldier Profile.h"
#include "Overhead.h"
#include "Game Clock.h"
#include "Strategic Town Loyalty.h"
#include "DEBUG.H"
+9 -1
View File
@@ -1,16 +1,24 @@
#include "strategic.h"
#include "types.h"
#include "Squads.h"
#include "jascreens.h"
#include "Assignments.h"
#include "Interface Control.h"
#include "Overhead.h"
#include "Soldier Profile.h"
#include "Dialogue Control.h"
#include "personnel.h"
#include "Tactical Save.h"
#include "Isometric Utils.h"
#include "Vehicles.h"
#include "Game Clock.h"
#include "CampaignStats.h" // added by Flugente
#include "MilitiaSquads.h" // added by Flugente
#include "Game Event Hook.h" // added by Flugente
#include "message.h" // added by Flugente
#include "Text.h" // added by Flugente
#include "Queen Command.h" // added by Flugente
#ifdef JA2UB
#else
// anv: for playable Speck
+18 -3
View File
@@ -4,7 +4,11 @@
#include "strategic.h"
#include "Strategic Mines.h"
#include "types.h"
#include "memory.h"
#include <stdio.h>
#include <stdarg.h>
#include <math.h>
#include <time.h>
#include "jascreens.h"
#include "worlddef.h"
#include "Soldier Control.h"
@@ -12,11 +16,13 @@
#include "Interface Panels.h"
#include "Isometric Utils.h"
#include "Ambient Control.h"
#include "worlddef.h"
#include "WorldDat.h"
#include "Text.h"
#include "Soldier Add.h"
#include "Soldier macros.h"
#include "Strategic Pathing.h"
#include "Soldier Create.h"
#include "Handle UI.h"
#include "faces.h"
#include "renderworld.h"
@@ -30,7 +36,7 @@
#include "message.h"
#include "Font Control.h"
#include "environment.h"
#include "Game Event Hook.h"
#include "Game Events.h"
#include "Quests.h"
#include "FileMan.h"
#include "Animated ProgressBar.h"
@@ -45,6 +51,7 @@
#include "Animation Control.h"
#include "Squads.h"
#include "worldman.h"
#include "Overhead.h"
#include "Strategic Town Loyalty.h"
#include "Queen Command.h"
#include "Cursor Control.h"
@@ -59,8 +66,11 @@
#include "Tactical Placement GUI.h"
#include "Map Screen Helicopter.h"
#include "Map Edgepoints.h"
#include "Player Command.h"
#include "Event Pump.h"
#include "Meanwhile.h"
#include "Air Raid.h"
#include "Strategic Mines.h"
#include "Creature Spreading.h"
#include "SaveLoadMap.h"
#include "Militia Control.h"
@@ -74,9 +84,12 @@
#include "Debug Control.h"
#include "expat.h"
#include "Loading Screen.h"
#include "Queen Command.h"
#include "Enemy Soldier Save.h"
#include "NPC.h"
#include "Strategic Event Handler.h"
#include "MessageBoxScreen.h"
#include "interface Dialogue.h"
#include "Map Screen Interface.h"
#include "history.h"
#include "Bullets.h"
@@ -92,7 +105,6 @@
#include "GameInitOptionsScreen.h"
#ifdef JA2UB
#include "interface Dialogue.h"
#include "SaveLoadGame.h"
#include "email.h"
#include "Ja25 Strategic Ai.h"
@@ -109,9 +121,12 @@
#include "connect.h" //hayden added alot ""'s to get around client spawing random/different placed AI
#include "SaveLoadGame.h"
#include "Strategic Mines.h"
#include "Strategic Mines LUA.h"
#include "UndergroundInit.h"
#include "LuaInitNPCs.h"
#include "Luaglobal.h"
#include "sgp_logger.h"
@@ -357,7 +372,7 @@ extern HVSURFACE ghFrameBuffer;
extern BOOLEAN gfOverrideSector;
extern BOOLEAN sBadSectorsList[WORLD_MAP_X][WORLD_MAP_X];
extern STR16* pBullseyeStrings;
extern STR16 pBullseyeStrings[];
extern void HandleRPCDescription( );
+1
View File
@@ -2,3 +2,4 @@
# 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)
+2
View File
@@ -20,9 +20,11 @@
#include "Explosion Control.h"
#include "Interface.h"
#include "Music Control.h"
#include "Campaign Types.h"
#include "GameSettings.h"
#include "Text.h"
#include "Morale.h"
#include "Map Screen Helicopter.h"
#include "Structure Wrap.h"
#include "Meanwhile.h"
+4
View File
@@ -1,5 +1,9 @@
#include <stdio.h>
#include <string.h>
#include "types.h"
#include "WCheck.h"
#include "stdlib.h"
#include "DEBUG.H"
#include "Animation Cache.h"
#include "Animation Data.h"
+3
View File
@@ -2,9 +2,12 @@
#include <stdio.h>
#include <string.h>
#include "WCheck.h"
#include "stdlib.h"
#include "DEBUG.H"
#include "Animation Data.h"
#include "Animation Control.h"
#include "jascreens.h"
#include "tiledef.h"
#include "Sys Globals.h"
#include "Debug Control.h"
+7 -3
View File
@@ -15,8 +15,12 @@
#include "LuaInitNPCs.h" // added by Flugente
#ifdef JA2UB
#include "Explosion Control.h"
#include "Ja25_Tactical.h"
#include "Ja25 Strategic Ai.h"
#include "MapScreen Quotes.h"
#include "email.h"
#include "interface Dialogue.h"
#include "ub_config.h"
#endif
@@ -1423,7 +1427,7 @@ void AddObjectToArmsDealerInventory( UINT8 ubArmsDealer, OBJECTTYPE *pObject )
for (attachmentList::iterator iter = seperateObject[0]->attachments.begin(); iter != seperateObject[0]->attachments.end();) {
// ARM: Note: this is only used for selling, not repairs, so attachmentes are seperated when sold to a dealer
// If the attachment is detachable
if (! (iter->exists() && Item[ iter->usItem ].inseparable))
if (! (Item[ iter->usItem ].inseparable ) && iter->exists())
{
// add this particular attachment (they can't be imprinted, or themselves have attachments!)
AddObjectToArmsDealerInventory( ubArmsDealer, &(*iter) );
@@ -1931,7 +1935,7 @@ UINT32 CalculateObjectItemRepairTime( UINT8 ubArmsDealer, OBJECTTYPE *pItemObjec
// add time to repair any attachments on it
for (attachmentList::iterator iter = (*pItemObject)[x]->attachments.begin(); iter != (*pItemObject)[x]->attachments.end(); ++iter) {
// if damaged and repairable
if ( iter->exists() && ( (*iter)[x]->data.objectStatus < 100 ) && CanDealerRepairItem( ubArmsDealer, iter->usItem ) )
if ( ( (*iter)[x]->data.objectStatus < 100 ) && CanDealerRepairItem( ubArmsDealer, iter->usItem ) && iter->exists())
{
//uiRepairTime += CalculateSimpleItemRepairTime( ubArmsDealer, iter->usItem, (*iter)[x]->data.objectStatus );
uiRepairTime += CalculateObjectItemRepairTime( ubArmsDealer, &(*iter) );
@@ -1988,7 +1992,7 @@ UINT32 CalculateObjectItemRepairCost( UINT8 ubArmsDealer, OBJECTTYPE *pItemObjec
// add cost of repairing any attachments on it
for (attachmentList::iterator iter = (*pItemObject)[x]->attachments.begin(); iter != (*pItemObject)[x]->attachments.end(); ++iter) {
// if damaged and repairable
if ( iter->exists() && ( (*iter)[x]->data.objectStatus < 100 ) && CanDealerRepairItem( ubArmsDealer, iter->usItem ) )
if ( ( (*iter)[x]->data.objectStatus < 100 ) && CanDealerRepairItem( ubArmsDealer, iter->usItem ) && iter->exists())
{
uiRepairCost += CalculateObjectItemRepairCost( ubArmsDealer, &(*iter));
}
+1
View File
@@ -1,5 +1,6 @@
#include "types.h"
#include "ArmsDealerInvInit.h"
//#include "Item Types.h"
#include "Arms Dealer Init.h"
#include "DEBUG.H"
#include "Weapons.h"
+2 -5
View File
@@ -453,14 +453,11 @@ BOOLEAN BoxerAvailable( void )
return( FALSE );
}
// NOTE THIS IS NOW BROKEN BECAUSE NPC.C ASSUMES THAT BOXERSAVAILABLE < 3 IS A
// SEQUEL FIGHT. Maybe we could check Kingpin's location instead!
UINT8 BoxersAvailable( void )
{
UINT8 ubCount = 0;
// Should also run CheckOnBoxers to make sure boxer IDs are set for this function similarly to BoxerAvailable
if (CheckOnBoxers() == FALSE)
{
return(ubCount);
}
for (UINT8 ubLoop = 0; ubLoop < NUM_BOXERS; ++ubLoop)
{
+11 -4
View File
@@ -1,5 +1,6 @@
#include "builddefines.h"
#include <stdio.h>
#include "stdlib.h"
#include "DEBUG.H"
#include "Overhead Types.h"
@@ -30,16 +31,22 @@
#include "Strategic AI.h"
#include "interface Dialogue.h"
#include "DynamicDialogue.h"
#include "email.h"
#include "mercs.h"
#ifdef JA2UB
#include "Explosion Control.h"
#include "Ja25_Tactical.h"
#include "Ja25 Strategic Ai.h"
#include "MapScreen Quotes.h"
#include "email.h"
#include "interface Dialogue.h"
#include "mercs.h"
#include "ub_config.h"
#endif
#include "GameInitOptionsScreen.h"
#include "email.h"
#include "mercs.h"
//forward declarations of common classes to eliminate includes
@@ -1352,13 +1359,13 @@ void HandleUnhiredMercDeaths( INT32 iProfileID )
{
if ( gMercProfiles[iProfileID].Type == PROFILETYPE_AIM && gGameUBOptions.fDeadMerc == TRUE ) //new profiles by Jazz
//send an email to the player telling the player that a merc died
AddEmailWithSpecialData(206, MERC_DIED_ON_OTHER_ASSIGNMENT_LENGTH, AIM_SITE, GetWorldTotalMin(), 0, iProfileID, TYPE_EMAIL_DEAD_MERC_AIM_SITE_EMAIL_JA2_EDT, TYPE_E_AIM_L1, XML_AIM_NOTICE_OF_DEATH);
AddEmailWithSpecialData(206, MERC_DIED_ON_OTHER_ASSIGNMENT_LENGTH, AIM_SITE, GetWorldTotalMin(), 0, iProfileID, TYPE_EMAIL_DEAD_MERC_AIM_SITE_EMAIL_JA2_EDT, TYPE_E_AIM_L1 );
}
#else
if ( gMercProfiles[iProfileID].Type == PROFILETYPE_AIM )
{
//send an email to the player telling the player that a merc died
AddEmailWithSpecialData(MERC_DIED_ON_OTHER_ASSIGNMENT, MERC_DIED_ON_OTHER_ASSIGNMENT_LENGTH, AIM_SITE, GetWorldTotalMin(), 0, iProfileID, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE, XML_AIM_NOTICE_OF_DEATH);
AddEmailWithSpecialData(MERC_DIED_ON_OTHER_ASSIGNMENT, MERC_DIED_ON_OTHER_ASSIGNMENT_LENGTH, AIM_SITE, GetWorldTotalMin(), 0, iProfileID, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE );
}
#endif
}
+2
View File
@@ -8,11 +8,13 @@
#include "FileMan.h"
#include "Encrypted File.h"
#include "MessageBoxScreen.h"
#include "Queen Command.h"
#include "Overhead.h"
#include "Render Dirty.h"
#include "MercTextBox.h"
#include "ai.h"
#include "Text.h"
#include "screenids.h"
#include "Animation Data.h"
#include "video.h"
#include "Font Control.h"
+3 -7
View File
@@ -34,6 +34,8 @@
#include "Map Screen Interface.h"
#include "Text.h"
#include "Merc Contract.h"
#include "Town Militia.h"
#include "Meanwhile.h"
#include "SkillCheck.h"
#include "Interface Control.h"
#include "Civ Quotes.h"
@@ -50,15 +52,9 @@
#include <queue>
#include "connect.h"
#ifndef JA2UB
#include "Town Militia.h"
#include "Meanwhile.h"
#endif // !JA2UB
#ifdef JA2UB
#include "Intro.h"
#include "MapScreen Quotes.h"
#include "Ja25 Strategic Ai.h"
#include "Ja25_Tactical.h"
#include "Animation Control.h"
+1 -2
View File
@@ -8,8 +8,7 @@
#include "Overhead.h"
#include "random.h"
#include "Assignments.h"
#include <mapscreen.h>
#include "soldier profile type.h"
#include "Soldier Profile.h"
#include "Queen Command.h"
#include "Quests.h"
#include "finances.h"
+557 -413
View File
File diff suppressed because it is too large Load Diff
+4 -1
View File
@@ -3,13 +3,16 @@
#include "Soldier Profile.h"
#include "Drugs And Alcohol.h"
#include "Items.h"
#include "Morale.h"
#include "Points.h"
#include "message.h"
#include "GameSettings.h" // SANDRO - had to add this, dammit!
#include "random.h"
#include "Text.h"
#include "Interface.h"
#include "Overhead.h"
#include "Food.h" // added by Flugente
#include "Animation Data.h" // added by Flugente for SoldierBodyTypes
#include "CampaignStats.h" // added by Flugente
#include "DynamicDialogue.h"// added by Flugente
//forward declarations of common classes to eliminate includes
+2 -5
View File
@@ -10,6 +10,8 @@
#include "SaveLoadGame.h"
#include "GameVersion.h"
#include "Text.h"
#include "MercTextBox.h"
#include "Meanwhile.h"
#include "soldier profile type.h"
#include "Soldier Profile.h"
#include "Interface.h"
@@ -28,11 +30,6 @@
#include "Campaign.h"
#include "Points.h"
#ifndef JA2UB
#include "Meanwhile.h"
#endif // !JA2UB
// event id counter
// has to be saved/loaded/reset
UINT32 gDynamicDialogueEventCounter = 0;
+20 -22
View File
@@ -2,6 +2,7 @@
#include "Overhead.h"
#include "worldman.h"
#include "Soldier Profile.h"
#include "NPC.h"
#include "Dialogue Control.h"
#include "End Game.h"
#include "Intro.h"
@@ -12,26 +13,23 @@
#include "Sound Control.h"
#include "renderworld.h"
#include "Isometric Utils.h"
#include "Music Control.h"
#include "Soldier macros.h"
#include "qarray.h"
#include "LOS.h"
#include "Strategic AI.h"
#include "Squads.h"
#include "PreBattle Interface.h"
#include "Strategic Movement.h"
#include "strategic.h"
#include "Morale.h"
#include "Queen Command.h"
#include "Strategic Town Loyalty.h"
#include "Player Command.h"
#include "Campaign Types.h"
#include "Tactical Save.h"
#include "screenids.h"
#ifndef JA2UB
#include "NPC.h"
#include "Music Control.h"
#include "qarray.h"
#include "LOS.h"
#include "Strategic AI.h"
#include "Squads.h"
#include "PreBattle Interface.h"
#include "strategic.h"
#include "Queen Command.h"
#include "Strategic Town Loyalty.h"
#include "Player Command.h"
#include "Tactical Save.h"
#endif // !JA2UB
#ifdef JA2UB
#include "email.h"
#include "Game Clock.h"
@@ -507,37 +505,37 @@ void HandleAddingTheEndGameEmails()
// email # 12a - Miguel dead, Manuel never recruited
if( !fMiguelAlive && !fManuelHired )
{
AddEmail(EMAIL_CONGRATS, EMAIL_CONGRATS_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_JA2UB_ENRICO_CONGRATS);
AddEmail( EMAIL_CONGRATS, EMAIL_CONGRATS_LENGTH, MAIL_ENRICO, GetWorldTotalMin(),-1 ,-1, TYPE_EMAIL_EMAIL_EDT);
}
// email # 12b - Miguel alive, Manuel never recruited
else if( fMiguelAlive && !fManuelHired )
{
AddEmail(EMAIL_CONGRATSICK, EMAIL_CONGRATSICK_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_JA2UB_ENRICO_CONGRATS_MIGUELSICK);
AddEmail( EMAIL_CONGRATSICK, EMAIL_CONGRATSICK_LENGTH, MAIL_ENRICO, GetWorldTotalMin(),-1 ,-1, TYPE_EMAIL_EMAIL_EDT);
}
// email # 12c - Miguel alive, Manuel dead
else if( fMiguelAlive && !fManuelAlive )
{
AddEmail(EMAIL_CONGRATMIGMANUELDEAD, EMAIL_CONGRATMIGMANUELDEAD_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_JA2UB_ENRICO_CONGRATS_MIGUELSICK_MANUELDEAD);
AddEmail( EMAIL_CONGRATMIGMANUELDEAD, EMAIL_CONGRATMIGMANUELDEAD_LENGTH, MAIL_ENRICO, GetWorldTotalMin() , -1, -1, TYPE_EMAIL_EMAIL_EDT);
}
// email # 12d - Miguel alive, Manuel recruited and alive
else if( fMiguelAlive && fManuelAlive && fManuelHired )
{
AddEmail(EMAIL_CONGRATMIGMANUELALIVE, EMAIL_CONGRATMIGMANUELALIVE_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_JA2UB_ENRICO_CONGRATS_MIGUELSICK_MANUELALIVE);
AddEmail( EMAIL_CONGRATMIGMANUELALIVE, EMAIL_CONGRATMIGMANUELALIVE_LENGTH, MAIL_ENRICO, GetWorldTotalMin() , -1, -1, TYPE_EMAIL_EMAIL_EDT);
}
// email # 12e - Miguel dead, Manuel dead
else if( !fMiguelAlive && !fManuelAlive )
{
AddEmail(EMAIL_CONGRATMANUELDEAD, EMAIL_CONGRATMANUELDEAD_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_JA2UB_ENRICO_CONGRATS_MANUELDEAD);
AddEmail( EMAIL_CONGRATMANUELDEAD, EMAIL_CONGRATMANUELDEAD_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1 , -1, TYPE_EMAIL_EMAIL_EDT);
}
// email # 12f - Miguel dead, Manuel recruited and alive
else if( !fMiguelAlive && fManuelAlive && fManuelHired )
{
AddEmail(EMAIL_CONGRATMANUELALIVE, EMAIL_CONGRATMANUELALIVE_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_JA2UB_ENRICO_CONGRATS_MANUELALIVE);
AddEmail( EMAIL_CONGRATMANUELALIVE, EMAIL_CONGRATMANUELALIVE_LENGTH, MAIL_ENRICO, GetWorldTotalMin() , -1, -1, TYPE_EMAIL_EMAIL_EDT);
}
else
+16 -1
View File
@@ -1,21 +1,36 @@
#include "builddefines.h"
#include "GameSettings.h"
#include <stdio.h>
#include <memory.h>
#include "types.h"
#include "strategicmap.h"
#include "Overhead.h"
#include "Isometric Utils.h"
#include "Soldier Add.h"
#include "Soldier Create.h"
#include "Soldier Init List.h"
#include "DEBUG.H"
#include "random.h"
#include "Items.h"
#include "Map Information.h"
#include "Soldier Profile.h"
#include "EditorMercs.h"
#include "Animation Data.h"
#include "message.h"
#include "Font Control.h"
#include "Campaign Types.h"
#include "Tactical Save.h"
#include "Game Clock.h"
#include "Queen Command.h"
#include "Scheduling.h"
#include "Soldier macros.h" // added by Flugente
#include "GameVersion.h"
#include "GameVersion.h"
//ADB When a savegame is loaded, the enemy and civ stuff needs to be loaded and updated, but this can only happen
//when the temp file is loaded which can happen much later, it cannot load convert and save when updating the savegame
//therefore store a flag to load and convert later
+2
View File
@@ -1,3 +1,5 @@
#include "types.h"
#include "DEBUG.H"
#include "EnemyItemDrops.h"
WEAPON_DROPS gEnemyWeaponDrops[MAX_DROP_ITEMS];
-2
View File
@@ -1,8 +1,6 @@
#ifndef _ENEMY_ITEM_DROPS__H_
#define _ENEMY_ITEM_DROPS__H_
#include "types.h"
#define MAX_DROP_ITEMS 100
typedef struct
+11 -5
View File
@@ -1,7 +1,10 @@
#include "builddefines.h"
#include "math.h"
#include <stdio.h>
#include <errno.h>
#include "worlddef.h"
#include "renderworld.h"
#include "vsurface.h"
#include "Render Dirty.h"
#include "sysutil.h"
@@ -9,6 +12,7 @@
#include "video.h"
#include "vobject_blitters.h"
#include "faces.h"
#include "Utilities.h"
#include "Overhead.h"
#include "GAP.H"
#include "Soldier Profile.h"
@@ -23,19 +27,21 @@
#include "GameSettings.h"
#include "Squads.h"
#include "Interface.h"
#include <strategicmap.h>
#include "Quests.h"
#include "Animation Control.h"
#include "Drugs And Alcohol.h"
#include "Interface Items.h"
#include "Meanwhile.h"
#include "Map Screen Interface.h"
// HEADROCK HAM 3.2: Added two includes so that a function can read values of the Gun Range/hospital location
#include "Campaign Types.h"
#include "Strategic Event Handler.h"
#include "Food.h" // added by Flugente
#include "Queen Command.h" // added by Flugente for FindUnderGroundSector(...)
#include "strategic.h" // added by Flugente
#ifdef JA2UB
#include "Ja25_Tactical.h"
#else
#include "Meanwhile.h"
#include "Map Screen Interface.h"
#endif
// Defines
+3
View File
@@ -1,3 +1,4 @@
#include <math.h>
#include "sgp.h"
#include "Soldier Profile.h"
#include "Food.h"
@@ -13,9 +14,11 @@
#include "Sound Control.h"
#include "Assignments.h"
#include "Overhead.h"
#include "Isometric Utils.h"
#include "Campaign Types.h"
#include "Drugs And Alcohol.h"
#include "environment.h"
#include "WorldDat.h"
#include "Facilities.h"
#include "Soldier macros.h"
#include "strategicmap.h"
+3 -1
View File
@@ -1,9 +1,11 @@
#include <string.h>
#include "builddefines.h"
#include "DEBUG.H"
#include "types.h"
//#include "mssw.h"
#include "GAP.H"
#include "Sound Control.h"
#include "soundman.h"
#include <stdio.h>
#include "FileMan.h"
SUBSEQUENTSOUNDS subsequentsounds;

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