mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Compare commits
266
Commits
v5
...
prevActiveMerc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
58c134bd8e | ||
|
|
f902b01497 | ||
|
|
0bbb01ae87 | ||
|
|
4cb1ebac88 | ||
|
|
264105071a | ||
|
|
9ce1492651 | ||
|
|
7499daf06a | ||
|
|
1e1eb88864 | ||
|
|
72e586a378 | ||
|
|
07dbf9c848 | ||
|
|
b19efcf1b4 | ||
|
|
332b267ae6 | ||
|
|
584f6b47e6 | ||
|
|
219cc6f88d | ||
|
|
8257f2c9df | ||
|
|
c6fd81d289 | ||
|
|
d98de9e793 | ||
|
|
049981b35f | ||
|
|
1088ffc5b2 | ||
|
|
3d29eff4d8 | ||
|
|
0dd32c4670 | ||
|
|
fee56e37e7 | ||
|
|
d79a445ad1 | ||
|
|
b1ccdf4e38 | ||
|
|
3af3b3fbbc | ||
|
|
86ec94b40a | ||
|
|
395c18c557 | ||
|
|
2eff78a2cf | ||
|
|
3d95c47356 | ||
|
|
0ebcf0fa06 | ||
|
|
d6166000c9 | ||
|
|
08b8d2f04f | ||
|
|
ba2e69d045 | ||
|
|
c9cf34d608 | ||
|
|
be109b71fa | ||
|
|
690d9e1336 | ||
|
|
3c87ae2724 | ||
|
|
f6ae1a96cd | ||
|
|
6c96b80afc | ||
|
|
00b5758af1 | ||
|
|
72ab9b0135 | ||
|
|
92813f5ce1 | ||
|
|
da83c6a557 | ||
|
|
a9dd9d0ca6 | ||
|
|
710941edd3 | ||
|
|
0b0fffa21d | ||
|
|
e1acf181df | ||
|
|
0f8c14e72e | ||
|
|
ecea18f57c | ||
|
|
e63e936715 | ||
|
|
a15ed3aceb | ||
|
|
0cb13650ed | ||
|
|
601ef4dc30 | ||
|
|
8fa2189a66 | ||
|
|
cf6cc2a213 | ||
|
|
fb34eb6776 | ||
|
|
35984f57d0 | ||
|
|
6c42f222e1 | ||
|
|
e8aedb29d5 | ||
|
|
ffe987061e | ||
|
|
1f6e545a39 | ||
|
|
2b9efd3702 | ||
|
|
f5a7c32bff | ||
|
|
e14a337e03 | ||
|
|
d21b487884 | ||
|
|
a161dcc509 | ||
|
|
f3b99edbff | ||
|
|
f47908e033 | ||
|
|
f52ab32952 | ||
|
|
82aca548f5 | ||
|
|
f3194718e4 | ||
|
|
fd9611ae04 | ||
|
|
c62d767622 | ||
|
|
b7bfd8a2eb | ||
|
|
c78f8faefc | ||
|
|
63f614f957 | ||
|
|
d078a3439f | ||
|
|
9b83d6a3bc | ||
|
|
56dc0088b6 | ||
|
|
9d1e9e8948 | ||
|
|
b3b3270e1e | ||
|
|
1a8db5d15b | ||
|
|
36a84ffe59 | ||
|
|
865288e622 | ||
|
|
da3c3bace8 | ||
|
|
ec4dc8b058 | ||
|
|
07320ba996 | ||
|
|
20a33893d9 | ||
|
|
ffccdfa654 | ||
|
|
abe6877d90 | ||
|
|
d0dbb9afb1 | ||
|
|
1013531a7f | ||
|
|
bfb724eab9 | ||
|
|
e59d915e58 | ||
|
|
4e8c5fa9ab | ||
|
|
de56f653ec | ||
|
|
79b57c326e | ||
|
|
c2b1ac0109 | ||
|
|
2eb16c583c | ||
|
|
5bbbec18bb | ||
|
|
66f5156f03 | ||
|
|
4645a09722 | ||
|
|
d244ef4c91 | ||
|
|
24656f2810 | ||
|
|
d960403514 | ||
|
|
0d97e36c34 | ||
|
|
1ac5d153fb | ||
|
|
d687956cf1 | ||
|
|
94f2e830e0 | ||
|
|
67c8081104 | ||
|
|
0dc2ceabb2 | ||
|
|
1ec2867ced | ||
|
|
a9120ef984 | ||
|
|
a50a6de1b5 | ||
|
|
845d784bff | ||
|
|
99703fa8b6 | ||
|
|
58bfffff55 | ||
|
|
7fffcd295c | ||
|
|
65a8b4fd77 | ||
|
|
9d0ec49e88 | ||
|
|
29354135dc | ||
|
|
63fe0be512 | ||
|
|
3f4c94642e | ||
|
|
8856813768 | ||
|
|
dbc4135974 | ||
|
|
d826491c83 | ||
|
|
bb1c63d4e8 | ||
|
|
8e4307b2fb | ||
|
|
e4fe066da0 | ||
|
|
cabb50a361 | ||
|
|
cebd20f5d0 | ||
|
|
aee7c23aa4 | ||
|
|
c7e654a1d9 | ||
|
|
235ddfa782 | ||
|
|
a670aff29c | ||
|
|
2a52347198 | ||
|
|
648a50f1e8 | ||
|
|
698176e841 | ||
|
|
8b90c84738 | ||
|
|
be5c4b1601 | ||
|
|
534ce662f3 | ||
|
|
ff638a5473 | ||
|
|
5b4be9bcdb | ||
|
|
3f448a62fb | ||
|
|
18673f3a29 | ||
|
|
47824c97a1 | ||
|
|
65c4cdd1d7 | ||
|
|
191af4da49 | ||
|
|
94a5972a85 | ||
|
|
1e16de30d7 | ||
|
|
b718b463c2 | ||
|
|
327046925b | ||
|
|
df01708ac3 | ||
|
|
2387667a23 | ||
|
|
883ceb2f6f | ||
|
|
924ccd8815 | ||
|
|
9bbec030d8 | ||
|
|
bc01bdb56d | ||
|
|
cd83fac928 | ||
|
|
e9e8080077 | ||
|
|
9fb29cf444 | ||
|
|
ca1112313a | ||
|
|
dd2c6f44b2 | ||
|
|
38b710343a | ||
|
|
3ddc4c2bbd | ||
|
|
d2388c76b8 | ||
|
|
07420ce245 | ||
|
|
e62684f0e1 | ||
|
|
c75f57785e | ||
|
|
66bd1e41c2 | ||
|
|
fa56a7ad6d | ||
|
|
f49013307f | ||
|
|
657097aa54 | ||
|
|
b74ccf3ddc | ||
|
|
d149b6ffea | ||
|
|
ef9aa1b027 | ||
|
|
b6e8b0c5ff | ||
|
|
b9641d4c90 | ||
|
|
f50bdf99cc | ||
|
|
9532fbfe2c | ||
|
|
74d752d452 | ||
|
|
06936b71c9 | ||
|
|
e9a13e12d8 | ||
|
|
9acf994952 | ||
|
|
9d62b9a37a | ||
|
|
2e92da4e12 | ||
|
|
f39078357b | ||
|
|
2e147d4bd7 | ||
|
|
274be524e6 | ||
|
|
34f0b40f93 | ||
|
|
f58cf588a6 | ||
|
|
30e6b9008c | ||
|
|
ab94d33bec | ||
|
|
3fe6e4f3d8 | ||
|
|
3e1c87f53c | ||
|
|
cbf53f8848 | ||
|
|
f0be44bb42 | ||
|
|
61c5a41bea | ||
|
|
c475f9e4e6 | ||
|
|
2918801f75 | ||
|
|
42d5ecb923 | ||
|
|
cd720a639a | ||
|
|
d28d46d974 | ||
|
|
edb26a68fe | ||
|
|
e7fe1d1cda | ||
|
|
3ff4cc0c19 | ||
|
|
98c18495c6 | ||
|
|
41fc407de6 | ||
|
|
23af6b6f3f | ||
|
|
b112d39fe2 | ||
|
|
419b0c794d | ||
|
|
8ef7fb5ae4 | ||
|
|
153d402065 | ||
|
|
75deccbc44 | ||
|
|
566ead5815 | ||
|
|
f823cb9718 | ||
|
|
5de6f77f2e | ||
|
|
1a172427ef | ||
|
|
8346d5bfa1 | ||
|
|
131172e41a | ||
|
|
ee429fd1f4 | ||
|
|
9079f2e0c1 | ||
|
|
ecb29ae9bc | ||
|
|
83b3485e58 | ||
|
|
b98732daa7 | ||
|
|
e9c8124dc2 | ||
|
|
cba88ab2bc | ||
|
|
337cf1804f | ||
|
|
1c631cb85f | ||
|
|
b9deb3cc19 | ||
|
|
d07dcf477a | ||
|
|
0def972901 | ||
|
|
735075869c | ||
|
|
6a0d02e9b9 | ||
|
|
568aa0a0b8 | ||
|
|
1327d186ed | ||
|
|
c04cc4cfcc | ||
|
|
1345d92521 | ||
|
|
0103a871cc | ||
|
|
f5b1447646 | ||
|
|
4d740055da | ||
|
|
aad6ed8297 | ||
|
|
d6370b7463 | ||
|
|
3c2592881f | ||
|
|
6c33009fab | ||
|
|
fcf2b27d1a | ||
|
|
040410b450 | ||
|
|
0089e0a640 | ||
|
|
d9edc9362b | ||
|
|
508310be3e | ||
|
|
5cf0ef4bde | ||
|
|
fdd6859726 | ||
|
|
2b024d63c6 | ||
|
|
a81820d0d7 | ||
|
|
f99065d0c6 | ||
|
|
bc870123bf | ||
|
|
17875978e0 | ||
|
|
4e253d0ec0 | ||
|
|
10250dc035 | ||
|
|
06918d7585 | ||
|
|
57cc888cd7 | ||
|
|
9ac53cac32 | ||
|
|
9fb4ef8607 | ||
|
|
03482ffc3d | ||
|
|
5c13170424 | ||
|
|
1f0a8f46e8 |
@@ -54,16 +54,6 @@ jobs:
|
|||||||
sed -i "s|@Build@|${GAME_BUILD:0:255}|" Ja2/GameVersion.cpp
|
sed -i "s|@Build@|${GAME_BUILD:0:255}|" Ja2/GameVersion.cpp
|
||||||
cat Ja2/GameVersion.cpp
|
cat Ja2/GameVersion.cpp
|
||||||
|
|
||||||
- name: Turn on link-time optimization?
|
|
||||||
if: fromJSON(inputs.assemble)
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
set -eux
|
|
||||||
|
|
||||||
echo "
|
|
||||||
LTO=ON
|
|
||||||
" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Prepare build properties
|
- name: Prepare build properties
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
@@ -87,7 +77,7 @@ jobs:
|
|||||||
arch: x86
|
arch: x86
|
||||||
- name: Prepare build
|
- name: Prepare build
|
||||||
run: |
|
run: |
|
||||||
cmake -S . -B build -GNinja -DCMAKE_BUILD_TYPE=Release -DLanguages="$Env:JA2Language" -DApplications="$Env:JA2Application" -DLTO_OPTION="$Env:LTO"
|
cmake -S . -B build -GNinja -DCMAKE_BUILD_TYPE=Release -DLanguages="$Env:JA2Language" -DApplications="$Env:JA2Application"
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
cmake --build build/ -- -v
|
cmake --build build/ -- -v
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ void AddNewItemToSelectedMercsInventory( BOOLEAN fCreate );
|
|||||||
void RenderMercInventoryPanel();
|
void RenderMercInventoryPanel();
|
||||||
void SetDroppableCheckboxesBasedOnMercsInventory();
|
void SetDroppableCheckboxesBasedOnMercsInventory();
|
||||||
|
|
||||||
extern BOOLEAN InternalAddSoldierToSector( UINT8 ubID, BOOLEAN fCalculateDirection, BOOLEAN fUseAnimation, UINT16 usAnimState, UINT16 usAnimCode );
|
extern BOOLEAN InternalAddSoldierToSector( SoldierID ubID, BOOLEAN fCalculateDirection, BOOLEAN fUseAnimation, UINT16 usAnimState, UINT16 usAnimCode );
|
||||||
|
|
||||||
//array which keeps track of which item is in which slot. This is dependant on the selected merc, so
|
//array which keeps track of which item is in which slot. This is dependant on the selected merc, so
|
||||||
//these temp values must be updated when different mercs are selected, and reset when a merc detailed
|
//these temp values must be updated when different mercs are selected, and reset when a merc detailed
|
||||||
@@ -559,7 +559,7 @@ void AddMercToWorld( INT32 iMapIndex )
|
|||||||
|
|
||||||
if( IsLocationSittable( iMapIndex, gfRoofPlacement ) )
|
if( IsLocationSittable( iMapIndex, gfRoofPlacement ) )
|
||||||
{
|
{
|
||||||
UINT8 ubID;
|
SoldierID ubID;
|
||||||
INT16 sSectorX, sSectorY;
|
INT16 sSectorX, sSectorY;
|
||||||
SOLDIERINITNODE *pNode;
|
SOLDIERINITNODE *pNode;
|
||||||
|
|
||||||
@@ -629,7 +629,7 @@ void HandleRightClickOnMerc( INT32 iMapIndex )
|
|||||||
if ( gsSelectedMercID != sThisMercID )
|
if ( gsSelectedMercID != sThisMercID )
|
||||||
{ // We want to edit a new merc (or different merc)
|
{ // We want to edit a new merc (or different merc)
|
||||||
//We need to avoid the editing of player mercs.
|
//We need to avoid the editing of player mercs.
|
||||||
pNode = FindSoldierInitNodeWithID( (UINT8)sThisMercID );
|
pNode = FindSoldierInitNodeWithID( sThisMercID );
|
||||||
if( !pNode )
|
if( !pNode )
|
||||||
return; //this is a player merc (which isn't in the list), or an error in logic.
|
return; //this is a player merc (which isn't in the list), or an error in logic.
|
||||||
IndicateSelectedMerc( sThisMercID );
|
IndicateSelectedMerc( sThisMercID );
|
||||||
@@ -1634,7 +1634,7 @@ void IndicateSelectedMerc( INT16 sID )
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
//search for the merc with the specific ID.
|
//search for the merc with the specific ID.
|
||||||
gpSelected = FindSoldierInitNodeWithID( (UINT8)sID );
|
gpSelected = FindSoldierInitNodeWithID( sID );
|
||||||
if( !gpSelected )
|
if( !gpSelected )
|
||||||
{
|
{
|
||||||
gsSelectedMercID = -1;
|
gsSelectedMercID = -1;
|
||||||
@@ -3783,7 +3783,7 @@ void PasteMercPlacement( INT32 iMapIndex )
|
|||||||
|
|
||||||
if( IsLocationSittable( iMapIndex, gfRoofPlacement ) )
|
if( IsLocationSittable( iMapIndex, gfRoofPlacement ) )
|
||||||
{
|
{
|
||||||
UINT8 ubID;
|
SoldierID ubID;
|
||||||
INT16 sSectorX, sSectorY;
|
INT16 sSectorX, sSectorY;
|
||||||
SOLDIERINITNODE *pNode;
|
SOLDIERINITNODE *pNode;
|
||||||
|
|
||||||
|
|||||||
+24
-27
@@ -279,23 +279,23 @@ BOOLEAN LoadGameSettings()
|
|||||||
gGameSettings.fOptions[TOPTION_BLOOD_N_GORE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_BLOOD_N_GORE" , TRUE );
|
gGameSettings.fOptions[TOPTION_BLOOD_N_GORE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_BLOOD_N_GORE" , TRUE );
|
||||||
gGameSettings.fOptions[TOPTION_DONT_MOVE_MOUSE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_DONT_MOVE_MOUSE" , FALSE );
|
gGameSettings.fOptions[TOPTION_DONT_MOVE_MOUSE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_DONT_MOVE_MOUSE" , FALSE );
|
||||||
gGameSettings.fOptions[TOPTION_OLD_SELECTION_METHOD] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_OLD_SELECTION_METHOD" , FALSE );
|
gGameSettings.fOptions[TOPTION_OLD_SELECTION_METHOD] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_OLD_SELECTION_METHOD" , FALSE );
|
||||||
gGameSettings.fOptions[TOPTION_ALWAYS_SHOW_MOVEMENT_PATH] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_ALWAYS_SHOW_MOVEMENT_PATH" , FALSE );
|
gGameSettings.fOptions[TOPTION_ALWAYS_SHOW_MOVEMENT_PATH] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_ALWAYS_SHOW_MOVEMENT_PATH" , TRUE );
|
||||||
gGameSettings.fOptions[TOPTION_SHOW_MISSES] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SHOW_MISSES" , FALSE );
|
gGameSettings.fOptions[TOPTION_SHOW_MISSES] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SHOW_MISSES" , FALSE );
|
||||||
gGameSettings.fOptions[TOPTION_RTCONFIRM] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_RTCONFIRM" , FALSE );
|
gGameSettings.fOptions[TOPTION_RTCONFIRM] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_RTCONFIRM" , FALSE );
|
||||||
gGameSettings.fOptions[TOPTION_SLEEPWAKE_NOTIFICATION] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SLEEPWAKE_NOTIFICATION" , TRUE );
|
gGameSettings.fOptions[TOPTION_SLEEPWAKE_NOTIFICATION] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SLEEPWAKE_NOTIFICATION" , FALSE );
|
||||||
gGameSettings.fOptions[TOPTION_USE_METRIC_SYSTEM] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_USE_METRIC_SYSTEM" , TRUE );
|
gGameSettings.fOptions[TOPTION_USE_METRIC_SYSTEM] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_USE_METRIC_SYSTEM" , TRUE );
|
||||||
gGameSettings.fOptions[TOPTION_MERC_CASTS_LIGHT] = iniReader.ReadBoolean("JA2 Game Settings", "TOPTION_MERC_CASTS_LIGHT" , FALSE);
|
gGameSettings.fOptions[TOPTION_MERC_CASTS_LIGHT] = iniReader.ReadBoolean("JA2 Game Settings", "TOPTION_MERC_CASTS_LIGHT" , FALSE);
|
||||||
gGameSettings.fOptions[TOPTION_SMART_CURSOR] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SMART_CURSOR" , FALSE );
|
gGameSettings.fOptions[TOPTION_SMART_CURSOR] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SMART_CURSOR" , FALSE );
|
||||||
gGameSettings.fOptions[TOPTION_SNAP_CURSOR_TO_DOOR] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SNAP_CURSOR_TO_DOOR" , TRUE );
|
gGameSettings.fOptions[TOPTION_SNAP_CURSOR_TO_DOOR] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SNAP_CURSOR_TO_DOOR" , TRUE );
|
||||||
gGameSettings.fOptions[TOPTION_GLOW_ITEMS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_GLOW_ITEMS" , TRUE );
|
gGameSettings.fOptions[TOPTION_GLOW_ITEMS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_GLOW_ITEMS" , TRUE );
|
||||||
gGameSettings.fOptions[TOPTION_TOGGLE_TREE_TOPS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_TOGGLE_TREE_TOPS" , TRUE );
|
gGameSettings.fOptions[TOPTION_TOGGLE_TREE_TOPS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_TOGGLE_TREE_TOPS" , TRUE );
|
||||||
gGameSettings.fOptions[TOPTION_SMART_TREE_TOPS] = iniReader.ReadBoolean("JA2 Game Settings", "TOPTION_SMART_TREE_TOPS" , FALSE );
|
gGameSettings.fOptions[TOPTION_SMART_TREE_TOPS] = iniReader.ReadBoolean("JA2 Game Settings", "TOPTION_SMART_TREE_TOPS" , TRUE );
|
||||||
gGameSettings.fOptions[TOPTION_TOGGLE_WIREFRAME] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_TOGGLE_WIREFRAME" , TRUE );
|
gGameSettings.fOptions[TOPTION_TOGGLE_WIREFRAME] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_TOGGLE_WIREFRAME" , TRUE );
|
||||||
gGameSettings.fOptions[TOPTION_3D_CURSOR] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_3D_CURSOR" , FALSE );
|
gGameSettings.fOptions[TOPTION_3D_CURSOR] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_3D_CURSOR" , FALSE );
|
||||||
gGameSettings.fOptions[TOPTION_CTH_CURSOR] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_CTH_CURSOR" , TRUE );
|
gGameSettings.fOptions[TOPTION_CTH_CURSOR] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_CTH_CURSOR" , TRUE );
|
||||||
gGameSettings.fOptions[TOPTION_GL_BURST_CURSOR] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_GL_BURST_CURSOR" , TRUE );
|
gGameSettings.fOptions[TOPTION_GL_BURST_CURSOR] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_GL_BURST_CURSOR" , TRUE );
|
||||||
gGameSettings.fOptions[TOPTION_ALLOW_TAUNTS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_ALLOW_TAUNTS" , TRUE ); // changed from drop all - SANDRO
|
gGameSettings.fOptions[TOPTION_ALLOW_TAUNTS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_ALLOW_TAUNTS" , TRUE ); // changed from drop all - SANDRO
|
||||||
gGameSettings.fOptions[TOPTION_GL_HIGH_ANGLE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_GL_HIGH_ANGLE" , FALSE );
|
gGameSettings.fOptions[TOPTION_GL_HIGH_ANGLE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_GL_HIGH_ANGLE" , TRUE );
|
||||||
|
|
||||||
if (!is_networked)
|
if (!is_networked)
|
||||||
gGameSettings.fOptions[TOPTION_ALLOW_REAL_TIME_SNEAK] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_ALLOW_REAL_TIME_SNEAK" , FALSE ); // Changed from aim levels restriction - SANDRO
|
gGameSettings.fOptions[TOPTION_ALLOW_REAL_TIME_SNEAK] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_ALLOW_REAL_TIME_SNEAK" , FALSE ); // Changed from aim levels restriction - SANDRO
|
||||||
@@ -305,7 +305,7 @@ BOOLEAN LoadGameSettings()
|
|||||||
gGameSettings.fOptions[TOPTION_SPACE_SELECTS_NEXT_SQUAD] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SPACE_SELECTS_NEXT_SQUAD" , TRUE );
|
gGameSettings.fOptions[TOPTION_SPACE_SELECTS_NEXT_SQUAD] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SPACE_SELECTS_NEXT_SQUAD" , TRUE );
|
||||||
gGameSettings.fOptions[TOPTION_SHOW_ITEM_SHADOW] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SHOW_ITEM_SHADOW" , TRUE );
|
gGameSettings.fOptions[TOPTION_SHOW_ITEM_SHADOW] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SHOW_ITEM_SHADOW" , TRUE );
|
||||||
gGameSettings.fOptions[TOPTION_SHOW_WEAPON_RANGE_IN_TILES] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SHOW_WEAPON_RANGE_IN_TILES" , TRUE );
|
gGameSettings.fOptions[TOPTION_SHOW_WEAPON_RANGE_IN_TILES] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SHOW_WEAPON_RANGE_IN_TILES" , TRUE );
|
||||||
gGameSettings.fOptions[TOPTION_TRACERS_FOR_SINGLE_FIRE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_TRACERS_FOR_SINGLE_FIRE" , FALSE );
|
gGameSettings.fOptions[TOPTION_TRACERS_FOR_SINGLE_FIRE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_TRACERS_FOR_SINGLE_FIRE" , TRUE );
|
||||||
gGameSettings.fOptions[TOPTION_RAIN_SOUND] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_RAIN_SOUND" , TRUE );
|
gGameSettings.fOptions[TOPTION_RAIN_SOUND] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_RAIN_SOUND" , TRUE );
|
||||||
|
|
||||||
if (!is_networked)
|
if (!is_networked)
|
||||||
@@ -332,12 +332,12 @@ BOOLEAN LoadGameSettings()
|
|||||||
else
|
else
|
||||||
gGameSettings.fOptions[TOPTION_TOGGLE_TURN_MODE] = FALSE;
|
gGameSettings.fOptions[TOPTION_TOGGLE_TURN_MODE] = FALSE;
|
||||||
|
|
||||||
gGameSettings.fOptions[TOPTION_ALT_START_AIM] = iniReader.ReadBoolean("JA2 Game Settings", "TOPTION_ALT_START_AIM" , FALSE); // Start at max aiming level instead of default no aiming
|
gGameSettings.fOptions[TOPTION_ALT_START_AIM] = iniReader.ReadBoolean("JA2 Game Settings", "TOPTION_ALT_START_AIM" , TRUE); // Start at max aiming level instead of default no aiming
|
||||||
gGameSettings.fOptions[TOPTION_ALT_PATHFINDING] = iniReader.ReadBoolean("JA2 Game Settings", "TOPTION_ALT_PATHFINDING" , FALSE); // A* pathfinding
|
gGameSettings.fOptions[TOPTION_ALT_PATHFINDING] = iniReader.ReadBoolean("JA2 Game Settings", "TOPTION_ALT_PATHFINDING" , FALSE); // A* pathfinding
|
||||||
gGameSettings.fOptions[TOPTION_MERCENARY_FORMATIONS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_MERCENARY_FORMATIONS" , TRUE ); // Flugente: mercenary formations
|
gGameSettings.fOptions[TOPTION_MERCENARY_FORMATIONS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_MERCENARY_FORMATIONS" , FALSE ); // Flugente: mercenary formations
|
||||||
gGameSettings.fOptions[TOPTION_SHOW_ENEMY_LOCATION] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SHOW_ENEMY_LOCATION" , FALSE); // sevenfm: show locations of known enemies
|
gGameSettings.fOptions[TOPTION_SHOW_ENEMY_LOCATION] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SHOW_ENEMY_LOCATION" , FALSE); // sevenfm: show locations of known enemies
|
||||||
gGameSettings.fOptions[TOPTION_REPORT_MISS_MARGIN] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_REPORT_MISS_MARGIN" , FALSE ); // HEADROCK HAM 4: Shot offset report
|
gGameSettings.fOptions[TOPTION_REPORT_MISS_MARGIN] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_REPORT_MISS_MARGIN" , FALSE ); // HEADROCK HAM 4: Shot offset report
|
||||||
gGameSettings.fOptions[TOPTION_USE_LOGICAL_BODYTYPES] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_USE_LOGICAL_BODYTYPES" , FALSE );
|
gGameSettings.fOptions[TOPTION_USE_LOGICAL_BODYTYPES] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_USE_LOGICAL_BODYTYPES" , TRUE );
|
||||||
gGameSettings.fOptions[TOPTION_ALT_MAP_COLOR] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_ALT_MAP_COLOR" , FALSE ); // HEADROCK HAM 4: Strategic Map Colors
|
gGameSettings.fOptions[TOPTION_ALT_MAP_COLOR] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_ALT_MAP_COLOR" , FALSE ); // HEADROCK HAM 4: Strategic Map Colors
|
||||||
gGameSettings.fOptions[TOPTION_ALTERNATE_BULLET_GRAPHICS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_ALTERNATE_BULLET_GRAPHICS" , TRUE );
|
gGameSettings.fOptions[TOPTION_ALTERNATE_BULLET_GRAPHICS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_ALTERNATE_BULLET_GRAPHICS" , TRUE );
|
||||||
gGameSettings.fOptions[TOPTION_SHOW_MERC_RANKS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SHOW_MERC_RANKS" , FALSE );
|
gGameSettings.fOptions[TOPTION_SHOW_MERC_RANKS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SHOW_MERC_RANKS" , FALSE );
|
||||||
@@ -357,13 +357,13 @@ BOOLEAN LoadGameSettings()
|
|||||||
gGameSettings.fOptions[NUM_GAME_OPTIONS] = iniReader.ReadBoolean("JA2 Game Settings","NUM_GAME_OPTIONS" , FALSE );
|
gGameSettings.fOptions[NUM_GAME_OPTIONS] = iniReader.ReadBoolean("JA2 Game Settings","NUM_GAME_OPTIONS" , FALSE );
|
||||||
gGameSettings.fOptions[TOPTION_HIDE_BULLETS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_HIDE_BULLETS" , FALSE );
|
gGameSettings.fOptions[TOPTION_HIDE_BULLETS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_HIDE_BULLETS" , FALSE );
|
||||||
gGameSettings.fOptions[TOPTION_TRACKING_MODE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_TRACKING_MODE" , TRUE );
|
gGameSettings.fOptions[TOPTION_TRACKING_MODE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_TRACKING_MODE" , TRUE );
|
||||||
gGameSettings.fOptions[TOPTION_DISABLE_CURSOR_SWAP] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_DISABLE_CURSOR_SWAP" , FALSE );
|
gGameSettings.fOptions[TOPTION_DISABLE_CURSOR_SWAP] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_DISABLE_CURSOR_SWAP" , TRUE );
|
||||||
gGameSettings.fOptions[TOPTION_QUIET_TRAINING] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_QUIET_TRAINING" , FALSE );
|
gGameSettings.fOptions[TOPTION_QUIET_TRAINING] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_QUIET_TRAINING" , FALSE );
|
||||||
gGameSettings.fOptions[TOPTION_QUIET_REPAIRING] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_QUIET_REPAIRING" , FALSE );
|
gGameSettings.fOptions[TOPTION_QUIET_REPAIRING] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_QUIET_REPAIRING" , FALSE );
|
||||||
gGameSettings.fOptions[TOPTION_QUIET_DOCTORING] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_QUIET_DOCTORING" , FALSE );
|
gGameSettings.fOptions[TOPTION_QUIET_DOCTORING] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_QUIET_DOCTORING" , FALSE );
|
||||||
|
|
||||||
if (!is_networked)
|
if (!is_networked)
|
||||||
gGameSettings.fOptions[TOPTION_AUTO_FAST_FORWARD_MODE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_AUTO_FAST_FORWARD_MODE" , FALSE );
|
gGameSettings.fOptions[TOPTION_AUTO_FAST_FORWARD_MODE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_AUTO_FAST_FORWARD_MODE" , TRUE );
|
||||||
else
|
else
|
||||||
gGameSettings.fOptions[TOPTION_AUTO_FAST_FORWARD_MODE] = FALSE;
|
gGameSettings.fOptions[TOPTION_AUTO_FAST_FORWARD_MODE] = FALSE;
|
||||||
|
|
||||||
@@ -776,17 +776,17 @@ void InitGameSettings()
|
|||||||
gGameSettings.fOptions[ TOPTION_BLOOD_N_GORE ] = TRUE;
|
gGameSettings.fOptions[ TOPTION_BLOOD_N_GORE ] = TRUE;
|
||||||
gGameSettings.fOptions[ TOPTION_DONT_MOVE_MOUSE ] = FALSE;
|
gGameSettings.fOptions[ TOPTION_DONT_MOVE_MOUSE ] = FALSE;
|
||||||
gGameSettings.fOptions[ TOPTION_OLD_SELECTION_METHOD ] = FALSE;
|
gGameSettings.fOptions[ TOPTION_OLD_SELECTION_METHOD ] = FALSE;
|
||||||
gGameSettings.fOptions[ TOPTION_ALWAYS_SHOW_MOVEMENT_PATH ] = FALSE;
|
gGameSettings.fOptions[ TOPTION_ALWAYS_SHOW_MOVEMENT_PATH ] = TRUE;
|
||||||
gGameSettings.fOptions[ TOPTION_SHOW_MISSES ] = FALSE;
|
gGameSettings.fOptions[ TOPTION_SHOW_MISSES ] = FALSE;
|
||||||
gGameSettings.fOptions[ TOPTION_RTCONFIRM ] = FALSE;
|
gGameSettings.fOptions[ TOPTION_RTCONFIRM ] = FALSE;
|
||||||
gGameSettings.fOptions[ TOPTION_SLEEPWAKE_NOTIFICATION ] = TRUE;
|
gGameSettings.fOptions[ TOPTION_SLEEPWAKE_NOTIFICATION ] = FALSE;
|
||||||
gGameSettings.fOptions[ TOPTION_USE_METRIC_SYSTEM ] = TRUE;
|
gGameSettings.fOptions[ TOPTION_USE_METRIC_SYSTEM ] = TRUE;
|
||||||
gGameSettings.fOptions[TOPTION_MERC_CASTS_LIGHT] = FALSE;
|
gGameSettings.fOptions[TOPTION_MERC_CASTS_LIGHT] = FALSE;
|
||||||
gGameSettings.fOptions[ TOPTION_SMART_CURSOR ] = FALSE;
|
gGameSettings.fOptions[ TOPTION_SMART_CURSOR ] = FALSE;
|
||||||
gGameSettings.fOptions[ TOPTION_SNAP_CURSOR_TO_DOOR ] = TRUE;
|
gGameSettings.fOptions[ TOPTION_SNAP_CURSOR_TO_DOOR ] = TRUE;
|
||||||
gGameSettings.fOptions[ TOPTION_GLOW_ITEMS ] = TRUE;
|
gGameSettings.fOptions[ TOPTION_GLOW_ITEMS ] = TRUE;
|
||||||
gGameSettings.fOptions[ TOPTION_TOGGLE_TREE_TOPS ] = TRUE;
|
gGameSettings.fOptions[ TOPTION_TOGGLE_TREE_TOPS ] = TRUE;
|
||||||
gGameSettings.fOptions[ TOPTION_SMART_TREE_TOPS ] = FALSE;
|
gGameSettings.fOptions[ TOPTION_SMART_TREE_TOPS ] = TRUE;
|
||||||
gGameSettings.fOptions[ TOPTION_TOGGLE_WIREFRAME ] = TRUE;
|
gGameSettings.fOptions[ TOPTION_TOGGLE_WIREFRAME ] = TRUE;
|
||||||
gGameSettings.fOptions[ TOPTION_3D_CURSOR ] = FALSE;
|
gGameSettings.fOptions[ TOPTION_3D_CURSOR ] = FALSE;
|
||||||
gGameSettings.fOptions[ TOPTION_CTH_CURSOR ] = TRUE;
|
gGameSettings.fOptions[ TOPTION_CTH_CURSOR ] = TRUE;
|
||||||
@@ -794,14 +794,14 @@ void InitGameSettings()
|
|||||||
//Madd:
|
//Madd:
|
||||||
gGameSettings.fOptions[ TOPTION_GL_BURST_CURSOR ] = TRUE;
|
gGameSettings.fOptions[ TOPTION_GL_BURST_CURSOR ] = TRUE;
|
||||||
gGameSettings.fOptions[ TOPTION_ALLOW_TAUNTS ] = TRUE; // changed - SANDRO
|
gGameSettings.fOptions[ TOPTION_ALLOW_TAUNTS ] = TRUE; // changed - SANDRO
|
||||||
gGameSettings.fOptions[ TOPTION_GL_HIGH_ANGLE ] = FALSE;
|
gGameSettings.fOptions[ TOPTION_GL_HIGH_ANGLE ] = TRUE;
|
||||||
gGameSettings.fOptions[ TOPTION_ALLOW_REAL_TIME_SNEAK ] = FALSE; // changed - SANDRO
|
gGameSettings.fOptions[ TOPTION_ALLOW_REAL_TIME_SNEAK ] = FALSE; // changed - SANDRO
|
||||||
|
|
||||||
//lalien
|
//lalien
|
||||||
gGameSettings.fOptions[ TOPTION_SPACE_SELECTS_NEXT_SQUAD ] = TRUE;
|
gGameSettings.fOptions[ TOPTION_SPACE_SELECTS_NEXT_SQUAD ] = TRUE;
|
||||||
gGameSettings.fOptions[ TOPTION_SHOW_ITEM_SHADOW ] = TRUE;
|
gGameSettings.fOptions[ TOPTION_SHOW_ITEM_SHADOW ] = TRUE;
|
||||||
gGameSettings.fOptions[ TOPTION_SHOW_WEAPON_RANGE_IN_TILES ] = TRUE;
|
gGameSettings.fOptions[ TOPTION_SHOW_WEAPON_RANGE_IN_TILES ] = TRUE;
|
||||||
gGameSettings.fOptions[ TOPTION_TRACERS_FOR_SINGLE_FIRE ] = FALSE;
|
gGameSettings.fOptions[ TOPTION_TRACERS_FOR_SINGLE_FIRE ] = TRUE;
|
||||||
gGameSettings.fOptions[ TOPTION_RAIN_SOUND ] = TRUE;
|
gGameSettings.fOptions[ TOPTION_RAIN_SOUND ] = TRUE;
|
||||||
gGameSettings.fOptions[ TOPTION_ALLOW_CROWS ] = TRUE;
|
gGameSettings.fOptions[ TOPTION_ALLOW_CROWS ] = TRUE;
|
||||||
gGameSettings.fOptions[ TOPTION_ALLOW_SOLDIER_TOOLTIPS ] = TRUE;
|
gGameSettings.fOptions[ TOPTION_ALLOW_SOLDIER_TOOLTIPS ] = TRUE;
|
||||||
@@ -827,14 +827,14 @@ void InitGameSettings()
|
|||||||
gGameSettings.fOptions[ TOPTION_REPORT_MISS_MARGIN ] = FALSE;
|
gGameSettings.fOptions[ TOPTION_REPORT_MISS_MARGIN ] = FALSE;
|
||||||
|
|
||||||
// BIO
|
// BIO
|
||||||
gGameSettings.fOptions[ TOPTION_USE_LOGICAL_BODYTYPES ] = FALSE;
|
gGameSettings.fOptions[ TOPTION_USE_LOGICAL_BODYTYPES ] = TRUE;
|
||||||
|
|
||||||
gGameSettings.fOptions[ TOPTION_DISABLE_CURSOR_SWAP ] = FALSE;
|
gGameSettings.fOptions[ TOPTION_DISABLE_CURSOR_SWAP ] = TRUE;
|
||||||
gGameSettings.fOptions[ TOPTION_QUIET_TRAINING ] = FALSE;
|
gGameSettings.fOptions[ TOPTION_QUIET_TRAINING ] = FALSE;
|
||||||
gGameSettings.fOptions[ TOPTION_QUIET_REPAIRING ] = FALSE;
|
gGameSettings.fOptions[ TOPTION_QUIET_REPAIRING ] = FALSE;
|
||||||
gGameSettings.fOptions[ TOPTION_QUIET_DOCTORING ] = FALSE;
|
gGameSettings.fOptions[ TOPTION_QUIET_DOCTORING ] = FALSE;
|
||||||
|
|
||||||
gGameSettings.fOptions[ TOPTION_AUTO_FAST_FORWARD_MODE ] = FALSE;
|
gGameSettings.fOptions[ TOPTION_AUTO_FAST_FORWARD_MODE ] = TRUE;
|
||||||
|
|
||||||
gGameSettings.fOptions[ TOPTION_ZOMBIES ] = FALSE; // Flugente Zombies
|
gGameSettings.fOptions[ TOPTION_ZOMBIES ] = FALSE; // Flugente Zombies
|
||||||
|
|
||||||
@@ -846,7 +846,7 @@ void InitGameSettings()
|
|||||||
|
|
||||||
gGameSettings.fOptions[ TOPTION_MERCENARY_FORMATIONS ] = FALSE; // Flugente: mercenary formations
|
gGameSettings.fOptions[ TOPTION_MERCENARY_FORMATIONS ] = FALSE; // Flugente: mercenary formations
|
||||||
gGameSettings.fOptions[TOPTION_SHOW_ENEMY_LOCATION] = FALSE; // sevenfm: show locations of known enemies
|
gGameSettings.fOptions[TOPTION_SHOW_ENEMY_LOCATION] = FALSE; // sevenfm: show locations of known enemies
|
||||||
gGameSettings.fOptions[TOPTION_ALT_START_AIM] = FALSE;
|
gGameSettings.fOptions[TOPTION_ALT_START_AIM] = TRUE;
|
||||||
gGameSettings.fOptions[TOPTION_ALT_PATHFINDING] = FALSE;
|
gGameSettings.fOptions[TOPTION_ALT_PATHFINDING] = FALSE;
|
||||||
|
|
||||||
// arynn: Cheat/Debug Menu
|
// arynn: Cheat/Debug Menu
|
||||||
@@ -2101,9 +2101,6 @@ void LoadGameExternalOptions()
|
|||||||
|
|
||||||
//################# Strategic Gameplay Settings ##################
|
//################# Strategic Gameplay Settings ##################
|
||||||
|
|
||||||
// Allow enemy and militia Strategic Groups to reinforce one another for battles?
|
|
||||||
// silversurfer: Obsolete. This is now in DifficultySettings.xml and will be set during InitNewGame().
|
|
||||||
gGameExternalOptions.gfAllowReinforcements = TRUE;
|
|
||||||
// Allow reinforcements only between City sectors?
|
// Allow reinforcements only between City sectors?
|
||||||
gGameExternalOptions.gfAllowReinforcementsOnlyInCity = iniReader.ReadBoolean("Strategic Gameplay Settings","ALLOW_REINFORCEMENTS_ONLY_IN_CITIES",FALSE);
|
gGameExternalOptions.gfAllowReinforcementsOnlyInCity = iniReader.ReadBoolean("Strategic Gameplay Settings","ALLOW_REINFORCEMENTS_ONLY_IN_CITIES",FALSE);
|
||||||
|
|
||||||
@@ -2898,7 +2895,7 @@ void LoadSkillTraitsExternalSettings()
|
|||||||
gSkillTraitValues.fSNTSnitchLeadershipBonusModifer = iniReader.ReadFloat("Snitch","SNITCH_LEADERSHIP_BONUS_MODIFIER", 0.5, 0.0, 10.0);
|
gSkillTraitValues.fSNTSnitchLeadershipBonusModifer = iniReader.ReadFloat("Snitch","SNITCH_LEADERSHIP_BONUS_MODIFIER", 0.5, 0.0, 10.0);
|
||||||
gSkillTraitValues.bSNTSociableMercBonus = iniReader.ReadInteger("Snitch","SOCIABLE_MERC_BONUS", 10, -100, 100);
|
gSkillTraitValues.bSNTSociableMercBonus = iniReader.ReadInteger("Snitch","SOCIABLE_MERC_BONUS", 10, -100, 100);
|
||||||
gSkillTraitValues.bSNTLonerMercBonus = iniReader.ReadInteger("Snitch","LONER_MERC_BONUS", -10, -100, 100);
|
gSkillTraitValues.bSNTLonerMercBonus = iniReader.ReadInteger("Snitch","LONER_MERC_BONUS", -10, -100, 100);
|
||||||
gSkillTraitValues.bSNTSameAssignmentBonus = iniReader.ReadInteger("Snitch","LONER_MERC_BONUS", -20, -100, 100);
|
gSkillTraitValues.bSNTSameAssignmentBonus = iniReader.ReadInteger("Snitch","SAME_ASSIGNMENT_BONUS", -20, -100, 100);
|
||||||
gSkillTraitValues.bSNTMercOpinionAboutMercTreshold = iniReader.ReadInteger("Snitch","MERC_OPINION_ABOUT_MERC_TRESHOLD", -10, -25, 25);
|
gSkillTraitValues.bSNTMercOpinionAboutMercTreshold = iniReader.ReadInteger("Snitch","MERC_OPINION_ABOUT_MERC_TRESHOLD", -10, -25, 25);
|
||||||
|
|
||||||
gSkillTraitValues.ubSNTPassiveReputationGain = iniReader.ReadInteger("Snitch","PASSIVE_REPUTATION_GAIN", 3, 0, 100);
|
gSkillTraitValues.ubSNTPassiveReputationGain = iniReader.ReadInteger("Snitch","PASSIVE_REPUTATION_GAIN", 3, 0, 100);
|
||||||
@@ -3614,10 +3611,10 @@ void LoadGameAPBPConstants()
|
|||||||
APBPConstants[BP_CRAWL_ENERGYCOSTFACTOR] = iniReader.ReadInteger("BPConstants","BP_CRAWL_ENERGYCOSTFACTOR",4);
|
APBPConstants[BP_CRAWL_ENERGYCOSTFACTOR] = iniReader.ReadInteger("BPConstants","BP_CRAWL_ENERGYCOSTFACTOR",4);
|
||||||
APBPConstants[BP_RADIO] = iniReader.ReadInteger("BPConstants","BP_RADIO",0);
|
APBPConstants[BP_RADIO] = iniReader.ReadInteger("BPConstants","BP_RADIO",0);
|
||||||
APBPConstants[BP_USE_DETONATOR] = iniReader.ReadInteger("BPConstants","BP_USE_DETONATOR",0);
|
APBPConstants[BP_USE_DETONATOR] = iniReader.ReadInteger("BPConstants","BP_USE_DETONATOR",0);
|
||||||
APBPConstants[BP_PER_AP_NO_EFFORT] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","BP_PER_AP_NO_EFFORT",-50),-50, TRUE);
|
APBPConstants[BP_PER_AP_NO_EFFORT] = DynamicAdjustAPConstants(iniReader.ReadInteger("BPConstants","BP_PER_AP_NO_EFFORT",-50),-50, TRUE);
|
||||||
APBPConstants[BP_PER_AP_MIN_EFFORT] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","BP_PER_AP_MIN_EFFORT",-25),-25, TRUE);
|
APBPConstants[BP_PER_AP_MIN_EFFORT] = DynamicAdjustAPConstants(iniReader.ReadInteger("BPConstants","BP_PER_AP_MIN_EFFORT",-25),-25, TRUE);
|
||||||
APBPConstants[BP_PER_AP_LT_EFFORT] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","BP_PER_AP_LT_EFFORT",-12),-12, TRUE);
|
APBPConstants[BP_PER_AP_LT_EFFORT] = DynamicAdjustAPConstants(iniReader.ReadInteger("BPConstants","BP_PER_AP_LT_EFFORT",-12),-12, TRUE);
|
||||||
APBPConstants[BP_PER_AP_MOD_EFFORT] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","BP_PER_AP_MOD_EFFORT",0),0, TRUE);
|
APBPConstants[BP_PER_AP_MOD_EFFORT] = DynamicAdjustAPConstants(iniReader.ReadInteger("BPConstants","BP_PER_AP_MOD_EFFORT",0),0, TRUE);
|
||||||
APBPConstants[BP_MOVEMENT_FLAT] = iniReader.ReadInteger("BPConstants","BP_MOVEMENT_FLAT",5);
|
APBPConstants[BP_MOVEMENT_FLAT] = iniReader.ReadInteger("BPConstants","BP_MOVEMENT_FLAT",5);
|
||||||
APBPConstants[BP_MOVEMENT_GRASS] = iniReader.ReadInteger("BPConstants","BP_MOVEMENT_GRASS",10);
|
APBPConstants[BP_MOVEMENT_GRASS] = iniReader.ReadInteger("BPConstants","BP_MOVEMENT_GRASS",10);
|
||||||
APBPConstants[BP_MOVEMENT_BUSH] = iniReader.ReadInteger("BPConstants","BP_MOVEMENT_BUSH",20);
|
APBPConstants[BP_MOVEMENT_BUSH] = iniReader.ReadInteger("BPConstants","BP_MOVEMENT_BUSH",20);
|
||||||
|
|||||||
+4
-2
@@ -22,7 +22,9 @@ extern CHAR16 zBuildInformation[256];
|
|||||||
//
|
//
|
||||||
// Keeps track of the saved game version. Increment the saved game version whenever
|
// Keeps track of the saved game version. Increment the saved game version whenever
|
||||||
// you will invalidate the saved game file
|
// you will invalidate the saved game file
|
||||||
#define MERC_PROFILE_INSERTION_DATA 185 // Bigmap support for AddProfileToMap function
|
|
||||||
|
#define INCREASED_TEAMSIZES 186 // Asdow: SOLDIERTYPE ubID changed from UINT8 -> UINT16
|
||||||
|
#define MERC_PROFILE_INSERTION_DATA 185 // Bigmap support for AddProfileToMap function
|
||||||
#define GROWTH_MODIFIERS 184
|
#define GROWTH_MODIFIERS 184
|
||||||
#define REBELCOMMAND 183
|
#define REBELCOMMAND 183
|
||||||
#define DRAGSTRUCTURE 182 // Flugente: we can drag structures behind us
|
#define DRAGSTRUCTURE 182 // Flugente: we can drag structures behind us
|
||||||
@@ -105,7 +107,7 @@ extern CHAR16 zBuildInformation[256];
|
|||||||
#define AP100_SAVEGAME_DATATYPE_CHANGE 105 // Before this, we didn't have the 100AP structure changes
|
#define AP100_SAVEGAME_DATATYPE_CHANGE 105 // Before this, we didn't have the 100AP structure changes
|
||||||
#define NIV_SAVEGAME_DATATYPE_CHANGE 102 // Before this, we used the old structure system
|
#define NIV_SAVEGAME_DATATYPE_CHANGE 102 // Before this, we used the old structure system
|
||||||
|
|
||||||
#define SAVE_GAME_VERSION MERC_PROFILE_INSERTION_DATA
|
#define SAVE_GAME_VERSION INCREASED_TEAMSIZES
|
||||||
|
|
||||||
//#define RUSSIANGOLD
|
//#define RUSSIANGOLD
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
+118
-262
@@ -233,7 +233,7 @@ typedef struct
|
|||||||
BOOLEAN fHavePurchasedItemsFromTony;
|
BOOLEAN fHavePurchasedItemsFromTony;
|
||||||
|
|
||||||
//The selected soldier in tactical
|
//The selected soldier in tactical
|
||||||
UINT16 usSelectedSoldier;
|
SoldierID usSelectedSoldier;
|
||||||
|
|
||||||
// The x and y scroll position
|
// The x and y scroll position
|
||||||
INT16 sRenderCenterX;
|
INT16 sRenderCenterX;
|
||||||
@@ -297,15 +297,15 @@ typedef struct
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
BOOLEAN fSkyriderEmptyHelpGiven;
|
BOOLEAN fSkyriderEmptyHelpGiven;
|
||||||
BOOLEAN fEnterMapDueToContract;
|
BOOLEAN fEnterMapDueToContract;
|
||||||
UINT8 ubHelicopterHitsTaken;
|
UINT8 ubHelicopterHitsTaken;
|
||||||
UINT8 ubQuitType;
|
UINT8 ubQuitType;
|
||||||
BOOLEAN fSkyriderSaidCongratsOnTakingSAM;
|
BOOLEAN fSkyriderSaidCongratsOnTakingSAM;
|
||||||
INT16 sContractRehireSoldierID;
|
SoldierID sContractRehireSoldierID;
|
||||||
|
|
||||||
|
|
||||||
GAME_OPTIONS GameOptions;
|
GAME_OPTIONS GameOptions;
|
||||||
|
|
||||||
UINT32 uiSeedNumber;
|
UINT32 uiSeedNumber;
|
||||||
|
|
||||||
@@ -314,7 +314,7 @@ typedef struct
|
|||||||
|
|
||||||
INT16 sCurInterfacePanel;
|
INT16 sCurInterfacePanel;
|
||||||
|
|
||||||
UINT8 ubSMCurrentMercID;
|
SoldierID ubSMCurrentMercID;
|
||||||
|
|
||||||
BOOLEAN fFirstTimeInMapScreen;
|
BOOLEAN fFirstTimeInMapScreen;
|
||||||
|
|
||||||
@@ -322,9 +322,9 @@ typedef struct
|
|||||||
|
|
||||||
BOOLEAN fDisableMapInterfaceDueToBattle;
|
BOOLEAN fDisableMapInterfaceDueToBattle;
|
||||||
|
|
||||||
INT32 sBoxerGridNo[ NUM_BOXERS ];
|
INT32 sBoxerGridNo[ NUM_BOXERS ];
|
||||||
UINT8 ubBoxerID[ NUM_BOXERS ];
|
SoldierID ubBoxerID[ NUM_BOXERS ];
|
||||||
BOOLEAN fBoxerFought[ NUM_BOXERS ];
|
BOOLEAN fBoxerFought[ NUM_BOXERS ];
|
||||||
|
|
||||||
BOOLEAN fHelicopterDestroyed; //if the chopper is destroyed
|
BOOLEAN fHelicopterDestroyed; //if the chopper is destroyed
|
||||||
BOOLEAN fShowMapScreenHelpText; //If true, displays help in mapscreen
|
BOOLEAN fShowMapScreenHelpText; //If true, displays help in mapscreen
|
||||||
@@ -342,8 +342,8 @@ typedef struct
|
|||||||
|
|
||||||
BOOLEAN ubPlayerProgressSkyriderLastCommentedOn;
|
BOOLEAN ubPlayerProgressSkyriderLastCommentedOn;
|
||||||
|
|
||||||
BOOLEAN gfMeanwhileTryingToStart;
|
BOOLEAN gfMeanwhileTryingToStart;
|
||||||
BOOLEAN gfInMeanwhile;
|
BOOLEAN gfInMeanwhile;
|
||||||
|
|
||||||
// list of dead guys for squads...in id values->-1 means no one home
|
// list of dead guys for squads...in id values->-1 means no one home
|
||||||
INT16 sDeadMercs[ NUMBER_OF_SQUADS ][ NUMBER_OF_SOLDIERS_PER_SQUAD ];
|
INT16 sDeadMercs[ NUMBER_OF_SQUADS ][ NUMBER_OF_SOLDIERS_PER_SQUAD ];
|
||||||
@@ -413,7 +413,7 @@ typedef struct
|
|||||||
|
|
||||||
UINT32 uiMeanWhileFlags;
|
UINT32 uiMeanWhileFlags;
|
||||||
|
|
||||||
INT8 bSelectedInfoChar;
|
INT16 bSelectedInfoChar;
|
||||||
INT8 bHospitalPriceModifier;
|
INT8 bHospitalPriceModifier;
|
||||||
INT8 bUnused2[ 2 ];
|
INT8 bUnused2[ 2 ];
|
||||||
|
|
||||||
@@ -551,8 +551,8 @@ BOOLEAN SetMercsInsertionGridNo( );
|
|||||||
BOOLEAN LoadOppListInfoFromSavedGame( HWFILE hFile );
|
BOOLEAN LoadOppListInfoFromSavedGame( HWFILE hFile );
|
||||||
BOOLEAN SaveOppListInfoToSavedGame( HWFILE hFile );
|
BOOLEAN SaveOppListInfoToSavedGame( HWFILE hFile );
|
||||||
|
|
||||||
BOOLEAN LoadMercPathToSoldierStruct( HWFILE hFilem, UINT8 ubID );
|
BOOLEAN LoadMercPathToSoldierStruct( HWFILE hFilem, UINT16 ubID );
|
||||||
BOOLEAN SaveMercPathFromSoldierStruct( HWFILE hFilem, UINT8 ubID );
|
BOOLEAN SaveMercPathFromSoldierStruct( HWFILE hFilem, UINT16 ubID );
|
||||||
|
|
||||||
BOOLEAN LoadGeneralInfo( HWFILE hFile );
|
BOOLEAN LoadGeneralInfo( HWFILE hFile );
|
||||||
BOOLEAN SaveGeneralInfo( HWFILE hFile );
|
BOOLEAN SaveGeneralInfo( HWFILE hFile );
|
||||||
@@ -1074,7 +1074,7 @@ BOOLEAN ITEM_CURSOR_SAVE_INFO::Load(HWFILE hFile)
|
|||||||
if ( guiCurrentSaveGameVersion >= NIV_SAVEGAME_DATATYPE_CHANGE )
|
if ( guiCurrentSaveGameVersion >= NIV_SAVEGAME_DATATYPE_CHANGE )
|
||||||
{
|
{
|
||||||
//3 bytes of info, screw being neat
|
//3 bytes of info, screw being neat
|
||||||
if ( !FileRead( hFile, this, 3, &uiNumBytesRead ) )
|
if ( !FileRead( hFile, this, SIZEOF_ITEM_CURSOR_SAVE_INFO_POD, &uiNumBytesRead ) )
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -1103,7 +1103,7 @@ BOOLEAN ITEM_CURSOR_SAVE_INFO::Save(HWFILE hFile)
|
|||||||
{
|
{
|
||||||
UINT32 uiNumBytesWritten;
|
UINT32 uiNumBytesWritten;
|
||||||
//3 bytes of info, screw being neat
|
//3 bytes of info, screw being neat
|
||||||
if ( !FileWrite( hFile, this, 3, &uiNumBytesWritten ) )
|
if ( !FileWrite( hFile, this, SIZEOF_ITEM_CURSOR_SAVE_INFO_POD, &uiNumBytesWritten ) )
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -1947,7 +1947,7 @@ use of this function should allow changes to be made to various structures withi
|
|||||||
INT32 ReadFieldByField(HWFILE hFile, PTR pDest, UINT32 uiFieldSize, UINT32 uiElementSize, UINT32 uiCurByteCount)
|
INT32 ReadFieldByField(HWFILE hFile, PTR pDest, UINT32 uiFieldSize, UINT32 uiElementSize, UINT32 uiCurByteCount)
|
||||||
{
|
{
|
||||||
UINT32 uiNumBytesRead;
|
UINT32 uiNumBytesRead;
|
||||||
char padding[10];
|
char padding[10];
|
||||||
UINT32 uiBytesRead = uiCurByteCount; // used to track our new byte count
|
UINT32 uiBytesRead = uiCurByteCount; // used to track our new byte count
|
||||||
UINT32 sampleBytesRead = uiBytesRead; // used to determine how much padding is needed
|
UINT32 sampleBytesRead = uiBytesRead; // used to determine how much padding is needed
|
||||||
|
|
||||||
@@ -1980,8 +1980,10 @@ BOOLEAN SOLDIERTYPE::Load(HWFILE hFile)
|
|||||||
//the soldier type info has changed at version 102
|
//the soldier type info has changed at version 102
|
||||||
//CHRISL: To accomodate future changes to this structure, we'll load each value field by field
|
//CHRISL: To accomodate future changes to this structure, we'll load each value field by field
|
||||||
numBytesRead = 0;
|
numBytesRead = 0;
|
||||||
FileRead( hFile, this, (offsetof(SOLDIERTYPE, ubBodyType)+sizeof(ubBodyType)), &uiNumBytesRead );
|
numBytesRead = ReadFieldByField(hFile, &this->ubID, sizeof(ubID), sizeof(UINT16), numBytesRead);
|
||||||
numBytesRead += uiNumBytesRead;
|
numBytesRead = ReadFieldByField(hFile, &this->name, sizeof(name), sizeof(CHAR16), numBytesRead);
|
||||||
|
numBytesRead = ReadFieldByField(hFile, &this->ubBodyType, sizeof(ubBodyType), sizeof(UINT8), numBytesRead);
|
||||||
|
|
||||||
if(guiCurrentSaveGameVersion >= AP100_SAVEGAME_DATATYPE_CHANGE)
|
if(guiCurrentSaveGameVersion >= AP100_SAVEGAME_DATATYPE_CHANGE)
|
||||||
{ //CHRISL: It was changed at version 104 to allow for 16bit action points for the 100AP system
|
{ //CHRISL: It was changed at version 104 to allow for 16bit action points for the 100AP system
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->bActionPoints, sizeof(bActionPoints), sizeof(INT16), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->bActionPoints, sizeof(bActionPoints), sizeof(INT16), numBytesRead);
|
||||||
@@ -2009,7 +2011,7 @@ BOOLEAN SOLDIERTYPE::Load(HWFILE hFile)
|
|||||||
numBytesRead = ReadFieldByField(hFile, &this->ubWaitActionToDo, sizeof(ubWaitActionToDo), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->ubWaitActionToDo, sizeof(ubWaitActionToDo), sizeof(UINT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->ubInsertionDirection, sizeof(ubInsertionDirection), sizeof(INT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->ubInsertionDirection, sizeof(ubInsertionDirection), sizeof(INT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->bGunType, sizeof(bGunType), sizeof(INT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->bGunType, sizeof(bGunType), sizeof(INT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->ubOppNum, sizeof(ubOppNum), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->ubOppNum, sizeof(ubOppNum), sizeof(UINT16), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->bLastRenderVisibleValue, sizeof(bLastRenderVisibleValue), sizeof(INT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->bLastRenderVisibleValue, sizeof(bLastRenderVisibleValue), sizeof(INT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->ubAttackingHand, sizeof(ubAttackingHand), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->ubAttackingHand, sizeof(ubAttackingHand), sizeof(UINT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->sWeightCarriedAtTurnStart, sizeof(sWeightCarriedAtTurnStart), sizeof(INT16), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->sWeightCarriedAtTurnStart, sizeof(sWeightCarriedAtTurnStart), sizeof(INT16), numBytesRead);
|
||||||
@@ -2053,8 +2055,8 @@ BOOLEAN SOLDIERTYPE::Load(HWFILE hFile)
|
|||||||
numBytesRead = ReadFieldByField(hFile, &this->usAnimState, sizeof(usAnimState), sizeof(UINT16), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->usAnimState, sizeof(usAnimState), sizeof(UINT16), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->uiAIDelay, sizeof(uiAIDelay), sizeof(UINT32), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->uiAIDelay, sizeof(uiAIDelay), sizeof(UINT32), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->sReloadDelay, sizeof(sReloadDelay), sizeof(INT16), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->sReloadDelay, sizeof(sReloadDelay), sizeof(INT16), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->ubAttackerID, sizeof(ubAttackerID), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->ubAttackerID, sizeof(ubAttackerID), sizeof(UINT16), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->ubPreviousAttackerID, sizeof(ubPreviousAttackerID), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->ubPreviousAttackerID, sizeof(ubPreviousAttackerID), sizeof(UINT16), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->sInsertionGridNo, sizeof(sInsertionGridNo), sizeof(INT32), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->sInsertionGridNo, sizeof(sInsertionGridNo), sizeof(INT32), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->AnimCache, sizeof(AnimCache), 1, numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->AnimCache, sizeof(AnimCache), 1, numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->bSide, sizeof(bSide), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->bSide, sizeof(bSide), sizeof(UINT8), numBytesRead);
|
||||||
@@ -2134,7 +2136,7 @@ BOOLEAN SOLDIERTYPE::Load(HWFILE hFile)
|
|||||||
numBytesRead = ReadFieldByField(hFile, &this->pCurrentShade, sizeof(pCurrentShade), sizeof(UINT16), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->pCurrentShade, sizeof(pCurrentShade), sizeof(UINT16), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->ubFadeLevel, sizeof(ubFadeLevel), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->ubFadeLevel, sizeof(ubFadeLevel), sizeof(UINT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->ubServiceCount, sizeof(ubServiceCount), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->ubServiceCount, sizeof(ubServiceCount), sizeof(UINT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->ubServicePartner, sizeof(ubServicePartner), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->ubServicePartner, sizeof(ubServicePartner), sizeof(UINT16), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->pThrowParams, sizeof(pThrowParams), 4, numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->pThrowParams, sizeof(pThrowParams), 4, numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->bReverse, sizeof(bReverse), sizeof(INT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->bReverse, sizeof(bReverse), sizeof(INT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->pLevelNode, sizeof(pLevelNode), 4, numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->pLevelNode, sizeof(pLevelNode), 4, numBytesRead);
|
||||||
@@ -2232,7 +2234,7 @@ BOOLEAN SOLDIERTYPE::Load(HWFILE hFile)
|
|||||||
numBytesRead = ReadFieldByField(hFile, &this->iTotalLengthOfInsuranceContract, sizeof(iTotalLengthOfInsuranceContract), sizeof(INT32), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->iTotalLengthOfInsuranceContract, sizeof(iTotalLengthOfInsuranceContract), sizeof(INT32), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->ubSoldierClass, sizeof(ubSoldierClass), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->ubSoldierClass, sizeof(ubSoldierClass), sizeof(UINT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->ubAPsLostToSuppression, sizeof(ubAPsLostToSuppression), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->ubAPsLostToSuppression, sizeof(ubAPsLostToSuppression), sizeof(UINT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->ubSuppressorID, sizeof(ubSuppressorID), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->ubSuppressorID, sizeof(ubSuppressorID), sizeof(UINT16), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->ubDesiredSquadAssignment, sizeof(ubDesiredSquadAssignment), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->ubDesiredSquadAssignment, sizeof(ubDesiredSquadAssignment), sizeof(UINT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->ubNumTraversalsAllowedToMerge, sizeof(ubNumTraversalsAllowedToMerge), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->ubNumTraversalsAllowedToMerge, sizeof(ubNumTraversalsAllowedToMerge), sizeof(UINT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->usPendingAnimation2, sizeof(usPendingAnimation2), sizeof(UINT16), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->usPendingAnimation2, sizeof(usPendingAnimation2), sizeof(UINT16), numBytesRead);
|
||||||
@@ -2244,7 +2246,7 @@ BOOLEAN SOLDIERTYPE::Load(HWFILE hFile)
|
|||||||
numBytesRead = ReadFieldByField(hFile, &this->bBlockedByAnotherMercDirection, sizeof(bBlockedByAnotherMercDirection), sizeof(INT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->bBlockedByAnotherMercDirection, sizeof(bBlockedByAnotherMercDirection), sizeof(INT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->usAttackingWeapon, sizeof(usAttackingWeapon), sizeof(UINT16), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->usAttackingWeapon, sizeof(usAttackingWeapon), sizeof(UINT16), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->bWeaponMode, sizeof(bWeaponMode), sizeof(INT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->bWeaponMode, sizeof(bWeaponMode), sizeof(INT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->ubTargetID, sizeof(ubTargetID), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->ubTargetID, sizeof(ubTargetID), sizeof(UINT16), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->bAIScheduleProgress, sizeof(bAIScheduleProgress), sizeof(INT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->bAIScheduleProgress, sizeof(bAIScheduleProgress), sizeof(INT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->sOffWorldGridNo, sizeof(sOffWorldGridNo), sizeof(INT32), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->sOffWorldGridNo, sizeof(sOffWorldGridNo), sizeof(INT32), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->pAniTile, sizeof(pAniTile), 1, numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->pAniTile, sizeof(pAniTile), 1, numBytesRead);
|
||||||
@@ -2265,8 +2267,8 @@ BOOLEAN SOLDIERTYPE::Load(HWFILE hFile)
|
|||||||
numBytesRead = ReadFieldByField(hFile, &this->bOldBattleSnd, sizeof(bOldBattleSnd), sizeof(INT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->bOldBattleSnd, sizeof(bOldBattleSnd), sizeof(INT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->iBurstSoundID, sizeof(iBurstSoundID), sizeof(INT32), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->iBurstSoundID, sizeof(iBurstSoundID), sizeof(INT32), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->bSlotItemTakenFrom, sizeof(bSlotItemTakenFrom), sizeof(INT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->bSlotItemTakenFrom, sizeof(bSlotItemTakenFrom), sizeof(INT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->ubAutoBandagingMedic, sizeof(ubAutoBandagingMedic), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->ubAutoBandagingMedic, sizeof(ubAutoBandagingMedic), sizeof(UINT16), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->ubRobotRemoteHolderID, sizeof(ubRobotRemoteHolderID), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->ubRobotRemoteHolderID, sizeof(ubRobotRemoteHolderID), sizeof(UINT16), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->uiTimeOfLastContractUpdate, sizeof(uiTimeOfLastContractUpdate), sizeof(UINT32), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->uiTimeOfLastContractUpdate, sizeof(uiTimeOfLastContractUpdate), sizeof(UINT32), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->bTypeOfLastContract, sizeof(bTypeOfLastContract), sizeof(INT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->bTypeOfLastContract, sizeof(bTypeOfLastContract), sizeof(INT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->bTurnsCollapsed, sizeof(bTurnsCollapsed), sizeof(INT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->bTurnsCollapsed, sizeof(bTurnsCollapsed), sizeof(INT8), numBytesRead);
|
||||||
@@ -2285,7 +2287,7 @@ BOOLEAN SOLDIERTYPE::Load(HWFILE hFile)
|
|||||||
numBytesRead = ReadFieldByField(hFile, &this->bRegenBoostersUsedToday, sizeof(bRegenBoostersUsedToday), sizeof(INT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->bRegenBoostersUsedToday, sizeof(bRegenBoostersUsedToday), sizeof(INT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->bNumPelletsHitBy, sizeof(bNumPelletsHitBy), sizeof(INT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->bNumPelletsHitBy, sizeof(bNumPelletsHitBy), sizeof(INT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->sSkillCheckGridNo, sizeof(sSkillCheckGridNo), sizeof(INT32), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->sSkillCheckGridNo, sizeof(sSkillCheckGridNo), sizeof(INT32), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->ubLastEnemyCycledID, sizeof(ubLastEnemyCycledID), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->ubLastEnemyCycledID, sizeof(ubLastEnemyCycledID), sizeof(UINT16), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->ubPrevSectorID, sizeof(ubPrevSectorID), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->ubPrevSectorID, sizeof(ubPrevSectorID), sizeof(UINT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->ubNumTilesMovesSinceLastForget, sizeof(ubNumTilesMovesSinceLastForget), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->ubNumTilesMovesSinceLastForget, sizeof(ubNumTilesMovesSinceLastForget), sizeof(UINT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->bTurningIncrement, sizeof(bTurningIncrement), sizeof(INT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->bTurningIncrement, sizeof(bTurningIncrement), sizeof(INT8), numBytesRead);
|
||||||
@@ -2293,7 +2295,7 @@ BOOLEAN SOLDIERTYPE::Load(HWFILE hFile)
|
|||||||
numBytesRead = ReadFieldByField(hFile, &this->usValueGoneUp, sizeof(usValueGoneUp), sizeof(UINT16), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->usValueGoneUp, sizeof(usValueGoneUp), sizeof(UINT16), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->ubNumLocateCycles, sizeof(ubNumLocateCycles), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->ubNumLocateCycles, sizeof(ubNumLocateCycles), sizeof(UINT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->ubDelayedMovementFlags, sizeof(ubDelayedMovementFlags), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->ubDelayedMovementFlags, sizeof(ubDelayedMovementFlags), sizeof(UINT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->ubCTGTTargetID, sizeof(ubCTGTTargetID), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->ubCTGTTargetID, sizeof(ubCTGTTargetID), sizeof(UINT16), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->uiMercChecksum, sizeof(uiMercChecksum), sizeof(UINT32), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->uiMercChecksum, sizeof(uiMercChecksum), sizeof(UINT32), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->bCurrentCivQuote, sizeof(bCurrentCivQuote), sizeof(INT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->bCurrentCivQuote, sizeof(bCurrentCivQuote), sizeof(INT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->bCurrentCivQuoteDelta, sizeof(bCurrentCivQuoteDelta), sizeof(INT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->bCurrentCivQuoteDelta, sizeof(bCurrentCivQuoteDelta), sizeof(INT8), numBytesRead);
|
||||||
@@ -2311,7 +2313,7 @@ BOOLEAN SOLDIERTYPE::Load(HWFILE hFile)
|
|||||||
numBytesRead = ReadFieldByField(hFile, &this->ubDoorOpeningNoise, sizeof(ubDoorOpeningNoise), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->ubDoorOpeningNoise, sizeof(ubDoorOpeningNoise), sizeof(UINT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->pGroup, sizeof(pGroup), 1, numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->pGroup, sizeof(pGroup), 1, numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->ubLeaveHistoryCode, sizeof(ubLeaveHistoryCode), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->ubLeaveHistoryCode, sizeof(ubLeaveHistoryCode), sizeof(UINT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->bOverrideMoveSpeed, sizeof(bOverrideMoveSpeed), sizeof(INT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->bOverrideMoveSpeed, sizeof(bOverrideMoveSpeed), sizeof(UINT16), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->uiTimeSoldierWillArrive, sizeof(uiTimeSoldierWillArrive), sizeof(UINT32), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->uiTimeSoldierWillArrive, sizeof(uiTimeSoldierWillArrive), sizeof(UINT32), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->bVehicleUnderRepairID, sizeof(bVehicleUnderRepairID), sizeof(INT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->bVehicleUnderRepairID, sizeof(bVehicleUnderRepairID), sizeof(INT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->iTimeCanSignElsewhere, sizeof(iTimeCanSignElsewhere), sizeof(INT32), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->iTimeCanSignElsewhere, sizeof(iTimeCanSignElsewhere), sizeof(INT32), numBytesRead);
|
||||||
@@ -2324,7 +2326,7 @@ BOOLEAN SOLDIERTYPE::Load(HWFILE hFile)
|
|||||||
numBytesRead = ReadFieldByField(hFile, &this->ubLastDamageReason, sizeof(ubLastDamageReason), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->ubLastDamageReason, sizeof(ubLastDamageReason), sizeof(UINT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->sLastTwoLocations, sizeof(sLastTwoLocations), sizeof(INT32), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->sLastTwoLocations, sizeof(sLastTwoLocations), sizeof(INT32), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->uiTimeSinceLastBleedGrunt, sizeof(uiTimeSinceLastBleedGrunt), sizeof(INT32), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->uiTimeSinceLastBleedGrunt, sizeof(uiTimeSinceLastBleedGrunt), sizeof(INT32), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->ubNextToPreviousAttackerID, sizeof(ubNextToPreviousAttackerID), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->ubNextToPreviousAttackerID, sizeof(ubNextToPreviousAttackerID), sizeof(UINT16), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->bDoAutofire, sizeof(bDoAutofire), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->bDoAutofire, sizeof(bDoAutofire), sizeof(UINT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->numFlanks, sizeof(numFlanks), sizeof(INT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->numFlanks, sizeof(numFlanks), sizeof(INT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->lastFlankSpot, sizeof(lastFlankSpot), sizeof(INT32), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->lastFlankSpot, sizeof(lastFlankSpot), sizeof(INT32), numBytesRead);
|
||||||
@@ -2351,9 +2353,7 @@ BOOLEAN SOLDIERTYPE::Load(HWFILE hFile)
|
|||||||
numBytesRead = ReadFieldByField(hFile, &this->bScopeMode, sizeof(bScopeMode), sizeof(INT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->bScopeMode, sizeof(bScopeMode), sizeof(INT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->ubMilitiaAssists, sizeof(ubMilitiaAssists), sizeof(UINT8), numBytesRead );
|
numBytesRead = ReadFieldByField(hFile, &this->ubMilitiaAssists, sizeof(ubMilitiaAssists), sizeof(UINT8), numBytesRead );
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->sNonNPCTraderID, sizeof(sNonNPCTraderID), sizeof(INT8), numBytesRead );
|
numBytesRead = ReadFieldByField(hFile, &this->sNonNPCTraderID, sizeof(sNonNPCTraderID), sizeof(INT8), numBytesRead );
|
||||||
//numBytesRead = ReadFieldByField(hFile, &this->bUnusedINT8_3, sizeof(bUnusedINT8_3), sizeof(INT8), numBytesRead );
|
numBytesRead = ReadFieldByField(hFile, &this->usDragPersonID, sizeof(usDragPersonID), sizeof(UINT16), numBytesRead );
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->usDragPersonID, sizeof(usDragPersonID), sizeof(UINT8), numBytesRead );
|
|
||||||
//numBytesRead = ReadFieldByField(hFile, &this->bUnusedINT16_4, sizeof(bUnusedINT16_4), sizeof(INT16), numBytesRead );
|
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->sDragCorpseID, sizeof(sDragCorpseID), sizeof(INT16), numBytesRead );
|
numBytesRead = ReadFieldByField(hFile, &this->sDragCorpseID, sizeof(sDragCorpseID), sizeof(INT16), numBytesRead );
|
||||||
|
|
||||||
if ( guiCurrentSaveGameVersion < DRAGPERSONS )
|
if ( guiCurrentSaveGameVersion < DRAGPERSONS )
|
||||||
@@ -2472,10 +2472,10 @@ BOOLEAN SOLDIERTYPE::Load(HWFILE hFile)
|
|||||||
|
|
||||||
if ( guiCurrentSaveGameVersion >= DISEASE_SYSTEM )
|
if ( guiCurrentSaveGameVersion >= DISEASE_SYSTEM )
|
||||||
{
|
{
|
||||||
numBytesRead = ReadFieldByField( hFile, &this->sDiseasePoints, sizeof(sDiseasePoints), sizeof(INT32), numBytesRead );
|
numBytesRead = ReadFieldByField( hFile, &this->sDiseasePoints, sizeof(sDiseasePoints), sizeof(INT16), numBytesRead );
|
||||||
numBytesRead = ReadFieldByField( hFile, &this->sDiseaseFlag, sizeof(sDiseaseFlag), sizeof(UINT8), numBytesRead );
|
numBytesRead = ReadFieldByField( hFile, &this->sDiseaseFlag, sizeof(sDiseaseFlag), sizeof(UINT8), numBytesRead );
|
||||||
numBytesRead = ReadFieldByField( hFile, &this->ubFiller, sizeof( ubFiller ), sizeof( UINT8 ), numBytesRead );
|
numBytesRead = ReadFieldByField( hFile, &this->ubFiller, sizeof( ubFiller ), sizeof( UINT8 ), numBytesRead );
|
||||||
numBytesRead = ReadFieldByField( hFile, &this->ubHoursRemainingOnMiniEvent, sizeof( ubHoursRemainingOnMiniEvent), sizeof( UINT8 ), numBytesRead );
|
numBytesRead = ReadFieldByField( hFile, &this->ubHoursRemainingOnMiniEvent, sizeof( ubHoursRemainingOnMiniEvent), sizeof( UINT16 ), numBytesRead );
|
||||||
numBytesRead = ReadFieldByField( hFile, &this->usGLDelayMode, sizeof( usGLDelayMode ), sizeof( UINT8 ), numBytesRead );
|
numBytesRead = ReadFieldByField( hFile, &this->usGLDelayMode, sizeof( usGLDelayMode ), sizeof( UINT8 ), numBytesRead );
|
||||||
numBytesRead = ReadFieldByField( hFile, &this->usBarrelMode, sizeof( usBarrelMode ), sizeof( UINT8 ), numBytesRead );
|
numBytesRead = ReadFieldByField( hFile, &this->usBarrelMode, sizeof( usBarrelMode ), sizeof( UINT8 ), numBytesRead );
|
||||||
numBytesRead = ReadFieldByField( hFile, &this->usBarrelCounter, sizeof( usBarrelCounter ), sizeof( UINT8 ), numBytesRead );
|
numBytesRead = ReadFieldByField( hFile, &this->usBarrelCounter, sizeof( usBarrelCounter ), sizeof( UINT8 ), numBytesRead );
|
||||||
@@ -2607,140 +2607,6 @@ BOOLEAN SOLDIERTYPE::Load(HWFILE hFile)
|
|||||||
buffer++;
|
buffer++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*if ( guiCurrentSaveGameVersion >= FOOD_CHANGES )
|
|
||||||
{
|
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->bFoodLevel, sizeof(bFoodLevel), sizeof(INT32), numBytesRead);
|
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->bDrinkLevel, sizeof(bDrinkLevel), sizeof(INT32), numBytesRead);
|
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->usStarveDamageHealth, sizeof(usStarveDamageHealth), sizeof(UINT8), numBytesRead);
|
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->usStarveDamageStrength, sizeof(usStarveDamageStrength), sizeof(UINT8), numBytesRead);
|
|
||||||
|
|
||||||
if ( guiCurrentSaveGameVersion >= MULTITURN_ACTIONS )
|
|
||||||
{
|
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->bOverTurnAPS, sizeof(bOverTurnAPS), sizeof(INT16), numBytesRead);
|
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->sMTActionGridNo, sizeof(sMTActionGridNo), sizeof(INT32), numBytesRead);
|
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->usMultiTurnAction, sizeof(usMultiTurnAction), sizeof(UINT8), numBytesRead);
|
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->bAIIndex, sizeof(bAIIndex), sizeof(UINT16), numBytesRead);
|
|
||||||
|
|
||||||
if ( guiCurrentSaveGameVersion >= SOLDIER_PROFILES )
|
|
||||||
{
|
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->usSoldierProfile, sizeof(usSoldierProfile), sizeof(UINT16), numBytesRead);
|
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->usItemMoveSectorID, sizeof(usItemMoveSectorID), sizeof(UINT8), numBytesRead);
|
|
||||||
|
|
||||||
if ( guiCurrentSaveGameVersion >= SOLDIER_PROFILES )
|
|
||||||
{
|
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->usSkillCounter, sizeof(usSkillCounter), sizeof(UINT16), numBytesRead);
|
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->usSkillCooldown, sizeof(usSkillCooldown), sizeof(UINT32), numBytesRead);
|
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->usAISkillUse, sizeof(usAISkillUse), sizeof(UINT8), numBytesRead);
|
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->ubFiller, sizeof(ubFiller), sizeof(UINT8), numBytesRead);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for(UINT8 i = 0; i < SOLDIER_COUNTER_MAX; ++i)
|
|
||||||
this->usSkillCounter[i] = 0;
|
|
||||||
|
|
||||||
for(UINT8 i = 0; i < SOLDIER_COOLDOWN_MAX; ++i)
|
|
||||||
this->usSkillCooldown[i] = 0;
|
|
||||||
|
|
||||||
this->usAISkillUse = 0;
|
|
||||||
|
|
||||||
// as we added new variables, fillersize was reduced, here we account for that. We have to also read the existing fillers that now do not exist anymore
|
|
||||||
const UINT8 tmp = sizeof(usSkillCounter) + sizeof(usSkillCooldown) + sizeof(usAISkillUse);
|
|
||||||
UINT8 blarg[tmp];
|
|
||||||
numBytesRead = ReadFieldByField(hFile, &blarg, tmp, sizeof(UINT8), numBytesRead);
|
|
||||||
|
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->ubFiller, sizeof(ubFiller), sizeof(UINT8), numBytesRead);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this->usSoldierProfile = 0;
|
|
||||||
this->usItemMoveSectorID = 0;
|
|
||||||
|
|
||||||
// as we added new variables, fillersize was reduced, here we account for that. We have to also read the existing fillers that now do not exist anymore
|
|
||||||
const UINT8 tmp = sizeof(usSoldierProfile) + sizeof(usItemMoveSectorID);
|
|
||||||
UINT8 blarg[tmp];
|
|
||||||
numBytesRead = ReadFieldByField(hFile, &blarg, tmp, sizeof(UINT8), numBytesRead);
|
|
||||||
|
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->ubFiller, sizeof(ubFiller), sizeof(UINT8), numBytesRead);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this->bOverTurnAPS = 0;
|
|
||||||
this->sMTActionGridNo = NOWHERE;
|
|
||||||
this->usMultiTurnAction = 0;
|
|
||||||
this->bAIIndex = 0;
|
|
||||||
this->usSoldierProfile = 0;
|
|
||||||
this->usItemMoveSectorID = 0;
|
|
||||||
|
|
||||||
// as we added new variables, fillersize was reduced, here we account for that. We have to also read the existing fillers that now do not exist anymore
|
|
||||||
// +1 for padding
|
|
||||||
const UINT8 tmp = sizeof(bOverTurnAPS) + sizeof(this->sMTActionGridNo) + sizeof(usMultiTurnAction) + sizeof(bAIIndex) + 1 + sizeof(usSoldierProfile) + sizeof(usItemMoveSectorID);
|
|
||||||
UINT8 blarg[tmp];
|
|
||||||
numBytesRead = ReadFieldByField(hFile, &blarg, tmp, sizeof(UINT8), numBytesRead);
|
|
||||||
|
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->ubFiller, sizeof(ubFiller), sizeof(UINT8), numBytesRead);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//CHRISL: We have to make sure we add a buffer to account for the lack of ubInterruptCounter and that buffer needs to be a full DWORD in size
|
|
||||||
for(int i = 0; i < sizeof(bFoodLevel); ++i)
|
|
||||||
buffer++;
|
|
||||||
while((buffer%4) > 0)
|
|
||||||
buffer++;
|
|
||||||
|
|
||||||
for(int i = 0; i < sizeof(bDrinkLevel); ++i)
|
|
||||||
buffer++;
|
|
||||||
while((buffer%4) > 0)
|
|
||||||
buffer++;
|
|
||||||
|
|
||||||
for(int i = 0; i < sizeof(usStarveDamageHealth); ++i)
|
|
||||||
buffer++;
|
|
||||||
while((buffer%4) > 0)
|
|
||||||
buffer++;
|
|
||||||
|
|
||||||
for(int i = 0; i < sizeof(usStarveDamageStrength); ++i)
|
|
||||||
buffer++;
|
|
||||||
while((buffer%4) > 0)
|
|
||||||
buffer++;
|
|
||||||
|
|
||||||
for(int i = 0; i < sizeof(bOverTurnAPS); ++i)
|
|
||||||
buffer++;
|
|
||||||
while((buffer%4) > 0)
|
|
||||||
buffer++;
|
|
||||||
|
|
||||||
for(int i = 0; i < sizeof(sMTActionGridNo); ++i)
|
|
||||||
buffer++;
|
|
||||||
while((buffer%4) > 0)
|
|
||||||
buffer++;
|
|
||||||
|
|
||||||
for(int i = 0; i < sizeof(usMultiTurnAction); ++i)
|
|
||||||
buffer++;
|
|
||||||
while((buffer%4) > 0)
|
|
||||||
buffer++;
|
|
||||||
|
|
||||||
for(int i = 0; i < sizeof(bAIIndex); ++i)
|
|
||||||
buffer++;
|
|
||||||
while((buffer%4) > 0)
|
|
||||||
buffer++;
|
|
||||||
|
|
||||||
for(int i = 0; i < sizeof(usSoldierProfile); ++i)
|
|
||||||
buffer++;
|
|
||||||
while((buffer%4) > 0)
|
|
||||||
buffer++;
|
|
||||||
|
|
||||||
for(int i = 0; i < sizeof(usItemMoveSectorID); ++i)
|
|
||||||
buffer++;
|
|
||||||
while((buffer%4) > 0)
|
|
||||||
buffer++;
|
|
||||||
|
|
||||||
for(int i = 0; i < sizeof(ubFiller); ++i)
|
|
||||||
buffer++;
|
|
||||||
while((buffer%4) > 0)
|
|
||||||
buffer++;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
#ifdef JA2UB
|
#ifdef JA2UB
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->fIgnoreGetupFromCollapseCheck, sizeof(fIgnoreGetupFromCollapseCheck), sizeof(BOOLEAN), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->fIgnoreGetupFromCollapseCheck, sizeof(fIgnoreGetupFromCollapseCheck), sizeof(BOOLEAN), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->GetupFromJA25StartCounter, sizeof(GetupFromJA25StartCounter), sizeof(TIMECOUNTER), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->GetupFromJA25StartCounter, sizeof(GetupFromJA25StartCounter), sizeof(TIMECOUNTER), numBytesRead);
|
||||||
@@ -2748,38 +2614,9 @@ BOOLEAN SOLDIERTYPE::Load(HWFILE hFile)
|
|||||||
numBytesRead = ReadFieldByField(hFile, &this->ubPercentDamageInflictedByTeam, sizeof(ubPercentDamageInflictedByTeam), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->ubPercentDamageInflictedByTeam, sizeof(ubPercentDamageInflictedByTeam), sizeof(UINT8), numBytesRead);
|
||||||
#endif
|
#endif
|
||||||
numBytesRead += buffer;
|
numBytesRead += buffer;
|
||||||
if(numBytesRead != SIZEOF_SOLDIERTYPE_POD)
|
const UINT32 PODsize = SIZEOF_SOLDIERTYPE_POD;
|
||||||
|
if(numBytesRead != PODsize)
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
/* //CHRISL: It was further changed at version 104 to allow for 16bit action points for the 100AP system
|
|
||||||
//first, load the POD
|
|
||||||
if ( guiCurrentSaveGameVersion >= AP100_SAVEGAME_DATATYPE_CHANGE )
|
|
||||||
{
|
|
||||||
if ( !FileRead( hFile, this, SIZEOF_SOLDIERTYPE_POD, &uiNumBytesRead ) )
|
|
||||||
{
|
|
||||||
return(FALSE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
numBytesRead = 0;
|
|
||||||
FileRead( hFile, this, (offsetof(SOLDIERTYPE, ubBodyType)+sizeof(ubBodyType)), &uiNumBytesRead );
|
|
||||||
numBytesRead += uiNumBytesRead;
|
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->bActionPoints, 1, 1, numBytesRead);
|
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->bInitialActionPoints, 1, 1, numBytesRead);
|
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->bOldLife, sizeof(bOldLife), sizeof(INT8), numBytesRead);
|
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->bVisible, sizeof(bVisible), sizeof(INT8), numBytesRead);
|
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->bActive, sizeof(bActive), sizeof(INT8), numBytesRead);
|
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->bTeam, sizeof(bTeam), sizeof(INT8), numBytesRead);
|
|
||||||
//CHRISL: in the old structure, there are 3 padding bytes at this point in the file. We need to account for
|
|
||||||
// them before continuing. We also want to include them in our numBytesRead since they cover the changes
|
|
||||||
// caused by increasing two elements by 1byte each. This includes shifting one byte of padding
|
|
||||||
FileRead( hFile, padding, 3, &uiNumBytesRead );
|
|
||||||
numBytesRead += uiNumBytesRead;
|
|
||||||
FileRead( hFile, &this->pTempObject, (SIZEOF_SOLDIERTYPE_POD-numBytesRead), &uiNumBytesRead );
|
|
||||||
numBytesRead += uiNumBytesRead;
|
|
||||||
if(numBytesRead != SIZEOF_SOLDIERTYPE_POD)
|
|
||||||
return(FALSE);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
//load the OO inventory
|
//load the OO inventory
|
||||||
if ( !this->inv.Load(hFile) )
|
if ( !this->inv.Load(hFile) )
|
||||||
@@ -2817,7 +2654,7 @@ BOOLEAN SOLDIERTYPE::Load(HWFILE hFile)
|
|||||||
numBytesRead = ReadFieldByField(hFile, &this->aiData.sNoiseGridno, sizeof(aiData.sNoiseGridno), sizeof(INT32), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->aiData.sNoiseGridno, sizeof(aiData.sNoiseGridno), sizeof(INT32), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->aiData.ubNoiseVolume, sizeof(aiData.ubNoiseVolume), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->aiData.ubNoiseVolume, sizeof(aiData.ubNoiseVolume), sizeof(UINT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->aiData.bLastAttackHit, sizeof(aiData.bLastAttackHit), sizeof(INT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->aiData.bLastAttackHit, sizeof(aiData.bLastAttackHit), sizeof(INT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->aiData.ubXRayedBy, sizeof(aiData.ubXRayedBy), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->aiData.ubXRayedBy, sizeof(aiData.ubXRayedBy), sizeof(UINT16), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->aiData.dHeightAdjustment, sizeof(aiData.dHeightAdjustment), sizeof(FLOAT), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->aiData.dHeightAdjustment, sizeof(aiData.dHeightAdjustment), sizeof(FLOAT), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->aiData.bMorale, sizeof(aiData.bMorale), sizeof(INT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->aiData.bMorale, sizeof(aiData.bMorale), sizeof(INT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->aiData.bTeamMoraleMod, sizeof(aiData.bTeamMoraleMod), sizeof(INT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->aiData.bTeamMoraleMod, sizeof(aiData.bTeamMoraleMod), sizeof(INT8), numBytesRead);
|
||||||
@@ -2840,7 +2677,7 @@ BOOLEAN SOLDIERTYPE::Load(HWFILE hFile)
|
|||||||
numBytesRead = ReadFieldByField(hFile, &this->aiData.bMoved, sizeof(aiData.bMoved), sizeof(INT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->aiData.bMoved, sizeof(aiData.bMoved), sizeof(INT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->aiData.bHunting, sizeof(aiData.bHunting), sizeof(INT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->aiData.bHunting, sizeof(aiData.bHunting), sizeof(INT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->aiData.ubLastCall, sizeof(aiData.ubLastCall), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->aiData.ubLastCall, sizeof(aiData.ubLastCall), sizeof(UINT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->aiData.ubCaller, sizeof(aiData.ubCaller), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->aiData.ubCaller, sizeof(aiData.ubCaller), sizeof(UINT16), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->aiData.sCallerGridNo, sizeof(aiData.sCallerGridNo), sizeof(INT32), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->aiData.sCallerGridNo, sizeof(aiData.sCallerGridNo), sizeof(INT32), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->aiData.bCallPriority, sizeof(aiData.bCallPriority), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->aiData.bCallPriority, sizeof(aiData.bCallPriority), sizeof(UINT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->aiData.bCallActedUpon, sizeof(aiData.bCallActedUpon), sizeof(INT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->aiData.bCallActedUpon, sizeof(aiData.bCallActedUpon), sizeof(INT8), numBytesRead);
|
||||||
@@ -3072,9 +2909,14 @@ BOOLEAN WORLDITEM::Load(INT8** hBuffer, float dMajorMapVersion, UINT8 ubMinorMap
|
|||||||
LOADDATA(&oldWorldItem, *hBuffer, _OLD_SIZEOF_WORLDITEM_POD);
|
LOADDATA(&oldWorldItem, *hBuffer, _OLD_SIZEOF_WORLDITEM_POD);
|
||||||
*this = oldWorldItem;
|
*this = oldWorldItem;
|
||||||
}
|
}
|
||||||
|
else if (dMajorMapVersion < 8.0)
|
||||||
|
{
|
||||||
|
LOADDATA(this, *hBuffer, _SIZEOF_WORLDITEM_INT8_ID_POD);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
LOADDATA(this, *hBuffer, SIZEOF_WORLDITEM_POD);
|
LOADDATA(this, *hBuffer, SIZEOF_WORLDITEM_POD);
|
||||||
|
}
|
||||||
// Load the OO OBJECTTYPE
|
// Load the OO OBJECTTYPE
|
||||||
this->object.Load(hBuffer, dMajorMapVersion, ubMinorMapVersion);
|
this->object.Load(hBuffer, dMajorMapVersion, ubMinorMapVersion);
|
||||||
}
|
}
|
||||||
@@ -3186,15 +3028,24 @@ BOOLEAN StackedObjectData::Load( INT8** hBuffer, float dMajorMapVersion, UINT8 u
|
|||||||
{
|
{
|
||||||
int size;
|
int size;
|
||||||
|
|
||||||
if (dMajorMapVersion >= 7 && ubMinorMapVersion >= MINOR_MAP_VERSION)
|
if (dMajorMapVersion >= 8 && ubMinorMapVersion >= MINOR_MAP_VERSION)
|
||||||
|
{
|
||||||
|
// Deal with Increased Team Sizes data
|
||||||
|
LOADDATA(&(this->data), *hBuffer, sizeof(ObjectData) );
|
||||||
|
}
|
||||||
|
else if (dMajorMapVersion >= 7 && ubMinorMapVersion >= MINOR_MAP_VERSION)
|
||||||
{
|
{
|
||||||
// Flugente: changed this, otherwise game would crash when reading WF maps if class ObjectData was different. this is a rough fix and by no means perfect
|
// Flugente: changed this, otherwise game would crash when reading WF maps if class ObjectData was different. this is a rough fix and by no means perfect
|
||||||
LOADDATA(&(this->data), *hBuffer, sizeof(ObjectData) );
|
ObjectData_PRE_ITS oldData{};
|
||||||
|
LOADDATA(&(oldData), *hBuffer, sizeof(ObjectData_PRE_ITS));
|
||||||
|
this->data = oldData;
|
||||||
}
|
}
|
||||||
else if (dMajorMapVersion >= 7 && ubMinorMapVersion >= MINOR_MAP_REPAIR_SYSTEM)
|
else if (dMajorMapVersion >= 7 && ubMinorMapVersion >= MINOR_MAP_REPAIR_SYSTEM)
|
||||||
{
|
{
|
||||||
// sObjectFlag' size changed
|
// sObjectFlag' size changed
|
||||||
LOADDATA(&(this->data), *hBuffer, sizeof(ObjectData) - sizeof(this->data.sObjectFlag) );
|
ObjectData_PRE_ITS oldData;
|
||||||
|
LOADDATA(&(oldData), *hBuffer, sizeof(ObjectData_PRE_ITS) - sizeof(oldData.sObjectFlag));
|
||||||
|
this->data = oldData;
|
||||||
}
|
}
|
||||||
// When saving maps with the new map editor that has weapon overheated feature included!
|
// When saving maps with the new map editor that has weapon overheated feature included!
|
||||||
else if (dMajorMapVersion >= 7 && ubMinorMapVersion >= MINOR_MAP_OVERHEATING)
|
else if (dMajorMapVersion >= 7 && ubMinorMapVersion >= MINOR_MAP_OVERHEATING)
|
||||||
@@ -3205,14 +3056,18 @@ BOOLEAN StackedObjectData::Load( INT8** hBuffer, float dMajorMapVersion, UINT8 u
|
|||||||
// But of course, we now 'read' the values for sRepairThreshold, but there weren't any in older map versions, resulting in garbage values - we therefore set that manually to 100
|
// But of course, we now 'read' the values for sRepairThreshold, but there weren't any in older map versions, resulting in garbage values - we therefore set that manually to 100
|
||||||
// Of course, once the ObjectData-Class is altered, this has to be altered as well!
|
// Of course, once the ObjectData-Class is altered, this has to be altered as well!
|
||||||
//dnl ch74 241013 We cannot change past so hardcode 32 simply because that was sizeof(ObjectData) before current and all future changes ;-)
|
//dnl ch74 241013 We cannot change past so hardcode 32 simply because that was sizeof(ObjectData) before current and all future changes ;-)
|
||||||
LOADDATA(&(this->data), *hBuffer, /*sizeof(ObjectData) - (sizeof(this->data.bDirtLevel) + sizeof(this->data.sObjectFlag) )*/32);
|
ObjectData_PRE_ITS oldData{};
|
||||||
|
LOADDATA(&(oldData), *hBuffer, 32);
|
||||||
|
this->data = oldData;
|
||||||
this->data.sRepairThreshold = 100;
|
this->data.sRepairThreshold = 100;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// WF Maps have old format
|
// WF Maps have old format
|
||||||
// +1 because we have to account for endOfPOD itself
|
// +1 because we have to account for endOfPOD itself
|
||||||
LOADDATA(&(this->data), *hBuffer, SIZEOF_OBJECTDATA_POD+1 );
|
ObjectData_PRE_ITS oldData{};
|
||||||
|
LOADDATA(&(oldData), *hBuffer, SIZEOF_OBJECTDATA_POD_PRE_ITS + 1);
|
||||||
|
this->data = oldData;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOADDATA(&size, *hBuffer, sizeof(int) );
|
LOADDATA(&size, *hBuffer, sizeof(int) );
|
||||||
@@ -6645,7 +6500,7 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
|
|||||||
if( gTacticalStatus.ubAttackBusyCount > 1 )
|
if( gTacticalStatus.ubAttackBusyCount > 1 )
|
||||||
{
|
{
|
||||||
//Lock the ui
|
//Lock the ui
|
||||||
SetUIBusy( (UINT8)gusSelectedSoldier );
|
SetUIBusy( gusSelectedSoldier );
|
||||||
}
|
}
|
||||||
// OJW - 20090403 - Fix Tactical Interface is still locked after quick-load
|
// OJW - 20090403 - Fix Tactical Interface is still locked after quick-load
|
||||||
else
|
else
|
||||||
@@ -6890,9 +6745,9 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
|
|||||||
|
|
||||||
// player team character fixes
|
// player team character fixes
|
||||||
SOLDIERTYPE *pTeamSoldier;
|
SOLDIERTYPE *pTeamSoldier;
|
||||||
for (INT8 bLoop=gTacticalStatus.Team[gbPlayerNum].bFirstID; bLoop <= gTacticalStatus.Team[gbPlayerNum].bLastID; bLoop++)
|
for (SoldierID bLoop = gTacticalStatus.Team[gbPlayerNum].bFirstID; bLoop <= gTacticalStatus.Team[gbPlayerNum].bLastID; ++bLoop)
|
||||||
{
|
{
|
||||||
pTeamSoldier=MercPtrs[bLoop];
|
pTeamSoldier = bLoop;
|
||||||
|
|
||||||
// silversurfer: added additional check to only remove the flags when there is no boxing activity going on at the moment.
|
// silversurfer: added additional check to only remove the flags when there is no boxing activity going on at the moment.
|
||||||
// WANNE: This should fix the bug if any merc are still under PC control. This could happen after boxing in SAN MONA.
|
// WANNE: This should fix the bug if any merc are still under PC control. This could happen after boxing in SAN MONA.
|
||||||
@@ -7085,12 +6940,12 @@ BOOLEAN SaveSoldierStructure( HWFILE hFile )
|
|||||||
|
|
||||||
BOOLEAN LoadSoldierStructure( HWFILE hFile )
|
BOOLEAN LoadSoldierStructure( HWFILE hFile )
|
||||||
{
|
{
|
||||||
UINT16 cnt;
|
UINT16 cnt;
|
||||||
UINT32 uiNumBytesRead=0;
|
UINT32 uiNumBytesRead=0;
|
||||||
UINT8 ubId;
|
SoldierID ubId;
|
||||||
UINT8 ubOne = 1;
|
UINT8 ubOne = 1;
|
||||||
UINT8 ubActive = 1;
|
UINT8 ubActive = 1;
|
||||||
UINT32 uiPercentage;
|
UINT32 uiPercentage;
|
||||||
SOLDIERTYPE SavedSoldierInfo;
|
SOLDIERTYPE SavedSoldierInfo;
|
||||||
|
|
||||||
//Loop through all the soldier and delete them all
|
//Loop through all the soldier and delete them all
|
||||||
@@ -7820,13 +7675,13 @@ BOOLEAN LoadTacticalStatusFromSavedGame( HWFILE hFile )
|
|||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.Team, sizeof(gTacticalStatus.Team), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.Team, sizeof(gTacticalStatus.Team), sizeof(UINT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubCurrentTeam, sizeof(gTacticalStatus.ubCurrentTeam), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubCurrentTeam, sizeof(gTacticalStatus.ubCurrentTeam), sizeof(UINT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.sSlideTarget, sizeof(gTacticalStatus.sSlideTarget), sizeof(INT32), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.sSlideTarget, sizeof(gTacticalStatus.sSlideTarget), sizeof(INT32), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.sSlideReason, sizeof(gTacticalStatus.sSlideReason), sizeof(INT16), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.sSlideReason_UNUSED, sizeof(gTacticalStatus.sSlideReason_UNUSED), sizeof(INT16), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.uiTimeSinceMercAIStart, sizeof(gTacticalStatus.uiTimeSinceMercAIStart), sizeof(UINT32), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.uiTimeSinceMercAIStart, sizeof(gTacticalStatus.uiTimeSinceMercAIStart), sizeof(UINT32), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.fPanicFlags, sizeof(gTacticalStatus.fPanicFlags), sizeof(INT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.fPanicFlags, sizeof(gTacticalStatus.fPanicFlags), sizeof(INT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.sPanicTriggerGridNoUnused, sizeof(gTacticalStatus.sPanicTriggerGridNoUnused), sizeof(INT32), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.sPanicTriggerGridNoUnused, sizeof(gTacticalStatus.sPanicTriggerGridNoUnused), sizeof(INT32), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.sHandGrid, sizeof(gTacticalStatus.sHandGrid), sizeof(INT16), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.sHandGrid, sizeof(gTacticalStatus.sHandGrid), sizeof(INT16), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubSpottersCalledForBy, sizeof(gTacticalStatus.ubSpottersCalledForBy), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubSpottersCalledForBy, sizeof(gTacticalStatus.ubSpottersCalledForBy), sizeof(UINT16), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubTheChosenOne, sizeof(gTacticalStatus.ubTheChosenOne), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubTheChosenOne, sizeof(gTacticalStatus.ubTheChosenOne), sizeof(UINT16), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.uiTimeOfLastInput, sizeof(gTacticalStatus.uiTimeOfLastInput), sizeof(UINT32), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.uiTimeOfLastInput, sizeof(gTacticalStatus.uiTimeOfLastInput), sizeof(UINT32), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.uiTimeSinceDemoOn, sizeof(gTacticalStatus.uiTimeSinceDemoOn), sizeof(UINT32), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.uiTimeSinceDemoOn, sizeof(gTacticalStatus.uiTimeSinceDemoOn), sizeof(UINT32), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.uiCountdownToRestart, sizeof(gTacticalStatus.uiCountdownToRestart), sizeof(UINT32), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.uiCountdownToRestart, sizeof(gTacticalStatus.uiCountdownToRestart), sizeof(UINT32), numBytesRead);
|
||||||
@@ -7845,13 +7700,13 @@ BOOLEAN LoadTacticalStatusFromSavedGame( HWFILE hFile )
|
|||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.bRealtimeSpeed, sizeof(gTacticalStatus.bRealtimeSpeed), sizeof(INT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.bRealtimeSpeed, sizeof(gTacticalStatus.bRealtimeSpeed), sizeof(INT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubEnemyIntention, sizeof(gTacticalStatus.ubEnemyIntention), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubEnemyIntention, sizeof(gTacticalStatus.ubEnemyIntention), sizeof(UINT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubEnemyIntendedRetreatDirection, sizeof(gTacticalStatus.ubEnemyIntendedRetreatDirection), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubEnemyIntendedRetreatDirection, sizeof(gTacticalStatus.ubEnemyIntendedRetreatDirection), sizeof(UINT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubEnemySightingOnTheirTurnEnemyID, sizeof(gTacticalStatus.ubEnemySightingOnTheirTurnEnemyID), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubEnemySightingOnTheirTurnEnemyID, sizeof(gTacticalStatus.ubEnemySightingOnTheirTurnEnemyID), sizeof(UINT16), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubEnemySightingOnTheirTurnPlayerID, sizeof(gTacticalStatus.ubEnemySightingOnTheirTurnPlayerID), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubEnemySightingOnTheirTurnPlayerID, sizeof(gTacticalStatus.ubEnemySightingOnTheirTurnPlayerID), sizeof(UINT16), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.fEnemySightingOnTheirTurn, sizeof(gTacticalStatus.fEnemySightingOnTheirTurn), sizeof(BOOLEAN), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.fEnemySightingOnTheirTurn, sizeof(gTacticalStatus.fEnemySightingOnTheirTurn), sizeof(BOOLEAN), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.fAutoBandageMode, sizeof(gTacticalStatus.fAutoBandageMode), sizeof(BOOLEAN), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.fAutoBandageMode, sizeof(gTacticalStatus.fAutoBandageMode), sizeof(BOOLEAN), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubAttackBusyCount, sizeof(gTacticalStatus.ubAttackBusyCount), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubAttackBusyCount, sizeof(gTacticalStatus.ubAttackBusyCount), sizeof(UINT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.bNumEnemiesFoughtInBattleUnused, sizeof(gTacticalStatus.bNumEnemiesFoughtInBattleUnused), sizeof(INT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.bNumEnemiesFoughtInBattleUnused, sizeof(gTacticalStatus.bNumEnemiesFoughtInBattleUnused), sizeof(INT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubEngagedInConvFromActionMercID, sizeof(gTacticalStatus.ubEngagedInConvFromActionMercID), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubEngagedInConvFromActionMercID, sizeof(gTacticalStatus.ubEngagedInConvFromActionMercID), sizeof(UINT16), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.usTactialTurnLimitCounter, sizeof(gTacticalStatus.usTactialTurnLimitCounter), sizeof(UINT16), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.usTactialTurnLimitCounter, sizeof(gTacticalStatus.usTactialTurnLimitCounter), sizeof(UINT16), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.fInTopMessage, sizeof(gTacticalStatus.fInTopMessage), sizeof(BOOLEAN), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.fInTopMessage, sizeof(gTacticalStatus.fInTopMessage), sizeof(BOOLEAN), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubTopMessageType, sizeof(gTacticalStatus.ubTopMessageType), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubTopMessageType, sizeof(gTacticalStatus.ubTopMessageType), sizeof(UINT8), numBytesRead);
|
||||||
@@ -7869,7 +7724,7 @@ BOOLEAN LoadTacticalStatusFromSavedGame( HWFILE hFile )
|
|||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.fSaidCreatureFlavourQuote, sizeof(gTacticalStatus.fSaidCreatureFlavourQuote), sizeof(BOOLEAN), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.fSaidCreatureFlavourQuote, sizeof(gTacticalStatus.fSaidCreatureFlavourQuote), sizeof(BOOLEAN), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.fHaveSeenCreature, sizeof(gTacticalStatus.fHaveSeenCreature), sizeof(BOOLEAN), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.fHaveSeenCreature, sizeof(gTacticalStatus.fHaveSeenCreature), sizeof(BOOLEAN), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.fKilledEnemyOnAttack, sizeof(gTacticalStatus.fKilledEnemyOnAttack), sizeof(BOOLEAN), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.fKilledEnemyOnAttack, sizeof(gTacticalStatus.fKilledEnemyOnAttack), sizeof(BOOLEAN), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubEnemyKilledOnAttack, sizeof(gTacticalStatus.ubEnemyKilledOnAttack), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubEnemyKilledOnAttack, sizeof(gTacticalStatus.ubEnemyKilledOnAttack), sizeof(UINT16), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.bEnemyKilledOnAttackLevel, sizeof(gTacticalStatus.bEnemyKilledOnAttackLevel), sizeof(INT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.bEnemyKilledOnAttackLevel, sizeof(gTacticalStatus.bEnemyKilledOnAttackLevel), sizeof(INT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubEnemyKilledOnAttackLocation, sizeof(gTacticalStatus.ubEnemyKilledOnAttackLocation), sizeof(UINT16), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubEnemyKilledOnAttackLocation, sizeof(gTacticalStatus.ubEnemyKilledOnAttackLocation), sizeof(UINT16), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.fItemsSeenOnAttack, sizeof(gTacticalStatus.fItemsSeenOnAttack), sizeof(BOOLEAN), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.fItemsSeenOnAttack, sizeof(gTacticalStatus.fItemsSeenOnAttack), sizeof(BOOLEAN), numBytesRead);
|
||||||
@@ -7883,7 +7738,7 @@ BOOLEAN LoadTacticalStatusFromSavedGame( HWFILE hFile )
|
|||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.fCantGetThrough, sizeof(gTacticalStatus.fCantGetThrough), sizeof(BOOLEAN), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.fCantGetThrough, sizeof(gTacticalStatus.fCantGetThrough), sizeof(BOOLEAN), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.sCantGetThroughGridNo, sizeof(gTacticalStatus.sCantGetThroughGridNo), sizeof(INT32), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.sCantGetThroughGridNo, sizeof(gTacticalStatus.sCantGetThroughGridNo), sizeof(INT32), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.sCantGetThroughSoldierGridNo, sizeof(gTacticalStatus.sCantGetThroughSoldierGridNo), sizeof(INT32), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.sCantGetThroughSoldierGridNo, sizeof(gTacticalStatus.sCantGetThroughSoldierGridNo), sizeof(INT32), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubCantGetThroughID, sizeof(gTacticalStatus.ubCantGetThroughID), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubCantGetThroughID, sizeof(gTacticalStatus.ubCantGetThroughID), sizeof(UINT16), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.fDidGameJustStart, sizeof(gTacticalStatus.fDidGameJustStart), sizeof(BOOLEAN), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.fDidGameJustStart, sizeof(gTacticalStatus.fDidGameJustStart), sizeof(BOOLEAN), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.fStatChangeCheatOn, sizeof(gTacticalStatus.fStatChangeCheatOn), sizeof(BOOLEAN), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.fStatChangeCheatOn, sizeof(gTacticalStatus.fStatChangeCheatOn), sizeof(BOOLEAN), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubLastRequesterTargetID, sizeof(gTacticalStatus.ubLastRequesterTargetID), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubLastRequesterTargetID, sizeof(gTacticalStatus.ubLastRequesterTargetID), sizeof(UINT8), numBytesRead);
|
||||||
@@ -7897,25 +7752,24 @@ BOOLEAN LoadTacticalStatusFromSavedGame( HWFILE hFile )
|
|||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.fHasAGameBeenStarted, sizeof(gTacticalStatus.fHasAGameBeenStarted), sizeof(BOOLEAN), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.fHasAGameBeenStarted, sizeof(gTacticalStatus.fHasAGameBeenStarted), sizeof(BOOLEAN), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.bConsNumTurnsWeHaventSeenButEnemyDoes, sizeof(gTacticalStatus.bConsNumTurnsWeHaventSeenButEnemyDoes), sizeof(INT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.bConsNumTurnsWeHaventSeenButEnemyDoes, sizeof(gTacticalStatus.bConsNumTurnsWeHaventSeenButEnemyDoes), sizeof(INT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.fSomeoneHit, sizeof(gTacticalStatus.fSomeoneHit), sizeof(BOOLEAN), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.fSomeoneHit, sizeof(gTacticalStatus.fSomeoneHit), sizeof(BOOLEAN), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubPaddingSmall, sizeof(gTacticalStatus.ubPaddingSmall), sizeof(UINT8), numBytesRead);
|
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.uiTimeSinceLastOpplistDecay, sizeof(gTacticalStatus.uiTimeSinceLastOpplistDecay), sizeof(UINT32), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.uiTimeSinceLastOpplistDecay, sizeof(gTacticalStatus.uiTimeSinceLastOpplistDecay), sizeof(UINT32), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.bMercArrivingQuoteBeingUsed, sizeof(gTacticalStatus.bMercArrivingQuoteBeingUsed), sizeof(INT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.bMercArrivingQuoteBeingUsed, sizeof(gTacticalStatus.bMercArrivingQuoteBeingUsed), sizeof(INT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubEnemyKilledOnAttackKiller, sizeof(gTacticalStatus.ubEnemyKilledOnAttackKiller), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubEnemyKilledOnAttackKiller, sizeof(gTacticalStatus.ubEnemyKilledOnAttackKiller), sizeof(UINT16), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.fCountingDownForGuideDescription, sizeof(gTacticalStatus.fCountingDownForGuideDescription), sizeof(BOOLEAN), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.fCountingDownForGuideDescription, sizeof(gTacticalStatus.fCountingDownForGuideDescription), sizeof(BOOLEAN), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.bGuideDescriptionCountDown, sizeof(gTacticalStatus.bGuideDescriptionCountDown), sizeof(INT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.bGuideDescriptionCountDown, sizeof(gTacticalStatus.bGuideDescriptionCountDown), sizeof(INT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubGuideDescriptionToUse, sizeof(gTacticalStatus.ubGuideDescriptionToUse), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubGuideDescriptionToUse, sizeof(gTacticalStatus.ubGuideDescriptionToUse), sizeof(UINT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.bGuideDescriptionSectorX, sizeof(gTacticalStatus.bGuideDescriptionSectorX), sizeof(INT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.bGuideDescriptionSectorX, sizeof(gTacticalStatus.bGuideDescriptionSectorX), sizeof(INT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.bGuideDescriptionSectorY, sizeof(gTacticalStatus.bGuideDescriptionSectorY), sizeof(INT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.bGuideDescriptionSectorY, sizeof(gTacticalStatus.bGuideDescriptionSectorY), sizeof(INT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.fEnemyFlags, sizeof(gTacticalStatus.fEnemyFlags), sizeof(INT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.fEnemyFlags, sizeof(gTacticalStatus.fEnemyFlags), sizeof(INT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus. fAutoBandagePending, sizeof(gTacticalStatus. fAutoBandagePending), sizeof(BOOLEAN), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.fAutoBandagePending, sizeof(gTacticalStatus. fAutoBandagePending), sizeof(BOOLEAN), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus. fHasEnteredCombatModeSinceEntering, sizeof(gTacticalStatus. fHasEnteredCombatModeSinceEntering), sizeof(BOOLEAN), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.fHasEnteredCombatModeSinceEntering, sizeof(gTacticalStatus. fHasEnteredCombatModeSinceEntering), sizeof(BOOLEAN), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus. fDontAddNewCrows, sizeof(gTacticalStatus. fDontAddNewCrows), sizeof(BOOLEAN), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.fDontAddNewCrows, sizeof(gTacticalStatus. fDontAddNewCrows), sizeof(BOOLEAN), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubMorePadding, sizeof(gTacticalStatus.ubMorePadding), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubMorePadding, sizeof(gTacticalStatus.ubMorePadding), sizeof(UINT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.sCreatureTenseQuoteDelay, sizeof(gTacticalStatus.sCreatureTenseQuoteDelay), sizeof(UINT16), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.sCreatureTenseQuoteDelay, sizeof(gTacticalStatus.sCreatureTenseQuoteDelay), sizeof(UINT16), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.uiCreatureTenseQuoteLastUpdate, sizeof(gTacticalStatus.uiCreatureTenseQuoteLastUpdate), sizeof(UINT32), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.uiCreatureTenseQuoteLastUpdate, sizeof(gTacticalStatus.uiCreatureTenseQuoteLastUpdate), sizeof(UINT32), numBytesRead);
|
||||||
if ( guiCurrentSaveGameVersion >= BUGFIX_NPC_DATA_FOR_BIG_MAPS )
|
if ( guiCurrentSaveGameVersion >= BUGFIX_NPC_DATA_FOR_BIG_MAPS )
|
||||||
{
|
{
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubLastRequesterSurgeryTargetID, sizeof(gTacticalStatus.ubLastRequesterSurgeryTargetID), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubLastRequesterSurgeryTargetID, sizeof(gTacticalStatus.ubLastRequesterSurgeryTargetID), sizeof(UINT16), numBytesRead);
|
||||||
if ( guiCurrentSaveGameVersion >= IMPROVED_INTERRUPT_SYSTEM )
|
if ( guiCurrentSaveGameVersion >= IMPROVED_INTERRUPT_SYSTEM )
|
||||||
{
|
{
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubInterruptPending, sizeof(gTacticalStatus.ubInterruptPending), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubInterruptPending, sizeof(gTacticalStatus.ubInterruptPending), sizeof(UINT8), numBytesRead);
|
||||||
@@ -8361,7 +8215,7 @@ void CreateSavedGameFileNameFromNumber( UINT8 ubSaveGameID, STR pzNewFileName )
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
BOOLEAN SaveMercPathFromSoldierStruct( HWFILE hFile, UINT8 ubID )
|
BOOLEAN SaveMercPathFromSoldierStruct( HWFILE hFile, UINT16 ubID )
|
||||||
{
|
{
|
||||||
UINT32 uiNumOfNodes=0;
|
UINT32 uiNumOfNodes=0;
|
||||||
PathStPtr pTempPath = Menptr[ ubID ].pMercPath;
|
PathStPtr pTempPath = Menptr[ ubID ].pMercPath;
|
||||||
@@ -8402,7 +8256,7 @@ BOOLEAN SaveMercPathFromSoldierStruct( HWFILE hFile, UINT8 ubID )
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
BOOLEAN LoadMercPathToSoldierStruct( HWFILE hFile, UINT8 ubID )
|
BOOLEAN LoadMercPathToSoldierStruct( HWFILE hFile, UINT16 ubID )
|
||||||
{
|
{
|
||||||
UINT32 uiNumOfNodes=0;
|
UINT32 uiNumOfNodes=0;
|
||||||
PathStPtr pTempPath = NULL;
|
PathStPtr pTempPath = NULL;
|
||||||
@@ -8665,7 +8519,7 @@ BOOLEAN SaveGeneralInfo( HWFILE hFile )
|
|||||||
if( pContractReHireSoldier != NULL )
|
if( pContractReHireSoldier != NULL )
|
||||||
sGeneralInfo.sContractRehireSoldierID = pContractReHireSoldier->ubID;
|
sGeneralInfo.sContractRehireSoldierID = pContractReHireSoldier->ubID;
|
||||||
else
|
else
|
||||||
sGeneralInfo.sContractRehireSoldierID = -1;
|
sGeneralInfo.sContractRehireSoldierID = NOBODY;
|
||||||
|
|
||||||
memcpy( &sGeneralInfo.GameOptions, &gGameOptions, sizeof( GAME_OPTIONS ) );
|
memcpy( &sGeneralInfo.GameOptions, &gGameOptions, sizeof( GAME_OPTIONS ) );
|
||||||
#ifndef BMP_RANDOM//dnl ch55 111009
|
#ifndef BMP_RANDOM//dnl ch55 111009
|
||||||
@@ -8685,7 +8539,7 @@ BOOLEAN SaveGeneralInfo( HWFILE hFile )
|
|||||||
if( gpSMCurrentMerc )
|
if( gpSMCurrentMerc )
|
||||||
sGeneralInfo.ubSMCurrentMercID = gpSMCurrentMerc->ubID;
|
sGeneralInfo.ubSMCurrentMercID = gpSMCurrentMerc->ubID;
|
||||||
else
|
else
|
||||||
sGeneralInfo.ubSMCurrentMercID = 255;
|
sGeneralInfo.ubSMCurrentMercID = NOBODY;
|
||||||
|
|
||||||
//Save the fact that it is the first time in mapscreen
|
//Save the fact that it is the first time in mapscreen
|
||||||
sGeneralInfo.fFirstTimeInMapScreen = fFirstTimeInMapScreen;
|
sGeneralInfo.fFirstTimeInMapScreen = fFirstTimeInMapScreen;
|
||||||
@@ -8696,7 +8550,7 @@ BOOLEAN SaveGeneralInfo( HWFILE hFile )
|
|||||||
|
|
||||||
// Save boxing info
|
// Save boxing info
|
||||||
memcpy( &sGeneralInfo.sBoxerGridNo, &gsBoxerGridNo, NUM_BOXERS * sizeof( INT32 ) );
|
memcpy( &sGeneralInfo.sBoxerGridNo, &gsBoxerGridNo, NUM_BOXERS * sizeof( INT32 ) );
|
||||||
memcpy( &sGeneralInfo.ubBoxerID, &gubBoxerID, NUM_BOXERS * sizeof( INT8 ) );
|
memcpy( &sGeneralInfo.ubBoxerID, &gubBoxerID, NUM_BOXERS * sizeof( UINT16 ) );
|
||||||
memcpy( &sGeneralInfo.fBoxerFought, &gfBoxerFought, NUM_BOXERS * sizeof( BOOLEAN ) );
|
memcpy( &sGeneralInfo.fBoxerFought, &gfBoxerFought, NUM_BOXERS * sizeof( BOOLEAN ) );
|
||||||
|
|
||||||
//Save the helicopter status
|
//Save the helicopter status
|
||||||
@@ -8944,17 +8798,17 @@ BOOLEAN LoadGeneralInfo( HWFILE hFile )
|
|||||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.ubHelicopterHitsTaken, sizeof(sGeneralInfo.ubHelicopterHitsTaken), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.ubHelicopterHitsTaken, sizeof(sGeneralInfo.ubHelicopterHitsTaken), sizeof(UINT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.ubQuitType, sizeof(sGeneralInfo.ubQuitType), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.ubQuitType, sizeof(sGeneralInfo.ubQuitType), sizeof(UINT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.fSkyriderSaidCongratsOnTakingSAM, sizeof(sGeneralInfo.fSkyriderSaidCongratsOnTakingSAM), sizeof(BOOLEAN), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.fSkyriderSaidCongratsOnTakingSAM, sizeof(sGeneralInfo.fSkyriderSaidCongratsOnTakingSAM), sizeof(BOOLEAN), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.sContractRehireSoldierID, sizeof(sGeneralInfo.sContractRehireSoldierID), sizeof(INT16), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.sContractRehireSoldierID, sizeof(sGeneralInfo.sContractRehireSoldierID), sizeof(UINT16), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.GameOptions, sizeof(sGeneralInfo.GameOptions), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.GameOptions, sizeof(sGeneralInfo.GameOptions), sizeof(UINT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.uiSeedNumber, sizeof(sGeneralInfo.uiSeedNumber), sizeof(UINT32), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.uiSeedNumber, sizeof(sGeneralInfo.uiSeedNumber), sizeof(UINT32), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.uiBaseJA2Clock, sizeof(sGeneralInfo.uiBaseJA2Clock), sizeof(UINT32), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.uiBaseJA2Clock, sizeof(sGeneralInfo.uiBaseJA2Clock), sizeof(UINT32), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.sCurInterfacePanel, sizeof(sGeneralInfo.sCurInterfacePanel), sizeof(INT16), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.sCurInterfacePanel, sizeof(sGeneralInfo.sCurInterfacePanel), sizeof(INT16), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.ubSMCurrentMercID, sizeof(sGeneralInfo.ubSMCurrentMercID), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.ubSMCurrentMercID, sizeof(sGeneralInfo.ubSMCurrentMercID), sizeof(UINT16), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.fFirstTimeInMapScreen, sizeof(sGeneralInfo.fFirstTimeInMapScreen), sizeof(BOOLEAN), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.fFirstTimeInMapScreen, sizeof(sGeneralInfo.fFirstTimeInMapScreen), sizeof(BOOLEAN), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.fDisableDueToBattleRoster, sizeof(sGeneralInfo.fDisableDueToBattleRoster), sizeof(BOOLEAN), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.fDisableDueToBattleRoster, sizeof(sGeneralInfo.fDisableDueToBattleRoster), sizeof(BOOLEAN), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.fDisableMapInterfaceDueToBattle, sizeof(sGeneralInfo.fDisableMapInterfaceDueToBattle), sizeof(BOOLEAN), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.fDisableMapInterfaceDueToBattle, sizeof(sGeneralInfo.fDisableMapInterfaceDueToBattle), sizeof(BOOLEAN), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.sBoxerGridNo, sizeof(sGeneralInfo.sBoxerGridNo), sizeof(INT32), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.sBoxerGridNo, sizeof(sGeneralInfo.sBoxerGridNo), sizeof(INT32), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.ubBoxerID, sizeof(sGeneralInfo.ubBoxerID), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.ubBoxerID, sizeof(sGeneralInfo.ubBoxerID), sizeof(UINT16), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.fBoxerFought, sizeof(sGeneralInfo.fBoxerFought), sizeof(BOOLEAN), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.fBoxerFought, sizeof(sGeneralInfo.fBoxerFought), sizeof(BOOLEAN), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.fHelicopterDestroyed, sizeof(sGeneralInfo.fHelicopterDestroyed), sizeof(BOOLEAN), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.fHelicopterDestroyed, sizeof(sGeneralInfo.fHelicopterDestroyed), sizeof(BOOLEAN), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.fShowMapScreenHelpText, sizeof(sGeneralInfo.fShowMapScreenHelpText), sizeof(BOOLEAN), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.fShowMapScreenHelpText, sizeof(sGeneralInfo.fShowMapScreenHelpText), sizeof(BOOLEAN), numBytesRead);
|
||||||
@@ -9032,7 +8886,7 @@ BOOLEAN LoadGeneralInfo( HWFILE hFile )
|
|||||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.fExplosionQueueActive, sizeof(sGeneralInfo.fExplosionQueueActive), sizeof(BOOLEAN), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.fExplosionQueueActive, sizeof(sGeneralInfo.fExplosionQueueActive), sizeof(BOOLEAN), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.ubUnused, sizeof(sGeneralInfo.ubUnused), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.ubUnused, sizeof(sGeneralInfo.ubUnused), sizeof(UINT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.uiMeanWhileFlags, sizeof(sGeneralInfo.uiMeanWhileFlags), sizeof(UINT32), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.uiMeanWhileFlags, sizeof(sGeneralInfo.uiMeanWhileFlags), sizeof(UINT32), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.bSelectedInfoChar, sizeof(sGeneralInfo.bSelectedInfoChar), sizeof(INT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.bSelectedInfoChar, sizeof(sGeneralInfo.bSelectedInfoChar), sizeof(INT16), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.bHospitalPriceModifier, sizeof(sGeneralInfo.bHospitalPriceModifier), sizeof(INT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.bHospitalPriceModifier, sizeof(sGeneralInfo.bHospitalPriceModifier), sizeof(INT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.bUnused2, sizeof(sGeneralInfo.bUnused2), sizeof(INT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.bUnused2, sizeof(sGeneralInfo.bUnused2), sizeof(INT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.iHospitalTempBalance, sizeof(sGeneralInfo.iHospitalTempBalance), sizeof(INT32), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.iHospitalTempBalance, sizeof(sGeneralInfo.iHospitalTempBalance), sizeof(INT32), numBytesRead);
|
||||||
@@ -9205,10 +9059,10 @@ BOOLEAN LoadGeneralInfo( HWFILE hFile )
|
|||||||
ubQuitType = sGeneralInfo.ubQuitType;
|
ubQuitType = sGeneralInfo.ubQuitType;
|
||||||
|
|
||||||
//if the soldier id is valid
|
//if the soldier id is valid
|
||||||
if( sGeneralInfo.sContractRehireSoldierID == -1 )
|
if( sGeneralInfo.sContractRehireSoldierID == NOBODY )
|
||||||
pContractReHireSoldier = NULL;
|
pContractReHireSoldier = NULL;
|
||||||
else
|
else
|
||||||
pContractReHireSoldier = &Menptr[ sGeneralInfo.sContractRehireSoldierID ];
|
pContractReHireSoldier = sGeneralInfo.sContractRehireSoldierID;
|
||||||
|
|
||||||
memcpy( &gGameOptions, &sGeneralInfo.GameOptions, sizeof( GAME_OPTIONS ) );
|
memcpy( &gGameOptions, &sGeneralInfo.GameOptions, sizeof( GAME_OPTIONS ) );
|
||||||
#ifndef BMP_RANDOM//dnl ch55 111009
|
#ifndef BMP_RANDOM//dnl ch55 111009
|
||||||
@@ -9225,10 +9079,10 @@ BOOLEAN LoadGeneralInfo( HWFILE hFile )
|
|||||||
|
|
||||||
|
|
||||||
// Restore the selected merc
|
// Restore the selected merc
|
||||||
if( sGeneralInfo.ubSMCurrentMercID == 255 )
|
if( sGeneralInfo.ubSMCurrentMercID == NOBODY)
|
||||||
gpSMCurrentMerc = NULL;
|
gpSMCurrentMerc = NULL;
|
||||||
else
|
else
|
||||||
gpSMCurrentMerc = &Menptr[ sGeneralInfo.ubSMCurrentMercID ];
|
gpSMCurrentMerc = sGeneralInfo.ubSMCurrentMercID;
|
||||||
|
|
||||||
//Set the interface panel to the team panel
|
//Set the interface panel to the team panel
|
||||||
ShutdownCurrentPanel( );
|
ShutdownCurrentPanel( );
|
||||||
@@ -9256,7 +9110,7 @@ BOOLEAN LoadGeneralInfo( HWFILE hFile )
|
|||||||
fDisableMapInterfaceDueToBattle = sGeneralInfo.fDisableMapInterfaceDueToBattle;
|
fDisableMapInterfaceDueToBattle = sGeneralInfo.fDisableMapInterfaceDueToBattle;
|
||||||
|
|
||||||
memcpy( &gsBoxerGridNo, &sGeneralInfo.sBoxerGridNo, NUM_BOXERS * sizeof( INT32 ) );
|
memcpy( &gsBoxerGridNo, &sGeneralInfo.sBoxerGridNo, NUM_BOXERS * sizeof( INT32 ) );
|
||||||
memcpy( &gubBoxerID, &sGeneralInfo.ubBoxerID, NUM_BOXERS * sizeof( UINT8 ) );
|
memcpy( &gubBoxerID, &sGeneralInfo.ubBoxerID, NUM_BOXERS * sizeof( UINT16 ) );
|
||||||
memcpy( &gfBoxerFought, &sGeneralInfo.fBoxerFought, NUM_BOXERS * sizeof( BOOLEAN ) );
|
memcpy( &gfBoxerFought, &sGeneralInfo.fBoxerFought, NUM_BOXERS * sizeof( BOOLEAN ) );
|
||||||
|
|
||||||
//Load the helicopter status
|
//Load the helicopter status
|
||||||
@@ -9437,20 +9291,20 @@ BOOLEAN LoadGeneralInfo( HWFILE hFile )
|
|||||||
gCamoFace[i].gSnowCamoface = FALSE;
|
gCamoFace[i].gSnowCamoface = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
SOLDIERTYPE * pSoldier;
|
SoldierID Soldier = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||||
UINT16 bMercID = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
SoldierID bLastTeamID = gTacticalStatus.Team[gbPlayerNum].bLastID;
|
||||||
UINT16 bLastTeamID = gTacticalStatus.Team[gbPlayerNum].bLastID;
|
for ( ; Soldier <= bLastTeamID; ++Soldier)
|
||||||
for ( pSoldier = MercPtrs[ bMercID ]; bMercID <= bLastTeamID; ++bMercID,pSoldier++)
|
|
||||||
{
|
{
|
||||||
if ( pSoldier )
|
if ( Soldier )
|
||||||
{
|
{
|
||||||
gCamoFace[pSoldier->ubProfile].gCamoface = ( pSoldier->bCamo > 0 );
|
UINT8 profile = Soldier->ubProfile;
|
||||||
gCamoFace[pSoldier->ubProfile].gUrbanCamoface = ( pSoldier->urbanCamo > 0 );
|
gCamoFace[profile].gCamoface = ( Soldier->bCamo > 0 );
|
||||||
gCamoFace[pSoldier->ubProfile].gDesertCamoface = ( pSoldier->desertCamo > 0 );
|
gCamoFace[profile].gUrbanCamoface = ( Soldier->urbanCamo > 0 );
|
||||||
gCamoFace[pSoldier->ubProfile].gSnowCamoface = ( pSoldier->snowCamo > 0 );
|
gCamoFace[profile].gDesertCamoface = ( Soldier->desertCamo > 0 );
|
||||||
|
gCamoFace[profile].gSnowCamoface = ( Soldier->snowCamo > 0 );
|
||||||
|
|
||||||
DeleteSoldierFace( pSoldier );
|
DeleteSoldierFace( Soldier );
|
||||||
pSoldier->iFaceIndex = InitSoldierFace( pSoldier );
|
Soldier->iFaceIndex = InitSoldierFace( Soldier );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -9671,18 +9525,19 @@ void GetBestPossibleSectorXYZValues( INT16 *psSectorX, INT16 *psSectorY, INT8 *p
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
INT16 sSoldierCnt;
|
SoldierID sSoldierCnt;
|
||||||
SOLDIERTYPE *pSoldier;
|
SoldierID bLastTeamID;
|
||||||
INT16 bLastTeamID;
|
SOLDIERTYPE *pSoldier;
|
||||||
BOOLEAN fFoundAMerc=FALSE;
|
BOOLEAN fFoundAMerc = FALSE;
|
||||||
|
|
||||||
// Set locator to first merc
|
// Set locator to first merc
|
||||||
sSoldierCnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
sSoldierCnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||||
bLastTeamID = gTacticalStatus.Team[ gbPlayerNum ].bLastID;
|
bLastTeamID = gTacticalStatus.Team[ gbPlayerNum ].bLastID;
|
||||||
|
|
||||||
//loop through all the mercs on the players team to find the one that is not moving
|
//loop through all the mercs on the players team to find the one that is not moving
|
||||||
for ( pSoldier = MercPtrs[ sSoldierCnt ]; sSoldierCnt <= bLastTeamID; sSoldierCnt++,pSoldier++)
|
for ( ; sSoldierCnt <= bLastTeamID; ++sSoldierCnt )
|
||||||
{
|
{
|
||||||
|
pSoldier = sSoldierCnt;
|
||||||
// test for !NULL (if initilization fails and MercPtrs contains 'NULL's)
|
// test for !NULL (if initilization fails and MercPtrs contains 'NULL's)
|
||||||
if( pSoldier && pSoldier->bActive )
|
if( pSoldier && pSoldier->bActive )
|
||||||
{
|
{
|
||||||
@@ -9706,8 +9561,9 @@ void GetBestPossibleSectorXYZValues( INT16 *psSectorX, INT16 *psSectorY, INT8 *p
|
|||||||
bLastTeamID = gTacticalStatus.Team[ gbPlayerNum ].bLastID;
|
bLastTeamID = gTacticalStatus.Team[ gbPlayerNum ].bLastID;
|
||||||
|
|
||||||
//loop through all the mercs and find one that is moving
|
//loop through all the mercs and find one that is moving
|
||||||
for ( pSoldier = MercPtrs[ sSoldierCnt ]; sSoldierCnt <= bLastTeamID; sSoldierCnt++,pSoldier++)
|
for ( ; sSoldierCnt <= bLastTeamID; ++sSoldierCnt )
|
||||||
{
|
{
|
||||||
|
pSoldier = sSoldierCnt;
|
||||||
if( pSoldier && pSoldier->bActive )
|
if( pSoldier && pSoldier->bActive )
|
||||||
{
|
{
|
||||||
//we found an alive, merc that is not moving
|
//we found an alive, merc that is not moving
|
||||||
|
|||||||
+20
-33
@@ -38,45 +38,32 @@ class SOLDIERTYPE;
|
|||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
UINT32 uiSavedGameVersion;
|
UINT32 uiSavedGameVersion;
|
||||||
CHAR8 zGameVersionNumber[ GAME_VERSION_LENGTH ];
|
CHAR8 zGameVersionNumber[ GAME_VERSION_LENGTH ];
|
||||||
|
CHAR16 sSavedGameDesc[ SIZE_OF_SAVE_GAME_DESC ];
|
||||||
CHAR16 sSavedGameDesc[ SIZE_OF_SAVE_GAME_DESC ];
|
UINT32 uiFlags;
|
||||||
|
|
||||||
UINT32 uiFlags;
|
|
||||||
|
|
||||||
#ifdef CRIPPLED_VERSION
|
#ifdef CRIPPLED_VERSION
|
||||||
UINT8 ubCrippleFiller[20];
|
UINT8 ubCrippleFiller[20];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
//The following will be used to quickly access info to display in the save/load screen
|
//The following will be used to quickly access info to display in the save/load screen
|
||||||
UINT32 uiDay;
|
UINT32 uiDay;
|
||||||
UINT8 ubHour;
|
UINT8 ubHour;
|
||||||
UINT8 ubMin;
|
UINT8 ubMin;
|
||||||
INT16 sSectorX;
|
INT16 sSectorX;
|
||||||
INT16 sSectorY;
|
INT16 sSectorY;
|
||||||
INT8 bSectorZ;
|
INT8 bSectorZ;
|
||||||
UINT8 ubNumOfMercsOnPlayersTeam;
|
UINT16 ubNumOfMercsOnPlayersTeam;
|
||||||
INT32 iCurrentBalance;
|
INT32 iCurrentBalance;
|
||||||
|
UINT32 uiCurrentScreen;
|
||||||
UINT32 uiCurrentScreen;
|
BOOLEAN fAlternateSector;
|
||||||
|
BOOLEAN fWorldLoaded;
|
||||||
BOOLEAN fAlternateSector;
|
UINT8 ubLoadScreenID; //The load screen that should be used when loading the saved game
|
||||||
|
GAME_OPTIONS sInitialGameOptions; //need these in the header so we can get the info from it on the save load screen.
|
||||||
BOOLEAN fWorldLoaded;
|
UINT32 uiRandom;
|
||||||
|
UINT8 ubFiller[494]; // WANNE: Decrease this filler by 1, for each new UINT8 variable!
|
||||||
UINT8 ubLoadScreenID; //The load screen that should be used when loading the saved game
|
|
||||||
|
|
||||||
GAME_OPTIONS sInitialGameOptions; //need these in the header so we can get the info from it on the save load screen.
|
|
||||||
|
|
||||||
UINT32 uiRandom;
|
|
||||||
|
|
||||||
UINT8 ubFiller[500]; // WANNE: Decrease this filler by 1, for each new UINT8 variable!
|
|
||||||
|
|
||||||
} SAVED_GAME_HEADER;
|
} SAVED_GAME_HEADER;
|
||||||
|
|
||||||
|
|
||||||
extern UINT32 guiScreenToGotoAfterLoadingSavedGame;
|
extern UINT32 guiScreenToGotoAfterLoadingSavedGame;
|
||||||
extern UINT32 guiCurrentSaveGameVersion;
|
extern UINT32 guiCurrentSaveGameVersion;
|
||||||
|
|
||||||
|
|||||||
@@ -1398,7 +1398,6 @@ BOOLEAN DisplaySaveGameEntry( INT32 bEntryID )
|
|||||||
CHAR16 zDateString[128];
|
CHAR16 zDateString[128];
|
||||||
CHAR16 zLocationString[128];
|
CHAR16 zLocationString[128];
|
||||||
CHAR16 zNumMercsString[128];
|
CHAR16 zNumMercsString[128];
|
||||||
CHAR16 zBalanceString[128];
|
|
||||||
SAVED_GAME_HEADER SaveGameHeader;
|
SAVED_GAME_HEADER SaveGameHeader;
|
||||||
HVOBJECT hPixHandle;
|
HVOBJECT hPixHandle;
|
||||||
UINT16 usPosX=SLG_FIRST_SAVED_SPOT_X;
|
UINT16 usPosX=SLG_FIRST_SAVED_SPOT_X;
|
||||||
@@ -1669,11 +1668,6 @@ BOOLEAN DisplaySaveGameEntry( INT32 bEntryID )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Get the current balance
|
|
||||||
swprintf( zBalanceString, L"%d", SaveGameHeader.iCurrentBalance);
|
|
||||||
InsertCommasForDollarFigure( zBalanceString );
|
|
||||||
InsertDollarSignInToString( zBalanceString );
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Display the Saved game information
|
// Display the Saved game information
|
||||||
//
|
//
|
||||||
@@ -1692,7 +1686,7 @@ BOOLEAN DisplaySaveGameEntry( INT32 bEntryID )
|
|||||||
|
|
||||||
//The balance
|
//The balance
|
||||||
if(!is_networked)
|
if(!is_networked)
|
||||||
DrawTextToScreen( zBalanceString, (UINT16)(usPosX+SLG_BALANCE_OFFSET_X), (UINT16)(usPosY+SLG_BALANCE_OFFSET_Y), 0, uiFont, ubFontColor, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
|
DrawTextToScreen(FormatMoney(SaveGameHeader.iCurrentBalance).data(), (UINT16)(usPosX + SLG_BALANCE_OFFSET_X), (UINT16)(usPosY + SLG_BALANCE_OFFSET_Y), 0, uiFont, ubFontColor, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
|
||||||
|
|
||||||
if( gbSaveGameArray[ VAL_SLOT_START + bEntryID ] || ( gfSaveGame && !gfUserInTextInputMode && ( gbSelectedSaveLocation == bEntryID ) ) )
|
if( gbSaveGameArray[ VAL_SLOT_START + bEntryID ] || ( gfSaveGame && !gfUserInTextInputMode && ( gbSelectedSaveLocation == bEntryID ) ) )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ UINT32 AniEditScreenHandle(void)
|
|||||||
fToggle2 = FALSE;
|
fToggle2 = FALSE;
|
||||||
ubCurLoadedState = 0;
|
ubCurLoadedState = 0;
|
||||||
|
|
||||||
pSoldier = MercPtrs[ gusSelectedSoldier ];
|
pSoldier = gusSelectedSoldier;
|
||||||
|
|
||||||
gTacticalStatus.uiFlags |= LOADING_SAVED_GAME;
|
gTacticalStatus.uiFlags |= LOADING_SAVED_GAME;
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,9 @@
|
|||||||
// -----------------------------
|
// -----------------------------
|
||||||
|
|
||||||
// Map Editor version - you should use the MapEditor configuration instead of messing with these defines (ChrisL)
|
// Map Editor version - you should use the MapEditor configuration instead of messing with these defines (ChrisL)
|
||||||
|
//#ifndef JA2BETAVERSION
|
||||||
//#define JA2BETAVERSION
|
//#define JA2BETAVERSION
|
||||||
|
//#endif
|
||||||
//#define JA2EDITOR
|
//#define JA2EDITOR
|
||||||
// Normal test version
|
// Normal test version
|
||||||
//#define JA2TESTVERSION
|
//#define JA2TESTVERSION
|
||||||
|
|||||||
+28
-36
@@ -108,10 +108,10 @@ INT32 giCounterPeriodOverlay = 0;
|
|||||||
BOOLEAN gfExitToNewSector = FALSE;
|
BOOLEAN gfExitToNewSector = FALSE;
|
||||||
//UINT8 gubNewSectorExitDirection;
|
//UINT8 gubNewSectorExitDirection;
|
||||||
|
|
||||||
BOOLEAN gfGameScreenLocateToSoldier = FALSE;
|
BOOLEAN gfGameScreenLocateToSoldier = FALSE;
|
||||||
BOOLEAN gfEnteringMapScreen = FALSE;
|
BOOLEAN gfEnteringMapScreen = FALSE;
|
||||||
UINT32 uiOldMouseCursor;
|
UINT32 uiOldMouseCursor;
|
||||||
UINT8 gubPreferredInitialSelectedGuy = NOBODY;
|
SoldierID gubPreferredInitialSelectedGuy = NOBODY;
|
||||||
|
|
||||||
BOOLEAN gfTacticalIsModal = FALSE;
|
BOOLEAN gfTacticalIsModal = FALSE;
|
||||||
MOUSE_REGION gTacticalDisableRegion;
|
MOUSE_REGION gTacticalDisableRegion;
|
||||||
@@ -261,17 +261,17 @@ void EnterTacticalScreen( )
|
|||||||
if ( gusSelectedSoldier != NOBODY )
|
if ( gusSelectedSoldier != NOBODY )
|
||||||
{
|
{
|
||||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("EnterTacticalScreen: check our guy"));
|
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("EnterTacticalScreen: check our guy"));
|
||||||
if ( !OK_CONTROLLABLE_MERC( MercPtrs[ gusSelectedSoldier ] ) )
|
if ( !OK_CONTROLLABLE_MERC( gusSelectedSoldier ) )
|
||||||
{
|
{
|
||||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("EnterTacticalScreen: SelectNextAvailSoldier, merc not controllable"));
|
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("EnterTacticalScreen: SelectNextAvailSoldier, merc not controllable"));
|
||||||
SelectNextAvailSoldier( MercPtrs[ gusSelectedSoldier ] );
|
SelectNextAvailSoldier( gusSelectedSoldier );
|
||||||
}
|
}
|
||||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("EnterTacticalScreen: who is selected? %d", gusSelectedSoldier));
|
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("EnterTacticalScreen: who is selected? %d", gusSelectedSoldier));
|
||||||
// ATE: If the current guy is sleeping, change....
|
// ATE: If the current guy is sleeping, change....
|
||||||
if ( gusSelectedSoldier != NOBODY && MercPtrs[ gusSelectedSoldier ]->flags.fMercAsleep )
|
if ( gusSelectedSoldier != NOBODY && gusSelectedSoldier->flags.fMercAsleep )
|
||||||
{
|
{
|
||||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("EnterTacticalScreen: SelectNextAvailSoldier, merc asleep"));
|
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("EnterTacticalScreen: SelectNextAvailSoldier, merc asleep"));
|
||||||
SelectNextAvailSoldier( MercPtrs[ gusSelectedSoldier ] );
|
SelectNextAvailSoldier( gusSelectedSoldier );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -580,9 +580,9 @@ UINT32 MainGameScreenHandle(void)
|
|||||||
{
|
{
|
||||||
if ( gTacticalStatus.ubCurrentTeam != gbPlayerNum )
|
if ( gTacticalStatus.ubCurrentTeam != gbPlayerNum )
|
||||||
{
|
{
|
||||||
MercPtrs[ gTacticalStatus.ubEnemySightingOnTheirTurnEnemyID ]->AdjustNoAPToFinishMove( FALSE );
|
gTacticalStatus.ubEnemySightingOnTheirTurnEnemyID->AdjustNoAPToFinishMove( FALSE );
|
||||||
}
|
}
|
||||||
MercPtrs[ gTacticalStatus.ubEnemySightingOnTheirTurnEnemyID ]->flags.fPauseAllAnimation = FALSE;
|
gTacticalStatus.ubEnemySightingOnTheirTurnEnemyID->flags.fPauseAllAnimation = FALSE;
|
||||||
|
|
||||||
gTacticalStatus.fEnemySightingOnTheirTurn = FALSE;
|
gTacticalStatus.fEnemySightingOnTheirTurn = FALSE;
|
||||||
}
|
}
|
||||||
@@ -684,7 +684,7 @@ UINT32 MainGameScreenHandle(void)
|
|||||||
// Select a guy if he hasn;'
|
// Select a guy if he hasn;'
|
||||||
if( !gfTacticalPlacementGUIActive )
|
if( !gfTacticalPlacementGUIActive )
|
||||||
{
|
{
|
||||||
if ( gusSelectedSoldier != NOBODY && OK_INTERRUPT_MERC( MercPtrs[ gusSelectedSoldier ] ) )
|
if ( gusSelectedSoldier != NOBODY && OK_INTERRUPT_MERC( gusSelectedSoldier ) )
|
||||||
{
|
{
|
||||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("maingamescreenhandle: selectsoldier"));
|
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("maingamescreenhandle: selectsoldier"));
|
||||||
SelectSoldier( gusSelectedSoldier, FALSE, TRUE );
|
SelectSoldier( gusSelectedSoldier, FALSE, TRUE );
|
||||||
@@ -735,11 +735,11 @@ UINT32 MainGameScreenHandle(void)
|
|||||||
|
|
||||||
if ( !ARE_IN_FADE_IN( ) )
|
if ( !ARE_IN_FADE_IN( ) )
|
||||||
{
|
{
|
||||||
HandleAutoBandagePending( );
|
HandleAutoBandagePending( );
|
||||||
|
|
||||||
#ifdef JA2UB
|
#ifdef JA2UB
|
||||||
HandleThePlayerBeNotifiedOfSomeoneElseInSector();
|
HandleThePlayerBeNotifiedOfSomeoneElseInSector();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -933,7 +933,7 @@ UINT32 MainGameScreenHandle(void)
|
|||||||
if ( gusSelectedSoldier != NOBODY )
|
if ( gusSelectedSoldier != NOBODY )
|
||||||
{
|
{
|
||||||
if( !gGameSettings.fOptions[ TOPTION_MUTE_CONFIRMATIONS ] )
|
if( !gGameSettings.fOptions[ TOPTION_MUTE_CONFIRMATIONS ] )
|
||||||
MercPtrs[ gusSelectedSoldier ]->DoMercBattleSound( BATTLE_SOUND_ATTN1 );
|
gusSelectedSoldier->DoMercBattleSound( BATTLE_SOUND_ATTN1 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1030,15 +1030,12 @@ void DisableFPSOverlay( BOOLEAN fEnable )
|
|||||||
|
|
||||||
void TacticalScreenLocateToSoldier( )
|
void TacticalScreenLocateToSoldier( )
|
||||||
{
|
{
|
||||||
INT32 cnt;
|
BOOLEAN fPreferedGuyUsed = FALSE;
|
||||||
SOLDIERTYPE *pSoldier;
|
|
||||||
INT16 bLastTeamID;
|
|
||||||
BOOLEAN fPreferedGuyUsed = FALSE;
|
|
||||||
|
|
||||||
if ( gubPreferredInitialSelectedGuy != NOBODY )
|
if ( gubPreferredInitialSelectedGuy != NOBODY )
|
||||||
{
|
{
|
||||||
// ATE: Put condition here...
|
// ATE: Put condition here...
|
||||||
if ( OK_CONTROLLABLE_MERC( MercPtrs[ gubPreferredInitialSelectedGuy ] ) && OK_INTERRUPT_MERC( MercPtrs[ gubPreferredInitialSelectedGuy ] ) )
|
if ( OK_CONTROLLABLE_MERC( gubPreferredInitialSelectedGuy ) && OK_INTERRUPT_MERC( gubPreferredInitialSelectedGuy ) )
|
||||||
{
|
{
|
||||||
LocateSoldier( gubPreferredInitialSelectedGuy, 10 );
|
LocateSoldier( gubPreferredInitialSelectedGuy, 10 );
|
||||||
SelectSoldier( gubPreferredInitialSelectedGuy, FALSE, TRUE );
|
SelectSoldier( gubPreferredInitialSelectedGuy, FALSE, TRUE );
|
||||||
@@ -1050,14 +1047,14 @@ void TacticalScreenLocateToSoldier( )
|
|||||||
if ( !fPreferedGuyUsed )
|
if ( !fPreferedGuyUsed )
|
||||||
{
|
{
|
||||||
// Set locator to first merc
|
// Set locator to first merc
|
||||||
cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
SoldierID Soldier = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||||
bLastTeamID = gTacticalStatus.Team[ gbPlayerNum ].bLastID;
|
SoldierID bLastTeamID = gTacticalStatus.Team[ gbPlayerNum ].bLastID;
|
||||||
for ( pSoldier = MercPtrs[ cnt ]; cnt <= bLastTeamID; cnt++,pSoldier++)
|
for ( ; Soldier <= bLastTeamID; ++Soldier)
|
||||||
{
|
{
|
||||||
if ( OK_CONTROLLABLE_MERC( pSoldier ) && OK_INTERRUPT_MERC( pSoldier ) )
|
if ( OK_CONTROLLABLE_MERC( Soldier ) && OK_INTERRUPT_MERC( Soldier ) )
|
||||||
{
|
{
|
||||||
LocateSoldier( pSoldier->ubID, 10 );
|
LocateSoldier( Soldier, 10 );
|
||||||
SelectSoldier( pSoldier->ubID, FALSE, TRUE );
|
SelectSoldier( Soldier, FALSE, TRUE );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1075,22 +1072,17 @@ void EnterMapScreen( )
|
|||||||
|
|
||||||
void UpdateTeamPanelAssignments( )
|
void UpdateTeamPanelAssignments( )
|
||||||
{
|
{
|
||||||
INT32 cnt;
|
|
||||||
SOLDIERTYPE *pSoldier;
|
|
||||||
INT16 bLastTeamID;
|
|
||||||
|
|
||||||
// Remove all players
|
// Remove all players
|
||||||
RemoveAllPlayersFromSlot( );
|
RemoveAllPlayersFromSlot( );
|
||||||
|
|
||||||
// Set locator to first merc
|
// Set locator to first merc
|
||||||
cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
SoldierID Soldier = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||||
bLastTeamID = gTacticalStatus.Team[ gbPlayerNum ].bLastID;
|
SoldierID bLastTeamID = gTacticalStatus.Team[ gbPlayerNum ].bLastID;
|
||||||
for ( pSoldier = MercPtrs[ cnt ]; cnt <= bLastTeamID; cnt++,pSoldier++)
|
for ( ; Soldier <= bLastTeamID; ++Soldier)
|
||||||
{
|
{
|
||||||
// Setup team interface
|
// Setup team interface
|
||||||
CheckForAndAddMercToTeamPanel( pSoldier );
|
CheckForAndAddMercToTeamPanel( Soldier );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+5
-5
@@ -1,7 +1,7 @@
|
|||||||
#ifndef _GAMESCREEN_H
|
#ifndef _GAMESCREEN_H
|
||||||
#define _GAMESCREEN_H
|
#define _GAMESCREEN_H
|
||||||
|
|
||||||
|
#include "Overhead Types.h"
|
||||||
#include "Fade Screen.h"
|
#include "Fade Screen.h"
|
||||||
|
|
||||||
#define ARE_IN_FADE_IN( ) ( gfFadeIn || gfFadeInitialized )
|
#define ARE_IN_FADE_IN( ) ( gfFadeIn || gfFadeInitialized )
|
||||||
@@ -14,9 +14,9 @@ void FadeOutGameScreen( );
|
|||||||
typedef void (*MODAL_HOOK)( void );
|
typedef void (*MODAL_HOOK)( void );
|
||||||
|
|
||||||
|
|
||||||
extern BOOLEAN gfGameScreenLocateToSoldier;
|
extern BOOLEAN gfGameScreenLocateToSoldier;
|
||||||
extern BOOLEAN gfEnteringMapScreen;
|
extern BOOLEAN gfEnteringMapScreen;
|
||||||
extern UINT8 gubPreferredInitialSelectedGuy;
|
extern SoldierID gubPreferredInitialSelectedGuy;
|
||||||
|
|
||||||
|
|
||||||
void EnterMapScreen( );
|
void EnterMapScreen( );
|
||||||
@@ -41,4 +41,4 @@ void InitHelicopterEntranceByMercs( void );
|
|||||||
|
|
||||||
void InternalLeaveTacticalScreen( UINT32 uiNewScreen );
|
void InternalLeaveTacticalScreen( UINT32 uiNewScreen );
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+14
-30
@@ -514,31 +514,25 @@ UINT32 PalEditScreenShutdown(void)
|
|||||||
|
|
||||||
void PalEditRenderHook( )
|
void PalEditRenderHook( )
|
||||||
{
|
{
|
||||||
SOLDIERTYPE *pSoldier;
|
if ( gusSelectedSoldier < NOBODY && gusSelectedSoldier->bActive)
|
||||||
|
|
||||||
if ( gusSelectedSoldier != NOBODY )
|
|
||||||
{
|
{
|
||||||
// Set to current
|
DisplayPaletteRep( gusSelectedSoldier->HeadPal, 50, 10, FRAME_BUFFER );
|
||||||
GetSoldier( &pSoldier, gusSelectedSoldier );
|
DisplayPaletteRep( gusSelectedSoldier->PantsPal, 50, 50, FRAME_BUFFER );
|
||||||
|
DisplayPaletteRep( gusSelectedSoldier->VestPal, 50, 90, FRAME_BUFFER );
|
||||||
DisplayPaletteRep( pSoldier->HeadPal, 50, 10, FRAME_BUFFER );
|
DisplayPaletteRep( gusSelectedSoldier->SkinPal, 50, 130, FRAME_BUFFER );
|
||||||
DisplayPaletteRep( pSoldier->PantsPal, 50, 50, FRAME_BUFFER );
|
|
||||||
DisplayPaletteRep( pSoldier->VestPal, 50, 90, FRAME_BUFFER );
|
|
||||||
DisplayPaletteRep( pSoldier->SkinPal, 50, 130, FRAME_BUFFER );
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN PalEditKeyboardHook( InputAtom *pInputEvent )
|
BOOLEAN PalEditKeyboardHook( InputAtom *pInputEvent )
|
||||||
{
|
{
|
||||||
UINT8 ubType;
|
SOLDIERTYPE *pSoldier;
|
||||||
SOLDIERTYPE *pSoldier;
|
UINT32 cnt;
|
||||||
UINT8 ubPaletteRep;
|
UINT8 ubType;
|
||||||
UINT32 cnt;
|
UINT8 ubPaletteRep;
|
||||||
UINT8 ubStartRep = 0;
|
UINT8 ubStartRep = 0;
|
||||||
UINT8 ubEndRep = 0;
|
UINT8 ubEndRep = 0;
|
||||||
|
|
||||||
if ( gusSelectedSoldier == NOBODY )
|
if ( gusSelectedSoldier >= NOBODY || gusSelectedSoldier->bActive == FALSE )
|
||||||
{
|
{
|
||||||
return( FALSE );
|
return( FALSE );
|
||||||
}
|
}
|
||||||
@@ -549,11 +543,10 @@ BOOLEAN PalEditKeyboardHook( InputAtom *pInputEvent )
|
|||||||
return( TRUE );
|
return( TRUE );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pSoldier = gusSelectedSoldier;
|
||||||
|
|
||||||
if ((pInputEvent->usEvent == KEY_DOWN )&& ( pInputEvent->usParam == 'h' ))
|
if ((pInputEvent->usEvent == KEY_DOWN )&& ( pInputEvent->usParam == 'h' ))
|
||||||
{
|
{
|
||||||
// Get Soldier
|
|
||||||
GetSoldier( &pSoldier, gusSelectedSoldier );
|
|
||||||
|
|
||||||
// Get index of current
|
// Get index of current
|
||||||
CHECKF( GetPaletteRepIndexFromID( pSoldier->HeadPal, &ubPaletteRep ) );
|
CHECKF( GetPaletteRepIndexFromID( pSoldier->HeadPal, &ubPaletteRep ) );
|
||||||
ubType = gpPalRep[ ubPaletteRep ].ubType;
|
ubType = gpPalRep[ ubPaletteRep ].ubType;
|
||||||
@@ -582,9 +575,6 @@ BOOLEAN PalEditKeyboardHook( InputAtom *pInputEvent )
|
|||||||
|
|
||||||
if ((pInputEvent->usEvent == KEY_DOWN )&& ( pInputEvent->usParam == 'v' ))
|
if ((pInputEvent->usEvent == KEY_DOWN )&& ( pInputEvent->usParam == 'v' ))
|
||||||
{
|
{
|
||||||
// Get Soldier
|
|
||||||
GetSoldier( &pSoldier, gusSelectedSoldier );
|
|
||||||
|
|
||||||
// Get index of current
|
// Get index of current
|
||||||
CHECKF( GetPaletteRepIndexFromID( pSoldier->VestPal, &ubPaletteRep ) );
|
CHECKF( GetPaletteRepIndexFromID( pSoldier->VestPal, &ubPaletteRep ) );
|
||||||
ubType = gpPalRep[ ubPaletteRep ].ubType;
|
ubType = gpPalRep[ ubPaletteRep ].ubType;
|
||||||
@@ -612,9 +602,6 @@ BOOLEAN PalEditKeyboardHook( InputAtom *pInputEvent )
|
|||||||
|
|
||||||
if ((pInputEvent->usEvent == KEY_DOWN )&& ( pInputEvent->usParam == 'p' ))
|
if ((pInputEvent->usEvent == KEY_DOWN )&& ( pInputEvent->usParam == 'p' ))
|
||||||
{
|
{
|
||||||
// Get Soldier
|
|
||||||
GetSoldier( &pSoldier, gusSelectedSoldier );
|
|
||||||
|
|
||||||
// Get index of current
|
// Get index of current
|
||||||
CHECKF( GetPaletteRepIndexFromID( pSoldier->PantsPal, &ubPaletteRep ) );
|
CHECKF( GetPaletteRepIndexFromID( pSoldier->PantsPal, &ubPaletteRep ) );
|
||||||
ubType = gpPalRep[ ubPaletteRep ].ubType;
|
ubType = gpPalRep[ ubPaletteRep ].ubType;
|
||||||
@@ -642,9 +629,6 @@ BOOLEAN PalEditKeyboardHook( InputAtom *pInputEvent )
|
|||||||
|
|
||||||
if ((pInputEvent->usEvent == KEY_DOWN )&& ( pInputEvent->usParam == 's' ))
|
if ((pInputEvent->usEvent == KEY_DOWN )&& ( pInputEvent->usParam == 's' ))
|
||||||
{
|
{
|
||||||
// Get Soldier
|
|
||||||
GetSoldier( &pSoldier, gusSelectedSoldier );
|
|
||||||
|
|
||||||
// Get index of current
|
// Get index of current
|
||||||
CHECKF( GetPaletteRepIndexFromID( pSoldier->SkinPal, &ubPaletteRep ) );
|
CHECKF( GetPaletteRepIndexFromID( pSoldier->SkinPal, &ubPaletteRep ) );
|
||||||
ubType = gpPalRep[ ubPaletteRep ].ubType;
|
ubType = gpPalRep[ ubPaletteRep ].ubType;
|
||||||
|
|||||||
+3
-3
@@ -81,9 +81,9 @@ void RandomStats ();
|
|||||||
void RandomAddEnemy( UINT8 SectorX, UINT8 SectorY, UINT8 Level )
|
void RandomAddEnemy( UINT8 SectorX, UINT8 SectorY, UINT8 Level )
|
||||||
{
|
{
|
||||||
UNDERGROUND_SECTORINFO *pSector;
|
UNDERGROUND_SECTORINFO *pSector;
|
||||||
UINT8 ubNumAdmins = 0;
|
UINT16 ubNumAdmins = 0;
|
||||||
UINT8 ubNumTroops = 0;
|
UINT16 ubNumTroops = 0;
|
||||||
UINT8 ubNumElites = 0;
|
UINT16 ubNumElites = 0;
|
||||||
|
|
||||||
if ( Level != 0 )
|
if ( Level != 0 )
|
||||||
{
|
{
|
||||||
|
|||||||
+48
-67
@@ -1099,7 +1099,6 @@ BOOLEAN RenderAIMMembers()
|
|||||||
HVOBJECT hPriceHandle;
|
HVOBJECT hPriceHandle;
|
||||||
HVOBJECT hWeaponBoxHandle;
|
HVOBJECT hWeaponBoxHandle;
|
||||||
UINT16 x, uiPosX;
|
UINT16 x, uiPosX;
|
||||||
CHAR16 wTemp[50];
|
|
||||||
|
|
||||||
DrawAimDefaults();
|
DrawAimDefaults();
|
||||||
|
|
||||||
@@ -1137,18 +1136,15 @@ BOOLEAN RenderAIMMembers()
|
|||||||
DrawTextToScreen(CharacterInfo[AIM_MEMBER_CONTRACT], AIM_CONTRACT_X_NSGI, AIM_CONTRACT_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
|
DrawTextToScreen(CharacterInfo[AIM_MEMBER_CONTRACT], AIM_CONTRACT_X_NSGI, AIM_CONTRACT_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
|
||||||
|
|
||||||
//Draw pay period (day, week, 2 week)
|
//Draw pay period (day, week, 2 week)
|
||||||
DrawTextToScreen(CharacterInfo[AIM_MEMBER_1_DAY], ONEDAY_X_NSGI, EXPLEVEL_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
|
DrawTextToScreen(CharacterInfo[AIM_MEMBER_1_DAY], ONEDAY_X_NSGI, EXPLEVEL_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
|
||||||
DrawTextToScreen(CharacterInfo[AIM_MEMBER_1_WEEK], ONEWEEK_X_NSGI, MARKSMAN_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
|
DrawTextToScreen(CharacterInfo[AIM_MEMBER_1_WEEK], ONEWEEK_X_NSGI, MARKSMAN_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
|
||||||
DrawTextToScreen(CharacterInfo[AIM_MEMBER_2_WEEKS], TWOWEEK_X_NSGI, MECHANAICAL_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
|
DrawTextToScreen(CharacterInfo[AIM_MEMBER_2_WEEKS], TWOWEEK_X_NSGI, MECHANAICAL_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
|
||||||
|
|
||||||
//Display Option Gear Cost text
|
//Display Option Gear Cost text
|
||||||
DrawTextToScreen(CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR_NSGI], AIM_MEMBER_OPTIONAL_GEAR_X_NSGI, EXPLOSIVE_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
|
DrawTextToScreen(CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR_NSGI], AIM_MEMBER_OPTIONAL_GEAR_X_NSGI, EXPLOSIVE_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
|
||||||
|
|
||||||
swprintf(wTemp, L"%d", gMercProfiles[gbCurrentSoldier].usOptionalGearCost);
|
|
||||||
InsertCommasForDollarFigure( wTemp );
|
|
||||||
InsertDollarSignInToString( wTemp );
|
|
||||||
uiPosX = AIM_MEMBER_OPTIONAL_GEAR_X_NSGI + StringPixLength( CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR_NSGI], AIM_M_FONT_STATIC_TEXT) + 5;
|
uiPosX = AIM_MEMBER_OPTIONAL_GEAR_X_NSGI + StringPixLength( CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR_NSGI], AIM_M_FONT_STATIC_TEXT) + 5;
|
||||||
DrawTextToScreen(wTemp, AIM_MEMBER_OPTIONAL_GEAR_COST_X_NSGI, EXPLOSIVE_Y_NSGI, FEE_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_DYNAMIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
|
DrawTextToScreen(FormatMoney(gMercProfiles[gbCurrentSoldier].usOptionalGearCost).data(), AIM_MEMBER_OPTIONAL_GEAR_COST_X_NSGI, EXPLOSIVE_Y_NSGI, FEE_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_DYNAMIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
|
||||||
#endif // JA2UB
|
#endif // JA2UB
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1184,18 +1180,15 @@ BOOLEAN RenderAIMMembers()
|
|||||||
DrawTextToScreen(CharacterInfo[AIM_MEMBER_CONTRACT], AIM_CONTRACT_X, AIM_CONTRACT_Y, AIM_CONTRACT_WIDTH, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
|
DrawTextToScreen(CharacterInfo[AIM_MEMBER_CONTRACT], AIM_CONTRACT_X, AIM_CONTRACT_Y, AIM_CONTRACT_WIDTH, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
|
||||||
|
|
||||||
//Draw pay period (day, week, 2 week)
|
//Draw pay period (day, week, 2 week)
|
||||||
DrawTextToScreen(CharacterInfo[AIM_MEMBER_1_DAY], ONEDAY_X, EXPLEVEL_Y, AIM_CONTRACT_WIDTH, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
|
DrawTextToScreen(CharacterInfo[AIM_MEMBER_1_DAY], ONEDAY_X, EXPLEVEL_Y, AIM_CONTRACT_WIDTH, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
|
||||||
DrawTextToScreen(CharacterInfo[AIM_MEMBER_1_WEEK], ONEWEEK_X, MARKSMAN_Y, AIM_CONTRACT_WIDTH, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
|
DrawTextToScreen(CharacterInfo[AIM_MEMBER_1_WEEK], ONEWEEK_X, MARKSMAN_Y, AIM_CONTRACT_WIDTH, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
|
||||||
DrawTextToScreen(CharacterInfo[AIM_MEMBER_2_WEEKS], TWOWEEK_X, MECHANAICAL_Y, AIM_CONTRACT_WIDTH, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
|
DrawTextToScreen(CharacterInfo[AIM_MEMBER_2_WEEKS], TWOWEEK_X, MECHANAICAL_Y, AIM_CONTRACT_WIDTH, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
|
||||||
|
|
||||||
//Display Option Gear Cost text
|
//Display Option Gear Cost text
|
||||||
DrawTextToScreen(CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR], AIM_MEMBER_OPTIONAL_GEAR_X, AIM_MEMBER_OPTIONAL_GEAR_Y, 0, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
|
DrawTextToScreen(CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR], AIM_MEMBER_OPTIONAL_GEAR_X, AIM_MEMBER_OPTIONAL_GEAR_Y, 0, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
|
||||||
|
|
||||||
swprintf(wTemp, L"%d", gMercProfiles[gbCurrentSoldier].usOptionalGearCost);
|
|
||||||
InsertCommasForDollarFigure( wTemp );
|
|
||||||
InsertDollarSignInToString( wTemp );
|
|
||||||
uiPosX = AIM_MEMBER_OPTIONAL_GEAR_X + StringPixLength( CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR], AIM_M_FONT_STATIC_TEXT) + 5;
|
uiPosX = AIM_MEMBER_OPTIONAL_GEAR_X + StringPixLength( CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR], AIM_M_FONT_STATIC_TEXT) + 5;
|
||||||
DrawTextToScreen(wTemp, uiPosX, AIM_MEMBER_OPTIONAL_GEAR_Y, 0, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_DYNAMIC_TEXT, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
|
DrawTextToScreen(FormatMoney(gMercProfiles[gbCurrentSoldier].usOptionalGearCost).data(), uiPosX, AIM_MEMBER_OPTIONAL_GEAR_Y, 0, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_DYNAMIC_TEXT, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1261,19 +1254,6 @@ BOOLEAN DrawNumeralsToScreen(INT32 iNumber, INT8 bWidth, UINT16 usLocX, UINT16 u
|
|||||||
return(TRUE);
|
return(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN DrawMoneyToScreen(INT32 iNumber, INT8 bWidth, UINT16 usLocX, UINT16 usLocY, UINT32 ulFont, UINT8 ubColor)
|
|
||||||
{
|
|
||||||
CHAR16 sStr[10];
|
|
||||||
|
|
||||||
swprintf(sStr, L"%d",iNumber);
|
|
||||||
InsertCommasForDollarFigure( sStr );
|
|
||||||
InsertDollarSignInToString( sStr );
|
|
||||||
|
|
||||||
// DrawTextToScreen(L"$", usLocX, usLocY, 0, ulFont, ubColor, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
|
|
||||||
DrawTextToScreen(sStr, usLocX, usLocY, bWidth, ulFont, ubColor, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
|
|
||||||
|
|
||||||
return(TRUE);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void SelectFaceRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason )
|
void SelectFaceRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason )
|
||||||
@@ -1315,6 +1295,19 @@ void SelectFaceMovementRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason )
|
|||||||
|
|
||||||
#include "LocalizedStrings.h"
|
#include "LocalizedStrings.h"
|
||||||
|
|
||||||
|
static auto DrawDiscountedDailyCosts() -> void
|
||||||
|
{
|
||||||
|
constexpr auto offset{ 65 };
|
||||||
|
constexpr auto l{ L"(" };
|
||||||
|
constexpr auto r{ L")" };
|
||||||
|
const static auto nsgi = gGameExternalOptions.gfUseNewStartingGearInterface;
|
||||||
|
const auto width = nsgi ? FEE_WIDTH_NSGI : FEE_WIDTH;
|
||||||
|
const auto xOffset = nsgi ? FEE_X_NSGI : FEE_X;
|
||||||
|
|
||||||
|
DrawTextToScreen((l + FormatMoney(gMercProfiles[gbCurrentSoldier].uiWeeklySalary / 7) + r).data(), xOffset + offset, nsgi ? AGILITY_Y_NSGI : AGILITY_Y, width, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
|
||||||
|
DrawTextToScreen((l + FormatMoney(gMercProfiles[gbCurrentSoldier].uiBiWeeklySalary / 14) + r).data(), xOffset + offset, nsgi ? DEXTERITY_Y_NSGI : DEXTERITY_Y, width, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
|
||||||
|
}
|
||||||
|
|
||||||
BOOLEAN UpdateMercInfo(void)
|
BOOLEAN UpdateMercInfo(void)
|
||||||
{
|
{
|
||||||
//UINT16 PosY = 300;
|
//UINT16 PosY = 300;
|
||||||
@@ -1324,26 +1317,23 @@ BOOLEAN UpdateMercInfo(void)
|
|||||||
if(gGameExternalOptions.gfUseNewStartingGearInterface)
|
if(gGameExternalOptions.gfUseNewStartingGearInterface)
|
||||||
{
|
{
|
||||||
#ifdef JA2UB
|
#ifdef JA2UB
|
||||||
DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].uiWeeklySalary, FEE_WIDTH, FEE_X_UB, FEE_Y_UB_NSGI, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT);
|
DrawTextToScreen(FormatMoney(gMercProfiles[gbCurrentSoldier].uiWeeklySalary).data(), FEE_X_UB, FEE_Y_UB_NSGI, FEE_WIDTH, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
|
||||||
DisplayWrappedString(AIM_OFFER_X, AGILITY_Y_NSGI, AIM_OFFER_WIDTH, 2, AIM_M_FONT_DYNAMIC_TEXT, AIM_FONT_MCOLOR_WHITE, zNewTacticalMessages[TACT_MSG__AIMMEMBER_FEE_TEXT], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
|
DisplayWrappedString(AIM_OFFER_X, AGILITY_Y_NSGI, AIM_OFFER_WIDTH, 2, AIM_M_FONT_DYNAMIC_TEXT, AIM_FONT_MCOLOR_WHITE, zNewTacticalMessages[TACT_MSG__AIMMEMBER_FEE_TEXT], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
|
||||||
#else
|
#else
|
||||||
//Display the salaries
|
//Display the salaries
|
||||||
DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].sSalary, FEE_WIDTH_NSGI, FEE_X_NSGI, HEALTH_Y_NSGI, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT );
|
DrawTextToScreen(FormatMoney(gMercProfiles[gbCurrentSoldier].sSalary).data(), FEE_X_NSGI, HEALTH_Y_NSGI, FEE_WIDTH_NSGI, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
|
||||||
DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].uiWeeklySalary, FEE_WIDTH_NSGI, FEE_X_NSGI, AGILITY_Y_NSGI, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT );
|
DrawTextToScreen(FormatMoney(gMercProfiles[gbCurrentSoldier].uiWeeklySalary).data(), FEE_X_NSGI, AGILITY_Y_NSGI, FEE_WIDTH_NSGI, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
|
||||||
DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].uiBiWeeklySalary, FEE_WIDTH_NSGI, FEE_X_NSGI, DEXTERITY_Y_NSGI, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT );
|
DrawTextToScreen(FormatMoney(gMercProfiles[gbCurrentSoldier].uiBiWeeklySalary).data(), FEE_X_NSGI, DEXTERITY_Y_NSGI, FEE_WIDTH_NSGI, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
|
||||||
|
|
||||||
|
DrawDiscountedDailyCosts();
|
||||||
|
|
||||||
//if medical deposit is required
|
//if medical deposit is required
|
||||||
if( gMercProfiles[gbCurrentSoldier].bMedicalDeposit )
|
if( gMercProfiles[gbCurrentSoldier].bMedicalDeposit )
|
||||||
{
|
{
|
||||||
CHAR16 zTemp[40];
|
|
||||||
CHAR16 sMedicalString[40];
|
CHAR16 sMedicalString[40];
|
||||||
|
|
||||||
// Display the medical cost
|
// Display the medical cost
|
||||||
swprintf( zTemp, L"%d", gMercProfiles[ gbCurrentSoldier ].sMedicalDepositAmount );
|
swprintf( sMedicalString, L"%s %s", FormatMoney(gMercProfiles[gbCurrentSoldier].sMedicalDepositAmount).data(), CharacterInfo[AIM_MEMBER_MEDICAL_DEPOSIT_REQ] );
|
||||||
InsertCommasForDollarFigure( zTemp );
|
|
||||||
InsertDollarSignInToString( zTemp );
|
|
||||||
|
|
||||||
swprintf( sMedicalString, L"%s %s", zTemp, CharacterInfo[AIM_MEMBER_MEDICAL_DEPOSIT_REQ] );
|
|
||||||
|
|
||||||
// If the string will be displayed in more then 2 lines, recenter the string
|
// If the string will be displayed in more then 2 lines, recenter the string
|
||||||
if( ( DisplayWrappedString( 0, 0, AIM_MEDICAL_DEPOSIT_WIDTH_NSGI, 2, AIM_FONT12ARIAL, AIM_M_COLOR_DYNAMIC_TEXT, sMedicalString, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED | DONT_DISPLAY_TEXT ) / GetFontHeight( AIM_FONT12ARIAL ) ) > 2 )
|
if( ( DisplayWrappedString( 0, 0, AIM_MEDICAL_DEPOSIT_WIDTH_NSGI, 2, AIM_FONT12ARIAL, AIM_M_COLOR_DYNAMIC_TEXT, sMedicalString, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED | DONT_DISPLAY_TEXT ) / GetFontHeight( AIM_FONT12ARIAL ) ) > 2 )
|
||||||
@@ -1384,13 +1374,15 @@ BOOLEAN UpdateMercInfo(void)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifdef JA2UB
|
#ifdef JA2UB
|
||||||
DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].uiWeeklySalary, FEE_WIDTH, FEE_X_UB, FEE_Y_UB, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT);
|
DrawTextToScreen(FormatMoney(gMercProfiles[gbCurrentSoldier].uiWeeklySalary).data(), FEE_X_UB, FEE_Y_UB, FEE_WIDTH, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
|
||||||
DisplayWrappedString(AIM_OFFER_X, AGILITY_Y, AIM_OFFER_WIDTH, 2, AIM_M_FONT_DYNAMIC_TEXT, AIM_FONT_MCOLOR_WHITE, zNewTacticalMessages[TACT_MSG__AIMMEMBER_FEE_TEXT], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
|
DisplayWrappedString(AIM_OFFER_X, AGILITY_Y, AIM_OFFER_WIDTH, 2, AIM_M_FONT_DYNAMIC_TEXT, AIM_FONT_MCOLOR_WHITE, zNewTacticalMessages[TACT_MSG__AIMMEMBER_FEE_TEXT], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
|
||||||
#else
|
#else
|
||||||
//Display the salaries
|
//Display the salaries
|
||||||
DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].sSalary, FEE_WIDTH, FEE_X, HEALTH_Y, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT );
|
DrawTextToScreen(FormatMoney(gMercProfiles[gbCurrentSoldier].sSalary).data(), FEE_X, HEALTH_Y, FEE_WIDTH, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
|
||||||
DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].uiWeeklySalary, FEE_WIDTH, FEE_X, AGILITY_Y, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT );
|
DrawTextToScreen(FormatMoney(gMercProfiles[gbCurrentSoldier].uiWeeklySalary).data(), FEE_X, AGILITY_Y, FEE_WIDTH, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
|
||||||
DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].uiBiWeeklySalary, FEE_WIDTH, FEE_X, DEXTERITY_Y, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT );
|
DrawTextToScreen(FormatMoney(gMercProfiles[gbCurrentSoldier].uiBiWeeklySalary).data(), FEE_X, DEXTERITY_Y, FEE_WIDTH, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
|
||||||
|
|
||||||
|
DrawDiscountedDailyCosts();
|
||||||
|
|
||||||
//if medical deposit is required
|
//if medical deposit is required
|
||||||
if( gMercProfiles[gbCurrentSoldier].bMedicalDeposit )
|
if( gMercProfiles[gbCurrentSoldier].bMedicalDeposit )
|
||||||
@@ -1399,11 +1391,7 @@ BOOLEAN UpdateMercInfo(void)
|
|||||||
CHAR16 sMedicalString[40];
|
CHAR16 sMedicalString[40];
|
||||||
|
|
||||||
// Display the medical cost
|
// Display the medical cost
|
||||||
swprintf( zTemp, L"%d", gMercProfiles[ gbCurrentSoldier ].sMedicalDepositAmount );
|
swprintf( sMedicalString, L"%s %s", FormatMoney(gMercProfiles[gbCurrentSoldier].sMedicalDepositAmount).data(), CharacterInfo[AIM_MEMBER_MEDICAL_DEPOSIT_REQ] );
|
||||||
InsertCommasForDollarFigure( zTemp );
|
|
||||||
InsertDollarSignInToString( zTemp );
|
|
||||||
|
|
||||||
swprintf( sMedicalString, L"%s %s", zTemp, CharacterInfo[AIM_MEMBER_MEDICAL_DEPOSIT_REQ] );
|
|
||||||
|
|
||||||
// If the string will be displayed in more then 2 lines, recenter the string
|
// If the string will be displayed in more then 2 lines, recenter the string
|
||||||
if( ( DisplayWrappedString( 0, 0, AIM_MEDICAL_DEPOSIT_WIDTH, 2, AIM_FONT12ARIAL, AIM_M_COLOR_DYNAMIC_TEXT, sMedicalString, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED | DONT_DISPLAY_TEXT ) / GetFontHeight( AIM_FONT12ARIAL ) ) > 2 )
|
if( ( DisplayWrappedString( 0, 0, AIM_MEDICAL_DEPOSIT_WIDTH, 2, AIM_FONT12ARIAL, AIM_M_COLOR_DYNAMIC_TEXT, sMedicalString, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED | DONT_DISPLAY_TEXT ) / GetFontHeight( AIM_FONT12ARIAL ) ) > 2 )
|
||||||
@@ -2422,9 +2410,9 @@ INT8 AimMemberHireMerc()
|
|||||||
MERC_HIRE_STRUCT HireMercStruct;
|
MERC_HIRE_STRUCT HireMercStruct;
|
||||||
// UINT8 ubCurrentSoldier = AimMercArray[gbCurrentIndex];
|
// UINT8 ubCurrentSoldier = AimMercArray[gbCurrentIndex];
|
||||||
UINT8 ubCurrentSoldier = gAimAvailability[AimMercArray[gbCurrentIndex]].ProfilId;
|
UINT8 ubCurrentSoldier = gAimAvailability[AimMercArray[gbCurrentIndex]].ProfilId;
|
||||||
INT8 bReturnCode;
|
INT8 bReturnCode;
|
||||||
INT16 sSoldierID=0;
|
SoldierID sSoldierID = NOBODY;
|
||||||
INT8 bTypeOfContract=0;
|
INT8 bTypeOfContract=0;
|
||||||
|
|
||||||
|
|
||||||
if( LaptopSaveInfo.iCurrentBalance < giContractAmount )
|
if( LaptopSaveInfo.iCurrentBalance < giContractAmount )
|
||||||
@@ -2500,9 +2488,10 @@ INT8 AimMemberHireMerc()
|
|||||||
|
|
||||||
//Set the type of contract the merc is on
|
//Set the type of contract the merc is on
|
||||||
sSoldierID = GetSoldierIDFromMercID( ubCurrentSoldier );
|
sSoldierID = GetSoldierIDFromMercID( ubCurrentSoldier );
|
||||||
if( sSoldierID == -1 )
|
if( sSoldierID == NOBODY )
|
||||||
return( FALSE );
|
return( FALSE );
|
||||||
Menptr[ sSoldierID ].bTypeOfLastContract = bTypeOfContract;
|
|
||||||
|
sSoldierID->bTypeOfLastContract = bTypeOfContract;
|
||||||
|
|
||||||
|
|
||||||
//add an entry in the finacial page for the hiring of the merc
|
//add an entry in the finacial page for the hiring of the merc
|
||||||
@@ -2681,7 +2670,6 @@ void DisplaySelectLights(BOOLEAN fContractDown, BOOLEAN fBuyEquipDown)
|
|||||||
UINT32 DisplayMercChargeAmount()
|
UINT32 DisplayMercChargeAmount()
|
||||||
{
|
{
|
||||||
CHAR16 wTemp[50];
|
CHAR16 wTemp[50];
|
||||||
CHAR16 wDollarTemp[50];
|
|
||||||
HVOBJECT hImageHandle;
|
HVOBJECT hImageHandle;
|
||||||
|
|
||||||
|
|
||||||
@@ -2727,24 +2715,17 @@ UINT32 DisplayMercChargeAmount()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
swprintf( wDollarTemp, L"%d", giContractAmount);
|
|
||||||
InsertCommasForDollarFigure( wDollarTemp );
|
|
||||||
InsertDollarSignInToString( wDollarTemp );
|
|
||||||
|
|
||||||
//if the merc hasnt just been hired
|
//if the merc hasnt just been hired
|
||||||
// if( FindSoldierByProfileID( gbCurrentSoldier, TRUE ) == NULL )
|
// if( FindSoldierByProfileID( gbCurrentSoldier, TRUE ) == NULL )
|
||||||
{
|
{
|
||||||
#ifdef JA2UB
|
auto contractAmount{ FormatMoney(giContractAmount) };
|
||||||
// Don't even have to pay for medical insurance! What a DEAL!
|
#ifndef JA2UB
|
||||||
swprintf(wTemp, L"%s", wDollarTemp);
|
if (gMercProfiles[gbCurrentSoldier].bMedicalDeposit)
|
||||||
#else
|
contractAmount += L" ";
|
||||||
if( gMercProfiles[ gbCurrentSoldier ].bMedicalDeposit )
|
contractAmount += VideoConfercingText[AIM_MEMBER_WITH_MEDICAL];
|
||||||
swprintf(wTemp, L"%s %s", wDollarTemp, VideoConfercingText[AIM_MEMBER_WITH_MEDICAL] );
|
#endif
|
||||||
else
|
|
||||||
swprintf(wTemp, L"%s", wDollarTemp );
|
|
||||||
#endif // JA2UB
|
|
||||||
|
|
||||||
DrawTextToScreen(wTemp, AIM_CONTRACT_CHARGE_AMOUNNT_X+1, AIM_CONTRACT_CHARGE_AMOUNNT_Y+3, 0, AIM_M_VIDEO_CONTRACT_AMOUNT_FONT, AIM_M_VIDEO_CONTRACT_AMOUNT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
|
DrawTextToScreen(contractAmount.data(), AIM_CONTRACT_CHARGE_AMOUNNT_X + 1, AIM_CONTRACT_CHARGE_AMOUNNT_Y + 3, 0, AIM_M_VIDEO_CONTRACT_AMOUNT_FONT, AIM_M_VIDEO_CONTRACT_AMOUNT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
|
||||||
}
|
}
|
||||||
|
|
||||||
return(giContractAmount);
|
return(giContractAmount);
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ BOOLEAN RenderAIMMembers();
|
|||||||
|
|
||||||
|
|
||||||
BOOLEAN DrawNumeralsToScreen(INT32 iNumber, INT8 bWidth, UINT16 usLocX, UINT16 usLocY, UINT32 ulFont, UINT8 ubColor);
|
BOOLEAN DrawNumeralsToScreen(INT32 iNumber, INT8 bWidth, UINT16 usLocX, UINT16 usLocY, UINT32 ulFont, UINT8 ubColor);
|
||||||
BOOLEAN DrawMoneyToScreen(INT32 iNumber, INT8 bWidth, UINT16 usLocX, UINT16 usLocY, UINT32 ulFont, UINT8 ubColor);
|
|
||||||
|
|
||||||
void DisplayTextForMercFaceVideoPopUp(STR16 pString);
|
void DisplayTextForMercFaceVideoPopUp(STR16 pString);
|
||||||
|
|
||||||
|
|||||||
+12
-20
@@ -1424,8 +1424,6 @@ BOOLEAN DisplayItemInfo(UINT32 uiItemClass, INT32 iFilter, INT32 iSubFilter)
|
|||||||
UINT8 ubCount=0;
|
UINT8 ubCount=0;
|
||||||
UINT16 PosY, usTextPosY;
|
UINT16 PosY, usTextPosY;
|
||||||
UINT16 usItemIndex;
|
UINT16 usItemIndex;
|
||||||
CHAR16 sDollarTemp[60];
|
|
||||||
CHAR16 sTemp[60];
|
|
||||||
CHAR16 sPage[60];
|
CHAR16 sPage[60];
|
||||||
INT16 pItemNumbers[ BOBBYR_NUM_WEAPONS_ON_PAGE ];
|
INT16 pItemNumbers[ BOBBYR_NUM_WEAPONS_ON_PAGE ];
|
||||||
BOOLEAN bAddItem = FALSE;
|
BOOLEAN bAddItem = FALSE;
|
||||||
@@ -1434,11 +1432,8 @@ BOOLEAN DisplayItemInfo(UINT32 uiItemClass, INT32 iFilter, INT32 iSubFilter)
|
|||||||
usTextPosY = BOBBYR_ITEM_DESC_START_Y;
|
usTextPosY = BOBBYR_ITEM_DESC_START_Y;
|
||||||
|
|
||||||
//Display the subtotal at the bottom of the screen
|
//Display the subtotal at the bottom of the screen
|
||||||
swprintf( sDollarTemp, L"%d", CalculateTotalPurchasePrice() );
|
auto subtotal{ std::wstring(BobbyRText[BOBBYR_GUNS_SUB_TOTAL]) + std::wstring(L" ") + FormatMoney(CalculateTotalPurchasePrice()) };
|
||||||
InsertCommasForDollarFigure( sDollarTemp );
|
DrawTextToScreen(subtotal.data(), BOBBYR_ORDER_SUBTOTAL_X, BOBBYR_ORDER_SUBTOTAL_Y, 0, BOBBYR_ORDER_TITLE_FONT, BOBBYR_ORDER_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED | TEXT_SHADOWED);
|
||||||
InsertDollarSignInToString( sDollarTemp );
|
|
||||||
swprintf( sTemp, L"%s %s", BobbyRText[BOBBYR_GUNS_SUB_TOTAL], sDollarTemp );
|
|
||||||
DrawTextToScreen(sTemp, BOBBYR_ORDER_SUBTOTAL_X, BOBBYR_ORDER_SUBTOTAL_Y, 0, BOBBYR_ORDER_TITLE_FONT, BOBBYR_ORDER_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED | TEXT_SHADOWED);
|
|
||||||
|
|
||||||
//Buggler: Display the current page & total pages at the bottom of the screen
|
//Buggler: Display the current page & total pages at the bottom of the screen
|
||||||
swprintf( sPage, L"%d / %d", gubCurPage + 1, gubNumPages );
|
swprintf( sPage, L"%d / %d", gubCurPage + 1, gubNumPages );
|
||||||
@@ -2059,11 +2054,7 @@ UINT16 DisplayCostAndQty(UINT16 usPosY, UINT16 usIndex, UINT16 usFontHeight, UIN
|
|||||||
DrawTextToScreen(BobbyRText[BOBBYR_GUNS_COST], BOBBYR_ITEM_COST_TEXT_X, (UINT16)usPosY, BOBBYR_ITEM_COST_TEXT_WIDTH, BOBBYR_ITEM_DESC_TEXT_FONT, BOBBYR_STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
|
DrawTextToScreen(BobbyRText[BOBBYR_GUNS_COST], BOBBYR_ITEM_COST_TEXT_X, (UINT16)usPosY, BOBBYR_ITEM_COST_TEXT_WIDTH, BOBBYR_ITEM_DESC_TEXT_FONT, BOBBYR_STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
|
||||||
usPosY += usFontHeight + 2;
|
usPosY += usFontHeight + 2;
|
||||||
|
|
||||||
swprintf(sTemp, L"%d", CalcBobbyRayCost( usIndex, usBobbyIndex, fUsed ));
|
DrawTextToScreen(FormatMoney(CalcBobbyRayCost(usIndex, usBobbyIndex, fUsed)).data(), BOBBYR_ITEM_COST_NUM_X, (UINT16)usPosY, BOBBYR_ITEM_COST_TEXT_WIDTH, BOBBYR_ITEM_DESC_TEXT_FONT, BOBBYR_ITEM_DESC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
|
||||||
InsertCommasForDollarFigure( sTemp );
|
|
||||||
InsertDollarSignInToString( sTemp );
|
|
||||||
|
|
||||||
DrawTextToScreen(sTemp, BOBBYR_ITEM_COST_NUM_X, (UINT16)usPosY, BOBBYR_ITEM_COST_TEXT_WIDTH, BOBBYR_ITEM_DESC_TEXT_FONT, BOBBYR_ITEM_DESC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
|
|
||||||
usPosY += usFontHeight + 2;
|
usPosY += usFontHeight + 2;
|
||||||
|
|
||||||
|
|
||||||
@@ -3720,26 +3711,27 @@ void OutOfStockMessageBoxCallBack( UINT8 bExitValue )
|
|||||||
UINT8 CheckPlayersInventoryForGunMatchingGivenAmmoID( INT16 sItemID )
|
UINT8 CheckPlayersInventoryForGunMatchingGivenAmmoID( INT16 sItemID )
|
||||||
{
|
{
|
||||||
UINT8 ubItemCount=0;
|
UINT8 ubItemCount=0;
|
||||||
UINT8 ubMercCount;
|
|
||||||
UINT8 ubPocketCount;
|
UINT8 ubPocketCount;
|
||||||
|
|
||||||
UINT8 ubFirstID = gTacticalStatus.Team[ OUR_TEAM ].bFirstID;
|
SoldierID id;
|
||||||
UINT8 ubLastID = gTacticalStatus.Team[ OUR_TEAM ].bLastID;
|
SoldierID ubFirstID = gTacticalStatus.Team[ OUR_TEAM ].bFirstID;
|
||||||
|
SoldierID ubLastID = gTacticalStatus.Team[ OUR_TEAM ].bLastID;
|
||||||
|
|
||||||
//loop through all the mercs on the team
|
//loop through all the mercs on the team
|
||||||
for( ubMercCount = ubFirstID; ubMercCount <= ubLastID; ++ubMercCount )
|
for( id = ubFirstID; id <= ubLastID; ++id )
|
||||||
{
|
{
|
||||||
if( Menptr[ ubMercCount ].bActive )
|
SOLDIERTYPE *pSoldier = id;
|
||||||
|
if( pSoldier->bActive )
|
||||||
{
|
{
|
||||||
//loop through all the pockets on the merc
|
//loop through all the pockets on the merc
|
||||||
UINT8 invsize = Menptr[ ubMercCount ].inv.size();
|
UINT8 invsize = pSoldier->inv.size();
|
||||||
for( ubPocketCount=0; ubPocketCount<invsize; ++ubPocketCount)
|
for( ubPocketCount=0; ubPocketCount<invsize; ++ubPocketCount)
|
||||||
{
|
{
|
||||||
//if there is a weapon here
|
//if there is a weapon here
|
||||||
if( Item[ Menptr[ ubMercCount ].inv[ ubPocketCount ].usItem ].usItemClass == IC_GUN )
|
if( Item[ pSoldier->inv[ ubPocketCount ].usItem ].usItemClass == IC_GUN )
|
||||||
{
|
{
|
||||||
//if the weapon uses the same kind of ammo as the one passed in, return true
|
//if the weapon uses the same kind of ammo as the one passed in, return true
|
||||||
if( Weapon[ Menptr[ ubMercCount ].inv[ ubPocketCount ].usItem ].ubCalibre == Magazine[ Item[ sItemID ].ubClassIndex ].ubCalibre )
|
if( Weapon[ pSoldier->inv[ ubPocketCount ].usItem ].ubCalibre == Magazine[ Item[ sItemID ].ubClassIndex ].ubCalibre )
|
||||||
{
|
{
|
||||||
++ubItemCount;
|
++ubItemCount;
|
||||||
}
|
}
|
||||||
|
|||||||
+12
-43
@@ -1127,19 +1127,11 @@ void DisplayPurchasedItems( BOOLEAN fCalledFromOrderPage, UINT16 usGridX, UINT16
|
|||||||
DrawTextToScreen(sText, (UINT16)(usGridX+BOBBYR_GRID_THIRD_COLUMN_X+2), usPosY, BOBBYR_GRID_THIRD_COLUMN_WIDTH, BOBBYR_ORDER_DYNAMIC_TEXT_FONT, BOBBYR_ORDER_DYNAMIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
|
DrawTextToScreen(sText, (UINT16)(usGridX+BOBBYR_GRID_THIRD_COLUMN_X+2), usPosY, BOBBYR_GRID_THIRD_COLUMN_WIDTH, BOBBYR_ORDER_DYNAMIC_TEXT_FONT, BOBBYR_ORDER_DYNAMIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
|
||||||
|
|
||||||
//unit price
|
//unit price
|
||||||
swprintf(sTemp, L"%d", CalcBobbyRayCost( pBobbyRayPurchase[i].usItemIndex, pBobbyRayPurchase[i].usBobbyItemIndex, pBobbyRayPurchase[i].fUsed ));
|
DrawTextToScreen(FormatMoney(CalcBobbyRayCost(pBobbyRayPurchase[i].usItemIndex, pBobbyRayPurchase[i].usBobbyItemIndex, pBobbyRayPurchase[i].fUsed)).data(), (UINT16)(usGridX+BOBBYR_GRID_FOURTH_COLUMN_X-2), usPosY, BOBBYR_GRID_FOURTH_COLUMN_WIDTH, BOBBYR_ORDER_DYNAMIC_TEXT_FONT, BOBBYR_ORDER_DYNAMIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
|
||||||
InsertCommasForDollarFigure( sTemp );
|
|
||||||
InsertDollarSignInToString( sTemp );
|
|
||||||
|
|
||||||
DrawTextToScreen(sTemp, (UINT16)(usGridX+BOBBYR_GRID_FOURTH_COLUMN_X-2), usPosY, BOBBYR_GRID_FOURTH_COLUMN_WIDTH, BOBBYR_ORDER_DYNAMIC_TEXT_FONT, BOBBYR_ORDER_DYNAMIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
|
|
||||||
|
|
||||||
uiTotal += CalcBobbyRayCost( pBobbyRayPurchase[i].usItemIndex, pBobbyRayPurchase[i].usBobbyItemIndex, pBobbyRayPurchase[i].fUsed ) * pBobbyRayPurchase[i].ubNumberPurchased;
|
uiTotal += CalcBobbyRayCost( pBobbyRayPurchase[i].usItemIndex, pBobbyRayPurchase[i].usBobbyItemIndex, pBobbyRayPurchase[i].fUsed ) * pBobbyRayPurchase[i].ubNumberPurchased;
|
||||||
|
|
||||||
swprintf(sTemp, L"%d", uiTotal );
|
DrawTextToScreen(FormatMoney(uiTotal).data(), (UINT16)(usGridX+BOBBYR_GRID_FIFTH_COLUMN_X-2), usPosY, BOBBYR_GRID_FIFTH_COLUMN_WIDTH, BOBBYR_ORDER_DYNAMIC_TEXT_FONT, BOBBYR_ORDER_DYNAMIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
|
||||||
InsertCommasForDollarFigure( sTemp );
|
|
||||||
InsertDollarSignInToString( sTemp );
|
|
||||||
|
|
||||||
DrawTextToScreen(sTemp, (UINT16)(usGridX+BOBBYR_GRID_FIFTH_COLUMN_X-2), usPosY, BOBBYR_GRID_FIFTH_COLUMN_WIDTH, BOBBYR_ORDER_DYNAMIC_TEXT_FONT, BOBBYR_ORDER_DYNAMIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
|
|
||||||
|
|
||||||
usPosY += BOBBYR_GRID_ROW_OFFSET;
|
usPosY += BOBBYR_GRID_ROW_OFFSET;
|
||||||
}
|
}
|
||||||
@@ -1259,7 +1251,6 @@ void DisplayPurchasedItems( BOOLEAN fCalledFromOrderPage, UINT16 usGridX, UINT16
|
|||||||
|
|
||||||
void DisplayShippingCosts( BOOLEAN fCalledFromOrderPage, INT32 iSubTotal, UINT16 usGridX, UINT16 usGridY, INT32 iOrderNum )
|
void DisplayShippingCosts( BOOLEAN fCalledFromOrderPage, INT32 iSubTotal, UINT16 usGridX, UINT16 usGridY, INT32 iOrderNum )
|
||||||
{
|
{
|
||||||
CHAR16 sTemp[20];
|
|
||||||
HVOBJECT hPixHandle;
|
HVOBJECT hPixHandle;
|
||||||
INT32 iShippingCost = 0;
|
INT32 iShippingCost = 0;
|
||||||
// INT32 iTotal;
|
// INT32 iTotal;
|
||||||
@@ -1331,27 +1322,15 @@ void DisplayShippingCosts( BOOLEAN fCalledFromOrderPage, INT32 iSubTotal, UINT16
|
|||||||
if( iSubTotal )
|
if( iSubTotal )
|
||||||
{
|
{
|
||||||
//Display the subtotal
|
//Display the subtotal
|
||||||
swprintf(sTemp, L"%d", iSubTotal );
|
DrawTextToScreen(FormatMoney(iSubTotal).data(), (UINT16)(usGridX + BOBBYR_GRID_FIFTH_COLUMN_X - 2), (UINT16)(usGridY + BOBBYR_SUBTOTAL_Y), BOBBYR_GRID_FIFTH_COLUMN_WIDTH, BOBBYR_ORDER_DYNAMIC_TEXT_FONT, BOBBYR_ORDER_DYNAMIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
|
||||||
InsertCommasForDollarFigure( sTemp );
|
|
||||||
InsertDollarSignInToString( sTemp );
|
|
||||||
|
|
||||||
DrawTextToScreen(sTemp, (UINT16)(usGridX + BOBBYR_GRID_FIFTH_COLUMN_X-2), (UINT16)(usGridY + BOBBYR_SUBTOTAL_Y), BOBBYR_GRID_FIFTH_COLUMN_WIDTH, BOBBYR_ORDER_DYNAMIC_TEXT_FONT, BOBBYR_ORDER_DYNAMIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
|
|
||||||
|
|
||||||
//Display the shipping and handling charge
|
//Display the shipping and handling charge
|
||||||
swprintf(sTemp, L"%d", iShippingCost );
|
DrawTextToScreen(FormatMoney(iShippingCost).data(), (UINT16)(usGridX + BOBBYR_GRID_FIFTH_COLUMN_X - 2), (UINT16)(usGridY + BOBBYR_SHIPPING_N_HANDLE_Y), BOBBYR_GRID_FIFTH_COLUMN_WIDTH, BOBBYR_ORDER_DYNAMIC_TEXT_FONT, BOBBYR_ORDER_DYNAMIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
|
||||||
InsertCommasForDollarFigure( sTemp );
|
|
||||||
InsertDollarSignInToString( sTemp );
|
|
||||||
|
|
||||||
DrawTextToScreen(sTemp, (UINT16)(usGridX + BOBBYR_GRID_FIFTH_COLUMN_X-2), (UINT16)(usGridY + BOBBYR_SHIPPING_N_HANDLE_Y), BOBBYR_GRID_FIFTH_COLUMN_WIDTH, BOBBYR_ORDER_DYNAMIC_TEXT_FONT, BOBBYR_ORDER_DYNAMIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
|
|
||||||
|
|
||||||
|
|
||||||
//Display the grand total
|
//Display the grand total
|
||||||
giGrandTotal = iSubTotal + iShippingCost;
|
giGrandTotal = iSubTotal + iShippingCost;
|
||||||
swprintf(sTemp, L"%d", giGrandTotal );
|
DrawTextToScreen(FormatMoney(giGrandTotal).data(), (UINT16)(usGridX + BOBBYR_GRID_FIFTH_COLUMN_X - 2), (UINT16)(usGridY + BOBBYR_GRAND_TOTAL_Y), BOBBYR_GRID_FIFTH_COLUMN_WIDTH, BOBBYR_ORDER_DYNAMIC_TEXT_FONT, BOBBYR_ORDER_DYNAMIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
|
||||||
InsertCommasForDollarFigure( sTemp );
|
|
||||||
InsertDollarSignInToString( sTemp );
|
|
||||||
|
|
||||||
DrawTextToScreen(sTemp, (UINT16)(usGridX + BOBBYR_GRID_FIFTH_COLUMN_X-2), (UINT16)(usGridY + BOBBYR_GRAND_TOTAL_Y), BOBBYR_GRID_FIFTH_COLUMN_WIDTH, BOBBYR_ORDER_DYNAMIC_TEXT_FONT, BOBBYR_ORDER_DYNAMIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
InvalidateRegion(iScreenWidthOffset + 333,iScreenHeightOffset + 326,iScreenWidthOffset + 374,iScreenHeightOffset + 400);
|
InvalidateRegion(iScreenWidthOffset + 333,iScreenHeightOffset + 326,iScreenWidthOffset + 374,iScreenHeightOffset + 400);
|
||||||
@@ -1830,7 +1809,7 @@ void DrawSelectedCity( UINT8 ubCityNumber )
|
|||||||
|
|
||||||
void DisplayShippingLocationCity()
|
void DisplayShippingLocationCity()
|
||||||
{
|
{
|
||||||
CHAR16 sTemp[40];
|
std::wstring sTemp{ L"$0" };
|
||||||
UINT16 usPosY;
|
UINT16 usPosY;
|
||||||
|
|
||||||
//display the name on the title bar
|
//display the name on the title bar
|
||||||
@@ -1853,39 +1832,29 @@ void DisplayShippingLocationCity()
|
|||||||
//Display the shipping cost
|
//Display the shipping cost
|
||||||
usPosY = BOBBYR_OVERNIGHT_EXPRESS_Y;
|
usPosY = BOBBYR_OVERNIGHT_EXPRESS_Y;
|
||||||
|
|
||||||
wcscpy(sTemp, L"$0");
|
|
||||||
|
|
||||||
if( gbSelectedCity != -1 )
|
if( gbSelectedCity != -1 )
|
||||||
{
|
{
|
||||||
// swprintf( sTemp, L"%d", ( INT32 )(BobbyROrderLocations[gbSelectedCity].usOverNightExpress/GetWeightBasedOnMetricOption( 1 ) ) );
|
// swprintf( sTemp, L"%d", ( INT32 )(BobbyROrderLocations[gbSelectedCity].usOverNightExpress/GetWeightBasedOnMetricOption( 1 ) ) );
|
||||||
swprintf( sTemp, L"%d", ( INT32 )(gPostalService.GetDestinationFee(0, gDestinationTable[gbSelectedCity]->usID) / GetWeightBasedOnMetricOption( 1 ) ) );
|
sTemp = FormatMoney(static_cast<INT32>(gPostalService.GetDestinationFee(0, gDestinationTable[gbSelectedCity]->usID) / GetWeightBasedOnMetricOption(1)));
|
||||||
InsertCommasForDollarFigure( sTemp );
|
|
||||||
InsertDollarSignInToString( sTemp );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawTextToScreen(sTemp, BOBBYR_SHIPPING_SPEED_NUMBER_X, usPosY, BOBBYR_SHIPPING_SPEED_NUMBER_WIDTH, BOBBYR_DROPDOWN_FONT, BOBBYR_ORDER_DYNAMIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
|
DrawTextToScreen(sTemp.data(), BOBBYR_SHIPPING_SPEED_NUMBER_X, usPosY, BOBBYR_SHIPPING_SPEED_NUMBER_WIDTH, BOBBYR_DROPDOWN_FONT, BOBBYR_ORDER_DYNAMIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
|
||||||
usPosY +=BOBBYR_GRID_ROW_OFFSET;
|
usPosY +=BOBBYR_GRID_ROW_OFFSET;
|
||||||
|
|
||||||
if( gbSelectedCity != -1 )
|
if( gbSelectedCity != -1 )
|
||||||
{
|
{
|
||||||
// swprintf( sTemp, L"%d", ( INT32 )( BobbyROrderLocations[gbSelectedCity].us2DaysService / GetWeightBasedOnMetricOption( 1 ) ) );
|
sTemp = FormatMoney(static_cast<INT32>(gPostalService.GetDestinationFee(1, gDestinationTable[gbSelectedCity]->usID) / GetWeightBasedOnMetricOption(1)));
|
||||||
swprintf( sTemp, L"%d", ( INT32 )(gPostalService.GetDestinationFee(1, gDestinationTable[gbSelectedCity]->usID) / GetWeightBasedOnMetricOption( 1 ) ) );
|
|
||||||
InsertCommasForDollarFigure( sTemp );
|
|
||||||
InsertDollarSignInToString( sTemp );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawTextToScreen(sTemp, BOBBYR_SHIPPING_SPEED_NUMBER_X, usPosY, BOBBYR_SHIPPING_SPEED_NUMBER_WIDTH, BOBBYR_DROPDOWN_FONT, BOBBYR_ORDER_DYNAMIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
|
DrawTextToScreen(sTemp.data(), BOBBYR_SHIPPING_SPEED_NUMBER_X, usPosY, BOBBYR_SHIPPING_SPEED_NUMBER_WIDTH, BOBBYR_DROPDOWN_FONT, BOBBYR_ORDER_DYNAMIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
|
||||||
usPosY +=BOBBYR_GRID_ROW_OFFSET;
|
usPosY +=BOBBYR_GRID_ROW_OFFSET;
|
||||||
|
|
||||||
if( gbSelectedCity != -1 )
|
if( gbSelectedCity != -1 )
|
||||||
{
|
{
|
||||||
// swprintf( sTemp, L"%d", (INT32 )( BobbyROrderLocations[gbSelectedCity].usStandardService / GetWeightBasedOnMetricOption( 1 ) ) );
|
sTemp = FormatMoney(static_cast<INT32>(gPostalService.GetDestinationFee(2, gDestinationTable[gbSelectedCity]->usID) / GetWeightBasedOnMetricOption(1)));
|
||||||
swprintf( sTemp, L"%d", ( INT32 )(gPostalService.GetDestinationFee(2, gDestinationTable[gbSelectedCity]->usID) / GetWeightBasedOnMetricOption( 1 ) ) );
|
|
||||||
InsertCommasForDollarFigure( sTemp );
|
|
||||||
InsertDollarSignInToString( sTemp );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawTextToScreen(sTemp, BOBBYR_SHIPPING_SPEED_NUMBER_X, usPosY, BOBBYR_SHIPPING_SPEED_NUMBER_WIDTH, BOBBYR_DROPDOWN_FONT, BOBBYR_ORDER_DYNAMIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
|
DrawTextToScreen(sTemp.data(), BOBBYR_SHIPPING_SPEED_NUMBER_X, usPosY, BOBBYR_SHIPPING_SPEED_NUMBER_WIDTH, BOBBYR_DROPDOWN_FONT, BOBBYR_ORDER_DYNAMIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SelectCloseDroDownRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason )
|
void SelectCloseDroDownRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason )
|
||||||
|
|||||||
+4
-4
@@ -269,7 +269,7 @@ void IMPGearDisplay( )
|
|||||||
gIMPGearGun1 = currentWeapon;
|
gIMPGearGun1 = currentWeapon;
|
||||||
|
|
||||||
std::vector<std::pair<INT16, STR16> > entries;
|
std::vector<std::pair<INT16, STR16> > entries;
|
||||||
entries.push_back(std::make_pair(0, pLongAssignmentStrings[40])); //Reusing AssignmentString for "Empty" text
|
entries.push_back(std::make_pair(0, pLongAssignmentStrings[60])); //Reusing AssignmentString for "Empty" text
|
||||||
|
|
||||||
if (Item[gIMPGearGun1].usItemClass & IC_GUN)
|
if (Item[gIMPGearGun1].usItemClass & IC_GUN)
|
||||||
{
|
{
|
||||||
@@ -321,7 +321,7 @@ void IMPGearDisplay( )
|
|||||||
|
|
||||||
|
|
||||||
std::vector<std::pair<INT16, STR16> > entries;
|
std::vector<std::pair<INT16, STR16> > entries;
|
||||||
entries.push_back(std::make_pair(0, pLongAssignmentStrings[40])); //Reusing AssignmentString for "Empty" text
|
entries.push_back(std::make_pair(0, pLongAssignmentStrings[60])); //Reusing AssignmentString for "Empty" text
|
||||||
|
|
||||||
|
|
||||||
if (Item[gIMPGearGun2].usItemClass & IC_GUN)
|
if (Item[gIMPGearGun2].usItemClass & IC_GUN)
|
||||||
@@ -372,7 +372,7 @@ void IMPGearDisplay( )
|
|||||||
gIMPGearGun3 = currentWeapon;
|
gIMPGearGun3 = currentWeapon;
|
||||||
|
|
||||||
std::vector<std::pair<INT16, STR16> > entries;
|
std::vector<std::pair<INT16, STR16> > entries;
|
||||||
entries.push_back(std::make_pair(0, pLongAssignmentStrings[40])); //Reusing AssignmentString for "Empty" text
|
entries.push_back(std::make_pair(0, pLongAssignmentStrings[60])); //Reusing AssignmentString for "Empty" text
|
||||||
|
|
||||||
if (Item[gIMPGearGun3].usItemClass & IC_GUN)
|
if (Item[gIMPGearGun3].usItemClass & IC_GUN)
|
||||||
{
|
{
|
||||||
@@ -1272,7 +1272,7 @@ void DistributePossibleItemsToVectors(void)
|
|||||||
// it is always possible to not select something
|
// it is always possible to not select something
|
||||||
for (int i = 0; i < NUM_INV_SLOTS; ++i)
|
for (int i = 0; i < NUM_INV_SLOTS; ++i)
|
||||||
{
|
{
|
||||||
gIMPPossibleItems[i].push_back(std::make_pair(0, pLongAssignmentStrings[40])); //Reusing AssignmentString for "Empty" text
|
gIMPPossibleItems[i].push_back(std::make_pair(0, pLongAssignmentStrings[60])); //Reusing AssignmentString for "Empty" text
|
||||||
SetChoiceForPocket(i, 0, 1); // Initialize all selections to empty at first
|
SetChoiceForPocket(i, 0, 1); // Initialize all selections to empty at first
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -25,8 +25,8 @@ class SOLDIERTYPE;
|
|||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
BOOLEAN fActive;
|
BOOLEAN fActive;
|
||||||
UINT8 ubSoldierID;
|
SoldierID ubSoldierID;
|
||||||
UINT8 ubMercID;
|
UINT8 ubMercID;
|
||||||
INT32 iPayOutPrice;
|
INT32 iPayOutPrice;
|
||||||
} LIFE_INSURANCE_PAYOUT;
|
} LIFE_INSURANCE_PAYOUT;
|
||||||
|
|||||||
+1
-8
@@ -6165,15 +6165,8 @@ BOOLEAN ReplaceMercNameAndAmountWithProperData( CHAR16 *pFinishedString, EmailPt
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CHAR16 sDollarAmount[64];
|
|
||||||
|
|
||||||
swprintf( sDollarAmount, L"%d", pMail->iFirstData );
|
|
||||||
|
|
||||||
InsertCommasForDollarFigure( sDollarAmount );
|
|
||||||
InsertDollarSignInToString( sDollarAmount );
|
|
||||||
|
|
||||||
//add the mercs name to the string
|
//add the mercs name to the string
|
||||||
wcscat( pFinishedString, sDollarAmount );
|
wcscat( pFinishedString, FormatMoney(pMail->iFirstData).data() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
+34
-204
@@ -808,31 +808,15 @@ void DrawRecordsText( void )
|
|||||||
if(pCurFinance->iAmount >=0)
|
if(pCurFinance->iAmount >=0)
|
||||||
{
|
{
|
||||||
// increase in asset - debit
|
// increase in asset - debit
|
||||||
swprintf(sString, L"%d", pCurFinance->iAmount);
|
swprintf(sString, L"%s", FormatMoney(pCurFinance->iAmount).data());
|
||||||
// insert commas
|
|
||||||
InsertCommasForDollarFigure( sString );
|
|
||||||
// insert dollar sight for first record in the list
|
|
||||||
//DEF: 3/19/99: removed cause we want to see the dollar sign on ALL entries
|
|
||||||
// if( iCounter == 0 )
|
|
||||||
{
|
|
||||||
InsertDollarSignInToString( sString );
|
|
||||||
}
|
|
||||||
|
|
||||||
FindFontCenterCoordinates(RECORD_DEBIT_X,0,RECORD_DEBIT_WIDTH,0, sString, FINANCE_TEXT_FONT,&usX, &usY);
|
FindFontCenterCoordinates(RECORD_DEBIT_X,0,RECORD_DEBIT_WIDTH,0, sString, FINANCE_TEXT_FONT,&usX, &usY);
|
||||||
mprintf(usX, 12+RECORD_Y + (iCounter * ( GetFontHeight( FINANCE_TEXT_FONT ) + 6 ) ), sString);
|
mprintf(usX, 12+RECORD_Y + (iCounter * ( GetFontHeight( FINANCE_TEXT_FONT ) + 6 ) ), sString);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// decrease in asset - credit
|
// decrease in asset - credit
|
||||||
swprintf(sString, L"%d", pCurFinance->iAmount * (-1));
|
swprintf(sString, L"%s", FormatMoney(pCurFinance->iAmount * (-1)).data());
|
||||||
SetFontForeground(FONT_RED);
|
SetFontForeground(FONT_RED);
|
||||||
InsertCommasForDollarFigure( sString );
|
|
||||||
// insert dollar sight for first record in the list
|
|
||||||
//DEF: 3/19/99: removed cause we want to see the dollar sign on ALL entries
|
|
||||||
// if( iCounter == 0 )
|
|
||||||
{
|
|
||||||
InsertDollarSignInToString( sString );
|
|
||||||
}
|
|
||||||
|
|
||||||
FindFontCenterCoordinates(RECORD_CREDIT_X ,0 , RECORD_CREDIT_WIDTH,0, sString, FINANCE_TEXT_FONT,&usX, &usY);
|
FindFontCenterCoordinates(RECORD_CREDIT_X ,0 , RECORD_CREDIT_WIDTH,0, sString, FINANCE_TEXT_FONT,&usX, &usY);
|
||||||
mprintf(usX, 12+RECORD_Y + (iCounter * ( GetFontHeight( FINANCE_TEXT_FONT ) + 6 ) ), sString);
|
mprintf(usX, 12+RECORD_Y + (iCounter * ( GetFontHeight( FINANCE_TEXT_FONT ) + 6 ) ), sString);
|
||||||
@@ -860,15 +844,7 @@ void DrawRecordsText( void )
|
|||||||
|
|
||||||
|
|
||||||
// print the balance string
|
// print the balance string
|
||||||
swprintf(sString, L"%d", iBalance);
|
swprintf(sString, L"%s", FormatMoney(iBalance).data());
|
||||||
InsertCommasForDollarFigure( sString );
|
|
||||||
// insert dollar sight for first record in the list
|
|
||||||
//DEF: 3/19/99: removed cause we want to see the dollar sign on ALL entries
|
|
||||||
// if( iCounter == 0 )
|
|
||||||
{
|
|
||||||
InsertDollarSignInToString( sString );
|
|
||||||
}
|
|
||||||
|
|
||||||
FindFontCenterCoordinates(RECORD_BALANCE_X,0,RECORD_BALANCE_WIDTH,0, sString, FINANCE_TEXT_FONT,&usX, &usY);
|
FindFontCenterCoordinates(RECORD_BALANCE_X,0,RECORD_BALANCE_WIDTH,0, sString, FINANCE_TEXT_FONT,&usX, &usY);
|
||||||
mprintf(usX, 12+RECORD_Y + (iCounter * ( GetFontHeight( FINANCE_TEXT_FONT ) + 6 ) ), sString);
|
mprintf(usX, 12+RECORD_Y + (iCounter * ( GetFontHeight( FINANCE_TEXT_FONT ) + 6 ) ), sString);
|
||||||
|
|
||||||
@@ -921,7 +897,7 @@ void InvalidateLapTopScreen( void )
|
|||||||
void DrawSummaryText( void )
|
void DrawSummaryText( void )
|
||||||
{
|
{
|
||||||
INT16 usX, usY;
|
INT16 usX, usY;
|
||||||
CHAR16 pString[100];
|
std::wstring tmp{};
|
||||||
INT32 iBalance = 0;
|
INT32 iBalance = 0;
|
||||||
|
|
||||||
|
|
||||||
@@ -949,98 +925,68 @@ void DrawSummaryText( void )
|
|||||||
|
|
||||||
// yesterdays income
|
// yesterdays income
|
||||||
iBalance = GetPreviousDaysIncome( );
|
iBalance = GetPreviousDaysIncome( );
|
||||||
swprintf(pString, L"%d", iBalance );
|
tmp = FormatMoney(iBalance);
|
||||||
|
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0, tmp.data(), FINANCE_TEXT_FONT, &usX, &usY);
|
||||||
|
|
||||||
InsertCommasForDollarFigure( pString );
|
mprintf(usX,YESTERDAYS_INCOME,tmp.data());
|
||||||
|
|
||||||
if( iBalance != 0 )
|
|
||||||
InsertDollarSignInToString( pString );
|
|
||||||
|
|
||||||
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,pString,FINANCE_TEXT_FONT, &usX, &usY);
|
|
||||||
|
|
||||||
mprintf(usX,YESTERDAYS_INCOME,pString);
|
|
||||||
|
|
||||||
SetFontForeground( FONT_BLACK );
|
SetFontForeground( FONT_BLACK );
|
||||||
|
|
||||||
// yesterdays other
|
// yesterdays other
|
||||||
iBalance = GetYesterdaysOtherDeposits( );
|
iBalance = GetYesterdaysOtherDeposits( );
|
||||||
swprintf(pString, L"%d", iBalance );
|
tmp = FormatMoney(iBalance);
|
||||||
|
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0, tmp.data(),FINANCE_TEXT_FONT, &usX, &usY);
|
||||||
|
|
||||||
InsertCommasForDollarFigure( pString );
|
mprintf(usX,YESTERDAYS_OTHER,tmp.data());
|
||||||
if( iBalance != 0 )
|
|
||||||
InsertDollarSignInToString( pString );
|
|
||||||
|
|
||||||
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,pString,FINANCE_TEXT_FONT, &usX, &usY);
|
|
||||||
|
|
||||||
mprintf(usX,YESTERDAYS_OTHER,pString);
|
|
||||||
|
|
||||||
SetFontForeground( FONT_RED );
|
SetFontForeground( FONT_RED );
|
||||||
|
|
||||||
// yesterdays debits
|
// yesterdays debits
|
||||||
iBalance = GetYesterdaysDebits( );
|
|
||||||
if( iBalance < 0 )
|
if( iBalance < 0 )
|
||||||
{
|
{
|
||||||
SetFontForeground( FONT_RED );
|
SetFontForeground( FONT_RED );
|
||||||
iBalance *= -1;
|
iBalance *= -1;
|
||||||
}
|
}
|
||||||
|
tmp = FormatMoney(iBalance);
|
||||||
|
|
||||||
swprintf(pString, L"%d", iBalance );
|
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0, tmp.data(),FINANCE_TEXT_FONT, &usX, &usY);
|
||||||
|
|
||||||
InsertCommasForDollarFigure( pString );
|
mprintf(usX,YESTERDAYS_DEBITS,tmp.data());
|
||||||
if( iBalance != 0 )
|
|
||||||
InsertDollarSignInToString( pString );
|
|
||||||
|
|
||||||
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,pString,FINANCE_TEXT_FONT, &usX, &usY);
|
|
||||||
|
|
||||||
mprintf(usX,YESTERDAYS_DEBITS,pString);
|
|
||||||
|
|
||||||
SetFontForeground( FONT_BLACK );
|
SetFontForeground( FONT_BLACK );
|
||||||
|
|
||||||
// yesterdays balance..ending balance..so todays balance then
|
// yesterdays balance..ending balance..so todays balance then
|
||||||
iBalance = GetTodaysBalance( );
|
iBalance = GetTodaysBalance( );
|
||||||
|
|
||||||
if( iBalance < 0 )
|
if( iBalance < 0 )
|
||||||
{
|
{
|
||||||
SetFontForeground( FONT_RED );
|
SetFontForeground( FONT_RED );
|
||||||
iBalance *= -1;
|
iBalance *= -1;
|
||||||
}
|
}
|
||||||
|
tmp = FormatMoney(iBalance);
|
||||||
|
|
||||||
swprintf(pString, L"%d", iBalance );
|
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0, tmp.data(),FINANCE_TEXT_FONT, &usX, &usY);
|
||||||
InsertCommasForDollarFigure( pString );
|
|
||||||
if( iBalance != 0 )
|
|
||||||
InsertDollarSignInToString( pString );
|
|
||||||
|
|
||||||
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,pString,FINANCE_TEXT_FONT, &usX, &usY);
|
mprintf(usX,YESTERDAYS_BALANCE,tmp.data());
|
||||||
|
|
||||||
mprintf(usX,YESTERDAYS_BALANCE,pString);
|
|
||||||
|
|
||||||
SetFontForeground( FONT_BLACK );
|
SetFontForeground( FONT_BLACK );
|
||||||
|
|
||||||
// todays income
|
// todays income
|
||||||
iBalance = GetTodaysDaysIncome( );
|
iBalance = GetTodaysDaysIncome( );
|
||||||
swprintf(pString, L"%d", iBalance );
|
tmp = FormatMoney(iBalance);
|
||||||
|
|
||||||
InsertCommasForDollarFigure( pString );
|
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,tmp.data(),FINANCE_TEXT_FONT, &usX, &usY);
|
||||||
if( iBalance != 0 )
|
|
||||||
InsertDollarSignInToString( pString );
|
|
||||||
|
|
||||||
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,pString,FINANCE_TEXT_FONT, &usX, &usY);
|
mprintf(usX,TODAYS_INCOME,tmp.data());
|
||||||
|
|
||||||
mprintf(usX,TODAYS_INCOME,pString);
|
|
||||||
|
|
||||||
SetFontForeground( FONT_BLACK );
|
SetFontForeground( FONT_BLACK );
|
||||||
|
|
||||||
// todays other
|
// todays other
|
||||||
iBalance = GetTodaysOtherDeposits( );
|
iBalance = GetTodaysOtherDeposits( );
|
||||||
swprintf(pString, L"%d", iBalance );
|
tmp = FormatMoney(iBalance);
|
||||||
|
|
||||||
InsertCommasForDollarFigure( pString );
|
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,tmp.data(),FINANCE_TEXT_FONT, &usX, &usY);
|
||||||
if( iBalance != 0 )
|
|
||||||
InsertDollarSignInToString( pString );
|
|
||||||
|
|
||||||
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,pString,FINANCE_TEXT_FONT, &usX, &usY);
|
mprintf(usX,TODAYS_OTHER,tmp.data());
|
||||||
|
|
||||||
mprintf(usX,TODAYS_OTHER,pString);
|
|
||||||
|
|
||||||
SetFontForeground( FONT_RED );
|
SetFontForeground( FONT_RED );
|
||||||
|
|
||||||
@@ -1053,15 +999,11 @@ void DrawSummaryText( void )
|
|||||||
iBalance *= ( -1 );
|
iBalance *= ( -1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
swprintf(pString, L"%d", iBalance );
|
tmp = FormatMoney(iBalance);
|
||||||
|
|
||||||
InsertCommasForDollarFigure( pString );
|
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,tmp.data(),FINANCE_TEXT_FONT, &usX, &usY);
|
||||||
if( iBalance != 0 )
|
|
||||||
InsertDollarSignInToString( pString );
|
|
||||||
|
|
||||||
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,pString,FINANCE_TEXT_FONT, &usX, &usY);
|
mprintf(usX,TODAYS_DEBITS,tmp.data());
|
||||||
|
|
||||||
mprintf(usX,TODAYS_DEBITS,pString);
|
|
||||||
|
|
||||||
SetFontForeground( FONT_BLACK );
|
SetFontForeground( FONT_BLACK );
|
||||||
|
|
||||||
@@ -1069,36 +1011,23 @@ void DrawSummaryText( void )
|
|||||||
iBalance = GetCurrentBalance( );
|
iBalance = GetCurrentBalance( );
|
||||||
if( iBalance < 0 )
|
if( iBalance < 0 )
|
||||||
{
|
{
|
||||||
iBalance *= -1;
|
|
||||||
SetFontForeground( FONT_RED );
|
SetFontForeground( FONT_RED );
|
||||||
swprintf(pString, L"%d", iBalance );
|
|
||||||
iBalance *= -1;
|
iBalance *= -1;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
swprintf(pString, L"%d", iBalance );
|
|
||||||
}
|
|
||||||
|
|
||||||
InsertCommasForDollarFigure( pString );
|
tmp = FormatMoney(iBalance);
|
||||||
if( iBalance != 0 )
|
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,tmp.data(),FINANCE_TEXT_FONT, &usX, &usY);
|
||||||
InsertDollarSignInToString( pString );
|
mprintf(usX,TODAYS_CURRENT_BALANCE,tmp.data());
|
||||||
|
|
||||||
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,pString,FINANCE_TEXT_FONT, &usX, &usY);
|
|
||||||
mprintf(usX,TODAYS_CURRENT_BALANCE,pString);
|
|
||||||
SetFontForeground( FONT_BLACK );
|
SetFontForeground( FONT_BLACK );
|
||||||
|
|
||||||
|
|
||||||
// todays forcast income
|
// todays forcast income
|
||||||
iBalance = GetProjectedTotalDailyIncome( );
|
iBalance = GetProjectedTotalDailyIncome( );
|
||||||
swprintf(pString, L"%d", iBalance );
|
tmp = FormatMoney(iBalance);
|
||||||
|
|
||||||
InsertCommasForDollarFigure( pString );
|
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,tmp.data(),FINANCE_TEXT_FONT, &usX, &usY);
|
||||||
if( iBalance != 0 )
|
|
||||||
InsertDollarSignInToString( pString );
|
|
||||||
|
|
||||||
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,pString,FINANCE_TEXT_FONT, &usX, &usY);
|
mprintf(usX,TODAYS_CURRENT_FORCAST_INCOME,tmp.data());
|
||||||
|
|
||||||
mprintf(usX,TODAYS_CURRENT_FORCAST_INCOME,pString);
|
|
||||||
|
|
||||||
SetFontForeground( FONT_BLACK );
|
SetFontForeground( FONT_BLACK );
|
||||||
|
|
||||||
@@ -1107,22 +1036,13 @@ void DrawSummaryText( void )
|
|||||||
iBalance = GetCurrentBalance( ) + GetProjectedTotalDailyIncome( );
|
iBalance = GetCurrentBalance( ) + GetProjectedTotalDailyIncome( );
|
||||||
if( iBalance < 0 )
|
if( iBalance < 0 )
|
||||||
{
|
{
|
||||||
iBalance *= -1;
|
|
||||||
SetFontForeground( FONT_RED );
|
SetFontForeground( FONT_RED );
|
||||||
swprintf(pString, L"%d", iBalance );
|
|
||||||
iBalance *= -1;
|
iBalance *= -1;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
swprintf(pString, L"%d", iBalance );
|
|
||||||
}
|
|
||||||
|
|
||||||
InsertCommasForDollarFigure( pString );
|
tmp = FormatMoney(iBalance);
|
||||||
if( iBalance != 0 )
|
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,tmp.data(),FINANCE_TEXT_FONT, &usX, &usY);
|
||||||
InsertDollarSignInToString( pString );
|
mprintf(usX,TODAYS_CURRENT_FORCAST_BALANCE,tmp.data());
|
||||||
|
|
||||||
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,pString,FINANCE_TEXT_FONT, &usX, &usY);
|
|
||||||
mprintf(usX,TODAYS_CURRENT_FORCAST_BALANCE,pString);
|
|
||||||
SetFontForeground( FONT_BLACK );
|
SetFontForeground( FONT_BLACK );
|
||||||
|
|
||||||
|
|
||||||
@@ -1990,96 +1910,6 @@ BOOLEAN LoadInRecords( UINT32 uiPage )
|
|||||||
return( TRUE );
|
return( TRUE );
|
||||||
}
|
}
|
||||||
|
|
||||||
void InsertCommasForDollarFigure( STR16 pString )
|
|
||||||
{
|
|
||||||
INT16 sCounter =0;
|
|
||||||
INT16 sZeroCount =0;
|
|
||||||
INT16 sTempCounter = 0;
|
|
||||||
INT16 sEndPosition = 0;
|
|
||||||
|
|
||||||
// go to end of dollar figure
|
|
||||||
while( pString[ sCounter ] != 0 )
|
|
||||||
{
|
|
||||||
sCounter++;
|
|
||||||
}
|
|
||||||
|
|
||||||
// negative?
|
|
||||||
if( pString[0] == '-' )
|
|
||||||
{
|
|
||||||
// stop one slot in advance of normal
|
|
||||||
sEndPosition = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// is there under $1,000?
|
|
||||||
if( sCounter < 4 )
|
|
||||||
{
|
|
||||||
// can't do anything, return
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// at end, start backing up until beginning
|
|
||||||
while( sCounter > sEndPosition )
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
// enough for a comma?
|
|
||||||
if( sZeroCount==3 )
|
|
||||||
{
|
|
||||||
// reset count
|
|
||||||
sZeroCount =0;
|
|
||||||
// set tempcounter to current counter
|
|
||||||
sTempCounter = sCounter;
|
|
||||||
|
|
||||||
// run until end
|
|
||||||
while( pString[ sTempCounter ] != 0 )
|
|
||||||
{
|
|
||||||
sTempCounter++;
|
|
||||||
}
|
|
||||||
// now shift everything over ot the right one place until sTempCounter = sCounter
|
|
||||||
while( sTempCounter >= sCounter )
|
|
||||||
{
|
|
||||||
pString[ sTempCounter+1 ] = pString[ sTempCounter ];
|
|
||||||
sTempCounter--;
|
|
||||||
}
|
|
||||||
// now insert comma
|
|
||||||
pString[ sCounter ]=L',';
|
|
||||||
}
|
|
||||||
|
|
||||||
// increment count of digits
|
|
||||||
sZeroCount++;
|
|
||||||
|
|
||||||
// decrement counter
|
|
||||||
sCounter--;
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void InsertDollarSignInToString( STR16 pString )
|
|
||||||
{
|
|
||||||
// run to end of string, copy everything in string 2 places right, insert a space at pString[ 1 ] and a L'$' at pString[ 0 ]
|
|
||||||
|
|
||||||
INT32 iCounter =0;
|
|
||||||
|
|
||||||
// run to end of string
|
|
||||||
while( pString[ iCounter ] != 0 )
|
|
||||||
{
|
|
||||||
iCounter++;
|
|
||||||
}
|
|
||||||
|
|
||||||
// now copy over
|
|
||||||
while( iCounter >= 0 )
|
|
||||||
{
|
|
||||||
pString[ iCounter + 1] = pString[ iCounter ];
|
|
||||||
iCounter--;
|
|
||||||
}
|
|
||||||
|
|
||||||
pString[ 0 ] = L'$';
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
INT32 GetPreviousBalanceToDate( void )
|
INT32 GetPreviousBalanceToDate( void )
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@@ -73,8 +73,6 @@ typedef struct finance *FinanceUnitPtr;
|
|||||||
extern FinanceUnitPtr pFinanceListHead;
|
extern FinanceUnitPtr pFinanceListHead;
|
||||||
//extern INT32 iCurrentBalance;
|
//extern INT32 iCurrentBalance;
|
||||||
UINT32 AddTransactionToPlayersBook(UINT8 ubCode, UINT8 ubSecondCode, UINT32 uiDate, INT32 iAmount);
|
UINT32 AddTransactionToPlayersBook(UINT8 ubCode, UINT8 ubSecondCode, UINT32 uiDate, INT32 iAmount);
|
||||||
void InsertDollarSignInToString( STR16 pString );
|
|
||||||
void InsertCommasForDollarFigure( STR16 pString );
|
|
||||||
INT32 GetTodaysDaysIncome( void );
|
INT32 GetTodaysDaysIncome( void );
|
||||||
INT32 GetProjectedTotalDailyIncome( void );
|
INT32 GetProjectedTotalDailyIncome( void );
|
||||||
INT32 GetProjectedExpenses( void ); // HEADROCK HAM 3.6: Projected daily expenses.
|
INT32 GetProjectedExpenses( void ); // HEADROCK HAM 3.6: Projected daily expenses.
|
||||||
|
|||||||
@@ -163,11 +163,11 @@ BOOLEAN DisplayOrderGrid( UINT8 ubGridNumber, UINT8 ubMercID );
|
|||||||
INT8 GetNumberOfHireMercsStartingFromID( UINT8 ubStartMercID );
|
INT8 GetNumberOfHireMercsStartingFromID( UINT8 ubStartMercID );
|
||||||
//INT32 CalculateInsuranceCost( SOLDIERTYPE *pSoldier, BOOLEAN fHaveInsurance );
|
//INT32 CalculateInsuranceCost( SOLDIERTYPE *pSoldier, BOOLEAN fHaveInsurance );
|
||||||
void InsuranceContractUserTextFieldCallBack( UINT8 ubID, BOOLEAN fEntering );
|
void InsuranceContractUserTextFieldCallBack( UINT8 ubID, BOOLEAN fEntering );
|
||||||
INT8 CountInsurableMercs();
|
UINT16 CountInsurableMercs();
|
||||||
void DisableInsuranceContractNextPreviousbuttons();
|
void DisableInsuranceContractNextPreviousbuttons();
|
||||||
void CreateDestroyInsuranceContractFormButtons( BOOLEAN fCreate);
|
void CreateDestroyInsuranceContractFormButtons( BOOLEAN fCreate);
|
||||||
void HandleAcceptButton( UINT8 ubSoldierID, UINT8 ubFormID );
|
void HandleAcceptButton( SoldierID ubSoldierID, UINT8 ubFormID );
|
||||||
FLOAT DiffFromNormRatio( INT16 sThisValue, INT16 sNormalValue );
|
FLOAT DiffFromNormRatio( INT16 sThisValue, INT16 sNormalValue );
|
||||||
void InsContractNoMercsPopupCallBack( UINT8 bExitValue );
|
void InsContractNoMercsPopupCallBack( UINT8 bExitValue );
|
||||||
void BuildInsuranceArray();
|
void BuildInsuranceArray();
|
||||||
BOOLEAN MercIsInsurable( SOLDIERTYPE *pSoldier );
|
BOOLEAN MercIsInsurable( SOLDIERTYPE *pSoldier );
|
||||||
@@ -177,8 +177,8 @@ UINT32 GetTimeRemainingOnSoldiersContract( SOLDIERTYPE *pSoldier );
|
|||||||
UINT32 GetTimeRemainingOnSoldiersInsuranceContract( SOLDIERTYPE *pSoldier );
|
UINT32 GetTimeRemainingOnSoldiersInsuranceContract( SOLDIERTYPE *pSoldier );
|
||||||
void EnableDisableIndividualInsuranceContractButton( UINT8 ubMercIDForMercInForm1, UINT32 *puiAcceptButton );
|
void EnableDisableIndividualInsuranceContractButton( UINT8 ubMercIDForMercInForm1, UINT32 *puiAcceptButton );
|
||||||
BOOLEAN CanSoldierExtendInsuranceContract( SOLDIERTYPE *pSoldier );
|
BOOLEAN CanSoldierExtendInsuranceContract( SOLDIERTYPE *pSoldier );
|
||||||
INT32 CalculateSoldiersInsuranceContractLength( SOLDIERTYPE *pSoldier );
|
INT32 CalculateSoldiersInsuranceContractLength( SOLDIERTYPE *pSoldier );
|
||||||
INT32 CalcStartDayOfInsurance( SOLDIERTYPE *pSoldier );
|
INT32 CalcStartDayOfInsurance( SOLDIERTYPE *pSoldier );
|
||||||
|
|
||||||
BOOLEAN AreAnyAimMercsOnTeam( );
|
BOOLEAN AreAnyAimMercsOnTeam( );
|
||||||
//ppp
|
//ppp
|
||||||
@@ -394,12 +394,14 @@ void RenderInsuranceContract()
|
|||||||
{
|
{
|
||||||
sMercID = gubInsuranceMercArray[ sNextMercID ];
|
sMercID = gubInsuranceMercArray[ sNextMercID ];
|
||||||
|
|
||||||
pSoldier = &Menptr[ GetSoldierIDFromMercID( (UINT8) sMercID ) ];
|
SoldierID ID = GetSoldierIDFromMercID( sMercID );
|
||||||
|
if ( ID != NOBODY )
|
||||||
if( ( sMercID != -1 ) && MercIsInsurable( pSoldier ) )
|
|
||||||
{
|
{
|
||||||
DisplayOrderGrid( ubCount, (UINT8)sMercID );
|
if( ( sMercID != -1 ) && MercIsInsurable( ID ) )
|
||||||
ubCount++;
|
{
|
||||||
|
DisplayOrderGrid( ubCount, (UINT8)sMercID );
|
||||||
|
ubCount++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sNextMercID++;
|
sNextMercID++;
|
||||||
@@ -499,18 +501,22 @@ void BtnInsContractNextButtonCallBack(GUI_BUTTON *btn,INT32 reason)
|
|||||||
|
|
||||||
BOOLEAN DisplayOrderGrid( UINT8 ubGridNumber, UINT8 ubMercID )
|
BOOLEAN DisplayOrderGrid( UINT8 ubGridNumber, UINT8 ubMercID )
|
||||||
{
|
{
|
||||||
VOBJECT_DESC VObjectDesc;
|
VOBJECT_DESC VObjectDesc;
|
||||||
HVOBJECT hPixHandle;
|
HVOBJECT hPixHandle;
|
||||||
UINT16 usPosX, usPosY;
|
UINT16 usPosX, usPosY;
|
||||||
UINT32 uiInsMercFaceImage;
|
UINT32 uiInsMercFaceImage;
|
||||||
INT32 iCostOfContract=0;
|
INT32 iCostOfContract=0;
|
||||||
char sTemp[100];
|
char sTemp[100];
|
||||||
CHAR16 sText[800];
|
CHAR16 sText[800];
|
||||||
BOOLEAN fDisplayMercContractStateTextColorInRed = FALSE;
|
BOOLEAN fDisplayMercContractStateTextColorInRed = FALSE;
|
||||||
|
SoldierID usID = GetSoldierIDFromMercID( ubMercID );
|
||||||
SOLDIERTYPE *pSoldier = &Menptr[ GetSoldierIDFromMercID( ubMercID ) ];
|
|
||||||
|
|
||||||
|
if ( usID == NOBODY )
|
||||||
|
{
|
||||||
|
return(FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
SOLDIERTYPE *pSoldier = usID;
|
||||||
usPosX=usPosY=0;
|
usPosX=usPosY=0;
|
||||||
|
|
||||||
switch( ubGridNumber )
|
switch( ubGridNumber )
|
||||||
@@ -694,6 +700,7 @@ BOOLEAN DisplayOrderGrid( UINT8 ubGridNumber, UINT8 ubMercID )
|
|||||||
iCostOfContract = 0;
|
iCostOfContract = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::wstring amountRefund{};
|
||||||
if( iCostOfContract < 0 )
|
if( iCostOfContract < 0 )
|
||||||
{
|
{
|
||||||
//shouldnt get in here now since we can longer give refunds
|
//shouldnt get in here now since we can longer give refunds
|
||||||
@@ -706,19 +713,16 @@ BOOLEAN DisplayOrderGrid( UINT8 ubGridNumber, UINT8 ubMercID )
|
|||||||
DrawTextToScreen( sText, (UINT16)(usPosX+INS_CTRCT_EMPLYMNT_CNTRCT_TEXT_OFFSET_X), INS_CTRCT_ORDER_GRID1_Y+INS_CTRCT_PREMIUM_OWING_OFFSET_Y, INS_CTRCT_ORDER_GRID_WIDTH, INS_FONT_MED, INS_FONT_COLOR, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
|
DrawTextToScreen( sText, (UINT16)(usPosX+INS_CTRCT_EMPLYMNT_CNTRCT_TEXT_OFFSET_X), INS_CTRCT_ORDER_GRID1_Y+INS_CTRCT_PREMIUM_OWING_OFFSET_Y, INS_CTRCT_ORDER_GRID_WIDTH, INS_FONT_MED, INS_FONT_COLOR, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
|
||||||
|
|
||||||
//display the amount of refund
|
//display the amount of refund
|
||||||
swprintf( sText, L"%d", iCostOfContract );
|
amountRefund = FormatMoney(iCostOfContract);
|
||||||
InsertCommasForDollarFigure( sText );
|
|
||||||
InsertDollarSignInToString( sText );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if( IsMercDead( ubMercID ) )
|
if( IsMercDead( ubMercID ) )
|
||||||
{
|
{
|
||||||
swprintf( sText, L"0");
|
amountRefund = L"$0";
|
||||||
InsertDollarSignInToString( sText );
|
|
||||||
}
|
}
|
||||||
//display the amount owing
|
//display the amount owing
|
||||||
DrawTextToScreen( sText, (UINT16)(usPosX+32), INS_CTRCT_ORDER_GRID1_Y+179, 72, INS_FONT_MED, INS_FONT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
|
DrawTextToScreen( amountRefund.data(), (UINT16)(usPosX + 32), INS_CTRCT_ORDER_GRID1_Y + 179, 72, INS_FONT_MED, INS_FONT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -747,8 +751,8 @@ void BtnInsuranceAcceptClearForm1ButtonCallback(GUI_BUTTON *btn,INT32 reason)
|
|||||||
{
|
{
|
||||||
if (btn->uiFlags & BUTTON_CLICKED_ON)
|
if (btn->uiFlags & BUTTON_CLICKED_ON)
|
||||||
{
|
{
|
||||||
UINT8 ubButton = (UINT8) MSYS_GetBtnUserData( btn, 0 );
|
UINT8 ubButton = (UINT8) MSYS_GetBtnUserData( btn, 0 );
|
||||||
UINT8 ubSoldierID = (UINT8) GetSoldierIDFromMercID( gubMercIDForMercInForm1 );
|
SoldierID ubSoldierID = GetSoldierIDFromMercID( gubMercIDForMercInForm1 );
|
||||||
|
|
||||||
btn->uiFlags &= (~BUTTON_CLICKED_ON );
|
btn->uiFlags &= (~BUTTON_CLICKED_ON );
|
||||||
|
|
||||||
@@ -759,7 +763,7 @@ void BtnInsuranceAcceptClearForm1ButtonCallback(GUI_BUTTON *btn,INT32 reason)
|
|||||||
HandleAcceptButton( ubSoldierID, 1 );
|
HandleAcceptButton( ubSoldierID, 1 );
|
||||||
|
|
||||||
//specify the length of the insurance contract
|
//specify the length of the insurance contract
|
||||||
Menptr[ ubSoldierID ].iTotalLengthOfInsuranceContract = gsForm1InsuranceLengthNumber;
|
ubSoldierID->iTotalLengthOfInsuranceContract = gsForm1InsuranceLengthNumber;
|
||||||
|
|
||||||
//reset the insurance length
|
//reset the insurance length
|
||||||
gsForm1InsuranceLengthNumber = 0;
|
gsForm1InsuranceLengthNumber = 0;
|
||||||
@@ -791,8 +795,8 @@ void BtnInsuranceAcceptClearForm2ButtonCallback(GUI_BUTTON *btn,INT32 reason)
|
|||||||
{
|
{
|
||||||
if (btn->uiFlags & BUTTON_CLICKED_ON)
|
if (btn->uiFlags & BUTTON_CLICKED_ON)
|
||||||
{
|
{
|
||||||
UINT8 ubButton = (UINT8) MSYS_GetBtnUserData( btn, 0 );
|
UINT8 ubButton = (UINT8) MSYS_GetBtnUserData( btn, 0 );
|
||||||
UINT8 ubSoldierID = (UINT8) GetSoldierIDFromMercID( gubMercIDForMercInForm2 );
|
SoldierID ubSoldierID = GetSoldierIDFromMercID( gubMercIDForMercInForm2 );
|
||||||
|
|
||||||
btn->uiFlags &= (~BUTTON_CLICKED_ON );
|
btn->uiFlags &= (~BUTTON_CLICKED_ON );
|
||||||
|
|
||||||
@@ -803,7 +807,7 @@ void BtnInsuranceAcceptClearForm2ButtonCallback(GUI_BUTTON *btn,INT32 reason)
|
|||||||
HandleAcceptButton( ubSoldierID, 2 );
|
HandleAcceptButton( ubSoldierID, 2 );
|
||||||
|
|
||||||
//specify the length of the insurance contract
|
//specify the length of the insurance contract
|
||||||
Menptr[ ubSoldierID ].iTotalLengthOfInsuranceContract = gsForm2InsuranceLengthNumber;
|
ubSoldierID->iTotalLengthOfInsuranceContract = gsForm2InsuranceLengthNumber;
|
||||||
|
|
||||||
//reset the insurance length
|
//reset the insurance length
|
||||||
gsForm2InsuranceLengthNumber = 0;
|
gsForm2InsuranceLengthNumber = 0;
|
||||||
@@ -836,8 +840,8 @@ void BtnInsuranceAcceptClearForm3ButtonCallback(GUI_BUTTON *btn,INT32 reason)
|
|||||||
{
|
{
|
||||||
if (btn->uiFlags & BUTTON_CLICKED_ON)
|
if (btn->uiFlags & BUTTON_CLICKED_ON)
|
||||||
{
|
{
|
||||||
UINT8 ubButton = (UINT8) MSYS_GetBtnUserData( btn, 0 );
|
UINT8 ubButton = (UINT8) MSYS_GetBtnUserData( btn, 0 );
|
||||||
UINT8 ubSoldierID = (UINT8) GetSoldierIDFromMercID( gubMercIDForMercInForm3 );
|
SoldierID ubSoldierID = GetSoldierIDFromMercID( gubMercIDForMercInForm3 );
|
||||||
|
|
||||||
btn->uiFlags &= (~BUTTON_CLICKED_ON );
|
btn->uiFlags &= (~BUTTON_CLICKED_ON );
|
||||||
|
|
||||||
@@ -848,7 +852,7 @@ void BtnInsuranceAcceptClearForm3ButtonCallback(GUI_BUTTON *btn,INT32 reason)
|
|||||||
HandleAcceptButton( ubSoldierID, 3 );
|
HandleAcceptButton( ubSoldierID, 3 );
|
||||||
|
|
||||||
//specify the length of the insurance contract
|
//specify the length of the insurance contract
|
||||||
Menptr[ ubSoldierID ].iTotalLengthOfInsuranceContract = gsForm3InsuranceLengthNumber;
|
ubSoldierID->iTotalLengthOfInsuranceContract = gsForm3InsuranceLengthNumber;
|
||||||
|
|
||||||
//reset the insurance length
|
//reset the insurance length
|
||||||
gsForm3InsuranceLengthNumber = 0;
|
gsForm3InsuranceLengthNumber = 0;
|
||||||
@@ -937,20 +941,17 @@ void SelectInsuranceContractRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
INT8 CountInsurableMercs()
|
UINT16 CountInsurableMercs()
|
||||||
{
|
{
|
||||||
INT16 cnt;
|
UINT16 bCount = 0;
|
||||||
SOLDIERTYPE *pSoldier;
|
|
||||||
INT16 bLastTeamID;
|
|
||||||
INT8 bCount=0;
|
|
||||||
|
|
||||||
// Set locator to first merc
|
// Set locator to first merc
|
||||||
cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
SoldierID Soldier = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||||
bLastTeamID = gTacticalStatus.Team[ gbPlayerNum ].bLastID;
|
SoldierID bLastTeamID = gTacticalStatus.Team[ gbPlayerNum ].bLastID;
|
||||||
|
|
||||||
for ( pSoldier = MercPtrs[ cnt ]; cnt <= bLastTeamID; cnt++,pSoldier++)
|
for ( ; Soldier <= bLastTeamID; ++Soldier)
|
||||||
{
|
{
|
||||||
if (MercIsInsurable(pSoldier))
|
if (MercIsInsurable(Soldier))
|
||||||
{
|
{
|
||||||
bCount++;
|
bCount++;
|
||||||
}
|
}
|
||||||
@@ -1067,12 +1068,12 @@ void CreateDestroyInsuranceContractFormButtons( BOOLEAN fCreate)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void HandleAcceptButton( UINT8 ubSoldierID, UINT8 ubFormID )
|
void HandleAcceptButton( SoldierID ubSoldierID, UINT8 ubFormID )
|
||||||
{
|
{
|
||||||
//passed in either 1,2,3 should be 0,1,2
|
//passed in either 1,2,3 should be 0,1,2
|
||||||
ubFormID--;
|
ubFormID--;
|
||||||
|
|
||||||
PurchaseOrExtendInsuranceForSoldier( &Menptr[ ubSoldierID ], CalculateSoldiersInsuranceContractLength( &Menptr[ ubSoldierID ] ) );
|
PurchaseOrExtendInsuranceForSoldier( ubSoldierID, CalculateSoldiersInsuranceContractLength( ubSoldierID ) );
|
||||||
|
|
||||||
RenderInsuranceContract();
|
RenderInsuranceContract();
|
||||||
}
|
}
|
||||||
@@ -1088,33 +1089,29 @@ void HandleAcceptButton( UINT8 ubSoldierID, UINT8 ubFormID )
|
|||||||
// determines if a merc will run out of their insurance contract
|
// determines if a merc will run out of their insurance contract
|
||||||
void DailyUpdateOfInsuredMercs()
|
void DailyUpdateOfInsuredMercs()
|
||||||
{
|
{
|
||||||
INT16 cnt;
|
SoldierID Soldier = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||||
INT16 bLastTeamID;
|
SoldierID bLastTeamID = gTacticalStatus.Team[gbPlayerNum].bLastID;
|
||||||
SOLDIERTYPE *pSoldier;
|
|
||||||
|
|
||||||
cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
for ( ; Soldier <= bLastTeamID; ++Soldier)
|
||||||
bLastTeamID = gTacticalStatus.Team[ gbPlayerNum ].bLastID;
|
|
||||||
|
|
||||||
for ( pSoldier = MercPtrs[ cnt ]; cnt <= bLastTeamID; cnt++,pSoldier++)
|
|
||||||
{
|
{
|
||||||
//if the soldier is in the team array
|
//if the soldier is in the team array
|
||||||
if( pSoldier->bActive )
|
if( Soldier->bActive )
|
||||||
{
|
{
|
||||||
//if the merc has life insurance
|
//if the merc has life insurance
|
||||||
if( pSoldier->usLifeInsurance )
|
if( Soldier->usLifeInsurance )
|
||||||
{
|
{
|
||||||
//if the merc wasn't just hired
|
//if the merc wasn't just hired
|
||||||
if( (INT16)GetWorldDay() != pSoldier->iStartOfInsuranceContract )
|
if( (INT16)GetWorldDay() != Soldier->iStartOfInsuranceContract )
|
||||||
{
|
{
|
||||||
//if the contract has run out of time
|
//if the contract has run out of time
|
||||||
if( GetTimeRemainingOnSoldiersInsuranceContract( pSoldier ) <= 0 )
|
if( GetTimeRemainingOnSoldiersInsuranceContract( Soldier ) <= 0 )
|
||||||
{
|
{
|
||||||
//if the soldier isn't dead
|
//if the soldier isn't dead
|
||||||
if( !IsMercDead( pSoldier->ubProfile ) )
|
if( !IsMercDead( Soldier->ubProfile ) )
|
||||||
{
|
{
|
||||||
pSoldier->usLifeInsurance = 0;
|
Soldier->usLifeInsurance = 0;
|
||||||
pSoldier->iTotalLengthOfInsuranceContract = 0;
|
Soldier->iTotalLengthOfInsuranceContract = 0;
|
||||||
pSoldier->iStartOfInsuranceContract = 0;
|
Soldier->iStartOfInsuranceContract = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1139,7 +1136,7 @@ INT32 CalculateInsuranceContractCost( INT32 iLength, UINT8 ubMercID )
|
|||||||
SOLDIERTYPE *pSoldier;
|
SOLDIERTYPE *pSoldier;
|
||||||
|
|
||||||
|
|
||||||
pSoldier = &Menptr[ GetSoldierIDFromMercID( ubMercID ) ];
|
pSoldier = GetSoldierIDFromMercID( ubMercID );
|
||||||
|
|
||||||
|
|
||||||
// only mercs with at least 2 days to go on their employment contract are insurable
|
// only mercs with at least 2 days to go on their employment contract are insurable
|
||||||
@@ -1248,20 +1245,16 @@ void InsContractNoMercsPopupCallBack( UINT8 bExitValue )
|
|||||||
|
|
||||||
void BuildInsuranceArray()
|
void BuildInsuranceArray()
|
||||||
{
|
{
|
||||||
INT16 cnt;
|
SoldierID Soldier = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||||
SOLDIERTYPE *pSoldier;
|
SoldierID bLastTeamID = gTacticalStatus.Team[gbPlayerNum].bLastID;
|
||||||
INT16 bLastTeamID;
|
|
||||||
|
|
||||||
cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
|
||||||
bLastTeamID = gTacticalStatus.Team[ gbPlayerNum ].bLastID;
|
|
||||||
gsMaxPlayersOnTeam = 0;
|
gsMaxPlayersOnTeam = 0;
|
||||||
|
|
||||||
// store profile #s of all insurable mercs in an array
|
// store profile #s of all insurable mercs in an array
|
||||||
for ( pSoldier = MercPtrs[ cnt ]; cnt <= bLastTeamID; cnt++,pSoldier++)
|
for ( ; Soldier <= bLastTeamID; ++Soldier)
|
||||||
{
|
{
|
||||||
if( MercIsInsurable(pSoldier) )
|
if( MercIsInsurable(Soldier) )
|
||||||
{
|
{
|
||||||
gubInsuranceMercArray[ gsMaxPlayersOnTeam ] = pSoldier->ubProfile;
|
gubInsuranceMercArray[ gsMaxPlayersOnTeam ] = Soldier->ubProfile;
|
||||||
gsMaxPlayersOnTeam++;
|
gsMaxPlayersOnTeam++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1355,7 +1348,7 @@ BOOLEAN AddLifeInsurancePayout( SOLDIERTYPE *pSoldier )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void StartInsuranceInvestigation( UINT8 ubPayoutID )
|
void StartInsuranceInvestigation( UINT16 ubPayoutID )
|
||||||
{
|
{
|
||||||
UINT8 ubDays;
|
UINT8 ubDays;
|
||||||
|
|
||||||
@@ -1408,7 +1401,7 @@ void StartInsuranceInvestigation( UINT8 ubPayoutID )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void EndInsuranceInvestigation( UINT8 ubPayoutID )
|
void EndInsuranceInvestigation( UINT16 ubPayoutID )
|
||||||
{
|
{
|
||||||
// send an email telling player the investigation is over
|
// send an email telling player the investigation is over
|
||||||
if ( gMercProfiles[ LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID ].ubSuspiciousDeath == VERY_SUSPICIOUS_DEATH )
|
if ( gMercProfiles[ LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID ].ubSuspiciousDeath == VERY_SUSPICIOUS_DEATH )
|
||||||
@@ -1455,14 +1448,14 @@ void EndInsuranceInvestigation( UINT8 ubPayoutID )
|
|||||||
|
|
||||||
|
|
||||||
//void InsuranceContractPayLifeInsuranceForDeadMerc( LIFE_INSURANCE_PAYOUT *pPayoutStruct )
|
//void InsuranceContractPayLifeInsuranceForDeadMerc( LIFE_INSURANCE_PAYOUT *pPayoutStruct )
|
||||||
void InsuranceContractPayLifeInsuranceForDeadMerc( UINT8 ubPayoutID )
|
void InsuranceContractPayLifeInsuranceForDeadMerc( UINT16 ubPayoutID )
|
||||||
{
|
{
|
||||||
//if the mercs id number is the same what is in the soldier array
|
//if the mercs id number is the same what is in the soldier array
|
||||||
if( LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubSoldierID == Menptr[ LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubSoldierID ].ubID )
|
if( LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubSoldierID == LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubSoldierID->ubID )
|
||||||
{
|
{
|
||||||
// and if the soldier is still active ( player hasn't removed carcass yet ), reset insurance flag
|
// and if the soldier is still active ( player hasn't removed carcass yet ), reset insurance flag
|
||||||
if( Menptr[ LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubSoldierID ].bActive )
|
if( LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubSoldierID->bActive )
|
||||||
Menptr[ LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubSoldierID ].usLifeInsurance = 0;
|
LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubSoldierID->usLifeInsurance = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//add transaction to players account
|
//add transaction to players account
|
||||||
@@ -1552,14 +1545,12 @@ void EnableDisableInsuranceContractAcceptButtons()
|
|||||||
|
|
||||||
void EnableDisableIndividualInsuranceContractButton( UINT8 ubMercIDForMercInForm, UINT32 *puiAcceptButton )
|
void EnableDisableIndividualInsuranceContractButton( UINT8 ubMercIDForMercInForm, UINT32 *puiAcceptButton )
|
||||||
{
|
{
|
||||||
INT16 sSoldierID = 0;
|
SoldierID sSoldierID = GetSoldierIDFromMercID( ubMercIDForMercInForm );
|
||||||
|
if( sSoldierID == NOBODY)
|
||||||
sSoldierID = GetSoldierIDFromMercID( ubMercIDForMercInForm );
|
|
||||||
if( sSoldierID == - 1)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// if the soldiers contract can be extended, enable the button
|
// if the soldiers contract can be extended, enable the button
|
||||||
if( CanSoldierExtendInsuranceContract( &Menptr[ sSoldierID ] ) )
|
if( CanSoldierExtendInsuranceContract( sSoldierID ) )
|
||||||
EnableButton( *puiAcceptButton );
|
EnableButton( *puiAcceptButton );
|
||||||
|
|
||||||
// else the soldier cant extend their insurance contract, disable the button
|
// else the soldier cant extend their insurance contract, disable the button
|
||||||
@@ -1783,14 +1774,13 @@ INT32 CalcStartDayOfInsurance( SOLDIERTYPE *pSoldier )
|
|||||||
|
|
||||||
BOOLEAN AreAnyAimMercsOnTeam( )
|
BOOLEAN AreAnyAimMercsOnTeam( )
|
||||||
{
|
{
|
||||||
SOLDIERTYPE *pSoldier = NULL;
|
SoldierID Soldier = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||||
|
SoldierID bLastTeamID = gTacticalStatus.Team[gbPlayerNum].bLastID;
|
||||||
|
|
||||||
for( int cnt = 0; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++cnt )
|
for( ; Soldier <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++Soldier)
|
||||||
{
|
{
|
||||||
pSoldier = MercPtrs[cnt];
|
|
||||||
|
|
||||||
//check to see if any of the mercs are AIM mercs
|
//check to see if any of the mercs are AIM mercs
|
||||||
if( pSoldier->ubWhatKindOfMercAmI == MERC_TYPE__AIM_MERC )
|
if( Soldier->ubWhatKindOfMercAmI == MERC_TYPE__AIM_MERC )
|
||||||
{
|
{
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,9 +18,9 @@ void DailyUpdateOfInsuredMercs();
|
|||||||
//void InsuranceContractPayLifeInsuranceForDeadMerc( LIFE_INSURANCE_PAYOUT *pPayoutStruct );
|
//void InsuranceContractPayLifeInsuranceForDeadMerc( LIFE_INSURANCE_PAYOUT *pPayoutStruct );
|
||||||
|
|
||||||
BOOLEAN AddLifeInsurancePayout( SOLDIERTYPE *pSoldier );
|
BOOLEAN AddLifeInsurancePayout( SOLDIERTYPE *pSoldier );
|
||||||
void InsuranceContractPayLifeInsuranceForDeadMerc( UINT8 ubPayoutID );
|
void InsuranceContractPayLifeInsuranceForDeadMerc( UINT16 ubPayoutID );
|
||||||
void StartInsuranceInvestigation( UINT8 ubPayoutID );
|
void StartInsuranceInvestigation( UINT16 ubPayoutID );
|
||||||
void EndInsuranceInvestigation( UINT8 ubPayoutID );
|
void EndInsuranceInvestigation( UINT16 ubPayoutID );
|
||||||
|
|
||||||
INT32 CalculateInsuranceContractCost( INT32 iLength, UINT8 ubMercID );
|
INT32 CalculateInsuranceContractCost( INT32 iLength, UINT8 ubMercID );
|
||||||
|
|
||||||
@@ -28,4 +28,4 @@ void InsuranceContractEndGameShutDown();
|
|||||||
|
|
||||||
void PurchaseOrExtendInsuranceForSoldier( SOLDIERTYPE *pSoldier, UINT32 uiInsuranceLength );
|
void PurchaseOrExtendInsuranceForSoldier( SOLDIERTYPE *pSoldier, UINT32 uiInsuranceLength );
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+10
-27
@@ -376,10 +376,6 @@ BOOLEAN fReDrawBookMarkInfo = FALSE;
|
|||||||
// show the 2 second info about bookmarks being accessed by clicking on web
|
// show the 2 second info about bookmarks being accessed by clicking on web
|
||||||
BOOLEAN fShowBookmarkInfo = FALSE;
|
BOOLEAN fShowBookmarkInfo = FALSE;
|
||||||
|
|
||||||
// show start button for ATM panel?
|
|
||||||
extern BOOLEAN fShowAtmPanelStartButton;
|
|
||||||
|
|
||||||
|
|
||||||
//TEMP! Disables the loadpending delay when switching b/n www pages
|
//TEMP! Disables the loadpending delay when switching b/n www pages
|
||||||
BOOLEAN gfTemporaryDisablingOfLoadPendingFlag=FALSE;
|
BOOLEAN gfTemporaryDisablingOfLoadPendingFlag=FALSE;
|
||||||
|
|
||||||
@@ -1093,8 +1089,6 @@ INT32 EnterLaptop()
|
|||||||
EnterLaptopInitLaptopPages();
|
EnterLaptopInitLaptopPages();
|
||||||
InitalizeSubSitesList( );
|
InitalizeSubSitesList( );
|
||||||
|
|
||||||
fShowAtmPanelStartButton = TRUE;
|
|
||||||
|
|
||||||
// lock cursor to screen
|
// lock cursor to screen
|
||||||
if ( gGameExternalOptions.fLaptopMouseCaptured == TRUE )
|
if ( gGameExternalOptions.fLaptopMouseCaptured == TRUE )
|
||||||
{
|
{
|
||||||
@@ -5090,36 +5084,28 @@ void ShouldNewMailBeDisplayed()
|
|||||||
void DisplayPlayersBalanceToDate( void )
|
void DisplayPlayersBalanceToDate( void )
|
||||||
{
|
{
|
||||||
// print players balance to date
|
// print players balance to date
|
||||||
CHAR16 sString[ 100 ];
|
|
||||||
INT16 sX, sY;
|
INT16 sX, sY;
|
||||||
|
|
||||||
// initialize string
|
|
||||||
memset( sString, 0, sizeof( sString ) );
|
|
||||||
|
|
||||||
// font stuff
|
// font stuff
|
||||||
SetFont( FONT10ARIAL);
|
SetFont( FONT10ARIAL);
|
||||||
SetFontForeground( 142 );
|
SetFontForeground( 142 );
|
||||||
SetFontShadow(NO_SHADOW);
|
SetFontShadow(NO_SHADOW);
|
||||||
|
|
||||||
// parse straigth number
|
// parse straigth number
|
||||||
swprintf( sString, L"%d", LaptopSaveInfo.iCurrentBalance );
|
std::wstring sString{FormatMoney(LaptopSaveInfo.iCurrentBalance)};
|
||||||
|
|
||||||
// put in commas, then dollar sign
|
|
||||||
InsertCommasForDollarFigure( sString );
|
|
||||||
InsertDollarSignInToString( sString );
|
|
||||||
|
|
||||||
// get center
|
// get center
|
||||||
FindFontCenterCoordinates( (INT16)LAPTOP_ICON_TEXT_X, iScreenHeightOffset, (INT16)(LAPTOP_ICON_TEXT_WIDTH) ,(INT16)(LAPTOP_ICON_TEXT_HEIGHT), sString, LAPTOPICONFONT, &sX, &sY );
|
FindFontCenterCoordinates( (INT16)LAPTOP_ICON_TEXT_X, iScreenHeightOffset, (INT16)(LAPTOP_ICON_TEXT_WIDTH) ,(INT16)(LAPTOP_ICON_TEXT_HEIGHT), sString.data(), LAPTOPICONFONT, &sX, &sY);
|
||||||
|
|
||||||
// gprintfdirty( sX , LAPTOP_ICON_TEXT_FINANCIAL_Y + 10, sString );
|
// gprintfdirty( sX , LAPTOP_ICON_TEXT_FINANCIAL_Y + 10, sString );
|
||||||
// printf it!
|
// printf it!
|
||||||
if( ButtonList[ gLaptopButton[ 5 ] ]->uiFlags & BUTTON_CLICKED_ON )
|
if( ButtonList[ gLaptopButton[ 5 ] ]->uiFlags & BUTTON_CLICKED_ON )
|
||||||
{
|
{
|
||||||
mprintf( sX + 5, LAPTOP_ICON_TEXT_FINANCIAL_Y + 10 + 5, sString);
|
mprintf( sX + 5, LAPTOP_ICON_TEXT_FINANCIAL_Y + 10 + 5, sString.data());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mprintf( sX, LAPTOP_ICON_TEXT_FINANCIAL_Y + 10, sString);
|
mprintf( sX, LAPTOP_ICON_TEXT_FINANCIAL_Y + 10, sString.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
// reset shadow
|
// reset shadow
|
||||||
@@ -6213,7 +6199,6 @@ void DeleteDesktopBackground( void )
|
|||||||
|
|
||||||
void PrintBalance( void )
|
void PrintBalance( void )
|
||||||
{
|
{
|
||||||
CHAR16 pString[ 32 ];
|
|
||||||
// UINT16 usX, usY;
|
// UINT16 usX, usY;
|
||||||
|
|
||||||
SetFont( FONT10ARIAL );
|
SetFont( FONT10ARIAL );
|
||||||
@@ -6221,17 +6206,15 @@ void PrintBalance( void )
|
|||||||
SetFontBackground( FONT_BLACK );
|
SetFontBackground( FONT_BLACK );
|
||||||
SetFontShadow( NO_SHADOW );
|
SetFontShadow( NO_SHADOW );
|
||||||
|
|
||||||
swprintf(pString, L"%d", LaptopSaveInfo.iCurrentBalance);
|
std::wstring pString{ FormatMoney(LaptopSaveInfo.iCurrentBalance) };
|
||||||
InsertCommasForDollarFigure( pString );
|
|
||||||
InsertDollarSignInToString( pString );
|
|
||||||
|
|
||||||
if( ButtonList[ gLaptopButton[ 5 ] ]->uiFlags & BUTTON_CLICKED_ON )
|
if( ButtonList[ gLaptopButton[ 5 ] ]->uiFlags & BUTTON_CLICKED_ON )
|
||||||
{
|
{
|
||||||
mprintf(iScreenWidthOffset + 48, iScreenHeightOffset + 273,pString);
|
mprintf(iScreenWidthOffset + 48, iScreenHeightOffset + 273,pString.data());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mprintf(iScreenWidthOffset + 47, iScreenHeightOffset + 272,pString);
|
mprintf(iScreenWidthOffset + 47, iScreenHeightOffset + 272,pString.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -6243,7 +6226,7 @@ void PrintNumberOnTeam( void )
|
|||||||
{
|
{
|
||||||
CHAR16 pString[ 32 ];
|
CHAR16 pString[ 32 ];
|
||||||
SOLDIERTYPE *pSoldier, *pTeamSoldier;
|
SOLDIERTYPE *pSoldier, *pTeamSoldier;
|
||||||
INT32 cnt=0;
|
SoldierID cnt = 0;
|
||||||
INT32 iCounter=0;
|
INT32 iCounter=0;
|
||||||
UINT16 usPosX, usPosY, usFontHeight, usStrLength;
|
UINT16 usPosX, usPosY, usFontHeight, usStrLength;
|
||||||
|
|
||||||
@@ -6256,9 +6239,9 @@ void PrintNumberOnTeam( void )
|
|||||||
// grab number on team
|
// grab number on team
|
||||||
pSoldier = MercPtrs[0];
|
pSoldier = MercPtrs[0];
|
||||||
|
|
||||||
for ( pTeamSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ pSoldier->bTeam ].bLastID; cnt++, pTeamSoldier++)
|
for ( ; cnt <= gTacticalStatus.Team[ pSoldier->bTeam ].bLastID; ++cnt )
|
||||||
{
|
{
|
||||||
pTeamSoldier = MercPtrs[ cnt ];
|
pTeamSoldier = cnt;
|
||||||
|
|
||||||
if( ( pTeamSoldier->bActive)&&( !( pTeamSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE ) ) )
|
if( ( pTeamSoldier->bActive)&&( !( pTeamSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE ) ) )
|
||||||
{
|
{
|
||||||
|
|||||||
+31
-36
@@ -340,13 +340,12 @@ BOOLEAN EnterMercCompareAnalyze()
|
|||||||
// We fill two dropdowns with all mercs on our team
|
// We fill two dropdowns with all mercs on our team
|
||||||
std::vector<std::pair<INT16, STR16> > mercvector;
|
std::vector<std::pair<INT16, STR16> > mercvector;
|
||||||
|
|
||||||
SOLDIERTYPE* pSoldier = NULL;
|
SoldierID id = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||||
UINT16 id = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
SoldierID lastid = gTacticalStatus.Team[gbPlayerNum].bLastID;
|
||||||
UINT16 lastid = gTacticalStatus.Team[gbPlayerNum].bLastID;
|
for ( ; id <= lastid; ++id)
|
||||||
for ( pSoldier = MercPtrs[id]; id <= lastid; ++id, pSoldier++ )
|
|
||||||
{
|
{
|
||||||
if ( pSoldier->bActive && pSoldier->ubProfile != NO_PROFILE )
|
if ( id->bActive && id->ubProfile != NO_PROFILE )
|
||||||
mercvector.push_back( std::make_pair( pSoldier->ubProfile, gMercProfiles[pSoldier->ubProfile].zNickname ) );
|
mercvector.push_back( std::make_pair( id->ubProfile, gMercProfiles[id->ubProfile].zNickname ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
DropDownTemplate<DROPDOWNNR_MERCCOMPARE1>::getInstance( ).SetEntries( mercvector );
|
DropDownTemplate<DROPDOWNNR_MERCCOMPARE1>::getInstance( ).SetEntries( mercvector );
|
||||||
@@ -433,12 +432,12 @@ void RenderMercCompareAnalyze()
|
|||||||
|
|
||||||
BOOLEAN DisplayMercData( UINT8 usProfileA, UINT8 usProfileB )
|
BOOLEAN DisplayMercData( UINT8 usProfileA, UINT8 usProfileB )
|
||||||
{
|
{
|
||||||
VOBJECT_DESC VObjectDesc;
|
VOBJECT_DESC VObjectDesc;
|
||||||
HVOBJECT hPixHandle;
|
HVOBJECT hPixHandle;
|
||||||
UINT16 usPosX, usPosY, usPosY2;
|
UINT16 usPosX, usPosY, usPosY2;
|
||||||
UINT32 uiInsMercFaceImage;
|
UINT32 uiInsMercFaceImage;
|
||||||
INT32 iCostOfContract = 0;
|
INT32 iCostOfContract = 0;
|
||||||
char sTemp[100];
|
char sTemp[100];
|
||||||
CHAR16 sText[800];
|
CHAR16 sText[800];
|
||||||
BOOLEAN fDisplayMercContractStateTextColorInRed = FALSE;
|
BOOLEAN fDisplayMercContractStateTextColorInRed = FALSE;
|
||||||
|
|
||||||
@@ -452,14 +451,14 @@ BOOLEAN DisplayMercData( UINT8 usProfileA, UINT8 usProfileB )
|
|||||||
if ( !pProfileA || !pProfileB )
|
if ( !pProfileA || !pProfileB )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
INT16 idA = GetSoldierIDFromMercID( usProfileA );
|
SoldierID idA = GetSoldierIDFromMercID( usProfileA );
|
||||||
INT16 idB = GetSoldierIDFromMercID( usProfileB );
|
SoldierID idB = GetSoldierIDFromMercID( usProfileB );
|
||||||
|
|
||||||
if ( idA < 0 || idB < 0 )
|
if ( idA == NOBODY || idB == NOBODY )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
SOLDIERTYPE* pSoldierA = MercPtrs[idA];
|
SOLDIERTYPE* pSoldierA = idA;
|
||||||
SOLDIERTYPE* pSoldierB = MercPtrs[idB];
|
SOLDIERTYPE* pSoldierB = idB;
|
||||||
|
|
||||||
if ( !pSoldierA || !pSoldierB )
|
if ( !pSoldierA || !pSoldierB )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -976,17 +975,16 @@ BOOLEAN EnterMercCompareMatrix( )
|
|||||||
// create a map of all current squads with at least 2 members
|
// create a map of all current squads with at least 2 members
|
||||||
std::map<INT16, INT16> squadmap;
|
std::map<INT16, INT16> squadmap;
|
||||||
|
|
||||||
SOLDIERTYPE* pSoldier = NULL;
|
SoldierID id = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||||
UINT16 id = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
SoldierID lastid = gTacticalStatus.Team[gbPlayerNum].bLastID;
|
||||||
UINT16 lastid = gTacticalStatus.Team[gbPlayerNum].bLastID;
|
for ( ; id <= lastid; ++id )
|
||||||
for ( pSoldier = MercPtrs[id]; id <= lastid; ++id, pSoldier++ )
|
|
||||||
{
|
{
|
||||||
if ( pSoldier->bActive && pSoldier->ubProfile != NO_PROFILE && pSoldier->bAssignment < ON_DUTY )
|
if ( id->bActive && id->ubProfile != NO_PROFILE && id->bAssignment < ON_DUTY )
|
||||||
{
|
{
|
||||||
if ( squadmap.find( pSoldier->bAssignment ) == squadmap.end() )
|
if ( squadmap.find( id->bAssignment ) == squadmap.end() )
|
||||||
squadmap[pSoldier->bAssignment] = 1;
|
squadmap[id->bAssignment] = 1;
|
||||||
else
|
else
|
||||||
++squadmap[pSoldier->bAssignment];
|
++squadmap[id->bAssignment];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1079,15 +1077,14 @@ void RenderMercCompareMatrix( )
|
|||||||
|
|
||||||
// display a table with all squadmembers
|
// display a table with all squadmembers
|
||||||
std::vector<UINT8> squadvector;
|
std::vector<UINT8> squadvector;
|
||||||
SOLDIERTYPE* pSoldier = NULL;
|
SoldierID id = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||||
UINT16 id = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
SoldierID lastid = gTacticalStatus.Team[gbPlayerNum].bLastID;
|
||||||
UINT16 lastid = gTacticalStatus.Team[gbPlayerNum].bLastID;
|
for ( ; id <= lastid; ++id )
|
||||||
for ( pSoldier = MercPtrs[id]; id <= lastid; ++id, pSoldier++ )
|
|
||||||
{
|
{
|
||||||
if ( pSoldier->bActive && pSoldier->ubProfile != NO_PROFILE && pSoldier->bAssignment == gSquadToShow )
|
if ( id->bActive && id->ubProfile != NO_PROFILE && id->bAssignment == gSquadToShow )
|
||||||
{
|
{
|
||||||
// remember squamember
|
// remember squamember
|
||||||
squadvector.push_back( pSoldier->ubProfile );
|
squadvector.push_back( id->ubProfile );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1117,13 +1114,12 @@ void RenderMercCompareMatrix( )
|
|||||||
|
|
||||||
for ( std::vector<UINT8>::iterator it = squadvector.begin(); it != itend; ++it )
|
for ( std::vector<UINT8>::iterator it = squadvector.begin(); it != itend; ++it )
|
||||||
{
|
{
|
||||||
INT16 idA = GetSoldierIDFromMercID( (*it) );
|
SoldierID idA = GetSoldierIDFromMercID( (*it) );
|
||||||
|
|
||||||
if ( idA < 0 )
|
if ( idA == NOBODY )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
SOLDIERTYPE* pSoldierA = MercPtrs[idA];
|
SOLDIERTYPE* pSoldierA = idA;
|
||||||
|
|
||||||
if ( !pSoldierA )
|
if ( !pSoldierA )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@@ -1140,9 +1136,9 @@ void RenderMercCompareMatrix( )
|
|||||||
|
|
||||||
for ( std::vector<UINT8>::iterator it2 = squadvector.begin( ); it2 != itend; ++it2 )
|
for ( std::vector<UINT8>::iterator it2 = squadvector.begin( ); it2 != itend; ++it2 )
|
||||||
{
|
{
|
||||||
INT16 idB = GetSoldierIDFromMercID( (*it2) );
|
SoldierID idB = GetSoldierIDFromMercID( (*it2) );
|
||||||
|
|
||||||
if ( idB < 0 )
|
if ( idB == NOBODY )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if ( idA == idB )
|
if ( idA == idB )
|
||||||
@@ -1151,8 +1147,7 @@ void RenderMercCompareMatrix( )
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
SOLDIERTYPE* pSoldierB = MercPtrs[idB];
|
SOLDIERTYPE* pSoldierB = idB;
|
||||||
|
|
||||||
if ( !pSoldierB )
|
if ( !pSoldierB )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|||||||
@@ -446,13 +446,8 @@ void BtnMercAuthorizeButtonCallback(GUI_BUTTON *btn,INT32 reason)
|
|||||||
|
|
||||||
btn->uiFlags &= (~BUTTON_CLICKED_ON );
|
btn->uiFlags &= (~BUTTON_CLICKED_ON );
|
||||||
|
|
||||||
swprintf( wzDollarAmount, L"%d", giMercTotalContractCharge );
|
|
||||||
|
|
||||||
InsertCommasForDollarFigure( wzDollarAmount );
|
|
||||||
InsertDollarSignInToString( wzDollarAmount );
|
|
||||||
|
|
||||||
//create the string to show to the user
|
//create the string to show to the user
|
||||||
swprintf( wzAuthorizeString, MercAccountText[MERC_ACCOUNT_AUTHORIZE_CONFIRMATION], wzDollarAmount );
|
swprintf( wzAuthorizeString, MercAccountText[MERC_ACCOUNT_AUTHORIZE_CONFIRMATION], FormatMoney(giMercTotalContractCharge).data());
|
||||||
|
|
||||||
DoLapTopMessageBox( MSG_BOX_BLUE_ON_GREY, wzAuthorizeString, LAPTOP_SCREEN, MSG_BOX_FLAG_YESNO, MercAuthorizePaymentMessageBoxCallBack );
|
DoLapTopMessageBox( MSG_BOX_BLUE_ON_GREY, wzAuthorizeString, LAPTOP_SCREEN, MSG_BOX_FLAG_YESNO, MercAuthorizePaymentMessageBoxCallBack );
|
||||||
|
|
||||||
|
|||||||
+13
-24
@@ -977,8 +977,7 @@ void DisplayMercsStats( UINT8 ubMercID )
|
|||||||
{
|
{
|
||||||
UINT16 usPosY, usPosX;
|
UINT16 usPosY, usPosX;
|
||||||
CHAR16 sPage[60];
|
CHAR16 sPage[60];
|
||||||
CHAR16 sTemp[128];
|
std::wstring sString{};
|
||||||
CHAR16 sString[128];
|
|
||||||
CHAR16 NsString[128];
|
CHAR16 NsString[128];
|
||||||
CHAR16 N2sString[128];
|
CHAR16 N2sString[128];
|
||||||
UINT8 ubColor;
|
UINT8 ubColor;
|
||||||
@@ -1058,21 +1057,15 @@ void DisplayMercsStats( UINT8 ubMercID )
|
|||||||
DrawTextToScreen( CharacterInfo[AIM_MEMBER_FEE], MERC_STATS_SECOND_COL_X, usPosY, 0, MERC_TITLE_FONT, MERC_TITLE_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
|
DrawTextToScreen( CharacterInfo[AIM_MEMBER_FEE], MERC_STATS_SECOND_COL_X, usPosY, 0, MERC_TITLE_FONT, MERC_TITLE_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
|
||||||
|
|
||||||
usPosX = MERC_STATS_SECOND_COL_X + StringPixLength( CharacterInfo[AIM_MEMBER_FEE], MERC_NAME_FONT );
|
usPosX = MERC_STATS_SECOND_COL_X + StringPixLength( CharacterInfo[AIM_MEMBER_FEE], MERC_NAME_FONT );
|
||||||
swprintf( sString, L"%d", gMercProfiles[ubMercID].uiWeeklySalary );
|
sString = FormatMoney(gMercProfiles[ubMercID].uiWeeklySalary);
|
||||||
InsertCommasForDollarFigure( sString );
|
|
||||||
InsertDollarSignInToString( sString );
|
|
||||||
#else
|
#else
|
||||||
DrawTextToScreen( MercInfo[MERC_FILES_SALARY], MERC_STATS_SECOND_COL_X, usPosY, 0, MERC_STATS_FONT, MERC_STATIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
|
DrawTextToScreen( MercInfo[MERC_FILES_SALARY], MERC_STATS_SECOND_COL_X, usPosY, 0, MERC_STATS_FONT, MERC_STATIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
|
||||||
|
|
||||||
usPosX = MERC_STATS_SECOND_COL_X + StringPixLength( MercInfo[MERC_FILES_SALARY], MERC_NAME_FONT );
|
usPosX = MERC_STATS_SECOND_COL_X + StringPixLength( MercInfo[MERC_FILES_SALARY], MERC_NAME_FONT );
|
||||||
swprintf( sString, L"%d", gMercProfiles[ubMercID].sSalary );
|
sString = FormatMoney(gMercProfiles[ubMercID].sSalary) + L" " + std::wstring(MercInfo[MERC_FILES_PER_DAY]);
|
||||||
InsertCommasForDollarFigure( sString );
|
|
||||||
InsertDollarSignInToString( sString );
|
|
||||||
swprintf( sTemp, L" %s", MercInfo[MERC_FILES_PER_DAY] );
|
|
||||||
#endif // JA2UB
|
#endif // JA2UB
|
||||||
|
|
||||||
wcscat( sString, sTemp );
|
DrawTextToScreen( sString.data(), usPosX, usPosY, 95, MERC_NAME_FONT, MERC_DYNAMIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
|
||||||
DrawTextToScreen( sString, usPosX, usPosY, 95, MERC_NAME_FONT, MERC_DYNAMIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
|
|
||||||
|
|
||||||
// Buggler: Display current MERC index & total MERC members at the bottom of the screen
|
// Buggler: Display current MERC index & total MERC members at the bottom of the screen
|
||||||
swprintf( sPage, L"%d / %d", gubCurMercIndex + 1, LaptopSaveInfo.gubLastMercIndex + 1 );
|
swprintf( sPage, L"%d / %d", gubCurMercIndex + 1, LaptopSaveInfo.gubLastMercIndex + 1 );
|
||||||
@@ -1103,10 +1096,8 @@ void DisplayMercsStats( UINT8 ubMercID )
|
|||||||
#endif // JA2UB
|
#endif // JA2UB
|
||||||
|
|
||||||
swprintf( NsString, L"+ " );
|
swprintf( NsString, L"+ " );
|
||||||
swprintf(sTemp, L"%d",gMercProfiles[ ubMercID ].usOptionalGearCost);
|
sString = FormatMoney(gMercProfiles[ ubMercID ].usOptionalGearCost);
|
||||||
InsertCommasForDollarFigure( sTemp );
|
wcscat( NsString, sString.data() );
|
||||||
InsertDollarSignInToString( sTemp );
|
|
||||||
wcscat( NsString, sTemp );
|
|
||||||
DrawTextToScreen( NsString, usPosX, usPosY, 95, MERC_NAME_FONT, MERC_DYNAMIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
|
DrawTextToScreen( NsString, usPosX, usPosY, 95, MERC_NAME_FONT, MERC_DYNAMIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
|
||||||
usPosY += MERC_SPACE_BN_LINES;
|
usPosY += MERC_SPACE_BN_LINES;
|
||||||
|
|
||||||
@@ -1115,13 +1106,11 @@ void DisplayMercsStats( UINT8 ubMercID )
|
|||||||
|
|
||||||
swprintf(N2sString, L"= ");
|
swprintf(N2sString, L"= ");
|
||||||
#ifdef JA2UB
|
#ifdef JA2UB
|
||||||
swprintf( sTemp, L"%d", gMercProfiles[ubMercID].usOptionalGearCost + gMercProfiles[ubMercID].uiWeeklySalary );
|
sString = FormatMoney(gMercProfiles[ubMercID].usOptionalGearCost + gMercProfiles[ubMercID].uiWeeklySalary);
|
||||||
#else
|
#else
|
||||||
swprintf(sTemp, L"%d",gMercProfiles[ ubMercID ].usOptionalGearCost+gMercProfiles[ ubMercID ].sSalary);
|
sString = FormatMoney(gMercProfiles[ ubMercID ].usOptionalGearCost+gMercProfiles[ ubMercID ].sSalary);
|
||||||
#endif
|
#endif
|
||||||
InsertCommasForDollarFigure( sTemp );
|
wcscat( N2sString, sString.data() );
|
||||||
InsertDollarSignInToString( sTemp );
|
|
||||||
wcscat( N2sString, sTemp );
|
|
||||||
DrawTextToScreen( N2sString, usPosX, usPosY, 95, MERC_NAME_FONT, MERC_DYNAMIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
|
DrawTextToScreen( N2sString, usPosX, usPosY, 95, MERC_NAME_FONT, MERC_DYNAMIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1211,8 +1200,8 @@ BOOLEAN MercFilesHireMerc(UINT8 ubMercID)
|
|||||||
|
|
||||||
if(is_networked && (Namount*(-1) > LaptopSaveInfo.iCurrentBalance))
|
if(is_networked && (Namount*(-1) > LaptopSaveInfo.iCurrentBalance))
|
||||||
{
|
{
|
||||||
DoLapTopMessageBox( MSG_BOX_LAPTOP_DEFAULT, sATMText[ 4 ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL);
|
DoLapTopMessageBox( MSG_BOX_LAPTOP_DEFAULT, gzSkiAtmText[SKI_ATM_MODE_TEXT_SELECT_INUSUFFICIENT_FUNDS], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL);
|
||||||
return(FALSE);//not enough big ones $$$sATMText
|
return(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef JA2UB
|
#ifdef JA2UB
|
||||||
@@ -1225,8 +1214,8 @@ BOOLEAN MercFilesHireMerc(UINT8 ubMercID)
|
|||||||
|
|
||||||
if ( Namount > LaptopSaveInfo.iCurrentBalance )
|
if ( Namount > LaptopSaveInfo.iCurrentBalance )
|
||||||
{
|
{
|
||||||
DoLapTopMessageBox( MSG_BOX_LAPTOP_DEFAULT, sATMText[4], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL );
|
DoLapTopMessageBox( MSG_BOX_LAPTOP_DEFAULT, gzSkiAtmText[SKI_ATM_MODE_TEXT_SELECT_INUSUFFICIENT_FUNDS], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL );
|
||||||
return(FALSE);//not enough big ones $$$sATMText
|
return(FALSE);
|
||||||
}
|
}
|
||||||
#endif // JA2UB
|
#endif // JA2UB
|
||||||
|
|
||||||
|
|||||||
+3
-2
@@ -980,7 +980,8 @@ void BtnFileBoxButtonCallback(GUI_BUTTON *btn,INT32 reason)
|
|||||||
void DailyUpdateOfMercSite( UINT16 usDate)
|
void DailyUpdateOfMercSite( UINT16 usDate)
|
||||||
{
|
{
|
||||||
SOLDIERTYPE *pSoldier;
|
SOLDIERTYPE *pSoldier;
|
||||||
INT16 sSoldierID, i;
|
SoldierID sSoldierID;
|
||||||
|
INT16 i;
|
||||||
UINT8 ubMercID;
|
UINT8 ubMercID;
|
||||||
INT32 iNumDays;
|
INT32 iNumDays;
|
||||||
|
|
||||||
@@ -1006,7 +1007,7 @@ void DailyUpdateOfMercSite( UINT16 usDate)
|
|||||||
// continue;
|
// continue;
|
||||||
|
|
||||||
sSoldierID = GetSoldierIDFromMercID( ubMercID );
|
sSoldierID = GetSoldierIDFromMercID( ubMercID );
|
||||||
pSoldier = MercPtrs[ sSoldierID ];
|
pSoldier = sSoldierID;
|
||||||
|
|
||||||
//if the merc is dead, dont advance the contract length
|
//if the merc is dead, dont advance the contract length
|
||||||
if( !IsMercDead( pSoldier->ubProfile ) )
|
if( !IsMercDead( pSoldier->ubProfile ) )
|
||||||
|
|||||||
+549
-1368
File diff suppressed because it is too large
Load Diff
@@ -74,9 +74,6 @@ void AddCharacterToFiredList( SOLDIERTYPE *pSoldier );
|
|||||||
// get the total amt of money on this guy
|
// get the total amt of money on this guy
|
||||||
INT32 GetFundsOnMerc( SOLDIERTYPE *pSoldier );
|
INT32 GetFundsOnMerc( SOLDIERTYPE *pSoldier );
|
||||||
|
|
||||||
BOOLEAN TransferFundsFromMercToBank( SOLDIERTYPE *pSoldier, INT32 iCurrentBalance );
|
|
||||||
BOOLEAN TransferFundsFromBankToMerc( SOLDIERTYPE *pSoldier, INT32 iCurrentBalance );
|
|
||||||
|
|
||||||
BOOLEAN RemoveNewlyHiredMercFromPersonnelDepartedList( UINT8 ubProfile );
|
BOOLEAN RemoveNewlyHiredMercFromPersonnelDepartedList( UINT8 ubProfile );
|
||||||
|
|
||||||
void AssignPersonnelSkillTraitHelpText( UINT8 ubTraitNumber, BOOLEAN fExpertLevel, BOOLEAN fRegMale, STR16 apStr );
|
void AssignPersonnelSkillTraitHelpText( UINT8 ubTraitNumber, BOOLEAN fExpertLevel, BOOLEAN fRegMale, STR16 apStr );
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ namespace AI
|
|||||||
if(i.event_type_ == AIInputData::auditive_event)
|
if(i.event_type_ == AIInputData::auditive_event)
|
||||||
return os<<"sound: "<<i.noise_maker_<<" made a sound at "<<i.grid_no_<<", lvl "<<i.level_<<" vol "<<i.volume_<<" type "<<i.type_;
|
return os<<"sound: "<<i.noise_maker_<<" made a sound at "<<i.grid_no_<<", lvl "<<i.level_<<" vol "<<i.volume_<<" type "<<i.type_;
|
||||||
if(i.event_type_ == AIInputData::visual_event)
|
if(i.event_type_ == AIInputData::visual_event)
|
||||||
return os<<"visual: "<<(int)i.opponent_->ubID<<" was seen at "<<i.grid_no_<<", lvl "<<i.level_<<" caller1 "<<i.caller1_<<" caller2 "<<i.caller2_;
|
return os<<"visual: "<<i.opponent_->ubID.i<<" was seen at "<<i.grid_no_<<", lvl "<<i.level_<<" caller1 "<<i.caller1_<<" caller2 "<<i.caller2_;
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+143
-146
@@ -382,22 +382,22 @@ typedef struct
|
|||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
UINT8 ubProfileID;
|
UINT16 ubProfileID;
|
||||||
|
|
||||||
} send_dismiss_struct;
|
} send_dismiss_struct;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
UINT8 usSoldierID;
|
SoldierID usSoldierID;
|
||||||
FLOAT dNewXPos;
|
FLOAT dNewXPos;
|
||||||
FLOAT dNewYPos;
|
FLOAT dNewYPos;
|
||||||
|
|
||||||
} gui_pos;
|
} gui_pos;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
UINT8 usSoldierID;
|
SoldierID usSoldierID;
|
||||||
INT16 usNewDirection;
|
INT16 usNewDirection;
|
||||||
|
|
||||||
} gui_dir;
|
} gui_dir;
|
||||||
|
|
||||||
@@ -425,12 +425,12 @@ typedef struct
|
|||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
UINT8 ubID;
|
SoldierID ubID;
|
||||||
INT8 bTeam;
|
INT8 bTeam;
|
||||||
UINT8 gubOutOfTurnPersons;
|
UINT16 gubOutOfTurnPersons;
|
||||||
UINT8 gubOutOfTurnOrder[MAXMERCS];
|
UINT16 gubOutOfTurnOrder[MAXMERCS];
|
||||||
BOOLEAN fMarkInterruptOccurred;
|
BOOLEAN fMarkInterruptOccurred;
|
||||||
UINT8 Interrupted;
|
SoldierID Interrupted;
|
||||||
} INT_STRUCT;
|
} INT_STRUCT;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
@@ -470,7 +470,7 @@ typedef struct
|
|||||||
float dForceY;
|
float dForceY;
|
||||||
float dForceZ;
|
float dForceZ;
|
||||||
UINT32 sTargetGridNo;
|
UINT32 sTargetGridNo;
|
||||||
UINT8 ubID;
|
SoldierID ubID;
|
||||||
UINT8 ubActionCode;
|
UINT8 ubActionCode;
|
||||||
UINT32 uiActionData;
|
UINT32 uiActionData;
|
||||||
UINT16 usItem;
|
UINT16 usItem;
|
||||||
@@ -486,7 +486,7 @@ typedef struct
|
|||||||
float dZ;
|
float dZ;
|
||||||
INT32 sGridNo;
|
INT32 sGridNo;
|
||||||
bool bWasDud;
|
bool bWasDud;
|
||||||
UINT8 ubOwnerID;
|
SoldierID ubOwnerID;
|
||||||
INT32 RealObjectID; // the local ID on the initiating client
|
INT32 RealObjectID; // the local ID on the initiating client
|
||||||
UINT32 uiPreRandomIndex; // send out our current pre-random index
|
UINT32 uiPreRandomIndex; // send out our current pre-random index
|
||||||
} grenade_result;
|
} grenade_result;
|
||||||
@@ -494,7 +494,7 @@ typedef struct
|
|||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
UINT32 sGridNo;
|
UINT32 sGridNo;
|
||||||
UINT8 ubID;
|
SoldierID ubID;
|
||||||
UINT16 usItem;
|
UINT16 usItem;
|
||||||
UINT8 ubItemStatus;
|
UINT8 ubItemStatus;
|
||||||
UINT32 uiWorldIndex; // the local World Index of this bomb on its creators client
|
UINT32 uiWorldIndex; // the local World Index of this bomb on its creators client
|
||||||
@@ -506,7 +506,7 @@ typedef struct
|
|||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
UINT8 ubID;
|
SoldierID ubID;
|
||||||
UINT32 uiWorldItemIndex;
|
UINT32 uiWorldItemIndex;
|
||||||
UINT8 ubMPTeamIndex;
|
UINT8 ubMPTeamIndex;
|
||||||
UINT32 uiPreRandomIndex; // send out our current pre-random index
|
UINT32 uiPreRandomIndex; // send out our current pre-random index
|
||||||
@@ -516,7 +516,7 @@ typedef struct
|
|||||||
{
|
{
|
||||||
UINT32 uiWorldItemIndex;
|
UINT32 uiWorldItemIndex;
|
||||||
UINT8 ubMPTeamIndex;
|
UINT8 ubMPTeamIndex;
|
||||||
UINT8 ubID;
|
SoldierID ubID;
|
||||||
UINT32 sGridNo;
|
UINT32 sGridNo;
|
||||||
UINT32 uiPreRandomIndex; // send out our current pre-random index
|
UINT32 uiPreRandomIndex; // send out our current pre-random index
|
||||||
} disarm_struct;
|
} disarm_struct;
|
||||||
@@ -526,7 +526,7 @@ typedef struct
|
|||||||
INT32 sGridNo;
|
INT32 sGridNo;
|
||||||
UINT8 ubRadius;
|
UINT8 ubRadius;
|
||||||
UINT16 usItem;
|
UINT16 usItem;
|
||||||
UINT8 ubOwner;
|
SoldierID ubOwner;
|
||||||
BOOLEAN fSubsequent;
|
BOOLEAN fSubsequent;
|
||||||
INT8 bLevel;
|
INT8 bLevel;
|
||||||
INT32 iSmokeEffectID;
|
INT32 iSmokeEffectID;
|
||||||
@@ -535,18 +535,18 @@ typedef struct
|
|||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
UINT8 ubDamageFunc; // 1 - gas damage , 2 - explosive damage
|
UINT8 ubDamageFunc; // 1 - gas damage , 2 - explosive damage
|
||||||
UINT8 ubSoldierID;
|
SoldierID ubSoldierID;
|
||||||
UINT16 usExplosiveClassID;
|
UINT16 usExplosiveClassID;
|
||||||
INT16 sSubsequent;
|
INT16 sSubsequent;
|
||||||
BOOL fRecompileMovementCosts;
|
BOOL fRecompileMovementCosts;
|
||||||
INT16 sWoundAmt;
|
INT16 sWoundAmt;
|
||||||
INT16 sBreathAmt;
|
INT16 sBreathAmt;
|
||||||
UINT8 ubAttackerID;
|
SoldierID ubAttackerID;
|
||||||
UINT16 usItem;
|
UINT16 usItem;
|
||||||
INT32 sBombGridNo;
|
INT32 sBombGridNo;
|
||||||
UINT32 uiDist;
|
UINT32 uiDist;
|
||||||
UINT32 uiPreRandomIndex;
|
UINT32 uiPreRandomIndex;
|
||||||
} explosiondamage_struct;
|
} explosiondamage_struct;
|
||||||
|
|
||||||
bullets_table bTable[11][50];
|
bullets_table bTable[11][50];
|
||||||
@@ -566,7 +566,7 @@ int client_progress[4];
|
|||||||
int TEAM;
|
int TEAM;
|
||||||
|
|
||||||
UINT8 netbTeam;
|
UINT8 netbTeam;
|
||||||
UINT8 ubID_prefix;
|
UINT16 ubID_prefix;
|
||||||
|
|
||||||
bool is_connected=false;
|
bool is_connected=false;
|
||||||
bool is_connecting=false;
|
bool is_connecting=false;
|
||||||
@@ -802,7 +802,7 @@ void recievePATH(RPCParameters *rpcParameters)
|
|||||||
|
|
||||||
EV_S_SENDPATHTONETWORK* SNetPath = (EV_S_SENDPATHTONETWORK*)rpcParameters->input;
|
EV_S_SENDPATHTONETWORK* SNetPath = (EV_S_SENDPATHTONETWORK*)rpcParameters->input;
|
||||||
|
|
||||||
SOLDIERTYPE *pSoldier = MercPtrs[ SNetPath->usSoldierID ];
|
SOLDIERTYPE *pSoldier = SNetPath->usSoldierID;
|
||||||
|
|
||||||
|
|
||||||
memcpy(pSoldier->pathing.usPathingData, SNetPath->usPathData,sizeof(UINT16)*30);
|
memcpy(pSoldier->pathing.usPathingData, SNetPath->usPathData,sizeof(UINT16)*30);
|
||||||
@@ -863,7 +863,7 @@ void recieveSTANCE(RPCParameters *rpcParameters)
|
|||||||
|
|
||||||
EV_S_CHANGESTANCE* SChangeStance = (EV_S_CHANGESTANCE*)rpcParameters->input;
|
EV_S_CHANGESTANCE* SChangeStance = (EV_S_CHANGESTANCE*)rpcParameters->input;
|
||||||
|
|
||||||
SOLDIERTYPE *pSoldier = MercPtrs[ SChangeStance->usSoldierID ];
|
SOLDIERTYPE *pSoldier = SChangeStance->usSoldierID;
|
||||||
|
|
||||||
pSoldier->ChangeSoldierStance( SChangeStance->ubNewStance );
|
pSoldier->ChangeSoldierStance( SChangeStance->ubNewStance );
|
||||||
|
|
||||||
@@ -906,7 +906,7 @@ void recieveDIR(RPCParameters *rpcParameters)
|
|||||||
EV_S_SETDESIREDDIRECTION* SSetDesiredDirection = (EV_S_SETDESIREDDIRECTION*)rpcParameters->input;
|
EV_S_SETDESIREDDIRECTION* SSetDesiredDirection = (EV_S_SETDESIREDDIRECTION*)rpcParameters->input;
|
||||||
|
|
||||||
|
|
||||||
SOLDIERTYPE *pSoldier = MercPtrs[ SSetDesiredDirection->usSoldierID ];
|
SOLDIERTYPE *pSoldier = SSetDesiredDirection->usSoldierID;
|
||||||
|
|
||||||
pSoldier->EVENT_SetSoldierDesiredDirection( SSetDesiredDirection->usDesiredDirection );
|
pSoldier->EVENT_SetSoldierDesiredDirection( SSetDesiredDirection->usDesiredDirection );
|
||||||
|
|
||||||
@@ -945,7 +945,7 @@ void recieveFIRE(RPCParameters *rpcParameters)
|
|||||||
EV_S_BEGINFIREWEAPON* SBeginFireWeapon = (EV_S_BEGINFIREWEAPON*)rpcParameters->input;
|
EV_S_BEGINFIREWEAPON* SBeginFireWeapon = (EV_S_BEGINFIREWEAPON*)rpcParameters->input;
|
||||||
//ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"SendBeginFireWeaponEvent" );
|
//ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"SendBeginFireWeaponEvent" );
|
||||||
|
|
||||||
SOLDIERTYPE *pSoldier = MercPtrs[ SBeginFireWeapon->usSoldierID ];
|
SOLDIERTYPE *pSoldier = SBeginFireWeapon->usSoldierID;
|
||||||
|
|
||||||
pSoldier->sTargetGridNo = SBeginFireWeapon->sTargetGridNo;
|
pSoldier->sTargetGridNo = SBeginFireWeapon->sTargetGridNo;
|
||||||
pSoldier->bTargetLevel = SBeginFireWeapon->bTargetLevel;
|
pSoldier->bTargetLevel = SBeginFireWeapon->bTargetLevel;
|
||||||
@@ -967,7 +967,7 @@ void send_hit( EV_S_WEAPONHIT *SWeaponHit )
|
|||||||
|
|
||||||
memcpy( &weaphit_struct , SWeaponHit, sizeof( EV_S_WEAPONHIT ));
|
memcpy( &weaphit_struct , SWeaponHit, sizeof( EV_S_WEAPONHIT ));
|
||||||
|
|
||||||
UINT16 usSoldierID=weaphit_struct.usSoldierID;
|
SoldierID usSoldierID = weaphit_struct.usSoldierID;
|
||||||
|
|
||||||
if(SWeaponHit->usSoldierID < 20)weaphit_struct.usSoldierID = weaphit_struct.usSoldierID+ubID_prefix;
|
if(SWeaponHit->usSoldierID < 20)weaphit_struct.usSoldierID = weaphit_struct.usSoldierID+ubID_prefix;
|
||||||
if(SWeaponHit->ubAttackerID < 20)weaphit_struct.ubAttackerID = weaphit_struct.ubAttackerID+ubID_prefix;
|
if(SWeaponHit->ubAttackerID < 20)weaphit_struct.ubAttackerID = weaphit_struct.ubAttackerID+ubID_prefix;
|
||||||
@@ -981,9 +981,9 @@ void recieveHIT(RPCParameters *rpcParameters)
|
|||||||
|
|
||||||
EV_S_WEAPONHIT* SWeaponHit = (EV_S_WEAPONHIT*)rpcParameters->input;
|
EV_S_WEAPONHIT* SWeaponHit = (EV_S_WEAPONHIT*)rpcParameters->input;
|
||||||
|
|
||||||
SOLDIERTYPE *pSoldier = MercPtrs[ SWeaponHit->usSoldierID ];
|
SOLDIERTYPE *pSoldier = SWeaponHit->usSoldierID;
|
||||||
UINT16 usSoldierID;
|
SoldierID usSoldierID;
|
||||||
UINT8 ubAttackerID;
|
SoldierID ubAttackerID;
|
||||||
|
|
||||||
if((SWeaponHit->usSoldierID >= ubID_prefix) && (SWeaponHit->usSoldierID < (ubID_prefix+6))) // within our netbTeam range...
|
if((SWeaponHit->usSoldierID >= ubID_prefix) && (SWeaponHit->usSoldierID < (ubID_prefix+6))) // within our netbTeam range...
|
||||||
usSoldierID = (SWeaponHit->usSoldierID - ubID_prefix);
|
usSoldierID = (SWeaponHit->usSoldierID - ubID_prefix);
|
||||||
@@ -1010,7 +1010,7 @@ void recieveHIT(RPCParameters *rpcParameters)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void send_dismiss(UINT8 ubCurrentSoldierID)
|
void send_dismiss(UINT16 ubCurrentSoldierID)
|
||||||
{
|
{
|
||||||
send_dismiss_struct sDismissMerc;
|
send_dismiss_struct sDismissMerc;
|
||||||
|
|
||||||
@@ -1019,7 +1019,7 @@ void send_dismiss(UINT8 ubCurrentSoldierID)
|
|||||||
client->RPC("sendDISMISS",(const char*)&sDismissMerc, (int)sizeof(send_dismiss_struct)*8, HIGH_PRIORITY, RELIABLE, 0, UNASSIGNED_SYSTEM_ADDRESS, true, 0, UNASSIGNED_NETWORK_ID,0);
|
client->RPC("sendDISMISS",(const char*)&sDismissMerc, (int)sizeof(send_dismiss_struct)*8, HIGH_PRIORITY, RELIABLE, 0, UNASSIGNED_SYSTEM_ADDRESS, true, 0, UNASSIGNED_NETWORK_ID,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void send_hire( UINT8 iNewIndex, UINT8 ubCurrentSoldier, INT16 iTotalContractLength, BOOLEAN fCopyProfileItemsOver)
|
void send_hire( SoldierID iNewIndex, UINT8 ubCurrentSoldier, INT16 iTotalContractLength, BOOLEAN fCopyProfileItemsOver)
|
||||||
{
|
{
|
||||||
send_hire_struct sHireMerc;
|
send_hire_struct sHireMerc;
|
||||||
|
|
||||||
@@ -1028,7 +1028,7 @@ void send_hire( UINT8 iNewIndex, UINT8 ubCurrentSoldier, INT16 iTotalContractLen
|
|||||||
sHireMerc.fCopyProfileItemsOver=fCopyProfileItemsOver;
|
sHireMerc.fCopyProfileItemsOver=fCopyProfileItemsOver;
|
||||||
sHireMerc.bTeam=netbTeam;
|
sHireMerc.bTeam=netbTeam;
|
||||||
|
|
||||||
SOLDIERTYPE *pSoldier = MercPtrs[ iNewIndex ];
|
SOLDIERTYPE *pSoldier = iNewIndex;
|
||||||
|
|
||||||
UINT8 sectorEdge = cStartingSectorEdge;
|
UINT8 sectorEdge = cStartingSectorEdge;
|
||||||
|
|
||||||
@@ -1082,8 +1082,7 @@ void recieveHIRE(RPCParameters *rpcParameters)
|
|||||||
send_hire_struct* sHireMerc = (send_hire_struct*)rpcParameters->input;
|
send_hire_struct* sHireMerc = (send_hire_struct*)rpcParameters->input;
|
||||||
|
|
||||||
SOLDIERTYPE *pSoldier;
|
SOLDIERTYPE *pSoldier;
|
||||||
UINT8 iNewIndex;
|
SoldierID iNewIndex;
|
||||||
UINT8 ubCount=0;
|
|
||||||
|
|
||||||
SOLDIERCREATE_STRUCT MercCreateStruct;
|
SOLDIERCREATE_STRUCT MercCreateStruct;
|
||||||
BOOLEAN fReturn = FALSE;
|
BOOLEAN fReturn = FALSE;
|
||||||
@@ -1098,7 +1097,7 @@ void recieveHIRE(RPCParameters *rpcParameters)
|
|||||||
|
|
||||||
TacticalCreateSoldier( &MercCreateStruct, &iNewIndex ) ;
|
TacticalCreateSoldier( &MercCreateStruct, &iNewIndex ) ;
|
||||||
|
|
||||||
pSoldier = &Menptr[iNewIndex];
|
pSoldier = iNewIndex;
|
||||||
pSoldier->flags.uiStatusFlags |= SOLDIER_PC;
|
pSoldier->flags.uiStatusFlags |= SOLDIER_PC;
|
||||||
gMercProfiles[ pSoldier->ubProfile ].ubMiscFlags |= PROFILE_MISC_FLAG_RECRUITED;
|
gMercProfiles[ pSoldier->ubProfile ].ubMiscFlags |= PROFILE_MISC_FLAG_RECRUITED;
|
||||||
|
|
||||||
@@ -1158,7 +1157,7 @@ void send_gui_pos(SOLDIERTYPE *pSoldier, FLOAT dNewXPos, FLOAT dNewYPos)
|
|||||||
{
|
{
|
||||||
gui_pos gnPOS;
|
gui_pos gnPOS;
|
||||||
|
|
||||||
gnPOS.usSoldierID = (pSoldier->ubID)+ubID_prefix;
|
gnPOS.usSoldierID = pSoldier->ubID + ubID_prefix;
|
||||||
|
|
||||||
gnPOS.dNewXPos = dNewXPos;
|
gnPOS.dNewXPos = dNewXPos;
|
||||||
gnPOS.dNewYPos = dNewYPos;
|
gnPOS.dNewYPos = dNewYPos;
|
||||||
@@ -1170,7 +1169,7 @@ void recieveguiPOS(RPCParameters *rpcParameters)
|
|||||||
{
|
{
|
||||||
gui_pos* gnPOS = (gui_pos*)rpcParameters->input;
|
gui_pos* gnPOS = (gui_pos*)rpcParameters->input;
|
||||||
|
|
||||||
SOLDIERTYPE *pSoldier = MercPtrs[ gnPOS->usSoldierID ];
|
SOLDIERTYPE *pSoldier = gnPOS->usSoldierID;
|
||||||
|
|
||||||
INT32 sNewGridNo;
|
INT32 sNewGridNo;
|
||||||
|
|
||||||
@@ -1196,7 +1195,7 @@ void recieveguiDIR(RPCParameters *rpcParameters)
|
|||||||
{
|
{
|
||||||
gui_dir* gnDIR = (gui_dir*)rpcParameters->input;
|
gui_dir* gnDIR = (gui_dir*)rpcParameters->input;
|
||||||
|
|
||||||
SOLDIERTYPE *pSoldier = MercPtrs[ gnDIR->usSoldierID ];
|
SOLDIERTYPE *pSoldier = gnDIR->usSoldierID;
|
||||||
|
|
||||||
pSoldier->EVENT_SetSoldierDirection( gnDIR->usNewDirection );
|
pSoldier->EVENT_SetSoldierDirection( gnDIR->usNewDirection );
|
||||||
}
|
}
|
||||||
@@ -1276,7 +1275,7 @@ UINT8 numenemyLAN( UINT8 ubSectorX, UINT8 ubSectorY )
|
|||||||
return ubNumEnemies;
|
return ubNumEnemies;
|
||||||
}
|
}
|
||||||
|
|
||||||
void send_AI( SOLDIERCREATE_STRUCT *pCreateStruct, UINT8 *pubID )
|
void send_AI( SOLDIERCREATE_STRUCT *pCreateStruct )
|
||||||
{
|
{
|
||||||
AI_STRUCT send_inv;
|
AI_STRUCT send_inv;
|
||||||
send_inv.standard_data = *pCreateStruct;
|
send_inv.standard_data = *pCreateStruct;
|
||||||
@@ -1291,7 +1290,7 @@ void send_AI( SOLDIERCREATE_STRUCT *pCreateStruct, UINT8 *pubID )
|
|||||||
|
|
||||||
void recieveAI (RPCParameters *rpcParameters)
|
void recieveAI (RPCParameters *rpcParameters)
|
||||||
{
|
{
|
||||||
UINT8 iNewIndex;
|
SoldierID iNewIndex;
|
||||||
SOLDIERTYPE *pSoldier;
|
SOLDIERTYPE *pSoldier;
|
||||||
AI_STRUCT* send_inv = (AI_STRUCT*)rpcParameters->input;
|
AI_STRUCT* send_inv = (AI_STRUCT*)rpcParameters->input;
|
||||||
|
|
||||||
@@ -1355,7 +1354,7 @@ void recieveAI (RPCParameters *rpcParameters)
|
|||||||
new_standard_data.fPlayerPlan=1;
|
new_standard_data.fPlayerPlan=1;
|
||||||
|
|
||||||
TacticalCreateSoldier( &new_standard_data, &iNewIndex );
|
TacticalCreateSoldier( &new_standard_data, &iNewIndex );
|
||||||
pSoldier = &Menptr[iNewIndex];
|
pSoldier = iNewIndex;
|
||||||
pSoldier->flags.uiStatusFlags |= SOLDIER_PC;
|
pSoldier->flags.uiStatusFlags |= SOLDIER_PC;
|
||||||
|
|
||||||
AddSoldierToSector( iNewIndex );
|
AddSoldierToSector( iNewIndex );
|
||||||
@@ -1900,7 +1899,7 @@ void recieveSTOP (RPCParameters *rpcParameters)
|
|||||||
{
|
{
|
||||||
EV_S_STOP_MERC* SStopMerc =(EV_S_STOP_MERC*)rpcParameters->input;
|
EV_S_STOP_MERC* SStopMerc =(EV_S_STOP_MERC*)rpcParameters->input;
|
||||||
|
|
||||||
SOLDIERTYPE *pSoldier = MercPtrs[ SStopMerc->usSoldierID ];
|
SOLDIERTYPE *pSoldier = SStopMerc->usSoldierID;
|
||||||
|
|
||||||
pSoldier->EVENT_InternalSetSoldierPosition( SStopMerc->sXPos, SStopMerc->sYPos,FALSE, FALSE, FALSE );
|
pSoldier->EVENT_InternalSetSoldierPosition( SStopMerc->sXPos, SStopMerc->sYPos,FALSE, FALSE, FALSE );
|
||||||
pSoldier->EVENT_SetSoldierDirection( SStopMerc->ubDirection );
|
pSoldier->EVENT_SetSoldierDirection( SStopMerc->ubDirection );
|
||||||
@@ -1914,10 +1913,10 @@ void send_interrupt (SOLDIERTYPE *pSoldier)
|
|||||||
|
|
||||||
INT.ubID = pSoldier->ubID;
|
INT.ubID = pSoldier->ubID;
|
||||||
INT.bTeam = pSoldier->bTeam;
|
INT.bTeam = pSoldier->bTeam;
|
||||||
memcpy(INT.gubOutOfTurnOrder, gubOutOfTurnOrder, sizeof(UINT8) * MAXMERCS);
|
memcpy(INT.gubOutOfTurnOrder, gubOutOfTurnOrder, sizeof(UINT16) * MAXMERCS);
|
||||||
INT.gubOutOfTurnPersons = gubOutOfTurnPersons;
|
INT.gubOutOfTurnPersons = gubOutOfTurnPersons;
|
||||||
|
|
||||||
INT.Interrupted=gusSelectedSoldier+ubID_prefix;
|
INT.Interrupted = gusSelectedSoldier + ubID_prefix;
|
||||||
|
|
||||||
if(INT.bTeam==0)
|
if(INT.bTeam==0)
|
||||||
{
|
{
|
||||||
@@ -1945,7 +1944,7 @@ void send_interrupt (SOLDIERTYPE *pSoldier)
|
|||||||
if (cGameType == MP_TYPE_COOP)
|
if (cGameType == MP_TYPE_COOP)
|
||||||
{
|
{
|
||||||
INT_STRUCT* INT = (INT_STRUCT*)rpcParameters->input;
|
INT_STRUCT* INT = (INT_STRUCT*)rpcParameters->input;
|
||||||
SOLDIERTYPE* pOpponent = MercPtrs[ INT->Interrupted];
|
SOLDIERTYPE* pOpponent = INT->Interrupted;
|
||||||
|
|
||||||
if( INT->bTeam == netbTeam || is_server)//its for us or we are server and its for AI which we control
|
if( INT->bTeam == netbTeam || is_server)//its for us or we are server and its for AI which we control
|
||||||
{
|
{
|
||||||
@@ -1970,7 +1969,7 @@ void send_interrupt (SOLDIERTYPE *pSoldier)
|
|||||||
INT->gubOutOfTurnOrder[i]=INT->gubOutOfTurnOrder[i]-ubID_prefix;
|
INT->gubOutOfTurnOrder[i]=INT->gubOutOfTurnOrder[i]-ubID_prefix;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
memcpy(gubOutOfTurnOrder,INT->gubOutOfTurnOrder, sizeof(UINT8) * MAXMERCS);
|
memcpy(gubOutOfTurnOrder,INT->gubOutOfTurnOrder, sizeof(UINT16) * MAXMERCS);
|
||||||
gubOutOfTurnPersons = INT->gubOutOfTurnPersons;
|
gubOutOfTurnPersons = INT->gubOutOfTurnPersons;
|
||||||
|
|
||||||
if(INT->bTeam==netbTeam)//for us
|
if(INT->bTeam==netbTeam)//for us
|
||||||
@@ -1979,7 +1978,7 @@ void send_interrupt (SOLDIERTYPE *pSoldier)
|
|||||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"Recieved interrupt between %s and %s.", TeamNameStrings[pOpponent->bTeam], TeamNameStrings[INT->bTeam] );
|
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"Recieved interrupt between %s and %s.", TeamNameStrings[pOpponent->bTeam], TeamNameStrings[INT->bTeam] );
|
||||||
|
|
||||||
//start interrupt turn //real interrupt code
|
//start interrupt turn //real interrupt code
|
||||||
SOLDIERTYPE* pSoldier = MercPtrs[ INT->ubID ];
|
SOLDIERTYPE* pSoldier = INT->ubID;
|
||||||
ManSeesMan(pSoldier,pOpponent,pOpponent->sGridNo,pOpponent->pathing.bLevel,2,1);
|
ManSeesMan(pSoldier,pOpponent,pOpponent->sGridNo,pOpponent->pathing.bLevel,2,1);
|
||||||
StartInterrupt();
|
StartInterrupt();
|
||||||
}
|
}
|
||||||
@@ -1995,7 +1994,7 @@ void send_interrupt (SOLDIERTYPE *pSoldier)
|
|||||||
{
|
{
|
||||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"Interrupt of %s awarded to you.", TeamNameStrings[pOpponent->bTeam] );//was MPClientMessage[37], can be reconnected if text updated and translated
|
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"Interrupt of %s awarded to you.", TeamNameStrings[pOpponent->bTeam] );//was MPClientMessage[37], can be reconnected if text updated and translated
|
||||||
|
|
||||||
SOLDIERTYPE* pSoldier = MercPtrs[ INT->ubID ];
|
SOLDIERTYPE* pSoldier = INT->ubID;
|
||||||
ManSeesMan(pSoldier,pOpponent,pOpponent->sGridNo,pOpponent->pathing.bLevel,2,1);
|
ManSeesMan(pSoldier,pOpponent,pOpponent->sGridNo,pOpponent->pathing.bLevel,2,1);
|
||||||
StartInterrupt();
|
StartInterrupt();
|
||||||
}
|
}
|
||||||
@@ -2004,7 +2003,7 @@ void send_interrupt (SOLDIERTYPE *pSoldier)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
INT_STRUCT* INT = (INT_STRUCT*)rpcParameters->input;
|
INT_STRUCT* INT = (INT_STRUCT*)rpcParameters->input;
|
||||||
SOLDIERTYPE* pOpponent = MercPtrs[ INT->Interrupted];
|
SOLDIERTYPE* pOpponent = INT->Interrupted;
|
||||||
|
|
||||||
if(INT->bTeam==netbTeam)//for us
|
if(INT->bTeam==netbTeam)//for us
|
||||||
{
|
{
|
||||||
@@ -2018,7 +2017,7 @@ void send_interrupt (SOLDIERTYPE *pSoldier)
|
|||||||
INT->gubOutOfTurnOrder[i]=INT->gubOutOfTurnOrder[i]-ubID_prefix;
|
INT->gubOutOfTurnOrder[i]=INT->gubOutOfTurnOrder[i]-ubID_prefix;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
memcpy(gubOutOfTurnOrder,INT->gubOutOfTurnOrder, sizeof(UINT8) * MAXMERCS);
|
memcpy(gubOutOfTurnOrder,INT->gubOutOfTurnOrder, sizeof(UINT16) * MAXMERCS);
|
||||||
gubOutOfTurnPersons = INT->gubOutOfTurnPersons;
|
gubOutOfTurnPersons = INT->gubOutOfTurnPersons;
|
||||||
|
|
||||||
AddTopMessage( PLAYER_INTERRUPT_MESSAGE, TeamTurnString[ INT->bTeam ] );
|
AddTopMessage( PLAYER_INTERRUPT_MESSAGE, TeamTurnString[ INT->bTeam ] );
|
||||||
@@ -2029,7 +2028,7 @@ void send_interrupt (SOLDIERTYPE *pSoldier)
|
|||||||
if( INT->bTeam != 0)//not for our team - hayden
|
if( INT->bTeam != 0)//not for our team - hayden
|
||||||
{
|
{
|
||||||
//stop moving merc who was interrupted and init UI bar
|
//stop moving merc who was interrupted and init UI bar
|
||||||
SOLDIERTYPE* pMerc = MercPtrs[ INT->ubID ];
|
SOLDIERTYPE* pMerc = INT->ubID;
|
||||||
pMerc->HaultSoldierFromSighting(TRUE);
|
pMerc->HaultSoldierFromSighting(TRUE);
|
||||||
FreezeInterfaceForEnemyTurn();
|
FreezeInterfaceForEnemyTurn();
|
||||||
InitEnemyUIBar( 0, 0 );
|
InitEnemyUIBar( 0, 0 );
|
||||||
@@ -2050,7 +2049,7 @@ void send_interrupt (SOLDIERTYPE *pSoldier)
|
|||||||
{
|
{
|
||||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"Interrupt of %s awarded to you.", TeamNameStrings[pOpponent->bTeam] );//was MPClientMessage[37], can be reconnected if text updated and translated
|
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"Interrupt of %s awarded to you.", TeamNameStrings[pOpponent->bTeam] );//was MPClientMessage[37], can be reconnected if text updated and translated
|
||||||
|
|
||||||
SOLDIERTYPE* pSoldier = MercPtrs[ INT->ubID ];
|
SOLDIERTYPE* pSoldier = INT->ubID;
|
||||||
ManSeesMan(pSoldier,pOpponent,pOpponent->sGridNo,pOpponent->pathing.bLevel,2,1);
|
ManSeesMan(pSoldier,pOpponent,pOpponent->sGridNo,pOpponent->pathing.bLevel,2,1);
|
||||||
StartInterrupt();
|
StartInterrupt();
|
||||||
}
|
}
|
||||||
@@ -2134,7 +2133,7 @@ void end_interrupt ( BOOLEAN fMarkInterruptOccurred )
|
|||||||
INT_STRUCT INT;
|
INT_STRUCT INT;
|
||||||
INT.ubID = pSoldier->ubID;
|
INT.ubID = pSoldier->ubID;
|
||||||
INT.bTeam = pSoldier->bTeam;
|
INT.bTeam = pSoldier->bTeam;
|
||||||
memcpy(INT.gubOutOfTurnOrder, gubOutOfTurnOrder, sizeof(UINT8) * MAXMERCS);
|
memcpy(INT.gubOutOfTurnOrder, gubOutOfTurnOrder, sizeof(UINT16) * MAXMERCS);
|
||||||
INT.gubOutOfTurnPersons = gubOutOfTurnPersons;
|
INT.gubOutOfTurnPersons = gubOutOfTurnPersons;
|
||||||
INT.fMarkInterruptOccurred=fMarkInterruptOccurred;
|
INT.fMarkInterruptOccurred=fMarkInterruptOccurred;
|
||||||
if(is_server)Sawarded=false;
|
if(is_server)Sawarded=false;
|
||||||
@@ -2175,7 +2174,7 @@ void resume_turn(RPCParameters *rpcParameters)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(gubOutOfTurnOrder,INT->gubOutOfTurnOrder, sizeof(UINT8) * MAXMERCS);
|
memcpy(gubOutOfTurnOrder,INT->gubOutOfTurnOrder, sizeof(UINT16) * MAXMERCS);
|
||||||
gubOutOfTurnPersons = INT->gubOutOfTurnPersons;
|
gubOutOfTurnPersons = INT->gubOutOfTurnPersons;
|
||||||
EndInterrupt( INT->fMarkInterruptOccurred );
|
EndInterrupt( INT->fMarkInterruptOccurred );
|
||||||
}
|
}
|
||||||
@@ -2921,11 +2920,11 @@ void recieveMAPCHANGE( RPCParameters *rpcParameters )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 20091002 - OJW - Explosives
|
// 20091002 - OJW - Explosives
|
||||||
void send_grenade (OBJECTTYPE *pGameObj, float dLifeLength, float xPos, float yPos, float zPos, float xForce, float yForce, float zForce, UINT32 sTargetGridNo, UINT8 ubOwner, UINT8 ubActionCode, UINT32 uiActionData, INT32 iRealObjectID , bool bIsThrownGrenade)
|
void send_grenade (OBJECTTYPE *pGameObj, float dLifeLength, float xPos, float yPos, float zPos, float xForce, float yForce, float zForce, UINT32 sTargetGridNo, SoldierID ubOwner, UINT8 ubActionCode, UINT32 uiActionData, INT32 iRealObjectID, bool bIsThrownGrenade)
|
||||||
{
|
{
|
||||||
ubOwner = MPEncodeSoldierID(ubOwner); // translate our soldier to the "network" version
|
ubOwner = MPEncodeSoldierID(ubOwner); // translate our soldier to the "network" version
|
||||||
|
|
||||||
SOLDIERTYPE* pSoldier = MercPtrs[ubOwner];
|
SOLDIERTYPE* pSoldier = ubOwner;
|
||||||
if (pSoldier != NULL)
|
if (pSoldier != NULL)
|
||||||
{
|
{
|
||||||
if ((pSoldier->bTeam == 1 && is_server) || IsOurSoldier(pSoldier))
|
if ((pSoldier->bTeam == 1 && is_server) || IsOurSoldier(pSoldier))
|
||||||
@@ -2943,14 +2942,13 @@ void send_grenade (OBJECTTYPE *pGameObj, float dLifeLength, float xPos, float yP
|
|||||||
gren.ubID = ubOwner;
|
gren.ubID = ubOwner;
|
||||||
gren.usItem = pGameObj->usItem;
|
gren.usItem = pGameObj->usItem;
|
||||||
gren.sTargetGridNo = sTargetGridNo;
|
gren.sTargetGridNo = sTargetGridNo;
|
||||||
gren.ubID = ubOwner;
|
|
||||||
gren.RealObjectID = iRealObjectID;
|
gren.RealObjectID = iRealObjectID;
|
||||||
gren.IsThrownGrenade = bIsThrownGrenade;
|
gren.IsThrownGrenade = bIsThrownGrenade;
|
||||||
gren.uiPreRandomIndex = guiPreRandomIndex;
|
gren.uiPreRandomIndex = guiPreRandomIndex;
|
||||||
|
|
||||||
#ifdef JA2BETAVERSION
|
#ifdef JA2BETAVERSION
|
||||||
CHAR tmpMPDbgString[512];
|
CHAR tmpMPDbgString[512];
|
||||||
sprintf(tmpMPDbgString,"MP - send_grenade ( usItem : %i , sGridNo : %i , ubSoldierID : %i , uiPreRandomIndex : %i )\n",gren.usItem, gren.sTargetGridNo , gren.ubID , guiPreRandomIndex );
|
sprintf(tmpMPDbgString,"MP - send_grenade ( usItem : %i , sGridNo : %i , ubSoldierID : %i , uiPreRandomIndex : %i )\n",gren.usItem, gren.sTargetGridNo , gren.ubID.i , guiPreRandomIndex );
|
||||||
MPDebugMsg(tmpMPDbgString);
|
MPDebugMsg(tmpMPDbgString);
|
||||||
gfMPDebugOutputRandoms = true;
|
gfMPDebugOutputRandoms = true;
|
||||||
#endif
|
#endif
|
||||||
@@ -2966,7 +2964,7 @@ void recieveGRENADE (RPCParameters *rpcParameters)
|
|||||||
|
|
||||||
gren->ubID = MPDecodeSoldierID(gren->ubID);
|
gren->ubID = MPDecodeSoldierID(gren->ubID);
|
||||||
|
|
||||||
SOLDIERTYPE* pThrower = MercPtrs[ gren->ubID ];
|
SOLDIERTYPE* pThrower = gren->ubID;
|
||||||
if (pThrower != NULL)
|
if (pThrower != NULL)
|
||||||
{
|
{
|
||||||
guiPreRandomIndex = gren->uiPreRandomIndex;
|
guiPreRandomIndex = gren->uiPreRandomIndex;
|
||||||
@@ -2976,7 +2974,7 @@ void recieveGRENADE (RPCParameters *rpcParameters)
|
|||||||
{
|
{
|
||||||
#ifdef JA2BETAVERSION
|
#ifdef JA2BETAVERSION
|
||||||
CHAR tmpMPDbgString[512];
|
CHAR tmpMPDbgString[512];
|
||||||
sprintf(tmpMPDbgString,"MP - recieveGRENADE ( usItem : %i , sGridNo : %i , ubSoldierID : %i , uiPreRandomIndex : %i )\n",gren->usItem, gren->sTargetGridNo , gren->ubID , guiPreRandomIndex );
|
sprintf(tmpMPDbgString,"MP - recieveGRENADE ( usItem : %i , sGridNo : %i , ubSoldierID : %i , uiPreRandomIndex : %i )\n",gren->usItem, gren->sTargetGridNo , gren->ubID.i , guiPreRandomIndex );
|
||||||
MPDebugMsg(tmpMPDbgString);
|
MPDebugMsg(tmpMPDbgString);
|
||||||
gfMPDebugOutputRandoms = true;
|
gfMPDebugOutputRandoms = true;
|
||||||
#endif
|
#endif
|
||||||
@@ -2986,7 +2984,7 @@ void recieveGRENADE (RPCParameters *rpcParameters)
|
|||||||
CreateItem( gren->usItem, 99, newObj );
|
CreateItem( gren->usItem, 99, newObj );
|
||||||
OBJECTTYPE::CopyToOrCreateAt(&pThrower->pTempObject, newObj);
|
OBJECTTYPE::CopyToOrCreateAt(&pThrower->pTempObject, newObj);
|
||||||
// this will create a grenade and launch it
|
// this will create a grenade and launch it
|
||||||
INT32 i = CreatePhysicalObject( pThrower->pTempObject , gren->dLifeSpan , gren->dX , gren->dY , gren->dZ , gren->dForceX , gren->dForceY , gren->dForceZ , pThrower->ubID , gren->ubActionCode , gren->uiActionData, false);
|
INT32 i = CreatePhysicalObject( pThrower->pTempObject, gren->dLifeSpan, gren->dX, gren->dY, gren->dZ, gren->dForceX, gren->dForceY, gren->dForceZ, pThrower->ubID, gren->ubActionCode, gren->uiActionData, false);
|
||||||
// save extra state info so we can check and feed it result later
|
// save extra state info so we can check and feed it result later
|
||||||
ObjectSlots[ i ].mpRealObjectID = gren->RealObjectID;
|
ObjectSlots[ i ].mpRealObjectID = gren->RealObjectID;
|
||||||
ObjectSlots[ i ].mpTeam = pThrower->bTeam;
|
ObjectSlots[ i ].mpTeam = pThrower->bTeam;
|
||||||
@@ -3023,7 +3021,7 @@ void recieveGRENADE (RPCParameters *rpcParameters)
|
|||||||
{
|
{
|
||||||
#ifdef JA2BETAVERSION
|
#ifdef JA2BETAVERSION
|
||||||
char tmpMsg[128];
|
char tmpMsg[128];
|
||||||
sprintf(tmpMsg,"ERROR! - Invalid Soldier pointer from ubID %i in recieveGRENADE()",gren->ubID);
|
sprintf(tmpMsg,"ERROR! - Invalid Soldier pointer from ubID %i in recieveGRENADE()", gren->ubID.i);
|
||||||
//ScreenMsg(FONT_RED,MSG_MPSYSTEM,tmpMsg);
|
//ScreenMsg(FONT_RED,MSG_MPSYSTEM,tmpMsg);
|
||||||
MPDebugMsg(tmpMsg);
|
MPDebugMsg(tmpMsg);
|
||||||
#endif
|
#endif
|
||||||
@@ -3031,11 +3029,11 @@ void recieveGRENADE (RPCParameters *rpcParameters)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// we send a grenade result out to the clients as it may have been a fizzer
|
// we send a grenade result out to the clients as it may have been a fizzer
|
||||||
void send_grenade_result (float xPos, float yPos, float zPos, INT32 sGridNo, UINT8 ubOwnerID, INT32 iRealObjectID, bool bIsDud)
|
void send_grenade_result (float xPos, float yPos, float zPos, INT32 sGridNo, SoldierID ubOwnerID, INT32 iRealObjectID, bool bIsDud)
|
||||||
{
|
{
|
||||||
ubOwnerID = MPEncodeSoldierID(ubOwnerID); // translate our soldier to the "network" version
|
ubOwnerID = MPEncodeSoldierID(ubOwnerID); // translate our soldier to the "network" version
|
||||||
|
|
||||||
SOLDIERTYPE* pSoldier = MercPtrs[ubOwnerID];
|
SOLDIERTYPE* pSoldier = ubOwnerID;
|
||||||
if (pSoldier != NULL)
|
if (pSoldier != NULL)
|
||||||
{
|
{
|
||||||
if ((pSoldier->bTeam == 1 && is_server) || IsOurSoldier(pSoldier))
|
if ((pSoldier->bTeam == 1 && is_server) || IsOurSoldier(pSoldier))
|
||||||
@@ -3052,7 +3050,7 @@ void send_grenade_result (float xPos, float yPos, float zPos, INT32 sGridNo, UIN
|
|||||||
|
|
||||||
#ifdef JA2BETAVERSION
|
#ifdef JA2BETAVERSION
|
||||||
CHAR tmpMPDbgString[512];
|
CHAR tmpMPDbgString[512];
|
||||||
sprintf(tmpMPDbgString,"MP - send_grenade_result ( RealObjectID : %i , sGridNo : %i , ubSoldierID : %i , uiPreRandomIndex : %i )\n",gres.RealObjectID, gres.sGridNo , gres.ubOwnerID , guiPreRandomIndex );
|
sprintf( tmpMPDbgString, "MP - send_grenade_result ( RealObjectID : %i , sGridNo : %i , ubSoldierID : %i , uiPreRandomIndex : %i )\n", gres.RealObjectID, gres.sGridNo, gres.ubOwnerID.i, guiPreRandomIndex );
|
||||||
MPDebugMsg(tmpMPDbgString);
|
MPDebugMsg(tmpMPDbgString);
|
||||||
gfMPDebugOutputRandoms = true;
|
gfMPDebugOutputRandoms = true;
|
||||||
#endif
|
#endif
|
||||||
@@ -3068,7 +3066,7 @@ void recieveGRENADERESULT (RPCParameters *rpcParameters)
|
|||||||
|
|
||||||
gres->ubOwnerID = MPDecodeSoldierID(gres->ubOwnerID);
|
gres->ubOwnerID = MPDecodeSoldierID(gres->ubOwnerID);
|
||||||
|
|
||||||
SOLDIERTYPE* pThrower = MercPtrs[ gres->ubOwnerID ];
|
SOLDIERTYPE* pThrower = gres->ubOwnerID;
|
||||||
if (pThrower != NULL)
|
if (pThrower != NULL)
|
||||||
{
|
{
|
||||||
// grenade wasnt thrown by one of our guys, so we should do it on the client
|
// grenade wasnt thrown by one of our guys, so we should do it on the client
|
||||||
@@ -3076,7 +3074,7 @@ void recieveGRENADERESULT (RPCParameters *rpcParameters)
|
|||||||
{
|
{
|
||||||
#ifdef JA2BETAVERSION
|
#ifdef JA2BETAVERSION
|
||||||
CHAR tmpMPDbgString[512];
|
CHAR tmpMPDbgString[512];
|
||||||
sprintf(tmpMPDbgString,"MP - recieveGRENADERESULT ( RealObjectID : %i , sGridNo : %i , ubSoldierID : %i , uiPreRandomIndex : %i )\n",gres->RealObjectID, gres->sGridNo , gres->ubOwnerID , gres->uiPreRandomIndex );
|
sprintf( tmpMPDbgString, "MP - recieveGRENADERESULT ( RealObjectID : %i , sGridNo : %i , ubSoldierID : %i , uiPreRandomIndex : %i )\n", gres->RealObjectID, gres->sGridNo, gres->ubOwnerID.i, gres->uiPreRandomIndex );
|
||||||
MPDebugMsg(tmpMPDbgString);
|
MPDebugMsg(tmpMPDbgString);
|
||||||
gfMPDebugOutputRandoms = true;
|
gfMPDebugOutputRandoms = true;
|
||||||
#endif
|
#endif
|
||||||
@@ -3122,14 +3120,14 @@ void recieveGRENADERESULT (RPCParameters *rpcParameters)
|
|||||||
{
|
{
|
||||||
#ifdef JA2BETAVERSION
|
#ifdef JA2BETAVERSION
|
||||||
char tmpMsg[128];
|
char tmpMsg[128];
|
||||||
sprintf(tmpMsg,"ERROR! - Invalid Soldier pointer from ubID %i in recieveGRENADERESULT()",gres->ubOwnerID);
|
sprintf(tmpMsg,"ERROR! - Invalid Soldier pointer from ubID %i in recieveGRENADERESULT()", gres->ubOwnerID.i);
|
||||||
//ScreenMsg(FONT_RED,MSG_MPSYSTEM,tmpMsg);
|
//ScreenMsg(FONT_RED,MSG_MPSYSTEM,tmpMsg);
|
||||||
MPDebugMsg(tmpMsg);
|
MPDebugMsg(tmpMsg);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void send_plant_explosive (UINT8 ubID,UINT16 usItem,UINT8 ubItemStatus,UINT16 usFlags, UINT32 sGridNo,UINT8 ubLevel, UINT32 uiWorldItemIndex)
|
void send_plant_explosive (SoldierID ubID,UINT16 usItem,UINT8 ubItemStatus,UINT16 usFlags, UINT32 sGridNo,UINT8 ubLevel, UINT32 uiWorldItemIndex)
|
||||||
{
|
{
|
||||||
explosive_obj exp;
|
explosive_obj exp;
|
||||||
|
|
||||||
@@ -3148,7 +3146,7 @@ void send_plant_explosive (UINT8 ubID,UINT16 usItem,UINT8 ubItemStatus,UINT16 us
|
|||||||
|
|
||||||
#ifdef JA2BETAVERSION
|
#ifdef JA2BETAVERSION
|
||||||
CHAR tmpMPDbgString[512];
|
CHAR tmpMPDbgString[512];
|
||||||
sprintf(tmpMPDbgString,"MP - send_plant_explosive ( usItem : %i , sGridNo : %i , ubSoldierID : %i , uiPreRandomIndex : %i , uiWorldItemIndex : %i )\n",exp.usItem, exp.sGridNo , exp.ubID , guiPreRandomIndex , uiWorldItemIndex );
|
sprintf(tmpMPDbgString,"MP - send_plant_explosive ( usItem : %i , sGridNo : %i , ubSoldierID : %i , uiPreRandomIndex : %i , uiWorldItemIndex : %i )\n",exp.usItem, exp.sGridNo , exp.ubID.i , guiPreRandomIndex , uiWorldItemIndex );
|
||||||
MPDebugMsg(tmpMPDbgString);
|
MPDebugMsg(tmpMPDbgString);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -3161,7 +3159,7 @@ void recievePLANTEXPLOSIVE (RPCParameters *rpcParameters)
|
|||||||
|
|
||||||
exp->ubID = MPDecodeSoldierID( exp->ubID );
|
exp->ubID = MPDecodeSoldierID( exp->ubID );
|
||||||
|
|
||||||
SOLDIERTYPE* pSoldier = MercPtrs[ exp->ubID ];
|
SOLDIERTYPE* pSoldier = exp->ubID;
|
||||||
if (pSoldier != NULL)
|
if (pSoldier != NULL)
|
||||||
{
|
{
|
||||||
// explosive wasnt planted on our client, so we should do it on the client
|
// explosive wasnt planted on our client, so we should do it on the client
|
||||||
@@ -3169,7 +3167,7 @@ void recievePLANTEXPLOSIVE (RPCParameters *rpcParameters)
|
|||||||
{
|
{
|
||||||
#ifdef JA2BETAVERSION
|
#ifdef JA2BETAVERSION
|
||||||
CHAR tmpMPDbgString[512];
|
CHAR tmpMPDbgString[512];
|
||||||
sprintf(tmpMPDbgString,"MP - recievePLANTEXPLOSIVE ( usItem : %i , sGridNo : %i , ubSoldierID : %i , uiPreRandomIndex : %i )\n",exp->usItem, exp->sGridNo , exp->ubID , guiPreRandomIndex );
|
sprintf( tmpMPDbgString, "MP - recievePLANTEXPLOSIVE ( usItem : %i , sGridNo : %i , ubSoldierID : %i , uiPreRandomIndex : %i )\n", exp->usItem, exp->sGridNo, exp->ubID.i, guiPreRandomIndex );
|
||||||
MPDebugMsg(tmpMPDbgString);
|
MPDebugMsg(tmpMPDbgString);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -3177,7 +3175,7 @@ void recievePLANTEXPLOSIVE (RPCParameters *rpcParameters)
|
|||||||
OBJECTTYPE* newObj = new OBJECTTYPE();
|
OBJECTTYPE* newObj = new OBJECTTYPE();
|
||||||
CreateItem( exp->usItem, exp->ubItemStatus, newObj );
|
CreateItem( exp->usItem, exp->ubItemStatus, newObj );
|
||||||
INT32 iNewItemIndex;
|
INT32 iNewItemIndex;
|
||||||
OBJECTTYPE* pObj = AddItemToPoolAndGetIndex( exp->sGridNo, newObj, VISIBLE, exp->ubLevel, exp->usFlags,0, exp->ubID ,&iNewItemIndex);
|
OBJECTTYPE* pObj = AddItemToPoolAndGetIndex( exp->sGridNo, newObj, VISIBLE, exp->ubLevel, exp->usFlags,0, exp->ubID,&iNewItemIndex);
|
||||||
// need to save Item Type metadata agaist the world item
|
// need to save Item Type metadata agaist the world item
|
||||||
(*pObj)[0]->data.misc.ubBombOwner = exp->ubID + 2; // this is a hack the designers put into the game, storing the side as well (which isnt relevant in MP, but still have to do it)
|
(*pObj)[0]->data.misc.ubBombOwner = exp->ubID + 2; // this is a hack the designers put into the game, storing the side as well (which isnt relevant in MP, but still have to do it)
|
||||||
(*pObj)[0]->data.misc.usBombItem = exp->usItem;
|
(*pObj)[0]->data.misc.usBombItem = exp->usItem;
|
||||||
@@ -3223,18 +3221,18 @@ void recievePLANTEXPLOSIVE (RPCParameters *rpcParameters)
|
|||||||
{
|
{
|
||||||
#ifdef JA2BETAVERSION
|
#ifdef JA2BETAVERSION
|
||||||
char tmpMsg[128];
|
char tmpMsg[128];
|
||||||
sprintf(tmpMsg,"ERROR! - Invalid Soldier pointer from ubID %i in recievePLANTEXPLOSIVE()",exp->ubID);
|
sprintf(tmpMsg,"ERROR! - Invalid Soldier pointer from ubID %i in recievePLANTEXPLOSIVE()",exp->ubID.i);
|
||||||
//ScreenMsg(FONT_RED,MSG_MPSYSTEM,tmpMsg);
|
//ScreenMsg(FONT_RED,MSG_MPSYSTEM,tmpMsg);
|
||||||
MPDebugMsg(tmpMsg);
|
MPDebugMsg(tmpMsg);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void send_detonate_explosive (UINT32 uiWorldIndex, UINT8 ubID)
|
void send_detonate_explosive (UINT32 uiWorldIndex, SoldierID ubID)
|
||||||
{
|
{
|
||||||
ubID = MPEncodeSoldierID(ubID);
|
ubID = MPEncodeSoldierID(ubID);
|
||||||
|
|
||||||
SOLDIERTYPE* pSoldier = MercPtrs[ubID];
|
SOLDIERTYPE* pSoldier = ubID;
|
||||||
if (pSoldier != NULL)
|
if (pSoldier != NULL)
|
||||||
{
|
{
|
||||||
// explosive detonated on this client, notify the other clients
|
// explosive detonated on this client, notify the other clients
|
||||||
@@ -3298,7 +3296,7 @@ void recieveDETONATEEXPLOSIVE (RPCParameters *rpcParameters)
|
|||||||
|
|
||||||
det->ubID = MPDecodeSoldierID(det->ubID);
|
det->ubID = MPDecodeSoldierID(det->ubID);
|
||||||
|
|
||||||
SOLDIERTYPE* pSoldier = MercPtrs[det->ubID];
|
SOLDIERTYPE* pSoldier = det->ubID;
|
||||||
if (pSoldier != NULL)
|
if (pSoldier != NULL)
|
||||||
{
|
{
|
||||||
// if explosive detonation didnt originate from this client then its need to be performed here
|
// if explosive detonation didnt originate from this client then its need to be performed here
|
||||||
@@ -3306,7 +3304,7 @@ void recieveDETONATEEXPLOSIVE (RPCParameters *rpcParameters)
|
|||||||
{
|
{
|
||||||
#ifdef JA2BETAVERSION
|
#ifdef JA2BETAVERSION
|
||||||
CHAR tmpMPDbgString[512];
|
CHAR tmpMPDbgString[512];
|
||||||
sprintf(tmpMPDbgString,"MP - recieveDETONATEEXPLOSIVE ( MPTeam : %i , uiWorldIndex : %i , uiPreRandomIndex : %i , ubID : %i )\n",det->ubMPTeamIndex, det->uiWorldItemIndex , det->uiPreRandomIndex , det->ubID );
|
sprintf(tmpMPDbgString,"MP - recieveDETONATEEXPLOSIVE ( MPTeam : %i , uiWorldIndex : %i , uiPreRandomIndex : %i , ubID : %i )\n",det->ubMPTeamIndex, det->uiWorldItemIndex , det->uiPreRandomIndex , det->ubID.i );
|
||||||
MPDebugMsg(tmpMPDbgString);
|
MPDebugMsg(tmpMPDbgString);
|
||||||
gfMPDebugOutputRandoms = true;
|
gfMPDebugOutputRandoms = true;
|
||||||
#endif
|
#endif
|
||||||
@@ -3344,11 +3342,11 @@ void recieveDETONATEEXPLOSIVE (RPCParameters *rpcParameters)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void send_disarm_explosive(UINT32 sGridNo, UINT32 uiWorldItem, UINT8 ubID)
|
void send_disarm_explosive(UINT32 sGridNo, UINT32 uiWorldItem, SoldierID ubID)
|
||||||
{
|
{
|
||||||
ubID = MPEncodeSoldierID(ubID);
|
ubID = MPEncodeSoldierID(ubID);
|
||||||
|
|
||||||
SOLDIERTYPE* pSoldier = MercPtrs[ubID];
|
SOLDIERTYPE* pSoldier = ubID;
|
||||||
if (pSoldier != NULL)
|
if (pSoldier != NULL)
|
||||||
{
|
{
|
||||||
// explosive disarmed on this client, notify the other clients
|
// explosive disarmed on this client, notify the other clients
|
||||||
@@ -3411,7 +3409,7 @@ void recieveDISARMEXPLOSIVE (RPCParameters *rpcParameters)
|
|||||||
|
|
||||||
disarm->ubID = MPDecodeSoldierID(disarm->ubID);
|
disarm->ubID = MPDecodeSoldierID(disarm->ubID);
|
||||||
|
|
||||||
SOLDIERTYPE* pSoldier = MercPtrs[disarm->ubID];
|
SOLDIERTYPE* pSoldier = disarm->ubID;
|
||||||
if (pSoldier != NULL)
|
if (pSoldier != NULL)
|
||||||
{
|
{
|
||||||
// if explosive disarm didnt originate from this client then its need to be performed here
|
// if explosive disarm didnt originate from this client then its need to be performed here
|
||||||
@@ -3419,7 +3417,7 @@ void recieveDISARMEXPLOSIVE (RPCParameters *rpcParameters)
|
|||||||
{
|
{
|
||||||
#ifdef JA2BETAVERSION
|
#ifdef JA2BETAVERSION
|
||||||
CHAR tmpMPDbgString[512];
|
CHAR tmpMPDbgString[512];
|
||||||
sprintf(tmpMPDbgString,"MP - recieveDISARMEXPLOSIVE ( MPTeam : %i , uiWorldItemIndex : %i , uiPreRandomIndex : %i , ubID : %i , sGridNo : %i )\n",disarm->ubMPTeamIndex, disarm->uiWorldItemIndex , disarm->uiPreRandomIndex , disarm->ubID , disarm->sGridNo );
|
sprintf(tmpMPDbgString,"MP - recieveDISARMEXPLOSIVE ( MPTeam : %i , uiWorldItemIndex : %i , uiPreRandomIndex : %i , ubID : %i , sGridNo : %i )\n",disarm->ubMPTeamIndex, disarm->uiWorldItemIndex , disarm->uiPreRandomIndex , disarm->ubID.i, disarm->sGridNo );
|
||||||
MPDebugMsg(tmpMPDbgString);
|
MPDebugMsg(tmpMPDbgString);
|
||||||
gfMPDebugOutputRandoms = true;
|
gfMPDebugOutputRandoms = true;
|
||||||
#endif
|
#endif
|
||||||
@@ -3440,7 +3438,7 @@ void recieveDISARMEXPLOSIVE (RPCParameters *rpcParameters)
|
|||||||
// print out a screen message if it was our bomb
|
// print out a screen message if it was our bomb
|
||||||
if (disarm->ubMPTeamIndex == netbTeam)
|
if (disarm->ubMPTeamIndex == netbTeam)
|
||||||
{
|
{
|
||||||
SOLDIERTYPE * pBombOwner = MercPtrs[gWorldItems[ gWorldBombs[ uiCount ].iItemIndex ].soldierID];
|
SOLDIERTYPE * pBombOwner = gWorldItems[ gWorldBombs[ uiCount ].iItemIndex ].soldierID;
|
||||||
if (pBombOwner != NULL)
|
if (pBombOwner != NULL)
|
||||||
{
|
{
|
||||||
ScreenMsg( FONT_LTBLUE , MSG_MPSYSTEM , MPClientMessage[71], pBombOwner->name, pSoldier->name);
|
ScreenMsg( FONT_LTBLUE , MSG_MPSYSTEM , MPClientMessage[71], pBombOwner->name, pSoldier->name);
|
||||||
@@ -3467,7 +3465,7 @@ void recieveDISARMEXPLOSIVE (RPCParameters *rpcParameters)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void send_spreadeffect ( INT32 sGridNo, UINT8 ubRadius, UINT16 usItem, UINT8 ubOwner, BOOLEAN fSubsequent, INT8 bLevel, INT32 iSmokeEffectID )
|
void send_spreadeffect ( INT32 sGridNo, UINT8 ubRadius, UINT16 usItem, SoldierID ubOwner, BOOLEAN fSubsequent, INT8 bLevel, INT32 iSmokeEffectID )
|
||||||
{
|
{
|
||||||
spreadeffect_struct sef;
|
spreadeffect_struct sef;
|
||||||
|
|
||||||
@@ -3482,7 +3480,7 @@ void send_spreadeffect ( INT32 sGridNo, UINT8 ubRadius, UINT16 usItem, UINT8 ubO
|
|||||||
|
|
||||||
#ifdef JA2BETAVERSION
|
#ifdef JA2BETAVERSION
|
||||||
CHAR tmpMPDbgString[512];
|
CHAR tmpMPDbgString[512];
|
||||||
sprintf(tmpMPDbgString,"MP - send_spreadeffect ( sGridNo : %i , ubRadius : %i , usItem : %i , ubOwner : %i , fSubsequent : %i , bLevel : %i , iSmokeEffectID : %i , uiPreRandomIndex : %i )\n",sef.sGridNo, sef.ubRadius ,sef.usItem, sef.ubOwner, sef.fSubsequent, sef.bLevel, sef.iSmokeEffectID, sef.uiPreRandomIndex );
|
sprintf(tmpMPDbgString,"MP - send_spreadeffect ( sGridNo : %i , ubRadius : %i , usItem : %i , ubOwner : %i , fSubsequent : %i , bLevel : %i , iSmokeEffectID : %i , uiPreRandomIndex : %i )\n",sef.sGridNo, sef.ubRadius ,sef.usItem, sef.ubOwner.i, sef.fSubsequent, sef.bLevel, sef.iSmokeEffectID, sef.uiPreRandomIndex );
|
||||||
MPDebugMsg(tmpMPDbgString);
|
MPDebugMsg(tmpMPDbgString);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -3495,7 +3493,7 @@ void recieveSPREADEFFECT (RPCParameters *rpcParameters)
|
|||||||
|
|
||||||
sef->ubOwner = MPDecodeSoldierID(sef->ubOwner);
|
sef->ubOwner = MPDecodeSoldierID(sef->ubOwner);
|
||||||
|
|
||||||
SOLDIERTYPE* pSoldier = MercPtrs[sef->ubOwner];
|
SOLDIERTYPE* pSoldier = sef->ubOwner;
|
||||||
if (pSoldier != NULL)
|
if (pSoldier != NULL)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -3504,7 +3502,7 @@ void recieveSPREADEFFECT (RPCParameters *rpcParameters)
|
|||||||
{
|
{
|
||||||
#ifdef JA2BETAVERSION
|
#ifdef JA2BETAVERSION
|
||||||
CHAR tmpMPDbgString[512];
|
CHAR tmpMPDbgString[512];
|
||||||
sprintf(tmpMPDbgString,"MP - recieveSPREADEFFECT ( sGridNo : %i , ubRadius : %i , usItem : %i , ubOwner : %i , fSubsequent : %i , bLevel : %i , iSmokeEffectID : %i , uiPreRandomIndex : %i )\n",sef->sGridNo, sef->ubRadius ,sef->usItem, sef->ubOwner, sef->fSubsequent, sef->bLevel, sef->iSmokeEffectID, sef->uiPreRandomIndex );
|
sprintf(tmpMPDbgString,"MP - recieveSPREADEFFECT ( sGridNo : %i , ubRadius : %i , usItem : %i , ubOwner : %i , fSubsequent : %i , bLevel : %i , iSmokeEffectID : %i , uiPreRandomIndex : %i )\n",sef->sGridNo, sef->ubRadius ,sef->usItem, sef->ubOwner.i, sef->fSubsequent, sef->bLevel, sef->iSmokeEffectID, sef->uiPreRandomIndex );
|
||||||
MPDebugMsg(tmpMPDbgString);
|
MPDebugMsg(tmpMPDbgString);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -3520,7 +3518,7 @@ void recieveSPREADEFFECT (RPCParameters *rpcParameters)
|
|||||||
if ( gSmokeEffectData[ uiCount ].fAllocated == TRUE && gSmokeEffectData[ uiCount ].iMPTeamIndex == pSoldier->bTeam && gSmokeEffectData[ uiCount ].iMPSmokeEffectID == sef->iSmokeEffectID)
|
if ( gSmokeEffectData[ uiCount ].fAllocated == TRUE && gSmokeEffectData[ uiCount ].iMPTeamIndex == pSoldier->bTeam && gSmokeEffectData[ uiCount ].iMPSmokeEffectID == sef->iSmokeEffectID)
|
||||||
{
|
{
|
||||||
bFound = true;
|
bFound = true;
|
||||||
SpreadEffect( sef->sGridNo , sef->ubRadius , sef->usItem , sef->ubOwner , sef->fSubsequent , sef->bLevel , uiCount , TRUE);
|
SpreadEffect( sef->sGridNo, sef->ubRadius, sef->usItem, sef->ubOwner, sef->fSubsequent, sef->bLevel, uiCount, TRUE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3537,7 +3535,7 @@ void recieveSPREADEFFECT (RPCParameters *rpcParameters)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SpreadEffect( sef->sGridNo , sef->ubRadius , sef->usItem , sef->ubOwner , sef->fSubsequent , sef->bLevel , sef->iSmokeEffectID , TRUE);
|
SpreadEffect( sef->sGridNo, sef->ubRadius, sef->usItem, sef->ubOwner, sef->fSubsequent, sef->bLevel, sef->iSmokeEffectID, TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3545,14 +3543,14 @@ void recieveSPREADEFFECT (RPCParameters *rpcParameters)
|
|||||||
{
|
{
|
||||||
#ifdef JA2BETAVERSION
|
#ifdef JA2BETAVERSION
|
||||||
char tmpMsg2[128];
|
char tmpMsg2[128];
|
||||||
sprintf(tmpMsg2,"ERROR! - Invalid Soldier pointer from ubID %i in recieveSPREADEFFECT()",sef->ubOwner);
|
sprintf(tmpMsg2,"ERROR! - Invalid Soldier pointer from ubID %i in recieveSPREADEFFECT()",sef->ubOwner.i );
|
||||||
//ScreenMsg(FONT_RED,MSG_MPSYSTEM,tmpMsg);
|
//ScreenMsg(FONT_RED,MSG_MPSYSTEM,tmpMsg);
|
||||||
MPDebugMsg(tmpMsg2);
|
MPDebugMsg(tmpMsg2);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void send_newsmokeeffect(INT32 sGridNo, UINT16 usItem, INT8 bLevel, UINT8 ubOwner, INT32 iSmokeEffectID)
|
void send_newsmokeeffect(INT32 sGridNo, UINT16 usItem, INT8 bLevel, SoldierID ubOwner, INT32 iSmokeEffectID)
|
||||||
{
|
{
|
||||||
// i'm reusing this struct, the parameters are essentially the same
|
// i'm reusing this struct, the parameters are essentially the same
|
||||||
spreadeffect_struct sef;
|
spreadeffect_struct sef;
|
||||||
@@ -3566,7 +3564,7 @@ void send_newsmokeeffect(INT32 sGridNo, UINT16 usItem, INT8 bLevel, UINT8 ubOwne
|
|||||||
|
|
||||||
#ifdef JA2BETAVERSION
|
#ifdef JA2BETAVERSION
|
||||||
CHAR tmpMPDbgString[512];
|
CHAR tmpMPDbgString[512];
|
||||||
sprintf(tmpMPDbgString,"MP - send_newsmokeeffect ( sGridNo : %i , usItem : %i , ubOwner : %i , bLevel : %i , iSmokeEffectID : %i , uiPreRandomIndex : %i )\n",sef.sGridNo, sef.usItem, sef.ubOwner, sef.bLevel, sef.iSmokeEffectID, sef.uiPreRandomIndex );
|
sprintf(tmpMPDbgString,"MP - send_newsmokeeffect ( sGridNo : %i , usItem : %i , ubOwner : %i , bLevel : %i , iSmokeEffectID : %i , uiPreRandomIndex : %i )\n",sef.sGridNo, sef.usItem, sef.ubOwner.i, sef.bLevel, sef.iSmokeEffectID, sef.uiPreRandomIndex );
|
||||||
MPDebugMsg(tmpMPDbgString);
|
MPDebugMsg(tmpMPDbgString);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -3580,7 +3578,7 @@ void recieveNEWSMOKEEFFECT (RPCParameters *rpcParameters)
|
|||||||
// translate any of our soldier ids back to the correct local copy
|
// translate any of our soldier ids back to the correct local copy
|
||||||
sef->ubOwner = MPDecodeSoldierID(sef->ubOwner);
|
sef->ubOwner = MPDecodeSoldierID(sef->ubOwner);
|
||||||
|
|
||||||
SOLDIERTYPE* pSoldier = MercPtrs[sef->ubOwner];
|
SOLDIERTYPE* pSoldier = sef->ubOwner;
|
||||||
if (pSoldier != NULL)
|
if (pSoldier != NULL)
|
||||||
{
|
{
|
||||||
// new smoke effect didnt originate from us
|
// new smoke effect didnt originate from us
|
||||||
@@ -3588,14 +3586,14 @@ void recieveNEWSMOKEEFFECT (RPCParameters *rpcParameters)
|
|||||||
{
|
{
|
||||||
#ifdef JA2BETAVERSION
|
#ifdef JA2BETAVERSION
|
||||||
CHAR tmpMPDbgString[512];
|
CHAR tmpMPDbgString[512];
|
||||||
sprintf(tmpMPDbgString,"MP - recieveNEWSMOKEEFFECT ( sGridNo : %i , usItem : %i , ubOwner : %i , bLevel : %i , iSmokeEffectID : %i , uiPreRandomIndex : %i )\n",sef->sGridNo, sef->usItem, sef->ubOwner, sef->bLevel, sef->iSmokeEffectID, sef->uiPreRandomIndex );
|
sprintf(tmpMPDbgString,"MP - recieveNEWSMOKEEFFECT ( sGridNo : %i , usItem : %i , ubOwner : %i , bLevel : %i , iSmokeEffectID : %i , uiPreRandomIndex : %i )\n",sef->sGridNo, sef->usItem, sef->ubOwner.i, sef->bLevel, sef->iSmokeEffectID, sef->uiPreRandomIndex );
|
||||||
MPDebugMsg(tmpMPDbgString);
|
MPDebugMsg(tmpMPDbgString);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
guiPreRandomIndex = sef->uiPreRandomIndex;
|
guiPreRandomIndex = sef->uiPreRandomIndex;
|
||||||
|
|
||||||
// start new smoke effect
|
// start new smoke effect
|
||||||
INT32 iNewSmokeIndex = NewSmokeEffect( sef->sGridNo , sef->usItem , sef->bLevel , sef->ubOwner , TRUE );
|
INT32 iNewSmokeIndex = NewSmokeEffect( sef->sGridNo, sef->usItem, sef->bLevel, sef->ubOwner, TRUE );
|
||||||
|
|
||||||
// attach remote id to local smoke effect
|
// attach remote id to local smoke effect
|
||||||
gSmokeEffectData[iNewSmokeIndex].iMPTeamIndex = pSoldier->bTeam;
|
gSmokeEffectData[iNewSmokeIndex].iMPTeamIndex = pSoldier->bTeam;
|
||||||
@@ -3606,14 +3604,14 @@ void recieveNEWSMOKEEFFECT (RPCParameters *rpcParameters)
|
|||||||
{
|
{
|
||||||
#ifdef JA2BETAVERSION
|
#ifdef JA2BETAVERSION
|
||||||
char tmpMsg[128];
|
char tmpMsg[128];
|
||||||
sprintf(tmpMsg,"ERROR! - Invalid Soldier pointer from ubID %i in recieveNEWSMOKEEFFECT()",sef->ubOwner);
|
sprintf(tmpMsg,"ERROR! - Invalid Soldier pointer from ubID %i in recieveNEWSMOKEEFFECT()",sef->ubOwner.i );
|
||||||
//ScreenMsg(FONT_RED,MSG_MPSYSTEM,tmpMsg);
|
//ScreenMsg(FONT_RED,MSG_MPSYSTEM,tmpMsg);
|
||||||
MPDebugMsg(tmpMsg);
|
MPDebugMsg(tmpMsg);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void send_gasdamage( SOLDIERTYPE * pSoldier, UINT16 usExplosiveClassID, INT16 sSubsequent, BOOLEAN fRecompileMovementCosts, INT16 sWoundAmt, INT16 sBreathAmt, UINT8 ubOwner )
|
void send_gasdamage( SOLDIERTYPE * pSoldier, UINT16 usExplosiveClassID, INT16 sSubsequent, BOOLEAN fRecompileMovementCosts, INT16 sWoundAmt, INT16 sBreathAmt, SoldierID ubOwner )
|
||||||
{
|
{
|
||||||
explosiondamage_struct exp;
|
explosiondamage_struct exp;
|
||||||
exp.ubDamageFunc = 1;
|
exp.ubDamageFunc = 1;
|
||||||
@@ -3628,14 +3626,14 @@ void send_gasdamage( SOLDIERTYPE * pSoldier, UINT16 usExplosiveClassID, INT16 sS
|
|||||||
|
|
||||||
#ifdef JA2BETAVERSION
|
#ifdef JA2BETAVERSION
|
||||||
CHAR tmpMPDbgString[512];
|
CHAR tmpMPDbgString[512];
|
||||||
sprintf(tmpMPDbgString,"MP - send_gasdamage ( ubSoldierID : %i , usExplosiveClassID : %i , sSubsequent : %i , recompileMoveCosts : %i , sWoundAmt : %i , sBreathAmt : %i , ubOwner : %i )\n", exp.ubSoldierID , usExplosiveClassID , sSubsequent , fRecompileMovementCosts , sWoundAmt , sBreathAmt , exp.ubAttackerID );
|
sprintf(tmpMPDbgString, "MP - send_gasdamage ( ubSoldierID : %i , usExplosiveClassID : %i , sSubsequent : %i , recompileMoveCosts : %i , sWoundAmt : %i , sBreathAmt : %i , ubOwner : %i )\n", exp.ubSoldierID.i, usExplosiveClassID , sSubsequent , fRecompileMovementCosts , sWoundAmt , sBreathAmt , exp.ubAttackerID.i );
|
||||||
MPDebugMsg(tmpMPDbgString);
|
MPDebugMsg(tmpMPDbgString);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
client->RPC("sendEXPLOSIONDAMAGE",(const char*)&exp, (int)sizeof(explosiondamage_struct)*8, HIGH_PRIORITY, RELIABLE, 0, UNASSIGNED_SYSTEM_ADDRESS, true, 0, UNASSIGNED_NETWORK_ID,0);
|
client->RPC("sendEXPLOSIONDAMAGE",(const char*)&exp, (int)sizeof(explosiondamage_struct)*8, HIGH_PRIORITY, RELIABLE, 0, UNASSIGNED_SYSTEM_ADDRESS, true, 0, UNASSIGNED_NETWORK_ID,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void send_explosivedamage( UINT8 ubPerson, UINT8 ubOwner, INT32 sBombGridNo, INT16 sWoundAmt, INT16 sBreathAmt, UINT32 uiDist, UINT16 usItem, INT16 sSubsequent )
|
void send_explosivedamage( SoldierID ubPerson, SoldierID ubOwner, INT32 sBombGridNo, INT16 sWoundAmt, INT16 sBreathAmt, UINT32 uiDist, UINT16 usItem, INT16 sSubsequent )
|
||||||
{
|
{
|
||||||
explosiondamage_struct exp;
|
explosiondamage_struct exp;
|
||||||
exp.ubDamageFunc = 2;
|
exp.ubDamageFunc = 2;
|
||||||
@@ -3651,7 +3649,7 @@ void send_explosivedamage( UINT8 ubPerson, UINT8 ubOwner, INT32 sBombGridNo, INT
|
|||||||
|
|
||||||
#ifdef JA2BETAVERSION
|
#ifdef JA2BETAVERSION
|
||||||
CHAR tmpMPDbgString[512];
|
CHAR tmpMPDbgString[512];
|
||||||
sprintf(tmpMPDbgString,"MP - send_explosivedamage ( ubPerson : %i , ubOwner : %i , sBombGridNo : %i , sWoundAmt : %i , sBreathAmt : %i , uiDist : %i , usItem : %i , sSubs : %i )\n",ubPerson, ubOwner , sBombGridNo , sWoundAmt , sBreathAmt , uiDist , usItem , sSubsequent );
|
sprintf(tmpMPDbgString, "MP - send_explosivedamage ( ubPerson : %i , ubOwner : %i , sBombGridNo : %i , sWoundAmt : %i , sBreathAmt : %i , uiDist : %i , usItem : %i , sSubs : %i )\n", ubPerson.i, ubOwner.i, sBombGridNo , sWoundAmt , sBreathAmt , uiDist , usItem , sSubsequent );
|
||||||
MPDebugMsg(tmpMPDbgString);
|
MPDebugMsg(tmpMPDbgString);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -3666,7 +3664,7 @@ void recieveEXPLOSIONDAMAGE (RPCParameters *rpcParameters)
|
|||||||
exp->ubAttackerID = MPDecodeSoldierID(exp->ubAttackerID);
|
exp->ubAttackerID = MPDecodeSoldierID(exp->ubAttackerID);
|
||||||
|
|
||||||
|
|
||||||
SOLDIERTYPE* pSoldier = MercPtrs[exp->ubSoldierID];
|
SOLDIERTYPE* pSoldier = exp->ubSoldierID;
|
||||||
if (pSoldier != NULL)
|
if (pSoldier != NULL)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -3675,7 +3673,7 @@ void recieveEXPLOSIONDAMAGE (RPCParameters *rpcParameters)
|
|||||||
{
|
{
|
||||||
#ifdef JA2BETAVERSION
|
#ifdef JA2BETAVERSION
|
||||||
CHAR tmpMPDbgString[512];
|
CHAR tmpMPDbgString[512];
|
||||||
sprintf(tmpMPDbgString,"MP - recieveEXPLOSIONDAMAGE ( ubDamageFunc : %i , ubSoldierID : %i , ubAttackerID : %i , usItem : %i , usExplosiveClassID : %i , sWoundAmt : %i , sBreathAmt : %i , uiDist : %i , sSubs : %i , sBombGridNo : %i , uiPreRandomIndex : %i )\n", exp->ubDamageFunc , exp->ubSoldierID , exp->ubAttackerID , exp->usItem , exp->usExplosiveClassID , exp->sWoundAmt , exp->sBreathAmt , exp->uiDist , exp->sSubsequent , exp->sBombGridNo , exp->uiPreRandomIndex );
|
sprintf(tmpMPDbgString, "MP - recieveEXPLOSIONDAMAGE ( ubDamageFunc : %i , ubSoldierID : %i , ubAttackerID : %i , usItem : %i , usExplosiveClassID : %i , sWoundAmt : %i , sBreathAmt : %i , uiDist : %i , sSubs : %i , sBombGridNo : %i , uiPreRandomIndex : %i )\n", exp->ubDamageFunc , exp->ubSoldierID.i, exp->ubAttackerID.i, exp->usItem , exp->usExplosiveClassID , exp->sWoundAmt , exp->sBreathAmt , exp->uiDist , exp->sSubsequent , exp->sBombGridNo , exp->uiPreRandomIndex );
|
||||||
MPDebugMsg(tmpMPDbgString);
|
MPDebugMsg(tmpMPDbgString);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -3692,7 +3690,7 @@ void recieveEXPLOSIONDAMAGE (RPCParameters *rpcParameters)
|
|||||||
}
|
}
|
||||||
else if (exp->ubDamageFunc == 2)
|
else if (exp->ubDamageFunc == 2)
|
||||||
{
|
{
|
||||||
DamageSoldierFromBlast( exp->ubSoldierID , exp->ubAttackerID , exp->sBombGridNo , exp->sWoundAmt , exp->sBreathAmt , exp->uiDist , exp->usItem , exp->sSubsequent , TRUE);
|
DamageSoldierFromBlast( exp->ubSoldierID, exp->ubAttackerID, exp->sBombGridNo, exp->sWoundAmt, exp->sBreathAmt, exp->uiDist, exp->usItem, exp->sSubsequent, TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3700,7 +3698,7 @@ void recieveEXPLOSIONDAMAGE (RPCParameters *rpcParameters)
|
|||||||
{
|
{
|
||||||
#ifdef JA2BETAVERSION
|
#ifdef JA2BETAVERSION
|
||||||
char tmpMsg[128];
|
char tmpMsg[128];
|
||||||
sprintf(tmpMsg,"ERROR! - Invalid Soldier pointer from ubID %i in recieveEXPLOSIONDAMAGE()",exp->ubAttackerID);
|
sprintf(tmpMsg, "ERROR! - Invalid Soldier pointer from ubID %i in recieveEXPLOSIONDAMAGE()", exp->ubAttackerID.i );
|
||||||
//ScreenMsg(FONT_RED,MSG_MPSYSTEM,tmpMsg);
|
//ScreenMsg(FONT_RED,MSG_MPSYSTEM,tmpMsg);
|
||||||
MPDebugMsg(tmpMsg);
|
MPDebugMsg(tmpMsg);
|
||||||
#endif
|
#endif
|
||||||
@@ -3734,7 +3732,7 @@ void recieveBULLET(RPCParameters *rpcParameters)
|
|||||||
INT8 bTeam = OUR_TEAM;
|
INT8 bTeam = OUR_TEAM;
|
||||||
if ( netb->net_bullet.ubFirerID != NOBODY )
|
if ( netb->net_bullet.ubFirerID != NOBODY )
|
||||||
{
|
{
|
||||||
pFirer = MercPtrs[ netb->net_bullet.ubFirerID ];
|
pFirer = netb->net_bullet.ubFirerID;
|
||||||
bTeam=pFirer->bTeam;
|
bTeam=pFirer->bTeam;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3794,7 +3792,7 @@ void recieveSTATE(RPCParameters *rpcParameters)
|
|||||||
{
|
{
|
||||||
EV_S_CHANGESTATE* new_state = (EV_S_CHANGESTATE*)rpcParameters->input;
|
EV_S_CHANGESTATE* new_state = (EV_S_CHANGESTATE*)rpcParameters->input;
|
||||||
|
|
||||||
SOLDIERTYPE * pSoldier=MercPtrs[ new_state->usSoldierID ];
|
SOLDIERTYPE * pSoldier = new_state->usSoldierID;
|
||||||
|
|
||||||
if(pSoldier->bActive)
|
if(pSoldier->bActive)
|
||||||
{
|
{
|
||||||
@@ -3838,22 +3836,22 @@ void recieveSTATE(RPCParameters *rpcParameters)
|
|||||||
void send_death( SOLDIERTYPE *pSoldier )
|
void send_death( SOLDIERTYPE *pSoldier )
|
||||||
{
|
{
|
||||||
death_struct nDeath;
|
death_struct nDeath;
|
||||||
nDeath.soldier_id=pSoldier->ubID;
|
nDeath.soldier_id = pSoldier->ubID;
|
||||||
nDeath.attacker_id=pSoldier->ubAttackerID;
|
nDeath.attacker_id = pSoldier->ubAttackerID;
|
||||||
|
|
||||||
// Translate soldier id for other clients if the soldier was one of ours
|
// Translate soldier id for other clients if the soldier was one of ours
|
||||||
if(pSoldier->ubID<20)nDeath.soldier_id=nDeath.soldier_id+ubID_prefix;
|
if(pSoldier->ubID<20)nDeath.soldier_id=nDeath.soldier_id+ubID_prefix;
|
||||||
|
|
||||||
// if soldier died from bleeding
|
// if soldier died from bleeding
|
||||||
if(pSoldier->ubAttackerID==NULL || pSoldier->ubAttackerID == NOBODY)
|
if(pSoldier->ubAttackerID >= NOBODY)
|
||||||
{
|
{
|
||||||
if (pSoldier->ubPreviousAttackerID != NOBODY && pSoldier->ubPreviousAttackerID != NULL)
|
if (pSoldier->ubPreviousAttackerID < NOBODY)
|
||||||
nDeath.attacker_id = pSoldier->ubPreviousAttackerID;
|
nDeath.attacker_id = pSoldier->ubPreviousAttackerID;
|
||||||
else if (pSoldier->ubNextToPreviousAttackerID != NOBODY && pSoldier->ubNextToPreviousAttackerID != NULL)
|
else if (pSoldier->ubNextToPreviousAttackerID < NOBODY)
|
||||||
nDeath.attacker_id = pSoldier->ubNextToPreviousAttackerID;
|
nDeath.attacker_id = pSoldier->ubNextToPreviousAttackerID;
|
||||||
}
|
}
|
||||||
|
|
||||||
SOLDIERTYPE * pAttacker=MercPtrs[ nDeath.attacker_id ];
|
SOLDIERTYPE * pAttacker = nDeath.attacker_id;
|
||||||
INT8 pA_bTeam=CLIENT_NUM;
|
INT8 pA_bTeam=CLIENT_NUM;
|
||||||
CHAR16 pA_name[ 10 ];
|
CHAR16 pA_name[ 10 ];
|
||||||
INT8 pS_bTeam=CLIENT_NUM;
|
INT8 pS_bTeam=CLIENT_NUM;
|
||||||
@@ -3864,16 +3862,16 @@ void send_death( SOLDIERTYPE *pSoldier )
|
|||||||
if(pAttacker)
|
if(pAttacker)
|
||||||
{
|
{
|
||||||
// if attacker was one of our own mercs, use the last hostile attacker as the killer if there is one
|
// if attacker was one of our own mercs, use the last hostile attacker as the killer if there is one
|
||||||
if (pAttacker->bTeam == pSoldier->bTeam && pSoldier->ubPreviousAttackerID != NULL && pSoldier->ubPreviousAttackerID != NOBODY)
|
if (pAttacker->bTeam == pSoldier->bTeam && pSoldier->ubPreviousAttackerID < NOBODY)
|
||||||
{
|
{
|
||||||
pAttacker=MercPtrs[ pSoldier->ubPreviousAttackerID ];
|
pAttacker = pSoldier->ubPreviousAttackerID;
|
||||||
// check if the new attacker was also a friendly...
|
// check if the new attacker was also a friendly...
|
||||||
if (pAttacker->bTeam == pSoldier->bTeam && pSoldier->ubNextToPreviousAttackerID != NULL && pSoldier->ubNextToPreviousAttackerID != NOBODY)
|
if (pAttacker->bTeam == pSoldier->bTeam && pSoldier->ubNextToPreviousAttackerID < NOBODY)
|
||||||
pAttacker=MercPtrs[ pSoldier->ubNextToPreviousAttackerID ];
|
pAttacker = pSoldier->ubNextToPreviousAttackerID;
|
||||||
// if its still a friendly, use the original attacker id...for posterity
|
// if its still a friendly, use the original attacker id...for posterity
|
||||||
// guy must snore too loudly if all his mates wanna kill him :)
|
// guy must snore too loudly if all his mates wanna kill him :)
|
||||||
if (pAttacker->bTeam == pSoldier->bTeam && pSoldier->ubAttackerID != NULL && pSoldier->ubAttackerID != NOBODY)
|
if (pAttacker->bTeam == pSoldier->bTeam && pSoldier->ubAttackerID != NOBODY)
|
||||||
pAttacker = MercPtrs[ pSoldier->ubAttackerID ];
|
pAttacker = pSoldier->ubAttackerID;
|
||||||
|
|
||||||
nDeath.attacker_id = pAttacker->ubID;
|
nDeath.attacker_id = pAttacker->ubID;
|
||||||
}
|
}
|
||||||
@@ -3952,15 +3950,15 @@ void send_death( SOLDIERTYPE *pSoldier )
|
|||||||
void recieveDEATH (RPCParameters *rpcParameters)
|
void recieveDEATH (RPCParameters *rpcParameters)
|
||||||
{
|
{
|
||||||
death_struct* nDeath = (death_struct*)rpcParameters->input;
|
death_struct* nDeath = (death_struct*)rpcParameters->input;
|
||||||
SOLDIERTYPE * pSoldier=MercPtrs[ nDeath->soldier_id ];
|
SOLDIERTYPE * pSoldier = nDeath->soldier_id;
|
||||||
|
|
||||||
UINT16 ubAttackerID;
|
SoldierID ubAttackerID;
|
||||||
if((nDeath->attacker_id >= ubID_prefix) && (nDeath->attacker_id < (ubID_prefix+6)))
|
if((nDeath->attacker_id >= ubID_prefix) && (nDeath->attacker_id < (ubID_prefix+6)))
|
||||||
ubAttackerID = (nDeath->attacker_id - ubID_prefix);
|
ubAttackerID = (nDeath->attacker_id - ubID_prefix);
|
||||||
else
|
else
|
||||||
ubAttackerID = nDeath->attacker_id;
|
ubAttackerID = nDeath->attacker_id;
|
||||||
|
|
||||||
SOLDIERTYPE * pAttacker=MercPtrs[ ubAttackerID ];
|
SOLDIERTYPE * pAttacker = ubAttackerID;
|
||||||
INT8 pA_bTeam;
|
INT8 pA_bTeam;
|
||||||
CHAR16 pA_name[ 10 ];
|
CHAR16 pA_name[ 10 ];
|
||||||
INT8 pS_bTeam;
|
INT8 pS_bTeam;
|
||||||
@@ -4071,7 +4069,7 @@ void send_miss(EV_S_MISS * SMiss)
|
|||||||
void recievehitSTRUCT (RPCParameters *rpcParameters)
|
void recievehitSTRUCT (RPCParameters *rpcParameters)
|
||||||
{
|
{
|
||||||
EV_S_STRUCTUREHIT* struct_hit = (EV_S_STRUCTUREHIT*)rpcParameters->input;
|
EV_S_STRUCTUREHIT* struct_hit = (EV_S_STRUCTUREHIT*)rpcParameters->input;
|
||||||
SOLDIERTYPE *pSoldier = MercPtrs[ struct_hit->ubAttackerID ];
|
SOLDIERTYPE *pSoldier = struct_hit->ubAttackerID;
|
||||||
INT8 bTeam=pSoldier->bTeam;
|
INT8 bTeam=pSoldier->bTeam;
|
||||||
INT32 iBullet = bTable[bTeam][struct_hit->iBullet].local_id;
|
INT32 iBullet = bTable[bTeam][struct_hit->iBullet].local_id;
|
||||||
|
|
||||||
@@ -4094,7 +4092,7 @@ void recieveMISS (RPCParameters *rpcParameters)
|
|||||||
{
|
{
|
||||||
EV_S_MISS* shot_miss = (EV_S_MISS*)rpcParameters->input;
|
EV_S_MISS* shot_miss = (EV_S_MISS*)rpcParameters->input;
|
||||||
|
|
||||||
SOLDIERTYPE *pSoldier = MercPtrs[ shot_miss->ubAttackerID ];
|
SOLDIERTYPE *pSoldier = shot_miss->ubAttackerID;
|
||||||
INT8 bTeam=pSoldier->bTeam;
|
INT8 bTeam=pSoldier->bTeam;
|
||||||
INT32 iBullet = bTable[bTeam][shot_miss->iBullet].local_id;
|
INT32 iBullet = bTable[bTeam][shot_miss->iBullet].local_id;
|
||||||
|
|
||||||
@@ -4104,7 +4102,6 @@ void recieveMISS (RPCParameters *rpcParameters)
|
|||||||
BOOLEAN check_status (void)// any 'enemies' and clients left to fight ??
|
BOOLEAN check_status (void)// any 'enemies' and clients left to fight ??
|
||||||
{
|
{
|
||||||
SOLDIERTYPE *pSoldier;
|
SOLDIERTYPE *pSoldier;
|
||||||
int cnt;
|
|
||||||
int soldiers= 0 ;
|
int soldiers= 0 ;
|
||||||
int numActiveSides = 0;
|
int numActiveSides = 0;
|
||||||
|
|
||||||
@@ -4114,9 +4111,9 @@ BOOLEAN check_status (void)// any 'enemies' and clients left to fight ??
|
|||||||
{
|
{
|
||||||
soldiers=0;
|
soldiers=0;
|
||||||
|
|
||||||
for(cnt = gTacticalStatus.Team[ x ].bFirstID;cnt <= gTacticalStatus.Team[ x ].bLastID; cnt++)
|
for( SoldierID cnt = gTacticalStatus.Team[ x ].bFirstID;cnt <= gTacticalStatus.Team[ x ].bLastID; ++cnt)
|
||||||
{
|
{
|
||||||
pSoldier = MercPtrs[ cnt ];
|
pSoldier = cnt;
|
||||||
if(pSoldier->stats.bLife >= OKLIFE && pSoldier->bActive && pSoldier->bInSector)
|
if(pSoldier->stats.bLife >= OKLIFE && pSoldier->bActive && pSoldier->bInSector)
|
||||||
{
|
{
|
||||||
soldiers++;
|
soldiers++;
|
||||||
@@ -4199,7 +4196,7 @@ BOOLEAN check_status (void)// any 'enemies' and clients left to fight ??
|
|||||||
void UpdateSoldierToNetwork ( SOLDIERTYPE *pSoldier )
|
void UpdateSoldierToNetwork ( SOLDIERTYPE *pSoldier )
|
||||||
{
|
{
|
||||||
//this send stats to other clients at intervals
|
//this send stats to other clients at intervals
|
||||||
UINT8 id = pSoldier->ubID;
|
SoldierID id = pSoldier->ubID;
|
||||||
UINT32 time = GetJA2Clock();
|
UINT32 time = GetJA2Clock();
|
||||||
|
|
||||||
if(id < 20 || (is_server && id <120))
|
if(id < 20 || (is_server && id <120))
|
||||||
@@ -4244,7 +4241,7 @@ void UpdateSoldierFromNetwork (RPCParameters *rpcParameters)
|
|||||||
{
|
{
|
||||||
EV_S_UPDATENETWORKSOLDIER* SUpdateNetworkSoldier = (EV_S_UPDATENETWORKSOLDIER*)rpcParameters->input;
|
EV_S_UPDATENETWORKSOLDIER* SUpdateNetworkSoldier = (EV_S_UPDATENETWORKSOLDIER*)rpcParameters->input;
|
||||||
|
|
||||||
SOLDIERTYPE *pSoldier = MercPtrs[ SUpdateNetworkSoldier->usSoldierID ];
|
SOLDIERTYPE *pSoldier = SUpdateNetworkSoldier->usSoldierID;
|
||||||
pSoldier->bBreath=SUpdateNetworkSoldier->bBreath;
|
pSoldier->bBreath=SUpdateNetworkSoldier->bBreath;
|
||||||
pSoldier->stats.bLife=SUpdateNetworkSoldier->bLife;
|
pSoldier->stats.bLife=SUpdateNetworkSoldier->bLife;
|
||||||
|
|
||||||
@@ -4333,14 +4330,14 @@ void null_team (RPCParameters *rpcParameters)
|
|||||||
{
|
{
|
||||||
kickR* kick = (kickR*)rpcParameters->input;
|
kickR* kick = (kickR*)rpcParameters->input;
|
||||||
ScreenMsg( FONT_LTGREEN, MSG_INTERFACE, MPClientMessage[29],(kick->ubResult-5),client_names[kick->ubResult-6] );
|
ScreenMsg( FONT_LTGREEN, MSG_INTERFACE, MPClientMessage[29],(kick->ubResult-5),client_names[kick->ubResult-6] );
|
||||||
int fID = gTacticalStatus.Team[ kick->ubResult ].bFirstID;
|
SoldierID fID = gTacticalStatus.Team[ kick->ubResult ].bFirstID;
|
||||||
int lID = gTacticalStatus.Team[ kick->ubResult ].bLastID;
|
SoldierID lID = gTacticalStatus.Team[ kick->ubResult ].bLastID;
|
||||||
|
|
||||||
if(kick->ubResult==netbTeam)
|
if(kick->ubResult==netbTeam)
|
||||||
fID=0,lID=19;
|
fID=0,lID=19;
|
||||||
|
|
||||||
int cnt;
|
SoldierID cnt;
|
||||||
for ( cnt=fID ; cnt <= lID; cnt++ )
|
for ( cnt=fID ; cnt <= lID; ++cnt )
|
||||||
{
|
{
|
||||||
TacticalRemoveSoldier( cnt );
|
TacticalRemoveSoldier( cnt );
|
||||||
}
|
}
|
||||||
@@ -4425,7 +4422,7 @@ void recieve_fireweapon (RPCParameters *rpcParameters)
|
|||||||
{
|
{
|
||||||
EV_S_FIREWEAPON* SFireWeapon = (EV_S_FIREWEAPON*)rpcParameters->input;
|
EV_S_FIREWEAPON* SFireWeapon = (EV_S_FIREWEAPON*)rpcParameters->input;
|
||||||
|
|
||||||
SOLDIERTYPE *pSoldier = MercPtrs[ SFireWeapon->usSoldierID ];
|
SOLDIERTYPE *pSoldier = SFireWeapon->usSoldierID;
|
||||||
|
|
||||||
pSoldier->sTargetGridNo = SFireWeapon->sTargetGridNo;
|
pSoldier->sTargetGridNo = SFireWeapon->sTargetGridNo;
|
||||||
pSoldier->bTargetLevel = SFireWeapon->bTargetLevel;
|
pSoldier->bTargetLevel = SFireWeapon->bTargetLevel;
|
||||||
@@ -4450,7 +4447,7 @@ void recieve_door (RPCParameters *rpcParameters)
|
|||||||
{
|
{
|
||||||
doors* sDoor = (doors*)rpcParameters->input;
|
doors* sDoor = (doors*)rpcParameters->input;
|
||||||
|
|
||||||
SOLDIERTYPE *pSoldier = MercPtrs[ sDoor->ubID ];
|
SOLDIERTYPE *pSoldier = sDoor->ubID;
|
||||||
BOOLEAN fNoAnimations = FALSE;
|
BOOLEAN fNoAnimations = FALSE;
|
||||||
|
|
||||||
if ( !AllMercsLookForDoor( sDoor->sGridNo, FALSE ) )//check for los
|
if ( !AllMercsLookForDoor( sDoor->sGridNo, FALSE ) )//check for los
|
||||||
@@ -4511,7 +4508,7 @@ void recieveDISCONNECT(RPCParameters* rpcParameters)
|
|||||||
// kill the dead clients mercs out of the game
|
// kill the dead clients mercs out of the game
|
||||||
|
|
||||||
UINT8 iNetbTeam = (cl_num)+5;
|
UINT8 iNetbTeam = (cl_num)+5;
|
||||||
UINT8 iubID_prefix = gTacticalStatus.Team[ iNetbTeam ].bFirstID;//over here now
|
UINT16 iubID_prefix = gTacticalStatus.Team[ iNetbTeam ].bFirstID;//over here now
|
||||||
|
|
||||||
// kill any alive soldiers for the disconnected team
|
// kill any alive soldiers for the disconnected team
|
||||||
SOLDIERTYPE *pTeamSoldier;
|
SOLDIERTYPE *pTeamSoldier;
|
||||||
@@ -4726,14 +4723,14 @@ void recieve_heal (RPCParameters *rpcParameters)
|
|||||||
{
|
{
|
||||||
heal* data = (heal*)rpcParameters->input;
|
heal* data = (heal*)rpcParameters->input;
|
||||||
|
|
||||||
UINT16 healed;
|
SoldierID healed;
|
||||||
|
|
||||||
if((data->ubID >= ubID_prefix) && (data->ubID < (ubID_prefix+6)))
|
if((data->ubID >= ubID_prefix) && (data->ubID < (ubID_prefix+6)))
|
||||||
healed = (data->ubID - ubID_prefix);
|
healed = (data->ubID - ubID_prefix);
|
||||||
else
|
else
|
||||||
healed = data->ubID;
|
healed = data->ubID;
|
||||||
|
|
||||||
SOLDIERTYPE *pSoldier = MercPtrs[ healed ];
|
SOLDIERTYPE *pSoldier = healed;
|
||||||
pSoldier->bBleeding=data->bBleeding;
|
pSoldier->bBleeding=data->bBleeding;
|
||||||
pSoldier->stats.bLife=data->bLife;
|
pSoldier->stats.bLife=data->bLife;
|
||||||
|
|
||||||
@@ -4759,7 +4756,7 @@ void awardINT (RPCParameters *rpcParameters)
|
|||||||
{
|
{
|
||||||
AIint* data= (AIint*)rpcParameters->input;
|
AIint* data= (AIint*)rpcParameters->input;
|
||||||
|
|
||||||
SOLDIERTYPE *pSoldier = MercPtrs[ data->ubID ];
|
SOLDIERTYPE *pSoldier = data->ubID;
|
||||||
|
|
||||||
StartInterrupt();
|
StartInterrupt();
|
||||||
|
|
||||||
|
|||||||
+17
-17
@@ -37,7 +37,7 @@ extern UINT8 cGameType;
|
|||||||
extern bool allowlaptop;
|
extern bool allowlaptop;
|
||||||
|
|
||||||
extern UINT8 netbTeam;
|
extern UINT8 netbTeam;
|
||||||
extern UINT8 ubID_prefix;
|
extern UINT16 ubID_prefix;
|
||||||
extern FLOAT cDamageMultiplier;
|
extern FLOAT cDamageMultiplier;
|
||||||
|
|
||||||
//OJW - 20081218
|
//OJW - 20081218
|
||||||
@@ -97,34 +97,34 @@ void send_dir ( SOLDIERTYPE *pSoldier, UINT16 usDesiredDirection );
|
|||||||
void send_fire( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo );
|
void send_fire( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo );
|
||||||
void send_hit( EV_S_WEAPONHIT *SWeaponHit );
|
void send_hit( EV_S_WEAPONHIT *SWeaponHit );
|
||||||
void send_bullet( BULLET * pBullet, UINT16 usHandItem);
|
void send_bullet( BULLET * pBullet, UINT16 usHandItem);
|
||||||
void send_hire( UINT8 iNewIndex, UINT8 ubCurrentSoldier, INT16 iTotalContractLength, BOOLEAN fCopyProfileItemsOver);
|
void send_hire( SoldierID iNewIndex, UINT8 ubCurrentSoldier, INT16 iTotalContractLength, BOOLEAN fCopyProfileItemsOver);
|
||||||
void send_dismiss( UINT8 ubCurrentSoldier);
|
void send_dismiss( UINT16 ubCurrentSoldierID);
|
||||||
|
|
||||||
void send_gui_pos(SOLDIERTYPE *pSoldier, FLOAT dNewXPos, FLOAT dNewYPos);
|
void send_gui_pos(SOLDIERTYPE *pSoldier, FLOAT dNewXPos, FLOAT dNewYPos);
|
||||||
void send_gui_dir(SOLDIERTYPE *pSoldier, UINT16 usNewDirection);
|
void send_gui_dir(SOLDIERTYPE *pSoldier, UINT16 usNewDirection);
|
||||||
|
|
||||||
void send_EndTurn( UINT8 ubNextTeam );
|
void send_EndTurn( UINT8 ubNextTeam );
|
||||||
|
|
||||||
void send_AI( SOLDIERCREATE_STRUCT *pCreateStruct, UINT8 *pubID );
|
void send_AI( SOLDIERCREATE_STRUCT *pCreateStruct );
|
||||||
|
|
||||||
void send_stop (EV_S_STOP_MERC *SStopMerc);
|
void send_stop (EV_S_STOP_MERC *SStopMerc);
|
||||||
|
|
||||||
void send_interrupt(SOLDIERTYPE *pSoldier);
|
void send_interrupt(SOLDIERTYPE *pSoldier);
|
||||||
|
|
||||||
// OJW - 20091002 - explosives
|
// OJW - 20091002 - explosives
|
||||||
void send_grenade (OBJECTTYPE *pGameObj, float dLifeLength, float xPos, float yPos, float zPos, float xForce, float yForce, float zForce, UINT32 sTargetGridNo, UINT8 ubOwner, UINT8 ubActionCode, UINT32 uiActionData, INT32 iRealObjectID , bool bIsThrownGrenade);
|
void send_grenade (OBJECTTYPE *pGameObj, float dLifeLength, float xPos, float yPos, float zPos, float xForce, float yForce, float zForce, UINT32 sTargetGridNo, SoldierID ubOwner, UINT8 ubActionCode, UINT32 uiActionData, INT32 iRealObjectID, bool bIsThrownGrenade);
|
||||||
void send_grenade_result (float xPos, float yPos, float zPos, INT32 sGridNo, UINT8 ubOwnerID, INT32 iRealObjectID, bool bIsDud);
|
void send_grenade_result (float xPos, float yPos, float zPos, INT32 sGridNo, SoldierID ubOwnerID, INT32 iRealObjectID, bool bIsDud);
|
||||||
void send_plant_explosive (UINT8 ubID,UINT16 usItem,UINT8 ubItemStatus,UINT16 usFlags, UINT32 sGridNo,UINT8 ubLevel, UINT32 uiWorldIndex);
|
void send_plant_explosive ( SoldierID ubID,UINT16 usItem,UINT8 ubItemStatus,UINT16 usFlags, UINT32 sGridNo,UINT8 ubLevel, UINT32 uiWorldIndex);
|
||||||
void send_detonate_explosive (UINT32 uiWorldIndex, UINT8 ubID);
|
void send_detonate_explosive (UINT32 uiWorldIndex, SoldierID ubID);
|
||||||
void send_spreadeffect ( INT32 sGridNo, UINT8 ubRadius, UINT16 usItem, UINT8 ubOwner, BOOLEAN fSubsequent, INT8 bLevel, INT32 iSmokeEffectID );
|
void send_spreadeffect ( INT32 sGridNo, UINT8 ubRadius, UINT16 usItem, SoldierID ubOwner, BOOLEAN fSubsequent, INT8 bLevel, INT32 iSmokeEffectID );
|
||||||
void send_newsmokeeffect(INT32 sGridNo, UINT16 usItem, INT8 bLevel, UINT8 ubOwner, INT32 iSmokeEffectID);
|
void send_newsmokeeffect(INT32 sGridNo, UINT16 usItem, INT8 bLevel, SoldierID ubOwner, INT32 iSmokeEffectID);
|
||||||
void send_gasdamage( SOLDIERTYPE * pSoldier, UINT16 usExplosiveClassID , INT16 sSubsequent, BOOLEAN fRecompileMovementCosts, INT16 sWoundAmt, INT16 sBreathAmt, UINT8 ubOwner );
|
void send_gasdamage( SOLDIERTYPE * pSoldier, UINT16 usExplosiveClassID, INT16 sSubsequent, BOOLEAN fRecompileMovementCosts, INT16 sWoundAmt, INT16 sBreathAmt, SoldierID ubOwner );
|
||||||
void send_explosivedamage( UINT8 ubPerson, UINT8 ubOwner, INT32 sBombGridNo, INT16 sWoundAmt, INT16 sBreathAmt, UINT32 uiDist, UINT16 usItem, INT16 sSubsequent );
|
void send_explosivedamage( SoldierID ubPerson, SoldierID ubOwner, INT32 sBombGridNo, INT16 sWoundAmt, INT16 sBreathAmt, UINT32 uiDist, UINT16 usItem, INT16 sSubsequent );
|
||||||
void send_disarm_explosive(UINT32 sGridNo, UINT32 uiWorldIndex, UINT8 ubID);
|
void send_disarm_explosive(UINT32 sGridNo, UINT32 uiWorldIndex, SoldierID ubID);
|
||||||
|
|
||||||
void OpenChatMsgBox(void);
|
void OpenChatMsgBox(void);
|
||||||
|
|
||||||
INT8 FireBullet( UINT8 ubFirer, BULLET * pBullet, BOOLEAN fFake );
|
INT8 FireBullet( SoldierID ubFirer, BULLET * pBullet, BOOLEAN fFake );
|
||||||
|
|
||||||
void reapplySETTINGS();
|
void reapplySETTINGS();
|
||||||
|
|
||||||
@@ -212,7 +212,7 @@ extern BOOLEAN fClientReceivedAllFiles;
|
|||||||
// sick of confusing myself :)
|
// sick of confusing myself :)
|
||||||
|
|
||||||
// this one should be called before passing an ID off the client
|
// this one should be called before passing an ID off the client
|
||||||
inline UINT8 MPEncodeSoldierID( UINT8 ubID )
|
inline SoldierID MPEncodeSoldierID( SoldierID ubID )
|
||||||
{
|
{
|
||||||
if ( ubID < 20 )
|
if ( ubID < 20 )
|
||||||
return ubID + ubID_prefix; // soldier is ours
|
return ubID + ubID_prefix; // soldier is ours
|
||||||
@@ -221,7 +221,7 @@ inline UINT8 MPEncodeSoldierID( UINT8 ubID )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// this one can be called anywhere, even if the ID was not "encoded"
|
// this one can be called anywhere, even if the ID was not "encoded"
|
||||||
inline UINT8 MPDecodeSoldierID( UINT8 ubID )
|
inline SoldierID MPDecodeSoldierID( SoldierID ubID )
|
||||||
{
|
{
|
||||||
if ( ubID >= ubID_prefix && ubID < (ubID_prefix + 7) )
|
if ( ubID >= ubID_prefix && ubID < (ubID_prefix + 7) )
|
||||||
return ubID - ubID_prefix; // soldier is ours
|
return ubID - ubID_prefix; // soldier is ours
|
||||||
@@ -234,7 +234,7 @@ inline bool IsOurSoldier (SOLDIERTYPE* pSoldier)
|
|||||||
return pSoldier->bTeam == netbTeam || pSoldier->bTeam == 0;
|
return pSoldier->bTeam == netbTeam || pSoldier->bTeam == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool IsOurSoldier (UINT8 ubID)
|
inline bool IsOurSoldier (UINT16 ubID)
|
||||||
{
|
{
|
||||||
return (ubID >= ubID_prefix && ubID < (ubID_prefix + 7)) || ubID < 20;
|
return (ubID >= ubID_prefix && ubID < (ubID_prefix + 7)) || ubID < 20;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,29 +5,29 @@ extern int readyteamreg[10];
|
|||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
UINT16 soldier_id;
|
SoldierID soldier_id;
|
||||||
UINT16 attacker_id;
|
SoldierID attacker_id;
|
||||||
UINT8 attacker_team;
|
UINT8 attacker_team;
|
||||||
UINT8 soldier_team;
|
UINT8 soldier_team;
|
||||||
}death_struct;
|
}death_struct;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
UINT16 ubID;
|
SoldierID ubID;
|
||||||
INT32 sGridNo;
|
INT32 sGridNo;
|
||||||
BOOLEAN fNoAnimations;
|
BOOLEAN fNoAnimations;
|
||||||
}doors;
|
}doors;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
UINT16 ubID;
|
SoldierID ubID;
|
||||||
INT8 bLife;
|
INT8 bLife;
|
||||||
INT8 bBleeding;
|
INT8 bBleeding;
|
||||||
}heal;
|
}heal;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
UINT16 ubID;
|
SoldierID ubID;
|
||||||
INT8 bteam;
|
INT8 bteam;
|
||||||
}AIint;
|
}AIint;
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ void startCombat(UINT8 ubStartingTeam);
|
|||||||
void intAI (SOLDIERTYPE *pSoldier );
|
void intAI (SOLDIERTYPE *pSoldier );
|
||||||
void teamwiped (void);
|
void teamwiped (void);
|
||||||
BOOLEAN check_status (void);
|
BOOLEAN check_status (void);
|
||||||
extern UINT8 NumEnemyInSector( );
|
extern UINT16 NumEnemyInSector( );
|
||||||
extern INT8 NumActiveAndConsciousTeamMembers( UINT8 ubTeam );
|
extern UINT16 NumActiveAndConsciousTeamMembers( UINT8 ubTeam );
|
||||||
void send_heal (SOLDIERTYPE *pSoldier );
|
void send_heal (SOLDIERTYPE *pSoldier );
|
||||||
void requestAIint(SOLDIERTYPE *pSoldier );
|
void requestAIint(SOLDIERTYPE *pSoldier );
|
||||||
|
|||||||
+8
-11
@@ -227,7 +227,7 @@ void sendHIT(RPCParameters *rpcParameters)
|
|||||||
{
|
{
|
||||||
EV_S_WEAPONHIT* hit = (EV_S_WEAPONHIT*)rpcParameters->input;
|
EV_S_WEAPONHIT* hit = (EV_S_WEAPONHIT*)rpcParameters->input;
|
||||||
|
|
||||||
int team = MercPtrs[ hit->ubAttackerID ]->bTeam;
|
int team = hit->ubAttackerID->bTeam;
|
||||||
|
|
||||||
// AI
|
// AI
|
||||||
if (team == 1)
|
if (team == 1)
|
||||||
@@ -365,7 +365,7 @@ void sendDEATH(RPCParameters *rpcParameters)
|
|||||||
_itow(iCLnum,clnum,10);
|
_itow(iCLnum,clnum,10);
|
||||||
ScreenMsg( FONT_LTBLUE, MSG_MPSYSTEM, L"DEBUG: Soldier Killed : Attacking team %s , Soldier Team %s, Sender %s",ateam,steam,clnum);
|
ScreenMsg( FONT_LTBLUE, MSG_MPSYSTEM, L"DEBUG: Soldier Killed : Attacking team %s , Soldier Team %s, Sender %s",ateam,steam,clnum);
|
||||||
char logmsg[100];
|
char logmsg[100];
|
||||||
sprintf(logmsg, "MP DEBUG: Soldier Killed #%i : Attacking team %i , Soldier Team %i, Sender %i\n",nDeath->soldier_id,nDeath->attacker_team,nDeath->soldier_team,iCLnum);
|
sprintf( logmsg, "MP DEBUG: Soldier Killed #%i : Attacking team %i , Soldier Team %i, Sender %i\n", nDeath->soldier_id.i, nDeath->attacker_team, nDeath->soldier_team, iCLnum );
|
||||||
MPDebugMsg( logmsg );
|
MPDebugMsg( logmsg );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -373,10 +373,9 @@ void sendhitSTRUCT(RPCParameters *rpcParameters)
|
|||||||
{
|
{
|
||||||
EV_S_STRUCTUREHIT* miss = (EV_S_STRUCTUREHIT*)rpcParameters->input;
|
EV_S_STRUCTUREHIT* miss = (EV_S_STRUCTUREHIT*)rpcParameters->input;
|
||||||
|
|
||||||
SOLDIERTYPE* pAttacker = MercPtrs[ miss->ubAttackerID ];
|
if ( miss->ubAttackerID != NOBODY)
|
||||||
if (pAttacker != NULL)
|
|
||||||
{
|
{
|
||||||
int team = MercPtrs[ miss->ubAttackerID ]->bTeam;
|
int team = miss->ubAttackerID->bTeam;
|
||||||
|
|
||||||
// AI
|
// AI
|
||||||
if (team == 1)
|
if (team == 1)
|
||||||
@@ -398,10 +397,9 @@ void sendhitWINDOW(RPCParameters *rpcParameters)
|
|||||||
EV_S_WINDOWHIT* miss = (EV_S_WINDOWHIT*)rpcParameters->input;
|
EV_S_WINDOWHIT* miss = (EV_S_WINDOWHIT*)rpcParameters->input;
|
||||||
|
|
||||||
|
|
||||||
SOLDIERTYPE* pAttacker = MercPtrs[ miss->ubAttackerID ];
|
if ( miss->ubAttackerID != NOBODY)
|
||||||
if (pAttacker != NULL)
|
|
||||||
{
|
{
|
||||||
int team = MercPtrs[ miss->ubAttackerID ]->bTeam;
|
int team = miss->ubAttackerID->bTeam;
|
||||||
|
|
||||||
// AI
|
// AI
|
||||||
if (team == 1)
|
if (team == 1)
|
||||||
@@ -422,10 +420,9 @@ void sendMISS(RPCParameters *rpcParameters)
|
|||||||
{
|
{
|
||||||
EV_S_MISS* miss = (EV_S_MISS*)rpcParameters->input;
|
EV_S_MISS* miss = (EV_S_MISS*)rpcParameters->input;
|
||||||
|
|
||||||
SOLDIERTYPE* pAttacker = MercPtrs[ miss->ubAttackerID ];
|
if ( miss->ubAttackerID != NOBODY)
|
||||||
if (pAttacker != NULL)
|
|
||||||
{
|
{
|
||||||
int team = MercPtrs[ miss->ubAttackerID ]->bTeam;
|
int team = miss->ubAttackerID->bTeam;
|
||||||
|
|
||||||
// AI
|
// AI
|
||||||
if (team == 1)
|
if (team == 1)
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ void ViewCreaturesCallback( GUI_BUTTON *btn, INT32 reason );
|
|||||||
void ExtractAndUpdatePopulations();
|
void ExtractAndUpdatePopulations();
|
||||||
void PrintEnemyPopTable();
|
void PrintEnemyPopTable();
|
||||||
void PrintEnemiesKilledTable();
|
void PrintEnemiesKilledTable();
|
||||||
UINT8 ChooseEnemyIconColor( UINT8 ubAdmins, UINT8 ubTroops, UINT8 ubElites, UINT8 ubTanks, UINT8 ubJeeps );
|
UINT8 ChooseEnemyIconColor( UINT16 ubAdmins, UINT16 ubTroops, UINT16 ubElites, UINT16 ubTanks, UINT16 ubJeeps );
|
||||||
void BlitGroupIcon( UINT8 ubIconType, UINT8 ubIconColor, UINT32 uiX, UINT32 uiY, HVOBJECT hVObject );
|
void BlitGroupIcon( UINT8 ubIconType, UINT8 ubIconColor, UINT32 uiX, UINT32 uiY, HVOBJECT hVObject );
|
||||||
void PrintDetailedEnemiesInSectorInfo( INT32 iScreenX, INT32 iScreenY, UINT8 ubSectorX, UINT8 ubSectorY );
|
void PrintDetailedEnemiesInSectorInfo( INT32 iScreenX, INT32 iScreenY, UINT8 ubSectorX, UINT8 ubSectorY );
|
||||||
|
|
||||||
@@ -536,7 +536,7 @@ void RenderMovingGroupsAndMercs()
|
|||||||
GROUP *pGroup;
|
GROUP *pGroup;
|
||||||
HVOBJECT hVObject;
|
HVOBJECT hVObject;
|
||||||
INT32 x, y;
|
INT32 x, y;
|
||||||
UINT8 ubNumTroops, ubNumAdmins, ubNumElites, ubNumTanks, ubNumJeeps;
|
UINT16 ubNumTroops, ubNumAdmins, ubNumElites, ubNumTanks, ubNumJeeps;
|
||||||
float ratio;
|
float ratio;
|
||||||
INT32 minX, maxX, minY, maxY;
|
INT32 minX, maxX, minY, maxY;
|
||||||
UINT8 ubIconType;
|
UINT8 ubIconType;
|
||||||
@@ -648,8 +648,8 @@ void RenderMovingGroupsAndMercs()
|
|||||||
void RenderInfoInSector()
|
void RenderInfoInSector()
|
||||||
{
|
{
|
||||||
UINT8 ubSectorX, ubSectorY;
|
UINT8 ubSectorX, ubSectorY;
|
||||||
UINT8 ubMercs=0, ubActive=0, ubUnconcious=0, ubCollapsed=0;
|
UINT16 ubMercs=0, ubActive=0, ubUnconcious=0, ubCollapsed=0;
|
||||||
INT32 i, xp, yp;
|
INT32 xp, yp;
|
||||||
|
|
||||||
if( gfViewEnemies && !gbViewLevel )
|
if( gfViewEnemies && !gbViewLevel )
|
||||||
{
|
{
|
||||||
@@ -694,11 +694,10 @@ void RenderInfoInSector()
|
|||||||
|
|
||||||
|
|
||||||
//Count the number of mercs and their states (even for underground sectors)
|
//Count the number of mercs and their states (even for underground sectors)
|
||||||
for( i = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; i <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; i++ )
|
for( SoldierID id = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; id <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; ++id )
|
||||||
{
|
{
|
||||||
SOLDIERTYPE *pSoldier;
|
SOLDIERTYPE *pSoldier = id;
|
||||||
|
|
||||||
pSoldier = MercPtrs[ i ];
|
|
||||||
if( pSoldier->bActive && pSoldier->sSectorX == ubSectorX && pSoldier->sSectorY == ubSectorY && pSoldier->bSectorZ == gbViewLevel )
|
if( pSoldier->bActive && pSoldier->sSectorX == ubSectorX && pSoldier->sSectorY == ubSectorY && pSoldier->bSectorZ == gbViewLevel )
|
||||||
{
|
{
|
||||||
if( pSoldier->stats.bLife )
|
if( pSoldier->stats.bLife )
|
||||||
@@ -722,7 +721,7 @@ void RenderInfoInSector()
|
|||||||
{
|
{
|
||||||
SECTORINFO *pSector;
|
SECTORINFO *pSector;
|
||||||
GROUP *pGroup;
|
GROUP *pGroup;
|
||||||
UINT8 ubNumAdmins = 0, ubNumTroops = 0, ubNumElites = 0, ubNumTanks = 0, ubNumJeeps = 0, ubAdminsInBattle = 0, ubTroopsInBattle = 0, ubElitesInBattle = 0, ubTanksInBattle = 0, ubJeepsInBattle = 0,ubNumGroups = 0;
|
UINT16 ubNumAdmins = 0, ubNumTroops = 0, ubNumElites = 0, ubNumTanks = 0, ubNumJeeps = 0, ubAdminsInBattle = 0, ubTroopsInBattle = 0, ubElitesInBattle = 0, ubTanksInBattle = 0, ubJeepsInBattle = 0,ubNumGroups = 0;
|
||||||
|
|
||||||
pSector = &SectorInfo[ SECTOR( ubSectorX, ubSectorY ) ];
|
pSector = &SectorInfo[ SECTOR( ubSectorX, ubSectorY ) ];
|
||||||
|
|
||||||
@@ -1832,7 +1831,7 @@ void PrintEnemiesKilledTable()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
UINT8 ChooseEnemyIconColor( UINT8 ubAdmins, UINT8 ubTroops, UINT8 ubElites, UINT8 ubTanks, UINT8 ubJeeps )
|
UINT8 ChooseEnemyIconColor( UINT16 ubAdmins, UINT16 ubTroops, UINT16 ubElites, UINT16 ubTanks, UINT16 ubJeeps )
|
||||||
{
|
{
|
||||||
UINT8 ubIconColor;
|
UINT8 ubIconColor;
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -1091,7 +1091,7 @@ void EnemyHeliSAMCheck( INT16 id )
|
|||||||
// also check whether this sector is not enemy-controlled - we can't have the AI shooting at its own helis
|
// also check whether this sector is not enemy-controlled - we can't have the AI shooting at its own helis
|
||||||
if ( pSAMStrategicMap && !pSAMStrategicMap->fEnemyControlled )
|
if ( pSAMStrategicMap && !pSAMStrategicMap->fEnemyControlled )
|
||||||
{
|
{
|
||||||
UINT16 ubBestSAMOperatorID = NOBODY;
|
SoldierID ubBestSAMOperatorID = NOBODY;
|
||||||
FLOAT samcth = GetBestSAMOperatorCTH_Player( gpSamSectorX[i], gpSamSectorY[i], 0, &ubBestSAMOperatorID );
|
FLOAT samcth = GetBestSAMOperatorCTH_Player( gpSamSectorX[i], gpSamSectorY[i], 0, &ubBestSAMOperatorID );
|
||||||
|
|
||||||
// cth is reduced if SAM is damaged, even if it can still operate
|
// cth is reduced if SAM is damaged, even if it can still operate
|
||||||
@@ -1142,9 +1142,9 @@ void EnemyHeliSAMCheck( INT16 id )
|
|||||||
if ( ubBestSAMOperatorID != NOBODY )
|
if ( ubBestSAMOperatorID != NOBODY )
|
||||||
{
|
{
|
||||||
if ( fHit )
|
if ( fHit )
|
||||||
StatChange( MercPtrs[ubBestSAMOperatorID], EXPERAMT, fDestroyed ? 30 : 10, TRUE );
|
StatChange( ubBestSAMOperatorID, EXPERAMT, fDestroyed ? 30 : 10, TRUE );
|
||||||
|
|
||||||
StatChange( MercPtrs[ubBestSAMOperatorID], MECHANAMT, 5, TRUE );
|
StatChange( ubBestSAMOperatorID, MECHANAMT, 5, TRUE );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+420
-355
File diff suppressed because it is too large
Load Diff
+22
-2
@@ -56,6 +56,26 @@ enum
|
|||||||
SQUAD_18,
|
SQUAD_18,
|
||||||
SQUAD_19,
|
SQUAD_19,
|
||||||
SQUAD_20,
|
SQUAD_20,
|
||||||
|
SQUAD_21,
|
||||||
|
SQUAD_22,
|
||||||
|
SQUAD_23,
|
||||||
|
SQUAD_24,
|
||||||
|
SQUAD_25,
|
||||||
|
SQUAD_26,
|
||||||
|
SQUAD_27,
|
||||||
|
SQUAD_28,
|
||||||
|
SQUAD_29,
|
||||||
|
SQUAD_30,
|
||||||
|
SQUAD_31,
|
||||||
|
SQUAD_32,
|
||||||
|
SQUAD_33,
|
||||||
|
SQUAD_34,
|
||||||
|
SQUAD_35,
|
||||||
|
SQUAD_36,
|
||||||
|
SQUAD_37,
|
||||||
|
SQUAD_38,
|
||||||
|
SQUAD_39,
|
||||||
|
SQUAD_40,
|
||||||
ON_DUTY,
|
ON_DUTY,
|
||||||
DOCTOR,
|
DOCTOR,
|
||||||
PATIENT,
|
PATIENT,
|
||||||
@@ -321,7 +341,7 @@ UINT32 CalculatePrisonGuardValue(SOLDIERTYPE *pSoldier );
|
|||||||
UINT32 CalculateSnitchInterrogationValue(SOLDIERTYPE *pSoldier, UINT16 *pusMaxPts );
|
UINT32 CalculateSnitchInterrogationValue(SOLDIERTYPE *pSoldier, UINT16 *pusMaxPts );
|
||||||
|
|
||||||
// Flugente: Determine the best cth with SAMs in a sector, and which merc has that cth if present
|
// Flugente: Determine the best cth with SAMs in a sector, and which merc has that cth if present
|
||||||
FLOAT GetBestSAMOperatorCTH_Player( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ, UINT16 *pubID );
|
FLOAT GetBestSAMOperatorCTH_Player( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ, SoldierID *pubID );
|
||||||
|
|
||||||
INT16 GetTrainWorkerPts(SOLDIERTYPE *pSoldier);
|
INT16 GetTrainWorkerPts(SOLDIERTYPE *pSoldier);
|
||||||
|
|
||||||
@@ -595,4 +615,4 @@ UINT8 CalcSoldierNeedForSleep( SOLDIERTYPE *pSoldier );
|
|||||||
// Flugente: administration assignment
|
// Flugente: administration assignment
|
||||||
FLOAT GetAdministrationPercentage( INT16 sX, INT16 sY );
|
FLOAT GetAdministrationPercentage( INT16 sX, INT16 sY );
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+49
-43
@@ -163,13 +163,13 @@ typedef struct AUTORESOLVE_STRUCT
|
|||||||
|
|
||||||
UINT8 ubEnemyLeadership;
|
UINT8 ubEnemyLeadership;
|
||||||
UINT8 ubPlayerLeadership;
|
UINT8 ubPlayerLeadership;
|
||||||
UINT8 ubMercs, ubCivs, ubEnemies;
|
UINT16 ubMercs, ubCivs, ubEnemies;
|
||||||
UINT8 ubAdmins, ubTroops, ubElites, ubTanks, ubJeeps, ubRobots;
|
UINT16 ubAdmins, ubTroops, ubElites, ubTanks, ubJeeps, ubRobots;
|
||||||
UINT8 ubYMCreatures, ubYFCreatures, ubAMCreatures, ubAFCreatures;
|
UINT16 ubYMCreatures, ubYFCreatures, ubAMCreatures, ubAFCreatures;
|
||||||
UINT8 ubBloodcats;
|
UINT16 ubBloodcats;
|
||||||
UINT8 ubZombies;
|
UINT16 ubZombies;
|
||||||
UINT8 ubBandits;
|
UINT16 ubBandits;
|
||||||
UINT8 ubAliveMercs, ubAliveCivs, ubAliveEnemies;
|
UINT16 ubAliveMercs, ubAliveCivs, ubAliveEnemies;
|
||||||
UINT8 ubMercCols, ubMercRows;
|
UINT8 ubMercCols, ubMercRows;
|
||||||
UINT8 ubEnemyCols, ubEnemyRows;
|
UINT8 ubEnemyCols, ubEnemyRows;
|
||||||
UINT8 ubCivCols, ubCivRows;
|
UINT8 ubCivCols, ubCivRows;
|
||||||
@@ -410,10 +410,10 @@ void EliminateAllEnemies( UINT8 ubSectorX, UINT8 ubSectorY )
|
|||||||
GROUP *pGroup, *pDeleteGroup;
|
GROUP *pGroup, *pDeleteGroup;
|
||||||
SECTORINFO *pSector;
|
SECTORINFO *pSector;
|
||||||
INT32 i;
|
INT32 i;
|
||||||
UINT8 ubNumEnemies[ NUM_ENEMY_RANKS ];
|
UINT16 ubNumEnemies[NUM_ENEMY_RANKS]{};
|
||||||
UINT8 ubNumTanks = 0;
|
UINT16 ubNumTanks = 0;
|
||||||
UINT8 ubNumJeeps = 0;
|
UINT16 ubNumJeeps = 0;
|
||||||
UINT8 ubNumRobots = 0;
|
UINT16 ubNumRobots = 0;
|
||||||
UINT8 ubRankIndex;
|
UINT8 ubRankIndex;
|
||||||
|
|
||||||
//Clear any possible battle locator
|
//Clear any possible battle locator
|
||||||
@@ -460,7 +460,6 @@ void EliminateAllEnemies( UINT8 ubSectorX, UINT8 ubSectorY )
|
|||||||
pSector->ubNumJeeps = 0;
|
pSector->ubNumJeeps = 0;
|
||||||
pSector->ubNumRobots = 0;
|
pSector->ubNumRobots = 0;
|
||||||
pSector->ubNumCreatures = 0;
|
pSector->ubNumCreatures = 0;
|
||||||
pSector->bLastKnownEnemies = 0;
|
|
||||||
//Remove the mobile forces here, but only if battle is over.
|
//Remove the mobile forces here, but only if battle is over.
|
||||||
while( pGroup )
|
while( pGroup )
|
||||||
{
|
{
|
||||||
@@ -755,9 +754,9 @@ void AssociateEnemiesWithStrategicGroups()
|
|||||||
{
|
{
|
||||||
SECTORINFO *pSector;
|
SECTORINFO *pSector;
|
||||||
GROUP *pGroup;
|
GROUP *pGroup;
|
||||||
UINT8 ubNumAdmins, ubNumTroops, ubNumElites, ubNumTanks, ubNumJeeps, ubNumRobots; //how many soldiers of the type do we still have to assign to a group?
|
UINT16 ubNumAdmins, ubNumTroops, ubNumElites, ubNumTanks, ubNumJeeps, ubNumRobots; //how many soldiers of the type do we still have to assign to a group?
|
||||||
UINT8 ubISNumAdmins, ubISNumTroops, ubISNumElites, ubISNumTanks, ubISNumJeeps, ubISNumRobots;
|
UINT16 ubISNumAdmins, ubISNumTroops, ubISNumElites, ubISNumTanks, ubISNumJeeps, ubISNumRobots;
|
||||||
UINT8 ubNumElitesInGroup, ubNumTroopsInGroup, ubNumAdminsInGroup, ubNumTanksInGroup, ubNumJeepsInGroup, ubNumRobotsInGroup;
|
UINT16 ubNumElitesInGroup, ubNumTroopsInGroup, ubNumAdminsInGroup, ubNumTanksInGroup, ubNumJeepsInGroup, ubNumRobotsInGroup;
|
||||||
INT32 i;
|
INT32 i;
|
||||||
UINT8 pSectors[4];
|
UINT8 pSectors[4];
|
||||||
UINT8 ubDirAmount;
|
UINT8 ubDirAmount;
|
||||||
@@ -1839,7 +1838,6 @@ void RenderAutoResolve()
|
|||||||
HandleMoraleEvent( NULL, MORALE_BATTLE_WON, gpAR->ubSectorX, gpAR->ubSectorY, 0 );
|
HandleMoraleEvent( NULL, MORALE_BATTLE_WON, gpAR->ubSectorX, gpAR->ubSectorY, 0 );
|
||||||
if( ProcessLoyalty() )HandleGlobalLoyaltyEvent( GLOBAL_LOYALTY_BATTLE_WON, gpAR->ubSectorX, gpAR->ubSectorY, 0 );
|
if( ProcessLoyalty() )HandleGlobalLoyaltyEvent( GLOBAL_LOYALTY_BATTLE_WON, gpAR->ubSectorX, gpAR->ubSectorY, 0 );
|
||||||
|
|
||||||
SectorInfo[ SECTOR( gpAR->ubSectorX, gpAR->ubSectorY ) ].bLastKnownEnemies = 0;
|
|
||||||
SetThisSectorAsPlayerControlled( gpAR->ubSectorX, gpAR->ubSectorY, 0, TRUE );
|
SetThisSectorAsPlayerControlled( gpAR->ubSectorX, gpAR->ubSectorY, 0, TRUE );
|
||||||
#ifdef NEWMUSIC
|
#ifdef NEWMUSIC
|
||||||
GlobalSoundID = MusicSoundValues[ SECTOR( gpAR->ubSectorX, gpAR->ubSectorY ) ].SoundTacticalVictory[0];
|
GlobalSoundID = MusicSoundValues[ SECTOR( gpAR->ubSectorX, gpAR->ubSectorY ) ].SoundTacticalVictory[0];
|
||||||
@@ -1854,29 +1852,35 @@ void RenderAutoResolve()
|
|||||||
|
|
||||||
case BATTLE_SURRENDERED:
|
case BATTLE_SURRENDERED:
|
||||||
case BATTLE_CAPTURED:
|
case BATTLE_CAPTURED:
|
||||||
for( i = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; i <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; i++ )
|
{
|
||||||
|
SoldierID id = gTacticalStatus.Team[OUR_TEAM].bFirstID;
|
||||||
|
const SoldierID lastid = gTacticalStatus.Team[OUR_TEAM].bLastID;
|
||||||
|
for ( ; id <= lastid; ++id )
|
||||||
{
|
{
|
||||||
if( MercPtrs[ i ]->bActive && MercPtrs[ i ]->stats.bLife && !(MercPtrs[ i ]->flags.uiStatusFlags & SOLDIER_VEHICLE) && !AM_A_ROBOT( MercPtrs[ i ] ) )
|
SOLDIERTYPE *pSoldier = id;
|
||||||
|
|
||||||
|
if ( pSoldier->bActive && pSoldier->stats.bLife && !(pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE) && !AM_A_ROBOT( pSoldier ) )
|
||||||
{ //Merc is active and alive, and not a vehicle or robot
|
{ //Merc is active and alive, and not a vehicle or robot
|
||||||
if ( PlayerMercInvolvedInThisCombat( MercPtrs[ i ] ) )
|
if ( PlayerMercInvolvedInThisCombat( pSoldier ) )
|
||||||
{
|
{
|
||||||
// This morale event is PER INDIVIDUAL SOLDIER
|
// This morale event is PER INDIVIDUAL SOLDIER
|
||||||
HandleMoraleEvent( MercPtrs[ i ], MORALE_MERC_CAPTURED, gpAR->ubSectorX, gpAR->ubSectorY, 0 );
|
HandleMoraleEvent( pSoldier, MORALE_MERC_CAPTURED, gpAR->ubSectorX, gpAR->ubSectorY, 0 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HandleMoraleEvent( NULL, MORALE_HEARD_BATTLE_LOST, gpAR->ubSectorX, gpAR->ubSectorY, 0 );
|
HandleMoraleEvent( NULL, MORALE_HEARD_BATTLE_LOST, gpAR->ubSectorX, gpAR->ubSectorY, 0 );
|
||||||
if( ProcessLoyalty() )HandleGlobalLoyaltyEvent( GLOBAL_LOYALTY_BATTLE_LOST, gpAR->ubSectorX, gpAR->ubSectorY, 0 );
|
if ( ProcessLoyalty() )HandleGlobalLoyaltyEvent( GLOBAL_LOYALTY_BATTLE_LOST, gpAR->ubSectorX, gpAR->ubSectorY, 0 );
|
||||||
#ifdef NEWMUSIC
|
#ifdef NEWMUSIC
|
||||||
GlobalSoundID = MusicSoundValues[ SECTOR( gpAR->ubSectorX, gpAR->ubSectorY ) ].SoundTacticalDeath[0];
|
GlobalSoundID = MusicSoundValues[SECTOR( gpAR->ubSectorX, gpAR->ubSectorY )].SoundTacticalDeath[0];
|
||||||
if ( MusicSoundValues[ SECTOR( gpAR->ubSectorX, gpAR->ubSectorY ) ].SoundTacticalDeath[0] != -1 )
|
if ( MusicSoundValues[SECTOR( gpAR->ubSectorX, gpAR->ubSectorY )].SoundTacticalDeath[0] != -1 )
|
||||||
SetMusicModeID( MUSIC_TACTICAL_DEATH, MusicSoundValues[ SECTOR( gpAR->ubSectorX, gpAR->ubSectorY ) ].SoundTacticalDeath[0] );
|
SetMusicModeID( MUSIC_TACTICAL_DEATH, MusicSoundValues[SECTOR( gpAR->ubSectorX, gpAR->ubSectorY )].SoundTacticalDeath[0] );
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
SetMusicMode( MUSIC_TACTICAL_DEATH );
|
SetMusicMode( MUSIC_TACTICAL_DEATH );
|
||||||
|
|
||||||
gsEnemyGainedControlOfSectorID = (INT16)SECTOR( gpAR->ubSectorX, gpAR->ubSectorY );
|
gsEnemyGainedControlOfSectorID = (INT16)SECTOR( gpAR->ubSectorX, gpAR->ubSectorY );
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case BATTLE_DEFEAT:
|
case BATTLE_DEFEAT:
|
||||||
HandleMoraleEvent( NULL, MORALE_HEARD_BATTLE_LOST, gpAR->ubSectorX, gpAR->ubSectorY, 0 );
|
HandleMoraleEvent( NULL, MORALE_HEARD_BATTLE_LOST, gpAR->ubSectorX, gpAR->ubSectorY, 0 );
|
||||||
|
|
||||||
@@ -2048,7 +2052,7 @@ static void ARCreateMilitia( UINT8 mclass, INT32 i, INT16 sX, INT16 sY)
|
|||||||
swprintf( gpCivs[i].pSoldier->name, gpStrategicString[ STR_AR_MILITIA_NAME ] );
|
swprintf( gpCivs[i].pSoldier->name, gpStrategicString[ STR_AR_MILITIA_NAME ] );
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ARCreateMilitiaSquad( UINT8 *cnt, UINT8 ubEliteMilitia, UINT8 ubRegMilitia, UINT8 ubGreenMilitia, INT16 sX, INT16 sY)
|
static void ARCreateMilitiaSquad( UINT16 *cnt, UINT16 ubEliteMilitia, UINT16 ubRegMilitia, UINT16 ubGreenMilitia, INT16 sX, INT16 sY)
|
||||||
{
|
{
|
||||||
while( *cnt < gpAR->ubCivs && (ubEliteMilitia || ubRegMilitia || ubGreenMilitia) )
|
while( *cnt < gpAR->ubCivs && (ubEliteMilitia || ubRegMilitia || ubGreenMilitia) )
|
||||||
{
|
{
|
||||||
@@ -2077,10 +2081,10 @@ void CreateAutoResolveInterface()
|
|||||||
VOBJECT_DESC VObjectDesc;
|
VOBJECT_DESC VObjectDesc;
|
||||||
INT32 i, index;
|
INT32 i, index;
|
||||||
HVOBJECT hVObject;
|
HVOBJECT hVObject;
|
||||||
UINT8 ubGreenMilitia, ubRegMilitia, ubEliteMilitia;
|
UINT16 ubGreenMilitia, ubRegMilitia, ubEliteMilitia;
|
||||||
UINT16 pMoveDir[4][3];
|
UINT16 pMoveDir[4][3];
|
||||||
UINT8 uiDirNumber = 0;
|
UINT8 uiDirNumber = 0;
|
||||||
UINT8 cnt;
|
UINT16 cnt;
|
||||||
|
|
||||||
//Setup new autoresolve blanket interface.
|
//Setup new autoresolve blanket interface.
|
||||||
MSYS_DefineRegion( &gpAR->AutoResolveRegion, 0 + xResOffset, 0, SCREEN_WIDTH, SCREEN_HEIGHT, MSYS_PRIORITY_HIGH-1, 0,
|
MSYS_DefineRegion( &gpAR->AutoResolveRegion, 0 + xResOffset, 0, SCREEN_WIDTH, SCREEN_HEIGHT, MSYS_PRIORITY_HIGH-1, 0,
|
||||||
@@ -2200,7 +2204,7 @@ void CreateAutoResolveInterface()
|
|||||||
ubGreenMilitia = MilitiaInSectorOfRank( gpAR->ubSectorX, gpAR->ubSectorY, GREEN_MILITIA );
|
ubGreenMilitia = MilitiaInSectorOfRank( gpAR->ubSectorX, gpAR->ubSectorY, GREEN_MILITIA );
|
||||||
|
|
||||||
// see if we get any bonus militia from nearby towns
|
// see if we get any bonus militia from nearby towns
|
||||||
UINT8 bonusGreenMilitia = 0, bonusRegularMilitia = 0, bonusEliteMilitia = 0;
|
UINT16 bonusGreenMilitia = 0, bonusRegularMilitia = 0, bonusEliteMilitia = 0;
|
||||||
RebelCommand::GetBonusMilitia(gpAR->ubSectorX, gpAR->ubSectorY, bonusGreenMilitia, bonusRegularMilitia, bonusEliteMilitia, FALSE); // no need to create a group for autoresolve as we're just increasing local militia pop
|
RebelCommand::GetBonusMilitia(gpAR->ubSectorX, gpAR->ubSectorY, bonusGreenMilitia, bonusRegularMilitia, bonusEliteMilitia, FALSE); // no need to create a group for autoresolve as we're just increasing local militia pop
|
||||||
ubEliteMilitia += bonusEliteMilitia;
|
ubEliteMilitia += bonusEliteMilitia;
|
||||||
ubRegMilitia += bonusRegularMilitia;
|
ubRegMilitia += bonusRegularMilitia;
|
||||||
@@ -2837,7 +2841,7 @@ void RetreatButtonCallback( GUI_BUTTON *btn, INT32 reason )
|
|||||||
if( gpAR->pRobotCell )
|
if( gpAR->pRobotCell )
|
||||||
{
|
{
|
||||||
//if robot is retreating, set the retreat time to be the same as the robot's controller.
|
//if robot is retreating, set the retreat time to be the same as the robot's controller.
|
||||||
UINT8 ubRobotControllerID;
|
SoldierID ubRobotControllerID;
|
||||||
|
|
||||||
ubRobotControllerID = gpAR->pRobotCell->pSoldier->ubRobotRemoteHolderID;
|
ubRobotControllerID = gpAR->pRobotCell->pSoldier->ubRobotRemoteHolderID;
|
||||||
|
|
||||||
@@ -3011,9 +3015,7 @@ void MercCellMouseClickCallback( MOUSE_REGION *reg, INT32 reason )
|
|||||||
|
|
||||||
if( gpAR->pRobotCell )
|
if( gpAR->pRobotCell )
|
||||||
{ //if controller is retreating, make the robot retreat too.
|
{ //if controller is retreating, make the robot retreat too.
|
||||||
UINT8 ubRobotControllerID;
|
SoldierID ubRobotControllerID = gpAR->pRobotCell->pSoldier->ubRobotRemoteHolderID;
|
||||||
|
|
||||||
ubRobotControllerID = gpAR->pRobotCell->pSoldier->ubRobotRemoteHolderID;
|
|
||||||
|
|
||||||
if( ubRobotControllerID == NOBODY )
|
if( ubRobotControllerID == NOBODY )
|
||||||
{
|
{
|
||||||
@@ -3067,7 +3069,7 @@ void CalculateAutoResolveInfo()
|
|||||||
&gpAR->ubAMCreatures, &gpAR->ubAFCreatures );
|
&gpAR->ubAMCreatures, &gpAR->ubAFCreatures );
|
||||||
}
|
}
|
||||||
|
|
||||||
gpAR->ubEnemies = (UINT8)min( gpAR->ubYMCreatures + gpAR->ubYFCreatures + gpAR->ubAMCreatures + gpAR->ubAFCreatures, MAX_AR_TEAM_SIZE );
|
gpAR->ubEnemies = min( gpAR->ubYMCreatures + gpAR->ubYFCreatures + gpAR->ubAMCreatures + gpAR->ubAFCreatures, MAX_AR_TEAM_SIZE );
|
||||||
}
|
}
|
||||||
else if ( GetEnemyEncounterCode() == BLOODCAT_ATTACK_CODE ||
|
else if ( GetEnemyEncounterCode() == BLOODCAT_ATTACK_CODE ||
|
||||||
GetEnemyEncounterCode() == ZOMBIE_ATTACK_CODE ||
|
GetEnemyEncounterCode() == ZOMBIE_ATTACK_CODE ||
|
||||||
@@ -3087,7 +3089,7 @@ void CalculateAutoResolveInfo()
|
|||||||
gpAR->ubBandits = gubNumCreaturesAttackingTown;
|
gpAR->ubBandits = gubNumCreaturesAttackingTown;
|
||||||
}
|
}
|
||||||
|
|
||||||
gpAR->ubEnemies = (UINT8)min( gubNumCreaturesAttackingTown, MAX_AR_TEAM_SIZE );
|
gpAR->ubEnemies = min( gubNumCreaturesAttackingTown, MAX_AR_TEAM_SIZE );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -3096,7 +3098,7 @@ void CalculateAutoResolveInfo()
|
|||||||
GetNumberOfEnemiesInFiveSectors( gpAR->ubSectorX, gpAR->ubSectorY,
|
GetNumberOfEnemiesInFiveSectors( gpAR->ubSectorX, gpAR->ubSectorY,
|
||||||
&gpAR->ubAdmins, &gpAR->ubTroops, &gpAR->ubElites, &gpAR->ubRobots, &gpAR->ubTanks, &gpAR->ubJeeps );
|
&gpAR->ubAdmins, &gpAR->ubTroops, &gpAR->ubElites, &gpAR->ubRobots, &gpAR->ubTanks, &gpAR->ubJeeps );
|
||||||
|
|
||||||
gpAR->ubEnemies = (UINT8)min( gpAR->ubAdmins + gpAR->ubTroops + gpAR->ubElites + gpAR->ubTanks + gpAR->ubJeeps + gpAR->ubRobots, MAX_AR_TEAM_SIZE );
|
gpAR->ubEnemies = min( gpAR->ubAdmins + gpAR->ubTroops + gpAR->ubElites + gpAR->ubTanks + gpAR->ubJeeps + gpAR->ubRobots, MAX_AR_TEAM_SIZE );
|
||||||
}
|
}
|
||||||
|
|
||||||
gfTransferTacticalOppositionToAutoResolve = FALSE;
|
gfTransferTacticalOppositionToAutoResolve = FALSE;
|
||||||
@@ -3735,7 +3737,7 @@ UINT8 GetUnusedMercProfileID()
|
|||||||
BOOLEAN fUnique = FALSE;
|
BOOLEAN fUnique = FALSE;
|
||||||
while( !fUnique )
|
while( !fUnique )
|
||||||
{
|
{
|
||||||
ubRandom = (UINT8)PreRandom( 40 );
|
ubRandom = (UINT8)PreRandom(CODE_MAXIMUM_NUMBER_OF_PLAYER_MERCS);
|
||||||
for( i = 0; i < 19; i++ )
|
for( i = 0; i < 19; i++ )
|
||||||
{
|
{
|
||||||
fUnique = TRUE;
|
fUnique = TRUE;
|
||||||
@@ -3753,7 +3755,7 @@ void CreateTempPlayerMerc()
|
|||||||
{
|
{
|
||||||
SOLDIERCREATE_STRUCT MercCreateStruct;
|
SOLDIERCREATE_STRUCT MercCreateStruct;
|
||||||
static INT32 iSoldierCount=0;
|
static INT32 iSoldierCount=0;
|
||||||
UINT8 ubID;
|
SoldierID ubID;
|
||||||
|
|
||||||
//Init the merc create structure with basic information
|
//Init the merc create structure with basic information
|
||||||
MercCreateStruct.bTeam = SOLDIER_CREATE_AUTO_TEAM;
|
MercCreateStruct.bTeam = SOLDIER_CREATE_AUTO_TEAM;
|
||||||
@@ -5961,12 +5963,16 @@ void CheckForSoldiersWhoRetreatedIntoMilitiaHeldSectors()
|
|||||||
(!gTacticalStatus.fEnemyInSector))
|
(!gTacticalStatus.fEnemyInSector))
|
||||||
{
|
{
|
||||||
unsigned mercCnt = 0;
|
unsigned mercCnt = 0;
|
||||||
for( int i = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; i <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; ++i )
|
SoldierID id = gTacticalStatus.Team[OUR_TEAM].bFirstID;
|
||||||
|
const SoldierID lastid = gTacticalStatus.Team[OUR_TEAM].bLastID;
|
||||||
|
for ( ; id <= lastid; ++id )
|
||||||
{
|
{
|
||||||
if( MercPtrs[ i ]->bActive && MercPtrs[ i ]->stats.bLife && !(MercPtrs[ i ]->flags.uiStatusFlags & SOLDIER_VEHICLE) && !AM_A_ROBOT( MercPtrs[ i ] ) )
|
SOLDIERTYPE *pSoldier = id;
|
||||||
|
|
||||||
|
if( pSoldier->bActive && pSoldier->stats.bLife && !(pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE) && !AM_A_ROBOT( pSoldier ) )
|
||||||
{
|
{
|
||||||
//Merc is active and alive, and not a vehicle or robot
|
//Merc is active and alive, and not a vehicle or robot
|
||||||
if ((MercPtrs[ i ]->sSectorX == sX) &&(MercPtrs[ i ]->sSectorY == sY) && (MercPtrs[ i ]->bSectorZ == 0))
|
if ( (pSoldier->sSectorX == sX) && (pSoldier->sSectorY == sY) && (pSoldier->bSectorZ == 0) )
|
||||||
{
|
{
|
||||||
++mercCnt;
|
++mercCnt;
|
||||||
}
|
}
|
||||||
|
|||||||
+27
-30
@@ -487,21 +487,18 @@ typedef struct SECTORINFO
|
|||||||
//This value determines how quickly it is investigated by the enemy.
|
//This value determines how quickly it is investigated by the enemy.
|
||||||
UINT8 ubGarrisonID; //IF the sector has an ID for this (non 255), then the queen values this sector and it
|
UINT8 ubGarrisonID; //IF the sector has an ID for this (non 255), then the queen values this sector and it
|
||||||
//indexes the garrison group.
|
//indexes the garrison group.
|
||||||
INT8 ubPendingReinforcements; //when the enemy owns this sector, this value will keep track of HIGH priority reinforcements -- not regular.
|
INT8 ubPendingReinforcements; //when the enemy owns this sector, this value will keep track of HIGH priority reinforcements -- not regular.
|
||||||
BOOLEAN fMilitiaTrainingPaid;
|
BOOLEAN fMilitiaTrainingPaid;
|
||||||
UINT8 ubMilitiaTrainingPercentDone;
|
UINT8 ubMilitiaTrainingPercentDone;
|
||||||
UINT8 ubMilitiaTrainingHundredths;
|
UINT8 ubMilitiaTrainingHundredths;
|
||||||
//enemy military presence
|
//enemy military presence
|
||||||
BOOLEAN fPlayer[ 4 ]; //whether the player THINKS the sector is unde his control or not. array is for sublevels
|
BOOLEAN fPlayer[ 4 ]; //whether the player THINKS the sector is unde his control or not. array is for sublevels
|
||||||
//enemy only info
|
//enemy only info
|
||||||
UINT8 ubNumTroops; //the actual number of troops here.
|
UINT16 ubNumTroops; //the actual number of troops here.
|
||||||
UINT8 ubNumElites; //the actual number of elites here.
|
UINT16 ubNumElites; //the actual number of elites here.
|
||||||
UINT8 ubNumAdmins; //the actual number of admins here.
|
UINT16 ubNumAdmins; //the actual number of admins here.
|
||||||
UINT8 ubNumCreatures; //only set when immediately before ground attack made!
|
UINT16 ubNumCreatures; //only set when immediately before ground attack made!
|
||||||
UINT8 ubTroopsInBattle, ubElitesInBattle, ubAdminsInBattle, ubCreaturesInBattle;
|
UINT16 ubTroopsInBattle, ubElitesInBattle, ubAdminsInBattle, ubCreaturesInBattle;
|
||||||
|
|
||||||
INT8 bLastKnownEnemies; // -1 means never been there, no idea, otherwise it's what we'd observed most recently
|
|
||||||
// while this is being maintained (partially, surely buggy), nothing uses it anymore. ARM
|
|
||||||
|
|
||||||
UINT32 ubDayOfLastCreatureAttack;
|
UINT32 ubDayOfLastCreatureAttack;
|
||||||
UINT32 uiFacilitiesFlags; // the flags for various facilities
|
UINT32 uiFacilitiesFlags; // the flags for various facilities
|
||||||
@@ -511,15 +508,15 @@ typedef struct SECTORINFO
|
|||||||
//throught the sector without entering it.
|
//throught the sector without entering it.
|
||||||
INT8 bNameId;
|
INT8 bNameId;
|
||||||
INT8 bUSUSED;
|
INT8 bUSUSED;
|
||||||
INT8 bBloodCats;
|
INT16 bBloodCats;
|
||||||
INT8 bBloodCatPlacements;
|
INT16 bBloodCatPlacements;
|
||||||
INT8 UNUSEDbSAMCondition;
|
INT8 UNUSEDbSAMCondition;
|
||||||
|
|
||||||
UINT8 ubTravelRating; //Represents how travelled a sector is. Typically, the higher the travel rating,
|
UINT8 ubTravelRating; //Represents how travelled a sector is. Typically, the higher the travel rating,
|
||||||
//the more people go near it. A travel rating of 0 means there are never people
|
//the more people go near it. A travel rating of 0 means there are never people
|
||||||
//around. This value is used for determining how often items would "vanish" from
|
//around. This value is used for determining how often items would "vanish" from
|
||||||
//a sector (nice theory, except it isn't being used that way. Stealing is only in towns. ARM)
|
//a sector (nice theory, except it isn't being used that way. Stealing is only in towns. ARM)
|
||||||
UINT8 ubNumberOfCivsAtLevel[ MAX_MILITIA_LEVELS ]; // town militia per experience class, 0/1/2 is GREEN/REGULAR/ELITE
|
UINT16 ubNumberOfCivsAtLevel[ MAX_MILITIA_LEVELS ]; // town militia per experience class, 0/1/2 is GREEN/REGULAR/ELITE
|
||||||
// HEADROCK HAM 3.6: Adding separate training percentage for MOBILES.
|
// HEADROCK HAM 3.6: Adding separate training percentage for MOBILES.
|
||||||
UINT8 usFiller3;
|
UINT8 usFiller3;
|
||||||
UINT8 usFiller1;
|
UINT8 usFiller1;
|
||||||
@@ -551,8 +548,8 @@ typedef struct SECTORINFO
|
|||||||
|
|
||||||
UINT32 uiTimeAIArtillerywasOrdered; // Flugente: updated every time an artillery strike is ordered from the militia
|
UINT32 uiTimeAIArtillerywasOrdered; // Flugente: updated every time an artillery strike is ordered from the militia
|
||||||
|
|
||||||
UINT8 ubNumTanks;
|
UINT16 ubNumTanks;
|
||||||
UINT8 ubTanksInBattle;
|
UINT16 ubTanksInBattle;
|
||||||
|
|
||||||
// Flugente: disease
|
// Flugente: disease
|
||||||
UINT16 usNumCorpses; // number of corpses in this sector
|
UINT16 usNumCorpses; // number of corpses in this sector
|
||||||
@@ -565,8 +562,8 @@ typedef struct SECTORINFO
|
|||||||
FLOAT dFortification_UnappliedProgress; // progress done via assignment work. As we cannot update unloaded sectors, update happens once sector is loaded
|
FLOAT dFortification_UnappliedProgress; // progress done via assignment work. As we cannot update unloaded sectors, update happens once sector is loaded
|
||||||
|
|
||||||
// Flugente: enemy jeeps
|
// Flugente: enemy jeeps
|
||||||
UINT8 ubNumJeeps;
|
UINT16 ubNumJeeps;
|
||||||
UINT8 ubJeepsInBattle;
|
UINT16 ubJeepsInBattle;
|
||||||
|
|
||||||
UINT8 usWorkers;
|
UINT8 usWorkers;
|
||||||
UINT8 ubWorkerTrainingHundredths;
|
UINT8 ubWorkerTrainingHundredths;
|
||||||
@@ -583,8 +580,8 @@ typedef struct SECTORINFO
|
|||||||
UINT8 ubNumElites_Turncoat;
|
UINT8 ubNumElites_Turncoat;
|
||||||
UINT8 usExplorationProgress;
|
UINT8 usExplorationProgress;
|
||||||
|
|
||||||
UINT8 ubNumRobots;
|
UINT16 ubNumRobots;
|
||||||
UINT8 ubRobotsInBattle;
|
UINT16 ubRobotsInBattle;
|
||||||
INT8 bPadding[ 6 ];
|
INT8 bPadding[ 6 ];
|
||||||
|
|
||||||
}SECTORINFO;
|
}SECTORINFO;
|
||||||
@@ -600,18 +597,18 @@ typedef struct UNDERGROUND_SECTORINFO
|
|||||||
{
|
{
|
||||||
UINT32 uiFlags;
|
UINT32 uiFlags;
|
||||||
UINT8 ubSectorX, ubSectorY, ubSectorZ;
|
UINT8 ubSectorX, ubSectorY, ubSectorZ;
|
||||||
UINT8 ubNumElites, ubNumTroops, ubNumAdmins, ubNumCreatures;
|
UINT16 ubNumElites, ubNumTroops, ubNumAdmins, ubNumCreatures;
|
||||||
UINT8 fVisited;
|
UINT8 fVisited;
|
||||||
INT8 ubTravelRating; //Represents how travelled a sector is. Typically, the higher the travel rating,
|
INT8 ubTravelRating; //Represents how travelled a sector is. Typically, the higher the travel rating,
|
||||||
//the more people go near it. A travel rating of 0 means there are never people
|
//the more people go near it. A travel rating of 0 means there are never people
|
||||||
//around. This value is used for determining how often items would "vanish" from
|
//around. This value is used for determining how often items would "vanish" from
|
||||||
//a sector.
|
//a sector.
|
||||||
UINT32 uiTimeCurrentSectorWasLastLoaded; //Specifies the last time the player was in the sector
|
UINT32 uiTimeCurrentSectorWasLastLoaded; //Specifies the last time the player was in the sector
|
||||||
struct UNDERGROUND_SECTORINFO *next;
|
struct UNDERGROUND_SECTORINFO *next;
|
||||||
|
|
||||||
UINT8 ubNumBloodcats; // Bloodcat population
|
UINT16 ubNumBloodcats; // Bloodcat population
|
||||||
UINT8 ubCreatureHabitat; //determines how creatures live in this sector (see creature spreading.c)
|
UINT8 ubCreatureHabitat; //determines how creatures live in this sector (see creature spreading.c)
|
||||||
UINT8 ubElitesInBattle, ubTroopsInBattle, ubAdminsInBattle, ubCreaturesInBattle;
|
UINT16 ubElitesInBattle, ubTroopsInBattle, ubAdminsInBattle, ubCreaturesInBattle;
|
||||||
|
|
||||||
// adding these (should not change struct layout due to padding)
|
// adding these (should not change struct layout due to padding)
|
||||||
UINT8 ubMusicMode, ubUnsed;
|
UINT8 ubMusicMode, ubUnsed;
|
||||||
@@ -622,20 +619,20 @@ typedef struct UNDERGROUND_SECTORINFO
|
|||||||
BOOLEAN fCampaignSector;
|
BOOLEAN fCampaignSector;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
UINT8 uiNumberOfPrisonersOfWar[PRISONER_MAX];
|
UINT16 uiNumberOfPrisonersOfWar[PRISONER_MAX];
|
||||||
|
|
||||||
UINT8 ubNumTanks;
|
UINT16 ubNumTanks;
|
||||||
UINT8 ubTanksInBattle;
|
UINT16 ubTanksInBattle;
|
||||||
|
|
||||||
// Flugente: fortification
|
// Flugente: fortification
|
||||||
FLOAT dFortification_MaxPossible; // the amount of fortification that can still be done in this sector, given the current layout plans. Is updated every time we unload a sector
|
FLOAT dFortification_MaxPossible; // the amount of fortification that can still be done in this sector, given the current layout plans. Is updated every time we unload a sector
|
||||||
FLOAT dFortification_UnappliedProgress; // progress done via assignment work. As we cannot update unloaded sectors, update happens once sector is loaded
|
FLOAT dFortification_UnappliedProgress; // progress done via assignment work. As we cannot update unloaded sectors, update happens once sector is loaded
|
||||||
|
|
||||||
UINT8 ubNumJeeps;
|
UINT16 ubNumJeeps;
|
||||||
UINT8 ubJeepsInBattle;
|
UINT16 ubJeepsInBattle;
|
||||||
UINT8 usExplorationProgress;
|
UINT8 usExplorationProgress;
|
||||||
UINT8 ubNumRobots;
|
UINT16 ubNumRobots;
|
||||||
UINT8 ubRobotsInBattle;
|
UINT16 ubRobotsInBattle;
|
||||||
|
|
||||||
INT8 bPadding[10];
|
INT8 bPadding[10];
|
||||||
//no padding left!
|
//no padding left!
|
||||||
@@ -656,4 +653,4 @@ enum CreateMusic
|
|||||||
CM_ALWAYS,
|
CM_ALWAYS,
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -139,11 +139,11 @@ INT32 giDestroyedLairID = 0;
|
|||||||
//prebattle interface, autoresolve, etc.
|
//prebattle interface, autoresolve, etc.
|
||||||
INT16 gsCreatureInsertionCode = 0;
|
INT16 gsCreatureInsertionCode = 0;
|
||||||
INT32 gsCreatureInsertionGridNo = 0;
|
INT32 gsCreatureInsertionGridNo = 0;
|
||||||
UINT8 gubNumCreaturesAttackingTown = 0;
|
UINT16 gubNumCreaturesAttackingTown = 0;
|
||||||
UINT8 gubYoungMalesAttackingTown = 0;
|
UINT16 gubYoungMalesAttackingTown = 0;
|
||||||
UINT8 gubYoungFemalesAttackingTown = 0;
|
UINT16 gubYoungFemalesAttackingTown = 0;
|
||||||
UINT8 gubAdultMalesAttackingTown = 0;
|
UINT16 gubAdultMalesAttackingTown = 0;
|
||||||
UINT8 gubAdultFemalesAttackingTown = 0;
|
UINT16 gubAdultFemalesAttackingTown = 0;
|
||||||
UINT8 gubCreatureBattleCode = CREATURE_BATTLE_CODE_NONE;
|
UINT8 gubCreatureBattleCode = CREATURE_BATTLE_CODE_NONE;
|
||||||
UINT8 gubSectorIDOfCreatureAttack = 0;
|
UINT8 gubSectorIDOfCreatureAttack = 0;
|
||||||
|
|
||||||
@@ -1634,8 +1634,8 @@ BOOLEAN MineClearOfMonsters( UINT8 ubMineIndex )
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DetermineCreatureTownComposition( UINT8 ubNumCreatures, UINT8 *pubNumYoungMales, UINT8 *pubNumYoungFemales,
|
void DetermineCreatureTownComposition( UINT16 ubNumCreatures, UINT16 *pubNumYoungMales, UINT16 *pubNumYoungFemales,
|
||||||
UINT8 *pubNumAdultMales, UINT8 *pubNumAdultFemales )
|
UINT16 *pubNumAdultMales, UINT16 *pubNumAdultFemales )
|
||||||
{
|
{
|
||||||
INT32 i, iRandom;
|
INT32 i, iRandom;
|
||||||
UINT8 ubYoungMalePercentage = 10;
|
UINT8 ubYoungMalePercentage = 10;
|
||||||
@@ -1667,8 +1667,8 @@ void DetermineCreatureTownComposition( UINT8 ubNumCreatures, UINT8 *pubNumYoungM
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DetermineCreatureTownCompositionBasedOnTacticalInformation( UINT8 *pubNumCreatures, UINT8 *pubNumYoungMales, UINT8 *pubNumYoungFemales,
|
void DetermineCreatureTownCompositionBasedOnTacticalInformation( UINT16 *pubNumCreatures, UINT16 *pubNumYoungMales, UINT16 *pubNumYoungFemales,
|
||||||
UINT8 *pubNumAdultMales, UINT8 *pubNumAdultFemales )
|
UINT16 *pubNumAdultMales, UINT16 *pubNumAdultFemales )
|
||||||
{
|
{
|
||||||
SOLDIERTYPE *pSoldier;
|
SOLDIERTYPE *pSoldier;
|
||||||
|
|
||||||
@@ -1676,9 +1676,9 @@ void DetermineCreatureTownCompositionBasedOnTacticalInformation( UINT8 *pubNumCr
|
|||||||
*pubNumCreatures = 0;
|
*pubNumCreatures = 0;
|
||||||
pSector->ubNumCreatures = 0;
|
pSector->ubNumCreatures = 0;
|
||||||
pSector->ubCreaturesInBattle = 0;
|
pSector->ubCreaturesInBattle = 0;
|
||||||
for( INT32 i = gTacticalStatus.Team[ CREATURE_TEAM ].bFirstID; i <= gTacticalStatus.Team[ CREATURE_TEAM ].bLastID; ++i )
|
for( SoldierID i = gTacticalStatus.Team[ CREATURE_TEAM ].bFirstID; i <= gTacticalStatus.Team[ CREATURE_TEAM ].bLastID; ++i )
|
||||||
{
|
{
|
||||||
pSoldier = MercPtrs[ i ];
|
pSoldier = i;
|
||||||
if( pSoldier->bActive && pSoldier->bInSector && pSoldier->stats.bLife )
|
if( pSoldier->bActive && pSoldier->bInSector && pSoldier->stats.bLife )
|
||||||
{
|
{
|
||||||
switch( pSoldier->ubBodyType )
|
switch( pSoldier->ubBodyType )
|
||||||
@@ -1704,7 +1704,7 @@ void DetermineCreatureTownCompositionBasedOnTacticalInformation( UINT8 *pubNumCr
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DetermineOtherCreatureTownCompositionBasedOnTacticalInformation( UINT8* pubNumCreatures, UINT8* pubNumBloodcats, UINT8* pubNumZombies, UINT8* pubNumBandits )
|
void DetermineOtherCreatureTownCompositionBasedOnTacticalInformation( UINT16* pubNumCreatures, UINT16* pubNumBloodcats, UINT16* pubNumZombies, UINT16* pubNumBandits )
|
||||||
{
|
{
|
||||||
SOLDIERTYPE *pSoldier;
|
SOLDIERTYPE *pSoldier;
|
||||||
|
|
||||||
@@ -1712,9 +1712,9 @@ void DetermineOtherCreatureTownCompositionBasedOnTacticalInformation( UINT8* pub
|
|||||||
*pubNumCreatures = 0;
|
*pubNumCreatures = 0;
|
||||||
pSector->ubNumCreatures = 0;
|
pSector->ubNumCreatures = 0;
|
||||||
pSector->ubCreaturesInBattle = 0;
|
pSector->ubCreaturesInBattle = 0;
|
||||||
for ( INT32 i = gTacticalStatus.Team[CREATURE_TEAM].bFirstID; i <= gTacticalStatus.Team[CREATURE_TEAM].bLastID; ++i )
|
for ( SoldierID i = gTacticalStatus.Team[CREATURE_TEAM].bFirstID; i <= gTacticalStatus.Team[CREATURE_TEAM].bLastID; ++i )
|
||||||
{
|
{
|
||||||
pSoldier = MercPtrs[i];
|
pSoldier = i;
|
||||||
if ( pSoldier->bActive && pSoldier->bInSector && pSoldier->stats.bLife )
|
if ( pSoldier->bActive && pSoldier->bInSector && pSoldier->stats.bLife )
|
||||||
{
|
{
|
||||||
if ( pSoldier->IsZombie() )
|
if ( pSoldier->IsZombie() )
|
||||||
@@ -1750,13 +1750,13 @@ BOOLEAN PrepareCreaturesForBattle()
|
|||||||
UINT8 ubAdultMalePercentage;
|
UINT8 ubAdultMalePercentage;
|
||||||
UINT8 ubAdultFemalePercentage;
|
UINT8 ubAdultFemalePercentage;
|
||||||
UINT8 ubCreatureHabitat;
|
UINT8 ubCreatureHabitat;
|
||||||
UINT8 ubNumLarvae = 0;
|
UINT16 ubNumLarvae = 0;
|
||||||
UINT8 ubNumInfants = 0;
|
UINT16 ubNumInfants = 0;
|
||||||
UINT8 ubNumYoungMales = 0;
|
UINT16 ubNumYoungMales = 0;
|
||||||
UINT8 ubNumYoungFemales = 0;
|
UINT16 ubNumYoungFemales = 0;
|
||||||
UINT8 ubNumAdultMales = 0;
|
UINT16 ubNumAdultMales = 0;
|
||||||
UINT8 ubNumAdultFemales = 0;
|
UINT16 ubNumAdultFemales = 0;
|
||||||
UINT8 ubNumCreatures;
|
UINT16 ubNumCreatures;
|
||||||
|
|
||||||
if( !gubCreatureBattleCode )
|
if( !gubCreatureBattleCode )
|
||||||
{
|
{
|
||||||
@@ -2243,7 +2243,6 @@ BOOLEAN PlayerGroupIsInACreatureInfestedMine()
|
|||||||
{
|
{
|
||||||
CREATURE_DIRECTIVE *curr;
|
CREATURE_DIRECTIVE *curr;
|
||||||
SOLDIERTYPE *pSoldier;
|
SOLDIERTYPE *pSoldier;
|
||||||
INT32 i;
|
|
||||||
INT16 sSectorX, sSectorY;
|
INT16 sSectorX, sSectorY;
|
||||||
INT8 bSectorZ;
|
INT8 bSectorZ;
|
||||||
|
|
||||||
@@ -2261,9 +2260,9 @@ BOOLEAN PlayerGroupIsInACreatureInfestedMine()
|
|||||||
bSectorZ = (INT8)curr->pLevel->ubSectorZ;
|
bSectorZ = (INT8)curr->pLevel->ubSectorZ;
|
||||||
//Loop through all the creature directives (mine sectors that are infectible) and
|
//Loop through all the creature directives (mine sectors that are infectible) and
|
||||||
//see if players are there.
|
//see if players are there.
|
||||||
for( i = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; i <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; i++ )
|
for( SoldierID i = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; i <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; ++i )
|
||||||
{
|
{
|
||||||
pSoldier = MercPtrs[ i ];
|
pSoldier = i;
|
||||||
if( pSoldier->bActive && pSoldier->stats.bLife &&
|
if( pSoldier->bActive && pSoldier->stats.bLife &&
|
||||||
pSoldier->sSectorX == sSectorX &&
|
pSoldier->sSectorX == sSectorX &&
|
||||||
pSoldier->sSectorY == sSectorY &&
|
pSoldier->sSectorY == sSectorY &&
|
||||||
@@ -2422,4 +2421,4 @@ void ResetCreatureAttackVariables()
|
|||||||
gubAdultFemalesAttackingTown = 0;
|
gubAdultFemalesAttackingTown = 0;
|
||||||
gubCreatureBattleCode = CREATURE_BATTLE_CODE_NONE;
|
gubCreatureBattleCode = CREATURE_BATTLE_CODE_NONE;
|
||||||
gubSectorIDOfCreatureAttack = 0;
|
gubSectorIDOfCreatureAttack = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,11 +30,11 @@ BOOLEAN GetWarpOutOfMineCodes( INT16 *psSectorX, INT16 *psSectorY, INT8 *pbSecto
|
|||||||
|
|
||||||
extern INT16 gsCreatureInsertionCode;
|
extern INT16 gsCreatureInsertionCode;
|
||||||
extern INT32 gsCreatureInsertionGridNo;
|
extern INT32 gsCreatureInsertionGridNo;
|
||||||
extern UINT8 gubNumCreaturesAttackingTown;
|
extern UINT16 gubNumCreaturesAttackingTown;
|
||||||
extern UINT8 gubYoungMalesAttackingTown;
|
extern UINT16 gubYoungMalesAttackingTown;
|
||||||
extern UINT8 gubYoungFemalesAttackingTown;
|
extern UINT16 gubYoungFemalesAttackingTown;
|
||||||
extern UINT8 gubAdultMalesAttackingTown;
|
extern UINT16 gubAdultMalesAttackingTown;
|
||||||
extern UINT8 gubAdultFemalesAttackingTown;
|
extern UINT16 gubAdultFemalesAttackingTown;
|
||||||
extern UINT8 gubSectorIDOfCreatureAttack;
|
extern UINT8 gubSectorIDOfCreatureAttack;
|
||||||
enum{
|
enum{
|
||||||
CREATURE_BATTLE_CODE_NONE,
|
CREATURE_BATTLE_CODE_NONE,
|
||||||
@@ -53,15 +53,15 @@ enum {
|
|||||||
};
|
};
|
||||||
extern UINT8 guCreatureAttackType;
|
extern UINT8 guCreatureAttackType;
|
||||||
|
|
||||||
void DetermineCreatureTownComposition( UINT8 ubNumCreatures,
|
void DetermineCreatureTownComposition( UINT16 ubNumCreatures,
|
||||||
UINT8 *pubNumYoungMales, UINT8 *pubNumYoungFemales,
|
UINT16 *pubNumYoungMales, UINT16 *pubNumYoungFemales,
|
||||||
UINT8 *pubNumAdultMales, UINT8 *pubNumAdultFemales );
|
UINT16 *pubNumAdultMales, UINT16 *pubNumAdultFemales );
|
||||||
|
|
||||||
void DetermineCreatureTownCompositionBasedOnTacticalInformation( UINT8 *pubNumCreatures,
|
void DetermineCreatureTownCompositionBasedOnTacticalInformation( UINT16 *pubNumCreatures,
|
||||||
UINT8 *pubNumYoungMales, UINT8 *pubNumYoungFemales,
|
UINT16 *pubNumYoungMales, UINT16 *pubNumYoungFemales,
|
||||||
UINT8 *pubNumAdultMales, UINT8 *pubNumAdultFemales );
|
UINT16 *pubNumAdultMales, UINT16 *pubNumAdultFemales );
|
||||||
|
|
||||||
void DetermineOtherCreatureTownCompositionBasedOnTacticalInformation( UINT8* pubNumCreatures, UINT8* pubNumBloodcats, UINT8* pubNumZombies, UINT8* pubNumBandits );
|
void DetermineOtherCreatureTownCompositionBasedOnTacticalInformation( UINT16* pubNumCreatures, UINT16* pubNumBloodcats, UINT16* pubNumZombies, UINT16* pubNumBandits );
|
||||||
|
|
||||||
|
|
||||||
BOOLEAN PlayerGroupIsInACreatureInfestedMine();
|
BOOLEAN PlayerGroupIsInACreatureInfestedMine();
|
||||||
@@ -114,4 +114,4 @@ extern CREATURECOMPOSITION gCreatureComposition[ MAX_NUMBER_OF_CREATURE_COMPOSIT
|
|||||||
// Flugente: reset code for creature attacks
|
// Flugente: reset code for creature attacks
|
||||||
void ResetCreatureAttackVariables();
|
void ResetCreatureAttackVariables();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -357,7 +357,7 @@ void UpdateStrategicDetectionLevel( )
|
|||||||
// Run through list of player-characters
|
// Run through list of player-characters
|
||||||
while(gCharactersList[ubCounter].fValid)
|
while(gCharactersList[ubCounter].fValid)
|
||||||
{
|
{
|
||||||
pSoldier = MercPtrs[ gCharactersList[ ubCounter ].usSolID ];
|
pSoldier = gCharactersList[ ubCounter ].usSolID;
|
||||||
|
|
||||||
// Is character truly valid?
|
// Is character truly valid?
|
||||||
if( !( pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE ) &&
|
if( !( pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE ) &&
|
||||||
@@ -499,7 +499,7 @@ void UpdateSkyriderCostModifier()
|
|||||||
|
|
||||||
while(gCharactersList[ubCounter].fValid)
|
while(gCharactersList[ubCounter].fValid)
|
||||||
{
|
{
|
||||||
pSoldier = MercPtrs[ gCharactersList[ ubCounter ].usSolID ];
|
pSoldier = gCharactersList[ ubCounter ].usSolID;
|
||||||
|
|
||||||
// Is character truly valid?
|
// Is character truly valid?
|
||||||
if( !( pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE ) &&
|
if( !( pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE ) &&
|
||||||
@@ -562,7 +562,7 @@ void UpdateFacilityUsageCosts( )
|
|||||||
|
|
||||||
while(gCharactersList[ubCounter].fValid)
|
while(gCharactersList[ubCounter].fValid)
|
||||||
{
|
{
|
||||||
pSoldier = MercPtrs[ gCharactersList[ ubCounter ].usSolID ];
|
pSoldier = gCharactersList[ ubCounter ].usSolID;
|
||||||
|
|
||||||
// Is character truly valid?
|
// Is character truly valid?
|
||||||
if( !( pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE ) &&
|
if( !( pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE ) &&
|
||||||
@@ -704,7 +704,7 @@ INT32 MineIncomeModifierFromFacility( UINT8 ubMine )
|
|||||||
UINT8 ubCounter = 0;
|
UINT8 ubCounter = 0;
|
||||||
while (gCharactersList[ubCounter].fValid)
|
while (gCharactersList[ubCounter].fValid)
|
||||||
{
|
{
|
||||||
pSoldier = MercPtrs[ gCharactersList[ ubCounter ].usSolID ];
|
pSoldier = gCharactersList[ ubCounter ].usSolID;
|
||||||
|
|
||||||
// Is character truly valid?
|
// Is character truly valid?
|
||||||
if( !( pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE ) &&
|
if( !( pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE ) &&
|
||||||
@@ -1112,7 +1112,7 @@ void HandleHourlyRisks()
|
|||||||
|
|
||||||
while (gCharactersList[iCounter].fValid)
|
while (gCharactersList[iCounter].fValid)
|
||||||
{
|
{
|
||||||
pSoldier = MercPtrs[ gCharactersList[ iCounter ].usSolID ];
|
pSoldier = gCharactersList[ iCounter ].usSolID;
|
||||||
|
|
||||||
// Is character truly valid?
|
// Is character truly valid?
|
||||||
if( !( pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE ) &&
|
if( !( pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE ) &&
|
||||||
@@ -1994,7 +1994,7 @@ INT32 GetTotalFacilityHourlyCosts( BOOLEAN fPositive )
|
|||||||
// Run through list of player-characters
|
// Run through list of player-characters
|
||||||
while(gCharactersList[ubCounter].fValid)
|
while(gCharactersList[ubCounter].fValid)
|
||||||
{
|
{
|
||||||
pSoldier = MercPtrs[ gCharactersList[ ubCounter ].usSolID ];
|
pSoldier = gCharactersList[ ubCounter ].usSolID;
|
||||||
|
|
||||||
// Is character truly valid?
|
// Is character truly valid?
|
||||||
if( !( pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE ) &&
|
if( !( pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE ) &&
|
||||||
|
|||||||
@@ -225,7 +225,7 @@ BOOLEAN ExecuteStrategicEvent( STRATEGICEVENT *pEvent )
|
|||||||
//If a merc gets hired and they dont show up immediately, the merc gets added to the queue and shows up
|
//If a merc gets hired and they dont show up immediately, the merc gets added to the queue and shows up
|
||||||
// uiTimeTillMercArrives minutes later
|
// uiTimeTillMercArrives minutes later
|
||||||
case EVENT_DELAYED_HIRING_OF_MERC:
|
case EVENT_DELAYED_HIRING_OF_MERC:
|
||||||
MercArrivesCallback( (UINT8) pEvent->uiParam );
|
MercArrivesCallback( (UINT16) pEvent->uiParam );
|
||||||
break;
|
break;
|
||||||
//handles the life insurance contract for a merc from AIM.
|
//handles the life insurance contract for a merc from AIM.
|
||||||
case EVENT_HANDLE_INSURED_MERCS:
|
case EVENT_HANDLE_INSURED_MERCS:
|
||||||
@@ -233,7 +233,7 @@ BOOLEAN ExecuteStrategicEvent( STRATEGICEVENT *pEvent )
|
|||||||
break;
|
break;
|
||||||
//handles when a merc is killed an there is a life insurance payout
|
//handles when a merc is killed an there is a life insurance payout
|
||||||
case EVENT_PAY_LIFE_INSURANCE_FOR_DEAD_MERC:
|
case EVENT_PAY_LIFE_INSURANCE_FOR_DEAD_MERC:
|
||||||
InsuranceContractPayLifeInsuranceForDeadMerc( (UINT8) pEvent->uiParam );
|
InsuranceContractPayLifeInsuranceForDeadMerc( (UINT16) pEvent->uiParam );
|
||||||
break;
|
break;
|
||||||
//gets called every day at midnight.
|
//gets called every day at midnight.
|
||||||
case EVENT_MERC_DAILY_UPDATE:
|
case EVENT_MERC_DAILY_UPDATE:
|
||||||
@@ -251,14 +251,17 @@ BOOLEAN ExecuteStrategicEvent( STRATEGICEVENT *pEvent )
|
|||||||
break;
|
break;
|
||||||
//When a merc is supposed to leave
|
//When a merc is supposed to leave
|
||||||
case EVENT_MERC_CONTRACT_OVER:
|
case EVENT_MERC_CONTRACT_OVER:
|
||||||
MercsContractIsFinished( (UINT8) pEvent->uiParam );
|
MercsContractIsFinished( pEvent->uiParam );
|
||||||
break;
|
break;
|
||||||
case EVENT_ADDSOLDIER_TO_UPDATE_BOX:
|
case EVENT_ADDSOLDIER_TO_UPDATE_BOX:
|
||||||
|
{
|
||||||
// if the grunt is currently active, add to update box
|
// if the grunt is currently active, add to update box
|
||||||
if( Menptr[ pEvent->uiParam ].bActive )
|
SoldierID usID = pEvent->uiParam;
|
||||||
|
if ( usID != NOBODY && usID->bActive )
|
||||||
{
|
{
|
||||||
AddSoldierToWaitingListQueue( &( Menptr[ pEvent->uiParam ] ) );
|
AddSoldierToWaitingListQueue( usID );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case EVENT_SET_MENU_REASON:
|
case EVENT_SET_MENU_REASON:
|
||||||
AddReasonToWaitingListQueue( (UINT8) pEvent->uiParam );
|
AddReasonToWaitingListQueue( (UINT8) pEvent->uiParam );
|
||||||
@@ -392,10 +395,10 @@ BOOLEAN ExecuteStrategicEvent( STRATEGICEVENT *pEvent )
|
|||||||
HandleEnricoEmail();
|
HandleEnricoEmail();
|
||||||
break;
|
break;
|
||||||
case EVENT_INSURANCE_INVESTIGATION_STARTED:
|
case EVENT_INSURANCE_INVESTIGATION_STARTED:
|
||||||
StartInsuranceInvestigation( (UINT8) pEvent->uiParam );
|
StartInsuranceInvestigation( (UINT16) pEvent->uiParam );
|
||||||
break;
|
break;
|
||||||
case EVENT_INSURANCE_INVESTIGATION_OVER:
|
case EVENT_INSURANCE_INVESTIGATION_OVER:
|
||||||
EndInsuranceInvestigation( (UINT8) pEvent->uiParam );
|
EndInsuranceInvestigation( (UINT16) pEvent->uiParam );
|
||||||
break;
|
break;
|
||||||
case EVENT_TEMPERATURE_UPDATE:
|
case EVENT_TEMPERATURE_UPDATE:
|
||||||
UpdateTemperature( (UINT8) pEvent->uiParam );
|
UpdateTemperature( (UINT8) pEvent->uiParam );
|
||||||
@@ -429,7 +432,7 @@ BOOLEAN ExecuteStrategicEvent( STRATEGICEVENT *pEvent )
|
|||||||
BeginContractRenewalSequence( );
|
BeginContractRenewalSequence( );
|
||||||
break;
|
break;
|
||||||
case EVENT_RPC_WHINE_ABOUT_PAY:
|
case EVENT_RPC_WHINE_ABOUT_PAY:
|
||||||
RPCWhineAboutNoPay( (UINT8) pEvent->uiParam );
|
RPCWhineAboutNoPay( pEvent->uiParam );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EVENT_HAVENT_MADE_IMP_CHARACTER_EMAIL:
|
case EVENT_HAVENT_MADE_IMP_CHARACTER_EMAIL:
|
||||||
|
|||||||
+5
-10
@@ -842,19 +842,14 @@ fFirstTimeInMapScreen = TRUE;
|
|||||||
|
|
||||||
BOOLEAN AnyMercsHired( )
|
BOOLEAN AnyMercsHired( )
|
||||||
{
|
{
|
||||||
INT32 cnt;
|
// Find first guy available in team
|
||||||
SOLDIERTYPE *pTeamSoldier;
|
SoldierID id = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||||
INT16 bLastTeamID;
|
SoldierID bLastTeamID = gTacticalStatus.Team[ gbPlayerNum ].bLastID;
|
||||||
|
|
||||||
// Find first guy availible in team
|
|
||||||
cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
|
||||||
|
|
||||||
bLastTeamID = gTacticalStatus.Team[ gbPlayerNum ].bLastID;
|
|
||||||
|
|
||||||
// look for all mercs on the same team,
|
// look for all mercs on the same team,
|
||||||
for ( pTeamSoldier = MercPtrs[ cnt ]; cnt <= bLastTeamID; cnt++,pTeamSoldier++)
|
for ( ; id <= bLastTeamID; ++id)
|
||||||
{
|
{
|
||||||
if ( pTeamSoldier->bActive )
|
if ( id->bActive )
|
||||||
{
|
{
|
||||||
return( TRUE );
|
return( TRUE );
|
||||||
}
|
}
|
||||||
|
|||||||
+24
-24
@@ -366,18 +366,18 @@ UINT16 LarryItems[ NUM_LARRY_ITEMS ][ 3 ] =
|
|||||||
|
|
||||||
void HourlyLarryUpdate()
|
void HourlyLarryUpdate()
|
||||||
{
|
{
|
||||||
SOLDIERTYPE * pSoldier = NULL;
|
SOLDIERTYPE *pSoldier = NULL;
|
||||||
SOLDIERTYPE * pOtherSoldier = NULL;
|
SOLDIERTYPE *pOtherSoldier = NULL;
|
||||||
INT8 bSlot = NO_SLOT, bBoozeSlot;
|
INT8 bSlot = NO_SLOT, bBoozeSlot;
|
||||||
UINT16 usTemptation = 0;
|
UINT16 usTemptation = 0;
|
||||||
UINT16 usCashAmount;
|
UINT16 usCashAmount;
|
||||||
BOOLEAN fBar = FALSE;
|
BOOLEAN fBar = FALSE;
|
||||||
OBJECTTYPE* pObj = NULL;
|
OBJECTTYPE* pObj = NULL;
|
||||||
BOOLEAN fTookDrugs = FALSE;
|
BOOLEAN fTookDrugs = FALSE;
|
||||||
|
|
||||||
for( UINT32 cnt = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; cnt <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; ++cnt )
|
for( SoldierID id = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; id <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; ++id )
|
||||||
{
|
{
|
||||||
pSoldier = MercPtrs[ cnt ];
|
pSoldier = id;
|
||||||
|
|
||||||
if ( pSoldier && pSoldier->bActive && !pSoldier->flags.fMercAsleep && ( pSoldier->ubProfile == LARRY_NORMAL || pSoldier->ubProfile == LARRY_DRUNK || pSoldier->HasBackgroundFlag( BACKGROUND_DRUGUSE ) ) )
|
if ( pSoldier && pSoldier->bActive && !pSoldier->flags.fMercAsleep && ( pSoldier->ubProfile == LARRY_NORMAL || pSoldier->ubProfile == LARRY_DRUNK || pSoldier->HasBackgroundFlag( BACKGROUND_DRUGUSE ) ) )
|
||||||
{
|
{
|
||||||
@@ -489,9 +489,9 @@ void HourlyLarryUpdate()
|
|||||||
{
|
{
|
||||||
// anv: snitches stop mercs from getting wasted
|
// anv: snitches stop mercs from getting wasted
|
||||||
BOOLEAN fSnitchStoppedBehaviour = FALSE;
|
BOOLEAN fSnitchStoppedBehaviour = FALSE;
|
||||||
for( INT32 cnt2 = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; cnt2 <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; ++cnt2 )
|
for( SoldierID id2 = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; id2 <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; ++id2 )
|
||||||
{
|
{
|
||||||
pOtherSoldier = MercPtrs[ cnt2 ];
|
pOtherSoldier = id2;
|
||||||
// note - snitches stop others, but can get wasted themselves (if they have drug use specifically set in background...)
|
// note - snitches stop others, but can get wasted themselves (if they have drug use specifically set in background...)
|
||||||
if( pOtherSoldier && !pOtherSoldier->flags.fBetweenSectors && pOtherSoldier->bActive && !pOtherSoldier->flags.fMercAsleep && pSoldier->ubProfile != pOtherSoldier->ubProfile )
|
if( pOtherSoldier && !pOtherSoldier->flags.fBetweenSectors && pOtherSoldier->bActive && !pOtherSoldier->flags.fMercAsleep && pSoldier->ubProfile != pOtherSoldier->ubProfile )
|
||||||
{
|
{
|
||||||
@@ -617,12 +617,12 @@ void HourlyLarryUpdate()
|
|||||||
// Flugente: mercs that are smokers occasionally consume smokes if they have some in their inventory
|
// Flugente: mercs that are smokers occasionally consume smokes if they have some in their inventory
|
||||||
void HourlySmokerUpdate( )
|
void HourlySmokerUpdate( )
|
||||||
{
|
{
|
||||||
SOLDIERTYPE * pSoldier = NULL;
|
SOLDIERTYPE *pSoldier = NULL;
|
||||||
OBJECTTYPE* pObj = NULL;
|
OBJECTTYPE *pObj = NULL;
|
||||||
|
|
||||||
for ( UINT32 cnt = gTacticalStatus.Team[OUR_TEAM].bFirstID; cnt <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++cnt )
|
for ( SoldierID id = gTacticalStatus.Team[OUR_TEAM].bFirstID; id <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++id )
|
||||||
{
|
{
|
||||||
pSoldier = MercPtrs[cnt];
|
pSoldier = id;
|
||||||
|
|
||||||
if ( pSoldier && pSoldier->bActive && !pSoldier->flags.fMercAsleep )
|
if ( pSoldier && pSoldier->bActive && !pSoldier->flags.fMercAsleep )
|
||||||
{
|
{
|
||||||
@@ -652,9 +652,9 @@ void HourlyDisabilityUpdate( )
|
|||||||
SOLDIERTYPE* pSoldier = NULL;
|
SOLDIERTYPE* pSoldier = NULL;
|
||||||
SOLDIERTYPE* pOtherSoldier = NULL;
|
SOLDIERTYPE* pOtherSoldier = NULL;
|
||||||
|
|
||||||
for ( UINT32 cnt = gTacticalStatus.Team[OUR_TEAM].bFirstID; cnt <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++cnt )
|
for ( SoldierID id = gTacticalStatus.Team[OUR_TEAM].bFirstID; id <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++id )
|
||||||
{
|
{
|
||||||
pSoldier = MercPtrs[cnt];
|
pSoldier = id;
|
||||||
|
|
||||||
if ( pSoldier && pSoldier->bActive )
|
if ( pSoldier && pSoldier->bActive )
|
||||||
{
|
{
|
||||||
@@ -669,9 +669,9 @@ void HourlyDisabilityUpdate( )
|
|||||||
{
|
{
|
||||||
// anv: snitches stop mercs from getting wasted
|
// anv: snitches stop mercs from getting wasted
|
||||||
BOOLEAN fSnitchStoppedBehaviour = FALSE;
|
BOOLEAN fSnitchStoppedBehaviour = FALSE;
|
||||||
for ( INT32 cnt2 = gTacticalStatus.Team[OUR_TEAM].bFirstID; cnt2 <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++cnt2 )
|
for ( SoldierID id2 = gTacticalStatus.Team[OUR_TEAM].bFirstID; id2 <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++id2 )
|
||||||
{
|
{
|
||||||
pOtherSoldier = MercPtrs[cnt2];
|
pOtherSoldier = id2;
|
||||||
|
|
||||||
// note - snitches stop others, but can get wasted themselves (if they have drug use specifically set in background...)
|
// note - snitches stop others, but can get wasted themselves (if they have drug use specifically set in background...)
|
||||||
if ( pOtherSoldier && !pOtherSoldier->flags.fBetweenSectors && pOtherSoldier->bActive && !pOtherSoldier->flags.fMercAsleep && pSoldier->ubProfile != pOtherSoldier->ubProfile )
|
if ( pOtherSoldier && !pOtherSoldier->flags.fBetweenSectors && pOtherSoldier->bActive && !pOtherSoldier->flags.fMercAsleep && pSoldier->ubProfile != pOtherSoldier->ubProfile )
|
||||||
@@ -765,9 +765,9 @@ void HourlyStealUpdate()
|
|||||||
SOLDIERTYPE * pSoldier = NULL;
|
SOLDIERTYPE * pSoldier = NULL;
|
||||||
SOLDIERTYPE * pOtherSoldier = NULL;
|
SOLDIERTYPE * pOtherSoldier = NULL;
|
||||||
|
|
||||||
for( INT32 cnt = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; cnt <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; ++cnt )
|
for( SoldierID cnt = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; cnt <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; ++cnt )
|
||||||
{
|
{
|
||||||
pSoldier = MercPtrs[ cnt ];
|
pSoldier = cnt;
|
||||||
|
|
||||||
// merc must be alive, not travelling and awake. If he is in the currently loaded sector, we may not be in tactical (we would see an item suddenly disappearing) and not in combat
|
// merc must be alive, not travelling and awake. If he is in the currently loaded sector, we may not be in tactical (we would see an item suddenly disappearing) and not in combat
|
||||||
if ( pSoldier
|
if ( pSoldier
|
||||||
@@ -799,9 +799,9 @@ void HourlyStealUpdate()
|
|||||||
|
|
||||||
// anv: snitches prevent scrounging in the same sector
|
// anv: snitches prevent scrounging in the same sector
|
||||||
BOOLEAN fSnitchStoppedBehaviour = FALSE;
|
BOOLEAN fSnitchStoppedBehaviour = FALSE;
|
||||||
for ( UINT32 cnt2 = gTacticalStatus.Team[OUR_TEAM].bFirstID; cnt2 <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++cnt2 )
|
for ( SoldierID cnt2 = gTacticalStatus.Team[OUR_TEAM].bFirstID; cnt2 <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++cnt2 )
|
||||||
{
|
{
|
||||||
pOtherSoldier = MercPtrs[cnt2];
|
pOtherSoldier = cnt2;
|
||||||
|
|
||||||
// note - snitches stop others, but can scrounge themselves (if they have scrounging specifically set in background...)
|
// note - snitches stop others, but can scrounge themselves (if they have scrounging specifically set in background...)
|
||||||
if ( pOtherSoldier
|
if ( pOtherSoldier
|
||||||
|
|||||||
@@ -1247,7 +1247,6 @@ BOOLEAN LoadJa25SaveInfoFromSavedGame( HWFILE hFile )
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
gJa25SaveStruct.iPowerGenFanPositionSndID = -1;
|
|
||||||
|
|
||||||
return( TRUE );
|
return( TRUE );
|
||||||
}
|
}
|
||||||
|
|||||||
+6766
-8584
File diff suppressed because it is too large
Load Diff
@@ -33,7 +33,7 @@ extern UINT16 PROFILLUA_sSectorX;
|
|||||||
extern UINT16 PROFILLUA_sSectorY;
|
extern UINT16 PROFILLUA_sSectorY;
|
||||||
extern UINT8 PROFILLUA_bSectorZ;
|
extern UINT8 PROFILLUA_bSectorZ;
|
||||||
extern UINT8 PROFILLUA_Level;
|
extern UINT8 PROFILLUA_Level;
|
||||||
extern UINT8 PROFILLUA_ubID;
|
extern UINT16 PROFILLUA_ubID;
|
||||||
extern UINT32 PROFILLUA_sGridNo;
|
extern UINT32 PROFILLUA_sGridNo;
|
||||||
extern UINT8 PROFILLUA_ubDirectiono;
|
extern UINT8 PROFILLUA_ubDirectiono;
|
||||||
extern UINT8 PROFILLUA_bTeam;
|
extern UINT8 PROFILLUA_bTeam;
|
||||||
@@ -42,7 +42,7 @@ extern UINT8 PROFILLUA2_ubProfile;
|
|||||||
extern UINT16 PROFILLUA2_sSectorX;
|
extern UINT16 PROFILLUA2_sSectorX;
|
||||||
extern UINT16 PROFILLUA2_sSectorY;
|
extern UINT16 PROFILLUA2_sSectorY;
|
||||||
extern UINT8 PROFILLUA2_bSectorZ;
|
extern UINT8 PROFILLUA2_bSectorZ;
|
||||||
extern UINT8 PROFILLUA2_ubID;
|
extern UINT16 PROFILLUA2_ubID;
|
||||||
extern UINT32 PROFILLUA2_sGridNo;
|
extern UINT32 PROFILLUA2_sGridNo;
|
||||||
|
|
||||||
extern BOOLEAN LetHandleLoyaltyChangeForNPCAction(UINT8 ubNPCProfileId , UINT8 Init);
|
extern BOOLEAN LetHandleLoyaltyChangeForNPCAction(UINT8 ubNPCProfileId , UINT8 Init);
|
||||||
@@ -60,8 +60,9 @@ extern BOOLEAN LuaHandleQuestCodeOnSector( INT16 sSectorX, INT16 sSectorY, INT8
|
|||||||
//extern BOOLEAN LuaHandleQuestCodeOnSectorEntry( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ, UINT8 Init);
|
//extern BOOLEAN LuaHandleQuestCodeOnSectorEntry( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ, UINT8 Init);
|
||||||
|
|
||||||
void LuaHandleSectorLiberation( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ, BOOLEAN fFirstTime );
|
void LuaHandleSectorLiberation( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ, BOOLEAN fFirstTime );
|
||||||
void LuaHandleInteractiveActionResult( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ,
|
void LuaHandleInteractiveActionResult( INT16 sSectorX, INT16 sSectorY,
|
||||||
INT32 sGridNo, UINT8 bLevel, UINT8 ubId,
|
INT8 bSectorZ,
|
||||||
|
INT32 sGridNo, UINT8 bLevel, SoldierID ubId,
|
||||||
UINT16 usActionType, INT32 sLuaactionid, INT32 difficulty, UINT16 skill );
|
UINT16 usActionType, INT32 sLuaactionid, INT32 difficulty, UINT16 skill );
|
||||||
void LuaRecruitRPCAdditionalHandling( UINT8 usProfile );
|
void LuaRecruitRPCAdditionalHandling( UINT8 usProfile );
|
||||||
void LuaHandleSectorTacticalEntry( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ, BOOLEAN fHasEverBeenPlayerControlled );
|
void LuaHandleSectorTacticalEntry( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ, BOOLEAN fHasEverBeenPlayerControlled );
|
||||||
|
|||||||
@@ -72,7 +72,7 @@
|
|||||||
#define HELICOPTER_RETURN_REASON_DAMAGE 2
|
#define HELICOPTER_RETURN_REASON_DAMAGE 2
|
||||||
|
|
||||||
extern FACETYPE *gpCurrentTalkingFace;
|
extern FACETYPE *gpCurrentTalkingFace;
|
||||||
extern UINT8 gubCurrentTalkingID;
|
extern UINT16 gubCurrentTalkingID;
|
||||||
|
|
||||||
// current temp path for dest char
|
// current temp path for dest char
|
||||||
extern PathStPtr pTempHelicopterPath;
|
extern PathStPtr pTempHelicopterPath;
|
||||||
|
|||||||
@@ -1562,7 +1562,7 @@ void DisplayCurrentBalanceTitleForMapBottom( void )
|
|||||||
void DisplayCurrentBalanceForMapBottom( void )
|
void DisplayCurrentBalanceForMapBottom( void )
|
||||||
{
|
{
|
||||||
// show the current balance for the player on the map panel bottom
|
// show the current balance for the player on the map panel bottom
|
||||||
CHAR16 sString[ 128 ];
|
std::wstring sString;
|
||||||
INT16 sFontX, sFontY;
|
INT16 sFontX, sFontY;
|
||||||
|
|
||||||
// ste the font buffer
|
// ste the font buffer
|
||||||
@@ -1573,22 +1573,18 @@ void DisplayCurrentBalanceForMapBottom( void )
|
|||||||
SetFontForeground( 183 );
|
SetFontForeground( 183 );
|
||||||
SetFontBackground( FONT_BLACK );
|
SetFontBackground( FONT_BLACK );
|
||||||
|
|
||||||
swprintf( sString, L"%d", LaptopSaveInfo.iCurrentBalance );
|
sString = FormatMoney( LaptopSaveInfo.iCurrentBalance );
|
||||||
|
|
||||||
// insert
|
|
||||||
InsertCommasForDollarFigure( sString );
|
|
||||||
InsertDollarSignInToString( sString );
|
|
||||||
|
|
||||||
VarFindFontCenterCoordinates(
|
VarFindFontCenterCoordinates(
|
||||||
UI_BOTTOM.Text.CurrentBalance.x,
|
UI_BOTTOM.Text.CurrentBalance.x,
|
||||||
UI_BOTTOM.Text.CurrentBalance.y,
|
UI_BOTTOM.Text.CurrentBalance.y,
|
||||||
UI_BOTTOM.Text.CurrentBalance.width,
|
UI_BOTTOM.Text.CurrentBalance.width,
|
||||||
UI_BOTTOM.Text.CurrentBalance.height,
|
UI_BOTTOM.Text.CurrentBalance.height,
|
||||||
COMPFONT, &sFontX, &sFontY, sString
|
COMPFONT, &sFontX, &sFontY, sString.data()
|
||||||
);
|
);
|
||||||
|
|
||||||
// print it
|
// print it
|
||||||
mprintf( sFontX, sFontY, L"%s", sString );
|
mprintf( sFontX, sFontY, L"%s", sString.data() );
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1667,7 +1663,7 @@ void DisplayProjectedDailyMineIncome( void )
|
|||||||
{
|
{
|
||||||
INT32 iRate = 0;
|
INT32 iRate = 0;
|
||||||
static INT32 iOldRate = -1;
|
static INT32 iOldRate = -1;
|
||||||
CHAR16 sString[ 128 ];
|
std::wstring sString;
|
||||||
INT16 sFontX, sFontY;
|
INT16 sFontX, sFontY;
|
||||||
|
|
||||||
// grab the rate from the financial system
|
// grab the rate from the financial system
|
||||||
@@ -1692,22 +1688,18 @@ void DisplayProjectedDailyMineIncome( void )
|
|||||||
SetFontForeground( 183 );
|
SetFontForeground( 183 );
|
||||||
SetFontBackground( FONT_BLACK );
|
SetFontBackground( FONT_BLACK );
|
||||||
|
|
||||||
swprintf( sString, L"%d", iRate );
|
sString = FormatMoney( iRate );
|
||||||
|
|
||||||
// insert
|
|
||||||
InsertCommasForDollarFigure( sString );
|
|
||||||
InsertDollarSignInToString( sString );
|
|
||||||
|
|
||||||
VarFindFontCenterCoordinates(
|
VarFindFontCenterCoordinates(
|
||||||
UI_BOTTOM.Text.CurrentIncome.x,
|
UI_BOTTOM.Text.CurrentIncome.x,
|
||||||
UI_BOTTOM.Text.CurrentIncome.y,
|
UI_BOTTOM.Text.CurrentIncome.y,
|
||||||
UI_BOTTOM.Text.CurrentIncome.width,
|
UI_BOTTOM.Text.CurrentIncome.width,
|
||||||
UI_BOTTOM.Text.CurrentIncome.height,
|
UI_BOTTOM.Text.CurrentIncome.height,
|
||||||
COMPFONT, &sFontX, &sFontY, sString
|
COMPFONT, &sFontX, &sFontY, sString.data()
|
||||||
);
|
);
|
||||||
|
|
||||||
// print it
|
// print it
|
||||||
mprintf( sFontX, sFontY, L"%s", sString );
|
mprintf( sFontX, sFontY, L"%s", sString.data() );
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1716,7 +1708,6 @@ void DisplayProjectedDailyExpenses( void )
|
|||||||
{
|
{
|
||||||
INT32 iRate = 0;
|
INT32 iRate = 0;
|
||||||
static INT32 iOldExpensesRate = -1;
|
static INT32 iOldExpensesRate = -1;
|
||||||
CHAR16 sString[ 128 ];
|
|
||||||
INT16 sFontX, sFontY;
|
INT16 sFontX, sFontY;
|
||||||
|
|
||||||
// grab the rate from the financial system
|
// grab the rate from the financial system
|
||||||
@@ -1749,22 +1740,18 @@ void DisplayProjectedDailyExpenses( void )
|
|||||||
}
|
}
|
||||||
SetFontBackground( FONT_BLACK );
|
SetFontBackground( FONT_BLACK );
|
||||||
|
|
||||||
swprintf( sString, L"%d", iRate );
|
auto rate{FormatMoney(iRate)};
|
||||||
|
|
||||||
// insert extra characters
|
|
||||||
InsertCommasForDollarFigure( sString );
|
|
||||||
InsertDollarSignInToString( sString );
|
|
||||||
|
|
||||||
VarFindFontCenterCoordinates(
|
VarFindFontCenterCoordinates(
|
||||||
UI_BOTTOM.Text.CurrentExpenses.x,
|
UI_BOTTOM.Text.CurrentExpenses.x,
|
||||||
UI_BOTTOM.Text.CurrentExpenses.y,
|
UI_BOTTOM.Text.CurrentExpenses.y,
|
||||||
UI_BOTTOM.Text.CurrentExpenses.width,
|
UI_BOTTOM.Text.CurrentExpenses.width,
|
||||||
UI_BOTTOM.Text.CurrentExpenses.height,
|
UI_BOTTOM.Text.CurrentExpenses.height,
|
||||||
COMPFONT, &sFontX, &sFontY, sString
|
COMPFONT, &sFontX, &sFontY, rate.data()
|
||||||
);
|
);
|
||||||
|
|
||||||
// print it
|
// print it
|
||||||
mprintf( sFontX, sFontY, L"%s", sString );
|
mprintf( sFontX, sFontY, L"%s", rate.data());
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -2070,7 +2057,14 @@ void HandleExitsFromMapScreen( void )
|
|||||||
#ifdef JA2UB
|
#ifdef JA2UB
|
||||||
//JA25 ub
|
//JA25 ub
|
||||||
case MAP_EXIT_TO_INTRO_SCREEN:
|
case MAP_EXIT_TO_INTRO_SCREEN:
|
||||||
// SetPendingNewScreen( INTRO_SCREEN );
|
// SetPendingNewScreen( INTRO_SCREEN );
|
||||||
|
// Set the PBI sector locator to initial arrival sector.
|
||||||
|
// UB skips the call to HandleTimeCompressWithTeamJackedInAndGearedToGo() that would normally set it upon game start
|
||||||
|
// When it's not set, the MapscreenHandle() will error on assert when trying to draw the glowing red box around the sector under attack
|
||||||
|
gubPBSectorX = gGameExternalOptions.ubDefaultArrivalSectorX;
|
||||||
|
gubPBSectorY = gGameExternalOptions.ubDefaultArrivalSectorY;
|
||||||
|
gubPBSectorZ = 0;
|
||||||
|
|
||||||
BeginLoadScreen();
|
BeginLoadScreen();
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -201,7 +201,7 @@ INT32 iCurrentInventoryPoolPage = 0;
|
|||||||
INT32 iLastInventoryPoolPage = 0;
|
INT32 iLastInventoryPoolPage = 0;
|
||||||
|
|
||||||
INT32 sObjectSourceGridNo = -1;//shadooow: I don't see much of a sense in this, we have gpItemPointerSoldier and we can use gpItemPointerSoldier->sGridNo to do this, this is actually unused
|
INT32 sObjectSourceGridNo = -1;//shadooow: I don't see much of a sense in this, we have gpItemPointerSoldier and we can use gpItemPointerSoldier->sGridNo to do this, this is actually unused
|
||||||
INT8 sObjectSourseSoldierID = -1;
|
SoldierID sObjectSourseSoldierID = NOBODY;
|
||||||
|
|
||||||
// number of unseen items in sector
|
// number of unseen items in sector
|
||||||
UINT32 uiNumberOfUnSeenItems = 0;
|
UINT32 uiNumberOfUnSeenItems = 0;
|
||||||
@@ -683,9 +683,9 @@ BOOLEAN RenderItemInPoolSlot( INT32 iCurrentSlot, INT32 iFirstSlotOnPage )
|
|||||||
// if the item is not reachable, or if the selected merc is not in the current sector
|
// if the item is not reachable, or if the selected merc is not in the current sector
|
||||||
//
|
//
|
||||||
if( !( pInventoryPoolList[ iCurrentSlot + iFirstSlotOnPage ].usFlags & WORLD_ITEM_REACHABLE ) ||
|
if( !( pInventoryPoolList[ iCurrentSlot + iFirstSlotOnPage ].usFlags & WORLD_ITEM_REACHABLE ) ||
|
||||||
!(( Menptr[ gCharactersList[ bSelectedInfoChar ].usSolID ].sSectorX == sSelMapX ) &&
|
!(( gCharactersList[ bSelectedInfoChar ].usSolID->sSectorX == sSelMapX ) &&
|
||||||
( Menptr[ gCharactersList[ bSelectedInfoChar ].usSolID ].sSectorY == sSelMapY ) &&
|
( gCharactersList[ bSelectedInfoChar ].usSolID->sSectorY == sSelMapY ) &&
|
||||||
( Menptr[ gCharactersList[ bSelectedInfoChar ].usSolID ].bSectorZ == iCurrentMapSectorZ )
|
( gCharactersList[ bSelectedInfoChar ].usSolID->bSectorZ == iCurrentMapSectorZ )
|
||||||
) )
|
) )
|
||||||
{
|
{
|
||||||
//Shade the item, but only if it is an active item!
|
//Shade the item, but only if it is an active item!
|
||||||
@@ -1180,7 +1180,6 @@ void CreateMapInventoryPoolSlots( )
|
|||||||
INT16 sXA = 0, sYA = 0;
|
INT16 sXA = 0, sYA = 0;
|
||||||
INT16 sULX = 0, sULY = 0;
|
INT16 sULX = 0, sULY = 0;
|
||||||
INT16 sBRX = 0, sBRY = 0;
|
INT16 sBRX = 0, sBRY = 0;
|
||||||
extern MOUSE_REGION gMapViewRegion;
|
|
||||||
//Moa: removed MapInventoryPoolMask, instead we disable map mouseregion and enable again when deleting stash regions
|
//Moa: removed MapInventoryPoolMask, instead we disable map mouseregion and enable again when deleting stash regions
|
||||||
MSYS_DisableRegion( &gMapViewRegion );
|
MSYS_DisableRegion( &gMapViewRegion );
|
||||||
//MSYS_DefineRegion( &MapInventoryPoolMask,
|
//MSYS_DefineRegion( &MapInventoryPoolMask,
|
||||||
@@ -1217,7 +1216,6 @@ void CreateMapInventoryPoolSlots( )
|
|||||||
void DestroyMapInventoryPoolSlots( void )
|
void DestroyMapInventoryPoolSlots( void )
|
||||||
{
|
{
|
||||||
INT32 iCounter = 0;
|
INT32 iCounter = 0;
|
||||||
extern MOUSE_REGION gMapViewRegion;
|
|
||||||
|
|
||||||
for( iCounter = 0; iCounter < MAP_INVENTORY_POOL_SLOT_COUNT; iCounter++ )
|
for( iCounter = 0; iCounter < MAP_INVENTORY_POOL_SLOT_COUNT; iCounter++ )
|
||||||
{
|
{
|
||||||
@@ -1351,7 +1349,6 @@ void MapInvenPoolSlots(MOUSE_REGION * pRegion, INT32 iReason )
|
|||||||
UINT16 usOldItemIndex, usNewItemIndex;
|
UINT16 usOldItemIndex, usNewItemIndex;
|
||||||
INT32 iOldNumberOfObjects = 0;
|
INT32 iOldNumberOfObjects = 0;
|
||||||
INT16 sDistanceFromObject = 0;
|
INT16 sDistanceFromObject = 0;
|
||||||
SOLDIERTYPE *pSoldier = NULL;
|
|
||||||
CHAR16 sString[ 128 ];
|
CHAR16 sString[ 128 ];
|
||||||
extern OBJECTTYPE *gpItemDescObject;
|
extern OBJECTTYPE *gpItemDescObject;
|
||||||
|
|
||||||
@@ -1370,11 +1367,16 @@ void MapInvenPoolSlots(MOUSE_REGION * pRegion, INT32 iReason )
|
|||||||
{
|
{
|
||||||
//CHRISL: Make it possible to right click and pull up stack popup and/or item description boxes
|
//CHRISL: Make it possible to right click and pull up stack popup and/or item description boxes
|
||||||
WORLDITEM * twItem = &(pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCounter ]);
|
WORLDITEM * twItem = &(pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCounter ]);
|
||||||
bool fValidPointer = false;
|
bool fValidPointer = false;
|
||||||
|
|
||||||
//CHRISL: Try to update InSector value so we don't have to "activate" a sector
|
//CHRISL: Try to update InSector value so we don't have to "activate" a sector
|
||||||
if(MercPtrs[gCharactersList[bSelectedInfoChar].usSolID]->sSectorX == sSelMapX && MercPtrs[gCharactersList[bSelectedInfoChar].usSolID]->sSectorY == sSelMapY && MercPtrs[gCharactersList[bSelectedInfoChar].usSolID]->bSectorZ == iCurrentMapSectorZ && !MercPtrs[gCharactersList[bSelectedInfoChar].usSolID]->flags.fBetweenSectors)
|
SOLDIERTYPE* pSelectedSoldier = gCharactersList[bSelectedInfoChar].usSolID;
|
||||||
|
const auto x = pSelectedSoldier->sSectorX;
|
||||||
|
const auto y = pSelectedSoldier->sSectorY;
|
||||||
|
const auto z = pSelectedSoldier->bSectorZ;
|
||||||
|
if(x == sSelMapX && y == sSelMapY && z == iCurrentMapSectorZ && !pSelectedSoldier->flags.fBetweenSectors)
|
||||||
{
|
{
|
||||||
MercPtrs[gCharactersList[bSelectedInfoChar].usSolID]->bInSector=TRUE;
|
pSelectedSoldier->bInSector = TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1388,7 +1390,7 @@ void MapInvenPoolSlots(MOUSE_REGION * pRegion, INT32 iReason )
|
|||||||
}
|
}
|
||||||
if ( !InSectorStackPopup( ) && !InItemStackPopup( ) /*&& !InItemDescriptionBox( ) */ && !InKeyRingPopup( ) && twItem->object.exists() == true && (bSelectedInfoChar != -1 && gCharactersList[bSelectedInfoChar].fValid) )
|
if ( !InSectorStackPopup( ) && !InItemStackPopup( ) /*&& !InItemDescriptionBox( ) */ && !InKeyRingPopup( ) && twItem->object.exists() == true && (bSelectedInfoChar != -1 && gCharactersList[bSelectedInfoChar].fValid) )
|
||||||
{
|
{
|
||||||
if(OK_CONTROL_MERC( MercPtrs[gCharactersList[bSelectedInfoChar].usSolID] ))
|
if(OK_CONTROL_MERC( pSelectedSoldier ))
|
||||||
{
|
{
|
||||||
//CHRISL: The old setup had a flaw I didn't consider. if, for some reason, the ItemSlotLimit = 0
|
//CHRISL: The old setup had a flaw I didn't consider. if, for some reason, the ItemSlotLimit = 0
|
||||||
// nothing might happen. Now we setup a flag to determine if our cursor is value for the item we're
|
// nothing might happen. Now we setup a flag to determine if our cursor is value for the item we're
|
||||||
@@ -1474,7 +1476,7 @@ void MapInvenPoolSlots(MOUSE_REGION * pRegion, INT32 iReason )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// HEADROCK HAM 5: Sector Inventory Item Desc Box no longer accessible during combat.
|
// HEADROCK HAM 5: Sector Inventory Item Desc Box no longer accessible during combat.
|
||||||
if( !CanPlayerUseSectorInventory( &(Menptr[ gCharactersList[ bSelectedInfoChar ].usSolID ]) ) )
|
if( !CanPlayerUseSectorInventory(pSelectedSoldier) )
|
||||||
{
|
{
|
||||||
DoScreenIndependantMessageBox( New113HAMMessage[ 22 ], MSG_BOX_FLAG_OK, NULL );
|
DoScreenIndependantMessageBox( New113HAMMessage[ 22 ], MSG_BOX_FLAG_OK, NULL );
|
||||||
return;
|
return;
|
||||||
@@ -1484,23 +1486,23 @@ void MapInvenPoolSlots(MOUSE_REGION * pRegion, INT32 iReason )
|
|||||||
if ( _KeyDown(SHIFT) && gpItemPointer == NULL && Item[twItem->object.usItem].usItemClass == IC_GUN && (twItem->object)[0]->data.gun.ubGunShotsLeft && !ItemIsSingleShotRocketLauncher(twItem->object.usItem))
|
if ( _KeyDown(SHIFT) && gpItemPointer == NULL && Item[twItem->object.usItem].usItemClass == IC_GUN && (twItem->object)[0]->data.gun.ubGunShotsLeft && !ItemIsSingleShotRocketLauncher(twItem->object.usItem))
|
||||||
{
|
{
|
||||||
EmptyWeaponMagazine( &twItem->object, &gItemPointer );
|
EmptyWeaponMagazine( &twItem->object, &gItemPointer );
|
||||||
InternalMAPBeginItemPointer( MercPtrs[gCharactersList[bSelectedInfoChar].usSolID] );
|
InternalMAPBeginItemPointer( pSelectedSoldier );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
MAPInternalInitItemDescriptionBox( &twItem->object, 0, MercPtrs[gCharactersList[bSelectedInfoChar].usSolID] );
|
MAPInternalInitItemDescriptionBox( &twItem->object, 0, pSelectedSoldier );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(fValidPointer)
|
else if(fValidPointer)
|
||||||
{
|
{
|
||||||
// Sector Inventory Stack Popup no longer accessible during combat.
|
// Sector Inventory Stack Popup no longer accessible during combat.
|
||||||
if( !CanPlayerUseSectorInventory( &(Menptr[ gCharactersList[ bSelectedInfoChar ].usSolID ]) ) )
|
if( !CanPlayerUseSectorInventory(pSelectedSoldier) )
|
||||||
{
|
{
|
||||||
DoScreenIndependantMessageBox( New113HAMMessage[ 22 ], MSG_BOX_FLAG_OK, NULL );
|
DoScreenIndependantMessageBox( New113HAMMessage[ 22 ], MSG_BOX_FLAG_OK, NULL );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
InitSectorStackPopup( MercPtrs[gCharactersList[bSelectedInfoChar].usSolID], twItem, iCounter, xResOffset, yResOffset - 10, 261, ( SCREEN_HEIGHT - PLAYER_INFO_Y ) );
|
InitSectorStackPopup( pSelectedSoldier, twItem, iCounter, xResOffset, yResOffset - 10, 261, ( SCREEN_HEIGHT - PLAYER_INFO_Y ) );
|
||||||
fTeamPanelDirty=TRUE;
|
fTeamPanelDirty=TRUE;
|
||||||
fInterfacePanelDirty = DIRTYLEVEL2;
|
fInterfacePanelDirty = DIRTYLEVEL2;
|
||||||
}
|
}
|
||||||
@@ -1597,11 +1599,13 @@ void MapInvenPoolSlots(MOUSE_REGION * pRegion, INT32 iReason )
|
|||||||
|
|
||||||
//if( fShowInventoryFlag )
|
//if( fShowInventoryFlag )
|
||||||
{
|
{
|
||||||
|
SOLDIERTYPE* pSelectedSoldier = gCharactersList[bSelectedInfoChar].usSolID;
|
||||||
|
|
||||||
// not in sector?
|
// not in sector?
|
||||||
if( ( Menptr[ gCharactersList[ bSelectedInfoChar ].usSolID ].sSectorX != sSelMapX ) ||
|
if( ( pSelectedSoldier->sSectorX != sSelMapX ) ||
|
||||||
( Menptr[ gCharactersList[ bSelectedInfoChar ].usSolID ].sSectorY != sSelMapY ) ||
|
( pSelectedSoldier->sSectorY != sSelMapY ) ||
|
||||||
( Menptr[ gCharactersList[ bSelectedInfoChar ].usSolID ].bSectorZ != iCurrentMapSectorZ ) ||
|
( pSelectedSoldier->bSectorZ != iCurrentMapSectorZ ) ||
|
||||||
( Menptr[ gCharactersList[ bSelectedInfoChar ].usSolID ].flags.fBetweenSectors ) )
|
( pSelectedSoldier->flags.fBetweenSectors ) )
|
||||||
{
|
{
|
||||||
if ( gpItemPointer == NULL )
|
if ( gpItemPointer == NULL )
|
||||||
{
|
{
|
||||||
@@ -1633,13 +1637,13 @@ void MapInvenPoolSlots(MOUSE_REGION * pRegion, INT32 iReason )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
swprintf( sString, pMapInventoryErrorString[ 2 ], Menptr[ gCharactersList[ bSelectedInfoChar ].usSolID ].name );
|
swprintf( sString, pMapInventoryErrorString[ 2 ], pSelectedSoldier->name );
|
||||||
DoMapMessageBox( MSG_BOX_BASIC_STYLE, sString, MAP_SCREEN, MSG_BOX_FLAG_OK, NULL );
|
DoMapMessageBox( MSG_BOX_BASIC_STYLE, sString, MAP_SCREEN, MSG_BOX_FLAG_OK, NULL );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
swprintf( sString, pMapInventoryErrorString[ 5 ], Menptr[ gCharactersList[ bSelectedInfoChar ].usSolID ].name );
|
swprintf( sString, pMapInventoryErrorString[ 5 ], pSelectedSoldier->name );
|
||||||
DoMapMessageBox( MSG_BOX_BASIC_STYLE, sString, MAP_SCREEN, MSG_BOX_FLAG_OK, NULL );
|
DoMapMessageBox( MSG_BOX_BASIC_STYLE, sString, MAP_SCREEN, MSG_BOX_FLAG_OK, NULL );
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@@ -1650,6 +1654,7 @@ void MapInvenPoolSlots(MOUSE_REGION * pRegion, INT32 iReason )
|
|||||||
// If we do not have an item in hand, start moving it
|
// If we do not have an item in hand, start moving it
|
||||||
if ( gpItemPointer == NULL )
|
if ( gpItemPointer == NULL )
|
||||||
{
|
{
|
||||||
|
SOLDIERTYPE* pSelectedSoldier = gCharactersList[bSelectedInfoChar].usSolID;
|
||||||
|
|
||||||
|
|
||||||
// Return if empty
|
// Return if empty
|
||||||
@@ -1658,7 +1663,7 @@ void MapInvenPoolSlots(MOUSE_REGION * pRegion, INT32 iReason )
|
|||||||
|
|
||||||
// if in battle inform player they will have to do this in tactical
|
// if in battle inform player they will have to do this in tactical
|
||||||
// if( ( ( gTacticalStatus.fEnemyInSector ) ||( ( sSelMapX == gWorldSectorX ) && ( sSelMapY == gWorldSectorY ) && ( iCurrentMapSectorZ == gbWorldSectorZ ) && ( gTacticalStatus.uiFlags & INCOMBAT ) ) ) )
|
// if( ( ( gTacticalStatus.fEnemyInSector ) ||( ( sSelMapX == gWorldSectorX ) && ( sSelMapY == gWorldSectorY ) && ( iCurrentMapSectorZ == gbWorldSectorZ ) && ( gTacticalStatus.uiFlags & INCOMBAT ) ) ) )
|
||||||
if( !CanPlayerUseSectorInventory( &Menptr[ gCharactersList[ bSelectedInfoChar ].usSolID ] ) )
|
if( !CanPlayerUseSectorInventory(pSelectedSoldier) )
|
||||||
{
|
{
|
||||||
DoMapMessageBox( MSG_BOX_BASIC_STYLE, pMapInventoryErrorString[ 3 ], MAP_SCREEN, MSG_BOX_FLAG_OK, NULL );
|
DoMapMessageBox( MSG_BOX_BASIC_STYLE, pMapInventoryErrorString[ 3 ], MAP_SCREEN, MSG_BOX_FLAG_OK, NULL );
|
||||||
return;
|
return;
|
||||||
@@ -1673,14 +1678,13 @@ void MapInvenPoolSlots(MOUSE_REGION * pRegion, INT32 iReason )
|
|||||||
if( ( sSelMapX == gWorldSectorX )&&( gWorldSectorY == sSelMapY ) &&(gbWorldSectorZ == iCurrentMapSectorZ ) )
|
if( ( sSelMapX == gWorldSectorX )&&( gWorldSectorY == sSelMapY ) &&(gbWorldSectorZ == iCurrentMapSectorZ ) )
|
||||||
{
|
{
|
||||||
// notify
|
// notify
|
||||||
pSoldier = &( Menptr[ gCharactersList[ bSelectedInfoChar ].usSolID ] );
|
|
||||||
|
|
||||||
sDistanceFromObject = PythSpacesAway( sObjectSourceGridNo, pSoldier->sGridNo);
|
sDistanceFromObject = PythSpacesAway( sObjectSourceGridNo, pSelectedSoldier->sGridNo);
|
||||||
|
|
||||||
/* if( sDistanceFromObject > MAX_DISTANCE_TO_PICKUP_ITEM )
|
/* if( sDistanceFromObject > MAX_DISTANCE_TO_PICKUP_ITEM )
|
||||||
{
|
{
|
||||||
// see for the loaded sector if the merc is cloase enough?
|
// see for the loaded sector if the merc is cloase enough?
|
||||||
swprintf( sString, pMapInventoryErrorString[ 0 ], Menptr[ gCharactersList[ bSelectedInfoChar ].usSolID ].name );
|
swprintf( sString, pMapInventoryErrorString[ 0 ], pSelectedSoldier->name );
|
||||||
DoMapMessageBox( MSG_BOX_BASIC_STYLE, sString, MAP_SCREEN, MSG_BOX_FLAG_OK, NULL );
|
DoMapMessageBox( MSG_BOX_BASIC_STYLE, sString, MAP_SCREEN, MSG_BOX_FLAG_OK, NULL );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1718,10 +1722,11 @@ void MapInvenPoolSlots(MOUSE_REGION * pRegion, INT32 iReason )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{//we have an item on cursor
|
{//we have an item on cursor
|
||||||
|
SOLDIERTYPE* pSelectedSoldier = gCharactersList[bSelectedInfoChar].usSolID;
|
||||||
|
|
||||||
// if in battle inform player they will have to do this in tactical
|
// if in battle inform player they will have to do this in tactical
|
||||||
// if( ( gTacticalStatus.fEnemyInSector ) ||( ( sSelMapX == gWorldSectorX ) && ( sSelMapY == gWorldSectorY ) && ( iCurrentMapSectorZ == gbWorldSectorZ ) && ( gTacticalStatus.uiFlags & INCOMBAT ) ) )
|
// if( ( gTacticalStatus.fEnemyInSector ) ||( ( sSelMapX == gWorldSectorX ) && ( sSelMapY == gWorldSectorY ) && ( iCurrentMapSectorZ == gbWorldSectorZ ) && ( gTacticalStatus.uiFlags & INCOMBAT ) ) )
|
||||||
if( !CanPlayerUseSectorInventory( &Menptr[ gCharactersList[ bSelectedInfoChar ].usSolID ] ) )
|
if( !CanPlayerUseSectorInventory(pSelectedSoldier) )
|
||||||
{
|
{
|
||||||
DoMapMessageBox( MSG_BOX_BASIC_STYLE, pMapInventoryErrorString[ 4 ], MAP_SCREEN, MSG_BOX_FLAG_OK, NULL );
|
DoMapMessageBox( MSG_BOX_BASIC_STYLE, pMapInventoryErrorString[ 4 ], MAP_SCREEN, MSG_BOX_FLAG_OK, NULL );
|
||||||
return;
|
return;
|
||||||
@@ -1795,7 +1800,7 @@ void MapInvenPoolSlots(MOUSE_REGION * pRegion, INT32 iReason )
|
|||||||
/*
|
/*
|
||||||
if ( fShowInventoryFlag && bSelectedInfoChar >= 0 )
|
if ( fShowInventoryFlag && bSelectedInfoChar >= 0 )
|
||||||
{
|
{
|
||||||
ReevaluateItemHatches( MercPtrs[ gCharactersList[ bSelectedInfoChar ].usSolID ], FALSE );
|
ReevaluateItemHatches( gCharactersList[ bSelectedInfoChar ].usSolID, FALSE );
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
@@ -2471,7 +2476,7 @@ void BeginInventoryPoolPtr( OBJECTTYPE *pInventorySlot )
|
|||||||
|
|
||||||
if ( _KeyDown ( CTRL ))//MM: Pass item to selected merc. Delete if none selected.
|
if ( _KeyDown ( CTRL ))//MM: Pass item to selected merc. Delete if none selected.
|
||||||
{
|
{
|
||||||
SOLDIERTYPE *pSoldier = &Menptr[ gCharactersList[ bSelectedInfoChar ].usSolID ];
|
SOLDIERTYPE *pSoldier = gCharactersList[ bSelectedInfoChar ].usSolID;
|
||||||
bool placedAllObjects = false;
|
bool placedAllObjects = false;
|
||||||
|
|
||||||
if(pSoldier->exists() == true)
|
if(pSoldier->exists() == true)
|
||||||
@@ -2575,7 +2580,7 @@ void BeginInventoryPoolPtr( OBJECTTYPE *pInventorySlot )
|
|||||||
|
|
||||||
if ( fShowInventoryFlag && bSelectedInfoChar >= 0 )
|
if ( fShowInventoryFlag && bSelectedInfoChar >= 0 )
|
||||||
{
|
{
|
||||||
ReevaluateItemHatches( MercPtrs[ gCharactersList[ bSelectedInfoChar ].usSolID ], FALSE );
|
ReevaluateItemHatches( gCharactersList[ bSelectedInfoChar ].usSolID, FALSE );
|
||||||
fTeamPanelDirty = TRUE;
|
fTeamPanelDirty = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2643,7 +2648,7 @@ void BeginInventoryPoolPtr( OBJECTTYPE *pInventorySlot )
|
|||||||
|
|
||||||
if ( fShowInventoryFlag && bSelectedInfoChar >= 0 )
|
if ( fShowInventoryFlag && bSelectedInfoChar >= 0 )
|
||||||
{
|
{
|
||||||
ReevaluateItemHatches( MercPtrs[ gCharactersList[ bSelectedInfoChar ].usSolID ], FALSE );
|
ReevaluateItemHatches( gCharactersList[ bSelectedInfoChar ].usSolID, FALSE );
|
||||||
fTeamPanelDirty = TRUE;
|
fTeamPanelDirty = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2660,7 +2665,7 @@ BOOLEAN PlaceObjectInInventoryStash( OBJECTTYPE *pInventorySlot, OBJECTTYPE *pIt
|
|||||||
// anv: swap ownerships too
|
// anv: swap ownerships too
|
||||||
if( pInventoryPoolList[ iSrcSlot ].soldierID == sObjectSourseSoldierID )
|
if( pInventoryPoolList[ iSrcSlot ].soldierID == sObjectSourseSoldierID )
|
||||||
{
|
{
|
||||||
pInventoryPoolList[ iSrcSlot ].soldierID = (-1);
|
pInventoryPoolList[ iSrcSlot ].soldierID = NOBODY;
|
||||||
}
|
}
|
||||||
pInventoryPoolList[ iDestSlot ].soldierID = sObjectSourseSoldierID;
|
pInventoryPoolList[ iDestSlot ].soldierID = sObjectSourseSoldierID;
|
||||||
}
|
}
|
||||||
@@ -2674,10 +2679,10 @@ BOOLEAN PlaceObjectInInventoryStash( OBJECTTYPE *pInventorySlot, OBJECTTYPE *pIt
|
|||||||
// anv: disable soldier's ownership, as otherwise stacked backpacks would share it
|
// anv: disable soldier's ownership, as otherwise stacked backpacks would share it
|
||||||
if( iDestSlot != (-1) && iSrcSlot != (-1) )
|
if( iDestSlot != (-1) && iSrcSlot != (-1) )
|
||||||
{
|
{
|
||||||
pInventoryPoolList[ iDestSlot ].soldierID = (-1);
|
pInventoryPoolList[ iDestSlot ].soldierID = NOBODY;
|
||||||
pInventoryPoolList[ iSrcSlot ].soldierID = (-1);
|
pInventoryPoolList[ iSrcSlot ].soldierID = NOBODY;
|
||||||
iCurrentlyPickedUpItem = iDestSlot;
|
iCurrentlyPickedUpItem = iDestSlot;
|
||||||
sObjectSourseSoldierID = (-1);
|
sObjectSourseSoldierID = NOBODY;
|
||||||
}
|
}
|
||||||
// stacking
|
// stacking
|
||||||
pInventorySlot->AddObjectsToStack(*pItemPtr);
|
pInventorySlot->AddObjectsToStack(*pItemPtr);
|
||||||
@@ -2689,9 +2694,9 @@ BOOLEAN PlaceObjectInInventoryStash( OBJECTTYPE *pInventorySlot, OBJECTTYPE *pIt
|
|||||||
// anv: swap ownerships too
|
// anv: swap ownerships too
|
||||||
if( pInventoryPoolList[ iSrcSlot ].soldierID == sObjectSourseSoldierID )
|
if( pInventoryPoolList[ iSrcSlot ].soldierID == sObjectSourseSoldierID )
|
||||||
{
|
{
|
||||||
pInventoryPoolList[ iSrcSlot ].soldierID = (-1);
|
pInventoryPoolList[ iSrcSlot ].soldierID = NOBODY;
|
||||||
}
|
}
|
||||||
INT32 iTempSoldierID = pInventoryPoolList[ iDestSlot ].soldierID;
|
SoldierID iTempSoldierID = pInventoryPoolList[ iDestSlot ].soldierID;
|
||||||
pInventoryPoolList[ iDestSlot ].soldierID = sObjectSourseSoldierID;
|
pInventoryPoolList[ iDestSlot ].soldierID = sObjectSourseSoldierID;
|
||||||
sObjectSourseSoldierID = iTempSoldierID;
|
sObjectSourseSoldierID = iTempSoldierID;
|
||||||
iCurrentlyPickedUpItem = iDestSlot;
|
iCurrentlyPickedUpItem = iDestSlot;
|
||||||
@@ -3015,7 +3020,7 @@ void TemplateNameInputCallBack(UINT8 ubResult)
|
|||||||
{
|
{
|
||||||
if (ubResult == MSG_BOX_RETURN_OK && wcscmp(gszMsgBoxInputString, L"") > 0)
|
if (ubResult == MSG_BOX_RETURN_OK && wcscmp(gszMsgBoxInputString, L"") > 0)
|
||||||
{
|
{
|
||||||
SOLDIERTYPE* pSoldier = &Menptr[gCharactersList[bSelectedInfoChar].usSolID];
|
SOLDIERTYPE* pSoldier = gCharactersList[bSelectedInfoChar].usSolID;
|
||||||
if (pSoldier)
|
if (pSoldier)
|
||||||
{
|
{
|
||||||
WriteEquipmentTemplate(pSoldier, gszMsgBoxInputString);
|
WriteEquipmentTemplate(pSoldier, gszMsgBoxInputString);
|
||||||
@@ -3047,7 +3052,7 @@ void MapInventoryWriteEquipmentTemplate(GUI_BUTTON *btn, INT32 reason)
|
|||||||
{
|
{
|
||||||
if ( btn->uiFlags & (BUTTON_CLICKED_ON) )
|
if ( btn->uiFlags & (BUTTON_CLICKED_ON) )
|
||||||
{
|
{
|
||||||
SOLDIERTYPE* pSoldier = &Menptr[gCharactersList[bSelectedInfoChar].usSolID];
|
SOLDIERTYPE* pSoldier = gCharactersList[bSelectedInfoChar].usSolID;
|
||||||
if ( pSoldier )
|
if ( pSoldier )
|
||||||
{
|
{
|
||||||
DoMessageBox( MSG_BOX_BASIC_SMALL_BUTTONS, szGearTemplateText[0], guiCurrentScreen, MSG_BOX_FLAG_INPUTBOX, TemplateNameInputCallBack, NULL );
|
DoMessageBox( MSG_BOX_BASIC_SMALL_BUTTONS, szGearTemplateText[0], guiCurrentScreen, MSG_BOX_FLAG_INPUTBOX, TemplateNameInputCallBack, NULL );
|
||||||
@@ -3072,7 +3077,7 @@ void MapInventoryReadEquipmentTemplate(GUI_BUTTON *btn, INT32 reason)
|
|||||||
{
|
{
|
||||||
if ( btn->uiFlags & (BUTTON_CLICKED_ON) )
|
if ( btn->uiFlags & (BUTTON_CLICKED_ON) )
|
||||||
{
|
{
|
||||||
SOLDIERTYPE* pSoldier = &Menptr[gCharactersList[bSelectedInfoChar].usSolID];
|
SOLDIERTYPE* pSoldier = gCharactersList[bSelectedInfoChar].usSolID;
|
||||||
if ( pSoldier &&
|
if ( pSoldier &&
|
||||||
pSoldier->sSectorX == sSelMapX && pSoldier->sSectorY == sSelMapY && pSoldier->bSectorZ == iCurrentMapSectorZ &&
|
pSoldier->sSectorX == sSelMapX && pSoldier->sSectorY == sSelMapY && pSoldier->bSectorZ == iCurrentMapSectorZ &&
|
||||||
!pSoldier->flags.fBetweenSectors )
|
!pSoldier->flags.fBetweenSectors )
|
||||||
@@ -3525,11 +3530,12 @@ void HandleButtonStatesWhileMapInventoryActive( void )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Selected Merc is in sector? Or is in combat?
|
// Selected Merc is in sector? Or is in combat?
|
||||||
if(MercPtrs[gCharactersList[bSelectedInfoChar].usSolID]->sSectorX != sSelMapX ||
|
SOLDIERTYPE* pSoldier = gCharactersList[bSelectedInfoChar].usSolID;
|
||||||
MercPtrs[gCharactersList[bSelectedInfoChar].usSolID]->sSectorY != sSelMapY ||
|
if( pSoldier->sSectorX != sSelMapX ||
|
||||||
MercPtrs[gCharactersList[bSelectedInfoChar].usSolID]->bSectorZ != iCurrentMapSectorZ ||
|
pSoldier->sSectorY != sSelMapY ||
|
||||||
MercPtrs[gCharactersList[bSelectedInfoChar].usSolID]->flags.fBetweenSectors ||
|
pSoldier->bSectorZ != iCurrentMapSectorZ ||
|
||||||
!CanPlayerUseSectorInventory( &(Menptr[ gCharactersList[ bSelectedInfoChar ].usSolID ]) ) )
|
pSoldier->flags.fBetweenSectors ||
|
||||||
|
!CanPlayerUseSectorInventory( pSoldier ) )
|
||||||
{
|
{
|
||||||
DisableButton( guiMapInvenSortButton[ 0 ] );
|
DisableButton( guiMapInvenSortButton[ 0 ] );
|
||||||
DisableButton( guiMapInvenSortButton[ 1 ] );
|
DisableButton( guiMapInvenSortButton[ 1 ] );
|
||||||
@@ -3640,7 +3646,7 @@ void HandleMouseInCompatableItemForMapSectorInventory( INT32 iCurrentSlot )
|
|||||||
if( fShowInventoryFlag )
|
if( fShowInventoryFlag )
|
||||||
{
|
{
|
||||||
//Soldier inventory is shown, highlight those items
|
//Soldier inventory is shown, highlight those items
|
||||||
pSoldier = &Menptr[ gCharactersList[ bSelectedInfoChar ].usSolID ];
|
pSoldier = gCharactersList[ bSelectedInfoChar ].usSolID;
|
||||||
if( pSoldier )
|
if( pSoldier )
|
||||||
{
|
{
|
||||||
if( HandleCompatibleAmmoUIForMapScreen( pSoldier, iCurrentSlot + ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ), TRUE, FALSE ) )
|
if( HandleCompatibleAmmoUIForMapScreen( pSoldier, iCurrentSlot + ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ), TRUE, FALSE ) )
|
||||||
@@ -4815,7 +4821,7 @@ void SortSectorInventoryAmmo(bool useBoxes)
|
|||||||
OBJECTTYPE newCrate;
|
OBJECTTYPE newCrate;
|
||||||
int loopCount = 0;
|
int loopCount = 0;
|
||||||
|
|
||||||
SOLDIERTYPE * pSoldier = &(Menptr[ gCharactersList[ bSelectedInfoChar ].usSolID ]);
|
SOLDIERTYPE * pSoldier = gCharactersList[ bSelectedInfoChar ].usSolID;
|
||||||
|
|
||||||
AssertMsg( pSoldier != NULL, "Sector Inventory: Attempting ammo sort without valid selected soldier?" );
|
AssertMsg( pSoldier != NULL, "Sector Inventory: Attempting ammo sort without valid selected soldier?" );
|
||||||
|
|
||||||
@@ -4957,7 +4963,7 @@ void SortSectorInventoryEjectAmmo()
|
|||||||
{
|
{
|
||||||
OBJECTTYPE gTempObject;
|
OBJECTTYPE gTempObject;
|
||||||
|
|
||||||
SOLDIERTYPE * pSoldier = &(Menptr[ gCharactersList[ bSelectedInfoChar ].usSolID ]);
|
SOLDIERTYPE * pSoldier = gCharactersList[ bSelectedInfoChar ].usSolID;
|
||||||
|
|
||||||
for ( UINT32 uiLoop = 0; uiLoop < pInventoryPoolList.size(); uiLoop++ ) //for all items in sector
|
for ( UINT32 uiLoop = 0; uiLoop < pInventoryPoolList.size(); uiLoop++ ) //for all items in sector
|
||||||
{
|
{
|
||||||
@@ -5006,7 +5012,7 @@ void SortSectorInventoryEmptyLBE() {
|
|||||||
// current item
|
// current item
|
||||||
WORLDITEM * pInventoryItem = NULL;
|
WORLDITEM * pInventoryItem = NULL;
|
||||||
|
|
||||||
SOLDIERTYPE * pSoldier = &(Menptr[gCharactersList[bSelectedInfoChar].usSolID]);
|
SOLDIERTYPE * pSoldier = gCharactersList[bSelectedInfoChar].usSolID;
|
||||||
|
|
||||||
for (UINT32 uiLoop = 0; uiLoop < pInventoryPoolList.size(); uiLoop++) //for all items in sector
|
for (UINT32 uiLoop = 0; uiLoop < pInventoryPoolList.size(); uiLoop++) //for all items in sector
|
||||||
{
|
{
|
||||||
@@ -5081,7 +5087,7 @@ void SortSectorInventorySeparateAttachments()
|
|||||||
WORLDITEM * pInventoryItem = NULL;
|
WORLDITEM * pInventoryItem = NULL;
|
||||||
|
|
||||||
|
|
||||||
SOLDIERTYPE * pSoldier = &(Menptr[gCharactersList[bSelectedInfoChar].usSolID]);
|
SOLDIERTYPE * pSoldier = gCharactersList[bSelectedInfoChar].usSolID;
|
||||||
|
|
||||||
for (UINT32 uiLoop = 0; uiLoop < pInventoryPoolList.size(); uiLoop++) //for all items in sector
|
for (UINT32 uiLoop = 0; uiLoop < pInventoryPoolList.size(); uiLoop++) //for all items in sector
|
||||||
{
|
{
|
||||||
@@ -5154,12 +5160,12 @@ void SortSectorInventoryStackAndMerge(bool ammoOnly )
|
|||||||
{
|
{
|
||||||
OBJECTTYPE * StackObject;
|
OBJECTTYPE * StackObject;
|
||||||
|
|
||||||
SOLDIERTYPE * pSoldier = &(Menptr[ gCharactersList[ bSelectedInfoChar ].usSolID ]);
|
SOLDIERTYPE * pSoldier = gCharactersList[ bSelectedInfoChar ].usSolID;
|
||||||
|
|
||||||
for ( UINT32 uiLoop = 0; uiLoop < pInventoryPoolList.size(); uiLoop++ )
|
for ( UINT32 uiLoop = 0; uiLoop < pInventoryPoolList.size(); uiLoop++ )
|
||||||
{
|
{
|
||||||
// anv: disable soldier's ownership, as otherwise stacked backpacks would share it
|
// anv: disable soldier's ownership, as otherwise stacked backpacks would share it
|
||||||
pInventoryPoolList[ uiLoop ].soldierID = (-1);
|
pInventoryPoolList[ uiLoop ].soldierID = NOBODY;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run through sector inventory.
|
// Run through sector inventory.
|
||||||
|
|||||||
@@ -476,10 +476,10 @@ UINT32 guiMAPCURSORS;
|
|||||||
UINT32 guiMapPathingArrows;
|
UINT32 guiMapPathingArrows;
|
||||||
|
|
||||||
// assignment selection character
|
// assignment selection character
|
||||||
INT8 bSelectedAssignChar=-1;
|
INT16 bSelectedAssignChar=-1;
|
||||||
|
|
||||||
// current contract char
|
// current contract char
|
||||||
INT8 bSelectedContractChar = -1;
|
INT16 bSelectedContractChar = -1;
|
||||||
|
|
||||||
|
|
||||||
// has the temp path for character or helicopter been already drawn?
|
// has the temp path for character or helicopter been already drawn?
|
||||||
@@ -523,7 +523,7 @@ void ShowTownText( void );
|
|||||||
void DrawTownLabels(STR16 pString, STR16 pStringA,UINT16 usFirstX, UINT16 usFirstY);
|
void DrawTownLabels(STR16 pString, STR16 pStringA,UINT16 usFirstX, UINT16 usFirstY);
|
||||||
void ShowTeamAndVehicles(INT32 fShowFlags);
|
void ShowTeamAndVehicles(INT32 fShowFlags);
|
||||||
BOOLEAN ShadeMapElem( INT16 sMapX, INT16 sMapY, INT32 iColor );
|
BOOLEAN ShadeMapElem( INT16 sMapX, INT16 sMapY, INT32 iColor );
|
||||||
BOOLEAN ShadeMapElements(const INT32(&colorMap)[16][16]);
|
BOOLEAN ShadeMapElements(const INT32(&colorMap)[MAXIMUM_VALID_Y_COORDINATE][MAXIMUM_VALID_X_COORDINATE]);
|
||||||
void AdjustXForLeftMapEdge(STR16 wString, INT16 *psX, INT32 iFont);
|
void AdjustXForLeftMapEdge(STR16 wString, INT16 *psX, INT32 iFont);
|
||||||
void BlitTownGridMarkers( void );
|
void BlitTownGridMarkers( void );
|
||||||
void BlitMineGridMarkers( void );
|
void BlitMineGridMarkers( void );
|
||||||
@@ -602,11 +602,11 @@ BOOLEAN SaveHiddenTownToSaveGameFile( HWFILE hFile );
|
|||||||
// Flugente: added getter/setter so that we can easily check when a new char is set
|
// Flugente: added getter/setter so that we can easily check when a new char is set
|
||||||
// we also set a marker determining when we should update the squads data, so that we only check that when required
|
// we also set a marker determining when we should update the squads data, so that we only check that when required
|
||||||
// destination plotting character
|
// destination plotting character
|
||||||
INT8 bSelectedDestChar = -1;
|
INT16 bSelectedDestChar = -1;
|
||||||
bool gSquadEncumbranceCheckNecessary = true;
|
bool gSquadEncumbranceCheckNecessary = true;
|
||||||
|
|
||||||
INT8 GetSelectedDestChar() { return bSelectedDestChar; }
|
INT16 GetSelectedDestChar() { return bSelectedDestChar; }
|
||||||
void SetSelectedDestChar( INT8 aVal )
|
void SetSelectedDestChar( INT16 aVal )
|
||||||
{
|
{
|
||||||
bSelectedDestChar = aVal;
|
bSelectedDestChar = aVal;
|
||||||
gSquadEncumbranceCheckNecessary = true;
|
gSquadEncumbranceCheckNecessary = true;
|
||||||
@@ -1299,7 +1299,7 @@ INT32 ShowOnDutyTeam( INT16 sMapX, INT16 sMapY )
|
|||||||
// run through list
|
// run through list
|
||||||
while(gCharactersList[ubCounter].fValid)
|
while(gCharactersList[ubCounter].fValid)
|
||||||
{
|
{
|
||||||
pSoldier = MercPtrs[ gCharactersList[ ubCounter ].usSolID ];
|
pSoldier = gCharactersList[ ubCounter ].usSolID;
|
||||||
|
|
||||||
if( !( pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE ) &&
|
if( !( pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE ) &&
|
||||||
( pSoldier->sSectorX == sMapX) &&
|
( pSoldier->sSectorX == sMapX) &&
|
||||||
@@ -1351,7 +1351,7 @@ INT32 ShowAssignedTeam(INT16 sMapX, INT16 sMapY, INT32 iCount)
|
|||||||
|
|
||||||
while(gCharactersList[ubCounter].fValid)
|
while(gCharactersList[ubCounter].fValid)
|
||||||
{
|
{
|
||||||
pSoldier = MercPtrs[ gCharactersList[ ubCounter ].usSolID ];
|
pSoldier = gCharactersList[ ubCounter ].usSolID;
|
||||||
|
|
||||||
// given number of on duty members, find number of assigned chars
|
// given number of on duty members, find number of assigned chars
|
||||||
// start at beginning of list, look for people who are in sector and assigned
|
// start at beginning of list, look for people who are in sector and assigned
|
||||||
@@ -4378,9 +4378,7 @@ void DisplayDistancesForHelicopter( void )
|
|||||||
if( (INT32)uiTripCost > LaptopSaveInfo.iCurrentBalance )
|
if( (INT32)uiTripCost > LaptopSaveInfo.iCurrentBalance )
|
||||||
SetFontForeground( FONT_LTRED );
|
SetFontForeground( FONT_LTRED );
|
||||||
|
|
||||||
swprintf( sString, L"%d", uiTripCost );
|
swprintf( sString, L"%s", FormatMoney(uiTripCost).data());
|
||||||
InsertCommasForDollarFigure( sString );
|
|
||||||
InsertDollarSignInToString( sString );
|
|
||||||
FindFontRightCoordinates(UI_MAP.HeliETA.PopupBox.x + 5, ( INT16 ) (UI_MAP.HeliETA.PopupBox.y + 5 + 3 * GetFontHeight( MAP_FONT ) ), UI_MAP.HeliETA.PopupBox.width, 0, sString, MAP_FONT, &sX, &sY );
|
FindFontRightCoordinates(UI_MAP.HeliETA.PopupBox.x + 5, ( INT16 ) (UI_MAP.HeliETA.PopupBox.y + 5 + 3 * GetFontHeight( MAP_FONT ) ), UI_MAP.HeliETA.PopupBox.width, 0, sString, MAP_FONT, &sX, &sY );
|
||||||
mprintf( sX, ( INT16 ) ( sYPosition + 5 + 3 * GetFontHeight( MAP_FONT ) ), sString );
|
mprintf( sX, ( INT16 ) ( sYPosition + 5 + 3 * GetFontHeight( MAP_FONT ) ), sString );
|
||||||
|
|
||||||
@@ -4857,9 +4855,7 @@ void BlitMineText( INT16 sMapX, INT16 sMapY )
|
|||||||
if (PlayerControlsMine(ubMineIndex) && !gMineStatus[ ubMineIndex ].fEmpty)
|
if (PlayerControlsMine(ubMineIndex) && !gMineStatus[ ubMineIndex ].fEmpty)
|
||||||
{
|
{
|
||||||
// show current production
|
// show current production
|
||||||
swprintf( wSubString, L"%d", PredictDailyIncomeFromAMine(ubMineIndex, TRUE) );
|
swprintf( wSubString, L"%s", FormatMoney(PredictDailyIncomeFromAMine(ubMineIndex, TRUE)).data());
|
||||||
InsertCommasForDollarFigure( wSubString );
|
|
||||||
InsertDollarSignInToString( wSubString );
|
|
||||||
wcscpy( wString, wSubString );
|
wcscpy( wString, wSubString );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -6232,14 +6228,14 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Map Screen4");
|
|||||||
usSector = SECTOR( sSectorX, sSectorY );
|
usSector = SECTOR( sSectorX, sSectorY );
|
||||||
|
|
||||||
// distribute here
|
// distribute here
|
||||||
SectorInfo[usSector].ubNumberOfCivsAtLevel[ GREEN_MILITIA ] = ( UINT8 )( iNumberOfGreens / iNumberUnderControl );
|
SectorInfo[usSector].ubNumberOfCivsAtLevel[ GREEN_MILITIA ] = ( UINT16 )( iNumberOfGreens / iNumberUnderControl );
|
||||||
SectorInfo[usSector].ubNumberOfCivsAtLevel[ REGULAR_MILITIA ] = ( UINT8 )( iNumberOfRegulars / iNumberUnderControl );
|
SectorInfo[usSector].ubNumberOfCivsAtLevel[ REGULAR_MILITIA ] = ( UINT16 )( iNumberOfRegulars / iNumberUnderControl );
|
||||||
SectorInfo[usSector].ubNumberOfCivsAtLevel[ ELITE_MILITIA ] = ( UINT8 )( iNumberOfElites / iNumberUnderControl );
|
SectorInfo[usSector].ubNumberOfCivsAtLevel[ ELITE_MILITIA ] = ( UINT16 )( iNumberOfElites / iNumberUnderControl );
|
||||||
|
|
||||||
// Flugente: indivdual militia
|
// Flugente: indivdual militia
|
||||||
DropIndividualMilitia( usSector, GREEN_MILITIA, (UINT8)(iNumberOfGreens / iNumberUnderControl) );
|
DropIndividualMilitia( usSector, GREEN_MILITIA, (UINT16)(iNumberOfGreens / iNumberUnderControl) );
|
||||||
DropIndividualMilitia( usSector, REGULAR_MILITIA, (UINT8)(iNumberOfRegulars / iNumberUnderControl) );
|
DropIndividualMilitia( usSector, REGULAR_MILITIA, (UINT16)(iNumberOfRegulars / iNumberUnderControl) );
|
||||||
DropIndividualMilitia( usSector, ELITE_MILITIA, (UINT8)(iNumberOfElites / iNumberUnderControl) );
|
DropIndividualMilitia( usSector, ELITE_MILITIA, (UINT16)(iNumberOfElites / iNumberUnderControl) );
|
||||||
|
|
||||||
// Flugente: as we do not move the group militia, we have to make sure we don't accidentally overfill a sector
|
// Flugente: as we do not move the group militia, we have to make sure we don't accidentally overfill a sector
|
||||||
sTotalSoFar = NumNonPlayerTeamMembersInSector( sSectorX, sSectorY, MILITIA_TEAM );
|
sTotalSoFar = NumNonPlayerTeamMembersInSector( sSectorX, sSectorY, MILITIA_TEAM );
|
||||||
@@ -6949,19 +6945,15 @@ UINT32 WhatPlayerKnowsAboutEnemiesInSector( INT16 sSectorX, INT16 sSectorY )
|
|||||||
|
|
||||||
BOOLEAN CanMercsScoutThisSector( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ )
|
BOOLEAN CanMercsScoutThisSector( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ )
|
||||||
{
|
{
|
||||||
INT32 iFirstId = 0, iLastId = 0;
|
|
||||||
INT32 iCounter = 0;
|
|
||||||
SOLDIERTYPE *pSoldier = NULL;
|
SOLDIERTYPE *pSoldier = NULL;
|
||||||
|
|
||||||
|
|
||||||
// to speed it up a little?
|
// to speed it up a little?
|
||||||
iFirstId = gTacticalStatus.Team[ OUR_TEAM ].bFirstID;
|
SoldierID id = gTacticalStatus.Team[ OUR_TEAM ].bFirstID;
|
||||||
iLastId = gTacticalStatus.Team[ OUR_TEAM ].bLastID;
|
const SoldierID iLastId = gTacticalStatus.Team[ OUR_TEAM ].bLastID;
|
||||||
|
for( ; id <= iLastId; ++id )
|
||||||
for( iCounter = iFirstId; iCounter <= iLastId; iCounter++ )
|
|
||||||
{
|
{
|
||||||
// get the soldier
|
// get the soldier
|
||||||
pSoldier = &Menptr[ iCounter ];
|
pSoldier = id;
|
||||||
|
|
||||||
// is the soldier active
|
// is the soldier active
|
||||||
if( pSoldier->bActive == FALSE )
|
if( pSoldier->bActive == FALSE )
|
||||||
@@ -7127,7 +7119,7 @@ UINT8 NumActiveCharactersInSector( INT16 sSectorX, INT16 sSectorY, INT16 bSector
|
|||||||
{
|
{
|
||||||
if( gCharactersList[ iCounter ].fValid )
|
if( gCharactersList[ iCounter ].fValid )
|
||||||
{
|
{
|
||||||
pSoldier = &( Menptr[ gCharactersList[ iCounter ].usSolID ] );
|
pSoldier = gCharactersList[ iCounter ].usSolID;
|
||||||
|
|
||||||
if( pSoldier->bActive && ( pSoldier->stats.bLife > 0 ) &&
|
if( pSoldier->bActive && ( pSoldier->stats.bLife > 0 ) &&
|
||||||
( pSoldier->bAssignment != ASSIGNMENT_POW ) && ( pSoldier->bAssignment != IN_TRANSIT ) )
|
( pSoldier->bAssignment != ASSIGNMENT_POW ) && ( pSoldier->bAssignment != IN_TRANSIT ) )
|
||||||
@@ -8091,7 +8083,7 @@ void MilitiaGroupBoxButtonCallback( GUI_BUTTON *btn, INT32 reason )
|
|||||||
UINT8 militiatype = id / 2;
|
UINT8 militiatype = id / 2;
|
||||||
|
|
||||||
// for now, always alter by 1
|
// for now, always alter by 1
|
||||||
UINT8 howmany = 1;
|
UINT16 howmany = 1;
|
||||||
|
|
||||||
// either add or remove a militia from currently selected group
|
// either add or remove a militia from currently selected group
|
||||||
if ( id % 2 )
|
if ( id % 2 )
|
||||||
|
|||||||
@@ -372,19 +372,19 @@ extern BOOLEAN fDrawTempHeliPath;
|
|||||||
extern BOOLEAN fDrawTempMilitiaPath;
|
extern BOOLEAN fDrawTempMilitiaPath;
|
||||||
|
|
||||||
// selected destination char
|
// selected destination char
|
||||||
INT8 GetSelectedDestChar();
|
INT16 GetSelectedDestChar();
|
||||||
void SetSelectedDestChar( INT8 aVal );
|
void SetSelectedDestChar( INT16 aVal );
|
||||||
|
|
||||||
extern bool gSquadEncumbranceCheckNecessary;
|
extern bool gSquadEncumbranceCheckNecessary;
|
||||||
|
|
||||||
// current assignment character
|
// current assignment character
|
||||||
extern INT8 bSelectedAssignChar;
|
extern INT16 bSelectedAssignChar;
|
||||||
|
|
||||||
// the info character
|
// the info character
|
||||||
extern INT8 bSelectedInfoChar;
|
extern INT16 bSelectedInfoChar;
|
||||||
|
|
||||||
// the contract char
|
// the contract char
|
||||||
extern INT8 bSelectedContractChar;
|
extern INT16 bSelectedContractChar;
|
||||||
|
|
||||||
// map arrows graphical index value
|
// map arrows graphical index value
|
||||||
extern UINT32 guiMAPCURSORS;
|
extern UINT32 guiMAPCURSORS;
|
||||||
|
|||||||
@@ -180,11 +180,12 @@ void CreateDestroyTownInfoBox( void )
|
|||||||
// set highlight color
|
// set highlight color
|
||||||
SetBoxHighLight(ghTownMineBox, FONT_WHITE);
|
SetBoxHighLight(ghTownMineBox, FONT_WHITE);
|
||||||
|
|
||||||
SetBoxSecondColumnForeground( ghTownMineBox, FONT_WHITE );
|
const auto column = 1;
|
||||||
SetBoxSecondColumnBackground( ghTownMineBox, FONT_BLACK );
|
SetBoxColumnForeground( ghTownMineBox, FONT_WHITE, column );
|
||||||
SetBoxSecondColumnHighLight( ghTownMineBox, FONT_WHITE );
|
SetBoxColumnBackground( ghTownMineBox, FONT_BLACK, column );
|
||||||
SetBoxSecondColumnShade( ghTownMineBox, FONT_BLACK );
|
SetBoxColumnHighLight( ghTownMineBox, FONT_WHITE, column );
|
||||||
SetBoxSecondColumnFont( ghTownMineBox, BLOCKFONT2 );
|
SetBoxColumnShade( ghTownMineBox, FONT_BLACK, column );
|
||||||
|
SetBoxColumnFont( ghTownMineBox, BLOCKFONT2, column );
|
||||||
SetBoxSecondColumnMinimumOffset( ghTownMineBox, 20 );
|
SetBoxSecondColumnMinimumOffset( ghTownMineBox, 20 );
|
||||||
|
|
||||||
// unhighlighted color
|
// unhighlighted color
|
||||||
@@ -548,20 +549,14 @@ void AddTextToMineBox( void )
|
|||||||
swprintf( wString, L"%s:", pwMineStrings[ 3 ]);
|
swprintf( wString, L"%s:", pwMineStrings[ 3 ]);
|
||||||
AddMonoString( &hStringHandle, wString );
|
AddMonoString( &hStringHandle, wString );
|
||||||
|
|
||||||
swprintf( wString, L"%d", PredictDailyIncomeFromAMine( ubMineIndex, TRUE ) );
|
AddSecondColumnMonoString( &hStringHandle, FormatMoney(PredictDailyIncomeFromAMine(ubMineIndex, TRUE)).data() );
|
||||||
InsertCommasForDollarFigure( wString );
|
|
||||||
InsertDollarSignInToString( wString );
|
|
||||||
AddSecondColumnMonoString( &hStringHandle, wString );
|
|
||||||
|
|
||||||
|
|
||||||
// potential production
|
// potential production
|
||||||
swprintf( wString, L"%s:", pwMineStrings[ 4 ]);
|
swprintf( wString, L"%s:", pwMineStrings[ 4 ]);
|
||||||
AddMonoString( &hStringHandle, wString );
|
AddMonoString( &hStringHandle, wString );
|
||||||
|
|
||||||
swprintf( wString, L"%d", GetMaxDailyRemovalFromMine( ubMineIndex ) );
|
AddSecondColumnMonoString( &hStringHandle, FormatMoney(GetMaxDailyRemovalFromMine(ubMineIndex)).data());
|
||||||
InsertCommasForDollarFigure( wString );
|
|
||||||
InsertDollarSignInToString( wString );
|
|
||||||
AddSecondColumnMonoString( &hStringHandle, wString );
|
|
||||||
|
|
||||||
|
|
||||||
// if potential is not nil
|
// if potential is not nil
|
||||||
@@ -615,9 +610,7 @@ void AddTextToMineBox( void )
|
|||||||
wcscpy( wString, L"Remaining (DEBUG):");
|
wcscpy( wString, L"Remaining (DEBUG):");
|
||||||
AddMonoString( &hStringHandle, wString );
|
AddMonoString( &hStringHandle, wString );
|
||||||
|
|
||||||
swprintf( wString, L"%d", GetTotalLeftInMine( ubMineIndex ) );
|
swprintf( wString, L"%s", FormatMoney( GetTotalLeftInMine( ubMineIndex ) ).data() );
|
||||||
InsertCommasForDollarFigure( wString );
|
|
||||||
InsertDollarSignInToString( wString );
|
|
||||||
AddSecondColumnMonoString( &hStringHandle, wString );
|
AddSecondColumnMonoString( &hStringHandle, wString );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
+559
-172
File diff suppressed because it is too large
Load Diff
@@ -24,8 +24,8 @@ typedef struct FASTHELPREGION {
|
|||||||
// Flugente: externalised squad names
|
// Flugente: externalised squad names
|
||||||
extern std::vector<std::wstring> gSquadNameVector;
|
extern std::vector<std::wstring> gSquadNameVector;
|
||||||
|
|
||||||
extern UINT8 FIRSTmercTOdisplay ;
|
extern UINT16 FIRSTmercTOdisplay ;
|
||||||
extern UINT8 maxNumberOfMercVisibleInStrategyList;
|
extern UINT16 maxNumberOfMercVisibleInStrategyList;
|
||||||
|
|
||||||
// String Lengths Defines
|
// String Lengths Defines
|
||||||
#define MAX_NAME_LENGTH 10
|
#define MAX_NAME_LENGTH 10
|
||||||
@@ -322,7 +322,7 @@ extern BOOLEAN fLockOutMapScreenInterface;
|
|||||||
// The character data structure
|
// The character data structure
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
||||||
UINT16 usSolID;// soldier ID in MenPtrs
|
SoldierID usSolID;// soldier ID in MenPtrs
|
||||||
BOOLEAN fValid;// is the current soldier a valid soldier
|
BOOLEAN fValid;// is the current soldier a valid soldier
|
||||||
|
|
||||||
} MapScreenCharacterSt;
|
} MapScreenCharacterSt;
|
||||||
@@ -437,24 +437,24 @@ extern BOOLEAN fResetContractGlow;
|
|||||||
void InitalizeVehicleAndCharacterList( void );
|
void InitalizeVehicleAndCharacterList( void );
|
||||||
|
|
||||||
// set this entry to as selected
|
// set this entry to as selected
|
||||||
void SetEntryInSelectedCharacterList( INT8 bEntry );
|
void SetEntryInSelectedCharacterList( INT16 bEntry );
|
||||||
// set this entry to as unselected
|
// set this entry to as unselected
|
||||||
void ResetEntryForSelectedList( INT8 bEntry );
|
void ResetEntryForSelectedList( INT16 bEntry );
|
||||||
|
|
||||||
// reset selected list
|
// reset selected list
|
||||||
void ResetSelectedListForMapScreen( );
|
void ResetSelectedListForMapScreen( );
|
||||||
|
|
||||||
// build a selected list from a to b, inclusive
|
// build a selected list from a to b, inclusive
|
||||||
void BuildSelectedListFromAToB( INT8 bA, INT8 bB );
|
void BuildSelectedListFromAToB( INT16 bA, INT16 bB );
|
||||||
|
|
||||||
// isa this entry int he selected character list set?
|
// isa this entry int he selected character list set?
|
||||||
BOOLEAN IsEntryInSelectedListSet( INT8 bEntry );
|
BOOLEAN IsEntryInSelectedListSet( INT16 bEntry );
|
||||||
|
|
||||||
// is there more than one person selected?
|
// is there more than one person selected?
|
||||||
BOOLEAN MultipleCharacterListEntriesSelected( void );
|
BOOLEAN MultipleCharacterListEntriesSelected( void );
|
||||||
|
|
||||||
// toggle this entry on or off
|
// toggle this entry on or off
|
||||||
void ToggleEntryInSelectedList( INT8 bEntry );
|
void ToggleEntryInSelectedList( INT16 bEntry );
|
||||||
|
|
||||||
// reset assignments for mercs on selected list who have this assignment
|
// reset assignments for mercs on selected list who have this assignment
|
||||||
// HEADROCK HAM 3.6: Argument was unused... adding my own.
|
// HEADROCK HAM 3.6: Argument was unused... adding my own.
|
||||||
@@ -513,11 +513,11 @@ void DeselectSelectedListMercsWhoCantMoveWithThisGuy( SOLDIERTYPE *pSoldier );
|
|||||||
void GetMoraleString( SOLDIERTYPE *pSoldier, STR16 sString );
|
void GetMoraleString( SOLDIERTYPE *pSoldier, STR16 sString );
|
||||||
|
|
||||||
// handle leaving of equipment in sector
|
// handle leaving of equipment in sector
|
||||||
void HandleLeavingOfEquipmentInCurrentSector( UINT32 uiMercId );
|
void HandleLeavingOfEquipmentInCurrentSector( SoldierID uiMercId );
|
||||||
|
|
||||||
// set up a linked list of items being dropped and post an event to later drop them
|
// set up a linked list of items being dropped and post an event to later drop them
|
||||||
void HandleMercLeavingEquipmentInDrassen( UINT32 uiMercId );
|
void HandleMercLeavingEquipmentInDrassen( SoldierID uiMercId );
|
||||||
void HandleMercLeavingEquipmentInOmerta( UINT32 uiMercId );
|
void HandleMercLeavingEquipmentInOmerta( SoldierID uiMercId );
|
||||||
|
|
||||||
// actually drop the stored list of items
|
// actually drop the stored list of items
|
||||||
void HandleEquipmentLeftInOmerta( UINT32 uiSlotIndex );
|
void HandleEquipmentLeftInOmerta( UINT32 uiSlotIndex );
|
||||||
@@ -537,7 +537,7 @@ void FreeLeaveListSlot( UINT32 uiSlotIndex );
|
|||||||
INT32 FindFreeSlotInLeaveList( void );
|
INT32 FindFreeSlotInLeaveList( void );
|
||||||
|
|
||||||
// set up drop list
|
// set up drop list
|
||||||
INT32 SetUpDropItemListForMerc( UINT32 uiMercId );
|
INT32 SetUpDropItemListForMerc( SoldierID uiMercId );
|
||||||
// store owner's profile id for the items added to this leave slot index
|
// store owner's profile id for the items added to this leave slot index
|
||||||
void SetUpMercAboutToLeaveEquipment( UINT32 ubProfileId, UINT32 uiSlotIndex );
|
void SetUpMercAboutToLeaveEquipment( UINT32 ubProfileId, UINT32 uiSlotIndex );
|
||||||
|
|
||||||
@@ -745,4 +745,4 @@ extern BOOLEAN CanCharacterMoveInStrategic( SOLDIERTYPE *pSoldier, INT8 *pbError
|
|||||||
extern BOOLEAN MapscreenCanPassItemToCharNum( INT32 iNewCharSlot );
|
extern BOOLEAN MapscreenCanPassItemToCharNum( INT32 iNewCharSlot );
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -418,7 +418,7 @@ void CheckForMeanwhileOKStart( )
|
|||||||
SOLDIERTYPE *pSoldier;
|
SOLDIERTYPE *pSoldier;
|
||||||
BOOLEAN fFoundSoldierToInterrogate = FALSE;
|
BOOLEAN fFoundSoldierToInterrogate = FALSE;
|
||||||
UINT32 uiCount = 0;
|
UINT32 uiCount = 0;
|
||||||
for (pSoldier = MercPtrs[gCharactersList[uiCount].usSolID]; gCharactersList[uiCount].fValid; uiCount++, pSoldier++)
|
for (pSoldier = gCharactersList[uiCount].usSolID; gCharactersList[uiCount].fValid; uiCount++, pSoldier++)
|
||||||
{
|
{
|
||||||
if (pSoldier->sSectorX == gModSettings.ubMeanwhileInterrogatePOWSectorX && pSoldier->sSectorY == gModSettings.ubMeanwhileInterrogatePOWSectorY &&
|
if (pSoldier->sSectorX == gModSettings.ubMeanwhileInterrogatePOWSectorX && pSoldier->sSectorY == gModSettings.ubMeanwhileInterrogatePOWSectorY &&
|
||||||
pSoldier->bSectorZ == 0 && pSoldier->bAssignment == ASSIGNMENT_POW && pSoldier->stats.bLife > 0 && gMercProfiles[pSoldier->ubProfile].bMercStatus != MERC_FIRED_AS_A_POW)
|
pSoldier->bSectorZ == 0 && pSoldier->bAssignment == ASSIGNMENT_POW && pSoldier->stats.bLife > 0 && gMercProfiles[pSoldier->ubProfile].bMercStatus != MERC_FIRED_AS_A_POW)
|
||||||
|
|||||||
+17
-28
@@ -282,9 +282,9 @@ void EndCurrentContractRenewal( )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void HandleMercIsWillingToRenew( UINT8 ubID )
|
void HandleMercIsWillingToRenew( SoldierID ubID )
|
||||||
{
|
{
|
||||||
SOLDIERTYPE *pSoldier = MercPtrs[ ubID ];
|
SOLDIERTYPE *pSoldier = ubID;
|
||||||
|
|
||||||
// We wish to lock interface
|
// We wish to lock interface
|
||||||
SpecialCharacterDialogueEvent( DIALOGUE_SPECIAL_EVENT_LOCK_INTERFACE,1,MAP_SCREEN,0,0,0 );
|
SpecialCharacterDialogueEvent( DIALOGUE_SPECIAL_EVENT_LOCK_INTERFACE,1,MAP_SCREEN,0,0,0 );
|
||||||
@@ -302,9 +302,9 @@ void HandleMercIsWillingToRenew( UINT8 ubID )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void HandleMercIsNotWillingToRenew( UINT8 ubID )
|
void HandleMercIsNotWillingToRenew( SoldierID ubID )
|
||||||
{
|
{
|
||||||
SOLDIERTYPE *pSoldier = MercPtrs[ ubID ];
|
SOLDIERTYPE *pSoldier = ubID;
|
||||||
|
|
||||||
// We wish to lock interface
|
// We wish to lock interface
|
||||||
SpecialCharacterDialogueEvent( DIALOGUE_SPECIAL_EVENT_LOCK_INTERFACE,1,MAP_SCREEN,0,0,0 );
|
SpecialCharacterDialogueEvent( DIALOGUE_SPECIAL_EVENT_LOCK_INTERFACE,1,MAP_SCREEN,0,0,0 );
|
||||||
@@ -742,16 +742,12 @@ BOOLEAN WillMercRenew( SOLDIERTYPE *pSoldier, BOOLEAN fSayQuote )
|
|||||||
|
|
||||||
void HandleBuddiesReactionToFiringMerc(SOLDIERTYPE *pFiredSoldier, INT8 bMoraleEvent )
|
void HandleBuddiesReactionToFiringMerc(SOLDIERTYPE *pFiredSoldier, INT8 bMoraleEvent )
|
||||||
{
|
{
|
||||||
INT8 bMercID;
|
SoldierID bMercID = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||||
INT8 bLastTeamID;
|
SoldierID bLastTeamID = gTacticalStatus.Team[ gbPlayerNum ].bLastID;
|
||||||
SOLDIERTYPE * pSoldier;
|
|
||||||
|
|
||||||
|
|
||||||
bMercID = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
|
||||||
bLastTeamID = gTacticalStatus.Team[ gbPlayerNum ].bLastID;
|
|
||||||
// loop through all mercs to find buddies
|
// loop through all mercs to find buddies
|
||||||
for ( pSoldier = MercPtrs[ bMercID ]; bMercID <= bLastTeamID; bMercID++,pSoldier++)
|
for ( ; bMercID <= bLastTeamID; ++bMercID)
|
||||||
{
|
{
|
||||||
|
SOLDIERTYPE *pSoldier = bMercID;
|
||||||
//if the merc is active, in Arulco, not POW and is a buddy
|
//if the merc is active, in Arulco, not POW and is a buddy
|
||||||
if ( WhichBuddy(pSoldier->ubProfile,pFiredSoldier->ubProfile) != (-1) &&
|
if ( WhichBuddy(pSoldier->ubProfile,pFiredSoldier->ubProfile) != (-1) &&
|
||||||
pSoldier->bActive && pSoldier->ubProfile != NO_PROFILE &&
|
pSoldier->bActive && pSoldier->ubProfile != NO_PROFILE &&
|
||||||
@@ -1416,9 +1412,9 @@ void FindOutIfAnyMercAboutToLeaveIsGonnaRenew( void )
|
|||||||
SOLDIERTYPE *pSoldier = NULL, *pSoldierWhoWillQuit = NULL;
|
SOLDIERTYPE *pSoldier = NULL, *pSoldierWhoWillQuit = NULL;
|
||||||
INT32 iCounter= 0, iNumberOnTeam = 0;
|
INT32 iCounter= 0, iNumberOnTeam = 0;
|
||||||
// WDS - make number of mercenaries, etc. be configurable
|
// WDS - make number of mercenaries, etc. be configurable
|
||||||
UINT8 ubPotentialMercs[ CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS ] = { 0 };
|
SoldierID ubPotentialMercs[ CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS ] = { 0 };
|
||||||
UINT8 ubNumMercs = 0;
|
UINT16 ubNumMercs = 0;
|
||||||
UINT8 ubChosenMerc;
|
UINT16 ubChosenMerc;
|
||||||
|
|
||||||
gfFirstMercSayQuote = FALSE;
|
gfFirstMercSayQuote = FALSE;
|
||||||
|
|
||||||
@@ -1498,16 +1494,17 @@ void FindOutIfAnyMercAboutToLeaveIsGonnaRenew( void )
|
|||||||
// OK, pick one....
|
// OK, pick one....
|
||||||
if ( ubNumMercs > 0 )
|
if ( ubNumMercs > 0 )
|
||||||
{
|
{
|
||||||
ubChosenMerc = (UINT8)Random( ubNumMercs );
|
ubChosenMerc = (UINT16)Random( ubNumMercs );
|
||||||
|
SOLDIERTYPE *pChosenSoldier = ubPotentialMercs[ubChosenMerc];
|
||||||
|
|
||||||
SpecialCharacterDialogueEvent( DIALOGUE_SPECIAL_EVENT_LOCK_INTERFACE,1 ,MAP_SCREEN ,0 ,0 ,0 );
|
SpecialCharacterDialogueEvent( DIALOGUE_SPECIAL_EVENT_LOCK_INTERFACE,1 ,MAP_SCREEN ,0 ,0 ,0 );
|
||||||
HandleImportantMercQuote( MercPtrs[ ubPotentialMercs[ ubChosenMerc ] ], QUOTE_CONTRACTS_OVER );
|
HandleImportantMercQuote( pChosenSoldier, QUOTE_CONTRACTS_OVER );
|
||||||
SpecialCharacterDialogueEvent( DIALOGUE_SPECIAL_EVENT_LOCK_INTERFACE,0 ,MAP_SCREEN ,0 ,0 ,0 );
|
SpecialCharacterDialogueEvent( DIALOGUE_SPECIAL_EVENT_LOCK_INTERFACE,0 ,MAP_SCREEN ,0 ,0 ,0 );
|
||||||
|
|
||||||
AddReasonToWaitingListQueue( CONTRACT_EXPIRE_WARNING_REASON );
|
AddReasonToWaitingListQueue( CONTRACT_EXPIRE_WARNING_REASON );
|
||||||
TacticalCharacterDialogueWithSpecialEvent( MercPtrs[ ubPotentialMercs[ ubChosenMerc ] ], 0, DIALOGUE_SPECIAL_EVENT_SHOW_UPDATE_MENU, 0,0 );
|
TacticalCharacterDialogueWithSpecialEvent( pChosenSoldier, 0, DIALOGUE_SPECIAL_EVENT_SHOW_UPDATE_MENU, 0,0 );
|
||||||
|
|
||||||
MercPtrs[ ubPotentialMercs[ ubChosenMerc ] ]->ubContractRenewalQuoteCode = SOLDIER_CONTRACT_RENEW_QUOTE_89_USED;
|
pChosenSoldier->ubContractRenewalQuoteCode = SOLDIER_CONTRACT_RENEW_QUOTE_89_USED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1521,16 +1518,8 @@ void HandleNotifyPlayerCantAffordInsurance( void )
|
|||||||
void HandleNotifyPlayerCanAffordInsurance( SOLDIERTYPE *pSoldier, UINT8 ubLength, INT32 iCost )
|
void HandleNotifyPlayerCanAffordInsurance( SOLDIERTYPE *pSoldier, UINT8 ubLength, INT32 iCost )
|
||||||
{
|
{
|
||||||
CHAR16 sString[ 128 ];
|
CHAR16 sString[ 128 ];
|
||||||
CHAR16 sStringA[ 32 ];
|
|
||||||
|
|
||||||
//parse the cost
|
swprintf( sString, zMarksMapScreenText[ 10 ], pSoldier->GetName(), FormatMoney(iCost).data(), ubLength );
|
||||||
swprintf( sStringA, L"%d",iCost );
|
|
||||||
|
|
||||||
// insert the commans and dollar sign
|
|
||||||
InsertCommasForDollarFigure( sStringA );
|
|
||||||
InsertDollarSignInToString( sStringA );
|
|
||||||
|
|
||||||
swprintf( sString, zMarksMapScreenText[ 10 ], pSoldier->GetName(), sStringA, ubLength );
|
|
||||||
|
|
||||||
//Set the length to the global variable ( so we know how long the contract is in the callback )
|
//Set the length to the global variable ( so we know how long the contract is in the callback )
|
||||||
gubContractLength = ubLength;
|
gubContractLength = ubLength;
|
||||||
|
|||||||
@@ -68,8 +68,8 @@ void FindOutIfAnyMercAboutToLeaveIsGonnaRenew( void );
|
|||||||
void BeginContractRenewalSequence( );
|
void BeginContractRenewalSequence( );
|
||||||
void HandleContractRenewalSequence( );
|
void HandleContractRenewalSequence( );
|
||||||
void EndCurrentContractRenewal( );
|
void EndCurrentContractRenewal( );
|
||||||
void HandleMercIsWillingToRenew( UINT8 ubID );
|
void HandleMercIsWillingToRenew( SoldierID ubID );
|
||||||
void HandleMercIsNotWillingToRenew( UINT8 ubID );
|
void HandleMercIsNotWillingToRenew( SoldierID ubID );
|
||||||
|
|
||||||
BOOLEAN ContractIsExpiring( SOLDIERTYPE *pSoldier );
|
BOOLEAN ContractIsExpiring( SOLDIERTYPE *pSoldier );
|
||||||
UINT32 GetHourWhenContractDone( SOLDIERTYPE *pSoldier );
|
UINT32 GetHourWhenContractDone( SOLDIERTYPE *pSoldier );
|
||||||
|
|||||||
@@ -282,11 +282,12 @@ void UpdateMilitia( MILITIA aMilitia )
|
|||||||
|
|
||||||
SOLDIERTYPE* GetUsedSoldierToIndividualMilitia( UINT32 aMilitiaId )
|
SOLDIERTYPE* GetUsedSoldierToIndividualMilitia( UINT32 aMilitiaId )
|
||||||
{
|
{
|
||||||
for ( UINT32 cnt = gTacticalStatus.Team[MILITIA_TEAM].bFirstID; cnt <= gTacticalStatus.Team[MILITIA_TEAM].bLastID; ++cnt )
|
for ( SoldierID cnt = gTacticalStatus.Team[MILITIA_TEAM].bFirstID; cnt <= gTacticalStatus.Team[MILITIA_TEAM].bLastID; ++cnt )
|
||||||
{
|
{
|
||||||
if ( MercPtrs[cnt] && MercPtrs[cnt]->bActive && MercPtrs[cnt]->usIndividualMilitiaID == aMilitiaId )
|
SOLDIERTYPE *pSoldier = cnt;
|
||||||
|
if ( pSoldier && pSoldier->bActive && pSoldier->usIndividualMilitiaID == aMilitiaId )
|
||||||
{
|
{
|
||||||
return MercPtrs[cnt];
|
return pSoldier;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -299,11 +300,11 @@ void ApplyTacticalLifeRatioToMilitia()
|
|||||||
if ( !gGameExternalOptions.fIndividualMilitia )
|
if ( !gGameExternalOptions.fIndividualMilitia )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
SOLDIERTYPE* pSoldier;
|
SoldierID cnt = gTacticalStatus.Team[MILITIA_TEAM].bFirstID;
|
||||||
UINT32 cnt = gTacticalStatus.Team[MILITIA_TEAM].bFirstID;
|
SoldierID lastid = gTacticalStatus.Team[MILITIA_TEAM].bLastID;
|
||||||
INT32 lastid = gTacticalStatus.Team[MILITIA_TEAM].bLastID;
|
for ( ; cnt < lastid; ++cnt )
|
||||||
for ( pSoldier = MercPtrs[cnt]; cnt < lastid; ++cnt, ++pSoldier )
|
|
||||||
{
|
{
|
||||||
|
SOLDIERTYPE *pSoldier = cnt;
|
||||||
MILITIA militia;
|
MILITIA militia;
|
||||||
if ( pSoldier && pSoldier->bActive && pSoldier->stats.bLifeMax && GetMilitia( pSoldier->usIndividualMilitiaID, &militia ) )
|
if ( pSoldier && pSoldier->bActive && pSoldier->stats.bLifeMax && GetMilitia( pSoldier->usIndividualMilitiaID, &militia ) )
|
||||||
{
|
{
|
||||||
@@ -325,11 +326,11 @@ void ApplyMilitiaHealthRatioToTactical()
|
|||||||
if ( !gGameExternalOptions.fIndividualMilitia || !gGameExternalOptions.fIndividualMilitia_ManageHealth )
|
if ( !gGameExternalOptions.fIndividualMilitia || !gGameExternalOptions.fIndividualMilitia_ManageHealth )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
SOLDIERTYPE* pSoldier;
|
SoldierID cnt = gTacticalStatus.Team[MILITIA_TEAM].bFirstID;
|
||||||
UINT32 cnt = gTacticalStatus.Team[MILITIA_TEAM].bFirstID;
|
SoldierID lastid = gTacticalStatus.Team[MILITIA_TEAM].bLastID;
|
||||||
INT32 lastid = gTacticalStatus.Team[MILITIA_TEAM].bLastID;
|
for ( ; cnt < lastid; ++cnt )
|
||||||
for ( pSoldier = MercPtrs[cnt]; cnt < lastid; ++cnt, ++pSoldier )
|
|
||||||
{
|
{
|
||||||
|
SOLDIERTYPE *pSoldier = cnt;
|
||||||
MILITIA militia;
|
MILITIA militia;
|
||||||
if ( pSoldier && pSoldier->bActive && pSoldier->stats.bLifeMax && GetMilitia( pSoldier->usIndividualMilitiaID, &militia ) )
|
if ( pSoldier && pSoldier->bActive && pSoldier->stats.bLifeMax && GetMilitia( pSoldier->usIndividualMilitiaID, &militia ) )
|
||||||
{
|
{
|
||||||
@@ -695,12 +696,12 @@ UINT32 GetIdOfUnusedIndividualMilitia( UINT8 aSoldierClass, UINT8 aSector )
|
|||||||
// fitting data found - now we have to make sure this one isn't already in use
|
// fitting data found - now we have to make sure this one isn't already in use
|
||||||
BOOLEAN found = FALSE;
|
BOOLEAN found = FALSE;
|
||||||
|
|
||||||
SOLDIERTYPE* pSoldier;
|
SoldierID cnt = gTacticalStatus.Team[MILITIA_TEAM].bFirstID;
|
||||||
|
SoldierID lastid = gTacticalStatus.Team[MILITIA_TEAM].bLastID;
|
||||||
INT32 cnt = gTacticalStatus.Team[MILITIA_TEAM].bFirstID;
|
for ( ; cnt < lastid; ++cnt )
|
||||||
INT32 lastid = gTacticalStatus.Team[MILITIA_TEAM].bLastID;
|
|
||||||
for ( pSoldier = MercPtrs[cnt]; cnt < lastid; ++cnt, ++pSoldier )
|
|
||||||
{
|
{
|
||||||
|
SOLDIERTYPE *pSoldier = cnt;
|
||||||
|
|
||||||
if ( pSoldier && pSoldier->bActive && ( *it ).id == pSoldier->usIndividualMilitiaID && IsLegalMilitiaId( pSoldier->usIndividualMilitiaID ) )
|
if ( pSoldier && pSoldier->bActive && ( *it ).id == pSoldier->usIndividualMilitiaID && IsLegalMilitiaId( pSoldier->usIndividualMilitiaID ) )
|
||||||
{
|
{
|
||||||
found = TRUE;
|
found = TRUE;
|
||||||
@@ -852,10 +853,11 @@ FLOAT PromoteIndividualMilitiaInSector( UINT8 aSector, FLOAT aPointsToAdd )
|
|||||||
{
|
{
|
||||||
BOOLEAN changesnecessary = FALSE;
|
BOOLEAN changesnecessary = FALSE;
|
||||||
|
|
||||||
SOLDIERTYPE* pSoldier = NULL;
|
SoldierID cnt = gTacticalStatus.Team[MILITIA_TEAM].bFirstID;
|
||||||
int cnt = gTacticalStatus.Team[MILITIA_TEAM].bFirstID;
|
SoldierID lastid = gTacticalStatus.Team[MILITIA_TEAM].bLastID;
|
||||||
for ( pSoldier = MercPtrs[cnt]; cnt <= gTacticalStatus.Team[MILITIA_TEAM].bLastID; ++cnt, ++pSoldier )
|
for ( ; cnt < lastid; ++cnt )
|
||||||
{
|
{
|
||||||
|
SOLDIERTYPE *pSoldier = cnt;
|
||||||
MILITIA militia;
|
MILITIA militia;
|
||||||
|
|
||||||
if ( pSoldier && GetMilitia( pSoldier->usIndividualMilitiaID, &militia ) )
|
if ( pSoldier && GetMilitia( pSoldier->usIndividualMilitiaID, &militia ) )
|
||||||
@@ -1004,7 +1006,7 @@ void HandlePossibleMilitiaPromotion( SOLDIERTYPE* pSoldier, BOOLEAN aAutoResolve
|
|||||||
pSoldier->ubMilitiaAssists = 0;
|
pSoldier->ubMilitiaAssists = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MoveIndividualMilitiaProfiles( UINT8 aSourceSector, UINT8 aTargetSector, UINT8 usGreens, UINT8 usRegulars, UINT8 usElites )
|
void MoveIndividualMilitiaProfiles( UINT8 aSourceSector, UINT8 aTargetSector, UINT16 usGreens, UINT16 usRegulars, UINT16 usElites )
|
||||||
{
|
{
|
||||||
if ( !usGreens && !usRegulars && !usElites )
|
if ( !usGreens && !usRegulars && !usElites )
|
||||||
return;
|
return;
|
||||||
@@ -1042,7 +1044,7 @@ void MoveIndividualMilitiaProfiles( UINT8 aSourceSector, UINT8 aTargetSector, UI
|
|||||||
|
|
||||||
|
|
||||||
// militia are disbanded - we have to take note of that
|
// militia are disbanded - we have to take note of that
|
||||||
void DisbandIndividualMilitia( UINT8 aSector, UINT8 usGreens, UINT8 usRegulars, UINT8 usElites )
|
void DisbandIndividualMilitia( UINT8 aSector, UINT16 usGreens, UINT16 usRegulars, UINT16 usElites )
|
||||||
{
|
{
|
||||||
std::vector<MILITIA>::iterator itend = gIndividualMilitiaVector.end( );
|
std::vector<MILITIA>::iterator itend = gIndividualMilitiaVector.end( );
|
||||||
for ( std::vector<MILITIA>::iterator it = gIndividualMilitiaVector.begin( ); it != itend; ++it )
|
for ( std::vector<MILITIA>::iterator it = gIndividualMilitiaVector.begin( ); it != itend; ++it )
|
||||||
|
|||||||
@@ -179,10 +179,10 @@ FLOAT PromoteIndividualMilitiaInSector( UINT8 aSector, FLOAT aPointsToAdd );
|
|||||||
// handle possible militia promotion and individual militia update
|
// handle possible militia promotion and individual militia update
|
||||||
void HandlePossibleMilitiaPromotion( SOLDIERTYPE* pSoldier, BOOLEAN aAutoResolve );
|
void HandlePossibleMilitiaPromotion( SOLDIERTYPE* pSoldier, BOOLEAN aAutoResolve );
|
||||||
|
|
||||||
void MoveIndividualMilitiaProfiles( UINT8 aSourceSector, UINT8 aTargetSector, UINT8 usGreens, UINT8 usRegulars, UINT8 usElites );
|
void MoveIndividualMilitiaProfiles( UINT8 aSourceSector, UINT8 aTargetSector, UINT16 usGreens, UINT16 usRegulars, UINT16 usElites );
|
||||||
|
|
||||||
// militia are disbanded - we have to take note of that
|
// militia are disbanded - we have to take note of that
|
||||||
void DisbandIndividualMilitia( UINT8 aSector, UINT8 usGreens, UINT8 usRegulars, UINT8 usElites );
|
void DisbandIndividualMilitia( UINT8 aSector, UINT16 usGreens, UINT16 usRegulars, UINT16 usElites );
|
||||||
|
|
||||||
void PromoteIndividualMilitia( UINT8 aSector, UINT8 aSoldierClass );
|
void PromoteIndividualMilitia( UINT8 aSector, UINT8 aSoldierClass );
|
||||||
|
|
||||||
@@ -195,4 +195,4 @@ UINT32 GetDailyUpkeep_IndividualMilitia( UINT32& arNumGreen, UINT32& arNumRegula
|
|||||||
void PickIndividualMilitia( UINT8 aSector, UINT8 ubType, UINT16 aNumber );
|
void PickIndividualMilitia( UINT8 aSector, UINT8 ubType, UINT16 aNumber );
|
||||||
void DropIndividualMilitia( UINT8 aSector, UINT8 ubType, UINT16 aNumber );
|
void DropIndividualMilitia( UINT8 aSector, UINT8 ubType, UINT16 aNumber );
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+37
-37
@@ -70,7 +70,7 @@
|
|||||||
#define DIR_SOUTH 2
|
#define DIR_SOUTH 2
|
||||||
#define DIR_WEST 3
|
#define DIR_WEST 3
|
||||||
|
|
||||||
UINT8 gpAttackDirs[5][4]; // 0. Green Militia 1. Regular Militia 2. Elite Militia 3. Insertion code
|
UINT16 gpAttackDirs[5][4]; // 0. Green Militia 1. Regular Militia 2. Elite Militia 3. Insertion code
|
||||||
UINT8 guiDirNumber = 0;
|
UINT8 guiDirNumber = 0;
|
||||||
BOOLEAN gfMSBattle = FALSE;
|
BOOLEAN gfMSBattle = FALSE;
|
||||||
|
|
||||||
@@ -140,12 +140,12 @@ void MoveMilitiaSquad(INT16 sMapX, INT16 sMapY, INT16 sTMapX, INT16 sTMapY, BOOL
|
|||||||
SECTORINFO *pSectorInfo = &( SectorInfo[ SECTOR( sMapX, sMapY ) ] );
|
SECTORINFO *pSectorInfo = &( SectorInfo[ SECTOR( sMapX, sMapY ) ] );
|
||||||
SECTORINFO *pTSectorInfo = &( SectorInfo[ SECTOR( sTMapX, sTMapY ) ] );
|
SECTORINFO *pTSectorInfo = &( SectorInfo[ SECTOR( sTMapX, sTMapY ) ] );
|
||||||
|
|
||||||
UINT8 bGreensSourceTeam = 0, bGreensDestTeam = 0;
|
UINT16 bGreensSourceTeam = 0, bGreensDestTeam = 0;
|
||||||
UINT8 bRegularsSourceTeam = 0, bRegularsDestTeam = 0;
|
UINT16 bRegularsSourceTeam = 0, bRegularsDestTeam = 0;
|
||||||
UINT8 bElitesSourceTeam = 0, bElitesDestTeam = 0;
|
UINT16 bElitesSourceTeam = 0, bElitesDestTeam = 0;
|
||||||
UINT8 bTotalGreens = 0, bTotalRegulars = 0, bTotalElites = 0;
|
UINT16 bTotalGreens = 0, bTotalRegulars = 0, bTotalElites = 0;
|
||||||
UINT8 bTotalGreensPercent = 0, bTotalRegularsPercent = 0, bTotalElitesPercent = 0;
|
UINT8 bTotalGreensPercent = 0, bTotalRegularsPercent = 0, bTotalElitesPercent = 0;
|
||||||
INT8 bNewSourceGroupSize = 0, bNewDestGroupSize = 0, bGroupSizeRatio = 0;
|
INT16 bNewSourceGroupSize = 0, bNewDestGroupSize = 0, bGroupSizeRatio = 0;
|
||||||
UINT8 ubChanceToSpreadOut;
|
UINT8 ubChanceToSpreadOut;
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////
|
||||||
@@ -165,8 +165,8 @@ void MoveMilitiaSquad(INT16 sMapX, INT16 sMapY, INT16 sTMapX, INT16 sTMapY, BOOL
|
|||||||
{
|
{
|
||||||
// Wilderness->Wilderness movement. Calculate Spread Out chance based on threats.
|
// Wilderness->Wilderness movement. Calculate Spread Out chance based on threats.
|
||||||
|
|
||||||
UINT8 ubNumEnemiesNearOrigin = NumEnemiesInFiveSectors( sMapX, sMapY );
|
UINT16 ubNumEnemiesNearOrigin = NumEnemiesInFiveSectors( sMapX, sMapY );
|
||||||
UINT8 ubNumEnemiesNearTarget = NumEnemiesInFiveSectors( sTMapX, sTMapY );
|
UINT16 ubNumEnemiesNearTarget = NumEnemiesInFiveSectors( sTMapX, sTMapY );
|
||||||
|
|
||||||
if (ubNumEnemiesNearOrigin == 0 &&
|
if (ubNumEnemiesNearOrigin == 0 &&
|
||||||
ubNumEnemiesNearTarget > 0 )
|
ubNumEnemiesNearTarget > 0 )
|
||||||
@@ -264,9 +264,9 @@ void MoveMilitiaSquad(INT16 sMapX, INT16 sMapY, INT16 sTMapX, INT16 sTMapY, BOOL
|
|||||||
|
|
||||||
// Flugente: mobiles take along their gear
|
// Flugente: mobiles take along their gear
|
||||||
// move only gear for those who come new into a sector
|
// move only gear for those who come new into a sector
|
||||||
UINT8 elites = max(0, bElitesDestTeam - pTSectorInfo->ubNumberOfCivsAtLevel[ ELITE_MILITIA ]);
|
UINT16 elites = max(0, bElitesDestTeam - pTSectorInfo->ubNumberOfCivsAtLevel[ ELITE_MILITIA ]);
|
||||||
UINT8 regulars = max(0, bRegularsDestTeam - pTSectorInfo->ubNumberOfCivsAtLevel[ REGULAR_MILITIA ]);
|
UINT16 regulars = max(0, bRegularsDestTeam - pTSectorInfo->ubNumberOfCivsAtLevel[ REGULAR_MILITIA ]);
|
||||||
UINT8 greens = max(0, bGreensDestTeam - pTSectorInfo->ubNumberOfCivsAtLevel[ GREEN_MILITIA ]);
|
UINT16 greens = max(0, bGreensDestTeam - pTSectorInfo->ubNumberOfCivsAtLevel[ GREEN_MILITIA ]);
|
||||||
|
|
||||||
MoveMilitiaEquipment(sMapX, sMapY, sTMapX, sTMapY, elites, regulars, greens);
|
MoveMilitiaEquipment(sMapX, sMapY, sTMapX, sTMapY, elites, regulars, greens);
|
||||||
|
|
||||||
@@ -306,9 +306,9 @@ void MoveMilitiaSquad(INT16 sMapX, INT16 sMapY, INT16 sTMapX, INT16 sTMapY, BOOL
|
|||||||
|
|
||||||
// Flugente: mobiles take along their gear
|
// Flugente: mobiles take along their gear
|
||||||
// move only gear for those who come new into a sector
|
// move only gear for those who come new into a sector
|
||||||
UINT8 elites = max(0, bElitesDestTeam - pTSectorInfo->ubNumberOfCivsAtLevel[ ELITE_MILITIA ]);
|
UINT16 elites = max(0, bElitesDestTeam - pTSectorInfo->ubNumberOfCivsAtLevel[ ELITE_MILITIA ]);
|
||||||
UINT8 regulars = max(0, bRegularsDestTeam - pTSectorInfo->ubNumberOfCivsAtLevel[ REGULAR_MILITIA ]);
|
UINT16 regulars = max(0, bRegularsDestTeam - pTSectorInfo->ubNumberOfCivsAtLevel[ REGULAR_MILITIA ]);
|
||||||
UINT8 greens = max(0, bGreensDestTeam - pTSectorInfo->ubNumberOfCivsAtLevel[ GREEN_MILITIA ]);
|
UINT16 greens = max(0, bGreensDestTeam - pTSectorInfo->ubNumberOfCivsAtLevel[ GREEN_MILITIA ]);
|
||||||
|
|
||||||
MoveMilitiaEquipment(sMapX, sMapY, sTMapX, sTMapY, elites, regulars, greens);
|
MoveMilitiaEquipment(sMapX, sMapY, sTMapX, sTMapY, elites, regulars, greens);
|
||||||
|
|
||||||
@@ -336,7 +336,7 @@ void MoveMilitiaSquad(INT16 sMapX, INT16 sMapY, INT16 sTMapX, INT16 sTMapY, BOOL
|
|||||||
{
|
{
|
||||||
// Source team moves En-Masse to target sector.
|
// Source team moves En-Masse to target sector.
|
||||||
|
|
||||||
bNewDestGroupSize = __min( (NumNonPlayerTeamMembersInSector( sTMapX, sTMapY, MILITIA_TEAM ) + NumNonPlayerTeamMembersInSector( sMapX, sMapY, MILITIA_TEAM )), (UINT8)gGameExternalOptions.iMaxMilitiaPerSector );
|
bNewDestGroupSize = __min( (NumNonPlayerTeamMembersInSector( sTMapX, sTMapY, MILITIA_TEAM ) + NumNonPlayerTeamMembersInSector( sMapX, sMapY, MILITIA_TEAM )), (UINT16)gGameExternalOptions.iMaxMilitiaPerSector );
|
||||||
bNewSourceGroupSize = __max( 0, (NumNonPlayerTeamMembersInSector( sTMapX, sTMapY, MILITIA_TEAM ) + NumNonPlayerTeamMembersInSector( sMapX, sMapY, MILITIA_TEAM )) - gGameExternalOptions.iMaxMilitiaPerSector );
|
bNewSourceGroupSize = __max( 0, (NumNonPlayerTeamMembersInSector( sTMapX, sTMapY, MILITIA_TEAM ) + NumNonPlayerTeamMembersInSector( sMapX, sMapY, MILITIA_TEAM )) - gGameExternalOptions.iMaxMilitiaPerSector );
|
||||||
|
|
||||||
// If there are still going to be two teams after the transfer
|
// If there are still going to be two teams after the transfer
|
||||||
@@ -396,9 +396,9 @@ void MoveMilitiaSquad(INT16 sMapX, INT16 sMapY, INT16 sTMapX, INT16 sTMapY, BOOL
|
|||||||
|
|
||||||
// Flugente: mobiles take along their gear
|
// Flugente: mobiles take along their gear
|
||||||
// move only gear for those who come new into a sector
|
// move only gear for those who come new into a sector
|
||||||
UINT8 elites = max(0, bElitesDestTeam - pTSectorInfo->ubNumberOfCivsAtLevel[ ELITE_MILITIA ]);
|
UINT16 elites = max(0, bElitesDestTeam - pTSectorInfo->ubNumberOfCivsAtLevel[ ELITE_MILITIA ]);
|
||||||
UINT8 regulars = max(0, bRegularsDestTeam - pTSectorInfo->ubNumberOfCivsAtLevel[ REGULAR_MILITIA ]);
|
UINT16 regulars = max(0, bRegularsDestTeam - pTSectorInfo->ubNumberOfCivsAtLevel[ REGULAR_MILITIA ]);
|
||||||
UINT8 greens = max(0, bGreensDestTeam - pTSectorInfo->ubNumberOfCivsAtLevel[ GREEN_MILITIA ]);
|
UINT16 greens = max(0, bGreensDestTeam - pTSectorInfo->ubNumberOfCivsAtLevel[ GREEN_MILITIA ]);
|
||||||
|
|
||||||
MoveMilitiaEquipment(sMapX, sMapY, sTMapX, sTMapY, elites, regulars, greens);
|
MoveMilitiaEquipment(sMapX, sMapY, sTMapX, sTMapY, elites, regulars, greens);
|
||||||
|
|
||||||
@@ -432,9 +432,9 @@ void MoveMilitiaSquad(INT16 sMapX, INT16 sMapY, INT16 sTMapX, INT16 sTMapY, BOOL
|
|||||||
// Flugente: update individual militia data
|
// Flugente: update individual militia data
|
||||||
ApplyTacticalLifeRatioToMilitia( );
|
ApplyTacticalLifeRatioToMilitia( );
|
||||||
|
|
||||||
UINT8 greens = pSectorInfo->ubNumberOfCivsAtLevel[GREEN_MILITIA];
|
UINT16 greens = pSectorInfo->ubNumberOfCivsAtLevel[GREEN_MILITIA];
|
||||||
UINT8 regulars = pSectorInfo->ubNumberOfCivsAtLevel[REGULAR_MILITIA];
|
UINT16 regulars = pSectorInfo->ubNumberOfCivsAtLevel[REGULAR_MILITIA];
|
||||||
UINT8 elites = pSectorInfo->ubNumberOfCivsAtLevel[ELITE_MILITIA];
|
UINT16 elites = pSectorInfo->ubNumberOfCivsAtLevel[ELITE_MILITIA];
|
||||||
|
|
||||||
StrategicRemoveMilitiaFromSector( sMapX, sMapY, GREEN_MILITIA, greens );
|
StrategicRemoveMilitiaFromSector( sMapX, sMapY, GREEN_MILITIA, greens );
|
||||||
StrategicRemoveMilitiaFromSector( sMapX, sMapY, REGULAR_MILITIA, regulars );
|
StrategicRemoveMilitiaFromSector( sMapX, sMapY, REGULAR_MILITIA, regulars );
|
||||||
@@ -549,7 +549,7 @@ UINT16 CountDirectionEnemyRating( INT16 sMapX, INT16 sMapY, UINT8 uiDir )
|
|||||||
for( sLMY = MINIMUM_VALID_Y_COORDINATE; sLMY <= MAXIMUM_VALID_Y_COORDINATE ; ++sLMY )
|
for( sLMY = MINIMUM_VALID_Y_COORDINATE; sLMY <= MAXIMUM_VALID_Y_COORDINATE ; ++sLMY )
|
||||||
{
|
{
|
||||||
// SECTORINFO *pSectorInfo = &( SectorInfo[ uiSector ] );
|
// SECTORINFO *pSectorInfo = &( SectorInfo[ uiSector ] );
|
||||||
UINT8 uiSumOfEnemyTroops = NumNonPlayerTeamMembersInSector( sLMX, sLMY, ENEMY_TEAM );
|
UINT16 uiSumOfEnemyTroops = NumNonPlayerTeamMembersInSector( sLMX, sLMY, ENEMY_TEAM );
|
||||||
//pSectorInfo->ubNumAdmins + pSectorInfo->ubNumTroops + pSectorInfo->ubNumElites;
|
//pSectorInfo->ubNumAdmins + pSectorInfo->ubNumTroops + pSectorInfo->ubNumElites;
|
||||||
|
|
||||||
// there's an enemy
|
// there's an enemy
|
||||||
@@ -605,21 +605,21 @@ UINT16 CountDirectionRating( INT16 sMapX, INT16 sMapY, UINT8 uiDir )
|
|||||||
return iRes;
|
return iRes;
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT8 ubMaxSquadSize = gGameExternalOptions.iMaxMilitiaPerSector;
|
UINT16 ubMaxSquadSize = gGameExternalOptions.iMaxMilitiaPerSector;
|
||||||
|
|
||||||
UINT8 ubSourceGreens = SectorInfo[SECTOR(sMapX, sMapY)].ubNumberOfCivsAtLevel[ GREEN_MILITIA ];
|
UINT16 ubSourceGreens = SectorInfo[SECTOR(sMapX, sMapY)].ubNumberOfCivsAtLevel[ GREEN_MILITIA ];
|
||||||
UINT8 ubSourceRegulars = SectorInfo[SECTOR(sMapX, sMapY)].ubNumberOfCivsAtLevel[ REGULAR_MILITIA ];
|
UINT16 ubSourceRegulars = SectorInfo[SECTOR(sMapX, sMapY)].ubNumberOfCivsAtLevel[ REGULAR_MILITIA ];
|
||||||
UINT8 ubSourceElites = SectorInfo[SECTOR(sMapX, sMapY)].ubNumberOfCivsAtLevel[ ELITE_MILITIA ];
|
UINT16 ubSourceElites = SectorInfo[SECTOR(sMapX, sMapY)].ubNumberOfCivsAtLevel[ ELITE_MILITIA ];
|
||||||
UINT8 ubTargetGreens = SectorInfo[SECTOR(sDMapX, sDMapY)].ubNumberOfCivsAtLevel[ GREEN_MILITIA ];
|
UINT16 ubTargetGreens = SectorInfo[SECTOR(sDMapX, sDMapY)].ubNumberOfCivsAtLevel[ GREEN_MILITIA ];
|
||||||
UINT8 ubTargetRegulars = SectorInfo[SECTOR(sDMapX, sDMapY)].ubNumberOfCivsAtLevel[ REGULAR_MILITIA ];
|
UINT16 ubTargetRegulars = SectorInfo[SECTOR(sDMapX, sDMapY)].ubNumberOfCivsAtLevel[ REGULAR_MILITIA ];
|
||||||
UINT8 ubTargetElites = SectorInfo[SECTOR(sDMapX, sDMapY)].ubNumberOfCivsAtLevel[ ELITE_MILITIA ];
|
UINT16 ubTargetElites = SectorInfo[SECTOR(sDMapX, sDMapY)].ubNumberOfCivsAtLevel[ ELITE_MILITIA ];
|
||||||
|
|
||||||
UINT8 ubSourceMilitia = ubSourceGreens + ubSourceRegulars + ubSourceElites;
|
UINT16 ubSourceMilitia = ubSourceGreens + ubSourceRegulars + ubSourceElites;
|
||||||
UINT8 ubTargetMilitia = ubTargetGreens + ubTargetRegulars + ubTargetElites;
|
UINT16 ubTargetMilitia = ubTargetGreens + ubTargetRegulars + ubTargetElites;
|
||||||
|
|
||||||
UINT16 usSourceEnemiesInFiveSectors = NumEnemiesInFiveSectors( sMapX, sMapY );
|
UINT16 usSourceEnemiesInFiveSectors = NumEnemiesInFiveSectors( sMapX, sMapY );
|
||||||
UINT16 usTargetEnemiesInFiveSectors = NumEnemiesInFiveSectors( sDMapX, sDMapY );
|
UINT16 usTargetEnemiesInFiveSectors = NumEnemiesInFiveSectors( sDMapX, sDMapY );
|
||||||
UINT8 ubTargetEnemies = NumNonPlayerTeamMembersInSector( sDMapX, sDMapY, ENEMY_TEAM );
|
UINT16 ubTargetEnemies = NumNonPlayerTeamMembersInSector( sDMapX, sDMapY, ENEMY_TEAM );
|
||||||
|
|
||||||
UINT16 usSourceMilitiaInFiveSectors = CountAllMilitiaInFiveSectors( sMapX, sMapY );
|
UINT16 usSourceMilitiaInFiveSectors = CountAllMilitiaInFiveSectors( sMapX, sMapY );
|
||||||
UINT16 usTargetMilitiaInFiveSectors = CountAllMilitiaInFiveSectors( sDMapX, sDMapY );
|
UINT16 usTargetMilitiaInFiveSectors = CountAllMilitiaInFiveSectors( sDMapX, sDMapY );
|
||||||
@@ -1112,7 +1112,7 @@ void DoMilitiaHelpFromAdjacentSectors( INT16 sMapX, INT16 sMapY )
|
|||||||
UINT16 pMoveDir[4][3];
|
UINT16 pMoveDir[4][3];
|
||||||
UINT8 uiDirNumber = 0;
|
UINT8 uiDirNumber = 0;
|
||||||
UINT8 x;
|
UINT8 x;
|
||||||
UINT8 uiNumGreen = 0, uiNumReg = 0, uiNumElite = 0;
|
UINT16 uiNumGreen = 0, uiNumReg = 0, uiNumElite = 0;
|
||||||
SECTORINFO *pSectorInfo = &( SectorInfo[ SECTOR( sMapX, sMapY ) ] );
|
SECTORINFO *pSectorInfo = &( SectorInfo[ SECTOR( sMapX, sMapY ) ] );
|
||||||
BOOLEAN fMoreTroopsLeft[4] = {FALSE,FALSE,FALSE,FALSE};
|
BOOLEAN fMoreTroopsLeft[4] = {FALSE,FALSE,FALSE,FALSE};
|
||||||
BOOLEAN fFirstLoop = TRUE;
|
BOOLEAN fFirstLoop = TRUE;
|
||||||
@@ -1175,7 +1175,7 @@ void DoMilitiaHelpFromAdjacentSectors( INT16 sMapX, INT16 sMapY )
|
|||||||
// Flugente: order sNumber reinforcements from src sector to target sector
|
// Flugente: order sNumber reinforcements from src sector to target sector
|
||||||
BOOLEAN CallMilitiaReinforcements( INT16 sTargetMapX, INT16 sTargetMapY, INT16 sSrcMapX, INT16 sSrcMapY, UINT16 sNumber )
|
BOOLEAN CallMilitiaReinforcements( INT16 sTargetMapX, INT16 sTargetMapY, INT16 sSrcMapX, INT16 sSrcMapY, UINT16 sNumber )
|
||||||
{
|
{
|
||||||
UINT8 uiNumGreen = 0, uiNumReg = 0, uiNumElite = 0;
|
UINT16 uiNumGreen = 0, uiNumReg = 0, uiNumElite = 0;
|
||||||
SECTORINFO *pSectorInfo = &( SectorInfo[ SECTOR( sTargetMapX, sTargetMapY ) ] );
|
SECTORINFO *pSectorInfo = &( SectorInfo[ SECTOR( sTargetMapX, sTargetMapY ) ] );
|
||||||
|
|
||||||
guiDirNumber = 0;
|
guiDirNumber = 0;
|
||||||
@@ -1236,9 +1236,9 @@ BOOLEAN CallMilitiaReinforcements( INT16 sTargetMapX, INT16 sTargetMapY, INT16 s
|
|||||||
{
|
{
|
||||||
++sMilitiaMoved;
|
++sMilitiaMoved;
|
||||||
|
|
||||||
UINT8 militia_green = MilitiaInSectorOfRank( sTargetMapX, sTargetMapY, GREEN_MILITIA );
|
UINT16 militia_green = MilitiaInSectorOfRank( sTargetMapX, sTargetMapY, GREEN_MILITIA );
|
||||||
UINT8 militia_troop = MilitiaInSectorOfRank( sTargetMapX, sTargetMapY, REGULAR_MILITIA );
|
UINT16 militia_troop = MilitiaInSectorOfRank( sTargetMapX, sTargetMapY, REGULAR_MILITIA );
|
||||||
UINT8 militia_elite = MilitiaInSectorOfRank( sTargetMapX, sTargetMapY, ELITE_MILITIA );
|
UINT16 militia_elite = MilitiaInSectorOfRank( sTargetMapX, sTargetMapY, ELITE_MILITIA );
|
||||||
|
|
||||||
gpAttackDirs[guiDirNumber][0] += militia_green - uiNumGreen;
|
gpAttackDirs[guiDirNumber][0] += militia_green - uiNumGreen;
|
||||||
gpAttackDirs[guiDirNumber][1] += militia_troop - uiNumReg;
|
gpAttackDirs[guiDirNumber][1] += militia_troop - uiNumReg;
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
//#define MAXIMUM_MILITIA_SQUAD_SIZE 30
|
//#define MAXIMUM_MILITIA_SQUAD_SIZE 30
|
||||||
|
|
||||||
extern UINT8 gpAttackDirs[5][4];
|
extern UINT16 gpAttackDirs[5][4];
|
||||||
extern UINT8 guiDirNumber;
|
extern UINT8 guiDirNumber;
|
||||||
|
|
||||||
// Flugente: militia in this sector is ordered to move according to flags that were applied to it prior
|
// Flugente: militia in this sector is ordered to move according to flags that were applied to it prior
|
||||||
@@ -50,4 +50,4 @@ void DissolveAllMilitiaGroupsInSector( INT16 sMapX, INT16 sMapY );
|
|||||||
|
|
||||||
BOOLEAN MilitiaGroupEntersCurrentSector( UINT8 usGroupId, INT16 sMapX, INT16 sMapY );
|
BOOLEAN MilitiaGroupEntersCurrentSector( UINT8 usGroupId, INT16 sMapX, INT16 sMapY );
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1089,9 +1089,9 @@ namespace MiniEventHelpers
|
|||||||
INT16 x = 0;
|
INT16 x = 0;
|
||||||
INT16 y = 0;
|
INT16 y = 0;
|
||||||
INT8 z = 0;
|
INT8 z = 0;
|
||||||
for (UINT32 i = gTacticalStatus.Team[OUR_TEAM].bFirstID; i <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++i)
|
for (SoldierID i = gTacticalStatus.Team[OUR_TEAM].bFirstID; i <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++i)
|
||||||
{
|
{
|
||||||
const SOLDIERTYPE* merc = MercPtrs[i];
|
const SOLDIERTYPE* merc = i;
|
||||||
if (merc && merc->ubProfile == profileId)
|
if (merc && merc->ubProfile == profileId)
|
||||||
{
|
{
|
||||||
x = merc->sSectorX;
|
x = merc->sSectorX;
|
||||||
@@ -1519,9 +1519,9 @@ void MiniEventsLua(UINT32 eventId)
|
|||||||
gAllMercs.clear();
|
gAllMercs.clear();
|
||||||
|
|
||||||
// get all mercs eligible to get a mini event
|
// get all mercs eligible to get a mini event
|
||||||
for (UINT32 cnt = gTacticalStatus.Team[OUR_TEAM].bFirstID; cnt <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++cnt)
|
for (SoldierID cnt = gTacticalStatus.Team[OUR_TEAM].bFirstID; cnt <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++cnt)
|
||||||
{
|
{
|
||||||
SOLDIERTYPE* pSoldier = MercPtrs[ cnt ];
|
SOLDIERTYPE* pSoldier = cnt;
|
||||||
|
|
||||||
if (pSoldier && pSoldier->bActive
|
if (pSoldier && pSoldier->bActive
|
||||||
&& pSoldier->stats.bLife > 0
|
&& pSoldier->stats.bLife > 0
|
||||||
@@ -1542,9 +1542,9 @@ void MiniEventsLua(UINT32 eventId)
|
|||||||
|
|
||||||
// second param: a table containing basic info about all of the player's mercs ({ nickname = profileid })
|
// second param: a table containing basic info about all of the player's mercs ({ nickname = profileid })
|
||||||
f.TableOpen();
|
f.TableOpen();
|
||||||
for (UINT32 i = gTacticalStatus.Team[OUR_TEAM].bFirstID; i <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++i)
|
for (SoldierID i = gTacticalStatus.Team[OUR_TEAM].bFirstID; i <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++i)
|
||||||
{
|
{
|
||||||
const SOLDIERTYPE* merc = MercPtrs[i];
|
const SOLDIERTYPE* merc = i;
|
||||||
if (merc && merc->bActive && merc->bAssignment != IN_TRANSIT && !(merc->flags.uiStatusFlags & SOLDIER_VEHICLE) && !(AM_A_ROBOT(merc)))
|
if (merc && merc->bActive && merc->bAssignment != IN_TRANSIT && !(merc->flags.uiStatusFlags & SOLDIER_VEHICLE) && !(AM_A_ROBOT(merc)))
|
||||||
{
|
{
|
||||||
std::wstring ws(gMercProfiles[merc->ubProfile].zNickname);
|
std::wstring ws(gMercProfiles[merc->ubProfile].zNickname);
|
||||||
@@ -1561,9 +1561,9 @@ void MiniEventsLua(UINT32 eventId)
|
|||||||
LuaFunction f = LuaFunction(gLS, "BeginRandomEvent");
|
LuaFunction f = LuaFunction(gLS, "BeginRandomEvent");
|
||||||
// first param: a table containing basic info about all of the player's mercs ({ nickname = profileid })
|
// first param: a table containing basic info about all of the player's mercs ({ nickname = profileid })
|
||||||
f.TableOpen();
|
f.TableOpen();
|
||||||
for (UINT32 i = gTacticalStatus.Team[OUR_TEAM].bFirstID; i <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++i)
|
for ( SoldierID i = gTacticalStatus.Team[OUR_TEAM].bFirstID; i <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++i)
|
||||||
{
|
{
|
||||||
const SOLDIERTYPE* merc = MercPtrs[i];
|
const SOLDIERTYPE* merc = i;
|
||||||
if (merc && merc->bActive && merc->bAssignment != IN_TRANSIT && !(merc->flags.uiStatusFlags & SOLDIER_VEHICLE) && !(AM_A_ROBOT(merc)))
|
if (merc && merc->bActive && merc->bAssignment != IN_TRANSIT && !(merc->flags.uiStatusFlags & SOLDIER_VEHICLE) && !(AM_A_ROBOT(merc)))
|
||||||
{
|
{
|
||||||
std::wstring ws(gMercProfiles[merc->ubProfile].zNickname);
|
std::wstring ws(gMercProfiles[merc->ubProfile].zNickname);
|
||||||
|
|||||||
@@ -543,7 +543,7 @@ BOOLEAN SetThisSectorAsEnemyControlled( INT16 sMapX, INT16 sMapY, INT8 bMapZ, BO
|
|||||||
{
|
{
|
||||||
// Enemies can steal items left lying about, each one can carry out up to X kg (defined in RemoveRandomItemsInSector).
|
// Enemies can steal items left lying about, each one can carry out up to X kg (defined in RemoveRandomItemsInSector).
|
||||||
// Don't care underground sectors here -- we are in overground code branch.
|
// Don't care underground sectors here -- we are in overground code branch.
|
||||||
UINT8 ubNumAdmins, ubNumTroops, ubNumElites, ubNumRobots, ubNumTanks, ubNumJeeps;
|
UINT16 ubNumAdmins, ubNumTroops, ubNumElites, ubNumRobots, ubNumTanks, ubNumJeeps;
|
||||||
GetNumberOfStationaryEnemiesInSector( sMapX, sMapY, &ubNumAdmins, &ubNumTroops, &ubNumElites, &ubNumRobots, &ubNumTanks, &ubNumJeeps );
|
GetNumberOfStationaryEnemiesInSector( sMapX, sMapY, &ubNumAdmins, &ubNumTroops, &ubNumElites, &ubNumRobots, &ubNumTanks, &ubNumJeeps );
|
||||||
RemoveRandomItemsInSector( sMapX, sMapY, bMapZ, (UINT32)ubNumAdmins + ubNumTroops + ubNumElites );
|
RemoveRandomItemsInSector( sMapX, sMapY, bMapZ, (UINT32)ubNumAdmins + ubNumTroops + ubNumElites );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -296,11 +296,10 @@ FLOAT gAmbushRadiusModifier = 1.0f;
|
|||||||
void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI )
|
void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI )
|
||||||
{
|
{
|
||||||
VOBJECT_DESC VObjectDesc;
|
VOBJECT_DESC VObjectDesc;
|
||||||
INT32 i;
|
|
||||||
UINT8 ubGroupID = 0;
|
UINT8 ubGroupID = 0;
|
||||||
UINT8 ubNumStationaryEnemies = 0;
|
UINT16 ubNumStationaryEnemies = 0;
|
||||||
UINT8 ubNumMobileEnemies = 0;
|
UINT16 ubNumMobileEnemies = 0;
|
||||||
UINT8 ubNumMercs;
|
UINT16 ubNumMercs;
|
||||||
BOOLEAN fUsePluralVersion = FALSE;
|
BOOLEAN fUsePluralVersion = FALSE;
|
||||||
INT8 bBestExpLevel = 0;
|
INT8 bBestExpLevel = 0;
|
||||||
BOOLEAN fRetreatAnOption = TRUE;
|
BOOLEAN fRetreatAnOption = TRUE;
|
||||||
@@ -407,8 +406,6 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI )
|
|||||||
gubPBSectorY = gpBattleGroup->ubSectorY;
|
gubPBSectorY = gpBattleGroup->ubSectorY;
|
||||||
gubPBSectorZ = gpBattleGroup->ubSectorZ;
|
gubPBSectorZ = gpBattleGroup->ubSectorZ;
|
||||||
|
|
||||||
// get number of enemies thought to be here
|
|
||||||
SectorInfo[SECTOR( gubPBSectorX, gubPBSectorY )].bLastKnownEnemies = NumNonPlayerTeamMembersInSector( gubPBSectorX, gubPBSectorY, ENEMY_TEAM );
|
|
||||||
fMapPanelDirty = TRUE;
|
fMapPanelDirty = TRUE;
|
||||||
}
|
}
|
||||||
else if( gfPersistantPBI )
|
else if( gfPersistantPBI )
|
||||||
@@ -602,11 +599,12 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI )
|
|||||||
//Count the number of players involved or not involved in this battle
|
//Count the number of players involved or not involved in this battle
|
||||||
guiNumUninvolved = 0;
|
guiNumUninvolved = 0;
|
||||||
guiNumInvolved = 0;
|
guiNumInvolved = 0;
|
||||||
for( i = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; i <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; ++i )
|
for( SoldierID i = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; i <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; ++i )
|
||||||
{
|
{
|
||||||
if( MercPtrs[ i ]->bActive && MercPtrs[ i ]->stats.bLife && !(MercPtrs[ i ]->flags.uiStatusFlags & SOLDIER_VEHICLE) )
|
SOLDIERTYPE *pSoldier = i;
|
||||||
|
if( pSoldier->bActive && pSoldier->stats.bLife && !(pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE) )
|
||||||
{
|
{
|
||||||
if ( PlayerMercInvolvedInThisCombat( MercPtrs[ i ] ) )
|
if ( PlayerMercInvolvedInThisCombat( pSoldier ) )
|
||||||
{
|
{
|
||||||
// involved
|
// involved
|
||||||
if( !ubGroupID )
|
if( !ubGroupID )
|
||||||
@@ -615,13 +613,13 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI )
|
|||||||
//can detect it by comparing the first value with future values. If we do, then
|
//can detect it by comparing the first value with future values. If we do, then
|
||||||
//we set a flag which determines whether to use the singular help text or plural version
|
//we set a flag which determines whether to use the singular help text or plural version
|
||||||
//for the retreat button.
|
//for the retreat button.
|
||||||
ubGroupID = MercPtrs[ i ]->ubGroupID;
|
ubGroupID = pSoldier->ubGroupID;
|
||||||
if( !gpBattleGroup )
|
if( !gpBattleGroup )
|
||||||
gpBattleGroup = GetGroup( ubGroupID );
|
gpBattleGroup = GetGroup( ubGroupID );
|
||||||
//if( bBestExpLevel > MercPtrs[ i ]->stats.bExpLevel ) // SANDRO - WTF!! This is a bug!
|
//if( bBestExpLevel > pSoldier->stats.bExpLevel ) // SANDRO - WTF!! This is a bug!
|
||||||
if( bBestExpLevel < MercPtrs[ i ]->stats.bExpLevel ) // SANDRO - WTF!! This is a bug!
|
if( bBestExpLevel < pSoldier->stats.bExpLevel ) // SANDRO - WTF!! This is a bug!
|
||||||
bBestExpLevel = MercPtrs[ i ]->stats.bExpLevel;
|
bBestExpLevel = pSoldier->stats.bExpLevel;
|
||||||
if( MercPtrs[ i ]->ubPrevSectorID == 255 )
|
if( pSoldier->ubPrevSectorID == 255 )
|
||||||
{ //Not able to retreat (calculate it for group)
|
{ //Not able to retreat (calculate it for group)
|
||||||
GROUP *pTempGroup;
|
GROUP *pTempGroup;
|
||||||
pTempGroup = GetGroup( ubGroupID );
|
pTempGroup = GetGroup( ubGroupID );
|
||||||
@@ -629,7 +627,7 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI )
|
|||||||
CalculateGroupRetreatSector( pTempGroup );
|
CalculateGroupRetreatSector( pTempGroup );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if( ubGroupID != MercPtrs[ i ]->ubGroupID )
|
else if( ubGroupID != pSoldier->ubGroupID )
|
||||||
{
|
{
|
||||||
fUsePluralVersion = TRUE;
|
fUsePluralVersion = TRUE;
|
||||||
}
|
}
|
||||||
@@ -637,23 +635,23 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI )
|
|||||||
++guiNumInvolved;
|
++guiNumInvolved;
|
||||||
|
|
||||||
// SANDRO - added check if we have a scout in group, needed later
|
// SANDRO - added check if we have a scout in group, needed later
|
||||||
if( gGameOptions.fNewTraitSystem && HAS_SKILL_TRAIT( MercPtrs[ i ], SCOUTING_NT ) && gSkillTraitValues.fSCPreventsTheEnemyToAmbushMercs )
|
if( gGameOptions.fNewTraitSystem && HAS_SKILL_TRAIT( pSoldier, SCOUTING_NT ) && gSkillTraitValues.fSCPreventsTheEnemyToAmbushMercs )
|
||||||
{
|
{
|
||||||
fScoutPresent = TRUE;
|
fScoutPresent = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( MercPtrs[i]->usSoldierFlagMask & SOLDIER_AIRDROP )
|
if ( pSoldier->usSoldierFlagMask & SOLDIER_AIRDROP )
|
||||||
{
|
{
|
||||||
fAirDrop = TRUE;
|
fAirDrop = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT16 deploymentleadership = EffectiveLeadership( MercPtrs[i] );
|
UINT16 deploymentleadership = EffectiveLeadership( pSoldier );
|
||||||
FLOAT ambushradiusmodifier = 10 * EffectiveExpLevel( MercPtrs[i] ) + MercPtrs[i]->GetBackgroundValue( BG_AMBUSH_RADIUS );
|
FLOAT ambushradiusmodifier = 10 * EffectiveExpLevel( pSoldier ) + pSoldier->GetBackgroundValue( BG_AMBUSH_RADIUS );
|
||||||
if ( gGameOptions.fNewTraitSystem )
|
if ( gGameOptions.fNewTraitSystem )
|
||||||
{
|
{
|
||||||
deploymentleadership += 50 * NUM_SKILL_TRAITS( MercPtrs[i], SQUADLEADER_NT );
|
deploymentleadership += 50 * NUM_SKILL_TRAITS( pSoldier, SQUADLEADER_NT );
|
||||||
|
|
||||||
ambushradiusmodifier += 50 * NUM_SKILL_TRAITS( MercPtrs[i], SCOUTING_NT );
|
ambushradiusmodifier += 50 * NUM_SKILL_TRAITS( pSoldier, SCOUTING_NT );
|
||||||
}
|
}
|
||||||
// bonus with old traits, so that the check can be won
|
// bonus with old traits, so that the check can be won
|
||||||
else
|
else
|
||||||
@@ -666,7 +664,7 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI )
|
|||||||
gAmbushRadiusModifier = max( gAmbushRadiusModifier, ambushradiusmodifier / 100 );
|
gAmbushRadiusModifier = max( gAmbushRadiusModifier, ambushradiusmodifier / 100 );
|
||||||
|
|
||||||
// Flugente: if a merc is inserted from concealed state, retreat is forbidden, as at least this merc will have to extract manually
|
// Flugente: if a merc is inserted from concealed state, retreat is forbidden, as at least this merc will have to extract manually
|
||||||
if ( MercPtrs[i]->usSoldierFlagMask2 & SOLDIER_CONCEALINSERTION )
|
if ( pSoldier->usSoldierFlagMask2 & SOLDIER_CONCEALINSERTION )
|
||||||
fRetreatAnOption = FALSE;
|
fRetreatAnOption = FALSE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -890,16 +888,17 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI )
|
|||||||
// SANDRO - merc records - ambush experienced
|
// SANDRO - merc records - ambush experienced
|
||||||
if ( GetEnemyEncounterCode() == ENEMY_AMBUSH_CODE || GetEnemyEncounterCode() == BLOODCAT_AMBUSH_CODE || GetEnemyEncounterCode() == ENEMY_AMBUSH_DEPLOYMENT_CODE || fAmbushPrevented )
|
if ( GetEnemyEncounterCode() == ENEMY_AMBUSH_CODE || GetEnemyEncounterCode() == BLOODCAT_AMBUSH_CODE || GetEnemyEncounterCode() == ENEMY_AMBUSH_DEPLOYMENT_CODE || fAmbushPrevented )
|
||||||
{
|
{
|
||||||
for( i = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; i <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; ++i )
|
for( SoldierID i = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; i <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; ++i )
|
||||||
{
|
{
|
||||||
if( MercPtrs[ i ]->bActive && MercPtrs[ i ]->stats.bLife && !(MercPtrs[ i ]->flags.uiStatusFlags & SOLDIER_VEHICLE) )
|
SOLDIERTYPE *pSoldier = i;
|
||||||
|
if( pSoldier->bActive && pSoldier->stats.bLife && !(pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE) )
|
||||||
{
|
{
|
||||||
if ( PlayerMercInvolvedInThisCombat( MercPtrs[ i ] ) && MercPtrs[ i ]->ubProfile != NO_PROFILE )
|
if ( PlayerMercInvolvedInThisCombat( pSoldier ) && pSoldier->ubProfile != NO_PROFILE )
|
||||||
{
|
{
|
||||||
if ( GetEnemyEncounterCode() == ENEMY_AMBUSH_CODE || GetEnemyEncounterCode() == BLOODCAT_AMBUSH_CODE || GetEnemyEncounterCode() == ENEMY_AMBUSH_DEPLOYMENT_CODE )
|
if ( GetEnemyEncounterCode() == ENEMY_AMBUSH_CODE || GetEnemyEncounterCode() == BLOODCAT_AMBUSH_CODE || GetEnemyEncounterCode() == ENEMY_AMBUSH_DEPLOYMENT_CODE )
|
||||||
gMercProfiles[ MercPtrs[ i ]->ubProfile ].records.usAmbushesExperienced++;
|
gMercProfiles[ pSoldier->ubProfile ].records.usAmbushesExperienced++;
|
||||||
else if ( fAmbushPrevented && HAS_SKILL_TRAIT( MercPtrs[ i ], SCOUTING_NT ) ) // Scouts actually get this as number of prevented ambushes
|
else if ( fAmbushPrevented && HAS_SKILL_TRAIT( pSoldier, SCOUTING_NT ) ) // Scouts actually get this as number of prevented ambushes
|
||||||
gMercProfiles[ MercPtrs[ i ]->ubProfile ].records.usAmbushesExperienced++;
|
gMercProfiles[ pSoldier->ubProfile ].records.usAmbushesExperienced++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1547,14 +1546,12 @@ void RenderPreBattleInterface()
|
|||||||
{
|
{
|
||||||
// don't know how many
|
// don't know how many
|
||||||
swprintf( str, L"?" );
|
swprintf( str, L"?" );
|
||||||
SectorInfo[ SECTOR( gubPBSectorX, gubPBSectorY ) ].bLastKnownEnemies = -2;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// know exactly how many
|
// know exactly how many
|
||||||
i = NumNonPlayerTeamMembersInSector( gubPBSectorX, gubPBSectorY, ENEMY_TEAM );
|
i = NumNonPlayerTeamMembersInSector( gubPBSectorX, gubPBSectorY, ENEMY_TEAM );
|
||||||
swprintf( str, L"%d", i );
|
swprintf( str, L"%d", i );
|
||||||
SectorInfo[ SECTOR( gubPBSectorX, gubPBSectorY ) ].bLastKnownEnemies = (INT8)i;
|
|
||||||
}
|
}
|
||||||
x = 57 + (27 - StringPixLength( str, FONT14ARIAL )) / 2;
|
x = 57 + (27 - StringPixLength( str, FONT14ARIAL )) / 2;
|
||||||
y = 36;
|
y = 36;
|
||||||
@@ -1579,22 +1576,23 @@ void RenderPreBattleInterface()
|
|||||||
// | NAME | ASSIGN | COND | HP | BP |
|
// | NAME | ASSIGN | COND | HP | BP |
|
||||||
line = 0;
|
line = 0;
|
||||||
y = TOP_Y + TOP_Y_TEXT_BUFFER - bListOffset;
|
y = TOP_Y + TOP_Y_TEXT_BUFFER - bListOffset;
|
||||||
for( i = gTacticalStatus.Team[OUR_TEAM].bFirstID; i <= gTacticalStatus.Team[OUR_TEAM].bLastID; i++)
|
for( SoldierID id = gTacticalStatus.Team[OUR_TEAM].bFirstID; id <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++id)
|
||||||
{
|
{
|
||||||
if( MercPtrs[i]->bActive && MercPtrs[i]->stats.bLife && !(MercPtrs[i]->flags.uiStatusFlags & SOLDIER_VEHICLE) )
|
SOLDIERTYPE *pSoldier = id;
|
||||||
|
if( pSoldier->bActive && pSoldier->stats.bLife && !(pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE) )
|
||||||
{
|
{
|
||||||
if( PlayerMercInvolvedInThisCombat( MercPtrs[ i ] ) )
|
if( PlayerMercInvolvedInThisCombat( pSoldier ) )
|
||||||
{
|
{
|
||||||
//NAME
|
//NAME
|
||||||
wcscpy( str, MercPtrs[ i ]->name );
|
wcscpy( str, pSoldier->name );
|
||||||
x = 17 + (52 - StringPixLength(str, BLOCKFONT2)) / 2;
|
x = 17 + (52 - StringPixLength(str, BLOCKFONT2)) / 2;
|
||||||
mprintf( x + xOffset, y + yOffset, str );
|
mprintf( x + xOffset, y + yOffset, str );
|
||||||
//ASSIGN
|
//ASSIGN
|
||||||
GetMapscreenMercAssignmentString( MercPtrs[ i ], str );
|
GetMapscreenMercAssignmentString( pSoldier, str );
|
||||||
x = 72 + (54 - StringPixLength(str, BLOCKFONT2)) / 2;
|
x = 72 + (54 - StringPixLength(str, BLOCKFONT2)) / 2;
|
||||||
mprintf( x + xOffset, y + yOffset, str );
|
mprintf( x + xOffset, y + yOffset, str );
|
||||||
//COND
|
//COND
|
||||||
GetSoldierConditionInfo( MercPtrs[ i ], str, &ubHPPercent, &ubBPPercent );
|
GetSoldierConditionInfo( pSoldier, str, &ubHPPercent, &ubBPPercent );
|
||||||
x = 129 + (58 - StringPixLength(str, BLOCKFONT2)) / 2;
|
x = 129 + (58 - StringPixLength(str, BLOCKFONT2)) / 2;
|
||||||
mprintf( x + xOffset, y + yOffset, str );
|
mprintf( x + xOffset, y + yOffset, str );
|
||||||
//HP
|
//HP
|
||||||
@@ -1624,33 +1622,34 @@ void RenderPreBattleInterface()
|
|||||||
{
|
{
|
||||||
pGroup = gpGroupList;
|
pGroup = gpGroupList;
|
||||||
y = TOP_Y + TOP_Y_TEXT_BUFFER + ubUninvolvedStartY + UNINVOLVED_RELEVANT_HEIGHT - bListOffset;
|
y = TOP_Y + TOP_Y_TEXT_BUFFER + ubUninvolvedStartY + UNINVOLVED_RELEVANT_HEIGHT - bListOffset;
|
||||||
for( i = gTacticalStatus.Team[OUR_TEAM].bFirstID; i <= gTacticalStatus.Team[OUR_TEAM].bLastID; i++ )
|
for( SoldierID id = gTacticalStatus.Team[OUR_TEAM].bFirstID; id <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++id )
|
||||||
{
|
{
|
||||||
if( MercPtrs[ i ]->bActive && MercPtrs[ i ]->stats.bLife && !(MercPtrs[ i ]->flags.uiStatusFlags & SOLDIER_VEHICLE) )
|
SOLDIERTYPE *pSoldier = id;
|
||||||
|
if( pSoldier->bActive && pSoldier->stats.bLife && !(pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE) )
|
||||||
{
|
{
|
||||||
if( !PlayerMercInvolvedInThisCombat(MercPtrs[ i ]) )
|
if( !PlayerMercInvolvedInThisCombat(pSoldier) )
|
||||||
{
|
{
|
||||||
//NAME
|
//NAME
|
||||||
wcscpy( str, MercPtrs[ i ]->name );
|
wcscpy( str, pSoldier->name );
|
||||||
x = 17 + (52 - StringPixLength(str, BLOCKFONT2)) / 2;
|
x = 17 + (52 - StringPixLength(str, BLOCKFONT2)) / 2;
|
||||||
mprintf( x + xOffset, y + yOffset, str );
|
mprintf( x + xOffset, y + yOffset, str );
|
||||||
//ASSIGN
|
//ASSIGN
|
||||||
GetMapscreenMercAssignmentString( MercPtrs[ i ], str );
|
GetMapscreenMercAssignmentString( pSoldier, str );
|
||||||
x = 72 + (54 - StringPixLength(str, BLOCKFONT2)) / 2;
|
x = 72 + (54 - StringPixLength(str, BLOCKFONT2)) / 2;
|
||||||
mprintf( x + xOffset, y + yOffset, str );
|
mprintf( x + xOffset, y + yOffset, str );
|
||||||
//LOC
|
//LOC
|
||||||
GetMapscreenMercLocationString( MercPtrs[ i ], str );
|
GetMapscreenMercLocationString( pSoldier, str );
|
||||||
x = 128 + (33 - StringPixLength(str, BLOCKFONT2)) / 2;
|
x = 128 + (33 - StringPixLength(str, BLOCKFONT2)) / 2;
|
||||||
mprintf( x + xOffset, y + yOffset, str );
|
mprintf( x + xOffset, y + yOffset, str );
|
||||||
//DEST
|
//DEST
|
||||||
GetMapscreenMercDestinationString( MercPtrs[ i ], str );
|
GetMapscreenMercDestinationString( pSoldier, str );
|
||||||
if (wcslen(str) > 0)
|
if (wcslen(str) > 0)
|
||||||
{
|
{
|
||||||
x = 164 + (41 - StringPixLength(str, BLOCKFONT2)) / 2;
|
x = 164 + (41 - StringPixLength(str, BLOCKFONT2)) / 2;
|
||||||
mprintf( x + xOffset, y + yOffset, str );
|
mprintf( x + xOffset, y + yOffset, str );
|
||||||
}
|
}
|
||||||
//DEP
|
//DEP
|
||||||
GetMapscreenMercDepartureString( MercPtrs[ i ], str, &ubJunk );
|
GetMapscreenMercDepartureString( pSoldier, str, &ubJunk );
|
||||||
x = 208 + (34 - StringPixLength(str, BLOCKFONT2)) / 2;
|
x = 208 + (34 - StringPixLength(str, BLOCKFONT2)) / 2;
|
||||||
mprintf(x + xOffset, y + yOffset, str);
|
mprintf(x + xOffset, y + yOffset, str);
|
||||||
|
|
||||||
@@ -1816,12 +1815,13 @@ void RetreatMercsCallback( GUI_BUTTON *btn, INT32 reason )
|
|||||||
{
|
{
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
// SANDRO - merc records - times retreated counter
|
// SANDRO - merc records - times retreated counter
|
||||||
for( UINT8 i = gTacticalStatus.Team[ gbPlayerNum ].bFirstID; i <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; i++ )
|
for( SoldierID i = gTacticalStatus.Team[ gbPlayerNum ].bFirstID; i <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++i )
|
||||||
{
|
{
|
||||||
if ( MercPtrs[i]->bActive && MercPtrs[i]->stats.bLife >= OKLIFE )
|
SOLDIERTYPE *pSoldier = i;
|
||||||
|
if ( pSoldier->bActive && pSoldier->stats.bLife >= OKLIFE )
|
||||||
{
|
{
|
||||||
if ( PlayerMercInvolvedInThisCombat( MercPtrs[i] ) && MercPtrs[i]->ubProfile != NO_PROFILE )
|
if ( PlayerMercInvolvedInThisCombat( pSoldier ) && pSoldier->ubProfile != NO_PROFILE )
|
||||||
gMercProfiles[ MercPtrs[i]->ubProfile ].records.usBattlesRetreated++;
|
gMercProfiles[ pSoldier->ubProfile ].records.usBattlesRetreated++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
@@ -2387,9 +2387,9 @@ void RetreatAllInvolvedMilitiaGroups()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// as group size will be cut to MAX_STRATEGIC_ENEMY_GROUP_SIZE, see how many troops are allowed and reduce sector count accordingly
|
// as group size will be cut to MAX_STRATEGIC_ENEMY_GROUP_SIZE, see how many troops are allowed and reduce sector count accordingly
|
||||||
UINT8 greens = pSector->ubNumberOfCivsAtLevel[0];
|
UINT16 greens = pSector->ubNumberOfCivsAtLevel[0];
|
||||||
UINT8 regulars = pSector->ubNumberOfCivsAtLevel[1];
|
UINT16 regulars = pSector->ubNumberOfCivsAtLevel[1];
|
||||||
UINT8 elites = pSector->ubNumberOfCivsAtLevel[2];
|
UINT16 elites = pSector->ubNumberOfCivsAtLevel[2];
|
||||||
|
|
||||||
pGroup = CreateNewMilitiaGroupDepartingFromSector( SECTOR( sBattleSectorX, sBattleSectorY ), greens, regulars, elites );
|
pGroup = CreateNewMilitiaGroupDepartingFromSector( SECTOR( sBattleSectorX, sBattleSectorY ), greens, regulars, elites );
|
||||||
|
|
||||||
@@ -2557,20 +2557,19 @@ BOOLEAN CurrentBattleSectorIs( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ )
|
|||||||
|
|
||||||
void CheckForRobotAndIfItsControlled( void )
|
void CheckForRobotAndIfItsControlled( void )
|
||||||
{
|
{
|
||||||
INT32 i;
|
|
||||||
|
|
||||||
// search for the robot on player's team
|
// search for the robot on player's team
|
||||||
for( i = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; i <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; i++ )
|
for( SoldierID i = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; i <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; ++i )
|
||||||
{
|
{
|
||||||
if( MercPtrs[ i ]->bActive && MercPtrs[ i ]->stats.bLife && AM_A_ROBOT( MercPtrs[ i ] ))
|
SOLDIERTYPE *pSoldier = i;
|
||||||
|
if( pSoldier->bActive && pSoldier->stats.bLife && AM_A_ROBOT( pSoldier ))
|
||||||
{
|
{
|
||||||
// check whether it has a valid controller with it. This sets its ubRobotRemoteHolderID field.
|
// check whether it has a valid controller with it. This sets its ubRobotRemoteHolderID field.
|
||||||
MercPtrs[ i ]->UpdateRobotControllerGivenRobot( );
|
pSoldier->UpdateRobotControllerGivenRobot( );
|
||||||
|
|
||||||
// if he has a controller, set controllers
|
// if he has a controller, set controllers
|
||||||
if ( MercPtrs[ i ]->ubRobotRemoteHolderID != NOBODY )
|
if ( pSoldier->ubRobotRemoteHolderID != NOBODY )
|
||||||
{
|
{
|
||||||
MercPtrs[ MercPtrs[ i ]->ubRobotRemoteHolderID ]->UpdateRobotControllerGivenController( );
|
pSoldier->ubRobotRemoteHolderID->UpdateRobotControllerGivenController( );
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|||||||
+80
-179
@@ -103,13 +103,13 @@ void ValidateEnemiesHaveWeapons()
|
|||||||
{
|
{
|
||||||
#ifdef JA2BETAVERSION
|
#ifdef JA2BETAVERSION
|
||||||
SGPRect CenteringRect= {0 + xResOffset, 0, SCREEN_WIDTH - xResOffset, SCREEN_HEIGHT };
|
SGPRect CenteringRect= {0 + xResOffset, 0, SCREEN_WIDTH - xResOffset, SCREEN_HEIGHT };
|
||||||
INT32 i, iErrorDialog;
|
INT32 iErrorDialog;
|
||||||
SOLDIERTYPE *pSoldier;
|
SOLDIERTYPE *pSoldier;
|
||||||
INT32 iNumInvalid = 0;
|
INT32 iNumInvalid = 0;
|
||||||
|
|
||||||
for( i = gTacticalStatus.Team[ ENEMY_TEAM ].bFirstID; i <= gTacticalStatus.Team[ ENEMY_TEAM ].bLastID; ++i )
|
for( SoldierID i = gTacticalStatus.Team[ ENEMY_TEAM ].bFirstID; i <= gTacticalStatus.Team[ ENEMY_TEAM ].bLastID; ++i )
|
||||||
{
|
{
|
||||||
pSoldier = MercPtrs[ i ];
|
pSoldier = i;
|
||||||
if( !pSoldier->bActive || !pSoldier->bInSector )
|
if( !pSoldier->bActive || !pSoldier->bInSector )
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
@@ -141,9 +141,9 @@ void ValidateEnemiesHaveWeapons()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Counts enemies and crepitus, but not bloodcats.
|
//Counts enemies and crepitus, but not bloodcats.
|
||||||
UINT8 NumHostilesInSector( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ )
|
UINT16 NumHostilesInSector( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ )
|
||||||
{
|
{
|
||||||
UINT8 ubNumHostiles = 0;
|
UINT16 ubNumHostiles = 0;
|
||||||
|
|
||||||
AssertGE( sSectorX, MINIMUM_VALID_X_COORDINATE);
|
AssertGE( sSectorX, MINIMUM_VALID_X_COORDINATE);
|
||||||
AssertLE( sSectorX, MAXIMUM_VALID_X_COORDINATE );
|
AssertLE( sSectorX, MAXIMUM_VALID_X_COORDINATE );
|
||||||
@@ -158,7 +158,7 @@ UINT8 NumHostilesInSector( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ )
|
|||||||
pSector = FindUnderGroundSector( sSectorX, sSectorY, (UINT8)sSectorZ );
|
pSector = FindUnderGroundSector( sSectorX, sSectorY, (UINT8)sSectorZ );
|
||||||
if( pSector )
|
if( pSector )
|
||||||
{
|
{
|
||||||
ubNumHostiles = (UINT8)(pSector->ubNumAdmins + pSector->ubNumTroops + pSector->ubNumElites + pSector->ubNumCreatures + pSector->ubNumRobots + pSector->ubNumJeeps + pSector->ubNumTanks);
|
ubNumHostiles = (pSector->ubNumAdmins + pSector->ubNumTroops + pSector->ubNumElites + pSector->ubNumCreatures + pSector->ubNumRobots + pSector->ubNumJeeps + pSector->ubNumTanks);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -168,7 +168,7 @@ UINT8 NumHostilesInSector( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ )
|
|||||||
|
|
||||||
//Count stationary hostiles
|
//Count stationary hostiles
|
||||||
pSector = &SectorInfo[ SECTOR( sSectorX, sSectorY ) ];
|
pSector = &SectorInfo[ SECTOR( sSectorX, sSectorY ) ];
|
||||||
ubNumHostiles = (UINT8)(pSector->ubNumAdmins + pSector->ubNumTroops + pSector->ubNumElites + pSector->ubNumCreatures + pSector->ubNumRobots + pSector->ubNumJeeps + pSector->ubNumTanks);
|
ubNumHostiles = (pSector->ubNumAdmins + pSector->ubNumTroops + pSector->ubNumElites + pSector->ubNumCreatures + pSector->ubNumRobots + pSector->ubNumJeeps + pSector->ubNumTanks);
|
||||||
|
|
||||||
//Count mobile enemies
|
//Count mobile enemies
|
||||||
pGroup = gpGroupList;
|
pGroup = gpGroupList;
|
||||||
@@ -185,9 +185,9 @@ UINT8 NumHostilesInSector( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ )
|
|||||||
return ubNumHostiles;
|
return ubNumHostiles;
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT8 NumEnemiesInAnySector( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ )
|
UINT16 NumEnemiesInAnySector( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ )
|
||||||
{
|
{
|
||||||
UINT8 ubNumEnemies = 0;
|
UINT16 ubNumEnemies = 0;
|
||||||
|
|
||||||
AssertGE( sSectorX, MINIMUM_VALID_X_COORDINATE);
|
AssertGE( sSectorX, MINIMUM_VALID_X_COORDINATE);
|
||||||
AssertLE( sSectorX, MAXIMUM_VALID_X_COORDINATE );
|
AssertLE( sSectorX, MAXIMUM_VALID_X_COORDINATE );
|
||||||
@@ -202,7 +202,7 @@ UINT8 NumEnemiesInAnySector( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ )
|
|||||||
pSector = FindUnderGroundSector( sSectorX, sSectorY, (UINT8)sSectorZ );
|
pSector = FindUnderGroundSector( sSectorX, sSectorY, (UINT8)sSectorZ );
|
||||||
if( pSector )
|
if( pSector )
|
||||||
{
|
{
|
||||||
ubNumEnemies = (UINT8)(pSector->ubNumAdmins + pSector->ubNumTroops + pSector->ubNumElites + pSector->ubNumRobots + pSector->ubNumJeeps + pSector->ubNumTanks);
|
ubNumEnemies = (pSector->ubNumAdmins + pSector->ubNumTroops + pSector->ubNumElites + pSector->ubNumRobots + pSector->ubNumJeeps + pSector->ubNumTanks);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -212,7 +212,7 @@ UINT8 NumEnemiesInAnySector( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ )
|
|||||||
|
|
||||||
//Count stationary enemies
|
//Count stationary enemies
|
||||||
pSector = &SectorInfo[ SECTOR( sSectorX, sSectorY ) ];
|
pSector = &SectorInfo[ SECTOR( sSectorX, sSectorY ) ];
|
||||||
ubNumEnemies = (UINT8)(pSector->ubNumAdmins + pSector->ubNumTroops + pSector->ubNumElites + pSector->ubNumRobots + pSector->ubNumJeeps + pSector->ubNumTanks);
|
ubNumEnemies = (pSector->ubNumAdmins + pSector->ubNumTroops + pSector->ubNumElites + pSector->ubNumRobots + pSector->ubNumJeeps + pSector->ubNumTanks);
|
||||||
|
|
||||||
//Count mobile enemies
|
//Count mobile enemies
|
||||||
pGroup = gpGroupList;
|
pGroup = gpGroupList;
|
||||||
@@ -230,11 +230,11 @@ UINT8 NumEnemiesInAnySector( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// returns how many members of a team are in a sector - not intended for OUR_TEAM!
|
// returns how many members of a team are in a sector - not intended for OUR_TEAM!
|
||||||
UINT8 NumNonPlayerTeamMembersInSector( INT16 sSectorX, INT16 sSectorY, UINT8 ubTeam )
|
UINT16 NumNonPlayerTeamMembersInSector( INT16 sSectorX, INT16 sSectorY, UINT8 ubTeam )
|
||||||
{
|
{
|
||||||
SECTORINFO *pSector;
|
SECTORINFO *pSector;
|
||||||
GROUP *pGroup;
|
GROUP *pGroup;
|
||||||
UINT8 ubNumTroops;
|
UINT16 ubNumTroops = 0;
|
||||||
|
|
||||||
// HEADROCK: This is a TEMPORARY fix to avoid the assertion error. Not sure this is the best solution,
|
// HEADROCK: This is a TEMPORARY fix to avoid the assertion error. Not sure this is the best solution,
|
||||||
// probably isn't. But I need this bit to work.
|
// probably isn't. But I need this bit to work.
|
||||||
@@ -255,14 +255,14 @@ UINT8 NumNonPlayerTeamMembersInSector( INT16 sSectorX, INT16 sSectorY, UINT8 ubT
|
|||||||
|
|
||||||
if ( ubTeam == ENEMY_TEAM )
|
if ( ubTeam == ENEMY_TEAM )
|
||||||
{
|
{
|
||||||
ubNumTroops = (UINT8)(pSector->ubNumAdmins + pSector->ubNumTroops + pSector->ubNumElites + pSector->ubNumRobots + pSector->ubNumJeeps + pSector->ubNumTanks);
|
ubNumTroops = (pSector->ubNumAdmins + pSector->ubNumTroops + pSector->ubNumElites + pSector->ubNumRobots + pSector->ubNumJeeps + pSector->ubNumTanks);
|
||||||
|
|
||||||
if ( is_networked )
|
if ( is_networked )
|
||||||
ubNumTroops += numenemyLAN((UINT8)sSectorX,(UINT8)sSectorY ); //hayden
|
ubNumTroops += numenemyLAN((UINT8)sSectorX,(UINT8)sSectorY ); //hayden
|
||||||
}
|
}
|
||||||
else if ( ubTeam == MILITIA_TEAM )
|
else if ( ubTeam == MILITIA_TEAM )
|
||||||
{
|
{
|
||||||
ubNumTroops = (UINT8)(pSector->ubNumberOfCivsAtLevel[0] + pSector->ubNumberOfCivsAtLevel[1] + pSector->ubNumberOfCivsAtLevel[2]);
|
ubNumTroops = (pSector->ubNumberOfCivsAtLevel[0] + pSector->ubNumberOfCivsAtLevel[1] + pSector->ubNumberOfCivsAtLevel[2]);
|
||||||
}
|
}
|
||||||
else if ( ubTeam == CREATURE_TEAM )
|
else if ( ubTeam == CREATURE_TEAM )
|
||||||
{
|
{
|
||||||
@@ -287,11 +287,12 @@ UINT16 NumPlayerTeamMembersInSector( INT16 sSectorX, INT16 sSectorY, INT8 sSecto
|
|||||||
{
|
{
|
||||||
UINT16 teammemberspresent = 0;
|
UINT16 teammemberspresent = 0;
|
||||||
|
|
||||||
SOLDIERTYPE* pTeamSoldier = NULL;
|
SOLDIERTYPE *pTeamSoldier = NULL;
|
||||||
UINT16 bMercID = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
SoldierID bMercID = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||||
UINT16 bLastTeamID = gTacticalStatus.Team[gbPlayerNum].bLastID;
|
SoldierID bLastTeamID = gTacticalStatus.Team[gbPlayerNum].bLastID;
|
||||||
for ( pTeamSoldier = MercPtrs[bMercID]; bMercID <= bLastTeamID; ++bMercID, pTeamSoldier++ )
|
for ( ; bMercID <= bLastTeamID; ++bMercID )
|
||||||
{
|
{
|
||||||
|
pTeamSoldier = bMercID;
|
||||||
// we test several conditions before we allow adding an opinion
|
// we test several conditions before we allow adding an opinion
|
||||||
// other merc must be active, have a profile, be someone else and not be in transit or dead
|
// other merc must be active, have a profile, be someone else and not be in transit or dead
|
||||||
if ( pTeamSoldier->bActive && !pTeamSoldier->flags.fBetweenSectors && pTeamSoldier->stats.bLife > 0 && !(pTeamSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE) &&
|
if ( pTeamSoldier->bActive && !pTeamSoldier->flags.fBetweenSectors && pTeamSoldier->stats.bLife > 0 && !(pTeamSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE) &&
|
||||||
@@ -309,7 +310,7 @@ UINT16 NumEnemyArmedVehiclesInSector( INT16 sSectorX, INT16 sSectorY, UINT8 usTe
|
|||||||
{
|
{
|
||||||
SECTORINFO *pSector;
|
SECTORINFO *pSector;
|
||||||
GROUP *pGroup;
|
GROUP *pGroup;
|
||||||
UINT16 ubNum;
|
UINT16 ubNum = 0;
|
||||||
|
|
||||||
// HEADROCK: This is a TEMPORARY fix to avoid the assertion error. Not sure this is the best solution,
|
// HEADROCK: This is a TEMPORARY fix to avoid the assertion error. Not sure this is the best solution,
|
||||||
// probably isn't. But I need this bit to work.
|
// probably isn't. But I need this bit to work.
|
||||||
@@ -344,7 +345,7 @@ UINT16 NumEnemyArmedVehiclesInSector( INT16 sSectorX, INT16 sSectorY, UINT8 usTe
|
|||||||
return ubNum;
|
return ubNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT8 NumStationaryEnemiesInSector( INT16 sSectorX, INT16 sSectorY )
|
UINT16 NumStationaryEnemiesInSector( INT16 sSectorX, INT16 sSectorY )
|
||||||
{
|
{
|
||||||
SECTORINFO *pSector;
|
SECTORINFO *pSector;
|
||||||
|
|
||||||
@@ -368,14 +369,14 @@ UINT8 NumStationaryEnemiesInSector( INT16 sSectorX, INT16 sSectorY )
|
|||||||
return( 0 );
|
return( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
return (UINT8)(pSector->ubNumAdmins + pSector->ubNumTroops + pSector->ubNumElites + pSector->ubNumTanks + pSector->ubNumJeeps + pSector->ubNumRobots);
|
return (pSector->ubNumAdmins + pSector->ubNumTroops + pSector->ubNumElites + pSector->ubNumTanks + pSector->ubNumJeeps + pSector->ubNumRobots);
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT8 NumMobileEnemiesInSector( INT16 sSectorX, INT16 sSectorY )
|
UINT16 NumMobileEnemiesInSector( INT16 sSectorX, INT16 sSectorY )
|
||||||
{
|
{
|
||||||
GROUP *pGroup;
|
GROUP *pGroup;
|
||||||
SECTORINFO *pSector;
|
SECTORINFO *pSector;
|
||||||
UINT8 ubNumTroops;
|
UINT16 ubNumTroops;
|
||||||
AssertGE( sSectorX, MINIMUM_VALID_X_COORDINATE);
|
AssertGE( sSectorX, MINIMUM_VALID_X_COORDINATE);
|
||||||
AssertLE( sSectorX, MAXIMUM_VALID_X_COORDINATE );
|
AssertLE( sSectorX, MAXIMUM_VALID_X_COORDINATE );
|
||||||
AssertGE( sSectorY, MINIMUM_VALID_Y_COORDINATE);
|
AssertGE( sSectorY, MINIMUM_VALID_Y_COORDINATE);
|
||||||
@@ -396,13 +397,13 @@ UINT8 NumMobileEnemiesInSector( INT16 sSectorX, INT16 sSectorY )
|
|||||||
if( pSector->ubGarrisonID == ROADBLOCK )
|
if( pSector->ubGarrisonID == ROADBLOCK )
|
||||||
{
|
{
|
||||||
//consider these troops as mobile troops even though they are in a garrison
|
//consider these troops as mobile troops even though they are in a garrison
|
||||||
ubNumTroops += (UINT8)(pSector->ubNumAdmins + pSector->ubNumTroops + pSector->ubNumElites + pSector->ubNumRobots + pSector->ubNumJeeps + pSector->ubNumTanks);
|
ubNumTroops += (pSector->ubNumAdmins + pSector->ubNumTroops + pSector->ubNumElites + pSector->ubNumRobots + pSector->ubNumJeeps + pSector->ubNumTanks);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ubNumTroops;
|
return ubNumTroops;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetNumberOfMobileEnemiesInSector( INT16 sSectorX, INT16 sSectorY, UINT8 *pubNumAdmins, UINT8 *pubNumTroops, UINT8 *pubNumElites, UINT8 *pubNumRobots, UINT8 *pubNumTanks, UINT8 *pubNumJeeps )
|
void GetNumberOfMobileEnemiesInSector( INT16 sSectorX, INT16 sSectorY, UINT16 *pubNumAdmins, UINT16 *pubNumTroops, UINT16 *pubNumElites, UINT16 *pubNumRobots, UINT16 *pubNumTanks, UINT16 *pubNumJeeps )
|
||||||
{
|
{
|
||||||
GROUP *pGroup;
|
GROUP *pGroup;
|
||||||
SECTORINFO *pSector;
|
SECTORINFO *pSector;
|
||||||
@@ -441,7 +442,7 @@ void GetNumberOfMobileEnemiesInSector( INT16 sSectorX, INT16 sSectorY, UINT8 *pu
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetNumberOfMobileEnemiesInSectorWithoutRoadBlock( INT16 sSectorX, INT16 sSectorY, UINT8 usTeam, UINT8 *pubNumAdmins, UINT8 *pubNumTroops, UINT8 *pubNumElites, UINT8 *pubNumRobots, UINT8 *pubNumTanks, UINT8 *pubNumJeeps )
|
void GetNumberOfMobileEnemiesInSectorWithoutRoadBlock( INT16 sSectorX, INT16 sSectorY, UINT16 usTeam, UINT16 *pubNumAdmins, UINT16 *pubNumTroops, UINT16 *pubNumElites, UINT16 *pubNumRobots, UINT16 *pubNumTanks, UINT16 *pubNumJeeps )
|
||||||
{
|
{
|
||||||
GROUP *pGroup;
|
GROUP *pGroup;
|
||||||
AssertGE( sSectorX, MINIMUM_VALID_X_COORDINATE);
|
AssertGE( sSectorX, MINIMUM_VALID_X_COORDINATE);
|
||||||
@@ -468,7 +469,7 @@ void GetNumberOfMobileEnemiesInSectorWithoutRoadBlock( INT16 sSectorX, INT16 sSe
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void GetNumberOfStationaryEnemiesInSector( INT16 sSectorX, INT16 sSectorY, UINT8 *pubNumAdmins, UINT8 *pubNumTroops, UINT8 *pubNumElites, UINT8 *pubNumRobots, UINT8 *pubNumTanks, UINT8 *pubNumJeeps )
|
void GetNumberOfStationaryEnemiesInSector( INT16 sSectorX, INT16 sSectorY, UINT16 *pubNumAdmins, UINT16 *pubNumTroops, UINT16 *pubNumElites, UINT16 *pubNumRobots, UINT16 *pubNumTanks, UINT16 *pubNumJeeps )
|
||||||
{
|
{
|
||||||
SECTORINFO *pSector;
|
SECTORINFO *pSector;
|
||||||
AssertGE( sSectorX, MINIMUM_VALID_X_COORDINATE);
|
AssertGE( sSectorX, MINIMUM_VALID_X_COORDINATE);
|
||||||
@@ -486,9 +487,9 @@ void GetNumberOfStationaryEnemiesInSector( INT16 sSectorX, INT16 sSectorY, UINT8
|
|||||||
*pubNumJeeps = pSector->ubNumJeeps;
|
*pubNumJeeps = pSector->ubNumJeeps;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetNumberOfEnemiesInSector( INT16 sSectorX, INT16 sSectorY, UINT8 *pubNumAdmins, UINT8 *pubNumTroops, UINT8 *pubNumElites, UINT8 *pubNumRobots, UINT8 *pubNumTanks, UINT8 *pubNumJeeps )
|
void GetNumberOfEnemiesInSector( INT16 sSectorX, INT16 sSectorY, UINT16 *pubNumAdmins, UINT16 *pubNumTroops, UINT16 *pubNumElites, UINT16 *pubNumRobots, UINT16 *pubNumTanks, UINT16 *pubNumJeeps )
|
||||||
{
|
{
|
||||||
UINT8 ubNumAdmins, ubNumTroops, ubNumElites, ubNumRobots, ubNumTanks, ubNumJeeps;
|
UINT16 ubNumAdmins, ubNumTroops, ubNumElites, ubNumRobots, ubNumTanks, ubNumJeeps;
|
||||||
|
|
||||||
GetNumberOfStationaryEnemiesInSector( sSectorX, sSectorY, pubNumAdmins, pubNumTroops, pubNumElites, pubNumRobots, pubNumTanks, pubNumJeeps );
|
GetNumberOfStationaryEnemiesInSector( sSectorX, sSectorY, pubNumAdmins, pubNumTroops, pubNumElites, pubNumRobots, pubNumTanks, pubNumJeeps );
|
||||||
|
|
||||||
@@ -505,7 +506,6 @@ void GetNumberOfEnemiesInSector( INT16 sSectorX, INT16 sSectorY, UINT8 *pubNumAd
|
|||||||
void EndTacticalBattleForEnemy()
|
void EndTacticalBattleForEnemy()
|
||||||
{
|
{
|
||||||
GROUP *pGroup;
|
GROUP *pGroup;
|
||||||
INT32 i;
|
|
||||||
|
|
||||||
//Clear enemies in battle for all stationary groups in the sector.
|
//Clear enemies in battle for all stationary groups in the sector.
|
||||||
if( gbWorldSectorZ > 0 )
|
if( gbWorldSectorZ > 0 )
|
||||||
@@ -558,14 +558,16 @@ void EndTacticalBattleForEnemy()
|
|||||||
|
|
||||||
//Check to see if any of our mercs have abandoned the militia during a battle. This is cause for a rather
|
//Check to see if any of our mercs have abandoned the militia during a battle. This is cause for a rather
|
||||||
//severe loyalty blow.
|
//severe loyalty blow.
|
||||||
for( i = gTacticalStatus.Team[ MILITIA_TEAM ].bFirstID; i <= gTacticalStatus.Team[ MILITIA_TEAM ].bLastID; ++i )
|
for( SoldierID i = gTacticalStatus.Team[ MILITIA_TEAM ].bFirstID; i <= gTacticalStatus.Team[ MILITIA_TEAM ].bLastID; ++i )
|
||||||
{
|
{
|
||||||
if( MercPtrs[ i ]->bActive && MercPtrs[ i ]->bInSector && MercPtrs[ i ]->stats.bLife >= OKLIFE )
|
SOLDIERTYPE *pSoldier = i;
|
||||||
|
if( pSoldier->bActive && pSoldier->bInSector && pSoldier->stats.bLife >= OKLIFE )
|
||||||
{ //found one live militia, so look for any enemies/creatures.
|
{ //found one live militia, so look for any enemies/creatures.
|
||||||
// NOTE: this is relying on ENEMY_TEAM being immediately followed by CREATURE_TEAM
|
// NOTE: this is relying on ENEMY_TEAM being immediately followed by CREATURE_TEAM
|
||||||
for( i = gTacticalStatus.Team[ ENEMY_TEAM ].bFirstID; i <= gTacticalStatus.Team[ CREATURE_TEAM ].bLastID; ++i )
|
for( SoldierID j = gTacticalStatus.Team[ ENEMY_TEAM ].bFirstID; j <= gTacticalStatus.Team[ CREATURE_TEAM ].bLastID; ++j )
|
||||||
{
|
{
|
||||||
if( MercPtrs[ i ]->bActive && MercPtrs[ i ]->bInSector && MercPtrs[ i ]->stats.bLife >= OKLIFE )
|
SOLDIERTYPE *pEnemy = j;
|
||||||
|
if( pEnemy->bActive && pEnemy->bInSector && pEnemy->stats.bLife >= OKLIFE )
|
||||||
{ //confirmed at least one enemy here, so do the loyalty penalty.
|
{ //confirmed at least one enemy here, so do the loyalty penalty.
|
||||||
HandleGlobalLoyaltyEvent( GLOBAL_LOYALTY_ABANDON_MILITIA, gWorldSectorX, gWorldSectorY, 0 );
|
HandleGlobalLoyaltyEvent( GLOBAL_LOYALTY_ABANDON_MILITIA, gWorldSectorX, gWorldSectorY, 0 );
|
||||||
break;
|
break;
|
||||||
@@ -576,27 +578,26 @@ void EndTacticalBattleForEnemy()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT8 NumFreeSlots( UINT8 ubTeam )
|
UINT16 NumFreeSlots( UINT8 ubTeam )
|
||||||
{
|
{
|
||||||
UINT8 ubNumFreeSlots = 0;
|
UINT16 ubNumFreeSlots = 0;
|
||||||
|
|
||||||
//Count the number of free enemy slots. It is possible to have multiple groups exceed the maximum.
|
//Count the number of free enemy slots. It is possible to have multiple groups exceed the maximum.
|
||||||
for ( INT32 i = gTacticalStatus.Team[ubTeam].bFirstID; i <= gTacticalStatus.Team[ubTeam].bLastID; ++i )
|
for ( SoldierID i = gTacticalStatus.Team[ubTeam].bFirstID; i <= gTacticalStatus.Team[ubTeam].bLastID; ++i )
|
||||||
{
|
{
|
||||||
if ( !Menptr[i].bActive )
|
if ( !i->bActive )
|
||||||
++ubNumFreeSlots;
|
++ubNumFreeSlots;
|
||||||
}
|
}
|
||||||
|
|
||||||
// the militia team size can be restricted by the ini
|
// the militia team size can be restricted by the ini
|
||||||
if ( ubTeam == MILITIA_TEAM )
|
if ( ubTeam == MILITIA_TEAM )
|
||||||
{
|
{
|
||||||
ubNumFreeSlots = (UINT8)max( 0, (INT8)ubNumFreeSlots - (INT8)(gGameExternalOptions.ubGameMaximumNumberOfRebels - gGameExternalOptions.iMaxMilitiaPerSector) );
|
ubNumFreeSlots = (UINT16)max( 0, (INT16)ubNumFreeSlots - (INT16)(gGameExternalOptions.ubGameMaximumNumberOfRebels - gGameExternalOptions.iMaxMilitiaPerSector) );
|
||||||
}
|
}
|
||||||
|
|
||||||
return ubNumFreeSlots;
|
return ubNumFreeSlots;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//Called when entering a sector so the campaign AI can automatically insert the
|
//Called when entering a sector so the campaign AI can automatically insert the
|
||||||
//correct number of troops of each type based on the current number in the sector
|
//correct number of troops of each type based on the current number in the sector
|
||||||
//in global focus (gWorldSectorX/Y)
|
//in global focus (gWorldSectorX/Y)
|
||||||
@@ -1191,7 +1192,6 @@ BOOLEAN PrepareEnemyForUndergroundBattle()
|
|||||||
//The queen AI layer must process the event by subtracting forces, etc.
|
//The queen AI layer must process the event by subtracting forces, etc.
|
||||||
void ProcessQueenCmdImplicationsOfDeath( SOLDIERTYPE *pSoldier )
|
void ProcessQueenCmdImplicationsOfDeath( SOLDIERTYPE *pSoldier )
|
||||||
{
|
{
|
||||||
INT32 iNumEnemiesInSector;
|
|
||||||
SECTORINFO *pSector;
|
SECTORINFO *pSector;
|
||||||
INT32 iMaxEnemyGroupSize = gGameExternalOptions.iMaxEnemyGroupSize;
|
INT32 iMaxEnemyGroupSize = gGameExternalOptions.iMaxEnemyGroupSize;
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"QueenCommand");
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"QueenCommand");
|
||||||
@@ -1738,22 +1738,6 @@ void ProcessQueenCmdImplicationsOfDeath( SOLDIERTYPE *pSoldier )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( !pSoldier->bSectorZ )
|
|
||||||
{
|
|
||||||
pSector = &SectorInfo[ SECTOR( pSoldier->sSectorX, pSoldier->sSectorY ) ];
|
|
||||||
iNumEnemiesInSector = NumNonPlayerTeamMembersInSector( pSoldier->sSectorX, pSoldier->sSectorY, ENEMY_TEAM );
|
|
||||||
if( iNumEnemiesInSector )
|
|
||||||
{
|
|
||||||
if( pSector->bLastKnownEnemies >= 0 )
|
|
||||||
{
|
|
||||||
pSector->bLastKnownEnemies = (INT8)iNumEnemiesInSector;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pSector->bLastKnownEnemies = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Well, not so rarely with mobile reinforcements!
|
//Well, not so rarely with mobile reinforcements!
|
||||||
@@ -1772,8 +1756,8 @@ void AddPossiblePendingEnemiesToBattle()
|
|||||||
BOOLEAN fMagicallyAppeared=FALSE;
|
BOOLEAN fMagicallyAppeared=FALSE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
UINT8 ubSlots, ubNumAvailable;
|
UINT16 ubSlots, ubNumAvailable;
|
||||||
UINT8 ubNumRobots, ubNumElites, ubNumTroops, ubNumAdmins, ubNumTanks, ubNumJeeps;
|
UINT16 ubNumRobots, ubNumElites, ubNumTroops, ubNumAdmins, ubNumTanks, ubNumJeeps;
|
||||||
UINT8 ubNumGroupsInSector;
|
UINT8 ubNumGroupsInSector;
|
||||||
UINT8 ubGroupIndex;
|
UINT8 ubGroupIndex;
|
||||||
GROUP *pGroup;
|
GROUP *pGroup;
|
||||||
@@ -2001,7 +1985,7 @@ void AddPossiblePendingEnemiesToBattle()
|
|||||||
pGroup = pGroupInSectorList[ ubGroupIndex];
|
pGroup = pGroupInSectorList[ ubGroupIndex];
|
||||||
|
|
||||||
// Flugente fix: check for underflow...
|
// Flugente fix: check for underflow...
|
||||||
UINT8 currentgroupsize = pGroup->pEnemyGroup->ubElitesInBattle + pGroup->pEnemyGroup->ubTroopsInBattle + pGroup->pEnemyGroup->ubAdminsInBattle
|
UINT16 currentgroupsize = pGroup->pEnemyGroup->ubElitesInBattle + pGroup->pEnemyGroup->ubTroopsInBattle + pGroup->pEnemyGroup->ubAdminsInBattle
|
||||||
+ pGroup->pEnemyGroup->ubRobotsInBattle + pGroup->pEnemyGroup->ubTanksInBattle + pGroup->pEnemyGroup->ubJeepsInBattle;
|
+ pGroup->pEnemyGroup->ubRobotsInBattle + pGroup->pEnemyGroup->ubTanksInBattle + pGroup->pEnemyGroup->ubJeepsInBattle;
|
||||||
if ( currentgroupsize > pGroup->ubGroupSize )
|
if ( currentgroupsize > pGroup->ubGroupSize )
|
||||||
ubNumAvailable = 0;
|
ubNumAvailable = 0;
|
||||||
@@ -2122,14 +2106,14 @@ void AddPossiblePendingEnemiesToBattle()
|
|||||||
|
|
||||||
void NotifyPlayersOfNewEnemies()
|
void NotifyPlayersOfNewEnemies()
|
||||||
{
|
{
|
||||||
INT32 iSoldiers, iChosenSoldier, i;
|
INT32 iSoldiers, iChosenSoldier;
|
||||||
SOLDIERTYPE *pSoldier;
|
SOLDIERTYPE *pSoldier;
|
||||||
BOOLEAN fIgnoreBreath = FALSE;
|
BOOLEAN fIgnoreBreath = FALSE;
|
||||||
|
|
||||||
iSoldiers = 0;
|
iSoldiers = 0;
|
||||||
for( i = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; i <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; i++ )
|
for( SoldierID i = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; i <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; ++i )
|
||||||
{ //find a merc that is aware.
|
{ //find a merc that is aware.
|
||||||
pSoldier = MercPtrs[ i ];
|
pSoldier = i;
|
||||||
if( pSoldier->bInSector && pSoldier->bActive && pSoldier->stats.bLife >= OKLIFE && pSoldier->bBreath >= OKBREATH )
|
if( pSoldier->bInSector && pSoldier->bActive && pSoldier->stats.bLife >= OKLIFE && pSoldier->bBreath >= OKBREATH )
|
||||||
{
|
{
|
||||||
iSoldiers++;
|
iSoldiers++;
|
||||||
@@ -2139,9 +2123,9 @@ void NotifyPlayersOfNewEnemies()
|
|||||||
{ // look for an out of breath merc.
|
{ // look for an out of breath merc.
|
||||||
fIgnoreBreath = TRUE;
|
fIgnoreBreath = TRUE;
|
||||||
|
|
||||||
for( i = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; i <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; i++ )
|
for( SoldierID i = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; i <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; ++i )
|
||||||
{ //find a merc that is aware.
|
{ //find a merc that is aware.
|
||||||
pSoldier = MercPtrs[ i ];
|
pSoldier = i;
|
||||||
if( pSoldier->bInSector && pSoldier->bActive && pSoldier->stats.bLife >= OKLIFE )
|
if( pSoldier->bInSector && pSoldier->bActive && pSoldier->stats.bLife >= OKLIFE )
|
||||||
{
|
{
|
||||||
iSoldiers++;
|
iSoldiers++;
|
||||||
@@ -2151,9 +2135,9 @@ void NotifyPlayersOfNewEnemies()
|
|||||||
if( iSoldiers )
|
if( iSoldiers )
|
||||||
{
|
{
|
||||||
iChosenSoldier = Random( iSoldiers );
|
iChosenSoldier = Random( iSoldiers );
|
||||||
for( i = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; i <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; i++ )
|
for( SoldierID i = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; i <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; ++i )
|
||||||
{ //find a merc that is aware.
|
{ //find a merc that is aware.
|
||||||
pSoldier = MercPtrs[ i ];
|
pSoldier = i;
|
||||||
if( pSoldier->bInSector && pSoldier->bActive && pSoldier->stats.bLife >= OKLIFE &&
|
if( pSoldier->bInSector && pSoldier->bActive && pSoldier->stats.bLife >= OKLIFE &&
|
||||||
( ( pSoldier->bBreath >= OKBREATH ) || fIgnoreBreath ) )
|
( ( pSoldier->bBreath >= OKBREATH ) || fIgnoreBreath ) )
|
||||||
{
|
{
|
||||||
@@ -2176,12 +2160,12 @@ void NotifyPlayersOfNewEnemies()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddEnemiesToBattle( GROUP *pGroup, UINT8 ubStrategicInsertionCode, UINT8 ubNumAdmins, UINT8 ubNumTroops, UINT8 ubNumElites, UINT8 ubNumRobots, UINT8 ubNumTanks, UINT8 ubNumJeeps, BOOLEAN fMagicallyAppeared )
|
void AddEnemiesToBattle( GROUP *pGroup, UINT8 ubStrategicInsertionCode, UINT16 ubNumAdmins, UINT16 ubNumTroops, UINT16 ubNumElites, UINT16 ubNumRobots, UINT16 ubNumTanks, UINT16 ubNumJeeps, BOOLEAN fMagicallyAppeared )
|
||||||
{
|
{
|
||||||
SOLDIERTYPE *pSoldier;
|
SOLDIERTYPE *pSoldier;
|
||||||
MAPEDGEPOINTINFO MapEdgepointInfo;
|
MAPEDGEPOINTINFO MapEdgepointInfo;
|
||||||
UINT8 ubCurrSlot;
|
UINT16 ubCurrSlot;
|
||||||
UINT8 ubTotalSoldiers;
|
UINT16 ubTotalSoldiers;
|
||||||
UINT8 bDesiredDirection=0;
|
UINT8 bDesiredDirection=0;
|
||||||
|
|
||||||
// while transport groups can't normally reinforce, this covers the case where a transport group enters a sector (via normal movement)
|
// while transport groups can't normally reinforce, this covers the case where a transport group enters a sector (via normal movement)
|
||||||
@@ -2323,7 +2307,7 @@ void AddEnemiesToBattle( GROUP *pGroup, UINT8 ubStrategicInsertionCode, UINT8 ub
|
|||||||
}
|
}
|
||||||
UpdateMercInSector( pSoldier, gWorldSectorX, gWorldSectorY, 0 );
|
UpdateMercInSector( pSoldier, gWorldSectorX, gWorldSectorY, 0 );
|
||||||
}
|
}
|
||||||
else if( ubNumTroops && (UINT8)Random( ubTotalSoldiers ) < (UINT8)(ubNumElites + ubNumTroops) )
|
else if( ubNumTroops && Random( ubTotalSoldiers ) < (ubNumElites + ubNumTroops) )
|
||||||
{
|
{
|
||||||
ubNumTroops--;
|
ubNumTroops--;
|
||||||
ubTotalSoldiers--;
|
ubTotalSoldiers--;
|
||||||
@@ -2346,7 +2330,7 @@ void AddEnemiesToBattle( GROUP *pGroup, UINT8 ubStrategicInsertionCode, UINT8 ub
|
|||||||
}
|
}
|
||||||
UpdateMercInSector( pSoldier, gWorldSectorX, gWorldSectorY, 0 );
|
UpdateMercInSector( pSoldier, gWorldSectorX, gWorldSectorY, 0 );
|
||||||
}
|
}
|
||||||
else if( ubNumAdmins && (UINT8)Random( ubTotalSoldiers ) < (UINT8)(ubNumElites + ubNumTroops + ubNumAdmins) )
|
else if( ubNumAdmins && Random( ubTotalSoldiers ) < (ubNumElites + ubNumTroops + ubNumAdmins) )
|
||||||
{
|
{
|
||||||
ubNumAdmins--;
|
ubNumAdmins--;
|
||||||
ubTotalSoldiers--;
|
ubTotalSoldiers--;
|
||||||
@@ -2369,7 +2353,7 @@ void AddEnemiesToBattle( GROUP *pGroup, UINT8 ubStrategicInsertionCode, UINT8 ub
|
|||||||
}
|
}
|
||||||
UpdateMercInSector( pSoldier, gWorldSectorX, gWorldSectorY, 0 );
|
UpdateMercInSector( pSoldier, gWorldSectorX, gWorldSectorY, 0 );
|
||||||
}
|
}
|
||||||
else if( ubNumRobots && (UINT8)Random( ubTotalSoldiers ) < (UINT8)(ubNumElites + ubNumTroops + ubNumAdmins + ubNumRobots) )
|
else if( ubNumRobots && Random( ubTotalSoldiers ) < (ubNumElites + ubNumTroops + ubNumAdmins + ubNumRobots) )
|
||||||
{
|
{
|
||||||
ubNumRobots--;
|
ubNumRobots--;
|
||||||
ubTotalSoldiers--;
|
ubTotalSoldiers--;
|
||||||
@@ -2392,7 +2376,7 @@ void AddEnemiesToBattle( GROUP *pGroup, UINT8 ubStrategicInsertionCode, UINT8 ub
|
|||||||
}
|
}
|
||||||
UpdateMercInSector( pSoldier, gWorldSectorX, gWorldSectorY, 0 );
|
UpdateMercInSector( pSoldier, gWorldSectorX, gWorldSectorY, 0 );
|
||||||
}
|
}
|
||||||
else if( ubNumTanks && (UINT8)Random( ubTotalSoldiers ) < (UINT8)(ubNumElites + ubNumTroops + ubNumAdmins + ubNumRobots + ubNumTanks) && ubNumberOfVehicles < 9 )
|
else if( ubNumTanks && Random( ubTotalSoldiers ) < (ubNumElites + ubNumTroops + ubNumAdmins + ubNumRobots + ubNumTanks) && ubNumberOfVehicles < 9 )
|
||||||
{
|
{
|
||||||
ubNumTanks--;
|
ubNumTanks--;
|
||||||
ubTotalSoldiers--;
|
ubTotalSoldiers--;
|
||||||
@@ -2415,7 +2399,7 @@ void AddEnemiesToBattle( GROUP *pGroup, UINT8 ubStrategicInsertionCode, UINT8 ub
|
|||||||
}
|
}
|
||||||
UpdateMercInSector( pSoldier, gWorldSectorX, gWorldSectorY, 0 );
|
UpdateMercInSector( pSoldier, gWorldSectorX, gWorldSectorY, 0 );
|
||||||
}
|
}
|
||||||
else if ( ubNumJeeps && (UINT8)Random( ubTotalSoldiers ) < (UINT8)(ubNumElites + ubNumTroops + ubNumAdmins + ubNumRobots + ubNumTanks + ubNumJeeps) && ubNumberOfVehicles < 9 )
|
else if ( ubNumJeeps && Random( ubTotalSoldiers ) < (ubNumElites + ubNumTroops + ubNumAdmins + ubNumRobots + ubNumTanks + ubNumJeeps) && ubNumberOfVehicles < 9 )
|
||||||
{
|
{
|
||||||
ubNumJeeps--;
|
ubNumJeeps--;
|
||||||
ubTotalSoldiers--;
|
ubTotalSoldiers--;
|
||||||
@@ -2463,12 +2447,12 @@ void AddEnemiesToBattle( GROUP *pGroup, UINT8 ubStrategicInsertionCode, UINT8 ub
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddMilitiaToBattle( GROUP *pGroup, UINT8 ubStrategicInsertionCode, UINT8 ubNumGreens, UINT8 ubNumRegulars, UINT8 ubNumElites, BOOLEAN fMagicallyAppeared )
|
void AddMilitiaToBattle( GROUP *pGroup, UINT8 ubStrategicInsertionCode, UINT16 ubNumGreens, UINT16 ubNumRegulars, UINT16 ubNumElites, BOOLEAN fMagicallyAppeared )
|
||||||
{
|
{
|
||||||
SOLDIERTYPE *pSoldier;
|
SOLDIERTYPE *pSoldier;
|
||||||
MAPEDGEPOINTINFO MapEdgepointInfo;
|
MAPEDGEPOINTINFO MapEdgepointInfo;
|
||||||
UINT8 ubCurrSlot;
|
UINT16 ubCurrSlot;
|
||||||
UINT8 ubTotalSoldiers;
|
UINT16 ubTotalSoldiers;
|
||||||
UINT8 bDesiredDirection = 0;
|
UINT8 bDesiredDirection = 0;
|
||||||
|
|
||||||
switch ( ubStrategicInsertionCode )
|
switch ( ubStrategicInsertionCode )
|
||||||
@@ -2558,7 +2542,7 @@ void AddMilitiaToBattle( GROUP *pGroup, UINT8 ubStrategicInsertionCode, UINT8 ub
|
|||||||
}
|
}
|
||||||
UpdateMercInSector( pSoldier, gWorldSectorX, gWorldSectorY, 0 );
|
UpdateMercInSector( pSoldier, gWorldSectorX, gWorldSectorY, 0 );
|
||||||
}
|
}
|
||||||
else if ( ubNumRegulars && (UINT8)Random( ubTotalSoldiers ) < (UINT8)(ubNumElites + ubNumRegulars) )
|
else if ( ubNumRegulars && Random( ubTotalSoldiers ) < (ubNumElites + ubNumRegulars) )
|
||||||
{
|
{
|
||||||
ubNumRegulars--;
|
ubNumRegulars--;
|
||||||
ubTotalSoldiers--;
|
ubTotalSoldiers--;
|
||||||
@@ -2581,7 +2565,7 @@ void AddMilitiaToBattle( GROUP *pGroup, UINT8 ubStrategicInsertionCode, UINT8 ub
|
|||||||
}
|
}
|
||||||
UpdateMercInSector( pSoldier, gWorldSectorX, gWorldSectorY, 0 );
|
UpdateMercInSector( pSoldier, gWorldSectorX, gWorldSectorY, 0 );
|
||||||
}
|
}
|
||||||
else if ( ubNumGreens && (UINT8)Random( ubTotalSoldiers ) < (UINT8)(ubNumElites + ubNumRegulars + ubNumGreens) )
|
else if ( ubNumGreens && Random( ubTotalSoldiers ) < (ubNumElites + ubNumRegulars + ubNumGreens) )
|
||||||
{
|
{
|
||||||
ubNumGreens--;
|
ubNumGreens--;
|
||||||
ubTotalSoldiers--;
|
ubTotalSoldiers--;
|
||||||
@@ -2964,89 +2948,6 @@ void EnemyCapturesPlayerSoldier( SOLDIERTYPE *pSoldier )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void HandleEnemyStatusInCurrentMapBeforeLoadingNewMap()
|
|
||||||
{
|
|
||||||
INT32 i;
|
|
||||||
BOOLEAN fMadeCorpse;
|
|
||||||
INT8 bKilledEnemies = 0, bKilledCreatures = 0, bKilledRebels = 0, bKilledCivilians = 0;
|
|
||||||
return;
|
|
||||||
//If any of the soldiers are dying, kill them now.
|
|
||||||
for( i = gTacticalStatus.Team[ ENEMY_TEAM ].bFirstID; i <= gTacticalStatus.Team[ ENEMY_TEAM ].bLastID; i++ )
|
|
||||||
{
|
|
||||||
if( MercPtrs[ i ]->bActive && MercPtrs[ i ]->stats.bLife < OKLIFE && MercPtrs[ i ]->stats.bLife )
|
|
||||||
{
|
|
||||||
MercPtrs[ i ]->stats.bLife = 0;
|
|
||||||
MercPtrs[ i ]->iHealableInjury = 0; // added just for sure - SANDRO
|
|
||||||
HandleSoldierDeath( MercPtrs[ i ], &fMadeCorpse );
|
|
||||||
bKilledEnemies++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//Do the same for the creatures.
|
|
||||||
for( i = gTacticalStatus.Team[ CREATURE_TEAM ].bFirstID; i <= gTacticalStatus.Team[ CREATURE_TEAM ].bLastID; i++ )
|
|
||||||
{
|
|
||||||
if( MercPtrs[ i ]->bActive && MercPtrs[ i ]->stats.bLife < OKLIFE && MercPtrs[ i ]->stats.bLife )
|
|
||||||
{
|
|
||||||
MercPtrs[ i ]->stats.bLife = 0;
|
|
||||||
HandleSoldierDeath( MercPtrs[ i ], &fMadeCorpse );
|
|
||||||
bKilledCreatures++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//Militia
|
|
||||||
for( i = gTacticalStatus.Team[ MILITIA_TEAM ].bFirstID; i <= gTacticalStatus.Team[ MILITIA_TEAM ].bLastID; i++ )
|
|
||||||
{
|
|
||||||
if( MercPtrs[ i ]->bActive && MercPtrs[ i ]->stats.bLife < OKLIFE && MercPtrs[ i ]->stats.bLife )
|
|
||||||
{
|
|
||||||
MercPtrs[ i ]->stats.bLife = 0;
|
|
||||||
MercPtrs[ i ]->iHealableInjury = 0; // added just for sure - SANDRO
|
|
||||||
HandleSoldierDeath( MercPtrs[ i ], &fMadeCorpse );
|
|
||||||
bKilledRebels++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//Civilians
|
|
||||||
for( i = gTacticalStatus.Team[ CIV_TEAM ].bFirstID; i <= gTacticalStatus.Team[ CIV_TEAM ].bLastID; i++ )
|
|
||||||
{
|
|
||||||
if( MercPtrs[ i ]->bActive && MercPtrs[ i ]->stats.bLife < OKLIFE && MercPtrs[ i ]->stats.bLife )
|
|
||||||
{
|
|
||||||
MercPtrs[ i ]->stats.bLife = 0;
|
|
||||||
MercPtrs[ i ]->iHealableInjury = 0; // added just for sure - SANDRO
|
|
||||||
HandleSoldierDeath( MercPtrs[ i ], &fMadeCorpse );
|
|
||||||
bKilledCivilians++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// TEST MESSAGES ONLY!
|
|
||||||
if( bKilledCivilians )
|
|
||||||
ScreenMsg( FONT_BLUE, MSG_TESTVERSION, L"%d civilians died after you left the sector.", bKilledCivilians );
|
|
||||||
if( bKilledRebels )
|
|
||||||
ScreenMsg( FONT_BLUE, MSG_TESTVERSION, L"%d militia died after you left the sector.", bKilledRebels );
|
|
||||||
if( bKilledEnemies )
|
|
||||||
ScreenMsg( FONT_BLUE, MSG_TESTVERSION, L"%d enemies died after you left the sector.", bKilledEnemies );
|
|
||||||
if( bKilledCreatures )
|
|
||||||
ScreenMsg( FONT_BLUE, MSG_TESTVERSION, L"%d creatures died after you left the sector.", bKilledCreatures );
|
|
||||||
|
|
||||||
if( !gbWorldSectorZ )
|
|
||||||
{
|
|
||||||
SECTORINFO *pSector;
|
|
||||||
pSector = &SectorInfo[ SECTOR(gWorldSectorX, gWorldSectorY) ];
|
|
||||||
pSector->ubAdminsInBattle = 0;
|
|
||||||
pSector->ubTroopsInBattle = 0;
|
|
||||||
pSector->ubElitesInBattle = 0;
|
|
||||||
pSector->ubCreaturesInBattle = 0;
|
|
||||||
//RecalculateSectorWeight(
|
|
||||||
}
|
|
||||||
else if( gbWorldSectorZ > 0 )
|
|
||||||
{
|
|
||||||
UNDERGROUND_SECTORINFO *pSector;
|
|
||||||
pSector = FindUnderGroundSector( gWorldSectorX, gWorldSectorY, gbWorldSectorZ );
|
|
||||||
if( !pSector )
|
|
||||||
return;
|
|
||||||
pSector->ubAdminsInBattle = 0;
|
|
||||||
pSector->ubTroopsInBattle = 0;
|
|
||||||
pSector->ubElitesInBattle = 0;
|
|
||||||
pSector->ubCreaturesInBattle = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOLEAN PlayerSectorDefended( UINT8 ubSectorID )
|
BOOLEAN PlayerSectorDefended( UINT8 ubSectorID )
|
||||||
{
|
{
|
||||||
if ( NumNonPlayerTeamMembersInSector( SECTORX( ubSectorID ), SECTORY( ubSectorID ), MILITIA_TEAM ) )
|
if ( NumNonPlayerTeamMembersInSector( SECTORX( ubSectorID ), SECTORY( ubSectorID ), MILITIA_TEAM ) )
|
||||||
@@ -3068,13 +2969,13 @@ BOOLEAN PlayerSectorDefended( UINT8 ubSectorID )
|
|||||||
BOOLEAN OnlyHostileCivsInSector()
|
BOOLEAN OnlyHostileCivsInSector()
|
||||||
{
|
{
|
||||||
SOLDIERTYPE *pSoldier;
|
SOLDIERTYPE *pSoldier;
|
||||||
INT32 i;
|
SoldierID i;
|
||||||
BOOLEAN fHostileCivs = FALSE;
|
BOOLEAN fHostileCivs = FALSE;
|
||||||
|
|
||||||
//Look for any hostile civs.
|
//Look for any hostile civs.
|
||||||
for( i = gTacticalStatus.Team[ CIV_TEAM ].bFirstID; i <= gTacticalStatus.Team[ CIV_TEAM ].bLastID; i++ )
|
for( i = gTacticalStatus.Team[ CIV_TEAM ].bFirstID; i <= gTacticalStatus.Team[ CIV_TEAM ].bLastID; ++i )
|
||||||
{
|
{
|
||||||
pSoldier = MercPtrs[ i ];
|
pSoldier = i;
|
||||||
if( pSoldier->bActive && pSoldier->bInSector && pSoldier->stats.bLife )
|
if( pSoldier->bActive && pSoldier->bInSector && pSoldier->stats.bLife )
|
||||||
{
|
{
|
||||||
if( !pSoldier->aiData.bNeutral )
|
if( !pSoldier->aiData.bNeutral )
|
||||||
@@ -3089,9 +2990,9 @@ BOOLEAN OnlyHostileCivsInSector()
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
//Look for anybody else hostile. If found, return FALSE immediately.
|
//Look for anybody else hostile. If found, return FALSE immediately.
|
||||||
for( i = gTacticalStatus.Team[ ENEMY_TEAM ].bFirstID; i <= gTacticalStatus.Team[ ENEMY_TEAM ].bLastID; i++ )
|
for( i = gTacticalStatus.Team[ ENEMY_TEAM ].bFirstID; i <= gTacticalStatus.Team[ ENEMY_TEAM ].bLastID; ++i )
|
||||||
{
|
{
|
||||||
pSoldier = MercPtrs[ i ];
|
pSoldier = i;
|
||||||
if( pSoldier->bActive && pSoldier->bInSector && pSoldier->stats.bLife )
|
if( pSoldier->bActive && pSoldier->bInSector && pSoldier->stats.bLife )
|
||||||
{
|
{
|
||||||
if( !pSoldier->aiData.bNeutral )
|
if( !pSoldier->aiData.bNeutral )
|
||||||
@@ -3100,9 +3001,9 @@ BOOLEAN OnlyHostileCivsInSector()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for( i = gTacticalStatus.Team[ CREATURE_TEAM ].bFirstID; i <= gTacticalStatus.Team[ CREATURE_TEAM ].bLastID; i++ )
|
for( i = gTacticalStatus.Team[ CREATURE_TEAM ].bFirstID; i <= gTacticalStatus.Team[ CREATURE_TEAM ].bLastID; ++i )
|
||||||
{
|
{
|
||||||
pSoldier = MercPtrs[ i ];
|
pSoldier = i;
|
||||||
if( pSoldier->bActive && pSoldier->bInSector && pSoldier->stats.bLife )
|
if( pSoldier->bActive && pSoldier->bInSector && pSoldier->stats.bLife )
|
||||||
{
|
{
|
||||||
if( !pSoldier->aiData.bNeutral )
|
if( !pSoldier->aiData.bNeutral )
|
||||||
@@ -3111,9 +3012,9 @@ BOOLEAN OnlyHostileCivsInSector()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for( i = gTacticalStatus.Team[ MILITIA_TEAM ].bFirstID; i <= gTacticalStatus.Team[ MILITIA_TEAM ].bLastID; i++ )
|
for( i = gTacticalStatus.Team[ MILITIA_TEAM ].bFirstID; i <= gTacticalStatus.Team[ MILITIA_TEAM ].bLastID; ++i )
|
||||||
{
|
{
|
||||||
pSoldier = MercPtrs[ i ];
|
pSoldier = i;
|
||||||
if( pSoldier->bActive && pSoldier->bInSector && pSoldier->stats.bLife )
|
if( pSoldier->bActive && pSoldier->bInSector && pSoldier->stats.bLife )
|
||||||
{
|
{
|
||||||
if( !pSoldier->aiData.bNeutral )
|
if( !pSoldier->aiData.bNeutral )
|
||||||
@@ -3176,8 +3077,8 @@ void HandleBloodCatDeaths( SECTORINFO *pSector )
|
|||||||
//if ALL the bloodcats are killed
|
//if ALL the bloodcats are killed
|
||||||
if( pSector->bBloodCats == 0 )
|
if( pSector->bBloodCats == 0 )
|
||||||
{
|
{
|
||||||
UINT8 bId1=-1;
|
SoldierID bId1 = NOBODY;
|
||||||
UINT8 bId2=-1;
|
SoldierID bId2 = NOBODY;
|
||||||
UINT8 bNum=0;
|
UINT8 bNum=0;
|
||||||
|
|
||||||
SetFactTrue( FACT_PLAYER_KILLED_ALL_BETTYS_BLOODCATS );
|
SetFactTrue( FACT_PLAYER_KILLED_ALL_BETTYS_BLOODCATS );
|
||||||
@@ -3192,13 +3093,13 @@ void HandleBloodCatDeaths( SECTORINFO *pSector )
|
|||||||
if( bNum != 0 )
|
if( bNum != 0 )
|
||||||
{
|
{
|
||||||
//must make sure TEX doesnt say the quote
|
//must make sure TEX doesnt say the quote
|
||||||
if( bId1 != NOBODY && Menptr[ bId1 ].ubProfile != TEX_UB )
|
if( bId1 != NOBODY && bId1->ubProfile != TEX_UB )
|
||||||
{
|
{
|
||||||
TacticalCharacterDialogue( &Menptr[ bId1 ], QUOTE_UB_HANDLE_BLOODCATDEATHS );
|
TacticalCharacterDialogue( bId1, QUOTE_UB_HANDLE_BLOODCATDEATHS );
|
||||||
}
|
}
|
||||||
else if( bId2 != NOBODY && Menptr[ bId2 ].ubProfile != TEX_UB )
|
else if( bId2 != NOBODY && bId2->ubProfile != TEX_UB )
|
||||||
{
|
{
|
||||||
TacticalCharacterDialogue( &Menptr[ bId2 ], QUOTE_UB_HANDLE_BLOODCATDEATHS );
|
TacticalCharacterDialogue( bId2, QUOTE_UB_HANDLE_BLOODCATDEATHS );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+12
-13
@@ -12,26 +12,26 @@
|
|||||||
extern BOOLEAN gfPendingNonPlayerTeam[PLAYER_PLAN];
|
extern BOOLEAN gfPendingNonPlayerTeam[PLAYER_PLAN];
|
||||||
|
|
||||||
|
|
||||||
UINT8 NumFreeSlots( UINT8 ubTeam );
|
UINT16 NumFreeSlots( UINT8 ubTeam );
|
||||||
|
|
||||||
//Counts enemies and crepitus, but not bloodcats.
|
//Counts enemies and crepitus, but not bloodcats.
|
||||||
UINT8 NumHostilesInSector( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ );
|
UINT16 NumHostilesInSector( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ );
|
||||||
|
|
||||||
UINT8 NumEnemiesInAnySector( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ );
|
UINT16 NumEnemiesInAnySector( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ );
|
||||||
|
|
||||||
// returns how many members of a team are in a sector - not intended for OUR_TEAM!
|
// returns how many members of a team are in a sector - not intended for OUR_TEAM!
|
||||||
UINT8 NumNonPlayerTeamMembersInSector( INT16 sSectorX, INT16 sSectorY, UINT8 ubTeam );
|
UINT16 NumNonPlayerTeamMembersInSector( INT16 sSectorX, INT16 sSectorY, UINT8 ubTeam );
|
||||||
|
|
||||||
// returns how many members of a team are in a sector - only intended for OUR_TEAM! POWs not included
|
// returns how many members of a team are in a sector - only intended for OUR_TEAM! POWs not included
|
||||||
UINT16 NumPlayerTeamMembersInSector( INT16 sSectorX, INT16 sSectorY, INT8 sSectorZ );
|
UINT16 NumPlayerTeamMembersInSector( INT16 sSectorX, INT16 sSectorY, INT8 sSectorZ );
|
||||||
|
|
||||||
UINT16 NumEnemyArmedVehiclesInSector( INT16 sSectorX, INT16 sSectorY, UINT8 usTeam );
|
UINT16 NumEnemyArmedVehiclesInSector( INT16 sSectorX, INT16 sSectorY, UINT8 usTeam );
|
||||||
UINT8 NumStationaryEnemiesInSector( INT16 sSectorX, INT16 sSectorY );
|
UINT16 NumStationaryEnemiesInSector( INT16 sSectorX, INT16 sSectorY );
|
||||||
UINT8 NumMobileEnemiesInSector( INT16 sSectorX, INT16 sSectorY );
|
UINT16 NumMobileEnemiesInSector( INT16 sSectorX, INT16 sSectorY );
|
||||||
void GetNumberOfMobileEnemiesInSector( INT16 sSectorX, INT16 sSectorY, UINT8 *pubNumAdmins, UINT8 *pubNumTroops, UINT8 *pubNumElites, UINT8 *pubNumRobots, UINT8 *pubNumTanks, UINT8 *pubNumJeeps );
|
void GetNumberOfMobileEnemiesInSector( INT16 sSectorX, INT16 sSectorY, UINT16 *pubNumAdmins, UINT16 *pubNumTroops, UINT16 *pubNumElites, UINT16 *pubNumRobots, UINT16 *pubNumTanks, UINT16 *pubNumJeeps );
|
||||||
void GetNumberOfMobileEnemiesInSectorWithoutRoadBlock( INT16 sSectorX, INT16 sSectorY, UINT8 usTeam, UINT8 *pubNumAdmins, UINT8 *pubNumTroops, UINT8 *pubNumElites, UINT8 *pubNumRobots, UINT8 *pubNumTanks, UINT8 *pubNumJeeps );
|
void GetNumberOfMobileEnemiesInSectorWithoutRoadBlock( INT16 sSectorX, INT16 sSectorY, UINT16 usTeam, UINT16 *pubNumAdmins, UINT16 *pubNumTroops, UINT16 *pubNumElites, UINT16 *pubNumRobots, UINT16 *pubNumTanks, UINT16 *pubNumJeeps );
|
||||||
void GetNumberOfStationaryEnemiesInSector( INT16 sSectorX, INT16 sSectorY, UINT8 *pubNumAdmins, UINT8 *pubNumTroops, UINT8 *pubNumElites, UINT8 *pubNumRobots, UINT8 *pubNumTanks, UINT8 *pubNumJeeps );
|
void GetNumberOfStationaryEnemiesInSector( INT16 sSectorX, INT16 sSectorY, UINT16 *pubNumAdmins, UINT16 *pubNumTroops, UINT16 *pubNumElites, UINT16 *pubNumRobots, UINT16 *pubNumTanks, UINT16 *pubNumJeeps );
|
||||||
void GetNumberOfEnemiesInSector( INT16 sSectorX, INT16 sSectorY, UINT8 *pubNumAdmins, UINT8 *pubNumTroops, UINT8 *pubNumElites, UINT8 *pubNumRobots, UINT8 *pubNumTanks, UINT8 *pubNumJeeps );
|
void GetNumberOfEnemiesInSector( INT16 sSectorX, INT16 sSectorY, UINT16 *pubNumAdmins, UINT16 *pubNumTroops, UINT16 *pubNumElites, UINT16 *pubNumRobots, UINT16 *pubNumTanks, UINT16 *pubNumJeeps );
|
||||||
|
|
||||||
//Called when entering a sector so the campaign AI can automatically insert the
|
//Called when entering a sector so the campaign AI can automatically insert the
|
||||||
//correct number of troops of each type based on the current number in the sector
|
//correct number of troops of each type based on the current number in the sector
|
||||||
@@ -39,14 +39,13 @@ void GetNumberOfEnemiesInSector( INT16 sSectorX, INT16 sSectorY, UINT8 *pubNumAd
|
|||||||
BOOLEAN PrepareEnemyForSectorBattle();
|
BOOLEAN PrepareEnemyForSectorBattle();
|
||||||
BOOLEAN PrepareEnemyForUndergroundBattle();
|
BOOLEAN PrepareEnemyForUndergroundBattle();
|
||||||
|
|
||||||
void AddEnemiesToBattle( GROUP *pGroup, UINT8 ubStrategicInsertionCode, UINT8 ubNumAdmins, UINT8 ubNumTroops, UINT8 ubNumElites, UINT8 ubNumRobots, UINT8 ubNumTanks, UINT8 abNumJeeps, BOOLEAN fMagicallyAppeared );
|
void AddEnemiesToBattle( GROUP *pGroup, UINT8 ubStrategicInsertionCode, UINT16 ubNumAdmins, UINT16 ubNumTroops, UINT16 ubNumElites, UINT16 ubNumRobots, UINT16 ubNumTanks, UINT16 abNumJeeps, BOOLEAN fMagicallyAppeared );
|
||||||
void AddMilitiaToBattle( GROUP *pGroup, UINT8 ubStrategicInsertionCode, UINT8 ubNumGreens, UINT8 ubNumRegulars, UINT8 ubNumElites, BOOLEAN fMagicallyAppeared );
|
void AddMilitiaToBattle( GROUP *pGroup, UINT8 ubStrategicInsertionCode, UINT16 ubNumGreens, UINT16 ubNumRegulars, UINT16 ubNumElites, BOOLEAN fMagicallyAppeared );
|
||||||
void AddPossiblePendingEnemiesToBattle();
|
void AddPossiblePendingEnemiesToBattle();
|
||||||
void EndTacticalBattleForEnemy();
|
void EndTacticalBattleForEnemy();
|
||||||
|
|
||||||
void ProcessQueenCmdImplicationsOfDeath( SOLDIERTYPE *pSoldier );
|
void ProcessQueenCmdImplicationsOfDeath( SOLDIERTYPE *pSoldier );
|
||||||
|
|
||||||
void HandleEnemyStatusInCurrentMapBeforeLoadingNewMap();
|
|
||||||
BOOLEAN SaveUnderGroundSectorInfoToSaveGame( HWFILE hFile );
|
BOOLEAN SaveUnderGroundSectorInfoToSaveGame( HWFILE hFile );
|
||||||
BOOLEAN LoadUnderGroundSectorInfoFromSavedGame( HWFILE hFile );
|
BOOLEAN LoadUnderGroundSectorInfoFromSavedGame( HWFILE hFile );
|
||||||
|
|
||||||
|
|||||||
@@ -665,19 +665,19 @@ void ChangeFactState( INT32 iNumber );
|
|||||||
void DisplayCurrentGridNo();
|
void DisplayCurrentGridNo();
|
||||||
void EnableQDSButtons();
|
void EnableQDSButtons();
|
||||||
|
|
||||||
BOOLEAN DoQDSMessageBox( UINT8 ubStyle, STR16 zString, UINT32 uiExitScreen, UINT8 ubFlags, MSGBOX_CALLBACK ReturnCallback );
|
BOOLEAN DoQDSMessageBox( UINT8 ubStyle, STR16 zString, UINT32 uiExitScreen, UINT8 ubFlags, MSGBOX_CALLBACK ReturnCallback );
|
||||||
void IncrementActiveDropDownBox( INT16 sIncrementValue );
|
void IncrementActiveDropDownBox( INT16 sIncrementValue );
|
||||||
INT16 IsMercInTheSector( UINT16 usMercID );
|
SoldierID IsMercInTheSector( UINT8 ubMercProfileID );
|
||||||
void RefreshAllNPCInventory();
|
void RefreshAllNPCInventory();
|
||||||
void SetQDSMercProfile();
|
void SetQDSMercProfile();
|
||||||
void HandleQDSTalkingMerc();
|
void HandleQDSTalkingMerc();
|
||||||
void DisplayQDSCurrentlyQuoteNum( );
|
void DisplayQDSCurrentlyQuoteNum( );
|
||||||
void SetTalkingMercPauseState( BOOLEAN fState );
|
void SetTalkingMercPauseState( BOOLEAN fState );
|
||||||
UINT8 WhichPanelShouldTalkingMercUse( );
|
UINT8 WhichPanelShouldTalkingMercUse( );
|
||||||
void EndMercTalking();
|
void EndMercTalking();
|
||||||
void EnableFactMouseRegions();
|
void EnableFactMouseRegions();
|
||||||
void DisableFactMouseRegions();
|
void DisableFactMouseRegions();
|
||||||
INT32 GetMaxNumberOfQuotesToPlay( );
|
INT32 GetMaxNumberOfQuotesToPlay( );
|
||||||
void GetDebugLocationString( UINT16 usProfileID, STR16 pzText );
|
void GetDebugLocationString( UINT16 usProfileID, STR16 pzText );
|
||||||
|
|
||||||
//ppp
|
//ppp
|
||||||
@@ -2993,9 +2993,9 @@ void DestroyQuestDebugTextInputBoxes()
|
|||||||
|
|
||||||
void AddNPCToGridNo( INT32 iGridNo )
|
void AddNPCToGridNo( INT32 iGridNo )
|
||||||
{
|
{
|
||||||
SOLDIERCREATE_STRUCT MercCreateStruct;
|
SOLDIERCREATE_STRUCT MercCreateStruct;
|
||||||
INT16 sSectorX, sSectorY;
|
INT16 sSectorX, sSectorY;
|
||||||
UINT8 ubID;
|
SoldierID ubID;
|
||||||
|
|
||||||
GetCurrentWorldSector( &sSectorX, &sSectorY );
|
GetCurrentWorldSector( &sSectorX, &sSectorY );
|
||||||
MercCreateStruct.bTeam = CIV_TEAM;
|
MercCreateStruct.bTeam = CIV_TEAM;
|
||||||
@@ -3270,7 +3270,7 @@ void BtnQuestDebugAllOrSectorNPCToggleCallback( GUI_BUTTON *btn, INT32 reason )
|
|||||||
DisableButton( guiQuestDebugStartMercTalkingButtonButton );
|
DisableButton( guiQuestDebugStartMercTalkingButtonButton );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( IsMercInTheSector( gNpcListBox.sCurSelectedItem ) == -1 )
|
if( IsMercInTheSector( gNpcListBox.sCurSelectedItem ) == NOBODY )
|
||||||
DisableButton( guiQuestDebugViewNPCInvButton );
|
DisableButton( guiQuestDebugViewNPCInvButton );
|
||||||
|
|
||||||
EnableQDSButtons();
|
EnableQDSButtons();
|
||||||
@@ -3567,7 +3567,7 @@ void EnableQDSButtons()
|
|||||||
|
|
||||||
if( gfUseLocalNPCs )
|
if( gfUseLocalNPCs )
|
||||||
{
|
{
|
||||||
if( IsMercInTheSector( gubCurrentNpcInSector[ gNpcListBox.sCurSelectedItem ] ) != -1 )
|
if( IsMercInTheSector( gubCurrentNpcInSector[ gNpcListBox.sCurSelectedItem ] ) != NOBODY )
|
||||||
{
|
{
|
||||||
EnableButton( guiQuestDebugViewNPCInvButton );
|
EnableButton( guiQuestDebugViewNPCInvButton );
|
||||||
EnableButton( guiQuestDebugNPCRefreshButtonButton );
|
EnableButton( guiQuestDebugNPCRefreshButtonButton );
|
||||||
@@ -3664,23 +3664,20 @@ void IncrementActiveDropDownBox( INT16 sIncrementValue )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
INT16 IsMercInTheSector( UINT16 usMercID )
|
SoldierID IsMercInTheSector( UINT8 ubMercProfileID )
|
||||||
{
|
{
|
||||||
if( usMercID == -1 )
|
UINT16 cnt;
|
||||||
return( FALSE );
|
|
||||||
|
|
||||||
UINT8 cnt;
|
|
||||||
for ( cnt=0; cnt < TOTAL_SOLDIERS; cnt++ )
|
for ( cnt=0; cnt < TOTAL_SOLDIERS; cnt++ )
|
||||||
{
|
{
|
||||||
//if the merc is active
|
//if the merc is active
|
||||||
if( Menptr[ cnt ].ubProfile == usMercID )
|
if( Menptr[ cnt ].ubProfile == ubMercProfileID )
|
||||||
{
|
{
|
||||||
if( Menptr[ cnt ].bActive )
|
if( Menptr[ cnt ].bActive )
|
||||||
return( Menptr[ cnt ].ubID );
|
return( Menptr[ cnt ].ubID );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return( -1 );
|
return( NOBODY );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+20
-20
@@ -181,7 +181,7 @@ BOOLEAN CheckNPCWithin( UINT8 ubFirstNPC, UINT8 ubSecondNPC, UINT8 ubMaxDistance
|
|||||||
return( PythSpacesAway( pFirstNPC->sGridNo, pSecondNPC->sGridNo ) <= ubMaxDistance );
|
return( PythSpacesAway( pFirstNPC->sGridNo, pSecondNPC->sGridNo ) <= ubMaxDistance );
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN CheckGuyVisible( UINT8 ubNPC, UINT8 ubGuy )
|
BOOLEAN CheckGuyVisible( UINT16 ubNPC, UINT16 ubGuy )
|
||||||
{
|
{
|
||||||
// NB ONLY WORKS IF ON DIFFERENT TEAMS
|
// NB ONLY WORKS IF ON DIFFERENT TEAMS
|
||||||
SOLDIERTYPE * pNPC, * pGuy;
|
SOLDIERTYPE * pNPC, * pGuy;
|
||||||
@@ -299,12 +299,12 @@ UINT32 NumWoundedMercsNearby( UINT8 ubProfileID )
|
|||||||
return( bNumber );
|
return( bNumber );
|
||||||
}
|
}
|
||||||
|
|
||||||
INT8 NumMercsNear( UINT8 ubProfileID, UINT8 ubMaxDist )
|
UINT16 NumMercsNear( UINT8 ubProfileID, UINT8 ubMaxDist )
|
||||||
{
|
{
|
||||||
INT8 bNumber = 0;
|
UINT16 bNumber = 0;
|
||||||
UINT32 uiLoop;
|
UINT32 uiLoop;
|
||||||
SOLDIERTYPE * pNPC;
|
SOLDIERTYPE *pNPC;
|
||||||
SOLDIERTYPE * pSoldier;
|
SOLDIERTYPE *pSoldier;
|
||||||
INT32 sGridNo;
|
INT32 sGridNo;
|
||||||
|
|
||||||
pNPC = FindSoldierByProfileID( ubProfileID, FALSE );
|
pNPC = FindSoldierByProfileID( ubProfileID, FALSE );
|
||||||
@@ -394,7 +394,7 @@ BOOLEAN PCInSameRoom( UINT8 ubProfileID )
|
|||||||
//DBrot: More Rooms
|
//DBrot: More Rooms
|
||||||
//UINT8 ubRoom;
|
//UINT8 ubRoom;
|
||||||
UINT16 usRoom;
|
UINT16 usRoom;
|
||||||
INT8 bLoop;
|
SoldierID bLoop;
|
||||||
SOLDIERTYPE * pSoldier;
|
SOLDIERTYPE * pSoldier;
|
||||||
|
|
||||||
pNPC = FindSoldierByProfileID( ubProfileID, FALSE );
|
pNPC = FindSoldierByProfileID( ubProfileID, FALSE );
|
||||||
@@ -404,9 +404,9 @@ BOOLEAN PCInSameRoom( UINT8 ubProfileID )
|
|||||||
}
|
}
|
||||||
usRoom = gusWorldRoomInfo[ pNPC->sGridNo ];
|
usRoom = gusWorldRoomInfo[ pNPC->sGridNo ];
|
||||||
|
|
||||||
for ( bLoop = gTacticalStatus.Team[ gbPlayerNum ].bFirstID; bLoop <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; bLoop++ )
|
for ( bLoop = gTacticalStatus.Team[ gbPlayerNum ].bFirstID; bLoop <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++bLoop )
|
||||||
{
|
{
|
||||||
pSoldier = MercPtrs[ bLoop ];
|
pSoldier = bLoop;
|
||||||
if ( pSoldier && pSoldier->bActive && pSoldier->bInSector )
|
if ( pSoldier && pSoldier->bActive && pSoldier->bInSector )
|
||||||
{
|
{
|
||||||
if ( gusWorldRoomInfo[ pSoldier->sGridNo ] == usRoom )
|
if ( gusWorldRoomInfo[ pSoldier->sGridNo ] == usRoom )
|
||||||
@@ -536,12 +536,11 @@ BOOLEAN FemalePresent( UINT8 ubProfileID )
|
|||||||
|
|
||||||
BOOLEAN CheckPlayerHasHead( void )
|
BOOLEAN CheckPlayerHasHead( void )
|
||||||
{
|
{
|
||||||
INT8 bLoop;
|
SOLDIERTYPE * pSoldier;
|
||||||
SOLDIERTYPE * pSoldier;
|
|
||||||
|
|
||||||
for ( bLoop = gTacticalStatus.Team[ gbPlayerNum ].bFirstID; bLoop <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; bLoop++ )
|
for ( SoldierID bLoop = gTacticalStatus.Team[ gbPlayerNum ].bFirstID; bLoop <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++bLoop )
|
||||||
{
|
{
|
||||||
pSoldier = MercPtrs[ bLoop ];
|
pSoldier = bLoop;
|
||||||
|
|
||||||
if ( pSoldier->bActive && pSoldier->stats.bLife > 0 )
|
if ( pSoldier->bActive && pSoldier->stats.bLife > 0 )
|
||||||
{
|
{
|
||||||
@@ -1714,18 +1713,19 @@ void GiveQuestRewardPoint( INT16 sQuestSectorX, INT16 sQuestsSectorY, INT8 bExpR
|
|||||||
{
|
{
|
||||||
ScreenMsg( FONT_MCOLOR_LTBLUE, MSG_TESTVERSION, L"QUEST COMPLETED - Adding to merc records and awarding experiences (%d).", (bExpReward * gGameExternalOptions.usAwardSpecialExpForQuests) );
|
ScreenMsg( FONT_MCOLOR_LTBLUE, MSG_TESTVERSION, L"QUEST COMPLETED - Adding to merc records and awarding experiences (%d).", (bExpReward * gGameExternalOptions.usAwardSpecialExpForQuests) );
|
||||||
|
|
||||||
for ( UINT8 i = gTacticalStatus.Team[ gbPlayerNum ].bFirstID; i <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; i++ )
|
for ( SoldierID id = gTacticalStatus.Team[ gbPlayerNum ].bFirstID; id <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++id )
|
||||||
{
|
{
|
||||||
if( MercPtrs[ i ]->bActive && MercPtrs[ i ]->stats.bLife >= CONSCIOUSNESS && !(MercPtrs[ i ]->flags.uiStatusFlags & SOLDIER_VEHICLE) && MercPtrs[ i ]->ubProfile != NO_PROFILE &&
|
SOLDIERTYPE *pSoldier = id;
|
||||||
MercPtrs[ i ]->sSectorX == sQuestSectorX && MercPtrs[ i ]->sSectorY == sQuestsSectorY && !MercPtrs[ i ]->flags.fBetweenSectors && MercPtrs[ i ]->bTeam == gbPlayerNum &&
|
if( pSoldier->bActive && pSoldier->stats.bLife >= CONSCIOUSNESS && !(pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE) && pSoldier->ubProfile != NO_PROFILE &&
|
||||||
MercPtrs[ i ]->bAssignment != IN_TRANSIT && MercPtrs[ i ]->bAssignment != ASSIGNMENT_DEAD && gMercProfiles[ MercPtrs[ i ]->ubProfile ].ubBodyType != 21 ) // != ROBOTNOWEAPON )
|
pSoldier->sSectorX == sQuestSectorX && pSoldier->sSectorY == sQuestsSectorY && !pSoldier->flags.fBetweenSectors && pSoldier->bTeam == gbPlayerNum &&
|
||||||
|
pSoldier->bAssignment != IN_TRANSIT && pSoldier->bAssignment != ASSIGNMENT_DEAD && gMercProfiles[ pSoldier->ubProfile ].ubBodyType != 21 ) // != ROBOTNOWEAPON )
|
||||||
{
|
{
|
||||||
if ( MercPtrs[ i ]->ubProfile != bException )
|
if ( pSoldier->ubProfile != bException )
|
||||||
{
|
{
|
||||||
gMercProfiles[ MercPtrs[ i ]->ubProfile ].records.ubQuestsHandled++;
|
gMercProfiles[ pSoldier->ubProfile ].records.ubQuestsHandled++;
|
||||||
|
|
||||||
if ( bExpReward > 0 && gGameExternalOptions.usAwardSpecialExpForQuests > 0 )
|
if ( bExpReward > 0 && gGameExternalOptions.usAwardSpecialExpForQuests > 0 )
|
||||||
StatChange( MercPtrs[ i ], EXPERAMT, (bExpReward * gGameExternalOptions.usAwardSpecialExpForQuests), FALSE );
|
StatChange( pSoldier, EXPERAMT, (bExpReward * gGameExternalOptions.usAwardSpecialExpForQuests), FALSE );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -728,12 +728,12 @@ extern BOOLEAN CheckNPCWounded( UINT8 ubProfileID, BOOLEAN fByPlayerOnly );
|
|||||||
extern BOOLEAN CheckNPCInOkayHealth( UINT8 ubProfileID );
|
extern BOOLEAN CheckNPCInOkayHealth( UINT8 ubProfileID );
|
||||||
extern BOOLEAN CheckNPCBleeding( UINT8 ubProfileID );
|
extern BOOLEAN CheckNPCBleeding( UINT8 ubProfileID );
|
||||||
extern BOOLEAN CheckNPCWithin( UINT8 ubFirstNPC, UINT8 ubSecondNPC, UINT8 ubMaxDistance );
|
extern BOOLEAN CheckNPCWithin( UINT8 ubFirstNPC, UINT8 ubSecondNPC, UINT8 ubMaxDistance );
|
||||||
extern BOOLEAN CheckGuyVisible( UINT8 ubNPC, UINT8 ubGuy );
|
extern BOOLEAN CheckGuyVisible( UINT16 ubNPC, UINT16 ubGuy );
|
||||||
extern BOOLEAN CheckNPCAt( UINT8 ubNPC, INT32 sGridNo );
|
extern BOOLEAN CheckNPCAt( UINT8 ubNPC, INT32 sGridNo );
|
||||||
extern BOOLEAN CheckNPCIsEnemy( UINT8 ubProfileID );
|
extern BOOLEAN CheckNPCIsEnemy( UINT8 ubProfileID );
|
||||||
extern BOOLEAN CheckIfMercIsNearNPC( SOLDIERTYPE *pMerc, UINT8 ubProfileId );
|
extern BOOLEAN CheckIfMercIsNearNPC( SOLDIERTYPE *pMerc, UINT8 ubProfileId );
|
||||||
extern UINT32 NumWoundedMercsNearby( UINT8 ubProfileID );
|
extern UINT32 NumWoundedMercsNearby( UINT8 ubProfileID );
|
||||||
extern INT8 NumMercsNear( UINT8 ubProfileID, UINT8 ubMaxDist );
|
extern UINT16 NumMercsNear( UINT8 ubProfileID, UINT8 ubMaxDist );
|
||||||
extern BOOLEAN CheckNPCIsEPC( UINT8 ubProfileID );
|
extern BOOLEAN CheckNPCIsEPC( UINT8 ubProfileID );
|
||||||
//DBrot: More Rooms
|
//DBrot: More Rooms
|
||||||
//extern BOOLEAN NPCInRoom( UINT8 ubProfileID, UINT8 ubRoomID );
|
//extern BOOLEAN NPCInRoom( UINT8 ubProfileID, UINT8 ubRoomID );
|
||||||
|
|||||||
+15
-15
@@ -2167,9 +2167,9 @@ BOOLEAN SetupMissionAgentBox(UINT16 x, UINT16 y, INT8 index)
|
|||||||
|
|
||||||
// temp/fixme
|
// temp/fixme
|
||||||
std::vector<SOLDIERTYPE*> mercs;
|
std::vector<SOLDIERTYPE*> mercs;
|
||||||
for (UINT8 i = gTacticalStatus.Team[OUR_TEAM].bFirstID; i <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++i)
|
for ( SoldierID i = gTacticalStatus.Team[OUR_TEAM].bFirstID; i <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++i)
|
||||||
{
|
{
|
||||||
SOLDIERTYPE* pSoldier = MercPtrs[i];
|
SOLDIERTYPE* pSoldier = i;
|
||||||
|
|
||||||
if (pSoldier && pSoldier->bActive
|
if (pSoldier && pSoldier->bActive
|
||||||
&& !(pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE)
|
&& !(pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE)
|
||||||
@@ -2812,9 +2812,9 @@ void PrepareMission(INT8 index)
|
|||||||
|
|
||||||
// confirmation popup
|
// confirmation popup
|
||||||
std::vector<SOLDIERTYPE*> mercs;
|
std::vector<SOLDIERTYPE*> mercs;
|
||||||
for (UINT8 i = gTacticalStatus.Team[OUR_TEAM].bFirstID; i <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++i)
|
for ( SoldierID i = gTacticalStatus.Team[OUR_TEAM].bFirstID; i <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++i)
|
||||||
{
|
{
|
||||||
SOLDIERTYPE* pSoldier = MercPtrs[i];
|
SOLDIERTYPE* pSoldier = i;
|
||||||
|
|
||||||
if (pSoldier && pSoldier->bActive
|
if (pSoldier && pSoldier->bActive
|
||||||
&& !(pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE)
|
&& !(pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE)
|
||||||
@@ -2977,9 +2977,9 @@ void PrepareMission(INT8 index)
|
|||||||
|
|
||||||
if (!evt.sentGenericRebelAgent)
|
if (!evt.sentGenericRebelAgent)
|
||||||
{
|
{
|
||||||
for (UINT8 i = gTacticalStatus.Team[OUR_TEAM].bFirstID; i <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++i)
|
for ( SoldierID i = gTacticalStatus.Team[OUR_TEAM].bFirstID; i <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++i)
|
||||||
{
|
{
|
||||||
SOLDIERTYPE* pSoldier = MercPtrs[i];
|
SOLDIERTYPE* pSoldier = i;
|
||||||
if (pSoldier->ubProfile == evt.mercProfileId)
|
if (pSoldier->ubProfile == evt.mercProfileId)
|
||||||
{
|
{
|
||||||
TakeSoldierOutOfVehicle(pSoldier);
|
TakeSoldierOutOfVehicle(pSoldier);
|
||||||
@@ -3171,7 +3171,7 @@ INT32 GetMiningPolicyBonus(INT16 townId)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetBonusMilitia(INT16 sx, INT16 sy, UINT8& green, UINT8& regular, UINT8& elite, BOOLEAN createGroup)
|
void GetBonusMilitia(INT16 sx, INT16 sy, UINT16& green, UINT16& regular, UINT16& elite, BOOLEAN createGroup)
|
||||||
{
|
{
|
||||||
if (!gGameExternalOptions.fRebelCommandEnabled)
|
if (!gGameExternalOptions.fRebelCommandEnabled)
|
||||||
return;
|
return;
|
||||||
@@ -4882,9 +4882,9 @@ void HandleStrategicEvent(const UINT32 eventParam)
|
|||||||
|
|
||||||
// make sure the merc's still on our team
|
// make sure the merc's still on our team
|
||||||
BOOLEAN foundMerc = FALSE;
|
BOOLEAN foundMerc = FALSE;
|
||||||
for (UINT8 i = gTacticalStatus.Team[OUR_TEAM].bFirstID; i <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++i)
|
for ( SoldierID i = gTacticalStatus.Team[OUR_TEAM].bFirstID; i <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++i)
|
||||||
{
|
{
|
||||||
const SOLDIERTYPE* pSoldier = MercPtrs[i];
|
const SOLDIERTYPE* pSoldier = i;
|
||||||
|
|
||||||
if (pSoldier->ubProfile == evt1.mercProfileId && pSoldier->bActive)
|
if (pSoldier->ubProfile == evt1.mercProfileId && pSoldier->bActive)
|
||||||
{
|
{
|
||||||
@@ -4953,9 +4953,9 @@ void HandleStrategicEvent(const UINT32 eventParam)
|
|||||||
|
|
||||||
if (!evt1.sentGenericRebelAgent)
|
if (!evt1.sentGenericRebelAgent)
|
||||||
{
|
{
|
||||||
for (UINT8 i = gTacticalStatus.Team[OUR_TEAM].bFirstID; i <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++i)
|
for ( SoldierID i = gTacticalStatus.Team[OUR_TEAM].bFirstID; i <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++i)
|
||||||
{
|
{
|
||||||
SOLDIERTYPE* pSoldier = MercPtrs[i];
|
SOLDIERTYPE* pSoldier = i;
|
||||||
if (pSoldier->ubProfile == evt1.mercProfileId)
|
if (pSoldier->ubProfile == evt1.mercProfileId)
|
||||||
{
|
{
|
||||||
if (mission == RCAM_FORGE_TRANSPORT_ORDERS)
|
if (mission == RCAM_FORGE_TRANSPORT_ORDERS)
|
||||||
@@ -4980,9 +4980,9 @@ void HandleStrategicEvent(const UINT32 eventParam)
|
|||||||
{
|
{
|
||||||
if (!evt1.sentGenericRebelAgent && foundMerc)
|
if (!evt1.sentGenericRebelAgent && foundMerc)
|
||||||
{
|
{
|
||||||
for (UINT8 i = gTacticalStatus.Team[OUR_TEAM].bFirstID; i <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++i)
|
for ( SoldierID i = gTacticalStatus.Team[OUR_TEAM].bFirstID; i <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++i)
|
||||||
{
|
{
|
||||||
SOLDIERTYPE* pSoldier = MercPtrs[i];
|
SOLDIERTYPE* pSoldier = i;
|
||||||
if (pSoldier->ubProfile == evt1.mercProfileId)
|
if (pSoldier->ubProfile == evt1.mercProfileId)
|
||||||
{
|
{
|
||||||
// mission failed! we tried, give some pity exp
|
// mission failed! we tried, give some pity exp
|
||||||
@@ -5002,9 +5002,9 @@ void HandleStrategicEvent(const UINT32 eventParam)
|
|||||||
|
|
||||||
if (!evt1.sentGenericRebelAgent && foundMerc)
|
if (!evt1.sentGenericRebelAgent && foundMerc)
|
||||||
{
|
{
|
||||||
for (UINT8 i = gTacticalStatus.Team[OUR_TEAM].bFirstID; i <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++i)
|
for ( SoldierID i = gTacticalStatus.Team[OUR_TEAM].bFirstID; i <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++i)
|
||||||
{
|
{
|
||||||
SOLDIERTYPE* pSoldier = MercPtrs[i];
|
SOLDIERTYPE* pSoldier = i;
|
||||||
if (pSoldier->ubProfile == evt1.mercProfileId)
|
if (pSoldier->ubProfile == evt1.mercProfileId)
|
||||||
{
|
{
|
||||||
// merc ready for reassignment
|
// merc ready for reassignment
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ void ApplyMilitiaBonuses(SOLDIERTYPE* pMilitia);
|
|||||||
UINT8 GetApproximateEnemyLocationResolutionIndex();
|
UINT8 GetApproximateEnemyLocationResolutionIndex();
|
||||||
FLOAT GetAssignmentBonus(INT16 x, INT16 y);
|
FLOAT GetAssignmentBonus(INT16 x, INT16 y);
|
||||||
INT32 GetMiningPolicyBonus(INT16 townId);
|
INT32 GetMiningPolicyBonus(INT16 townId);
|
||||||
void GetBonusMilitia(INT16 x, INT16 y, UINT8& green, UINT8& regular, UINT8& elite, BOOLEAN createGroup);
|
void GetBonusMilitia(INT16 x, INT16 y, UINT16& green, UINT16& regular, UINT16& elite, BOOLEAN createGroup);
|
||||||
INT16 GetFortificationsBonus(UINT8 sector);
|
INT16 GetFortificationsBonus(UINT8 sector);
|
||||||
FLOAT GetHarriersSpeedPenalty(UINT8 sector);
|
FLOAT GetHarriersSpeedPenalty(UINT8 sector);
|
||||||
FLOAT GetLoyaltyGainModifier();
|
FLOAT GetLoyaltyGainModifier();
|
||||||
|
|||||||
@@ -29,9 +29,9 @@
|
|||||||
UINT8 gubReinforcementMinEnemyStaticGroupSize = 12;
|
UINT8 gubReinforcementMinEnemyStaticGroupSize = 12;
|
||||||
UINT32 guiMilitiaReinforceTurn = 0, guiMilitiaArrived = 0;//dnl ch68 090913
|
UINT32 guiMilitiaReinforceTurn = 0, guiMilitiaArrived = 0;//dnl ch68 090913
|
||||||
|
|
||||||
void GetNumberOfEnemiesInFiveSectors( INT16 sSectorX, INT16 sSectorY, UINT8 *pubNumAdmins, UINT8 *pubNumTroops, UINT8 *pubNumElites, UINT8 *pubNumRobots, UINT8 *pubNumTanks, UINT8 *pubNumJeeps )
|
void GetNumberOfEnemiesInFiveSectors( INT16 sSectorX, INT16 sSectorY, UINT16 *pubNumAdmins, UINT16 *pubNumTroops, UINT16 *pubNumElites, UINT16 *pubNumRobots, UINT16 *pubNumTanks, UINT16 *pubNumJeeps )
|
||||||
{
|
{
|
||||||
UINT8 ubNumAdmins, ubNumTroops, ubNumElites, ubNumRobots, ubNumTanks, ubNumJeeps;
|
UINT16 ubNumAdmins, ubNumTroops, ubNumElites, ubNumRobots, ubNumTanks, ubNumJeeps;
|
||||||
UINT16 pusMoveDir[4][3]; //first column in this matrix is number of sector, except for 4th row
|
UINT16 pusMoveDir[4][3]; //first column in this matrix is number of sector, except for 4th row
|
||||||
UINT8 ubDirNumber, ubIndex;
|
UINT8 ubDirNumber, ubIndex;
|
||||||
|
|
||||||
@@ -156,9 +156,9 @@ void ActivateTurncoatsForAutoResolve( INT16 sSectorX, INT16 sSectorY )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT8 NumEnemiesInFiveSectors( INT16 sMapX, INT16 sMapY )
|
UINT16 NumEnemiesInFiveSectors( INT16 sMapX, INT16 sMapY )
|
||||||
{
|
{
|
||||||
UINT8 ubNumAdmins, ubNumTroops, ubNumElites, ubNumRobots, ubNumTanks, ubNumJeeps;
|
UINT16 ubNumAdmins, ubNumTroops, ubNumElites, ubNumRobots, ubNumTanks, ubNumJeeps;
|
||||||
|
|
||||||
GetNumberOfEnemiesInFiveSectors( sMapX, sMapY, &ubNumAdmins, &ubNumTroops, &ubNumElites, &ubNumRobots, &ubNumTanks, &ubNumJeeps );
|
GetNumberOfEnemiesInFiveSectors( sMapX, sMapY, &ubNumAdmins, &ubNumTroops, &ubNumElites, &ubNumRobots, &ubNumTanks, &ubNumJeeps );
|
||||||
|
|
||||||
|
|||||||
@@ -2,16 +2,16 @@
|
|||||||
#define __REINFORCEMENT_H__
|
#define __REINFORCEMENT_H__
|
||||||
|
|
||||||
//For Autoresolve (mostly)
|
//For Autoresolve (mostly)
|
||||||
void GetNumberOfEnemiesInFiveSectors( INT16 sSectorX, INT16 sSectorY, UINT8 *pubNumAdmins, UINT8 *pubNumTroops, UINT8 *pubNumElites, UINT8 *pubNumRobots, UINT8 *pubNumTanks, UINT8 *pubNumJeeps );
|
void GetNumberOfEnemiesInFiveSectors( INT16 sSectorX, INT16 sSectorY, UINT16 *pubNumAdmins, UINT16 *pubNumTroops, UINT16 *pubNumElites, UINT16 *pubNumRobots, UINT16 *pubNumTanks, UINT16 *pubNumJeeps );
|
||||||
void ActivateTurncoatsForAutoResolve( INT16 sSectorX, INT16 sSectorY );
|
void ActivateTurncoatsForAutoResolve( INT16 sSectorX, INT16 sSectorY );
|
||||||
BOOLEAN IsGroupInARightSectorToReinforce( GROUP *pGroup, INT16 sSectorX, INT16 sSectorY );
|
BOOLEAN IsGroupInARightSectorToReinforce( GROUP *pGroup, INT16 sSectorX, INT16 sSectorY );
|
||||||
UINT8 GetAdjacentSectors( UINT8 pSectors[4], INT16 sSectorX, INT16 sSectorY );
|
UINT8 GetAdjacentSectors( UINT8 pSectors[4], INT16 sSectorX, INT16 sSectorY );
|
||||||
UINT16 CountAllMilitiaInFiveSectors(INT16 sMapX, INT16 sMapY);
|
UINT16 CountAllMilitiaInFiveSectors(INT16 sMapX, INT16 sMapY);
|
||||||
UINT8 NumEnemiesInFiveSectors( INT16 sMapX, INT16 sMapY );
|
UINT16 NumEnemiesInFiveSectors( INT16 sMapX, INT16 sMapY );
|
||||||
|
|
||||||
//For Tactical
|
//For Tactical
|
||||||
UINT8 DoReinforcementAsPendingNonPlayer( INT16 sMapX, INT16 sMapY, UINT8 usTeam );
|
UINT8 DoReinforcementAsPendingNonPlayer( INT16 sMapX, INT16 sMapY, UINT8 usTeam );
|
||||||
void AddPossiblePendingMilitiaToBattle();
|
void AddPossiblePendingMilitiaToBattle();
|
||||||
GROUP* GetNonPlayerGroupInSectorForReinforcement( INT16 sMapX, INT16 sMapY, UINT8 usTeam );
|
GROUP* GetNonPlayerGroupInSectorForReinforcement( INT16 sMapX, INT16 sMapY, UINT8 usTeam );
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+39
-17
@@ -190,7 +190,7 @@ void ProcessTacticalSchedule( UINT8 ubScheduleID )
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Validate the existance of the soldier.
|
//Validate the existance of the soldier.
|
||||||
pSoldier = MercPtrs[ pSchedule->ubSoldierID ];
|
pSoldier = pSchedule->ubSoldierID;
|
||||||
if ( pSoldier->stats.bLife < OKLIFE )
|
if ( pSoldier->stats.bLife < OKLIFE )
|
||||||
{
|
{
|
||||||
// dead or dying!
|
// dead or dying!
|
||||||
@@ -331,7 +331,7 @@ void PrepareSchedulesForEditorEntry()
|
|||||||
prev->next = curr->next;
|
prev->next = curr->next;
|
||||||
else
|
else
|
||||||
gpScheduleList = gpScheduleList->next;
|
gpScheduleList = gpScheduleList->next;
|
||||||
MercPtrs[ curr->ubSoldierID ]->ubScheduleID = 0;
|
curr->ubSoldierID->ubScheduleID = 0;
|
||||||
temp = curr;
|
temp = curr;
|
||||||
curr = curr->next;
|
curr = curr->next;
|
||||||
MemFree( temp );
|
MemFree( temp );
|
||||||
@@ -483,7 +483,23 @@ SCHEDULENODE& SCHEDULENODE::operator=(const _OLD_SCHEDULENODE& src)
|
|||||||
TranslateArrayFields(usData2, src.usData2, OLD_MAX_SCHEDULE_ACTIONS, INT16_INT32);
|
TranslateArrayFields(usData2, src.usData2, OLD_MAX_SCHEDULE_ACTIONS, INT16_INT32);
|
||||||
TranslateArrayFields(ubAction, src.ubAction, OLD_MAX_SCHEDULE_ACTIONS, UINT8_UINT8);
|
TranslateArrayFields(ubAction, src.ubAction, OLD_MAX_SCHEDULE_ACTIONS, UINT8_UINT8);
|
||||||
ubScheduleID = src.ubScheduleID;
|
ubScheduleID = src.ubScheduleID;
|
||||||
ubSoldierID = src.ubSoldierID;
|
ubSoldierID = static_cast<UINT16>( src.ubSoldierID );
|
||||||
|
usFlags = src.usFlags;
|
||||||
|
}
|
||||||
|
return(*this);
|
||||||
|
}
|
||||||
|
|
||||||
|
SCHEDULENODE& SCHEDULENODE::operator=(const _OLD_SCHEDULENODE_PRE_ITS& src)
|
||||||
|
{
|
||||||
|
if ((void*)this != (void*)&src)
|
||||||
|
{
|
||||||
|
next = NULL;
|
||||||
|
TranslateArrayFields(usTime, src.usTime, OLD_MAX_SCHEDULE_ACTIONS, UINT16_UINT16);
|
||||||
|
TranslateArrayFields(usData1, src.usData1, OLD_MAX_SCHEDULE_ACTIONS, UINT32_UINT32);
|
||||||
|
TranslateArrayFields(usData2, src.usData2, OLD_MAX_SCHEDULE_ACTIONS, UINT32_UINT32);
|
||||||
|
TranslateArrayFields(ubAction, src.ubAction, OLD_MAX_SCHEDULE_ACTIONS, UINT8_UINT8);
|
||||||
|
ubScheduleID = src.ubScheduleID;
|
||||||
|
ubSoldierID = static_cast<UINT16>(src.ubSoldierID);
|
||||||
usFlags = src.usFlags;
|
usFlags = src.usFlags;
|
||||||
}
|
}
|
||||||
return(*this);
|
return(*this);
|
||||||
@@ -491,12 +507,18 @@ SCHEDULENODE& SCHEDULENODE::operator=(const _OLD_SCHEDULENODE& src)
|
|||||||
|
|
||||||
BOOLEAN SCHEDULENODE::Load(INT8** hBuffer, FLOAT dMajorMapVersion)
|
BOOLEAN SCHEDULENODE::Load(INT8** hBuffer, FLOAT dMajorMapVersion)
|
||||||
{
|
{
|
||||||
if(dMajorMapVersion < 7.0)
|
if (dMajorMapVersion < 7.0)
|
||||||
{
|
{
|
||||||
_OLD_SCHEDULENODE OldScheduleNode;
|
_OLD_SCHEDULENODE OldScheduleNode;
|
||||||
LOADDATA(&OldScheduleNode, *hBuffer, sizeof(_OLD_SCHEDULENODE));
|
LOADDATA(&OldScheduleNode, *hBuffer, sizeof(_OLD_SCHEDULENODE));
|
||||||
*this = OldScheduleNode;
|
*this = OldScheduleNode;
|
||||||
}
|
}
|
||||||
|
else if (dMajorMapVersion < 8.0)
|
||||||
|
{
|
||||||
|
_OLD_SCHEDULENODE_PRE_ITS OldScheduleNode;
|
||||||
|
LOADDATA(&OldScheduleNode, *hBuffer, sizeof(_OLD_SCHEDULENODE_PRE_ITS));
|
||||||
|
*this = OldScheduleNode;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
LOADDATA(this, *hBuffer, sizeof(SCHEDULENODE));
|
LOADDATA(this, *hBuffer, sizeof(SCHEDULENODE));
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
@@ -653,11 +675,11 @@ BOOLEAN SortSchedule( SCHEDULENODE *pSchedule )
|
|||||||
|
|
||||||
BOOLEAN BumpAnyExistingMerc( INT32 sGridNo )
|
BOOLEAN BumpAnyExistingMerc( INT32 sGridNo )
|
||||||
{
|
{
|
||||||
UINT8 ubID;
|
SoldierID ubID;
|
||||||
SOLDIERTYPE * pSoldier; // NB this is the person already in the location,
|
SOLDIERTYPE *pSoldier; // NB this is the person already in the location,
|
||||||
INT32 sNewGridNo;
|
INT32 sNewGridNo;
|
||||||
UINT8 ubDir;
|
UINT8 ubDir;
|
||||||
INT16 sCellX, sCellY;
|
INT16 sCellX, sCellY;
|
||||||
|
|
||||||
// this is for autoprocessing schedules...
|
// this is for autoprocessing schedules...
|
||||||
// there could be someone in the destination location, in which case
|
// there could be someone in the destination location, in which case
|
||||||
@@ -675,7 +697,7 @@ BOOLEAN BumpAnyExistingMerc( INT32 sGridNo )
|
|||||||
return( TRUE );
|
return( TRUE );
|
||||||
}
|
}
|
||||||
|
|
||||||
pSoldier = MercPtrs[ ubID ];
|
pSoldier = ubID;
|
||||||
|
|
||||||
// what if the existing merc is prone?
|
// what if the existing merc is prone?
|
||||||
sNewGridNo = FindGridNoFromSweetSpotWithStructDataFromSoldier( pSoldier, STANDING, 5, &ubDir, 1, pSoldier );
|
sNewGridNo = FindGridNoFromSweetSpotWithStructDataFromSoldier( pSoldier, STANDING, 5, &ubDir, 1, pSoldier );
|
||||||
@@ -707,7 +729,7 @@ void AutoProcessSchedule( SCHEDULENODE *pSchedule, INT32 index )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
pSoldier = MercPtrs[ pSchedule->ubSoldierID ];
|
pSoldier = pSchedule->ubSoldierID;
|
||||||
|
|
||||||
if (pSoldier->ubID == 0)
|
if (pSoldier->ubID == 0)
|
||||||
{
|
{
|
||||||
@@ -1381,16 +1403,16 @@ void ReplaceSleepSpot( SCHEDULENODE * pSchedule, UINT16 usNewSpot )
|
|||||||
|
|
||||||
void SecureSleepSpot( SOLDIERTYPE * pSoldier, UINT32 usSleepSpot )
|
void SecureSleepSpot( SOLDIERTYPE * pSoldier, UINT32 usSleepSpot )
|
||||||
{
|
{
|
||||||
SOLDIERTYPE * pSoldier2;
|
SOLDIERTYPE *pSoldier2;
|
||||||
UINT32 usSleepSpot2;
|
UINT32 usSleepSpot2;
|
||||||
UINT32 uiLoop;
|
UINT16 uiLoop;
|
||||||
SCHEDULENODE * pSchedule;
|
SCHEDULENODE *pSchedule;
|
||||||
UINT8 ubDirection;
|
UINT8 ubDirection;
|
||||||
|
|
||||||
// start after this soldier's ID so we don't duplicate work done in previous passes
|
// start after this soldier's ID so we don't duplicate work done in previous passes
|
||||||
for ( uiLoop = pSoldier->ubID + 1; uiLoop <= gTacticalStatus.Team[ CIV_TEAM ].bLastID; uiLoop++ )
|
for ( uiLoop = pSoldier->ubID + 1; uiLoop <= gTacticalStatus.Team[ CIV_TEAM ].bLastID; uiLoop++ )
|
||||||
{
|
{
|
||||||
pSoldier2 = MercPtrs[ uiLoop ];
|
pSoldier2 = MercPtrs[uiLoop];
|
||||||
if ( pSoldier2->bActive && pSoldier2->bInSector && pSoldier2->ubScheduleID != 0 )
|
if ( pSoldier2->bActive && pSoldier2->bInSector && pSoldier2->ubScheduleID != 0 )
|
||||||
{
|
{
|
||||||
pSchedule = GetSchedule( pSoldier2->ubScheduleID );
|
pSchedule = GetSchedule( pSoldier2->ubScheduleID );
|
||||||
|
|||||||
+14
-1
@@ -54,6 +54,18 @@ typedef struct _OLD_SCHEDULENODE
|
|||||||
UINT16 usFlags;
|
UINT16 usFlags;
|
||||||
}_OLD_SCHEDULENODE;
|
}_OLD_SCHEDULENODE;
|
||||||
|
|
||||||
|
typedef struct _OLD_SCHEDULENODE_PRE_ITS
|
||||||
|
{
|
||||||
|
struct _OLD_SCHEDULENODE_PRE_ITS* next;
|
||||||
|
UINT16 usTime[MAX_SCHEDULE_ACTIONS]; // Converted to minutes 12:30PM would be 12*60 + 30 = 750
|
||||||
|
UINT32 usData1[MAX_SCHEDULE_ACTIONS]; // Typically the gridno, but depends on the action
|
||||||
|
UINT32 usData2[MAX_SCHEDULE_ACTIONS]; // Secondary information, not used by most actions
|
||||||
|
UINT8 ubAction[MAX_SCHEDULE_ACTIONS];
|
||||||
|
UINT8 ubScheduleID;
|
||||||
|
UINT8 ubSoldierID;
|
||||||
|
UINT16 usFlags;
|
||||||
|
}_OLD_SCHEDULENODE_PRE_ITS;
|
||||||
|
|
||||||
class SCHEDULENODE
|
class SCHEDULENODE
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -63,10 +75,11 @@ public:
|
|||||||
UINT32 usData2[MAX_SCHEDULE_ACTIONS]; // Secondary information, not used by most actions
|
UINT32 usData2[MAX_SCHEDULE_ACTIONS]; // Secondary information, not used by most actions
|
||||||
UINT8 ubAction[MAX_SCHEDULE_ACTIONS];
|
UINT8 ubAction[MAX_SCHEDULE_ACTIONS];
|
||||||
UINT8 ubScheduleID;
|
UINT8 ubScheduleID;
|
||||||
UINT8 ubSoldierID;
|
SoldierID ubSoldierID;
|
||||||
UINT16 usFlags;
|
UINT16 usFlags;
|
||||||
public:
|
public:
|
||||||
SCHEDULENODE& operator=(const _OLD_SCHEDULENODE& src);
|
SCHEDULENODE& operator=(const _OLD_SCHEDULENODE& src);
|
||||||
|
SCHEDULENODE& operator=(const _OLD_SCHEDULENODE_PRE_ITS& src);
|
||||||
BOOLEAN Load(INT8** hBuffer, FLOAT dMajorMapVersion);
|
BOOLEAN Load(INT8** hBuffer, FLOAT dMajorMapVersion);
|
||||||
BOOLEAN Save(HWFILE hFile, FLOAT dMajorMapVersion, UINT8 ubMinorMapVersion);
|
BOOLEAN Save(HWFILE hFile, FLOAT dMajorMapVersion, UINT8 ubMinorMapVersion);
|
||||||
};
|
};
|
||||||
|
|||||||
+50
-52
@@ -470,9 +470,9 @@ BOOLEAN SendReinforcementsForPatrol( INT32 iPatrolID, GROUP **pOptionalGroup );
|
|||||||
|
|
||||||
void ClearPreviousAIGroupAssignment( GROUP *pGroup );
|
void ClearPreviousAIGroupAssignment( GROUP *pGroup );
|
||||||
|
|
||||||
void CalcNumTroopsBasedOnComposition( UINT8 *pubNumTroops, UINT8 *pubNumElites, UINT8 ubTotal, INT32 iCompositionID );
|
void CalcNumTroopsBasedOnComposition( UINT16 *pubNumTroops, UINT16 *pubNumElites, UINT16 ubTotal, INT32 iCompositionID );
|
||||||
void ConvertGroupTroopsToComposition( GROUP *pGroup, INT32 iCompositionID );
|
void ConvertGroupTroopsToComposition( GROUP *pGroup, INT32 iCompositionID );
|
||||||
void RemoveSoldiersFromGarrisonBasedOnComposition( INT32 iGarrisonID, UINT8 ubSize );
|
void RemoveSoldiersFromGarrisonBasedOnComposition( INT32 iGarrisonID, UINT16 ubSize );
|
||||||
|
|
||||||
//If there are any enemy groups that will be moving through this sector due, they will have to repath which
|
//If there are any enemy groups that will be moving through this sector due, they will have to repath which
|
||||||
//will cause them to avoid the sector. Returns the number of redirected groups.
|
//will cause them to avoid the sector. Returns the number of redirected groups.
|
||||||
@@ -912,7 +912,6 @@ void RemovePlayersFromAllMismatchGroups( SOLDIERTYPE *pSoldier )
|
|||||||
#ifdef JA2BETAVERSION
|
#ifdef JA2BETAVERSION
|
||||||
void ValidatePlayersAreInOneGroupOnly()
|
void ValidatePlayersAreInOneGroupOnly()
|
||||||
{
|
{
|
||||||
INT32 i;
|
|
||||||
INT32 iGroups;
|
INT32 iGroups;
|
||||||
INT32 iMismatches;
|
INT32 iMismatches;
|
||||||
INT32 iNumErrors;
|
INT32 iNumErrors;
|
||||||
@@ -923,10 +922,10 @@ void ValidatePlayersAreInOneGroupOnly()
|
|||||||
UINT8 ubGroupID;
|
UINT8 ubGroupID;
|
||||||
//Go through each merc slot in the player team
|
//Go through each merc slot in the player team
|
||||||
iNumErrors = 0;
|
iNumErrors = 0;
|
||||||
for( i = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; i <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; i++ )
|
for( SoldierID i = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; i <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; ++i )
|
||||||
{ //check to see if the merc has a group ID
|
{ //check to see if the merc has a group ID
|
||||||
|
|
||||||
pSoldier = MercPtrs[ i ];
|
pSoldier = i;
|
||||||
|
|
||||||
if( !pSoldier || !pSoldier->bActive || !pSoldier->stats.bLife || !pSoldier->ubGroupID )
|
if( !pSoldier || !pSoldier->bActive || !pSoldier->stats.bLife || !pSoldier->ubGroupID )
|
||||||
{ //non-existant, dead, or in no group (don't care, skip to next merc)
|
{ //non-existant, dead, or in no group (don't care, skip to next merc)
|
||||||
@@ -1151,8 +1150,8 @@ void InitStrategicAI()
|
|||||||
INT32 iStartPop, iDesiredPop, iPriority;
|
INT32 iStartPop, iDesiredPop, iPriority;
|
||||||
SECTORINFO *pSector = NULL;
|
SECTORINFO *pSector = NULL;
|
||||||
GROUP *pGroup;
|
GROUP *pGroup;
|
||||||
UINT8 ubNumTroops;
|
UINT16 ubNumTroops;
|
||||||
UINT8 ubNumRobots, ubNumTanks, ubNumJeeps;
|
UINT16 ubNumRobots, ubNumTanks, ubNumJeeps;
|
||||||
INT32 iPercentElitesBonus;
|
INT32 iPercentElitesBonus;
|
||||||
INT32 iMaxEnemyGroupSize = gGameExternalOptions.iMaxEnemyGroupSize;
|
INT32 iMaxEnemyGroupSize = gGameExternalOptions.iMaxEnemyGroupSize;
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Strategic3");
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Strategic3");
|
||||||
@@ -1538,9 +1537,9 @@ void InitStrategicAI()
|
|||||||
//based on the difficulty settings in the above patrol table.
|
//based on the difficulty settings in the above patrol table.
|
||||||
//if( gPatrolGroup[ i ].ubUNUSEDStartIfDifficulty <= gGameOptions.ubDifficultyLevel )
|
//if( gPatrolGroup[ i ].ubUNUSEDStartIfDifficulty <= gGameOptions.ubDifficultyLevel )
|
||||||
{
|
{
|
||||||
UINT8 troopCount = (UINT8)(gPatrolGroup[ i ].bSize + Random( 3 ) - 1);
|
UINT16 troopCount = (UINT16)(gPatrolGroup[ i ].bSize + Random( 3 ) - 1);
|
||||||
troopCount = (UINT8)max( gubMinEnemyGroupSize, min( iMaxEnemyGroupSize, troopCount) );
|
troopCount = (UINT16)max( gubMinEnemyGroupSize, min( iMaxEnemyGroupSize, troopCount) );
|
||||||
UINT8 ubNumElites;
|
UINT16 ubNumElites;
|
||||||
InitializeGroup(GROUP_TYPE_PATROL, troopCount, ubNumTroops, ubNumElites, ubNumRobots, ubNumJeeps, ubNumTanks, Random(10) < gGameOptions.ubDifficultyLevel && i != 3 && i != 4);
|
InitializeGroup(GROUP_TYPE_PATROL, troopCount, ubNumTroops, ubNumElites, ubNumRobots, ubNumJeeps, ubNumTanks, Random(10) < gGameOptions.ubDifficultyLevel && i != 3 && i != 4);
|
||||||
|
|
||||||
//Note on adding patrol groups...
|
//Note on adding patrol groups...
|
||||||
@@ -2273,12 +2272,12 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Strategic5");
|
|||||||
if( gGarrisonGroup[ i ].ubSectorID != SECTOR( gModSettings.ubSAISpawnSectorX, gModSettings.ubSAISpawnSectorY ) )
|
if( gGarrisonGroup[ i ].ubSectorID != SECTOR( gModSettings.ubSAISpawnSectorX, gModSettings.ubSAISpawnSectorY ) )
|
||||||
{
|
{
|
||||||
EliminateSurplusTroopsForGarrison( pGroup, pSector );
|
EliminateSurplusTroopsForGarrison( pGroup, pSector );
|
||||||
pSector->ubNumAdmins = (UINT8)(pSector->ubNumAdmins + pGroup->pEnemyGroup->ubNumAdmins);
|
pSector->ubNumAdmins = (pSector->ubNumAdmins + pGroup->pEnemyGroup->ubNumAdmins);
|
||||||
pSector->ubNumTroops = (UINT8)(pSector->ubNumTroops + pGroup->pEnemyGroup->ubNumTroops);
|
pSector->ubNumTroops = (pSector->ubNumTroops + pGroup->pEnemyGroup->ubNumTroops);
|
||||||
pSector->ubNumElites = (UINT8)(pSector->ubNumElites + pGroup->pEnemyGroup->ubNumElites);
|
pSector->ubNumElites = (pSector->ubNumElites + pGroup->pEnemyGroup->ubNumElites);
|
||||||
pSector->ubNumRobots = (UINT8)(pSector->ubNumRobots + pGroup->pEnemyGroup->ubNumRobots);
|
pSector->ubNumRobots = (pSector->ubNumRobots + pGroup->pEnemyGroup->ubNumRobots);
|
||||||
pSector->ubNumTanks = (UINT8)(pSector->ubNumTanks + pGroup->pEnemyGroup->ubNumTanks);
|
pSector->ubNumTanks = (pSector->ubNumTanks + pGroup->pEnemyGroup->ubNumTanks);
|
||||||
pSector->ubNumJeeps = (UINT8)(pSector->ubNumJeeps + pGroup->pEnemyGroup->ubNumJeeps);
|
pSector->ubNumJeeps = (pSector->ubNumJeeps + pGroup->pEnemyGroup->ubNumJeeps);
|
||||||
|
|
||||||
#ifdef JA2BETAVERSION
|
#ifdef JA2BETAVERSION
|
||||||
LogStrategicEvent( "%d reinforcements have arrived to garrison sector %c%d",
|
LogStrategicEvent( "%d reinforcements have arrived to garrison sector %c%d",
|
||||||
@@ -2361,7 +2360,7 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Strategic5");
|
|||||||
pPatrolGroup->pEnemyGroup->ubNumRobots += pGroup->pEnemyGroup->ubNumRobots;
|
pPatrolGroup->pEnemyGroup->ubNumRobots += pGroup->pEnemyGroup->ubNumRobots;
|
||||||
pPatrolGroup->pEnemyGroup->ubNumTanks += pGroup->pEnemyGroup->ubNumTanks;
|
pPatrolGroup->pEnemyGroup->ubNumTanks += pGroup->pEnemyGroup->ubNumTanks;
|
||||||
pPatrolGroup->pEnemyGroup->ubNumJeeps += pGroup->pEnemyGroup->ubNumJeeps;
|
pPatrolGroup->pEnemyGroup->ubNumJeeps += pGroup->pEnemyGroup->ubNumJeeps;
|
||||||
pPatrolGroup->ubGroupSize += (UINT8)(pGroup->pEnemyGroup->ubNumTroops + pGroup->pEnemyGroup->ubNumElites + pGroup->pEnemyGroup->ubNumAdmins
|
pPatrolGroup->ubGroupSize += (pGroup->pEnemyGroup->ubNumTroops + pGroup->pEnemyGroup->ubNumElites + pGroup->pEnemyGroup->ubNumAdmins
|
||||||
+ pGroup->pEnemyGroup->ubNumRobots + pGroup->pEnemyGroup->ubNumTanks + pGroup->pEnemyGroup->ubNumJeeps);
|
+ pGroup->pEnemyGroup->ubNumRobots + pGroup->pEnemyGroup->ubNumTanks + pGroup->pEnemyGroup->ubNumJeeps);
|
||||||
#ifdef JA2BETAVERSION
|
#ifdef JA2BETAVERSION
|
||||||
LogStrategicEvent( "%d reinforcements have joined patrol group at sector %c%d (new size: %d)",
|
LogStrategicEvent( "%d reinforcements have joined patrol group at sector %c%d (new size: %d)",
|
||||||
@@ -2714,7 +2713,7 @@ void CheckEnemyControlledSector( UINT8 ubSectorID )
|
|||||||
{
|
{
|
||||||
if( pGroup->pEnemyGroup->ubPendingReinforcements > 4 )
|
if( pGroup->pEnemyGroup->ubPendingReinforcements > 4 )
|
||||||
{
|
{
|
||||||
UINT8 ubNum = (UINT8)(3 + Random( 3 ));
|
UINT16 ubNum = (UINT16)(3 + Random( 3 ));
|
||||||
pGroup->pEnemyGroup->ubNumTroops += ubNum;
|
pGroup->pEnemyGroup->ubNumTroops += ubNum;
|
||||||
pGroup->ubGroupSize += ubNum;
|
pGroup->ubGroupSize += ubNum;
|
||||||
pGroup->pEnemyGroup->ubPendingReinforcements -= ubNum;
|
pGroup->pEnemyGroup->ubPendingReinforcements -= ubNum;
|
||||||
@@ -3080,7 +3079,7 @@ BOOLEAN SendReinforcementsForGarrison( INT32 iDstGarrisonID, UINT16 usDefencePoi
|
|||||||
GROUP *pGroup;
|
GROUP *pGroup;
|
||||||
UINT8 ubSrcSectorX, ubSrcSectorY, ubDstSectorX, ubDstSectorY;
|
UINT8 ubSrcSectorX, ubSrcSectorY, ubDstSectorX, ubDstSectorY;
|
||||||
UINT8 ubNumExtraReinforcements;
|
UINT8 ubNumExtraReinforcements;
|
||||||
UINT8 ubGroupSize;
|
UINT16 ubGroupSize;
|
||||||
BOOLEAN fLimitMaxTroopsAllowable = FALSE;
|
BOOLEAN fLimitMaxTroopsAllowable = FALSE;
|
||||||
|
|
||||||
Ensure_RepairedGarrisonGroup( &gGarrisonGroup, &giGarrisonArraySize ); /* added NULL fix, 2007-03-03, Sgt. Kolja */
|
Ensure_RepairedGarrisonGroup( &gGarrisonGroup, &giGarrisonArraySize ); /* added NULL fix, 2007-03-03, Sgt. Kolja */
|
||||||
@@ -3207,7 +3206,7 @@ BOOLEAN SendReinforcementsForGarrison( INT32 iDstGarrisonID, UINT16 usDefencePoi
|
|||||||
pGroup->ubMoveType = ONE_WAY;
|
pGroup->ubMoveType = ONE_WAY;
|
||||||
gGarrisonGroup[ iDstGarrisonID ].ubPendingGroupID = pGroup->ubGroupID;
|
gGarrisonGroup[ iDstGarrisonID ].ubPendingGroupID = pGroup->ubGroupID;
|
||||||
|
|
||||||
ubGroupSize = (UINT8)(pGroup->pEnemyGroup->ubNumTroops + pGroup->pEnemyGroup->ubNumElites + pGroup->pEnemyGroup->ubNumAdmins + pGroup->pEnemyGroup->ubNumRobots + pGroup->pEnemyGroup->ubNumTanks + pGroup->pEnemyGroup->ubNumJeeps);
|
ubGroupSize = (UINT16)(pGroup->pEnemyGroup->ubNumTroops + pGroup->pEnemyGroup->ubNumElites + pGroup->pEnemyGroup->ubNumAdmins + pGroup->pEnemyGroup->ubNumRobots + pGroup->pEnemyGroup->ubNumTanks + pGroup->pEnemyGroup->ubNumJeeps);
|
||||||
|
|
||||||
if( ubNumExtraReinforcements )
|
if( ubNumExtraReinforcements )
|
||||||
{
|
{
|
||||||
@@ -3297,7 +3296,7 @@ BOOLEAN SendReinforcementsForGarrison( INT32 iDstGarrisonID, UINT16 usDefencePoi
|
|||||||
pGroup->ubOriginalSector = (UINT8)SECTOR( ubDstSectorX, ubDstSectorY );
|
pGroup->ubOriginalSector = (UINT8)SECTOR( ubDstSectorX, ubDstSectorY );
|
||||||
pGroup->ubMoveType = ONE_WAY;
|
pGroup->ubMoveType = ONE_WAY;
|
||||||
gGarrisonGroup[ iDstGarrisonID ].ubPendingGroupID = pGroup->ubGroupID;
|
gGarrisonGroup[ iDstGarrisonID ].ubPendingGroupID = pGroup->ubGroupID;
|
||||||
ubGroupSize = (UINT8)(pGroup->pEnemyGroup->ubNumTroops + pGroup->pEnemyGroup->ubNumElites + pGroup->pEnemyGroup->ubNumAdmins + pGroup->pEnemyGroup->ubNumRobots + pGroup->pEnemyGroup->ubNumTanks + pGroup->pEnemyGroup->ubNumJeeps);
|
ubGroupSize = (UINT16)(pGroup->pEnemyGroup->ubNumTroops + pGroup->pEnemyGroup->ubNumElites + pGroup->pEnemyGroup->ubNumAdmins + pGroup->pEnemyGroup->ubNumRobots + pGroup->pEnemyGroup->ubNumTanks + pGroup->pEnemyGroup->ubNumJeeps);
|
||||||
|
|
||||||
if( ubNumExtraReinforcements )
|
if( ubNumExtraReinforcements )
|
||||||
{
|
{
|
||||||
@@ -4143,13 +4142,12 @@ BOOLEAN LoadStrategicAI( HWFILE hFile )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ //We are in the basement sector, relocate queen to proper position.
|
{ //We are in the basement sector, relocate queen to proper position.
|
||||||
INT32 i;
|
for( SoldierID i = gTacticalStatus.Team[ CIV_TEAM ].bFirstID; i <= gTacticalStatus.Team[ CIV_TEAM ].bLastID; ++i )
|
||||||
for( i = gTacticalStatus.Team[ CIV_TEAM ].bFirstID; i <= gTacticalStatus.Team[ CIV_TEAM ].bLastID; i++ )
|
|
||||||
{
|
{
|
||||||
if( MercPtrs[ i ]->ubProfile == QUEEN )
|
if( i->ubProfile == QUEEN )
|
||||||
{ //Found queen, relocate her to 16866
|
{ //Found queen, relocate her to 16866
|
||||||
BumpAnyExistingMerc( 16866 );
|
BumpAnyExistingMerc( 16866 );
|
||||||
TeleportSoldier( MercPtrs[ i ], 16866, TRUE );
|
TeleportSoldier( i, 16866, TRUE );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4546,15 +4544,15 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
|
|||||||
UINT8 stagesector0, stagesector1, stagesector2, stagesector3;
|
UINT8 stagesector0, stagesector1, stagesector2, stagesector3;
|
||||||
UINT8 assaultsector0, assaultsector1, assaultsector2, assaultsector3;
|
UINT8 assaultsector0, assaultsector1, assaultsector2, assaultsector3;
|
||||||
unsigned ubNumSoldiers;
|
unsigned ubNumSoldiers;
|
||||||
UINT8 ubNumRobots = 0;
|
UINT16 ubNumRobots = 0;
|
||||||
UINT8 ubNumTanks = 0;
|
UINT16 ubNumTanks = 0;
|
||||||
UINT8 ubNumJeeps = 0;
|
UINT16 ubNumJeeps = 0;
|
||||||
UINT32 totalusedsoldiers = 0;
|
UINT32 totalusedsoldiers = 0;
|
||||||
UINT8 grouptroops[4] = {0,0,0,0};
|
UINT16 grouptroops[4] = {0,0,0,0};
|
||||||
UINT8 groupelites[4] = {0,0,0,0};
|
UINT16 groupelites[4] = {0,0,0,0};
|
||||||
UINT8 grouprobots[4] = {0,0,0,0};
|
UINT16 grouprobots[4] = {0,0,0,0};
|
||||||
UINT8 grouptanks[4] = {0,0,0,0};
|
UINT16 grouptanks[4] = {0,0,0,0};
|
||||||
UINT8 groupjeeps[4] = {0, 0, 0, 0};
|
UINT16 groupjeeps[4] = {0, 0, 0, 0};
|
||||||
|
|
||||||
UINT32 difficultyMod;
|
UINT32 difficultyMod;
|
||||||
switch (gGameOptions.ubDifficultyLevel)
|
switch (gGameOptions.ubDifficultyLevel)
|
||||||
@@ -5247,12 +5245,12 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
|
|||||||
soldiersThisSquad = (unsigned)gGameExternalOptions.iMaxEnemyGroupSize;
|
soldiersThisSquad = (unsigned)gGameExternalOptions.iMaxEnemyGroupSize;
|
||||||
}
|
}
|
||||||
ubNumSoldiers -= soldiersThisSquad;
|
ubNumSoldiers -= soldiersThisSquad;
|
||||||
UINT8 adminsThisSquad = 0;
|
UINT16 adminsThisSquad = 0;
|
||||||
UINT8 troopsThisSquad = 0;
|
UINT16 troopsThisSquad = 0;
|
||||||
UINT8 elitesThisSquad = 0;
|
UINT16 elitesThisSquad = 0;
|
||||||
UINT8 robotsThisSquad = 0;
|
UINT16 robotsThisSquad = 0;
|
||||||
UINT8 tanksThisSquad = 0;
|
UINT16 tanksThisSquad = 0;
|
||||||
UINT8 jeepsThisSquad = 0;
|
UINT16 jeepsThisSquad = 0;
|
||||||
// this is an attack group, but set it to patrol since we'll set the admin/regular/elite composition by hand here
|
// this is an attack group, but set it to patrol since we'll set the admin/regular/elite composition by hand here
|
||||||
InitializeGroup(GROUP_TYPE_PATROL, soldiersThisSquad, troopsThisSquad, elitesThisSquad, robotsThisSquad, jeepsThisSquad, tanksThisSquad, Random(10 * 100) < difficultyMod * direness);
|
InitializeGroup(GROUP_TYPE_PATROL, soldiersThisSquad, troopsThisSquad, elitesThisSquad, robotsThisSquad, jeepsThisSquad, tanksThisSquad, Random(10 * 100) < difficultyMod * direness);
|
||||||
if (direness < 25) {
|
if (direness < 25) {
|
||||||
@@ -5295,7 +5293,7 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
|
|||||||
// Note: 1st optional parm is a count of troops to send
|
// Note: 1st optional parm is a count of troops to send
|
||||||
// 2nd optional parm is the composition of troops
|
// 2nd optional parm is the composition of troops
|
||||||
if (option1 > 0 && option1 < 256) {
|
if (option1 > 0 && option1 < 256) {
|
||||||
ubNumSoldiers = (UINT8)(option1);
|
ubNumSoldiers = option1;
|
||||||
} else {
|
} else {
|
||||||
// Something is goofy, just send a default sized squad
|
// Something is goofy, just send a default sized squad
|
||||||
ubNumSoldiers = gubMinEnemyGroupSize;
|
ubNumSoldiers = gubMinEnemyGroupSize;
|
||||||
@@ -5387,7 +5385,7 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
|
|||||||
if ( !gfUnlimitedTroops )
|
if ( !gfUnlimitedTroops )
|
||||||
giReinforcementPool -= ubNumSoldiers;
|
giReinforcementPool -= ubNumSoldiers;
|
||||||
|
|
||||||
UINT8 ubNumTroops, ubNumElites;
|
UINT16 ubNumTroops, ubNumElites;
|
||||||
// set the type to patrol as we're manually tuning the group composition here (100% elites + ASD upgrades)
|
// set the type to patrol as we're manually tuning the group composition here (100% elites + ASD upgrades)
|
||||||
InitializeGroup(GROUP_TYPE_PATROL, ubNumSoldiers, ubNumTroops, ubNumElites, ubNumRobots, ubNumJeeps, ubNumTanks, Random(10*100) < difficultyMod * HighestPlayerProgressPercentage());
|
InitializeGroup(GROUP_TYPE_PATROL, ubNumSoldiers, ubNumTroops, ubNumElites, ubNumRobots, ubNumJeeps, ubNumTanks, Random(10*100) < difficultyMod * HighestPlayerProgressPercentage());
|
||||||
|
|
||||||
@@ -6774,7 +6772,7 @@ void ClearPreviousAIGroupAssignment( GROUP *pGroup )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CalcNumTroopsBasedOnComposition( UINT8 *pubNumTroops, UINT8 *pubNumElites, UINT8 ubTotal, INT32 iCompositionID )
|
void CalcNumTroopsBasedOnComposition( UINT16 *pubNumTroops, UINT16 *pubNumElites, UINT16 ubTotal, INT32 iCompositionID )
|
||||||
{
|
{
|
||||||
*pubNumTroops = gArmyComp[ iCompositionID ].bTroopPercentage * ubTotal / 100;
|
*pubNumTroops = gArmyComp[ iCompositionID ].bTroopPercentage * ubTotal / 100;
|
||||||
*pubNumElites = gArmyComp[ iCompositionID ].bElitePercentage * ubTotal / 100;
|
*pubNumElites = gArmyComp[ iCompositionID ].bElitePercentage * ubTotal / 100;
|
||||||
@@ -6818,19 +6816,19 @@ void ConvertGroupTroopsToComposition( GROUP *pGroup, INT32 iCompositionID )
|
|||||||
ValidateLargeGroup( pGroup );
|
ValidateLargeGroup( pGroup );
|
||||||
}
|
}
|
||||||
|
|
||||||
void RemoveSoldiersFromGarrisonBasedOnComposition( INT32 iGarrisonID, UINT8 ubSize )
|
void RemoveSoldiersFromGarrisonBasedOnComposition( INT32 iGarrisonID, UINT16 ubSize )
|
||||||
{
|
{
|
||||||
SECTORINFO *pSector;
|
SECTORINFO *pSector;
|
||||||
INT32 iCompositionID;
|
INT32 iCompositionID;
|
||||||
UINT8 ubNumTroops, ubNumElites;
|
UINT16 ubNumTroops, ubNumElites;
|
||||||
|
|
||||||
//debug stuff
|
//debug stuff
|
||||||
UINT8 ubOrigSectorAdmins;
|
UINT16 ubOrigSectorAdmins;
|
||||||
UINT8 ubOrigSectorTroops;
|
UINT16 ubOrigSectorTroops;
|
||||||
UINT8 ubOrigSectorElites;
|
UINT16 ubOrigSectorElites;
|
||||||
UINT8 ubOrigNumElites;
|
UINT16 ubOrigNumElites;
|
||||||
UINT8 ubOrigNumTroops;
|
UINT16 ubOrigNumTroops;
|
||||||
UINT8 ubOrigSize;
|
UINT16 ubOrigSize;
|
||||||
|
|
||||||
Ensure_RepairedGarrisonGroup( &gGarrisonGroup, &giGarrisonArraySize ); /* added NULL fix, 2007-03-03, Sgt. Kolja */
|
Ensure_RepairedGarrisonGroup( &gGarrisonGroup, &giGarrisonArraySize ); /* added NULL fix, 2007-03-03, Sgt. Kolja */
|
||||||
iCompositionID = gGarrisonGroup[ iGarrisonID ].ubComposition;
|
iCompositionID = gGarrisonGroup[ iGarrisonID ].ubComposition;
|
||||||
@@ -7107,12 +7105,12 @@ void ASDInitializePatrolGroup(GROUP *pGroup)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void InitializeGroup( const GROUP_TYPE groupType, const UINT8 groupSize, ENEMYGROUP& enemyGroup, const BOOLEAN asdUpgrade )
|
void InitializeGroup( const GROUP_TYPE groupType, const UINT16 groupSize, ENEMYGROUP& enemyGroup, const BOOLEAN asdUpgrade )
|
||||||
{
|
{
|
||||||
InitializeGroup( groupType, groupSize, enemyGroup.ubNumTroops, enemyGroup.ubNumElites, enemyGroup.ubNumRobots, enemyGroup.ubNumJeeps, enemyGroup.ubNumTanks, asdUpgrade );
|
InitializeGroup( groupType, groupSize, enemyGroup.ubNumTroops, enemyGroup.ubNumElites, enemyGroup.ubNumRobots, enemyGroup.ubNumJeeps, enemyGroup.ubNumTanks, asdUpgrade );
|
||||||
}
|
}
|
||||||
|
|
||||||
void InitializeGroup( const GROUP_TYPE groupType, const UINT8 groupSize, UINT8 &troopCount, UINT8 &eliteCount, UINT8 &robotCount, UINT8 &jeepCount, UINT8 &tankCount, const BOOLEAN asdUpgrade )
|
void InitializeGroup( const GROUP_TYPE groupType, const UINT16 groupSize, UINT16 &troopCount, UINT16 &eliteCount, UINT16 &robotCount, UINT16 &jeepCount, UINT16 &tankCount, const BOOLEAN asdUpgrade )
|
||||||
{
|
{
|
||||||
troopCount = groupSize;
|
troopCount = groupSize;
|
||||||
eliteCount = 0;
|
eliteCount = 0;
|
||||||
|
|||||||
@@ -84,8 +84,8 @@ enum GROUP_TYPE
|
|||||||
};
|
};
|
||||||
|
|
||||||
void ASDInitializePatrolGroup(GROUP *pGroup);
|
void ASDInitializePatrolGroup(GROUP *pGroup);
|
||||||
void InitializeGroup(const GROUP_TYPE groupType, const UINT8 groupSize, ENEMYGROUP& enemyGroup, const BOOLEAN asdUpgrade);
|
void InitializeGroup(const GROUP_TYPE groupType, const UINT16 groupSize, ENEMYGROUP& enemyGroup, const BOOLEAN asdUpgrade);
|
||||||
void InitializeGroup(const GROUP_TYPE groupType, const UINT8 groupSize, UINT8 &troopCount, UINT8 &eliteCount, UINT8 &robotCount, UINT8 &jeepCount, UINT8 &tankCount, const BOOLEAN asdUpgrade);
|
void InitializeGroup(const GROUP_TYPE groupType, const UINT16 groupSize, UINT16 &troopCount, UINT16 &eliteCount, UINT16 &robotCount, UINT16 &jeepCount, UINT16 &tankCount, const BOOLEAN asdUpgrade);
|
||||||
|
|
||||||
extern BOOLEAN gfDisplayStrategicAILogs;
|
extern BOOLEAN gfDisplayStrategicAILogs;
|
||||||
extern BOOLEAN gfFirstBattleMeanwhileScenePending;
|
extern BOOLEAN gfFirstBattleMeanwhileScenePending;
|
||||||
@@ -181,4 +181,4 @@ typedef struct GARRISON_GROUP
|
|||||||
#define REGULAR_MILITIA_POINTS_MODIFIER 2
|
#define REGULAR_MILITIA_POINTS_MODIFIER 2
|
||||||
#define ELITE_MILITIA_POINTS_MODIFIER 3
|
#define ELITE_MILITIA_POINTS_MODIFIER 3
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ UINT32 guiPabloExtraDaysBribed = 0;
|
|||||||
|
|
||||||
UINT8 gubCambriaMedicalObjects;
|
UINT8 gubCambriaMedicalObjects;
|
||||||
|
|
||||||
extern INT8 NumMercsNear( UINT8 ubProfileID, UINT8 ubMaxDist );
|
extern UINT16 NumMercsNear( UINT8 ubProfileID, UINT8 ubMaxDist );
|
||||||
|
|
||||||
extern SECTOR_EXT_DATA SectorExternalData[256][4];
|
extern SECTOR_EXT_DATA SectorExternalData[256][4];
|
||||||
|
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ void StrategicHandlePlayerTeamMercDeath( SOLDIERTYPE *pSoldier )
|
|||||||
//add to the history log the fact that the merc died and the circumstances
|
//add to the history log the fact that the merc died and the circumstances
|
||||||
if( pSoldier->ubAttackerID != NOBODY )
|
if( pSoldier->ubAttackerID != NOBODY )
|
||||||
{
|
{
|
||||||
pKiller = MercPtrs[ pSoldier->ubAttackerID ];
|
pKiller = pSoldier->ubAttackerID;
|
||||||
}
|
}
|
||||||
|
|
||||||
// CJC Nov 11, 2002
|
// CJC Nov 11, 2002
|
||||||
@@ -141,7 +141,7 @@ void StrategicHandlePlayerTeamMercDeath( SOLDIERTYPE *pSoldier )
|
|||||||
gMercProfiles[ pSoldier->ubProfile ].ubSuspiciousDeath = VERY_SUSPICIOUS_DEATH;
|
gMercProfiles[ pSoldier->ubProfile ].ubSuspiciousDeath = VERY_SUSPICIOUS_DEATH;
|
||||||
}
|
}
|
||||||
// if killed by someone on our team, or while there weren't any opponents around
|
// if killed by someone on our team, or while there weren't any opponents around
|
||||||
else if (Menptr[ pSoldier->ubAttackerID ].bTeam == OUR_TEAM || !gTacticalStatus.fEnemyInSector )
|
else if (pSoldier->ubAttackerID->bTeam == OUR_TEAM || !gTacticalStatus.fEnemyInSector )
|
||||||
{
|
{
|
||||||
// cause insurance company to suspect fraud and investigate this claim
|
// cause insurance company to suspect fraud and investigate this claim
|
||||||
gMercProfiles[ pSoldier->ubProfile ].ubSuspiciousDeath = SUSPICIOUS_DEATH;
|
gMercProfiles[ pSoldier->ubProfile ].ubSuspiciousDeath = SUSPICIOUS_DEATH;
|
||||||
@@ -184,8 +184,8 @@ void StrategicHandlePlayerTeamMercDeath( SOLDIERTYPE *pSoldier )
|
|||||||
// MercDailyUpdate() gets called every day at midnight. If something is to happen to a merc that day, add an event for it.
|
// MercDailyUpdate() gets called every day at midnight. If something is to happen to a merc that day, add an event for it.
|
||||||
void MercDailyUpdate()
|
void MercDailyUpdate()
|
||||||
{
|
{
|
||||||
INT32 cnt;
|
SoldierID id;
|
||||||
INT8 bLastTeamID;
|
SoldierID lastid;
|
||||||
SOLDIERTYPE *pSoldier;
|
SOLDIERTYPE *pSoldier;
|
||||||
//SOLDIERTYPE *pQuitList[ 21 ];
|
//SOLDIERTYPE *pQuitList[ 21 ];
|
||||||
MERCPROFILESTRUCT *pProfile;
|
MERCPROFILESTRUCT *pProfile;
|
||||||
@@ -217,12 +217,13 @@ void MercDailyUpdate()
|
|||||||
AddSameDayStrategicEvent( EVENT_BEGIN_CONTRACT_RENEWAL_SEQUENCE, MERC_ARRIVE_TIME_SLOT_2, 0 );
|
AddSameDayStrategicEvent( EVENT_BEGIN_CONTRACT_RENEWAL_SEQUENCE, MERC_ARRIVE_TIME_SLOT_2, 0 );
|
||||||
AddSameDayStrategicEvent( EVENT_BEGIN_CONTRACT_RENEWAL_SEQUENCE, MERC_ARRIVE_TIME_SLOT_3, 0 );
|
AddSameDayStrategicEvent( EVENT_BEGIN_CONTRACT_RENEWAL_SEQUENCE, MERC_ARRIVE_TIME_SLOT_3, 0 );
|
||||||
|
|
||||||
cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
id = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||||
bLastTeamID = gTacticalStatus.Team[ gbPlayerNum ].bLastID;
|
lastid = gTacticalStatus.Team[ gbPlayerNum ].bLastID;
|
||||||
|
|
||||||
//loop though all the mercs
|
//loop though all the mercs
|
||||||
for ( pSoldier = MercPtrs[ cnt ]; cnt <= bLastTeamID; ++cnt,++pSoldier)
|
for ( ; id <= lastid; ++id)
|
||||||
{
|
{
|
||||||
|
pSoldier = id;
|
||||||
//if the merc is active
|
//if the merc is active
|
||||||
if ( ( pSoldier->bActive )&&( pSoldier->bAssignment != ASSIGNMENT_POW ) && ( pSoldier->bAssignment != IN_TRANSIT ) )
|
if ( ( pSoldier->bActive )&&( pSoldier->bAssignment != ASSIGNMENT_POW ) && ( pSoldier->bAssignment != IN_TRANSIT ) )
|
||||||
{
|
{
|
||||||
@@ -317,15 +318,8 @@ void MercDailyUpdate()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CHAR16 zMoney[128];
|
|
||||||
|
|
||||||
//create a string for the salary owed to the npc
|
|
||||||
swprintf( zMoney, L"%d", sSalary );
|
|
||||||
InsertCommasForDollarFigure( zMoney );
|
|
||||||
InsertDollarSignInToString( zMoney );
|
|
||||||
|
|
||||||
//Display a screen msg indicating that the npc was NOT paid
|
//Display a screen msg indicating that the npc was NOT paid
|
||||||
ScreenMsg( FONT_MCOLOR_WHITE, MSG_INTERFACE, pMessageStrings[ MSG_CANT_AFFORD_TO_PAY_NPC_DAILY_SALARY_MSG ], gMercProfiles[ pSoldier->ubProfile ].zNickname, zMoney );
|
ScreenMsg( FONT_MCOLOR_WHITE, MSG_INTERFACE, pMessageStrings[ MSG_CANT_AFFORD_TO_PAY_NPC_DAILY_SALARY_MSG ], gMercProfiles[ pSoldier->ubProfile ].zNickname, FormatMoney(sSalary).data() );
|
||||||
|
|
||||||
//if the merc hasnt been paid for NUM_DAYS_TILL_UNPAID_RPC_QUITS days, the merc will quit
|
//if the merc hasnt been paid for NUM_DAYS_TILL_UNPAID_RPC_QUITS days, the merc will quit
|
||||||
if( ( gMercProfiles[ pSoldier->ubProfile ].iBalance - sSalary ) <= -( sSalary * NUM_DAYS_TILL_UNPAID_RPC_QUITS ) )
|
if( ( gMercProfiles[ pSoldier->ubProfile ].iBalance - sSalary ) <= -( sSalary * NUM_DAYS_TILL_UNPAID_RPC_QUITS ) )
|
||||||
@@ -374,11 +368,10 @@ void MercDailyUpdate()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//r eset the counter
|
//reset the counter
|
||||||
cnt = 0;
|
for ( id = 0; id <= lastid; ++id )
|
||||||
|
|
||||||
for ( pSoldier = MercPtrs[ cnt ]; cnt <= bLastTeamID; cnt++,pSoldier++)
|
|
||||||
{
|
{
|
||||||
|
pSoldier = id;
|
||||||
//if the merc is active
|
//if the merc is active
|
||||||
if ( ( pSoldier->bActive )&&( pSoldier->bAssignment != ASSIGNMENT_POW ) && ( pSoldier->bAssignment != IN_TRANSIT ) )
|
if ( ( pSoldier->bActive )&&( pSoldier->bAssignment != ASSIGNMENT_POW ) && ( pSoldier->bAssignment != IN_TRANSIT ) )
|
||||||
{
|
{
|
||||||
@@ -402,7 +395,7 @@ void MercDailyUpdate()
|
|||||||
// WANNE: Only send mails from the original 1.13 merc, and not from the wildfire merc,
|
// WANNE: Only send mails from the original 1.13 merc, and not from the wildfire merc,
|
||||||
// otherwise we get wrong mails cause of hardcoded Email.edt structure!!!!!
|
// otherwise we get wrong mails cause of hardcoded Email.edt structure!!!!!
|
||||||
UINT16 numOriginalProfiles = 255;
|
UINT16 numOriginalProfiles = 255;
|
||||||
for( cnt = 0; cnt < numOriginalProfiles; ++cnt)
|
for( UINT16 cnt = 0; cnt < numOriginalProfiles; ++cnt)
|
||||||
{
|
{
|
||||||
pProfile = &(gMercProfiles[ cnt ]);
|
pProfile = &(gMercProfiles[ cnt ]);
|
||||||
|
|
||||||
@@ -721,11 +714,9 @@ void HandleMercsAboutToLeave( SOLDIERTYPE *pMercList )
|
|||||||
|
|
||||||
// ATE: This function deals with MERC MERC and NPC's leaving because of not getting paid...
|
// ATE: This function deals with MERC MERC and NPC's leaving because of not getting paid...
|
||||||
// NOT AIM renewals....
|
// NOT AIM renewals....
|
||||||
void MercsContractIsFinished( UINT8 ubID )
|
void MercsContractIsFinished( SoldierID ubID )
|
||||||
{
|
{
|
||||||
SOLDIERTYPE *pSoldier;
|
SOLDIERTYPE *pSoldier = ubID;
|
||||||
|
|
||||||
pSoldier = &Menptr[ ubID ];
|
|
||||||
|
|
||||||
//if the soldier was removed before getting into this function, return
|
//if the soldier was removed before getting into this function, return
|
||||||
if( !pSoldier->bActive )
|
if( !pSoldier->bActive )
|
||||||
@@ -775,11 +766,9 @@ void MercsContractIsFinished( UINT8 ubID )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ATE: Called for RPCs who should now complain about no pay...
|
// ATE: Called for RPCs who should now complain about no pay...
|
||||||
void RPCWhineAboutNoPay( UINT8 ubID )
|
void RPCWhineAboutNoPay( SoldierID ubID )
|
||||||
{
|
{
|
||||||
SOLDIERTYPE *pSoldier;
|
SOLDIERTYPE *pSoldier = ubID;
|
||||||
|
|
||||||
pSoldier = &Menptr[ ubID ];
|
|
||||||
|
|
||||||
//if the soldier was removed before getting into this function, return
|
//if the soldier was removed before getting into this function, return
|
||||||
if( !pSoldier->bActive )
|
if( !pSoldier->bActive )
|
||||||
@@ -904,24 +893,22 @@ void MercComplainAboutEquipment( UINT8 ubProfile )
|
|||||||
|
|
||||||
void UpdateBuddyAndHatedCounters( void )
|
void UpdateBuddyAndHatedCounters( void )
|
||||||
{
|
{
|
||||||
INT8 bMercID;
|
SoldierID bMercID, bOtherID, bLastTeamID;
|
||||||
INT32 iLoop;
|
INT32 iLoop;
|
||||||
INT8 bOtherID;
|
UINT8 ubOtherProfileID;
|
||||||
INT8 bLastTeamID;
|
SOLDIERTYPE *pSoldier;
|
||||||
UINT8 ubOtherProfileID;
|
SOLDIERTYPE *pOtherSoldier;
|
||||||
SOLDIERTYPE *pSoldier;
|
MERCPROFILESTRUCT *pProfile;
|
||||||
SOLDIERTYPE *pOtherSoldier;
|
BOOLEAN fSameGroupOnly;
|
||||||
MERCPROFILESTRUCT *pProfile;
|
BOOLEAN fUpdatedTimeTillNextHatedComplaint = FALSE;
|
||||||
BOOLEAN fSameGroupOnly;
|
|
||||||
|
|
||||||
BOOLEAN fUpdatedTimeTillNextHatedComplaint = FALSE;
|
|
||||||
|
|
||||||
bMercID = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
bMercID = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||||
bLastTeamID = gTacticalStatus.Team[ gbPlayerNum ].bLastID;
|
bLastTeamID = gTacticalStatus.Team[ gbPlayerNum ].bLastID;
|
||||||
|
|
||||||
//loop though all the mercs
|
//loop though all the mercs
|
||||||
for ( pSoldier = MercPtrs[ bMercID ]; bMercID <= bLastTeamID; bMercID++,pSoldier++)
|
for ( ; bMercID <= bLastTeamID; ++bMercID )
|
||||||
{
|
{
|
||||||
|
pSoldier = bMercID;
|
||||||
fSameGroupOnly = FALSE;
|
fSameGroupOnly = FALSE;
|
||||||
|
|
||||||
//if the merc is active and on a combat assignment
|
//if the merc is active and on a combat assignment
|
||||||
@@ -938,9 +925,9 @@ void UpdateBuddyAndHatedCounters( void )
|
|||||||
fUpdatedTimeTillNextHatedComplaint = FALSE;
|
fUpdatedTimeTillNextHatedComplaint = FALSE;
|
||||||
|
|
||||||
bOtherID = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
bOtherID = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||||
|
for ( ; bOtherID <= bLastTeamID; ++bOtherID )
|
||||||
for ( pOtherSoldier = MercPtrs[ bOtherID ]; bOtherID <= bLastTeamID; bOtherID++, pOtherSoldier++)
|
|
||||||
{
|
{
|
||||||
|
pOtherSoldier = bOtherID;
|
||||||
// is this guy in the same sector and on active duty (or in the same moving group)
|
// is this guy in the same sector and on active duty (or in the same moving group)
|
||||||
|
|
||||||
if (bOtherID != bMercID && pOtherSoldier->bActive && pOtherSoldier->bAssignment < ON_DUTY )
|
if (bOtherID != bMercID && pOtherSoldier->bActive && pOtherSoldier->bAssignment < ON_DUTY )
|
||||||
@@ -1255,15 +1242,16 @@ void UpdateBuddyAndHatedCounters( void )
|
|||||||
|
|
||||||
void HourlyCamouflageUpdate( void )
|
void HourlyCamouflageUpdate( void )
|
||||||
{
|
{
|
||||||
INT8 bMercID, bLastTeamID;
|
SoldierID bMercID, bLastTeamID;
|
||||||
SOLDIERTYPE * pSoldier;
|
SOLDIERTYPE * pSoldier;
|
||||||
BOOLEAN camoWoreOff = FALSE;
|
BOOLEAN camoWoreOff = FALSE;
|
||||||
bMercID = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
bMercID = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||||
bLastTeamID = gTacticalStatus.Team[ gbPlayerNum ].bLastID;
|
bLastTeamID = gTacticalStatus.Team[ gbPlayerNum ].bLastID;
|
||||||
|
|
||||||
// loop through all mercs
|
// loop through all mercs
|
||||||
for ( pSoldier = MercPtrs[ bMercID ]; bMercID <= bLastTeamID; bMercID++,pSoldier++)
|
for ( ; bMercID <= bLastTeamID; ++bMercID )
|
||||||
{
|
{
|
||||||
|
pSoldier = bMercID;
|
||||||
if ( pSoldier->bActive )
|
if ( pSoldier->bActive )
|
||||||
{
|
{
|
||||||
// SANDRO - new Ranger trait reduces camo degrading, which replaces camouflage trait
|
// SANDRO - new Ranger trait reduces camo degrading, which replaces camouflage trait
|
||||||
|
|||||||
@@ -3,11 +3,12 @@
|
|||||||
|
|
||||||
//forward declarations of common classes to eliminate includes
|
//forward declarations of common classes to eliminate includes
|
||||||
class SOLDIERTYPE;
|
class SOLDIERTYPE;
|
||||||
|
struct SoldierID;
|
||||||
|
|
||||||
void StrategicHandlePlayerTeamMercDeath( SOLDIERTYPE *pSoldier );
|
void StrategicHandlePlayerTeamMercDeath( SOLDIERTYPE *pSoldier );
|
||||||
void MercDailyUpdate();
|
void MercDailyUpdate();
|
||||||
void MercsContractIsFinished( UINT8 ubID );
|
void MercsContractIsFinished( SoldierID ubID );
|
||||||
void RPCWhineAboutNoPay( UINT8 ubID );
|
void RPCWhineAboutNoPay( SoldierID ubID );
|
||||||
void MercComplainAboutEquipment( UINT8 ubProfileID );
|
void MercComplainAboutEquipment( UINT8 ubProfileID );
|
||||||
BOOLEAN SoldierHasWorseEquipmentThanUsedTo( SOLDIERTYPE *pSoldier );
|
BOOLEAN SoldierHasWorseEquipmentThanUsedTo( SOLDIERTYPE *pSoldier );
|
||||||
void UpdateBuddyAndHatedCounters( void );
|
void UpdateBuddyAndHatedCounters( void );
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ UINT8 gubMonsterMineInfestation[]={
|
|||||||
// the static NPC dialogue faces
|
// the static NPC dialogue faces
|
||||||
//extern UINT32 uiExternalStaticNPCFaces[];
|
//extern UINT32 uiExternalStaticNPCFaces[];
|
||||||
extern FACETYPE *gpCurrentTalkingFace;
|
extern FACETYPE *gpCurrentTalkingFace;
|
||||||
extern UINT8 gubCurrentTalkingID;
|
extern UINT16 gubCurrentTalkingID;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -806,7 +806,7 @@ GROUP* CreateNewEnemyGroupDepartingFromSector( UINT32 uiSector, UINT8 ubNumAdmin
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
GROUP* CreateNewMilitiaGroupDepartingFromSector( UINT32 uiSector, UINT8& arusNumAdmins, UINT8& arusNumTroops, UINT8& arusNumElites )
|
GROUP* CreateNewMilitiaGroupDepartingFromSector( UINT32 uiSector, UINT16& arusNumAdmins, UINT16& arusNumTroops, UINT16& arusNumElites )
|
||||||
{
|
{
|
||||||
GROUP *pNew;
|
GROUP *pNew;
|
||||||
AssertMsg( uiSector >= 0 && uiSector <= 255, String( "CreateNewMilitiaGroupDepartingFromSector with out of range value of %d", uiSector ) );
|
AssertMsg( uiSector >= 0 && uiSector <= 255, String( "CreateNewMilitiaGroupDepartingFromSector with out of range value of %d", uiSector ) );
|
||||||
@@ -846,7 +846,7 @@ GROUP* CreateNewMilitiaGroupDepartingFromSector( UINT32 uiSector, UINT8& arusNum
|
|||||||
pNew->pEnemyGroup->ubNumAdmins = arusNumAdmins;
|
pNew->pEnemyGroup->ubNumAdmins = arusNumAdmins;
|
||||||
pNew->pEnemyGroup->ubNumTroops = arusNumTroops;
|
pNew->pEnemyGroup->ubNumTroops = arusNumTroops;
|
||||||
pNew->pEnemyGroup->ubNumElites = arusNumElites;
|
pNew->pEnemyGroup->ubNumElites = arusNumElites;
|
||||||
pNew->ubGroupSize = (UINT8)(arusNumAdmins + arusNumTroops + arusNumElites);
|
pNew->ubGroupSize = arusNumAdmins + arusNumTroops + arusNumElites;
|
||||||
pNew->ubTransportationMask = FOOT;
|
pNew->ubTransportationMask = FOOT;
|
||||||
pNew->fVehicle = FALSE;
|
pNew->fVehicle = FALSE;
|
||||||
pNew->ubCreatedSectorID = pNew->ubOriginalSector;
|
pNew->ubCreatedSectorID = pNew->ubOriginalSector;
|
||||||
@@ -1120,7 +1120,7 @@ void PrepareForPreBattleInterface( GROUP *pPlayerDialogGroup, GROUP *pInitiating
|
|||||||
gfCantRetreatInPBI = TRUE;
|
gfCantRetreatInPBI = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
ubChosenMerc = (UINT8)Random( ubNumMercs );
|
ubChosenMerc = (UINT16)Random( ubNumMercs );
|
||||||
|
|
||||||
pSoldier = MercPtrs[ ubMercsInGroup[ ubChosenMerc ] ];
|
pSoldier = MercPtrs[ ubMercsInGroup[ ubChosenMerc ] ];
|
||||||
gpTacticalTraversalChosenSoldier = pSoldier;
|
gpTacticalTraversalChosenSoldier = pSoldier;
|
||||||
@@ -1149,7 +1149,7 @@ void PrepareForPreBattleInterface( GROUP *pPlayerDialogGroup, GROUP *pInitiating
|
|||||||
gfCantRetreatInPBI = TRUE;
|
gfCantRetreatInPBI = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
ubChosenMerc = (UINT8)Random( ubNumMercs );
|
ubChosenMerc = (UINT16)Random( ubNumMercs );
|
||||||
|
|
||||||
pSoldier = MercPtrs[ ubMercsInGroup[ ubChosenMerc ] ];
|
pSoldier = MercPtrs[ ubMercsInGroup[ ubChosenMerc ] ];
|
||||||
|
|
||||||
@@ -1946,11 +1946,6 @@ void GroupArrivedAtSector( UINT8 ubGroupID, BOOLEAN fCheckForBattle, BOOLEAN fNe
|
|||||||
|
|
||||||
if ( pGroup->usGroupTeam == OUR_TEAM )
|
if ( pGroup->usGroupTeam == OUR_TEAM )
|
||||||
{
|
{
|
||||||
if( pGroup->ubSectorZ == 0 )
|
|
||||||
{
|
|
||||||
SectorInfo[SECTOR( pGroup->ubSectorX, pGroup->ubSectorY )].bLastKnownEnemies = NumNonPlayerTeamMembersInSector( pGroup->ubSectorX, pGroup->ubSectorY, ENEMY_TEAM );
|
|
||||||
}
|
|
||||||
|
|
||||||
// Flugente: do not award experience gain if we never left
|
// Flugente: do not award experience gain if we never left
|
||||||
if (!fNeverLeft)
|
if (!fNeverLeft)
|
||||||
{
|
{
|
||||||
@@ -3770,8 +3765,6 @@ INT32 GetTravelTimeForFootTeam( UINT8 ubSector, UINT8 ubDirection )
|
|||||||
void HandleArrivalOfReinforcements( GROUP *pGroup )
|
void HandleArrivalOfReinforcements( GROUP *pGroup )
|
||||||
{
|
{
|
||||||
SOLDIERTYPE *pSoldier;
|
SOLDIERTYPE *pSoldier;
|
||||||
SECTORINFO *pSector;
|
|
||||||
INT32 iNumEnemiesInSector;
|
|
||||||
INT32 cnt;
|
INT32 cnt;
|
||||||
|
|
||||||
if ( pGroup->usGroupTeam == OUR_TEAM )
|
if ( pGroup->usGroupTeam == OUR_TEAM )
|
||||||
@@ -3835,22 +3828,6 @@ void HandleArrivalOfReinforcements( GROUP *pGroup )
|
|||||||
gfPendingNonPlayerTeam[MILITIA_TEAM] = TRUE;
|
gfPendingNonPlayerTeam[MILITIA_TEAM] = TRUE;
|
||||||
AddPossiblePendingMilitiaToBattle( );
|
AddPossiblePendingMilitiaToBattle( );
|
||||||
}
|
}
|
||||||
|
|
||||||
//Update the known number of enemies in the sector.
|
|
||||||
pSector = &SectorInfo[ SECTOR( pGroup->ubSectorX, pGroup->ubSectorY ) ];
|
|
||||||
iNumEnemiesInSector = NumNonPlayerTeamMembersInSector( pGroup->ubSectorX, pGroup->ubSectorY, ENEMY_TEAM );
|
|
||||||
if( iNumEnemiesInSector )
|
|
||||||
{
|
|
||||||
if( pSector->bLastKnownEnemies >= 0 )
|
|
||||||
{
|
|
||||||
pSector->bLastKnownEnemies = (INT8)iNumEnemiesInSector;
|
|
||||||
}
|
|
||||||
//if we don't know how many enemies there are, then we can't update this value.
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pSector->bLastKnownEnemies = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN PlayersBetweenTheseSectors( INT16 sSource, INT16 sDest, INT32 *iCountEnter, INT32 *iCountExit, BOOLEAN *fAboutToArriveEnter )
|
BOOLEAN PlayersBetweenTheseSectors( INT16 sSource, INT16 sDest, INT32 *iCountEnter, INT32 *iCountExit, BOOLEAN *fAboutToArriveEnter )
|
||||||
@@ -4334,12 +4311,12 @@ BOOLEAN LoadPlayerGroupList( HWFILE hFile, GROUP **pGroup )
|
|||||||
{
|
{
|
||||||
PLAYERGROUP *pTemp=NULL;
|
PLAYERGROUP *pTemp=NULL;
|
||||||
PLAYERGROUP *pHead=NULL;
|
PLAYERGROUP *pHead=NULL;
|
||||||
UINT32 uiNumberOfNodes=0;
|
UINT32 uiNumberOfNodes=0;
|
||||||
UINT32 uiProfileID=0;
|
UINT32 uiProfileID=0;
|
||||||
UINT32 uiNumBytesRead;
|
UINT32 uiNumBytesRead;
|
||||||
UINT32 cnt=0;
|
UINT32 cnt=0;
|
||||||
INT16 sTempID;
|
SoldierID sTempID;
|
||||||
GROUP *pTempGroup = *pGroup;
|
GROUP *pTempGroup = *pGroup;
|
||||||
|
|
||||||
// pTemp = pGroup;
|
// pTemp = pGroup;
|
||||||
|
|
||||||
@@ -4374,10 +4351,10 @@ BOOLEAN LoadPlayerGroupList( HWFILE hFile, GROUP **pGroup )
|
|||||||
sTempID = GetSoldierIDFromMercID( pTemp->ubProfileID );
|
sTempID = GetSoldierIDFromMercID( pTemp->ubProfileID );
|
||||||
|
|
||||||
//Should never happen
|
//Should never happen
|
||||||
Assert( sTempID != -1 );
|
Assert( sTempID != NOBODY );
|
||||||
pTemp->ubID = (UINT8) sTempID;
|
pTemp->ubID = sTempID;
|
||||||
|
|
||||||
pTemp->pSoldier = &Menptr[ pTemp->ubID ];
|
pTemp->pSoldier = pTemp->ubID;
|
||||||
|
|
||||||
pTemp->next = NULL;
|
pTemp->next = NULL;
|
||||||
|
|
||||||
@@ -5480,15 +5457,16 @@ BOOLEAN TestForBloodcatAmbush( GROUP *pGroup )
|
|||||||
// merc recoeds - get a point to scouts
|
// merc recoeds - get a point to scouts
|
||||||
if ( fBloodCatAmbushPrevented )
|
if ( fBloodCatAmbushPrevented )
|
||||||
{
|
{
|
||||||
for( UINT16 i = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; i <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; i++ )
|
for( SoldierID i = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; i <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; ++i )
|
||||||
{
|
{
|
||||||
if( MercPtrs[ i ]->bActive && MercPtrs[ i ]->stats.bLife && !(MercPtrs[ i ]->flags.uiStatusFlags & SOLDIER_VEHICLE) )
|
SOLDIERTYPE *pSoldier = i;
|
||||||
|
if( pSoldier->bActive && pSoldier->stats.bLife && !(pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE) )
|
||||||
{
|
{
|
||||||
if ( MercPtrs[ i ]->sSectorX == pGroup->ubSectorX && MercPtrs[ i ]->sSectorY == pGroup->ubSectorY && MercPtrs[ i ]->bAssignment != ASSIGNMENT_POW && MercPtrs[ i ]->bAssignment != ASSIGNMENT_MINIEVENT && MercPtrs[i]->bAssignment != ASSIGNMENT_REBELCOMMAND && MercPtrs[ i ]->stats.bLife >= OKLIFE )
|
if ( pSoldier->sSectorX == pGroup->ubSectorX && pSoldier->sSectorY == pGroup->ubSectorY && pSoldier->bAssignment != ASSIGNMENT_POW && pSoldier->bAssignment != ASSIGNMENT_MINIEVENT && pSoldier->bAssignment != ASSIGNMENT_REBELCOMMAND && pSoldier->stats.bLife >= OKLIFE )
|
||||||
{
|
{
|
||||||
if( HAS_SKILL_TRAIT( MercPtrs[ i ], SCOUTING_NT ) && MercPtrs[ i ]->ubProfile != NO_PROFILE )
|
if( HAS_SKILL_TRAIT( pSoldier, SCOUTING_NT ) && pSoldier->ubProfile != NO_PROFILE )
|
||||||
{
|
{
|
||||||
gMercProfiles[ MercPtrs[ i ]->ubProfile ].records.usAmbushesExperienced++;
|
gMercProfiles[ pSoldier->ubProfile ].records.usAmbushesExperienced++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5962,18 +5940,17 @@ BOOLEAN ValidateGroups( GROUP *pGroup )
|
|||||||
BOOLEAN ScoutIsPresentInSquad( INT16 ubSectorNumX, INT16 ubSectorNumY )
|
BOOLEAN ScoutIsPresentInSquad( INT16 ubSectorNumX, INT16 ubSectorNumY )
|
||||||
{
|
{
|
||||||
BOOLEAN fScoutPresent = FALSE;
|
BOOLEAN fScoutPresent = FALSE;
|
||||||
INT32 i;
|
|
||||||
|
|
||||||
// sevenfm: scout should not be sleeping, in vehicle or on assignment
|
// sevenfm: scout should not be sleeping, in vehicle or on assignment
|
||||||
for( i = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; i <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; i++ )
|
for( SoldierID i = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; i <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; ++i )
|
||||||
{
|
{
|
||||||
if( MercPtrs[ i ]->bActive &&
|
SOLDIERTYPE *pSoldier = i;
|
||||||
MercPtrs[ i ]->stats.bLife >= OKLIFE &&
|
if( pSoldier->bActive &&
|
||||||
MercPtrs[ i ]->sSectorX == ubSectorNumX &&
|
pSoldier->stats.bLife >= OKLIFE &&
|
||||||
MercPtrs[ i ]->sSectorY == ubSectorNumY &&
|
pSoldier->sSectorX == ubSectorNumX &&
|
||||||
MercPtrs[ i ]->bAssignment < ON_DUTY &&
|
pSoldier->sSectorY == ubSectorNumY &&
|
||||||
!MercPtrs[ i ]->flags.fMercAsleep &&
|
pSoldier->bAssignment < ON_DUTY &&
|
||||||
HAS_SKILL_TRAIT( MercPtrs[ i ], SCOUTING_NT ) )
|
!pSoldier->flags.fMercAsleep &&
|
||||||
|
HAS_SKILL_TRAIT( pSoldier, SCOUTING_NT ) )
|
||||||
{
|
{
|
||||||
fScoutPresent = TRUE;
|
fScoutPresent = TRUE;
|
||||||
}
|
}
|
||||||
@@ -6004,13 +5981,14 @@ BOOLEAN ConcealedMercInSector( INT16 ubSectorNumX, INT16 ubSectorNumY, BOOLEAN a
|
|||||||
if ( !gGameOptions.fNewTraitSystem )
|
if ( !gGameOptions.fNewTraitSystem )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
for ( int i = gTacticalStatus.Team[OUR_TEAM].bFirstID; i <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++i )
|
for ( SoldierID i = gTacticalStatus.Team[OUR_TEAM].bFirstID; i <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++i )
|
||||||
{
|
{
|
||||||
if ( MercPtrs[i]->bActive && MercPtrs[i]->stats.bLife >= OKLIFE && SPY_LOCATION( MercPtrs[i]->bAssignment ) )
|
SOLDIERTYPE *pSoldier = i;
|
||||||
|
if ( pSoldier->bActive && pSoldier->stats.bLife >= OKLIFE && SPY_LOCATION( pSoldier->bAssignment ) )
|
||||||
{
|
{
|
||||||
if ( MercPtrs[i]->sSectorX == ubSectorNumX && MercPtrs[i]->sSectorY == ubSectorNumY && MercPtrs[i]->bSectorZ == 10 )
|
if ( pSoldier->sSectorX == ubSectorNumX && pSoldier->sSectorY == ubSectorNumY && pSoldier->bSectorZ == 10 )
|
||||||
{
|
{
|
||||||
if ( !aScoutsOnly || HAS_SKILL_TRAIT( MercPtrs[i], SCOUTING_NT ) )
|
if ( !aScoutsOnly || HAS_SKILL_TRAIT( pSoldier, SCOUTING_NT ) )
|
||||||
{
|
{
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,38 +52,38 @@ typedef struct WAYPOINT
|
|||||||
|
|
||||||
typedef struct PLAYERGROUP
|
typedef struct PLAYERGROUP
|
||||||
{
|
{
|
||||||
UINT8 ubProfileID; //SAVE THIS VALUE ONLY. The others are temp (for quick access)
|
UINT8 ubProfileID; //SAVE THIS VALUE ONLY. The others are temp (for quick access)
|
||||||
UINT8 ubID; //index in the Menptr array
|
SoldierID ubID; //index in the Menptr array
|
||||||
SOLDIERTYPE *pSoldier; //direct access to the soldier pointer
|
SOLDIERTYPE *pSoldier; //direct access to the soldier pointer
|
||||||
UINT8 bFlags; //flags referring to individual player soldiers
|
UINT8 bFlags; //flags referring to individual player soldiers
|
||||||
struct PLAYERGROUP *next; //next player in list
|
struct PLAYERGROUP *next; //next player in list
|
||||||
}PLAYERGROUP;
|
}PLAYERGROUP;
|
||||||
|
|
||||||
|
|
||||||
typedef struct ENEMYGROUP
|
typedef struct ENEMYGROUP
|
||||||
{
|
{
|
||||||
UINT8 ubNumTroops; //number of regular troops in the group
|
UINT16 ubNumTroops; //number of regular troops in the group
|
||||||
UINT8 ubNumElites; //number of elite troops in the group
|
UINT16 ubNumElites; //number of elite troops in the group
|
||||||
UINT8 ubNumAdmins; //number of administrators in the group
|
UINT16 ubNumAdmins; //number of administrators in the group
|
||||||
UINT8 ubLeaderProfileID; //could be Mike, maybe the warden... someone new, but likely nobody.
|
UINT8 ubLeaderProfileID; //could be Mike, maybe the warden... someone new, but likely nobody.
|
||||||
UINT8 ubPendingReinforcements;//This group is waiting for reinforcements before attacking or attempting to fortify newly aquired sector.
|
UINT16 ubPendingReinforcements;//This group is waiting for reinforcements before attacking or attempting to fortify newly aquired sector.
|
||||||
UINT8 ubAdminsInBattle; //number of administrators in currently in battle.
|
UINT16 ubAdminsInBattle; //number of administrators in currently in battle.
|
||||||
UINT8 ubIntention; //the type of group this is: patrol, assault, spies, etc.
|
UINT8 ubIntention; //the type of group this is: patrol, assault, spies, etc.
|
||||||
UINT8 ubTroopsInBattle; //number of soldiers currently in battle.
|
UINT16 ubTroopsInBattle; //number of soldiers currently in battle.
|
||||||
UINT8 ubElitesInBattle; //number of elite soldiers currently in battle.
|
UINT16 ubElitesInBattle; //number of elite soldiers currently in battle.
|
||||||
// WDS - New AI
|
// WDS - New AI
|
||||||
UINT8 ubNumTanks;
|
UINT16 ubNumTanks;
|
||||||
UINT8 ubTanksInBattle;
|
UINT16 ubTanksInBattle;
|
||||||
UINT8 ubNumJeeps;
|
UINT16 ubNumJeeps;
|
||||||
UINT8 ubJeepsInBattle;
|
UINT16 ubJeepsInBattle;
|
||||||
|
|
||||||
// Flugente: number of turncoats
|
// Flugente: number of turncoats
|
||||||
UINT8 ubNumAdmins_Turncoat;
|
UINT8 ubNumAdmins_Turncoat;
|
||||||
UINT8 ubNumTroops_Turncoat;
|
UINT8 ubNumTroops_Turncoat;
|
||||||
UINT8 ubNumElites_Turncoat;
|
UINT8 ubNumElites_Turncoat;
|
||||||
|
|
||||||
UINT8 ubNumRobots; //number of enemy robots in the group
|
UINT16 ubNumRobots; //number of enemy robots in the group
|
||||||
UINT8 ubRobotsInBattle; //number of enemy robots currently in battle.
|
UINT16 ubRobotsInBattle; //number of enemy robots currently in battle.
|
||||||
|
|
||||||
INT8 bPadding[11];
|
INT8 bPadding[11];
|
||||||
}ENEMYGROUP;
|
}ENEMYGROUP;
|
||||||
@@ -120,7 +120,7 @@ typedef struct GROUP
|
|||||||
BOOLEAN fVehicle; //vehicle controlled group?
|
BOOLEAN fVehicle; //vehicle controlled group?
|
||||||
BOOLEAN fPersistant; //This flag when set prevents the group from being automatically deleted when it becomes empty.
|
BOOLEAN fPersistant; //This flag when set prevents the group from being automatically deleted when it becomes empty.
|
||||||
UINT8 ubGroupID; //the unique ID of the group (used for hooking into events and SOLDIERTYPE)
|
UINT8 ubGroupID; //the unique ID of the group (used for hooking into events and SOLDIERTYPE)
|
||||||
UINT8 ubGroupSize; //total number of individuals in the group.
|
UINT16 ubGroupSize; //total number of individuals in the group.
|
||||||
UINT8 ubSectorX, ubSectorY; //last/curr sector occupied
|
UINT8 ubSectorX, ubSectorY; //last/curr sector occupied
|
||||||
UINT8 ubSectorZ;
|
UINT8 ubSectorZ;
|
||||||
UINT8 ubNextX, ubNextY; //next sector destination
|
UINT8 ubNextX, ubNextY; //next sector destination
|
||||||
@@ -204,7 +204,7 @@ BOOLEAN SetGroupPatrolParameters( UINT8 ubGroupID, UINT8 ubRestAtFL, UINT8 ubRes
|
|||||||
//............................................................
|
//............................................................
|
||||||
GROUP* CreateNewEnemyGroupDepartingFromSector( UINT32 uiSector, UINT8 ubNumAdmins, UINT8 ubNumTroops, UINT8 ubNumElites, UINT8 ubNumRobots, UINT8 ubNumTanks, UINT8 ubNumJeeps );
|
GROUP* CreateNewEnemyGroupDepartingFromSector( UINT32 uiSector, UINT8 ubNumAdmins, UINT8 ubNumTroops, UINT8 ubNumElites, UINT8 ubNumRobots, UINT8 ubNumTanks, UINT8 ubNumJeeps );
|
||||||
|
|
||||||
GROUP* CreateNewMilitiaGroupDepartingFromSector( UINT32 uiSector, UINT8& arusNumAdmins, UINT8& arusNumTroops, UINT8& arusNumElites );
|
GROUP* CreateNewMilitiaGroupDepartingFromSector( UINT32 uiSector, UINT16& arusNumAdmins, UINT16& arusNumTroops, UINT16& arusNumElites );
|
||||||
|
|
||||||
#ifdef JA2UB
|
#ifdef JA2UB
|
||||||
GROUP* CreateNewEnemyGroupDepartingFromSectorUsingZLevel( UINT32 uiSector, UINT8 ubSectorZ, UINT8 ubNumAdmins, UINT8 ubNumTroops, UINT8 ubNumElites, UINT8 ubNumTanks );
|
GROUP* CreateNewEnemyGroupDepartingFromSectorUsingZLevel( UINT32 uiSector, UINT8 ubSectorZ, UINT8 ubNumAdmins, UINT8 ubNumTroops, UINT8 ubNumElites, UINT8 ubNumTanks );
|
||||||
|
|||||||
@@ -680,7 +680,6 @@ void HandleMurderOfCivilian( SOLDIERTYPE *pSoldier, BOOLEAN fIntentional )
|
|||||||
INT8 bTownId = 0;
|
INT8 bTownId = 0;
|
||||||
INT32 iLoyaltyChange = 0;
|
INT32 iLoyaltyChange = 0;
|
||||||
INT8 bSeenState = 0;
|
INT8 bSeenState = 0;
|
||||||
INT32 iCounter = 0;
|
|
||||||
SOLDIERTYPE *pCivSoldier = NULL;
|
SOLDIERTYPE *pCivSoldier = NULL;
|
||||||
UINT32 uiChanceFalseAccusal = 0;
|
UINT32 uiChanceFalseAccusal = 0;
|
||||||
INT8 bKillerTeam = 0;
|
INT8 bKillerTeam = 0;
|
||||||
@@ -741,13 +740,13 @@ void HandleMurderOfCivilian( SOLDIERTYPE *pSoldier, BOOLEAN fIntentional )
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
// set killer team
|
// set killer team
|
||||||
bKillerTeam = Menptr[ pSoldier->ubAttackerID ].bTeam;
|
bKillerTeam = pSoldier->ubAttackerID->bTeam;
|
||||||
|
|
||||||
|
|
||||||
// if the player did the killing
|
// if the player did the killing
|
||||||
if( bKillerTeam == OUR_TEAM )
|
if( bKillerTeam == OUR_TEAM )
|
||||||
{
|
{
|
||||||
SOLDIERTYPE *pKiller = MercPtrs[ pSoldier->ubAttackerID ];
|
SOLDIERTYPE *pKiller = pSoldier->ubAttackerID;
|
||||||
|
|
||||||
// apply morale penalty for killing a civilian!
|
// apply morale penalty for killing a civilian!
|
||||||
HandleMoraleEvent( pKiller, MORALE_KILLED_CIVILIAN, pKiller->sSectorX, pKiller->sSectorY, pKiller->bSectorZ );
|
HandleMoraleEvent( pKiller, MORALE_KILLED_CIVILIAN, pKiller->sSectorX, pKiller->sSectorY, pKiller->bSectorZ );
|
||||||
@@ -790,10 +789,10 @@ void HandleMurderOfCivilian( SOLDIERTYPE *pSoldier, BOOLEAN fIntentional )
|
|||||||
// check if LOS between any civ, killer and killed
|
// check if LOS between any civ, killer and killed
|
||||||
// if so, then do not adjust
|
// if so, then do not adjust
|
||||||
|
|
||||||
for( iCounter = gTacticalStatus.Team[ CIV_TEAM ].bFirstID; iCounter <= gTacticalStatus.Team[ CIV_TEAM ].bLastID; iCounter++ )
|
for( SoldierID iCounter = gTacticalStatus.Team[ CIV_TEAM ].bFirstID; iCounter <= gTacticalStatus.Team[ CIV_TEAM ].bLastID; ++iCounter )
|
||||||
{
|
{
|
||||||
// set current civ soldier
|
// set current civ soldier
|
||||||
pCivSoldier = MercPtrs[ iCounter ];
|
pCivSoldier = iCounter;
|
||||||
|
|
||||||
if ( pCivSoldier == pSoldier )
|
if ( pCivSoldier == pSoldier )
|
||||||
{
|
{
|
||||||
@@ -801,7 +800,7 @@ void HandleMurderOfCivilian( SOLDIERTYPE *pSoldier, BOOLEAN fIntentional )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// killer seen by civ?
|
// killer seen by civ?
|
||||||
if ( SoldierToSoldierLineOfSightTest( pCivSoldier, MercPtrs[ pSoldier->ubAttackerID ], TRUE, gGameExternalOptions.ubStraightSightRange ) != 0 )
|
if ( SoldierToSoldierLineOfSightTest( pCivSoldier, pSoldier->ubAttackerID, TRUE, gGameExternalOptions.ubStraightSightRange ) != 0 )
|
||||||
{
|
{
|
||||||
bSeenState |= 1;
|
bSeenState |= 1;
|
||||||
}
|
}
|
||||||
@@ -909,7 +908,7 @@ void HandleMurderOfCivilian( SOLDIERTYPE *pSoldier, BOOLEAN fIntentional )
|
|||||||
|
|
||||||
case CREATURE_TEAM:
|
case CREATURE_TEAM:
|
||||||
// killed by a monster - make sure it was one
|
// killed by a monster - make sure it was one
|
||||||
if( ( Menptr[ pSoldier->ubAttackerID ].ubBodyType >= ADULTFEMALEMONSTER ) && ( Menptr[ pSoldier->ubAttackerID ].ubBodyType <= QUEENMONSTER ) )
|
if( ( pSoldier->ubAttackerID->ubBodyType >= ADULTFEMALEMONSTER ) && ( pSoldier->ubAttackerID->ubBodyType <= QUEENMONSTER ) )
|
||||||
{
|
{
|
||||||
// increase for the extreme horror of being killed by a monster
|
// increase for the extreme horror of being killed by a monster
|
||||||
iLoyaltyChange *= MULTIPLIER_FOR_MURDER_BY_MONSTER;
|
iLoyaltyChange *= MULTIPLIER_FOR_MURDER_BY_MONSTER;
|
||||||
@@ -2130,13 +2129,12 @@ BOOLEAN DidFirstBattleTakePlaceInThisTown( INT8 bTownId )
|
|||||||
|
|
||||||
UINT32 PlayerStrength( void )
|
UINT32 PlayerStrength( void )
|
||||||
{
|
{
|
||||||
UINT8 ubLoop;
|
SOLDIERTYPE *pSoldier;
|
||||||
SOLDIERTYPE * pSoldier;
|
UINT32 uiStrength, uiTotal = 0;
|
||||||
UINT32 uiStrength, uiTotal = 0;
|
|
||||||
|
|
||||||
for ( ubLoop = gTacticalStatus.Team[ gbPlayerNum ].bFirstID; ubLoop <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ubLoop++ )
|
for ( SoldierID ubLoop = gTacticalStatus.Team[ gbPlayerNum ].bFirstID; ubLoop <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++ubLoop )
|
||||||
{
|
{
|
||||||
pSoldier = MercPtrs[ ubLoop ];
|
pSoldier = ubLoop;
|
||||||
if ( pSoldier->bActive )
|
if ( pSoldier->bActive )
|
||||||
{
|
{
|
||||||
if ( pSoldier->bInSector || (pSoldier->flags.fBetweenSectors && SECTORX( pSoldier->ubPrevSectorID ) == gWorldSectorX && SECTORY( pSoldier->ubPrevSectorID ) == gWorldSectorY && (pSoldier->bSectorZ == gbWorldSectorZ)) )
|
if ( pSoldier->bInSector || (pSoldier->flags.fBetweenSectors && SECTORX( pSoldier->ubPrevSectorID ) == gWorldSectorX && SECTORY( pSoldier->ubPrevSectorID ) == gWorldSectorY && (pSoldier->bSectorZ == gbWorldSectorZ)) )
|
||||||
@@ -2152,13 +2150,12 @@ UINT32 PlayerStrength( void )
|
|||||||
|
|
||||||
UINT32 EnemyStrength( void )
|
UINT32 EnemyStrength( void )
|
||||||
{
|
{
|
||||||
UINT8 ubLoop;
|
SOLDIERTYPE * pSoldier;
|
||||||
SOLDIERTYPE * pSoldier;
|
UINT32 uiStrength, uiTotal = 0;
|
||||||
UINT32 uiStrength, uiTotal = 0;
|
|
||||||
|
|
||||||
for ( ubLoop = gTacticalStatus.Team[ ENEMY_TEAM ].bFirstID; ubLoop <= gTacticalStatus.Team[ CIV_TEAM ].bLastID; ubLoop++ )
|
for ( SoldierID ubLoop = gTacticalStatus.Team[ ENEMY_TEAM ].bFirstID; ubLoop <= gTacticalStatus.Team[ CIV_TEAM ].bLastID; ++ubLoop )
|
||||||
{
|
{
|
||||||
pSoldier = MercPtrs[ ubLoop ];
|
pSoldier = ubLoop;
|
||||||
if ( pSoldier->bActive && pSoldier->bInSector && !pSoldier->aiData.bNeutral )
|
if ( pSoldier->bActive && pSoldier->bInSector && !pSoldier->aiData.bNeutral )
|
||||||
{
|
{
|
||||||
// count this person's strength (condition), calculated as life reduced up to half according to maxbreath
|
// count this person's strength (condition), calculated as life reduced up to half according to maxbreath
|
||||||
|
|||||||
@@ -52,10 +52,10 @@ extern ARMY_GUN_CHOICE_TYPE gExtendedArmyGunChoices[SOLDIER_GUN_CHOICE_SELECTION
|
|||||||
extern ARMY_GUN_CHOICE_TYPE gArmyItemChoices[SOLDIER_GUN_CHOICE_SELECTIONS][MAX_ITEM_TYPES];
|
extern ARMY_GUN_CHOICE_TYPE gArmyItemChoices[SOLDIER_GUN_CHOICE_SELECTIONS][MAX_ITEM_TYPES];
|
||||||
extern BOOLEAN gfTownUsesLoyalty[MAX_TOWNS];
|
extern BOOLEAN gfTownUsesLoyalty[MAX_TOWNS];
|
||||||
|
|
||||||
std::map<UINT8, std::map<int, UINT8>> transportGroupIdToSoldierMap;
|
std::map<UINT8, std::map<int, UINT16>> transportGroupIdToSoldierMap;
|
||||||
std::map<UINT8, TransportGroupSectorInfo> transportGroupSectorInfo;
|
std::map<UINT8, TransportGroupSectorInfo> transportGroupSectorInfo;
|
||||||
|
|
||||||
void PopulateTransportGroup(UINT8& admins, UINT8& troops, UINT8& elites, UINT8& jeeps, UINT8& tanks, UINT8& robots, UINT8 progress, int difficulty, BOOLEAN trySpecialCase);
|
void PopulateTransportGroup(UINT16& admins, UINT16& troops, UINT16& elites, UINT16& jeeps, UINT16& tanks, UINT16& robots, UINT8 progress, int difficulty, BOOLEAN trySpecialCase);
|
||||||
|
|
||||||
BOOLEAN DeployTransportGroup()
|
BOOLEAN DeployTransportGroup()
|
||||||
{
|
{
|
||||||
@@ -128,7 +128,7 @@ BOOLEAN DeployTransportGroup()
|
|||||||
|
|
||||||
TRANSPORT_GROUP_DEBUG(L"DeployTransportGroup sending group to sectorId: %d (%d/%d)", ubSectorID, SECTORX(ubSectorID), SECTORY(ubSectorID));
|
TRANSPORT_GROUP_DEBUG(L"DeployTransportGroup sending group to sectorId: %d (%d/%d)", ubSectorID, SECTORX(ubSectorID), SECTORY(ubSectorID));
|
||||||
|
|
||||||
UINT8 admins, troops, elites, robots, jeeps, tanks;
|
UINT16 admins, troops, elites, robots, jeeps, tanks;
|
||||||
const UINT8 progress = min(125, HighestPlayerProgressPercentage() + recentLossCount * 5);
|
const UINT8 progress = min(125, HighestPlayerProgressPercentage() + recentLossCount * 5);
|
||||||
PopulateTransportGroup(admins, troops, elites, jeeps, tanks, robots, progress, difficulty, mineSectorIds.size() == 1);
|
PopulateTransportGroup(admins, troops, elites, jeeps, tanks, robots, progress, difficulty, mineSectorIds.size() == 1);
|
||||||
|
|
||||||
@@ -152,7 +152,7 @@ BOOLEAN DeployTransportGroup()
|
|||||||
|
|
||||||
BOOLEAN ForceDeployTransportGroup(UINT8 sectorId)
|
BOOLEAN ForceDeployTransportGroup(UINT8 sectorId)
|
||||||
{
|
{
|
||||||
UINT8 admins, troops, elites, robots, jeeps, tanks;
|
UINT16 admins, troops, elites, robots, jeeps, tanks;
|
||||||
const INT8 recentLossCount = min(5, GetAllStrategicEventsOfType(EVENT_TRANSPORT_GROUP_DEFEATED).size());
|
const INT8 recentLossCount = min(5, GetAllStrategicEventsOfType(EVENT_TRANSPORT_GROUP_DEFEATED).size());
|
||||||
const UINT8 progress = min(125, HighestPlayerProgressPercentage() + recentLossCount * 5);
|
const UINT8 progress = min(125, HighestPlayerProgressPercentage() + recentLossCount * 5);
|
||||||
const UINT8 difficulty = gGameOptions.ubDifficultyLevel;
|
const UINT8 difficulty = gGameOptions.ubDifficultyLevel;
|
||||||
@@ -222,29 +222,31 @@ void FillMapColoursForTransportGroups(INT32(&colorMap)[MAXIMUM_VALID_Y_COORDINAT
|
|||||||
// build map of detection sectors + ranges
|
// build map of detection sectors + ranges
|
||||||
std::map<std::pair<INT16,INT16>, INT8> detectionMap;
|
std::map<std::pair<INT16,INT16>, INT8> detectionMap;
|
||||||
std::map<UINT8, MonitoredSectorState> monitoredTowns;
|
std::map<UINT8, MonitoredSectorState> monitoredTowns;
|
||||||
for( INT16 i = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; i <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; i++ )
|
for( SoldierID i = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; i <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; ++i )
|
||||||
{
|
{
|
||||||
if( MercPtrs[ i ]->bActive &&
|
SOLDIERTYPE *pSoldier = i;
|
||||||
MercPtrs[ i ]->stats.bLife >= OKLIFE &&
|
|
||||||
(MercPtrs[ i ]->bAssignment < ON_DUTY || MercPtrs[ i ]->bAssignment == GATHERINTEL) &&
|
if( pSoldier->bActive &&
|
||||||
!MercPtrs[ i ]->flags.fMercAsleep)
|
pSoldier->stats.bLife >= OKLIFE &&
|
||||||
|
(pSoldier->bAssignment < ON_DUTY || pSoldier->bAssignment == GATHERINTEL) &&
|
||||||
|
!pSoldier->flags.fMercAsleep)
|
||||||
{
|
{
|
||||||
if (gGameOptions.fNewTraitSystem)
|
if (gGameOptions.fNewTraitSystem)
|
||||||
{
|
{
|
||||||
if (HAS_SKILL_TRAIT(MercPtrs[i], SCOUTING_NT))
|
if (HAS_SKILL_TRAIT(pSoldier, SCOUTING_NT))
|
||||||
{
|
{
|
||||||
detectionMap[std::pair<INT16,INT16>(MercPtrs[i]->sSectorX, MercPtrs[i]->sSectorY)] = DETECTION_RANGE_SCOUT;
|
detectionMap[std::pair<INT16,INT16>(pSoldier->sSectorX, pSoldier->sSectorY)] = DETECTION_RANGE_SCOUT;
|
||||||
}
|
}
|
||||||
else if (HAS_SKILL_TRAIT(MercPtrs[i], RADIO_OPERATOR_NT) && MercPtrs[i]->CanUseRadio(FALSE))
|
else if (HAS_SKILL_TRAIT(pSoldier, RADIO_OPERATOR_NT) && pSoldier->CanUseRadio(FALSE))
|
||||||
{
|
{
|
||||||
detectionMap[std::pair<INT16,INT16>(MercPtrs[i]->sSectorX, MercPtrs[i]->sSectorY)] = DETECTION_RANGE_RADIO;
|
detectionMap[std::pair<INT16,INT16>(pSoldier->sSectorX, pSoldier->sSectorY)] = DETECTION_RANGE_RADIO;
|
||||||
}
|
}
|
||||||
else if (HAS_SKILL_TRAIT(MercPtrs[i], COVERT_NT))
|
else if (HAS_SKILL_TRAIT(pSoldier, COVERT_NT))
|
||||||
{
|
{
|
||||||
if (MercPtrs[i]->bAssignment == GATHERINTEL)
|
if (pSoldier->bAssignment == GATHERINTEL)
|
||||||
{
|
{
|
||||||
detectionMap[std::pair<INT16,INT16>(MercPtrs[i]->sSectorX, MercPtrs[i]->sSectorY)] = DETECTION_RANGE_COVERT;
|
detectionMap[std::pair<INT16,INT16>(pSoldier->sSectorX, pSoldier->sSectorY)] = DETECTION_RANGE_COVERT;
|
||||||
monitoredTowns[GetTownIdForSector(MercPtrs[i]->sSectorX, MercPtrs[i]->sSectorY)] = MonitoredSectorState::Monitored;
|
monitoredTowns[GetTownIdForSector(pSoldier->sSectorX, pSoldier->sSectorY)] = MonitoredSectorState::Monitored;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -446,8 +448,8 @@ void UpdateTransportGroupInventory()
|
|||||||
if (gGameExternalOptions.fStrategicTransportGroupsEnabled == FALSE)
|
if (gGameExternalOptions.fStrategicTransportGroupsEnabled == FALSE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const int firstSlot = gTacticalStatus.Team[ ENEMY_TEAM ].bFirstID;
|
const SoldierID firstSlot = gTacticalStatus.Team[ ENEMY_TEAM ].bFirstID;
|
||||||
const int lastSlot = gTacticalStatus.Team[ ENEMY_TEAM ].bLastID;
|
const SoldierID lastSlot = gTacticalStatus.Team[ ENEMY_TEAM ].bLastID;
|
||||||
const UINT8 progress = CurrentPlayerProgressPercentage();
|
const UINT8 progress = CurrentPlayerProgressPercentage();
|
||||||
|
|
||||||
enum ItemTypes
|
enum ItemTypes
|
||||||
@@ -479,13 +481,14 @@ void UpdateTransportGroupInventory()
|
|||||||
{
|
{
|
||||||
// let's be nice to the player and only drop ammo for guns their mercs have in inventory
|
// let's be nice to the player and only drop ammo for guns their mercs have in inventory
|
||||||
std::set<UINT8> playerCalibres;
|
std::set<UINT8> playerCalibres;
|
||||||
for (INT16 i = gTacticalStatus.Team[OUR_TEAM].bFirstID; i <= gTacticalStatus.Team[OUR_TEAM].bLastID; i++)
|
for ( SoldierID i = gTacticalStatus.Team[OUR_TEAM].bFirstID; i <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++i)
|
||||||
{
|
{
|
||||||
if (MercPtrs[i]->bActive && !(MercPtrs[i]->flags.uiStatusFlags & SOLDIER_VEHICLE))
|
SOLDIERTYPE *pSoldier = i;
|
||||||
|
if (pSoldier->bActive && !(pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE))
|
||||||
{
|
{
|
||||||
for (int j = 0 ; j < MercPtrs[i]->inv.size(); ++j)
|
for (int j = 0 ; j < pSoldier->inv.size(); ++j)
|
||||||
{
|
{
|
||||||
OBJECTTYPE& obj = MercPtrs[i]->inv[j];
|
OBJECTTYPE& obj = pSoldier->inv[j];
|
||||||
if (obj.exists()
|
if (obj.exists()
|
||||||
&& Item[obj.usItem].usItemClass == IC_GUN)
|
&& Item[obj.usItem].usItemClass == IC_GUN)
|
||||||
{
|
{
|
||||||
@@ -599,11 +602,11 @@ void UpdateTransportGroupInventory()
|
|||||||
|
|
||||||
// cache the initial jeep count of every group we find
|
// cache the initial jeep count of every group we find
|
||||||
std::map<UINT8, int> cachedGroupJeepCount;
|
std::map<UINT8, int> cachedGroupJeepCount;
|
||||||
for (int slot = firstSlot; (slot <= lastSlot); ++slot)
|
for ( SoldierID slot = firstSlot; (slot <= lastSlot); ++slot)
|
||||||
{
|
{
|
||||||
SOLDIERTYPE* pSoldier = &Menptr[slot];
|
SOLDIERTYPE* pSoldier = slot;
|
||||||
|
|
||||||
const std::map<UINT8, std::map<int, UINT8>>::iterator groupIter = transportGroupIdToSoldierMap.find(pSoldier->ubGroupID);
|
const std::map<UINT8, std::map<int, UINT16>>::iterator groupIter = transportGroupIdToSoldierMap.find(pSoldier->ubGroupID);
|
||||||
if (groupIter != transportGroupIdToSoldierMap.end())
|
if (groupIter != transportGroupIdToSoldierMap.end())
|
||||||
{
|
{
|
||||||
// let's find out if this group is coming home or still outgoing to its target destination
|
// let's find out if this group is coming home or still outgoing to its target destination
|
||||||
@@ -620,7 +623,7 @@ void UpdateTransportGroupInventory()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// found a matching transport groupid
|
// found a matching transport groupid
|
||||||
std::map<int, UINT8>::iterator soldierClassIter = groupIter->second.find(SOLDIER_CLASS_JEEP);
|
std::map<int, UINT16>::iterator soldierClassIter = groupIter->second.find(SOLDIER_CLASS_JEEP);
|
||||||
if (cachedGroupJeepCount.find(groupIter->first) == cachedGroupJeepCount.end())
|
if (cachedGroupJeepCount.find(groupIter->first) == cachedGroupJeepCount.end())
|
||||||
{
|
{
|
||||||
cachedGroupJeepCount[groupIter->first] = soldierClassIter == groupIter->second.end() ? 0 : groupIter->second[SOLDIER_CLASS_JEEP];
|
cachedGroupJeepCount[groupIter->first] = soldierClassIter == groupIter->second.end() ? 0 : groupIter->second[SOLDIER_CLASS_JEEP];
|
||||||
@@ -874,7 +877,7 @@ void UpdateTransportGroupInventory()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddToTransportGroupMap(UINT8 groupId, int soldierClass, UINT8 amount)
|
void AddToTransportGroupMap(UINT8 groupId, int soldierClass, UINT16 amount)
|
||||||
{
|
{
|
||||||
if (gGameExternalOptions.fStrategicTransportGroupsEnabled == FALSE)
|
if (gGameExternalOptions.fStrategicTransportGroupsEnabled == FALSE)
|
||||||
{
|
{
|
||||||
@@ -913,7 +916,7 @@ void NotifyTransportGroupDefeated()
|
|||||||
AddStrategicEvent(EVENT_TRANSPORT_GROUP_DEFEATED, GetWorldTotalMin() + 60 * hoursToRememberDefeat, 0);
|
AddStrategicEvent(EVENT_TRANSPORT_GROUP_DEFEATED, GetWorldTotalMin() + 60 * hoursToRememberDefeat, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PopulateTransportGroup(UINT8& admins, UINT8& troops, UINT8& elites, UINT8& jeeps, UINT8& tanks, UINT8& robots, UINT8 progress, int difficulty, BOOLEAN trySpecialCase)
|
void PopulateTransportGroup(UINT16& admins, UINT16& troops, UINT16& elites, UINT16& jeeps, UINT16& tanks, UINT16& robots, UINT8 progress, int difficulty, BOOLEAN trySpecialCase)
|
||||||
{
|
{
|
||||||
admins = troops = elites = robots = jeeps = tanks = 0;
|
admins = troops = elites = robots = jeeps = tanks = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ void UpdateTransportGroupInventory();
|
|||||||
|
|
||||||
const std::map<UINT8, TransportGroupSectorInfo> GetTransportGroupSectorInfo();
|
const std::map<UINT8, TransportGroupSectorInfo> GetTransportGroupSectorInfo();
|
||||||
|
|
||||||
void AddToTransportGroupMap(UINT8 groupId, int soldierClass, UINT8 amount);
|
void AddToTransportGroupMap(UINT8 groupId, int soldierClass, UINT16 amount);
|
||||||
void ClearTransportGroupMap();
|
void ClearTransportGroupMap();
|
||||||
|
|
||||||
void NotifyTransportGroupDefeated();
|
void NotifyTransportGroupDefeated();
|
||||||
|
|||||||
+27
-27
@@ -54,7 +54,7 @@ BOOLEAN gfAreWePromotingRegular = FALSE;
|
|||||||
|
|
||||||
|
|
||||||
//the completed list of sector soldiers for training militia
|
//the completed list of sector soldiers for training militia
|
||||||
INT32 giListOfMercsInSectorsCompletedMilitiaTraining[ SIZE_OF_MILITIA_COMPLETED_TRAINING_LIST ];
|
SoldierID giListOfMercsInSectorsCompletedMilitiaTraining[ SIZE_OF_MILITIA_COMPLETED_TRAINING_LIST ];
|
||||||
SOLDIERTYPE *pMilitiaTrainerSoldier = NULL;
|
SOLDIERTYPE *pMilitiaTrainerSoldier = NULL;
|
||||||
|
|
||||||
// note that these sector values are STRATEGIC INDEXES, not 0-255!
|
// note that these sector values are STRATEGIC INDEXES, not 0-255!
|
||||||
@@ -471,7 +471,7 @@ INT8 MilitiaRankToSoldierClass(UINT8 ubRank)
|
|||||||
return(bSoldierClass);
|
return(bSoldierClass);
|
||||||
}
|
}
|
||||||
|
|
||||||
void StrategicAddMilitiaToSector(INT16 sMapX, INT16 sMapY, UINT8 ubRank, UINT8 ubHowMany)
|
void StrategicAddMilitiaToSector(INT16 sMapX, INT16 sMapY, UINT8 ubRank, UINT16 ubHowMany)
|
||||||
{
|
{
|
||||||
SECTORINFO *pSectorInfo = &( SectorInfo[ SECTOR( sMapX, sMapY ) ] );
|
SECTORINFO *pSectorInfo = &( SectorInfo[ SECTOR( sMapX, sMapY ) ] );
|
||||||
|
|
||||||
@@ -486,15 +486,15 @@ void StrategicAddMilitiaToSector(INT16 sMapX, INT16 sMapY, UINT8 ubRank, UINT8 u
|
|||||||
fMapPanelDirty = TRUE;
|
fMapPanelDirty = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void StrategicPromoteMilitiaInSector(INT16 sMapX, INT16 sMapY, UINT8 ubCurrentRank, UINT8 ubHowMany)
|
void StrategicPromoteMilitiaInSector(INT16 sMapX, INT16 sMapY, UINT8 ubCurrentRank, UINT16 ubHowMany)
|
||||||
{
|
{
|
||||||
SECTORINFO *pSectorInfo = &( SectorInfo[ SECTOR( sMapX, sMapY ) ] );
|
SECTORINFO *pSectorInfo = &( SectorInfo[ SECTOR( sMapX, sMapY ) ] );
|
||||||
|
|
||||||
// damn well better have that many around to promote!
|
// damn well better have that many around to promote!
|
||||||
//Assert(pSectorInfo->ubNumberOfCivsAtLevel[ ubCurrentRank ] >= ubHowMany);
|
//Assert(pSectorInfo->ubNumberOfCivsAtLevel[ ubCurrentRank ] >= ubHowMany);
|
||||||
|
|
||||||
UINT8 stationary = MilitiaInSectorOfRankStationary( sMapX, sMapY, ubCurrentRank );
|
UINT16 stationary = MilitiaInSectorOfRankStationary( sMapX, sMapY, ubCurrentRank );
|
||||||
UINT8 ingroups = MilitiaInSectorOfRankInGroups( sMapX, sMapY, ubCurrentRank );
|
UINT16 ingroups = MilitiaInSectorOfRankInGroups( sMapX, sMapY, ubCurrentRank );
|
||||||
|
|
||||||
//KM : July 21, 1999 patch fix
|
//KM : July 21, 1999 patch fix
|
||||||
if ( ubCurrentRank >= ELITE_MILITIA || stationary + ingroups < ubHowMany )
|
if ( ubCurrentRank >= ELITE_MILITIA || stationary + ingroups < ubHowMany )
|
||||||
@@ -503,8 +503,8 @@ void StrategicPromoteMilitiaInSector(INT16 sMapX, INT16 sMapY, UINT8 ubCurrentRa
|
|||||||
}
|
}
|
||||||
|
|
||||||
// determine how many static and - if necessary - group-based militia we have to remove
|
// determine how many static and - if necessary - group-based militia we have to remove
|
||||||
UINT8 reducestatic = min( stationary, ubHowMany );
|
UINT16 reducestatic = min( stationary, ubHowMany );
|
||||||
UINT8 reducegroups = min( ingroups, ubHowMany - reducestatic );
|
UINT16 reducegroups = min( ingroups, ubHowMany - reducestatic );
|
||||||
|
|
||||||
pSectorInfo->ubNumberOfCivsAtLevel[ubCurrentRank] -= reducestatic;
|
pSectorInfo->ubNumberOfCivsAtLevel[ubCurrentRank] -= reducestatic;
|
||||||
pSectorInfo->ubNumberOfCivsAtLevel[ubCurrentRank + 1] += reducestatic;
|
pSectorInfo->ubNumberOfCivsAtLevel[ubCurrentRank + 1] += reducestatic;
|
||||||
@@ -541,7 +541,7 @@ void StrategicPromoteMilitiaInSector(INT16 sMapX, INT16 sMapY, UINT8 ubCurrentRa
|
|||||||
fMapPanelDirty = TRUE;
|
fMapPanelDirty = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void StrategicRemoveMilitiaFromSector(INT16 sMapX, INT16 sMapY, UINT8 ubRank, UINT8 ubHowMany)
|
void StrategicRemoveMilitiaFromSector(INT16 sMapX, INT16 sMapY, UINT8 ubRank, UINT16 ubHowMany)
|
||||||
{
|
{
|
||||||
SECTORINFO *pSectorInfo = &( SectorInfo[ SECTOR( sMapX, sMapY ) ] );
|
SECTORINFO *pSectorInfo = &( SectorInfo[ SECTOR( sMapX, sMapY ) ] );
|
||||||
|
|
||||||
@@ -549,8 +549,8 @@ void StrategicRemoveMilitiaFromSector(INT16 sMapX, INT16 sMapY, UINT8 ubRank, UI
|
|||||||
// damn well better have that many around to remove!
|
// damn well better have that many around to remove!
|
||||||
//Assert(pSectorInfo->ubNumberOfCivsAtLevel[ ubRank ] >= ubHowMany);
|
//Assert(pSectorInfo->ubNumberOfCivsAtLevel[ ubRank ] >= ubHowMany);
|
||||||
|
|
||||||
UINT8 stationary = MilitiaInSectorOfRankStationary( sMapX, sMapY, ubRank );
|
UINT16 stationary = MilitiaInSectorOfRankStationary( sMapX, sMapY, ubRank );
|
||||||
UINT8 ingroups = MilitiaInSectorOfRankInGroups( sMapX, sMapY, ubRank );
|
UINT16 ingroups = MilitiaInSectorOfRankInGroups( sMapX, sMapY, ubRank );
|
||||||
|
|
||||||
//KM : July 21, 1999 patch fix
|
//KM : July 21, 1999 patch fix
|
||||||
if ( stationary + ingroups < ubHowMany )
|
if ( stationary + ingroups < ubHowMany )
|
||||||
@@ -559,8 +559,8 @@ void StrategicRemoveMilitiaFromSector(INT16 sMapX, INT16 sMapY, UINT8 ubRank, UI
|
|||||||
}
|
}
|
||||||
|
|
||||||
// determine how many static and - if necessary - group-based militia we have to remove
|
// determine how many static and - if necessary - group-based militia we have to remove
|
||||||
UINT8 reducestatic = min( stationary, ubHowMany );
|
UINT16 reducestatic = min( stationary, ubHowMany );
|
||||||
UINT8 reducegroups = min( ingroups, ubHowMany - reducestatic );
|
UINT16 reducegroups = min( ingroups, ubHowMany - reducestatic );
|
||||||
|
|
||||||
pSectorInfo->ubNumberOfCivsAtLevel[ubRank] -= reducestatic;
|
pSectorInfo->ubNumberOfCivsAtLevel[ubRank] -= reducestatic;
|
||||||
|
|
||||||
@@ -571,21 +571,21 @@ void StrategicRemoveMilitiaFromSector(INT16 sMapX, INT16 sMapY, UINT8 ubRank, UI
|
|||||||
{
|
{
|
||||||
if ( ubRank == GREEN_MILITIA )
|
if ( ubRank == GREEN_MILITIA )
|
||||||
{
|
{
|
||||||
UINT8 reduced = min( reducegroups, pGroup->pEnemyGroup->ubNumAdmins );
|
UINT16 reduced = min( reducegroups, pGroup->pEnemyGroup->ubNumAdmins );
|
||||||
pGroup->pEnemyGroup->ubNumAdmins -= reduced;
|
pGroup->pEnemyGroup->ubNumAdmins -= reduced;
|
||||||
pGroup->ubGroupSize -= reduced;
|
pGroup->ubGroupSize -= reduced;
|
||||||
reducegroups -= reduced;
|
reducegroups -= reduced;
|
||||||
}
|
}
|
||||||
else if ( ubRank == REGULAR_MILITIA )
|
else if ( ubRank == REGULAR_MILITIA )
|
||||||
{
|
{
|
||||||
UINT8 reduced = min( reducegroups, pGroup->pEnemyGroup->ubNumTroops );
|
UINT16 reduced = min( reducegroups, pGroup->pEnemyGroup->ubNumTroops );
|
||||||
pGroup->pEnemyGroup->ubNumTroops -= reduced;
|
pGroup->pEnemyGroup->ubNumTroops -= reduced;
|
||||||
pGroup->ubGroupSize -= reduced;
|
pGroup->ubGroupSize -= reduced;
|
||||||
reducegroups -= reduced;
|
reducegroups -= reduced;
|
||||||
}
|
}
|
||||||
else if ( ubRank == ELITE_MILITIA )
|
else if ( ubRank == ELITE_MILITIA )
|
||||||
{
|
{
|
||||||
UINT8 reduced = min( reducegroups, pGroup->pEnemyGroup->ubNumElites );
|
UINT16 reduced = min( reducegroups, pGroup->pEnemyGroup->ubNumElites );
|
||||||
pGroup->pEnemyGroup->ubNumElites -= reduced;
|
pGroup->pEnemyGroup->ubNumElites -= reduced;
|
||||||
pGroup->ubGroupSize -= reduced;
|
pGroup->ubGroupSize -= reduced;
|
||||||
reducegroups -= reduced;
|
reducegroups -= reduced;
|
||||||
@@ -705,12 +705,12 @@ void HandleMilitiaDefections(INT16 sMapX, INT16 sMapY)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT8 MilitiaInSectorOfRank(INT16 sMapX, INT16 sMapY, UINT8 ubRank)
|
UINT16 MilitiaInSectorOfRank(INT16 sMapX, INT16 sMapY, UINT8 ubRank)
|
||||||
{
|
{
|
||||||
return MilitiaInSectorOfRankStationary( sMapX, sMapY, ubRank ) + MilitiaInSectorOfRankInGroups( sMapX, sMapY, ubRank );
|
return MilitiaInSectorOfRankStationary( sMapX, sMapY, ubRank ) + MilitiaInSectorOfRankInGroups( sMapX, sMapY, ubRank );
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT8 MilitiaInSectorOfRankStationary( INT16 sMapX, INT16 sMapY, UINT8 ubRank )
|
UINT16 MilitiaInSectorOfRankStationary( INT16 sMapX, INT16 sMapY, UINT8 ubRank )
|
||||||
{
|
{
|
||||||
if ( ubRank < MAX_MILITIA_LEVELS )
|
if ( ubRank < MAX_MILITIA_LEVELS )
|
||||||
return SectorInfo[SECTOR( sMapX, sMapY )].ubNumberOfCivsAtLevel[ubRank];
|
return SectorInfo[SECTOR( sMapX, sMapY )].ubNumberOfCivsAtLevel[ubRank];
|
||||||
@@ -718,9 +718,9 @@ UINT8 MilitiaInSectorOfRankStationary( INT16 sMapX, INT16 sMapY, UINT8 ubRank )
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT8 MilitiaInSectorOfRankInGroups( INT16 sMapX, INT16 sMapY, UINT8 ubRank )
|
UINT16 MilitiaInSectorOfRankInGroups( INT16 sMapX, INT16 sMapY, UINT8 ubRank )
|
||||||
{
|
{
|
||||||
UINT8 count = 0;
|
UINT16 count = 0;
|
||||||
|
|
||||||
GROUP *pGroup = gpGroupList;
|
GROUP *pGroup = gpGroupList;
|
||||||
while ( pGroup )
|
while ( pGroup )
|
||||||
@@ -1379,7 +1379,7 @@ void HandleCompletionOfTownTrainingByGroupWithTrainer( SOLDIERTYPE *pTrainer, UI
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
pSoldier = &Menptr[ gCharactersList[ iCounter ].usSolID ];
|
pSoldier = gCharactersList[ iCounter ].usSolID;
|
||||||
|
|
||||||
// valid soldier?
|
// valid soldier?
|
||||||
if( pSoldier->bActive == FALSE )
|
if( pSoldier->bActive == FALSE )
|
||||||
@@ -1421,10 +1421,10 @@ void AddSectorForSoldierToListOfSectorsThatCompletedMilitiaTraining( SOLDIERTYPE
|
|||||||
// get the sector value
|
// get the sector value
|
||||||
sSector = pSoldier->sSectorX + pSoldier->sSectorY * MAP_WORLD_X;
|
sSector = pSoldier->sSectorX + pSoldier->sSectorY * MAP_WORLD_X;
|
||||||
|
|
||||||
while( giListOfMercsInSectorsCompletedMilitiaTraining[ iCounter ] != -1 )
|
while( giListOfMercsInSectorsCompletedMilitiaTraining[ iCounter ] != NOBODY )
|
||||||
{
|
{
|
||||||
// get the current soldier
|
// get the current soldier
|
||||||
pCurrentSoldier = &Menptr[ giListOfMercsInSectorsCompletedMilitiaTraining[ iCounter ] ];
|
pCurrentSoldier = giListOfMercsInSectorsCompletedMilitiaTraining[ iCounter ];
|
||||||
|
|
||||||
// get the current sector value
|
// get the current sector value
|
||||||
sCurrentSector = CALCULATE_STRATEGIC_INDEX( pCurrentSoldier->sSectorX, pCurrentSoldier->sSectorY );
|
sCurrentSector = CALCULATE_STRATEGIC_INDEX( pCurrentSoldier->sSectorX, pCurrentSoldier->sSectorY );
|
||||||
@@ -1455,7 +1455,7 @@ void ClearSectorListForCompletedTrainingOfMilitia( void )
|
|||||||
|
|
||||||
for( iCounter = 0; iCounter < SIZE_OF_MILITIA_COMPLETED_TRAINING_LIST; iCounter++ )
|
for( iCounter = 0; iCounter < SIZE_OF_MILITIA_COMPLETED_TRAINING_LIST; iCounter++ )
|
||||||
{
|
{
|
||||||
giListOfMercsInSectorsCompletedMilitiaTraining[ iCounter ] = -1;
|
giListOfMercsInSectorsCompletedMilitiaTraining[ iCounter ] = NOBODY;
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -1469,10 +1469,10 @@ void HandleContinueOfTownTraining( void )
|
|||||||
BOOLEAN fContinueEventPosted = FALSE;
|
BOOLEAN fContinueEventPosted = FALSE;
|
||||||
|
|
||||||
|
|
||||||
while( giListOfMercsInSectorsCompletedMilitiaTraining[ iCounter ] != -1 )
|
while( giListOfMercsInSectorsCompletedMilitiaTraining[ iCounter ] != NOBODY )
|
||||||
{
|
{
|
||||||
// get the soldier
|
// get the soldier
|
||||||
pSoldier = &Menptr[ giListOfMercsInSectorsCompletedMilitiaTraining[ iCounter ] ];
|
pSoldier = giListOfMercsInSectorsCompletedMilitiaTraining[ iCounter ];
|
||||||
|
|
||||||
if( pSoldier->bActive )
|
if( pSoldier->bActive )
|
||||||
{
|
{
|
||||||
@@ -1532,7 +1532,7 @@ void BuildListOfUnpaidTrainableSectors( UINT8 ubMilitiaType )
|
|||||||
// selected?
|
// selected?
|
||||||
if( ( fSelectedListOfMercsForMapScreen[ iCounter ] == TRUE ) || ( iCounter == bSelectedAssignChar ) )
|
if( ( fSelectedListOfMercsForMapScreen[ iCounter ] == TRUE ) || ( iCounter == bSelectedAssignChar ) )
|
||||||
{
|
{
|
||||||
pSoldier = &Menptr[ gCharactersList[ iCounter ].usSolID ];
|
pSoldier = gCharactersList[ iCounter ].usSolID;
|
||||||
|
|
||||||
// HEADROCK HAM 3.6: Two different conditions depending on the type of militia being trained.
|
// HEADROCK HAM 3.6: Two different conditions depending on the type of militia being trained.
|
||||||
if( ubMilitiaType == TOWN_MILITIA )
|
if( ubMilitiaType == TOWN_MILITIA )
|
||||||
@@ -1552,7 +1552,7 @@ void BuildListOfUnpaidTrainableSectors( UINT8 ubMilitiaType )
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// handle for tactical
|
// handle for tactical
|
||||||
pSoldier = &Menptr[ gusUIFullTargetID ];
|
pSoldier = gusUIFullTargetID;
|
||||||
iCounter = 0;
|
iCounter = 0;
|
||||||
|
|
||||||
if (ubMilitiaType == TOWN_MILITIA)
|
if (ubMilitiaType == TOWN_MILITIA)
|
||||||
|
|||||||
@@ -30,9 +30,9 @@ INT8 SoldierClassToMilitiaRank(UINT8 ubSoldierClass);
|
|||||||
INT8 MilitiaRankToSoldierClass(UINT8 ubRank);
|
INT8 MilitiaRankToSoldierClass(UINT8 ubRank);
|
||||||
|
|
||||||
// these add, promote, and remove militias of a certain rank
|
// these add, promote, and remove militias of a certain rank
|
||||||
void StrategicAddMilitiaToSector(INT16 sMapX, INT16 sMapY, UINT8 ubRank, UINT8 ubHowMany);
|
void StrategicAddMilitiaToSector(INT16 sMapX, INT16 sMapY, UINT8 ubRank, UINT16 ubHowMany);
|
||||||
void StrategicPromoteMilitiaInSector(INT16 sMapX, INT16 sMapY, UINT8 ubCurrentRank, UINT8 ubHowMany);
|
void StrategicPromoteMilitiaInSector(INT16 sMapX, INT16 sMapY, UINT8 ubCurrentRank, UINT16 ubHowMany);
|
||||||
void StrategicRemoveMilitiaFromSector(INT16 sMapX, INT16 sMapY, UINT8 ubRank, UINT8 ubHowMany);
|
void StrategicRemoveMilitiaFromSector(INT16 sMapX, INT16 sMapY, UINT8 ubRank, UINT16 ubHowMany);
|
||||||
|
|
||||||
void StrategicRemoveAllStaticMilitiaFromSector( INT16 sMapX, INT16 sMapY, UINT8 ubRank );
|
void StrategicRemoveAllStaticMilitiaFromSector( INT16 sMapX, INT16 sMapY, UINT8 ubRank );
|
||||||
|
|
||||||
@@ -49,9 +49,9 @@ UINT8 FindBestMilitiaTrainingLeadershipInSector ( INT16 sMapX, INT16 sMapY, INT8
|
|||||||
// call this if the player attacks his own militia
|
// call this if the player attacks his own militia
|
||||||
void HandleMilitiaDefections(INT16 sMapX, INT16 sMapY);
|
void HandleMilitiaDefections(INT16 sMapX, INT16 sMapY);
|
||||||
|
|
||||||
UINT8 MilitiaInSectorOfRank(INT16 sMapX, INT16 sMapY, UINT8 ubRank);
|
UINT16 MilitiaInSectorOfRank(INT16 sMapX, INT16 sMapY, UINT8 ubRank);
|
||||||
UINT8 MilitiaInSectorOfRankStationary( INT16 sMapX, INT16 sMapY, UINT8 ubRank );
|
UINT16 MilitiaInSectorOfRankStationary( INT16 sMapX, INT16 sMapY, UINT8 ubRank );
|
||||||
UINT8 MilitiaInSectorOfRankInGroups( INT16 sMapX, INT16 sMapY, UINT8 ubRank );
|
UINT16 MilitiaInSectorOfRankInGroups( INT16 sMapX, INT16 sMapY, UINT8 ubRank );
|
||||||
|
|
||||||
// Returns TRUE if sector is under player control, has no enemies in it, and isn't currently in combat mode
|
// Returns TRUE if sector is under player control, has no enemies in it, and isn't currently in combat mode
|
||||||
BOOLEAN SectorOursAndPeaceful( INT16 sMapX, INT16 sMapY, INT8 bMapZ );
|
BOOLEAN SectorOursAndPeaceful( INT16 sMapX, INT16 sMapY, INT8 bMapZ );
|
||||||
@@ -135,4 +135,4 @@ FLOAT GetIntel();
|
|||||||
void AddRaidPersonnel( INT32 aBloodcats, INT32 aZombie, INT32 aBandits );
|
void AddRaidPersonnel( INT32 aBloodcats, INT32 aZombie, INT32 aBandits );
|
||||||
void GetRaidPersonnel( INT32& arBloodcats, INT32& arZombie, INT32& arBandits );
|
void GetRaidPersonnel( INT32& arBloodcats, INT32& arZombie, INT32& arBandits );
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ extern "C" {
|
|||||||
#include "connect.h"
|
#include "connect.h"
|
||||||
|
|
||||||
// externals
|
// externals
|
||||||
UNDERGROUND_SECTORINFO* NewUndergroundNode( UINT8 ubSectorX, UINT8 ubSectorY, UINT8 ubSectorZ );
|
extern UNDERGROUND_SECTORINFO* NewUndergroundNode( UINT8 ubSectorX, UINT8 ubSectorY, UINT8 ubSectorZ );
|
||||||
extern BOOLEAN gfGettingNameFromSaveLoadScreen;
|
extern BOOLEAN gfGettingNameFromSaveLoadScreen;
|
||||||
|
|
||||||
// helper functions
|
// helper functions
|
||||||
@@ -49,6 +49,21 @@ bool LuaTable::getValue<UINT8>(const char * index, UINT8& value)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <>
|
||||||
|
bool LuaTable::getValue<UINT16>(const char* index, UINT16& value)
|
||||||
|
{
|
||||||
|
int dummy;
|
||||||
|
|
||||||
|
bool b = getValue(index, dummy);
|
||||||
|
if (b)
|
||||||
|
{
|
||||||
|
value = static_cast<UINT16>(dummy);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Calls into Lua script to let build underground sector list.
|
// Calls into Lua script to let build underground sector list.
|
||||||
BOOLEAN LuaUnderground::InitializeSectorList()
|
BOOLEAN LuaUnderground::InitializeSectorList()
|
||||||
{
|
{
|
||||||
|
|||||||
+412
-302
File diff suppressed because it is too large
Load Diff
+10
-6
@@ -123,6 +123,8 @@ struct UILayout_CharList
|
|||||||
int widthTimeRemaining;
|
int widthTimeRemaining;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extern MOUSE_REGION gMapViewRegion;
|
||||||
|
|
||||||
extern BOOLEAN fCharacterInfoPanelDirty;
|
extern BOOLEAN fCharacterInfoPanelDirty;
|
||||||
extern BOOLEAN fTeamPanelDirty;
|
extern BOOLEAN fTeamPanelDirty;
|
||||||
extern BOOLEAN fMapPanelDirty;
|
extern BOOLEAN fMapPanelDirty;
|
||||||
@@ -134,8 +136,10 @@ extern BOOLEAN gfInChangeArrivalSectorMode;
|
|||||||
|
|
||||||
extern BOOLEAN gfSkyriderEmptyHelpGiven;
|
extern BOOLEAN gfSkyriderEmptyHelpGiven;
|
||||||
|
|
||||||
|
extern std::vector<SOLDIERTYPE*> gSelectedSoldiers;
|
||||||
|
|
||||||
BOOLEAN SetInfoChar(UINT8 ubSolId);
|
|
||||||
|
BOOLEAN SetInfoChar(SoldierID ubID);
|
||||||
void EndMapScreen( BOOLEAN fDuringFade );
|
void EndMapScreen( BOOLEAN fDuringFade );
|
||||||
void ReBuildCharactersList( void );
|
void ReBuildCharactersList( void );
|
||||||
|
|
||||||
@@ -148,11 +152,11 @@ void ChangeSelectedMapSector( INT16 sMapX, INT16 sMapY, INT8 bMapZ );
|
|||||||
|
|
||||||
BOOLEAN CanToggleSelectedCharInventory( void );
|
BOOLEAN CanToggleSelectedCharInventory( void );
|
||||||
|
|
||||||
BOOLEAN CanExtendContractForCharSlot( INT8 bCharNumber );
|
BOOLEAN CanExtendContractForCharSlot( INT16 bCharNumber );
|
||||||
|
|
||||||
void TellPlayerWhyHeCantCompressTime( void );
|
void TellPlayerWhyHeCantCompressTime( void );
|
||||||
|
|
||||||
void ChangeSelectedInfoChar( INT8 bCharNumber, BOOLEAN fResetSelectedList );
|
void ChangeSelectedInfoChar( INT16 bCharNumber, BOOLEAN fResetSelectedList );
|
||||||
|
|
||||||
void MAPEndItemPointer();
|
void MAPEndItemPointer();
|
||||||
|
|
||||||
@@ -166,10 +170,10 @@ void CancelChangeArrivalSectorMode( void );
|
|||||||
|
|
||||||
void ExplainWhySkyriderCantFly( void );
|
void ExplainWhySkyriderCantFly( void );
|
||||||
|
|
||||||
BOOLEAN CanChangeSleepStatusForCharSlot( INT8 bCharNumber );
|
BOOLEAN CanChangeSleepStatusForCharSlot( INT16 bCharNumber );
|
||||||
BOOLEAN CanChangeSleepStatusForSoldier( SOLDIERTYPE *pSoldier );
|
BOOLEAN CanChangeSleepStatusForSoldier( SOLDIERTYPE *pSoldier );
|
||||||
|
|
||||||
BOOLEAN MapCharacterHasAccessibleInventory( INT8 bCharNumber );
|
BOOLEAN MapCharacterHasAccessibleInventory( INT16 bCharNumber );
|
||||||
|
|
||||||
// CHRISL: New functions to handle initialization of inventory coordinates
|
// CHRISL: New functions to handle initialization of inventory coordinates
|
||||||
BOOLEAN InitializeInvPanelCoordsOld( );
|
BOOLEAN InitializeInvPanelCoordsOld( );
|
||||||
@@ -228,4 +232,4 @@ void RetreatBandageCallback( UINT8 ubResult );
|
|||||||
|
|
||||||
bool isWidescreenUI(void);
|
bool isWidescreenUI(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -101,16 +101,16 @@ BOOLEAN HandleStrategicDeath( SOLDIERTYPE *pSoldier )
|
|||||||
|
|
||||||
void HandleSoldierDeadComments( SOLDIERTYPE *pSoldier )
|
void HandleSoldierDeadComments( SOLDIERTYPE *pSoldier )
|
||||||
{
|
{
|
||||||
INT32 cnt = 0;
|
|
||||||
SOLDIERTYPE *pTeamSoldier;
|
SOLDIERTYPE *pTeamSoldier;
|
||||||
INT8 bBuddyIndex;
|
INT8 bBuddyIndex;
|
||||||
|
|
||||||
// IF IT'S THE SELECTED GUY, MAKE ANOTHER SELECTED!
|
// IF IT'S THE SELECTED GUY, MAKE ANOTHER SELECTED!
|
||||||
cnt = gTacticalStatus.Team[ pSoldier->bTeam ].bFirstID;
|
SoldierID cnt = gTacticalStatus.Team[ pSoldier->bTeam ].bFirstID;
|
||||||
|
|
||||||
// see if this was the friend of a living merc
|
// see if this was the friend of a living merc
|
||||||
for ( pTeamSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ pSoldier->bTeam ].bLastID; cnt++,pTeamSoldier++)
|
for ( ; cnt <= gTacticalStatus.Team[ pSoldier->bTeam ].bLastID; ++cnt )
|
||||||
{
|
{
|
||||||
|
pTeamSoldier = cnt;
|
||||||
if ( pTeamSoldier->stats.bLife >= OKLIFE && pTeamSoldier->bActive )
|
if ( pTeamSoldier->stats.bLife >= OKLIFE && pTeamSoldier->bActive )
|
||||||
{
|
{
|
||||||
bBuddyIndex = WhichBuddy( pTeamSoldier->ubProfile, pSoldier->ubProfile );
|
bBuddyIndex = WhichBuddy( pTeamSoldier->ubProfile, pSoldier->ubProfile );
|
||||||
|
|||||||
+90
-75
@@ -184,8 +184,8 @@ BOOLEAN fUsingEdgePointsForStrategicEntry = FALSE;
|
|||||||
BOOLEAN gfInvalidTraversal = FALSE;
|
BOOLEAN gfInvalidTraversal = FALSE;
|
||||||
BOOLEAN gfLoneEPCAttemptingTraversal = FALSE;
|
BOOLEAN gfLoneEPCAttemptingTraversal = FALSE;
|
||||||
BOOLEAN gfRobotWithoutControllerAttemptingTraversal = FALSE;
|
BOOLEAN gfRobotWithoutControllerAttemptingTraversal = FALSE;
|
||||||
BOOLEAN gubLoneMercAttemptingToAbandonEPCs = 0;
|
BOOLEAN gubLoneMercAttemptingToAbandonEPCs = 0;
|
||||||
INT8 gbPotentiallyAbandonedEPCSlotID = -1;
|
SoldierID gbPotentiallyAbandonedEPCSlotID = NOBODY;
|
||||||
|
|
||||||
INT8 gbGreenToElitePromotions = 0;
|
INT8 gbGreenToElitePromotions = 0;
|
||||||
INT8 gbGreenToRegPromotions = 0;
|
INT8 gbGreenToRegPromotions = 0;
|
||||||
@@ -1976,7 +1976,7 @@ void GetCurrentWorldSector( INT16 *psMapX, INT16 *psMapY )
|
|||||||
}
|
}
|
||||||
|
|
||||||
//not in overhead.h!
|
//not in overhead.h!
|
||||||
extern UINT8 NumEnemyInSector( );
|
extern UINT16 NumEnemyInSector( );
|
||||||
|
|
||||||
void HandleRPCDescriptionOfSector( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ )
|
void HandleRPCDescriptionOfSector( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ )
|
||||||
{
|
{
|
||||||
@@ -2140,10 +2140,12 @@ BOOLEAN SetCurrentWorldSector( INT16 sMapX, INT16 sMapY, INT8 bMapZ )
|
|||||||
// GridNo = NOWHERE, which causes this assertion to fail
|
// GridNo = NOWHERE, which causes this assertion to fail
|
||||||
//CHRISL: There's also an issue with vehicles. Soldiers in any vehicle are considered to be in sGridNo = NOWHERE
|
//CHRISL: There's also an issue with vehicles. Soldiers in any vehicle are considered to be in sGridNo = NOWHERE
|
||||||
// This will result in an assertion error, so let's skip the assertion if the merc is assigned to a vehicle
|
// This will result in an assertion error, so let's skip the assertion if the merc is assigned to a vehicle
|
||||||
if (!(MercPtrs[i]->flags.uiStatusFlags & SOLDIER_DEAD) && MercPtrs[i]->bAssignment != VEHICLE && !SPY_LOCATION(MercPtrs[i]->bAssignment) && MercPtrs[i]->bAssignment != ASSIGNMENT_POW)
|
SOLDIERTYPE *pSoldier = MercPtrs[i];
|
||||||
|
|
||||||
|
if (!(pSoldier->flags.uiStatusFlags & SOLDIER_DEAD) && pSoldier->bAssignment != VEHICLE && !SPY_LOCATION(pSoldier->bAssignment) && pSoldier->bAssignment != ASSIGNMENT_POW)
|
||||||
{
|
{
|
||||||
//Assert( !MercPtrs[i]->bActive || !MercPtrs[i]->bInSector || MercPtrs[i]->sGridNo != NOWHERE || MercPtrs[i]->bVehicleID == iHelicopterVehicleId );
|
//Assert( !pSoldier->bActive || !pSoldier->bInSector || pSoldier->sGridNo != NOWHERE || pSoldier->bVehicleID == iHelicopterVehicleId );
|
||||||
Assert( !MercPtrs[i]->bActive || !MercPtrs[i]->bInSector || !TileIsOutOfBounds( MercPtrs[i]->sGridNo ) || MercPtrs[i]->bVehicleID == iHelicopterVehicleId );
|
Assert( !pSoldier->bActive || !pSoldier->bInSector || !TileIsOutOfBounds( pSoldier->sGridNo ) || pSoldier->bVehicleID == iHelicopterVehicleId );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2190,10 +2192,11 @@ BOOLEAN SetCurrentWorldSector( INT16 sMapX, INT16 sMapY, INT8 bMapZ )
|
|||||||
// GridNo = NOWHERE, which causes this assertion to fail
|
// GridNo = NOWHERE, which causes this assertion to fail
|
||||||
//CHRISL: There's also an issue with vehicles. Soldiers in any vehicle are considered to be in sGridNo = NOWHERE
|
//CHRISL: There's also an issue with vehicles. Soldiers in any vehicle are considered to be in sGridNo = NOWHERE
|
||||||
// This will result in an assertion error, so let's skip the assertion if the merc is assigned to a vehicle
|
// This will result in an assertion error, so let's skip the assertion if the merc is assigned to a vehicle
|
||||||
if (!(MercPtrs[i]->flags.uiStatusFlags & SOLDIER_DEAD) && MercPtrs[i]->bAssignment != VEHICLE && MercPtrs[i]->bAssignment != ASSIGNMENT_POW)
|
SOLDIERTYPE *pSoldier = MercPtrs[i];
|
||||||
|
if (!(pSoldier->flags.uiStatusFlags & SOLDIER_DEAD) && pSoldier->bAssignment != VEHICLE && pSoldier->bAssignment != ASSIGNMENT_POW)
|
||||||
{
|
{
|
||||||
//Assert( !MercPtrs[i]->bActive || !MercPtrs[i]->bInSector || MercPtrs[i]->sGridNo != NOWHERE || MercPtrs[i]->bVehicleID == iHelicopterVehicleId );
|
//Assert( !pSoldier->bActive || !pSoldier->bInSector || pSoldier->sGridNo != NOWHERE || pSoldier->bVehicleID == iHelicopterVehicleId );
|
||||||
Assert( !MercPtrs[i]->bActive || !MercPtrs[i]->bInSector || !TileIsOutOfBounds( MercPtrs[i]->sGridNo ) || MercPtrs[i]->bVehicleID == iHelicopterVehicleId );
|
Assert( !pSoldier->bActive || !pSoldier->bInSector || !TileIsOutOfBounds( pSoldier->sGridNo ) || pSoldier->bVehicleID == iHelicopterVehicleId );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2426,15 +2429,15 @@ BOOLEAN MapExists( UINT8 * szFilename )
|
|||||||
|
|
||||||
void RemoveMercsInSector( )
|
void RemoveMercsInSector( )
|
||||||
{
|
{
|
||||||
INT32 cnt;
|
|
||||||
SOLDIERTYPE *pSoldier;
|
SOLDIERTYPE *pSoldier;
|
||||||
|
|
||||||
// IF IT'S THE SELECTED GUY, MAKE ANOTHER SELECTED!
|
// IF IT'S THE SELECTED GUY, MAKE ANOTHER SELECTED!
|
||||||
cnt = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
SoldierID cnt = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||||
|
|
||||||
// ATE: only for OUR guys.. the rest is taken care of in TrashWorld() when a new sector is added...
|
// ATE: only for OUR guys.. the rest is taken care of in TrashWorld() when a new sector is added...
|
||||||
for ( pSoldier = MercPtrs[cnt]; cnt <= gTacticalStatus.Team[gbPlayerNum].bLastID; cnt++, pSoldier++ )
|
for ( ; cnt <= gTacticalStatus.Team[gbPlayerNum].bLastID; ++cnt )
|
||||||
{
|
{
|
||||||
|
pSoldier = cnt;
|
||||||
if ( pSoldier->bActive )
|
if ( pSoldier->bActive )
|
||||||
{
|
{
|
||||||
pSoldier->RemoveSoldierFromGridNo( );
|
pSoldier->RemoveSoldierFromGridNo( );
|
||||||
@@ -2695,7 +2698,6 @@ void HandleQuestCodeOnSectorEntry( INT16 sNewSectorX, INT16 sNewSectorY, INT8 bN
|
|||||||
//UINT8 ubRandomMiner[RANDOM_HEAD_MINERS] = { 106, 156, 157, 158 };
|
//UINT8 ubRandomMiner[RANDOM_HEAD_MINERS] = { 106, 156, 157, 158 };
|
||||||
//UINT8 ubMiner, ubMinersPlaced, ubMine;
|
//UINT8 ubMiner, ubMinersPlaced, ubMine;
|
||||||
UINT8 ubThisMine;
|
UINT8 ubThisMine;
|
||||||
UINT8 cnt;
|
|
||||||
SOLDIERTYPE * pSoldier;
|
SOLDIERTYPE * pSoldier;
|
||||||
|
|
||||||
// are we in a mine sector, on the surface?
|
// are we in a mine sector, on the surface?
|
||||||
@@ -2780,13 +2782,13 @@ void HandleQuestCodeOnSectorEntry( INT16 sNewSectorX, INT16 sNewSectorY, INT8 bN
|
|||||||
|
|
||||||
// Check to see if any player merc has the Chalice; if so,
|
// Check to see if any player merc has the Chalice; if so,
|
||||||
// note it as stolen
|
// note it as stolen
|
||||||
cnt = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
SoldierID cnt = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||||
|
|
||||||
for ( pSoldier = MercPtrs[cnt]; cnt <= gTacticalStatus.Team[gbPlayerNum].bLastID; ++cnt, pSoldier++ )
|
for ( ; cnt <= gTacticalStatus.Team[gbPlayerNum].bLastID; ++cnt )
|
||||||
{
|
{
|
||||||
if ( pSoldier->bActive )
|
if ( cnt->bActive )
|
||||||
{
|
{
|
||||||
if ( FindObj( pSoldier, CHALICE ) != ITEM_NOT_FOUND )
|
if ( FindObj( cnt, CHALICE ) != ITEM_NOT_FOUND )
|
||||||
{
|
{
|
||||||
SetFactTrue( FACT_CHALICE_STOLEN );
|
SetFactTrue( FACT_CHALICE_STOLEN );
|
||||||
}
|
}
|
||||||
@@ -2948,7 +2950,6 @@ extern void SetLastTimePlayerWasInSector( );
|
|||||||
// @calls SetLastTimePlayerWasInSector
|
// @calls SetLastTimePlayerWasInSector
|
||||||
BOOLEAN EnterSector( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ )
|
BOOLEAN EnterSector( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ )
|
||||||
{
|
{
|
||||||
INT32 i;
|
|
||||||
UNDERGROUND_SECTORINFO *pNode = NULL;
|
UNDERGROUND_SECTORINFO *pNode = NULL;
|
||||||
CHAR8 bFilename[50];
|
CHAR8 bFilename[50];
|
||||||
|
|
||||||
@@ -2965,11 +2966,12 @@ BOOLEAN EnterSector( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ )
|
|||||||
//@@@Evaluate
|
//@@@Evaluate
|
||||||
if ( gfWorldLoaded )
|
if ( gfWorldLoaded )
|
||||||
{
|
{
|
||||||
for ( i = gTacticalStatus.Team[CIV_TEAM].bFirstID; i <= gTacticalStatus.Team[CIV_TEAM].bLastID; i++ )
|
for ( SoldierID i = gTacticalStatus.Team[CIV_TEAM].bFirstID; i <= gTacticalStatus.Team[CIV_TEAM].bLastID; ++i )
|
||||||
{
|
{
|
||||||
if ( MercPtrs[i]->bActive && MercPtrs[i]->bInSector )
|
SOLDIERTYPE *pSoldier = i;
|
||||||
|
if ( pSoldier->bActive && pSoldier->bInSector )
|
||||||
{
|
{
|
||||||
SetupProfileInsertionDataForSoldier( MercPtrs[i] );
|
SetupProfileInsertionDataForSoldier( pSoldier );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2994,6 +2996,15 @@ BOOLEAN EnterSector( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ )
|
|||||||
|
|
||||||
#ifdef JA2UB
|
#ifdef JA2UB
|
||||||
//Ja25 No meanwhiles
|
//Ja25 No meanwhiles
|
||||||
|
// But DO check if powergen fan sound needs to be restarted
|
||||||
|
extern UINT32 SECTOR_FAN_X;
|
||||||
|
extern UINT32 SECTOR_FAN_Y;
|
||||||
|
extern UINT32 SECTOR_FAN_Z;
|
||||||
|
|
||||||
|
if (gWorldSectorX == SECTOR_FAN_X && gWorldSectorY == SECTOR_FAN_Y && gbWorldSectorZ == SECTOR_FAN_Z)
|
||||||
|
{
|
||||||
|
HandlePowerGenFanSoundModification();
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
if ( AreInMeanwhile( ) == FALSE )
|
if ( AreInMeanwhile( ) == FALSE )
|
||||||
#endif
|
#endif
|
||||||
@@ -3095,7 +3106,6 @@ BOOLEAN EnterSector( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ )
|
|||||||
|
|
||||||
void UpdateMercsInSector( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ )
|
void UpdateMercsInSector( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ )
|
||||||
{
|
{
|
||||||
INT32 cnt;
|
|
||||||
SOLDIERTYPE *pSoldier;
|
SOLDIERTYPE *pSoldier;
|
||||||
BOOLEAN fPOWSquadSet = FALSE;
|
BOOLEAN fPOWSquadSet = FALSE;
|
||||||
UINT8 ubPOWSquad = 0;
|
UINT8 ubPOWSquad = 0;
|
||||||
@@ -3125,8 +3135,9 @@ void UpdateMercsInSector( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ )
|
|||||||
|
|
||||||
//if( !(gTacticalStatus.uiFlags & LOADING_SAVED_GAME ) )
|
//if( !(gTacticalStatus.uiFlags & LOADING_SAVED_GAME ) )
|
||||||
{
|
{
|
||||||
for ( cnt = 0, pSoldier = MercPtrs[cnt]; cnt < MAX_NUM_SOLDIERS; ++cnt, ++pSoldier )
|
for ( SoldierID cnt = 0; cnt < MAX_NUM_SOLDIERS; ++cnt )
|
||||||
{
|
{
|
||||||
|
pSoldier = cnt;
|
||||||
if ( gfRestoringEnemySoldiersFromTempFile &&
|
if ( gfRestoringEnemySoldiersFromTempFile &&
|
||||||
cnt >= gTacticalStatus.Team[ENEMY_TEAM].bFirstID &&
|
cnt >= gTacticalStatus.Team[ENEMY_TEAM].bFirstID &&
|
||||||
cnt <= gTacticalStatus.Team[CREATURE_TEAM].bLastID )
|
cnt <= gTacticalStatus.Team[CREATURE_TEAM].bLastID )
|
||||||
@@ -3950,7 +3961,6 @@ UINT8 GetStrategicInsertionDataFromAdjacentMoveDirection( UINT8 ubTacticalDirect
|
|||||||
|
|
||||||
void JumpIntoAdjacentSector( UINT8 ubTacticalDirection, UINT8 ubJumpCode, INT32 sAdditionalData )//dnl ch56 151009
|
void JumpIntoAdjacentSector( UINT8 ubTacticalDirection, UINT8 ubJumpCode, INT32 sAdditionalData )//dnl ch56 151009
|
||||||
{
|
{
|
||||||
INT32 cnt;
|
|
||||||
SOLDIERTYPE *pSoldier;
|
SOLDIERTYPE *pSoldier;
|
||||||
SOLDIERTYPE *pValidSoldier = NULL;
|
SOLDIERTYPE *pValidSoldier = NULL;
|
||||||
GROUP *pGroup;
|
GROUP *pGroup;
|
||||||
@@ -3962,17 +3972,18 @@ void JumpIntoAdjacentSector( UINT8 ubTacticalDirection, UINT8 ubJumpCode, INT32
|
|||||||
|
|
||||||
// Set initial selected
|
// Set initial selected
|
||||||
// ATE: moved this towards top...
|
// ATE: moved this towards top...
|
||||||
gubPreferredInitialSelectedGuy = (UINT8)gusSelectedSoldier;
|
gubPreferredInitialSelectedGuy = gusSelectedSoldier;
|
||||||
|
|
||||||
if ( ubJumpCode == JUMP_ALL_LOAD_NEW || ubJumpCode == JUMP_ALL_NO_LOAD )
|
if ( ubJumpCode == JUMP_ALL_LOAD_NEW || ubJumpCode == JUMP_ALL_NO_LOAD )
|
||||||
{
|
{
|
||||||
// TODO: Check flags to see if we can jump!
|
// TODO: Check flags to see if we can jump!
|
||||||
// Move controllable mercs!
|
// Move controllable mercs!
|
||||||
cnt = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
SoldierID cnt = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||||
|
|
||||||
// look for all mercs on the same team,
|
// look for all mercs on the same team,
|
||||||
for ( pSoldier = MercPtrs[cnt]; cnt <= gTacticalStatus.Team[gbPlayerNum].bLastID; cnt++, pSoldier++ )
|
for ( ; cnt <= gTacticalStatus.Team[gbPlayerNum].bLastID; ++cnt )
|
||||||
{
|
{
|
||||||
|
pSoldier = cnt;
|
||||||
// If we are controllable
|
// If we are controllable
|
||||||
if ( OK_CONTROLLABLE_MERC( pSoldier ) && pSoldier->bAssignment == CurrentSquad( ) )
|
if ( OK_CONTROLLABLE_MERC( pSoldier ) && pSoldier->bAssignment == CurrentSquad( ) )
|
||||||
{
|
{
|
||||||
@@ -3993,7 +4004,7 @@ void JumpIntoAdjacentSector( UINT8 ubTacticalDirection, UINT8 ubJumpCode, INT32
|
|||||||
// This guy should always be 1 ) selected and 2 ) close enough to exit sector to leave
|
// This guy should always be 1 ) selected and 2 ) close enough to exit sector to leave
|
||||||
if ( gusSelectedSoldier != NOBODY )
|
if ( gusSelectedSoldier != NOBODY )
|
||||||
{
|
{
|
||||||
pValidSoldier = MercPtrs[gusSelectedSoldier];
|
pValidSoldier = gusSelectedSoldier;
|
||||||
ubDirection = GetInsertionDataFromAdjacentMoveDirection( ubTacticalDirection, sAdditionalData );
|
ubDirection = GetInsertionDataFromAdjacentMoveDirection( ubTacticalDirection, sAdditionalData );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4210,12 +4221,13 @@ void JumpIntoAdjacentSector( UINT8 ubTacticalDirection, UINT8 ubJumpCode, INT32
|
|||||||
void JumpIntoEscapedSector(UINT8 ubTacticalDirection)
|
void JumpIntoEscapedSector(UINT8 ubTacticalDirection)
|
||||||
{
|
{
|
||||||
// Remove any incapacitated mercs from current squads and assign them to new squad
|
// Remove any incapacitated mercs from current squads and assign them to new squad
|
||||||
UINT32 i = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
SoldierID id = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||||
UINT32 const lastID = gTacticalStatus.Team[gbPlayerNum].bLastID;
|
SoldierID const lastID = gTacticalStatus.Team[gbPlayerNum].bLastID;
|
||||||
INT8 currentSquad = -1;
|
INT8 currentSquad = -1;
|
||||||
|
|
||||||
for (SOLDIERTYPE* pSoldier = MercPtrs[i]; i <= lastID; ++i, ++pSoldier)
|
for ( ; id <= lastID; ++id )
|
||||||
{
|
{
|
||||||
|
SOLDIERTYPE *pSoldier = id;
|
||||||
// Are we not active in sector
|
// Are we not active in sector
|
||||||
if (!pSoldier->bActive || !pSoldier->bInSector || pSoldier->stats.bLife >= OKLIFE)
|
if (!pSoldier->bActive || !pSoldier->bInSector || pSoldier->stats.bLife >= OKLIFE)
|
||||||
{
|
{
|
||||||
@@ -4829,7 +4841,6 @@ BOOLEAN SoldierOKForSectorExit( SOLDIERTYPE * pSoldier, INT8 bExitDirection, INT
|
|||||||
//ATE: Returns FALSE if NOBODY is close enough, 1 if ONLY selected guy is and 2 if all on squad are...
|
//ATE: Returns FALSE if NOBODY is close enough, 1 if ONLY selected guy is and 2 if all on squad are...
|
||||||
BOOLEAN OKForSectorExit( INT8 bExitDirection, INT32 usAdditionalData, UINT32 *puiTraverseTimeInMinutes )//dnl ch56 151009
|
BOOLEAN OKForSectorExit( INT8 bExitDirection, INT32 usAdditionalData, UINT32 *puiTraverseTimeInMinutes )//dnl ch56 151009
|
||||||
{
|
{
|
||||||
INT32 cnt;
|
|
||||||
SOLDIERTYPE *pSoldier;
|
SOLDIERTYPE *pSoldier;
|
||||||
BOOLEAN fAtLeastOneMercControllable = FALSE;
|
BOOLEAN fAtLeastOneMercControllable = FALSE;
|
||||||
BOOLEAN fOnlySelectedGuy = FALSE;
|
BOOLEAN fOnlySelectedGuy = FALSE;
|
||||||
@@ -4839,13 +4850,13 @@ BOOLEAN OKForSectorExit( INT8 bExitDirection, INT32 usAdditionalData, UINT32 *pu
|
|||||||
UINT8 ubNumMercs = 0, ubNumEPCs = 0;
|
UINT8 ubNumMercs = 0, ubNumEPCs = 0;
|
||||||
UINT8 ubPlayerControllableMercsInSquad = 0;
|
UINT8 ubPlayerControllableMercsInSquad = 0;
|
||||||
|
|
||||||
if ( gusSelectedSoldier == NOBODY )
|
if ( gusSelectedSoldier >= NOBODY )
|
||||||
{ //must have a selected soldier to be allowed to tactically traverse.
|
{ //must have a selected soldier to be allowed to tactically traverse.
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// anv: vehicles can't use inner exit grids
|
// anv: vehicles can't use inner exit grids
|
||||||
if ( bExitDirection == (-1) && MercPtrs[gusSelectedSoldier]->bAssignment == VEHICLE )
|
if ( bExitDirection == (-1) && gusSelectedSoldier->bAssignment == VEHICLE )
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -4869,14 +4880,15 @@ BOOLEAN OKForSectorExit( INT8 bExitDirection, INT32 usAdditionalData, UINT32 *pu
|
|||||||
gfInvalidTraversal = FALSE;
|
gfInvalidTraversal = FALSE;
|
||||||
gfLoneEPCAttemptingTraversal = FALSE;
|
gfLoneEPCAttemptingTraversal = FALSE;
|
||||||
gubLoneMercAttemptingToAbandonEPCs = 0;
|
gubLoneMercAttemptingToAbandonEPCs = 0;
|
||||||
gbPotentiallyAbandonedEPCSlotID = -1;
|
gbPotentiallyAbandonedEPCSlotID = NOBODY;
|
||||||
|
|
||||||
// Look through all mercs and check if they are within range of east end....
|
// Look through all mercs and check if they are within range of east end....
|
||||||
cnt = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
SoldierID cnt = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||||
|
|
||||||
// look for all mercs on the same team,
|
// look for all mercs on the same team,
|
||||||
for ( pSoldier = MercPtrs[cnt]; cnt <= gTacticalStatus.Team[gbPlayerNum].bLastID; ++cnt, ++pSoldier )
|
for ( ; cnt <= gTacticalStatus.Team[gbPlayerNum].bLastID; ++cnt )
|
||||||
{
|
{
|
||||||
|
pSoldier = cnt;
|
||||||
// If we are controllable
|
// If we are controllable
|
||||||
if ( OK_CONTROLLABLE_MERC( pSoldier ) && (pSoldier->bAssignment == CurrentSquad( ) ||
|
if ( OK_CONTROLLABLE_MERC( pSoldier ) && (pSoldier->bAssignment == CurrentSquad( ) ||
|
||||||
(pSoldier->bAssignment == VEHICLE && pSoldier->iVehicleId != iHelicopterVehicleId && GetSoldierStructureForVehicle( pSoldier->iVehicleId )->bAssignment == CurrentSquad( ))) )
|
(pSoldier->bAssignment == VEHICLE && pSoldier->iVehicleId != iHelicopterVehicleId && GetSoldierStructureForVehicle( pSoldier->iVehicleId )->bAssignment == CurrentSquad( ))) )
|
||||||
@@ -4894,7 +4906,7 @@ BOOLEAN OKForSectorExit( INT8 bExitDirection, INT32 usAdditionalData, UINT32 *pu
|
|||||||
{
|
{
|
||||||
ubNumEPCs++;
|
ubNumEPCs++;
|
||||||
//Also record the EPC's slot ID incase we later build a string using the EPC's name.
|
//Also record the EPC's slot ID incase we later build a string using the EPC's name.
|
||||||
gbPotentiallyAbandonedEPCSlotID = (INT8)cnt;
|
gbPotentiallyAbandonedEPCSlotID = cnt;
|
||||||
if ( AM_A_ROBOT( pSoldier ) && !pSoldier->CanRobotBeControlled( ) )
|
if ( AM_A_ROBOT( pSoldier ) && !pSoldier->CanRobotBeControlled( ) )
|
||||||
{
|
{
|
||||||
gfRobotWithoutControllerAttemptingTraversal = TRUE;
|
gfRobotWithoutControllerAttemptingTraversal = TRUE;
|
||||||
@@ -4959,12 +4971,12 @@ BOOLEAN OKForSectorExit( INT8 bExitDirection, INT32 usAdditionalData, UINT32 *pu
|
|||||||
// If we are here, at least one guy is controllable in this sector, at least he can go!
|
// If we are here, at least one guy is controllable in this sector, at least he can go!
|
||||||
if ( fAtLeastOneMercControllable )
|
if ( fAtLeastOneMercControllable )
|
||||||
{
|
{
|
||||||
ubPlayerControllableMercsInSquad = (UINT8)NumberOfPlayerControllableMercsInSquad( MercPtrs[gusSelectedSoldier]->bAssignment );
|
ubPlayerControllableMercsInSquad = (UINT8)NumberOfPlayerControllableMercsInSquad( gusSelectedSoldier->bAssignment );
|
||||||
if ( fAtLeastOneMercControllable <= ubPlayerControllableMercsInSquad )
|
if ( fAtLeastOneMercControllable <= ubPlayerControllableMercsInSquad )
|
||||||
{ //if the selected merc is an EPC and we can only leave with that merc, then prevent it
|
{ //if the selected merc is an EPC and we can only leave with that merc, then prevent it
|
||||||
//as EPCs aren't allowed to leave by themselves. Instead of restricting this in the
|
//as EPCs aren't allowed to leave by themselves. Instead of restricting this in the
|
||||||
//exiting sector gui, we restrict it by explaining it with a message box.
|
//exiting sector gui, we restrict it by explaining it with a message box.
|
||||||
if ( AM_AN_EPC( MercPtrs[gusSelectedSoldier] ) )
|
if ( AM_AN_EPC( gusSelectedSoldier ) )
|
||||||
{
|
{
|
||||||
if ( AM_A_ROBOT( pSoldier ) && !pSoldier->CanRobotBeControlled( ) )
|
if ( AM_A_ROBOT( pSoldier ) && !pSoldier->CanRobotBeControlled( ) )
|
||||||
{
|
{
|
||||||
@@ -5153,7 +5165,7 @@ void SetSamHackStatus( INT16 sSectorX, INT16 sSectorY, INT8 sStatus )
|
|||||||
|
|
||||||
BOOLEAN CanGoToTacticalInSector( INT16 sX, INT16 sY, UINT8 ubZ )
|
BOOLEAN CanGoToTacticalInSector( INT16 sX, INT16 sY, UINT8 ubZ )
|
||||||
{
|
{
|
||||||
INT32 cnt;
|
SoldierID cnt;
|
||||||
SOLDIERTYPE *pSoldier;
|
SOLDIERTYPE *pSoldier;
|
||||||
|
|
||||||
// if not a valid sector
|
// if not a valid sector
|
||||||
@@ -5166,8 +5178,9 @@ BOOLEAN CanGoToTacticalInSector( INT16 sX, INT16 sY, UINT8 ubZ )
|
|||||||
cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||||
|
|
||||||
// look for all living, fighting mercs on player's team. Robot and EPCs qualify!
|
// look for all living, fighting mercs on player's team. Robot and EPCs qualify!
|
||||||
for ( pSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; cnt++, pSoldier++)
|
for ( ; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++cnt )
|
||||||
{
|
{
|
||||||
|
pSoldier = cnt;
|
||||||
// ARM: now allows loading of sector with all mercs below OKLIFE as long as they're alive
|
// ARM: now allows loading of sector with all mercs below OKLIFE as long as they're alive
|
||||||
if( ( pSoldier->bActive && pSoldier->stats.bLife ) && !( pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE ) &&
|
if( ( pSoldier->bActive && pSoldier->stats.bLife ) && !( pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE ) &&
|
||||||
( pSoldier->bAssignment != IN_TRANSIT ) && ( pSoldier->bAssignment != ASSIGNMENT_POW ) && ( pSoldier->bAssignment != ASSIGNMENT_MINIEVENT ) && ( pSoldier->bAssignment != ASSIGNMENT_REBELCOMMAND ) &&
|
( pSoldier->bAssignment != IN_TRANSIT ) && ( pSoldier->bAssignment != ASSIGNMENT_POW ) && ( pSoldier->bAssignment != ASSIGNMENT_MINIEVENT ) && ( pSoldier->bAssignment != ASSIGNMENT_REBELCOMMAND ) &&
|
||||||
@@ -6426,8 +6439,6 @@ BOOLEAN IsSectorRoad( INT16 sSectorX, INT16 sSectorY )
|
|||||||
|
|
||||||
BOOLEAN HandleDefiniteUnloadingOfWorld( UINT8 ubUnloadCode )
|
BOOLEAN HandleDefiniteUnloadingOfWorld( UINT8 ubUnloadCode )
|
||||||
{
|
{
|
||||||
INT32 i;
|
|
||||||
|
|
||||||
// clear tactical queue
|
// clear tactical queue
|
||||||
ClearEventQueue( );
|
ClearEventQueue( );
|
||||||
|
|
||||||
@@ -6489,11 +6500,12 @@ BOOLEAN HandleDefiniteUnloadingOfWorld( UINT8 ubUnloadCode )
|
|||||||
|
|
||||||
//Setup the tactical existance of the current soldier.
|
//Setup the tactical existance of the current soldier.
|
||||||
//@@@Evaluate
|
//@@@Evaluate
|
||||||
for ( i = gTacticalStatus.Team[CIV_TEAM].bFirstID; i <= gTacticalStatus.Team[CIV_TEAM].bLastID; i++ )
|
for ( SoldierID i = gTacticalStatus.Team[CIV_TEAM].bFirstID; i <= gTacticalStatus.Team[CIV_TEAM].bLastID; ++i )
|
||||||
{
|
{
|
||||||
if ( MercPtrs[i]->bActive && MercPtrs[i]->bInSector )
|
SOLDIERTYPE *pSoldier = i;
|
||||||
|
if ( pSoldier->bActive && pSoldier->bInSector )
|
||||||
{
|
{
|
||||||
SetupProfileInsertionDataForSoldier( MercPtrs[i] );
|
SetupProfileInsertionDataForSoldier( pSoldier );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6509,21 +6521,23 @@ BOOLEAN HandlePotentialBringUpAutoresolveToFinishBattle( int pSectorX, int pSect
|
|||||||
{
|
{
|
||||||
//We don't have mercs in the sector. Now, we check to see if there are BOTH enemies and militia. If both
|
//We don't have mercs in the sector. Now, we check to see if there are BOTH enemies and militia. If both
|
||||||
//co-exist in the sector, then make them fight for control of the sector via autoresolve.
|
//co-exist in the sector, then make them fight for control of the sector via autoresolve.
|
||||||
for ( int i = gTacticalStatus.Team[ENEMY_TEAM].bFirstID; i <= gTacticalStatus.Team[CREATURE_TEAM].bLastID; i++ )
|
for ( SoldierID i = gTacticalStatus.Team[ENEMY_TEAM].bFirstID; i <= gTacticalStatus.Team[CREATURE_TEAM].bLastID; ++i )
|
||||||
{
|
{
|
||||||
if ( MercPtrs[i]->bActive && MercPtrs[i]->stats.bLife )
|
SOLDIERTYPE *pEnemy = i;
|
||||||
|
if ( pEnemy->bActive && pEnemy->stats.bLife )
|
||||||
{
|
{
|
||||||
if ( MercPtrs[i]->sSectorX == pSectorX &&
|
if ( pEnemy->sSectorX == pSectorX &&
|
||||||
MercPtrs[i]->sSectorY == pSectorY &&
|
pEnemy->sSectorY == pSectorY &&
|
||||||
MercPtrs[i]->bSectorZ == pSectorZ )
|
pEnemy->bSectorZ == pSectorZ )
|
||||||
{ //We have enemies, now look for militia!
|
{ //We have enemies, now look for militia!
|
||||||
for ( i = gTacticalStatus.Team[MILITIA_TEAM].bFirstID; i <= gTacticalStatus.Team[MILITIA_TEAM].bLastID; i++ )
|
for ( SoldierID j = gTacticalStatus.Team[MILITIA_TEAM].bFirstID; j <= gTacticalStatus.Team[MILITIA_TEAM].bLastID; ++j )
|
||||||
{
|
{
|
||||||
if ( MercPtrs[i]->bActive && MercPtrs[i]->stats.bLife && MercPtrs[i]->bSide == OUR_TEAM )
|
SOLDIERTYPE *pMilitia = j;
|
||||||
|
if ( pMilitia->bActive && pMilitia->stats.bLife && pMilitia->bSide == OUR_TEAM )
|
||||||
{
|
{
|
||||||
if ( MercPtrs[i]->sSectorX == pSectorX &&
|
if ( pMilitia->sSectorX == pSectorX &&
|
||||||
MercPtrs[i]->sSectorY == pSectorY &&
|
pMilitia->sSectorY == pSectorY &&
|
||||||
MercPtrs[i]->bSectorZ == pSectorZ )
|
pMilitia->bSectorZ == pSectorZ )
|
||||||
{ //We have militia and enemies and no mercs! Let's finish this battle in autoresolve.
|
{ //We have militia and enemies and no mercs! Let's finish this battle in autoresolve.
|
||||||
gfEnteringMapScreen = TRUE;
|
gfEnteringMapScreen = TRUE;
|
||||||
gfEnteringMapScreenToEnterPreBattleInterface = TRUE;
|
gfEnteringMapScreenToEnterPreBattleInterface = TRUE;
|
||||||
@@ -6560,7 +6574,6 @@ BOOLEAN HandlePotentialBringUpAutoresolveToFinishBattle( int pSectorX, int pSect
|
|||||||
|
|
||||||
BOOLEAN CheckAndHandleUnloadingOfCurrentWorld( )
|
BOOLEAN CheckAndHandleUnloadingOfCurrentWorld( )
|
||||||
{
|
{
|
||||||
INT32 i;
|
|
||||||
INT16 sBattleSectorX, sBattleSectorY, sBattleSectorZ;
|
INT16 sBattleSectorX, sBattleSectorY, sBattleSectorZ;
|
||||||
|
|
||||||
//Don't bother checking this if we don't have a world loaded.
|
//Don't bother checking this if we don't have a world loaded.
|
||||||
@@ -6585,16 +6598,17 @@ BOOLEAN CheckAndHandleUnloadingOfCurrentWorld( )
|
|||||||
{ //The user has decided to let the game autoresolve the current battle.
|
{ //The user has decided to let the game autoresolve the current battle.
|
||||||
if ( gWorldSectorX == sBattleSectorX && gWorldSectorY == sBattleSectorY && gbWorldSectorZ == sBattleSectorZ )
|
if ( gWorldSectorX == sBattleSectorX && gWorldSectorY == sBattleSectorY && gbWorldSectorZ == sBattleSectorZ )
|
||||||
{
|
{
|
||||||
for ( i = gTacticalStatus.Team[OUR_TEAM].bFirstID; i <= gTacticalStatus.Team[OUR_TEAM].bLastID; i++ )
|
for ( SoldierID i = gTacticalStatus.Team[OUR_TEAM].bFirstID; i <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++i )
|
||||||
{ //If we have a live and valid soldier
|
{ //If we have a live and valid soldier
|
||||||
if ( MercPtrs[i]->bActive && MercPtrs[i]->stats.bLife && !MercPtrs[i]->flags.fBetweenSectors && !(MercPtrs[i]->flags.uiStatusFlags & SOLDIER_VEHICLE) && !AM_A_ROBOT( MercPtrs[i] ) && !AM_AN_EPC( MercPtrs[i] ) )
|
SOLDIERTYPE *pSoldier = i;
|
||||||
|
if ( pSoldier->bActive && pSoldier->stats.bLife && !pSoldier->flags.fBetweenSectors && !(pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE) && !AM_A_ROBOT( pSoldier ) && !AM_AN_EPC( pSoldier ) )
|
||||||
{
|
{
|
||||||
if ( MercPtrs[i]->sSectorX == gWorldSectorX &&
|
if ( pSoldier->sSectorX == gWorldSectorX &&
|
||||||
MercPtrs[i]->sSectorY == gWorldSectorY &&
|
pSoldier->sSectorY == gWorldSectorY &&
|
||||||
MercPtrs[i]->bSectorZ == gbWorldSectorZ )
|
pSoldier->bSectorZ == gbWorldSectorZ )
|
||||||
{
|
{
|
||||||
MercPtrs[i]->RemoveSoldierFromGridNo( );
|
pSoldier->RemoveSoldierFromGridNo( );
|
||||||
InitSoldierOppList( MercPtrs[i] );
|
InitSoldierOppList( pSoldier );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6602,13 +6616,14 @@ BOOLEAN CheckAndHandleUnloadingOfCurrentWorld( )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ //Check and see if we have any live mercs in the sector.
|
{ //Check and see if we have any live mercs in the sector.
|
||||||
for ( i = gTacticalStatus.Team[OUR_TEAM].bFirstID; i <= gTacticalStatus.Team[OUR_TEAM].bLastID; i++ )
|
for ( SoldierID i = gTacticalStatus.Team[OUR_TEAM].bFirstID; i <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++i )
|
||||||
{ //If we have a live and valid soldier
|
{ //If we have a live and valid soldier
|
||||||
if ( MercPtrs[i]->bActive && MercPtrs[i]->stats.bLife && !MercPtrs[i]->flags.fBetweenSectors && MercPtrs[i]->bInSector && !(MercPtrs[i]->flags.uiStatusFlags & SOLDIER_VEHICLE) && !AM_A_ROBOT( MercPtrs[i] ) && !AM_AN_EPC( MercPtrs[i] ) )
|
SOLDIERTYPE *pSoldier = i;
|
||||||
|
if ( pSoldier->bActive && pSoldier->stats.bLife && !pSoldier->flags.fBetweenSectors && pSoldier->bInSector && !(pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE) && !AM_A_ROBOT( pSoldier ) && !AM_AN_EPC( pSoldier ) )
|
||||||
{
|
{
|
||||||
if ( MercPtrs[i]->sSectorX == gWorldSectorX &&
|
if ( pSoldier->sSectorX == gWorldSectorX &&
|
||||||
MercPtrs[i]->sSectorY == gWorldSectorY &&
|
pSoldier->sSectorY == gWorldSectorY &&
|
||||||
MercPtrs[i]->bSectorZ == gbWorldSectorZ )
|
pSoldier->bSectorZ == gbWorldSectorZ )
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -7530,16 +7545,15 @@ void HandleMovingTheEnemiesToBeNearPlayerWhenEnteringComplexMap( )
|
|||||||
//if the player made a 'noise' going through the gate at the end of the tunnel sector
|
//if the player made a 'noise' going through the gate at the end of the tunnel sector
|
||||||
if ( gJa25SaveStruct.uiJa25GeneralFlags & JA_GF__DID_PLAYER_MAKE_SOUND_GOING_THROUGH_TUNNEL_GATE )
|
if ( gJa25SaveStruct.uiJa25GeneralFlags & JA_GF__DID_PLAYER_MAKE_SOUND_GOING_THROUGH_TUNNEL_GATE )
|
||||||
{
|
{
|
||||||
UINT8 cnt;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
//Move some of the enemies to be 'near' them player when the enter the room
|
//Move some of the enemies to be 'near' them player when the enter the room
|
||||||
//
|
//
|
||||||
|
|
||||||
// Loop through the list and move some of the enemies
|
// Loop through the list and move some of the enemies
|
||||||
cnt = gTacticalStatus.Team[ENEMY_TEAM].bFirstID;
|
SoldierID cnt = gTacticalStatus.Team[ENEMY_TEAM].bFirstID;
|
||||||
for ( pSoldier = MercPtrs[cnt]; cnt <= gTacticalStatus.Team[ENEMY_TEAM].bLastID; cnt++, pSoldier++ )
|
for ( ; cnt <= gTacticalStatus.Team[ENEMY_TEAM].bLastID; ++cnt)
|
||||||
{
|
{
|
||||||
|
pSoldier = cnt;
|
||||||
//if the soldier is active,
|
//if the soldier is active,
|
||||||
if ( pSoldier->bActive )
|
if ( pSoldier->bActive )
|
||||||
{
|
{
|
||||||
@@ -7570,8 +7584,9 @@ void HandleMovingTheEnemiesToBeNearPlayerWhenEnteringComplexMap( )
|
|||||||
while ( ubNumEnemiesMoved < 3 )
|
while ( ubNumEnemiesMoved < 3 )
|
||||||
{
|
{
|
||||||
cnt = gTacticalStatus.Team[ENEMY_TEAM].bFirstID;
|
cnt = gTacticalStatus.Team[ENEMY_TEAM].bFirstID;
|
||||||
for ( pSoldier = MercPtrs[cnt]; cnt <= gTacticalStatus.Team[ENEMY_TEAM].bLastID; cnt++, pSoldier++ )
|
for ( ; cnt <= gTacticalStatus.Team[ENEMY_TEAM].bLastID; ++cnt )
|
||||||
{
|
{
|
||||||
|
pSoldier = cnt;
|
||||||
//if the soldier is active,
|
//if the soldier is active,
|
||||||
if ( pSoldier->bActive && pSoldier->sGridNo != 15705 && pSoldier->sGridNo != 15712 && pSoldier->sGridNo != 15233 )
|
if ( pSoldier->bActive && pSoldier->sGridNo != 15705 && pSoldier->sGridNo != 15712 && pSoldier->sGridNo != 15233 )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -210,11 +210,11 @@ BOOLEAN EscapeDirectionIsValid( INT8 * pbDirection );
|
|||||||
bool IsEscapeDirectionValid(WorldDirections pbDirection);
|
bool IsEscapeDirectionValid(WorldDirections pbDirection);
|
||||||
//Used for determining the type of error message that comes up when you can't traverse to
|
//Used for determining the type of error message that comes up when you can't traverse to
|
||||||
//an adjacent sector. THESE VALUES DO NOT NEED TO BE SAVED!
|
//an adjacent sector. THESE VALUES DO NOT NEED TO BE SAVED!
|
||||||
extern BOOLEAN gfInvalidTraversal;
|
extern BOOLEAN gfInvalidTraversal;
|
||||||
extern BOOLEAN gfLoneEPCAttemptingTraversal;
|
extern BOOLEAN gfLoneEPCAttemptingTraversal;
|
||||||
extern BOOLEAN gfRobotWithoutControllerAttemptingTraversal;
|
extern BOOLEAN gfRobotWithoutControllerAttemptingTraversal;
|
||||||
extern UINT8 gubLoneMercAttemptingToAbandonEPCs;
|
extern UINT8 gubLoneMercAttemptingToAbandonEPCs;
|
||||||
extern INT8 gbPotentiallyAbandonedEPCSlotID;
|
extern SoldierID gbPotentiallyAbandonedEPCSlotID;
|
||||||
|
|
||||||
extern INT8 gbGreenToElitePromotions;
|
extern INT8 gbGreenToElitePromotions;
|
||||||
extern INT8 gbGreenToRegPromotions;
|
extern INT8 gbGreenToRegPromotions;
|
||||||
|
|||||||
+40
-38
@@ -79,7 +79,7 @@ typedef struct
|
|||||||
{
|
{
|
||||||
BOOLEAN fInAirRaid;
|
BOOLEAN fInAirRaid;
|
||||||
BOOLEAN fAirRaidScheduled;
|
BOOLEAN fAirRaidScheduled;
|
||||||
UINT8 ubAirRaidMode;
|
UINT8 ubAirRaidMode;
|
||||||
UINT32 uiSoundSample;
|
UINT32 uiSoundSample;
|
||||||
UINT32 uiRaidLastUpdate;
|
UINT32 uiRaidLastUpdate;
|
||||||
BOOLEAN fFadingRaidIn;
|
BOOLEAN fFadingRaidIn;
|
||||||
@@ -87,32 +87,32 @@ typedef struct
|
|||||||
INT8 bNumDives;
|
INT8 bNumDives;
|
||||||
INT8 bMaxDives;
|
INT8 bMaxDives;
|
||||||
BOOLEAN fFadingRaidOut;
|
BOOLEAN fFadingRaidOut;
|
||||||
INT16 sDiveX;
|
INT16 sDiveX;
|
||||||
INT16 sDiveY;
|
INT16 sDiveY;
|
||||||
INT16 sDiveTargetLocation;
|
INT16 sDiveTargetLocation;
|
||||||
UINT8 ubDiveDirection;
|
UINT8 ubDiveDirection;
|
||||||
INT16 sNumGridNosMoved;
|
INT16 sNumGridNosMoved;
|
||||||
INT32 iNumTurnsSinceLastDive;
|
INT32 iNumTurnsSinceLastDive;
|
||||||
INT32 iNumTurnsSinceDiveStarted;
|
INT32 iNumTurnsSinceDiveStarted;
|
||||||
INT32 iNumGridNosMovedThisTurn;
|
INT32 iNumGridNosMovedThisTurn;
|
||||||
BOOLEAN fAirRaidHasHadTurn;
|
BOOLEAN fAirRaidHasHadTurn;
|
||||||
UINT8 ubBeginTeamTurn;
|
UINT8 ubBeginTeamTurn;
|
||||||
BOOLEAN fHaveTBBatton;
|
BOOLEAN fHaveTBBatton;
|
||||||
AIR_RAID_DEFINITION AirRaidDef;
|
AIR_RAID_DEFINITION AirRaidDef;
|
||||||
INT16 sRaidSoldierID;
|
SoldierID sRaidSoldierID;
|
||||||
|
|
||||||
INT16 sNotLocatedYet;
|
INT16 sNotLocatedYet;
|
||||||
INT32 iNumFrames;
|
INT32 iNumFrames;
|
||||||
|
|
||||||
INT8 bLevel;
|
INT8 bLevel;
|
||||||
INT8 bTeam;
|
INT8 bTeam;
|
||||||
INT8 bSide;
|
INT8 bSide;
|
||||||
UINT8 ubAttackerID;
|
SoldierID ubAttackerID;
|
||||||
UINT16 usAttackingWeapon;
|
UINT16 usAttackingWeapon;
|
||||||
FLOAT dXPos;
|
FLOAT dXPos;
|
||||||
FLOAT dYPos;
|
FLOAT dYPos;
|
||||||
INT16 sX;
|
INT16 sX;
|
||||||
INT16 sY;
|
INT16 sY;
|
||||||
INT32 sGridNo;
|
INT32 sGridNo;
|
||||||
|
|
||||||
|
|
||||||
@@ -187,7 +187,6 @@ void ScheduleAirRaid( AIR_RAID_DEFINITION *pAirRaidDef )
|
|||||||
|
|
||||||
BOOLEAN BeginAirRaid( )
|
BOOLEAN BeginAirRaid( )
|
||||||
{
|
{
|
||||||
INT32 cnt=0;
|
|
||||||
BOOLEAN fOK = FALSE;
|
BOOLEAN fOK = FALSE;
|
||||||
SOLDIERTYPE *pSoldier;
|
SOLDIERTYPE *pSoldier;
|
||||||
gfQuoteSaid = FALSE;
|
gfQuoteSaid = FALSE;
|
||||||
@@ -215,9 +214,10 @@ BOOLEAN BeginAirRaid( )
|
|||||||
// Do we have any guys in here...
|
// Do we have any guys in here...
|
||||||
|
|
||||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("BeginAirRaid: check for mercs: first id = %d, last id = %d ",gTacticalStatus.Team[ gbPlayerNum ].bFirstID, gTacticalStatus.Team[ gbPlayerNum ].bLastID));
|
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("BeginAirRaid: check for mercs: first id = %d, last id = %d ",gTacticalStatus.Team[ gbPlayerNum ].bFirstID, gTacticalStatus.Team[ gbPlayerNum ].bLastID));
|
||||||
cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
SoldierID cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||||
for ( cnt = 0, pSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; cnt++, pSoldier++)
|
for ( ; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++cnt )
|
||||||
{
|
{
|
||||||
|
pSoldier = cnt;
|
||||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("BeginAirRaid: soldier id = %d, active = %d",pSoldier->ubID,pSoldier->bActive));
|
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("BeginAirRaid: soldier id = %d, active = %d",pSoldier->ubID,pSoldier->bActive));
|
||||||
if ( pSoldier->bActive )
|
if ( pSoldier->bActive )
|
||||||
{
|
{
|
||||||
@@ -305,27 +305,27 @@ BOOLEAN BeginAirRaid( )
|
|||||||
|
|
||||||
INT32 PickLocationNearAnyMercInSector( )
|
INT32 PickLocationNearAnyMercInSector( )
|
||||||
{
|
{
|
||||||
UINT8 ubMercsInSector[ 20 ] = { 0 };
|
UINT16 ubMercsInSector[ 20 ] = { 0 };
|
||||||
UINT8 ubNumMercs = 0;
|
UINT16 ubNumMercs = 0;
|
||||||
UINT8 ubChosenMerc;
|
UINT16 ubChosenMerc;
|
||||||
SOLDIERTYPE *pTeamSoldier;
|
SOLDIERTYPE *pTeamSoldier;
|
||||||
INT32 cnt=0;
|
|
||||||
|
|
||||||
// Loop through all our guys and randomly say one from someone in our sector
|
// Loop through all our guys and randomly say one from someone in our sector
|
||||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,"PickLocationNearAnyMercInSector");
|
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,"PickLocationNearAnyMercInSector");
|
||||||
|
|
||||||
// set up soldier ptr as first element in mercptrs list
|
// set up soldier ptr as first element in mercptrs list
|
||||||
cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
SoldierID cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||||
|
|
||||||
// run through list
|
// run through list
|
||||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("PickLocationNearAnyMercInSector: total guys = %d", gTacticalStatus.Team[ gbPlayerNum ].bLastID));
|
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("PickLocationNearAnyMercInSector: total guys = %d", gTacticalStatus.Team[ gbPlayerNum ].bLastID));
|
||||||
for ( pTeamSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; cnt++,pTeamSoldier++ )
|
for ( ; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++cnt )
|
||||||
{
|
{
|
||||||
|
pTeamSoldier = cnt;
|
||||||
// Add guy if he's a candidate...
|
// Add guy if he's a candidate...
|
||||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("PickLocationNearAnyMercInSector: looping %d",cnt));
|
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("PickLocationNearAnyMercInSector: looping %d",cnt));
|
||||||
if ( OK_INSECTOR_MERC( pTeamSoldier ) )
|
if ( OK_INSECTOR_MERC( pTeamSoldier ) )
|
||||||
{
|
{
|
||||||
ubMercsInSector[ ubNumMercs ] = (UINT8)cnt;
|
ubMercsInSector[ ubNumMercs ] = (UINT16)cnt;
|
||||||
ubNumMercs++;
|
ubNumMercs++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -334,7 +334,7 @@ INT32 PickLocationNearAnyMercInSector( )
|
|||||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("PickLocationNearAnyMercInSector: number of guys %d",ubNumMercs));
|
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("PickLocationNearAnyMercInSector: number of guys %d",ubNumMercs));
|
||||||
if ( ubNumMercs > 0 )
|
if ( ubNumMercs > 0 )
|
||||||
{
|
{
|
||||||
ubChosenMerc = (UINT8)Random( ubNumMercs );
|
ubChosenMerc = (UINT16)Random( ubNumMercs );
|
||||||
|
|
||||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("PickLocationNearAnyMercInSector: chosen guy = %d",ubChosenMerc));
|
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("PickLocationNearAnyMercInSector: chosen guy = %d",ubChosenMerc));
|
||||||
return( MercPtrs[ ubMercsInSector[ ubChosenMerc ] ]->sGridNo );
|
return( MercPtrs[ ubMercsInSector[ ubChosenMerc ] ]->sGridNo );
|
||||||
@@ -1057,9 +1057,10 @@ void HandleAirRaid( )
|
|||||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("HandleAirRaid: check for mercs: first id = %d, last id = %d ",gTacticalStatus.Team[ gbPlayerNum ].bFirstID, gTacticalStatus.Team[ gbPlayerNum ].bLastID));
|
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("HandleAirRaid: check for mercs: first id = %d, last id = %d ",gTacticalStatus.Team[ gbPlayerNum ].bFirstID, gTacticalStatus.Team[ gbPlayerNum ].bLastID));
|
||||||
SOLDIERTYPE * pSoldier;
|
SOLDIERTYPE * pSoldier;
|
||||||
BOOLEAN fOK = FALSE;
|
BOOLEAN fOK = FALSE;
|
||||||
int cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
SoldierID cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||||
for ( cnt = 0, pSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; cnt++, pSoldier++)
|
for ( ; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++cnt )
|
||||||
{
|
{
|
||||||
|
pSoldier = cnt;
|
||||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("HandleAirRaid: soldier id = %d, active = %d",pSoldier->ubID,pSoldier->bActive));
|
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("HandleAirRaid: soldier id = %d, active = %d",pSoldier->ubID,pSoldier->bActive));
|
||||||
if ( pSoldier->bActive )
|
if ( pSoldier->bActive )
|
||||||
{
|
{
|
||||||
@@ -1349,7 +1350,7 @@ BOOLEAN SaveAirRaidInfoToSaveGameFile( HWFILE hFile )
|
|||||||
//// sAirRaidSaveStruct.sRaidSoldierID = gpRaidSoldier->ubID;
|
//// sAirRaidSaveStruct.sRaidSoldierID = gpRaidSoldier->ubID;
|
||||||
// }
|
// }
|
||||||
// else
|
// else
|
||||||
sAirRaidSaveStruct.sRaidSoldierID = -1;
|
sAirRaidSaveStruct.sRaidSoldierID = NOBODY;
|
||||||
|
|
||||||
|
|
||||||
memcpy( &sAirRaidSaveStruct.AirRaidDef, &gAirRaidDef, sizeof( AIR_RAID_DEFINITION ) );
|
memcpy( &sAirRaidSaveStruct.AirRaidDef, &gAirRaidDef, sizeof( AIR_RAID_DEFINITION ) );
|
||||||
@@ -1407,9 +1408,9 @@ BOOLEAN LoadAirRaidInfoFromSaveGameFile( HWFILE hFile )
|
|||||||
giNumFrames = sAirRaidSaveStruct.iNumFrames;
|
giNumFrames = sAirRaidSaveStruct.iNumFrames;
|
||||||
|
|
||||||
|
|
||||||
if( sAirRaidSaveStruct.sRaidSoldierID != -1 )
|
if( sAirRaidSaveStruct.sRaidSoldierID != NOBODY )
|
||||||
{
|
{
|
||||||
gpRaidSoldier = &Menptr[ sAirRaidSaveStruct.sRaidSoldierID ];
|
gpRaidSoldier = sAirRaidSaveStruct.sRaidSoldierID;
|
||||||
|
|
||||||
gpRaidSoldier->pathing.bLevel = sAirRaidSaveStruct.bLevel;
|
gpRaidSoldier->pathing.bLevel = sAirRaidSaveStruct.bLevel;
|
||||||
gpRaidSoldier->bTeam = sAirRaidSaveStruct.bTeam;
|
gpRaidSoldier->bTeam = sAirRaidSaveStruct.bTeam;
|
||||||
@@ -1447,12 +1448,12 @@ void EndAirRaid( )
|
|||||||
if ( !gTacticalStatus.Team[ ENEMY_TEAM ].bTeamActive && !gTacticalStatus.Team[ CREATURE_TEAM ].bTeamActive )
|
if ( !gTacticalStatus.Team[ ENEMY_TEAM ].bTeamActive && !gTacticalStatus.Team[ CREATURE_TEAM ].bTeamActive )
|
||||||
{
|
{
|
||||||
SOLDIERTYPE * pTeamSoldier;
|
SOLDIERTYPE * pTeamSoldier;
|
||||||
INT32 cnt;
|
|
||||||
|
|
||||||
// Loop through all militia and restore them to peaceful status
|
// Loop through all militia and restore them to peaceful status
|
||||||
cnt = gTacticalStatus.Team[ MILITIA_TEAM ].bFirstID;
|
SoldierID cnt = gTacticalStatus.Team[ MILITIA_TEAM ].bFirstID;
|
||||||
for ( pTeamSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ MILITIA_TEAM ].bLastID; cnt++,pTeamSoldier++)
|
for ( ; cnt <= gTacticalStatus.Team[ MILITIA_TEAM ].bLastID; ++cnt )
|
||||||
{
|
{
|
||||||
|
pTeamSoldier = cnt;
|
||||||
if ( pTeamSoldier->bActive && pTeamSoldier->bInSector )
|
if ( pTeamSoldier->bActive && pTeamSoldier->bInSector )
|
||||||
{
|
{
|
||||||
pTeamSoldier->aiData.bAlertStatus = STATUS_GREEN;
|
pTeamSoldier->aiData.bAlertStatus = STATUS_GREEN;
|
||||||
@@ -1462,8 +1463,9 @@ void EndAirRaid( )
|
|||||||
|
|
||||||
cnt = gTacticalStatus.Team[ CIV_TEAM ].bFirstID;
|
cnt = gTacticalStatus.Team[ CIV_TEAM ].bFirstID;
|
||||||
// Loop through all civs and restore them to peaceful status
|
// Loop through all civs and restore them to peaceful status
|
||||||
for ( pTeamSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ CIV_TEAM ].bLastID; cnt++,pTeamSoldier++)
|
for ( ; cnt <= gTacticalStatus.Team[ CIV_TEAM ].bLastID; ++cnt )
|
||||||
{
|
{
|
||||||
|
pTeamSoldier = cnt;
|
||||||
if ( pTeamSoldier->bActive && pTeamSoldier->bInSector )
|
if ( pTeamSoldier->bActive && pTeamSoldier->bInSector )
|
||||||
{
|
{
|
||||||
pTeamSoldier->aiData.bAlertStatus = STATUS_GREEN;
|
pTeamSoldier->aiData.bAlertStatus = STATUS_GREEN;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user